mirror of
https://github.com/Ladebeze66/projetcbaollm.git
synced 2025-12-18 02:07:50 +01:00
3857 lines
4.4 MiB
3857 lines
4.4 MiB
import{h as oz,g as sz}from"./index-C7PS0jJm.js";import"./svelte/svelte.js";var MT={exports:{}};(function(Yf){var vh={};(function(mf,Lf){Yf.exports?Yf.exports=Lf():mf.moduleName=Lf()})(typeof self<"u"?self:oz,()=>{var mf=(()=>{var Lf=Object.defineProperty,cg=Object.defineProperties,hg=Object.getOwnPropertyDescriptor,n0=Object.getOwnPropertyDescriptors,yp=Object.getOwnPropertyNames,a0=Object.getOwnPropertySymbols,Em=Object.prototype.hasOwnProperty,Ey=Object.prototype.propertyIsEnumerable,Pm=(X,V,c)=>V in X?Lf(X,V,{enumerable:!0,configurable:!0,writable:!0,value:c}):X[V]=c,hu=(X,V)=>{for(var c in V||(V={}))Em.call(V,c)&&Pm(X,c,V[c]);if(a0)for(var c of a0(V))Ey.call(V,c)&&Pm(X,c,V[c]);return X},Py=(X,V)=>cg(X,n0(V)),bl=(X,V)=>()=>(X&&(V=X(X=0)),V),Vt=(X,V)=>()=>(V||X((V={exports:{}}).exports,V),V.exports),ET=(X,V)=>{for(var c in V)Lf(X,c,{get:V[c],enumerable:!0})},PT=(X,V,c,g)=>{if(V&&typeof V=="object"||typeof V=="function")for(let E of yp(V))!Em.call(X,E)&&E!==c&&Lf(X,E,{get:()=>V[E],enumerable:!(g=hg(V,E))||g.enumerable});return X},xd=X=>PT(Lf({},"__esModule",{value:!0}),X),Iy=Vt(X=>{X.version="3.0.0"}),IT=Vt((X,V)=>{(function(c,g,E){g[c]=g[c]||E(),typeof V<"u"&&V.exports&&(V.exports=g[c])})("Promise",typeof window<"u"?window:X,function(){var c,g,E,A=Object.prototype.toString,t=typeof setImmediate<"u"?function(y){return setImmediate(y)}:setTimeout;try{Object.defineProperty({},"x",{}),c=function(y,l,x,b){return Object.defineProperty(y,l,{value:x,writable:!0,configurable:b!==!1})}}catch{c=function(l,x,b){return l[x]=b,l}}E=function(){var y,l,x;function b(S,T){this.fn=S,this.self=T,this.next=void 0}return{add:function(S,T){x=new b(S,T),l?l.next=x:y=x,l=x,x=void 0},drain:function(){var S=y;for(y=l=g=void 0;S;)S.fn.call(S.self),S=S.next}}}();function e(y,l){E.add(y,l),g||(g=t(E.drain))}function r(y){var l,x=typeof y;return y!=null&&(x=="object"||x=="function")&&(l=y.then),typeof l=="function"?l:!1}function i(){for(var y=0;y<this.chain.length;y++)n(this,this.state===1?this.chain[y].success:this.chain[y].failure,this.chain[y]);this.chain.length=0}function n(y,l,x){var b,S;try{l===!1?x.reject(y.msg):(l===!0?b=y.msg:b=l.call(void 0,y.msg),b===x.promise?x.reject(TypeError("Promise-chain cycle")):(S=r(b))?S.call(b,x.resolve,x.reject):x.resolve(b))}catch(T){x.reject(T)}}function o(y){var l,x=this;if(!x.triggered){x.triggered=!0,x.def&&(x=x.def);try{(l=r(y))?e(function(){var b=new h(x);try{l.call(y,function(){o.apply(b,arguments)},function(){a.apply(b,arguments)})}catch(S){a.call(b,S)}}):(x.msg=y,x.state=1,x.chain.length>0&&e(i,x))}catch(b){a.call(new h(x),b)}}}function a(y){var l=this;l.triggered||(l.triggered=!0,l.def&&(l=l.def),l.msg=y,l.state=2,l.chain.length>0&&e(i,l))}function s(y,l,x,b){for(var S=0;S<l.length;S++)(function(T){y.resolve(l[T]).then(function(M){x(T,M)},b)})(S)}function h(y){this.def=y,this.triggered=!1}function v(y){this.promise=y,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function m(y){if(typeof y!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var l=new v(this);this.then=function(x,b){var S={success:typeof x=="function"?x:!0,failure:typeof b=="function"?b:!1};return S.promise=new this.constructor(function(T,M){if(typeof T!="function"||typeof M!="function")throw TypeError("Not a function");S.resolve=T,S.reject=M}),l.chain.push(S),l.state!==0&&e(i,l),S.promise},this.catch=function(x){return this.then(void 0,x)};try{y.call(void 0,function(x){o.call(l,x)},function(x){a.call(l,x)})}catch(x){a.call(l,x)}}var p=c({},"constructor",m,!1);return m.prototype=p,c(p,"__NPO__",0,!1),c(m,"resolve",function(y){var l=this;return y&&typeof y=="object"&&y.__NPO__===1?y:new l(function(x,b){if(typeof x!="function"||typeof b!="function")throw TypeError("Not a function");x(y)})}),c(m,"reject",function(y){return new this(function(l,x){if(typeof l!="function"||typeof x!="function")throw TypeError("Not a function");x(y)})}),c(m,"all",function(y){var l=this;return A.call(y)!="[object Array]"?l.reject(TypeError("Not an array")):y.length===0?l.resolve([]):new l(function(x,b){if(typeof x!="function"||typeof b!="function")throw TypeError("Not a function");var S=y.length,T=Array(S),M=0;s(l,y,function(w,u){T[w]=u,++M===S&&x(T)},b)})}),c(m,"race",function(y){var l=this;return A.call(y)!="[object Array]"?l.reject(TypeError("Not an array")):new l(function(x,b){if(typeof x!="function"||typeof b!="function")throw TypeError("Not a function");s(l,y,function(S,T){x(T)},b)})}),m})}),Ai=Vt((X,V)=>{(function(){var c={version:"3.8.2"},g=[].slice,E=function(mt){return g.call(mt)},A=self.document;function t(mt){return mt&&(mt.ownerDocument||mt.document||mt).documentElement}function e(mt){return mt&&(mt.ownerDocument&&mt.ownerDocument.defaultView||mt.document&&mt||mt.defaultView)}if(A)try{E(A.documentElement.childNodes)[0].nodeType}catch{E=function(St){for(var Xt=St.length,se=new Array(Xt);Xt--;)se[Xt]=St[Xt];return se}}if(Date.now||(Date.now=function(){return+new Date}),A)try{A.createElement("DIV").style.setProperty("opacity",0,"")}catch{var r=this.Element.prototype,i=r.setAttribute,n=r.setAttributeNS,o=this.CSSStyleDeclaration.prototype,a=o.setProperty;r.setAttribute=function(St,Xt){i.call(this,St,Xt+"")},r.setAttributeNS=function(St,Xt,se){n.call(this,St,Xt,se+"")},o.setProperty=function(St,Xt,se){a.call(this,St,Xt+"",se)}}c.ascending=s;function s(mt,St){return mt<St?-1:mt>St?1:mt>=St?0:NaN}c.descending=function(mt,St){return St<mt?-1:St>mt?1:St>=mt?0:NaN},c.min=function(mt,St){var Xt=-1,se=mt.length,fe,ve;if(arguments.length===1){for(;++Xt<se;)if((ve=mt[Xt])!=null&&ve>=ve){fe=ve;break}for(;++Xt<se;)(ve=mt[Xt])!=null&&fe>ve&&(fe=ve)}else{for(;++Xt<se;)if((ve=St.call(mt,mt[Xt],Xt))!=null&&ve>=ve){fe=ve;break}for(;++Xt<se;)(ve=St.call(mt,mt[Xt],Xt))!=null&&fe>ve&&(fe=ve)}return fe},c.max=function(mt,St){var Xt=-1,se=mt.length,fe,ve;if(arguments.length===1){for(;++Xt<se;)if((ve=mt[Xt])!=null&&ve>=ve){fe=ve;break}for(;++Xt<se;)(ve=mt[Xt])!=null&&ve>fe&&(fe=ve)}else{for(;++Xt<se;)if((ve=St.call(mt,mt[Xt],Xt))!=null&&ve>=ve){fe=ve;break}for(;++Xt<se;)(ve=St.call(mt,mt[Xt],Xt))!=null&&ve>fe&&(fe=ve)}return fe},c.extent=function(mt,St){var Xt=-1,se=mt.length,fe,ve,De;if(arguments.length===1){for(;++Xt<se;)if((ve=mt[Xt])!=null&&ve>=ve){fe=De=ve;break}for(;++Xt<se;)(ve=mt[Xt])!=null&&(fe>ve&&(fe=ve),De<ve&&(De=ve))}else{for(;++Xt<se;)if((ve=St.call(mt,mt[Xt],Xt))!=null&&ve>=ve){fe=De=ve;break}for(;++Xt<se;)(ve=St.call(mt,mt[Xt],Xt))!=null&&(fe>ve&&(fe=ve),De<ve&&(De=ve))}return[fe,De]};function h(mt){return mt===null?NaN:+mt}function v(mt){return!isNaN(mt)}c.sum=function(mt,St){var Xt=0,se=mt.length,fe,ve=-1;if(arguments.length===1)for(;++ve<se;)v(fe=+mt[ve])&&(Xt+=fe);else for(;++ve<se;)v(fe=+St.call(mt,mt[ve],ve))&&(Xt+=fe);return Xt},c.mean=function(mt,St){var Xt=0,se=mt.length,fe,ve=-1,De=se;if(arguments.length===1)for(;++ve<se;)v(fe=h(mt[ve]))?Xt+=fe:--De;else for(;++ve<se;)v(fe=h(St.call(mt,mt[ve],ve)))?Xt+=fe:--De;if(De)return Xt/De},c.quantile=function(mt,St){var Xt=(mt.length-1)*St+1,se=Math.floor(Xt),fe=+mt[se-1],ve=Xt-se;return ve?fe+ve*(mt[se]-fe):fe},c.median=function(mt,St){var Xt=[],se=mt.length,fe,ve=-1;if(arguments.length===1)for(;++ve<se;)v(fe=h(mt[ve]))&&Xt.push(fe);else for(;++ve<se;)v(fe=h(St.call(mt,mt[ve],ve)))&&Xt.push(fe);if(Xt.length)return c.quantile(Xt.sort(s),.5)},c.variance=function(mt,St){var Xt=mt.length,se=0,fe,ve,De=0,Ce=-1,Qe=0;if(arguments.length===1)for(;++Ce<Xt;)v(fe=h(mt[Ce]))&&(ve=fe-se,se+=ve/++Qe,De+=ve*(fe-se));else for(;++Ce<Xt;)v(fe=h(St.call(mt,mt[Ce],Ce)))&&(ve=fe-se,se+=ve/++Qe,De+=ve*(fe-se));if(Qe>1)return De/(Qe-1)},c.deviation=function(){var mt=c.variance.apply(this,arguments);return mt&&Math.sqrt(mt)};function m(mt){return{left:function(St,Xt,se,fe){for(arguments.length<3&&(se=0),arguments.length<4&&(fe=St.length);se<fe;){var ve=se+fe>>>1;mt(St[ve],Xt)<0?se=ve+1:fe=ve}return se},right:function(St,Xt,se,fe){for(arguments.length<3&&(se=0),arguments.length<4&&(fe=St.length);se<fe;){var ve=se+fe>>>1;mt(St[ve],Xt)>0?fe=ve:se=ve+1}return se}}}var p=m(s);c.bisectLeft=p.left,c.bisect=c.bisectRight=p.right,c.bisector=function(mt){return m(mt.length===1?function(St,Xt){return s(mt(St),Xt)}:mt)},c.shuffle=function(mt,St,Xt){(se=arguments.length)<3&&(Xt=mt.length,se<2&&(St=0));for(var se=Xt-St,fe,ve;se;)ve=Math.random()*se--|0,fe=mt[se+St],mt[se+St]=mt[ve+St],mt[ve+St]=fe;return mt},c.permute=function(mt,St){for(var Xt=St.length,se=new Array(Xt);Xt--;)se[Xt]=mt[St[Xt]];return se},c.pairs=function(mt){for(var St=0,Xt=mt.length-1,se,fe=mt[0],ve=new Array(Xt<0?0:Xt);St<Xt;)ve[St]=[se=fe,fe=mt[++St]];return ve},c.transpose=function(mt){if(!(ve=mt.length))return[];for(var St=-1,Xt=c.min(mt,y),se=new Array(Xt);++St<Xt;)for(var fe=-1,ve,De=se[St]=new Array(ve);++fe<ve;)De[fe]=mt[fe][St];return se};function y(mt){return mt.length}c.zip=function(){return c.transpose(arguments)},c.keys=function(mt){var St=[];for(var Xt in mt)St.push(Xt);return St},c.values=function(mt){var St=[];for(var Xt in mt)St.push(mt[Xt]);return St},c.entries=function(mt){var St=[];for(var Xt in mt)St.push({key:Xt,value:mt[Xt]});return St},c.merge=function(mt){for(var St=mt.length,Xt,se=-1,fe=0,ve,De;++se<St;)fe+=mt[se].length;for(ve=new Array(fe);--St>=0;)for(De=mt[St],Xt=De.length;--Xt>=0;)ve[--fe]=De[Xt];return ve};var l=Math.abs;c.range=function(mt,St,Xt){if(arguments.length<3&&(Xt=1,arguments.length<2&&(St=mt,mt=0)),(St-mt)/Xt===1/0)throw new Error("infinite range");var se=[],fe=x(l(Xt)),ve=-1,De;if(mt*=fe,St*=fe,Xt*=fe,Xt<0)for(;(De=mt+Xt*++ve)>St;)se.push(De/fe);else for(;(De=mt+Xt*++ve)<St;)se.push(De/fe);return se};function x(mt){for(var St=1;mt*St%1;)St*=10;return St}function b(mt,St){for(var Xt in St)Object.defineProperty(mt.prototype,Xt,{value:St[Xt],enumerable:!1})}c.map=function(mt,St){var Xt=new S;if(mt instanceof S)mt.forEach(function(Ce,Qe){Xt.set(Ce,Qe)});else if(Array.isArray(mt)){var se=-1,fe=mt.length,ve;if(arguments.length===1)for(;++se<fe;)Xt.set(se,mt[se]);else for(;++se<fe;)Xt.set(St.call(mt,ve=mt[se],se),ve)}else for(var De in mt)Xt.set(De,mt[De]);return Xt};function S(){this._=Object.create(null)}var T="__proto__",M="\0";b(S,{has:f,get:function(mt){return this._[w(mt)]},set:function(mt,St){return this._[w(mt)]=St},remove:k,keys:_,values:function(){var mt=[];for(var St in this._)mt.push(this._[St]);return mt},entries:function(){var mt=[];for(var St in this._)mt.push({key:u(St),value:this._[St]});return mt},size:D,empty:I,forEach:function(mt){for(var St in this._)mt.call(this,u(St),this._[St])}});function w(mt){return(mt+="")===T||mt[0]===M?M+mt:mt}function u(mt){return(mt+="")[0]===M?mt.slice(1):mt}function f(mt){return w(mt)in this._}function k(mt){return(mt=w(mt))in this._&&delete this._[mt]}function _(){var mt=[];for(var St in this._)mt.push(u(St));return mt}function D(){var mt=0;for(var St in this._)++mt;return mt}function I(){for(var mt in this._)return!1;return!0}c.nest=function(){var mt={},St=[],Xt=[],se,fe;function ve(Ce,Qe,Mr){if(Mr>=St.length)return fe?fe.call(mt,Qe):se?Qe.sort(se):Qe;for(var br=-1,jr=Qe.length,Yr=St[Mr++],tn,Rn,sn,Mn=new S,In;++br<jr;)(In=Mn.get(tn=Yr(Rn=Qe[br])))?In.push(Rn):Mn.set(tn,[Rn]);return Ce?(Rn=Ce(),sn=function(Dn,jn){Rn.set(Dn,ve(Ce,jn,Mr))}):(Rn={},sn=function(Dn,jn){Rn[Dn]=ve(Ce,jn,Mr)}),Mn.forEach(sn),Rn}function De(Ce,Qe){if(Qe>=St.length)return Ce;var Mr=[],br=Xt[Qe++];return Ce.forEach(function(jr,Yr){Mr.push({key:jr,values:De(Yr,Qe)})}),br?Mr.sort(function(jr,Yr){return br(jr.key,Yr.key)}):Mr}return mt.map=function(Ce,Qe){return ve(Qe,Ce,0)},mt.entries=function(Ce){return De(ve(c.map,Ce,0),0)},mt.key=function(Ce){return St.push(Ce),mt},mt.sortKeys=function(Ce){return Xt[St.length-1]=Ce,mt},mt.sortValues=function(Ce){return se=Ce,mt},mt.rollup=function(Ce){return fe=Ce,mt},mt},c.set=function(mt){var St=new O;if(mt)for(var Xt=0,se=mt.length;Xt<se;++Xt)St.add(mt[Xt]);return St};function O(){this._=Object.create(null)}b(O,{has:f,add:function(mt){return this._[w(mt+="")]=!0,mt},remove:k,values:_,size:D,empty:I,forEach:function(mt){for(var St in this._)mt.call(this,u(St))}}),c.behavior={};function B(mt){return mt}c.rebind=function(mt,St){for(var Xt=1,se=arguments.length,fe;++Xt<se;)mt[fe=arguments[Xt]]=R(mt,St,St[fe]);return mt};function R(mt,St,Xt){return function(){var se=Xt.apply(St,arguments);return se===St?mt:se}}function L(mt,St){if(St in mt)return St;St=St.charAt(0).toUpperCase()+St.slice(1);for(var Xt=0,se=F.length;Xt<se;++Xt){var fe=F[Xt]+St;if(fe in mt)return fe}}var F=["webkit","ms","moz","Moz","o","O"];function N(){}c.dispatch=function(){for(var mt=new j,St=-1,Xt=arguments.length;++St<Xt;)mt[arguments[St]]=G(mt);return mt};function j(){}j.prototype.on=function(mt,St){var Xt=mt.indexOf("."),se="";if(Xt>=0&&(se=mt.slice(Xt+1),mt=mt.slice(0,Xt)),mt)return arguments.length<2?this[mt].on(se):this[mt].on(se,St);if(arguments.length===2){if(St==null)for(mt in this)this.hasOwnProperty(mt)&&this[mt].on(se,null);return this}};function G(mt){var St=[],Xt=new S;function se(){for(var fe=St,ve=-1,De=fe.length,Ce;++ve<De;)(Ce=fe[ve].on)&&Ce.apply(this,arguments);return mt}return se.on=function(fe,ve){var De=Xt.get(fe),Ce;return arguments.length<2?De&&De.on:(De&&(De.on=null,St=St.slice(0,Ce=St.indexOf(De)).concat(St.slice(Ce+1)),Xt.remove(fe)),ve&&St.push(Xt.set(fe,{on:ve})),mt)},se}c.event=null;function rt(){c.event.preventDefault()}function ct(){for(var mt=c.event,St;St=mt.sourceEvent;)mt=St;return mt}function lt(mt){for(var St=new j,Xt=0,se=arguments.length;++Xt<se;)St[arguments[Xt]]=G(St);return St.of=function(fe,ve){return function(De){try{var Ce=De.sourceEvent=c.event;De.target=mt,c.event=De,St[De.type].apply(fe,ve)}finally{c.event=Ce}}},St}c.requote=function(mt){return mt.replace(tt,"\\$&")};var tt=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Z={}.__proto__?function(mt,St){mt.__proto__=St}:function(mt,St){for(var Xt in St)mt[Xt]=St[Xt]};function st(mt){return Z(mt,Y),mt}var $=function(mt,St){return St.querySelector(mt)},Q=function(mt,St){return St.querySelectorAll(mt)},nt=function(mt,St){var Xt=mt.matches||mt[L(mt,"matchesSelector")];return nt=function(se,fe){return Xt.call(se,fe)},nt(mt,St)};typeof Sizzle=="function"&&($=function(mt,St){return Sizzle(mt,St)[0]||null},Q=Sizzle,nt=Sizzle.matchesSelector),c.selection=function(){return c.select(A.documentElement)};var Y=c.selection.prototype=[];Y.select=function(mt){var St=[],Xt,se,fe,ve;mt=q(mt);for(var De=-1,Ce=this.length;++De<Ce;){St.push(Xt=[]),Xt.parentNode=(fe=this[De]).parentNode;for(var Qe=-1,Mr=fe.length;++Qe<Mr;)(ve=fe[Qe])?(Xt.push(se=mt.call(ve,ve.__data__,Qe,De)),se&&"__data__"in ve&&(se.__data__=ve.__data__)):Xt.push(null)}return st(St)};function q(mt){return typeof mt=="function"?mt:function(){return $(mt,this)}}Y.selectAll=function(mt){var St=[],Xt,se;mt=ot(mt);for(var fe=-1,ve=this.length;++fe<ve;)for(var De=this[fe],Ce=-1,Qe=De.length;++Ce<Qe;)(se=De[Ce])&&(St.push(Xt=E(mt.call(se,se.__data__,Ce,fe))),Xt.parentNode=se);return st(St)};function ot(mt){return typeof mt=="function"?mt:function(){return Q(mt,this)}}var it="http://www.w3.org/1999/xhtml",dt={svg:"http://www.w3.org/2000/svg",xhtml:it,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};c.ns={prefix:dt,qualify:function(mt){var St=mt.indexOf(":"),Xt=mt;return St>=0&&(Xt=mt.slice(0,St))!=="xmlns"&&(mt=mt.slice(St+1)),dt.hasOwnProperty(Xt)?{space:dt[Xt],local:mt}:mt}},Y.attr=function(mt,St){if(arguments.length<2){if(typeof mt=="string"){var Xt=this.node();return mt=c.ns.qualify(mt),mt.local?Xt.getAttributeNS(mt.space,mt.local):Xt.getAttribute(mt)}for(St in mt)this.each(wt(St,mt[St]));return this}return this.each(wt(mt,St))};function wt(mt,St){mt=c.ns.qualify(mt);function Xt(){this.removeAttribute(mt)}function se(){this.removeAttributeNS(mt.space,mt.local)}function fe(){this.setAttribute(mt,St)}function ve(){this.setAttributeNS(mt.space,mt.local,St)}function De(){var Qe=St.apply(this,arguments);Qe==null?this.removeAttribute(mt):this.setAttribute(mt,Qe)}function Ce(){var Qe=St.apply(this,arguments);Qe==null?this.removeAttributeNS(mt.space,mt.local):this.setAttributeNS(mt.space,mt.local,Qe)}return St==null?mt.local?se:Xt:typeof St=="function"?mt.local?Ce:De:mt.local?ve:fe}function xt(mt){return mt.trim().replace(/\s+/g," ")}Y.classed=function(mt,St){if(arguments.length<2){if(typeof mt=="string"){var Xt=this.node(),se=(mt=Et(mt)).length,fe=-1;if(St=Xt.classList){for(;++fe<se;)if(!St.contains(mt[fe]))return!1}else for(St=Xt.getAttribute("class");++fe<se;)if(!Ft(mt[fe]).test(St))return!1;return!0}for(St in mt)this.each(Nt(St,mt[St]));return this}return this.each(Nt(mt,St))};function Ft(mt){return new RegExp("(?:^|\\s+)"+c.requote(mt)+"(?:\\s+|$)","g")}function Et(mt){return(mt+"").trim().split(/^|\s+/)}function Nt(mt,St){mt=Et(mt).map(te);var Xt=mt.length;function se(){for(var ve=-1;++ve<Xt;)mt[ve](this,St)}function fe(){for(var ve=-1,De=St.apply(this,arguments);++ve<Xt;)mt[ve](this,De)}return typeof St=="function"?fe:se}function te(mt){var St=Ft(mt);return function(Xt,se){if(fe=Xt.classList)return se?fe.add(mt):fe.remove(mt);var fe=Xt.getAttribute("class")||"";se?(St.lastIndex=0,St.test(fe)||Xt.setAttribute("class",xt(fe+" "+mt))):Xt.setAttribute("class",xt(fe.replace(St," ")))}}Y.style=function(mt,St,Xt){var se=arguments.length;if(se<3){if(typeof mt!="string"){se<2&&(St="");for(Xt in mt)this.each(Jt(Xt,mt[Xt],St));return this}if(se<2){var fe=this.node();return e(fe).getComputedStyle(fe,null).getPropertyValue(mt)}Xt=""}return this.each(Jt(mt,St,Xt))};function Jt(mt,St,Xt){function se(){this.style.removeProperty(mt)}function fe(){this.style.setProperty(mt,St,Xt)}function ve(){var De=St.apply(this,arguments);De==null?this.style.removeProperty(mt):this.style.setProperty(mt,De,Xt)}return St==null?se:typeof St=="function"?ve:fe}Y.property=function(mt,St){if(arguments.length<2){if(typeof mt=="string")return this.node()[mt];for(St in mt)this.each(Qt(St,mt[St]));return this}return this.each(Qt(mt,St))};function Qt(mt,St){function Xt(){delete this[mt]}function se(){this[mt]=St}function fe(){var ve=St.apply(this,arguments);ve==null?delete this[mt]:this[mt]=ve}return St==null?Xt:typeof St=="function"?fe:se}Y.text=function(mt){return arguments.length?this.each(typeof mt=="function"?function(){var St=mt.apply(this,arguments);this.textContent=St??""}:mt==null?function(){this.textContent=""}:function(){this.textContent=mt}):this.node().textContent},Y.html=function(mt){return arguments.length?this.each(typeof mt=="function"?function(){var St=mt.apply(this,arguments);this.innerHTML=St??""}:mt==null?function(){this.innerHTML=""}:function(){this.innerHTML=mt}):this.node().innerHTML},Y.append=function(mt){return mt=Wt(mt),this.select(function(){return this.appendChild(mt.apply(this,arguments))})};function Wt(mt){function St(){var se=this.ownerDocument,fe=this.namespaceURI;return fe===it&&se.documentElement.namespaceURI===it?se.createElement(mt):se.createElementNS(fe,mt)}function Xt(){return this.ownerDocument.createElementNS(mt.space,mt.local)}return typeof mt=="function"?mt:(mt=c.ns.qualify(mt)).local?Xt:St}Y.insert=function(mt,St){return mt=Wt(mt),St=q(St),this.select(function(){return this.insertBefore(mt.apply(this,arguments),St.apply(this,arguments)||null)})},Y.remove=function(){return this.each(gt)};function gt(){var mt=this.parentNode;mt&&mt.removeChild(this)}Y.data=function(mt,St){var Xt=-1,se=this.length,fe,ve;if(!arguments.length){for(mt=new Array(se=(fe=this[0]).length);++Xt<se;)(ve=fe[Xt])&&(mt[Xt]=ve.__data__);return mt}function De(br,jr){var Yr,tn=br.length,Rn=jr.length,sn=Math.min(tn,Rn),Mn=new Array(Rn),In=new Array(Rn),Dn=new Array(tn),jn,xn;if(St){var _a=new S,La=new Array(tn),$a;for(Yr=-1;++Yr<tn;)(jn=br[Yr])&&(_a.has($a=St.call(jn,jn.__data__,Yr))?Dn[Yr]=jn:_a.set($a,jn),La[Yr]=$a);for(Yr=-1;++Yr<Rn;)(jn=_a.get($a=St.call(jr,xn=jr[Yr],Yr)))?jn!==!0&&(Mn[Yr]=jn,jn.__data__=xn):In[Yr]=bt(xn),_a.set($a,!0);for(Yr=-1;++Yr<tn;)Yr in La&&_a.get(La[Yr])!==!0&&(Dn[Yr]=br[Yr])}else{for(Yr=-1;++Yr<sn;)jn=br[Yr],xn=jr[Yr],jn?(jn.__data__=xn,Mn[Yr]=jn):In[Yr]=bt(xn);for(;Yr<Rn;++Yr)In[Yr]=bt(jr[Yr]);for(;Yr<tn;++Yr)Dn[Yr]=br[Yr]}In.update=Mn,In.parentNode=Mn.parentNode=Dn.parentNode=br.parentNode,Ce.push(In),Qe.push(Mn),Mr.push(Dn)}var Ce=Zt([]),Qe=st([]),Mr=st([]);if(typeof mt=="function")for(;++Xt<se;)De(fe=this[Xt],mt.call(fe,fe.parentNode.__data__,Xt));else for(;++Xt<se;)De(fe=this[Xt],mt);return Qe.enter=function(){return Ce},Qe.exit=function(){return Mr},Qe};function bt(mt){return{__data__:mt}}Y.datum=function(mt){return arguments.length?this.property("__data__",mt):this.property("__data__")},Y.filter=function(mt){var St=[],Xt,se,fe;typeof mt!="function"&&(mt=vt(mt));for(var ve=0,De=this.length;ve<De;ve++){St.push(Xt=[]),Xt.parentNode=(se=this[ve]).parentNode;for(var Ce=0,Qe=se.length;Ce<Qe;Ce++)(fe=se[Ce])&&mt.call(fe,fe.__data__,Ce,ve)&&Xt.push(fe)}return st(St)};function vt(mt){return function(){return nt(this,mt)}}Y.order=function(){for(var mt=-1,St=this.length;++mt<St;)for(var Xt=this[mt],se=Xt.length-1,fe=Xt[se],ve;--se>=0;)(ve=Xt[se])&&(fe&&fe!==ve.nextSibling&&fe.parentNode.insertBefore(ve,fe),fe=ve);return this},Y.sort=function(mt){mt=Ut.apply(this,arguments);for(var St=-1,Xt=this.length;++St<Xt;)this[St].sort(mt);return this.order()};function Ut(mt){return arguments.length||(mt=s),function(St,Xt){return St&&Xt?mt(St.__data__,Xt.__data__):!St-!Xt}}Y.each=function(mt){return Kt(this,function(St,Xt,se){mt.call(St,St.__data__,Xt,se)})};function Kt(mt,St){for(var Xt=0,se=mt.length;Xt<se;Xt++)for(var fe=mt[Xt],ve=0,De=fe.length,Ce;ve<De;ve++)(Ce=fe[ve])&&St(Ce,ve,Xt);return mt}Y.call=function(mt){var St=E(arguments);return mt.apply(St[0]=this,St),this},Y.empty=function(){return!this.node()},Y.node=function(){for(var mt=0,St=this.length;mt<St;mt++)for(var Xt=this[mt],se=0,fe=Xt.length;se<fe;se++){var ve=Xt[se];if(ve)return ve}return null},Y.size=function(){var mt=0;return Kt(this,function(){++mt}),mt};function Zt(mt){return Z(mt,le),mt}var le=[];c.selection.enter=Zt,c.selection.enter.prototype=le,le.append=Y.append,le.empty=Y.empty,le.node=Y.node,le.call=Y.call,le.size=Y.size,le.select=function(mt){for(var St=[],Xt,se,fe,ve,De,Ce=-1,Qe=this.length;++Ce<Qe;){fe=(ve=this[Ce]).update,St.push(Xt=[]),Xt.parentNode=ve.parentNode;for(var Mr=-1,br=ve.length;++Mr<br;)(De=ve[Mr])?(Xt.push(fe[Mr]=se=mt.call(ve.parentNode,De.__data__,Mr,Ce)),se.__data__=De.__data__):Xt.push(null)}return st(St)},le.insert=function(mt,St){return arguments.length<2&&(St=Te(this)),Y.insert.call(this,mt,St)};function Te(mt){var St,Xt;return function(se,fe,ve){var De=mt[ve].update,Ce=De.length,Qe;for(ve!=Xt&&(Xt=ve,St=0),fe>=St&&(St=fe+1);!(Qe=De[St])&&++St<Ce;);return Qe}}c.select=function(mt){var St;return typeof mt=="string"?(St=[$(mt,A)],St.parentNode=A.documentElement):(St=[mt],St.parentNode=t(mt)),st([St])},c.selectAll=function(mt){var St;return typeof mt=="string"?(St=E(Q(mt,A)),St.parentNode=A.documentElement):(St=E(mt),St.parentNode=null),st([St])},Y.on=function(mt,St,Xt){var se=arguments.length;if(se<3){if(typeof mt!="string"){se<2&&(St=!1);for(Xt in mt)this.each(Se(Xt,mt[Xt],St));return this}if(se<2)return(se=this.node()["__on"+mt])&&se._;Xt=!1}return this.each(Se(mt,St,Xt))};function Se(mt,St,Xt){var se="__on"+mt,fe=mt.indexOf("."),ve=Oe;fe>0&&(mt=mt.slice(0,fe));var De=Fe.get(mt);De&&(mt=De,ve=ur);function Ce(){var br=this[se];br&&(this.removeEventListener(mt,br,br.$),delete this[se])}function Qe(){var br=ve(St,E(arguments));Ce.call(this),this.addEventListener(mt,this[se]=br,br.$=Xt),br._=St}function Mr(){var br=new RegExp("^__on([^.]+)"+c.requote(mt)+"$"),jr;for(var Yr in this)if(jr=Yr.match(br)){var tn=this[Yr];this.removeEventListener(jr[1],tn,tn.$),delete this[Yr]}}return fe?St?Qe:Ce:St?N:Mr}var Fe=c.map({mouseenter:"mouseover",mouseleave:"mouseout"});A&&Fe.forEach(function(mt){"on"+mt in A&&Fe.remove(mt)});function Oe(mt,St){return function(Xt){var se=c.event;c.event=Xt,St[0]=this.__data__;try{mt.apply(this,St)}finally{c.event=se}}}function ur(mt,St){var Xt=Oe(mt,St);return function(se){var fe=this,ve=se.relatedTarget;(!ve||ve!==fe&&!(ve.compareDocumentPosition(fe)&8))&&Xt.call(fe,se)}}var fr,We=0;function Lr(mt){var St=".dragsuppress-"+ ++We,Xt="click"+St,se=c.select(e(mt)).on("touchmove"+St,rt).on("dragstart"+St,rt).on("selectstart"+St,rt);if(fr==null&&(fr="onselectstart"in mt?!1:L(mt.style,"userSelect")),fr){var fe=t(mt).style,ve=fe[fr];fe[fr]="none"}return function(De){if(se.on(St,null),fr&&(fe[fr]=ve),De){var Ce=function(){se.on(Xt,null)};se.on(Xt,function(){rt(),Ce()},!0),setTimeout(Ce,0)}}}c.mouse=function(mt){return he(mt,ct())};var kr=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function he(mt,St){St.changedTouches&&(St=St.changedTouches[0]);var Xt=mt.ownerSVGElement||mt;if(Xt.createSVGPoint){var se=Xt.createSVGPoint();if(kr<0){var fe=e(mt);if(fe.scrollX||fe.scrollY){Xt=c.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var ve=Xt[0][0].getScreenCTM();kr=!(ve.f||ve.e),Xt.remove()}}return kr?(se.x=St.pageX,se.y=St.pageY):(se.x=St.clientX,se.y=St.clientY),se=se.matrixTransform(mt.getScreenCTM().inverse()),[se.x,se.y]}var De=mt.getBoundingClientRect();return[St.clientX-De.left-mt.clientLeft,St.clientY-De.top-mt.clientTop]}c.touch=function(mt,St,Xt){if(arguments.length<3&&(Xt=St,St=ct().changedTouches),St){for(var se=0,fe=St.length,ve;se<fe;++se)if((ve=St[se]).identifier===Xt)return he(mt,ve)}},c.behavior.drag=function(){var mt=lt(fe,"drag","dragstart","dragend"),St=null,Xt=ve(N,c.mouse,e,"mousemove","mouseup"),se=ve(Dt,c.touch,B,"touchmove","touchend");function fe(){this.on("mousedown.drag",Xt).on("touchstart.drag",se)}function ve(De,Ce,Qe,Mr,br){return function(){var jr=this,Yr=c.event.target.correspondingElement||c.event.target,tn=jr.parentNode,Rn=mt.of(jr,arguments),sn=0,Mn=De(),In=".drag"+(Mn==null?"":"-"+Mn),Dn,jn=c.select(Qe(Yr)).on(Mr+In,La).on(br+In,$a),xn=Lr(Yr),_a=Ce(tn,Mn);St?(Dn=St.apply(jr,arguments),Dn=[Dn.x-_a[0],Dn.y-_a[1]]):Dn=[0,0],Rn({type:"dragstart"});function La(){var ti=Ce(tn,Mn),ii,di;ti&&(ii=ti[0]-_a[0],di=ti[1]-_a[1],sn|=ii|di,_a=ti,Rn({type:"drag",x:ti[0]+Dn[0],y:ti[1]+Dn[1],dx:ii,dy:di}))}function $a(){Ce(tn,Mn)&&(jn.on(Mr+In,null).on(br+In,null),xn(sn),Rn({type:"dragend"}))}}}return fe.origin=function(De){return arguments.length?(St=De,fe):St},c.rebind(fe,mt,"on")};function Dt(){return c.event.changedTouches[0].identifier}c.touches=function(mt,St){return arguments.length<2&&(St=ct().touches),St?E(St).map(function(Xt){var se=he(mt,Xt);return se.identifier=Xt.identifier,se}):[]};var qt=1e-6,zt=qt*qt,ut=Math.PI,yt=2*ut,Mt=yt-qt,Ot=ut/2,$t=ut/180,ee=180/ut;function we(mt,St,Xt){return(St[0]-mt[0])*(Xt[1]-mt[1])-(St[1]-mt[1])*(Xt[0]-mt[0])}function Me(mt){return mt>1?Ot:mt<-1?-Ot:Math.asin(mt)}function Re(mt){return((mt=Math.exp(mt))-1/mt)/2}function Be(mt){return((mt=Math.exp(mt))+1/mt)/2}function Ze(mt){return((mt=Math.exp(2*mt))-1)/(mt+1)}var Ue=Math.SQRT2,mr=2,ln=4;c.interpolateZoom=function(mt,St){var Xt=mt[0],se=mt[1],fe=mt[2],ve=St[0],De=St[1],Ce=St[2],Qe=ve-Xt,Mr=De-se,br=Qe*Qe+Mr*Mr,jr,Yr;if(br<zt)Yr=Math.log(Ce/fe)/Ue,jr=function(Dn){return[Xt+Dn*Qe,se+Dn*Mr,fe*Math.exp(Ue*Dn*Yr)]};else{var tn=Math.sqrt(br),Rn=(Ce*Ce-fe*fe+ln*br)/(2*fe*mr*tn),sn=(Ce*Ce-fe*fe-ln*br)/(2*Ce*mr*tn),Mn=Math.log(Math.sqrt(Rn*Rn+1)-Rn),In=Math.log(Math.sqrt(sn*sn+1)-sn);Yr=(In-Mn)/Ue,jr=function(Dn){var jn=Dn*Yr,xn=Be(Mn),_a=fe/(mr*tn)*(xn*Ze(Ue*jn+Mn)-Re(Mn));return[Xt+_a*Qe,se+_a*Mr,fe*xn/Be(Ue*jn+Mn)]}}return jr.duration=Yr*1e3,jr},c.behavior.zoom=function(){var mt={x:0,y:0,k:1},St,Xt,se,fe=[960,500],ve=an,De=250,Ce=0,Qe="mousedown.zoom",Mr="mousemove.zoom",br="mouseup.zoom",jr,Yr="touchstart.zoom",tn,Rn=lt(jn,"zoomstart","zoom","zoomend"),sn,Mn,In,Dn;Sn||(Sn="onwheel"in A?(vn=function(){return-c.event.deltaY*(c.event.deltaMode?120:1)},"wheel"):"onmousewheel"in A?(vn=function(){return c.event.wheelDelta},"mousewheel"):(vn=function(){return-c.event.detail},"MozMousePixelScroll"));function jn(Ja){Ja.on(Qe,Ji).on(Sn+".zoom",Ys).on("dblclick.zoom",_s).on(Yr,qo)}jn.event=function(Ja){Ja.each(function(){var yo=Rn.of(this,arguments),Lo=mt;li?c.select(this).transition().each("start.zoom",function(){mt=this.__chart__||{x:0,y:0,k:1},di(yo)}).tween("zoom:zoom",function(){var bs=fe[0],us=fe[1],eu=Xt?Xt[0]:bs/2,Yo=Xt?Xt[1]:us/2,gs=c.interpolateZoom([(eu-mt.x)/mt.k,(Yo-mt.y)/mt.k,bs/mt.k],[(eu-Lo.x)/Lo.k,(Yo-Lo.y)/Lo.k,bs/Lo.k]);return function(wu){var sr=gs(wu),fn=bs/sr[2];this.__chart__=mt={x:eu-sr[0]*fn,y:Yo-sr[1]*fn,k:fn},Io(yo)}}).each("interrupt.zoom",function(){gi(yo)}).each("end.zoom",function(){gi(yo)}):(this.__chart__=mt,di(yo),Io(yo),gi(yo))})},jn.translate=function(Ja){return arguments.length?(mt={x:+Ja[0],y:+Ja[1],k:mt.k},ii(),jn):[mt.x,mt.y]},jn.scale=function(Ja){return arguments.length?(mt={x:mt.x,y:mt.y,k:null},La(+Ja),ii(),jn):mt.k},jn.scaleExtent=function(Ja){return arguments.length?(ve=Ja==null?an:[+Ja[0],+Ja[1]],jn):ve},jn.center=function(Ja){return arguments.length?(se=Ja&&[+Ja[0],+Ja[1]],jn):se},jn.size=function(Ja){return arguments.length?(fe=Ja&&[+Ja[0],+Ja[1]],jn):fe},jn.duration=function(Ja){return arguments.length?(De=+Ja,jn):De},jn.x=function(Ja){return arguments.length?(Mn=Ja,sn=Ja.copy(),mt={x:0,y:0,k:1},jn):Mn},jn.y=function(Ja){return arguments.length?(Dn=Ja,In=Ja.copy(),mt={x:0,y:0,k:1},jn):Dn};function xn(Ja){return[(Ja[0]-mt.x)/mt.k,(Ja[1]-mt.y)/mt.k]}function _a(Ja){return[Ja[0]*mt.k+mt.x,Ja[1]*mt.k+mt.y]}function La(Ja){mt.k=Math.max(ve[0],Math.min(ve[1],Ja))}function $a(Ja,yo){yo=_a(yo),mt.x+=Ja[0]-yo[0],mt.y+=Ja[1]-yo[1]}function ti(Ja,yo,Lo,bs){Ja.__chart__={x:mt.x,y:mt.y,k:mt.k},La(Math.pow(2,bs)),$a(Xt=yo,Lo),Ja=c.select(Ja),De>0&&(Ja=Ja.transition().duration(De)),Ja.call(jn.event)}function ii(){Mn&&Mn.domain(sn.range().map(function(Ja){return(Ja-mt.x)/mt.k}).map(sn.invert)),Dn&&Dn.domain(In.range().map(function(Ja){return(Ja-mt.y)/mt.k}).map(In.invert))}function di(Ja){Ce++||Ja({type:"zoomstart"})}function Io(Ja){ii(),Ja({type:"zoom",scale:mt.k,translate:[mt.x,mt.y]})}function gi(Ja){--Ce||(Ja({type:"zoomend"}),Xt=null)}function Ji(){var Ja=this,yo=Rn.of(Ja,arguments),Lo=0,bs=c.select(e(Ja)).on(Mr,Yo).on(br,gs),us=xn(c.mouse(Ja)),eu=Lr(Ja);zn.call(Ja),di(yo);function Yo(){Lo=1,$a(c.mouse(Ja),us),Io(yo)}function gs(){bs.on(Mr,null).on(br,null),eu(Lo),gi(yo)}}function qo(){var Ja=this,yo=Rn.of(Ja,arguments),Lo={},bs=0,us,eu=".zoom-"+c.event.changedTouches[0].identifier,Yo="touchmove"+eu,gs="touchend"+eu,wu=[],sr=c.select(Ja),fn=Lr(Ja);ha(),di(yo),sr.on(Qe,null).on(Yr,ha);function gn(){var Cn=c.touches(Ja);return us=mt.k,Cn.forEach(function(ia){ia.identifier in Lo&&(Lo[ia.identifier]=xn(ia))}),Cn}function ha(){var Cn=c.event.target;c.select(Cn).on(Yo,Ta).on(gs,ka),wu.push(Cn);for(var ia=c.event.changedTouches,qa=0,Ra=ia.length;qa<Ra;++qa)Lo[ia[qa].identifier]=null;var ei=gn(),Ii=Date.now();if(ei.length===1){if(Ii-tn<500){var wi=ei[0];ti(Ja,wi,Lo[wi.identifier],Math.floor(Math.log(mt.k)/Math.LN2)+1),rt()}tn=Ii}else if(ei.length>1){var wi=ei[0],Ha=ei[1],Ca=wi[0]-Ha[0],Wn=wi[1]-Ha[1];bs=Ca*Ca+Wn*Wn}}function Ta(){var Cn=c.touches(Ja),ia,qa,Ra,ei;zn.call(Ja);for(var Ii=0,wi=Cn.length;Ii<wi;++Ii,ei=null)if(Ra=Cn[Ii],ei=Lo[Ra.identifier]){if(qa)break;ia=Ra,qa=ei}if(ei){var Ha=(Ha=Ra[0]-ia[0])*Ha+(Ha=Ra[1]-ia[1])*Ha,Ca=bs&&Math.sqrt(Ha/bs);ia=[(ia[0]+Ra[0])/2,(ia[1]+Ra[1])/2],qa=[(qa[0]+ei[0])/2,(qa[1]+ei[1])/2],La(Ca*us)}tn=null,$a(ia,qa),Io(yo)}function ka(){if(c.event.touches.length){for(var Cn=c.event.changedTouches,ia=0,qa=Cn.length;ia<qa;++ia)delete Lo[Cn[ia].identifier];for(var Ra in Lo)return void gn()}c.selectAll(wu).on(eu,null),sr.on(Qe,Ji).on(Yr,qo),fn(),gi(yo)}}function Ys(){var Ja=Rn.of(this,arguments);jr?clearTimeout(jr):(zn.call(this),St=xn(Xt=se||c.mouse(this)),di(Ja)),jr=setTimeout(function(){jr=null,gi(Ja)},50),rt(),La(Math.pow(2,vn()*.002)*mt.k),$a(Xt,St),Io(Ja)}function _s(){var Ja=c.mouse(this),yo=Math.log(mt.k)/Math.LN2;ti(this,Ja,xn(Ja),c.event.shiftKey?Math.ceil(yo)-1:Math.floor(yo)+1)}return c.rebind(jn,Rn,"on")};var an=[0,1/0],vn,Sn;c.color=An;function An(){}An.prototype.toString=function(){return this.rgb()+""},c.hsl=pn;function pn(mt,St,Xt){return this instanceof pn?(this.h=+mt,this.s=+St,void(this.l=+Xt)):arguments.length<2?mt instanceof pn?new pn(mt.h,mt.s,mt.l):Er(""+mt,Dr,pn):new pn(mt,St,Xt)}var On=pn.prototype=new An;On.brighter=function(mt){return mt=Math.pow(.7,arguments.length?mt:1),new pn(this.h,this.s,this.l/mt)},On.darker=function(mt){return mt=Math.pow(.7,arguments.length?mt:1),new pn(this.h,this.s,mt*this.l)},On.rgb=function(){return Nn(this.h,this.s,this.l)};function Nn(mt,St,Xt){var se,fe;mt=isNaN(mt)?0:(mt%=360)<0?mt+360:mt,St=isNaN(St)||St<0?0:St>1?1:St,Xt=Xt<0?0:Xt>1?1:Xt,fe=Xt<=.5?Xt*(1+St):Xt+St-Xt*St,se=2*Xt-fe;function ve(Ce){return Ce>360?Ce-=360:Ce<0&&(Ce+=360),Ce<60?se+(fe-se)*Ce/60:Ce<180?fe:Ce<240?se+(fe-se)*(240-Ce)/60:se}function De(Ce){return Math.round(ve(Ce)*255)}return new xe(De(mt+120),De(mt),De(mt-120))}c.hcl=ke;function ke(mt,St,Xt){return this instanceof ke?(this.h=+mt,this.c=+St,void(this.l=+Xt)):arguments.length<2?mt instanceof ke?new ke(mt.h,mt.c,mt.l):mt instanceof Ne?Fn(mt.l,mt.a,mt.b):Fn((mt=Ar((mt=c.rgb(mt)).r,mt.g,mt.b)).l,mt.a,mt.b):new ke(mt,St,Xt)}var ze=ke.prototype=new An;ze.brighter=function(mt){return new ke(this.h,this.c,Math.min(100,this.l+_r*(arguments.length?mt:1)))},ze.darker=function(mt){return new ke(this.h,this.c,Math.max(0,this.l-_r*(arguments.length?mt:1)))},ze.rgb=function(){return je(this.h,this.c,this.l).rgb()};function je(mt,St,Xt){return isNaN(mt)&&(mt=0),isNaN(St)&&(St=0),new Ne(Xt,Math.cos(mt*=$t)*St,Math.sin(mt)*St)}c.lab=Ne;function Ne(mt,St,Xt){return this instanceof Ne?(this.l=+mt,this.a=+St,void(this.b=+Xt)):arguments.length<2?mt instanceof Ne?new Ne(mt.l,mt.a,mt.b):mt instanceof ke?je(mt.h,mt.c,mt.l):Ar((mt=xe(mt)).r,mt.g,mt.b):new Ne(mt,St,Xt)}var _r=18,Xr=.95047,rn=1,Br=1.08883,_n=Ne.prototype=new An;_n.brighter=function(mt){return new Ne(Math.min(100,this.l+_r*(arguments.length?mt:1)),this.a,this.b)},_n.darker=function(mt){return new Ne(Math.max(0,this.l-_r*(arguments.length?mt:1)),this.a,this.b)},_n.rgb=function(){return bn(this.l,this.a,this.b)};function bn(mt,St,Xt){var se=(mt+16)/116,fe=se+St/500,ve=se-Xt/200;return fe=on(fe)*Xr,se=on(se)*rn,ve=on(ve)*Br,new xe(ue(3.2404542*fe-1.5371385*se-.4985314*ve),ue(-.969266*fe+1.8760108*se+.041556*ve),ue(.0556434*fe-.2040259*se+1.0572252*ve))}function Fn(mt,St,Xt){return mt>0?new ke(Math.atan2(Xt,St)*ee,Math.sqrt(St*St+Xt*Xt),mt):new ke(NaN,NaN,mt)}function on(mt){return mt>.206893034?mt*mt*mt:(mt-4/29)/7.787037}function Bn(mt){return mt>.008856?Math.pow(mt,1/3):7.787037*mt+4/29}function ue(mt){return Math.round(255*(mt<=.00304?12.92*mt:1.055*Math.pow(mt,1/2.4)-.055))}c.rgb=xe;function xe(mt,St,Xt){return this instanceof xe?(this.r=~~mt,this.g=~~St,void(this.b=~~Xt)):arguments.length<2?mt instanceof xe?new xe(mt.r,mt.g,mt.b):Er(""+mt,xe,Nn):new xe(mt,St,Xt)}function Pr(mt){return new xe(mt>>16,mt>>8&255,mt&255)}function Sr(mt){return Pr(mt)+""}var gr=xe.prototype=new An;gr.brighter=function(mt){mt=Math.pow(.7,arguments.length?mt:1);var St=this.r,Xt=this.g,se=this.b,fe=30;return!St&&!Xt&&!se?new xe(fe,fe,fe):(St&&St<fe&&(St=fe),Xt&&Xt<fe&&(Xt=fe),se&&se<fe&&(se=fe),new xe(Math.min(255,St/mt),Math.min(255,Xt/mt),Math.min(255,se/mt)))},gr.darker=function(mt){return mt=Math.pow(.7,arguments.length?mt:1),new xe(mt*this.r,mt*this.g,mt*this.b)},gr.hsl=function(){return Dr(this.r,this.g,this.b)},gr.toString=function(){return"#"+dr(this.r)+dr(this.g)+dr(this.b)};function dr(mt){return mt<16?"0"+Math.max(0,mt).toString(16):Math.min(255,mt).toString(16)}function Er(mt,St,Xt){var se=0,fe=0,ve=0,De,Ce,Qe;if(De=/([a-z]+)\((.*)\)/.exec(mt=mt.toLowerCase()),De)switch(Ce=De[2].split(","),De[1]){case"hsl":return Xt(parseFloat(Ce[0]),parseFloat(Ce[1])/100,parseFloat(Ce[2])/100);case"rgb":return St(Wr(Ce[0]),Wr(Ce[1]),Wr(Ce[2]))}return(Qe=Jr.get(mt))?St(Qe.r,Qe.g,Qe.b):(mt!=null&&mt.charAt(0)==="#"&&!isNaN(Qe=parseInt(mt.slice(1),16))&&(mt.length===4?(se=(Qe&3840)>>4,se=se>>4|se,fe=Qe&240,fe=fe>>4|fe,ve=Qe&15,ve=ve<<4|ve):mt.length===7&&(se=(Qe&16711680)>>16,fe=(Qe&65280)>>8,ve=Qe&255)),St(se,fe,ve))}function Dr(mt,St,Xt){var se=Math.min(mt/=255,St/=255,Xt/=255),fe=Math.max(mt,St,Xt),ve=fe-se,De,Ce,Qe=(fe+se)/2;return ve?(Ce=Qe<.5?ve/(fe+se):ve/(2-fe-se),mt==fe?De=(St-Xt)/ve+(St<Xt?6:0):St==fe?De=(Xt-mt)/ve+2:De=(mt-St)/ve+4,De*=60):(De=NaN,Ce=Qe>0&&Qe<1?0:De),new pn(De,Ce,Qe)}function Ar(mt,St,Xt){mt=Gr(mt),St=Gr(St),Xt=Gr(Xt);var se=Bn((.4124564*mt+.3575761*St+.1804375*Xt)/Xr),fe=Bn((.2126729*mt+.7151522*St+.072175*Xt)/rn),ve=Bn((.0193339*mt+.119192*St+.9503041*Xt)/Br);return Ne(116*fe-16,500*(se-fe),200*(fe-ve))}function Gr(mt){return(mt/=255)<=.04045?mt/12.92:Math.pow((mt+.055)/1.055,2.4)}function Wr(mt){var St=parseFloat(mt);return mt.charAt(mt.length-1)==="%"?Math.round(St*2.55):St}var Jr=c.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Jr.forEach(function(mt,St){Jr.set(mt,Pr(St))});function _e(mt){return typeof mt=="function"?mt:function(){return mt}}c.functor=_e,c.xhr=Je(B);function Je(mt){return function(St,Xt,se){return arguments.length===2&&typeof Xt=="function"&&(se=Xt,Xt=null),yr(St,Xt,mt,se)}}function yr(mt,St,Xt,se){var fe={},ve=c.dispatch("beforesend","progress","load","error"),De={},Ce=new XMLHttpRequest,Qe=null;self.XDomainRequest&&!("withCredentials"in Ce)&&/^(http(s)?:)?\/\//.test(mt)&&(Ce=new XDomainRequest),"onload"in Ce?Ce.onload=Ce.onerror=Mr:Ce.onreadystatechange=function(){Ce.readyState>3&&Mr()};function Mr(){var br=Ce.status,jr;if(!br&&hn(Ce)||br>=200&&br<300||br===304){try{jr=Xt.call(fe,Ce)}catch(Yr){ve.error.call(fe,Yr);return}ve.load.call(fe,jr)}else ve.error.call(fe,Ce)}return Ce.onprogress=function(br){var jr=c.event;c.event=br;try{ve.progress.call(fe,Ce)}finally{c.event=jr}},fe.header=function(br,jr){return br=(br+"").toLowerCase(),arguments.length<2?De[br]:(jr==null?delete De[br]:De[br]=jr+"",fe)},fe.mimeType=function(br){return arguments.length?(St=br==null?null:br+"",fe):St},fe.responseType=function(br){return arguments.length?(Qe=br,fe):Qe},fe.response=function(br){return Xt=br,fe},["get","post"].forEach(function(br){fe[br]=function(){return fe.send.apply(fe,[br].concat(E(arguments)))}}),fe.send=function(br,jr,Yr){if(arguments.length===2&&typeof jr=="function"&&(Yr=jr,jr=null),Ce.open(br,mt,!0),St!=null&&!("accept"in De)&&(De.accept=St+",*/*"),Ce.setRequestHeader)for(var tn in De)Ce.setRequestHeader(tn,De[tn]);return St!=null&&Ce.overrideMimeType&&Ce.overrideMimeType(St),Qe!=null&&(Ce.responseType=Qe),Yr!=null&&fe.on("error",Yr).on("load",function(Rn){Yr(null,Rn)}),ve.beforesend.call(fe,Ce),Ce.send(jr??null),fe},fe.abort=function(){return Ce.abort(),fe},c.rebind(fe,ve,"on"),se==null?fe:fe.get(Hr(se))}function Hr(mt){return mt.length===1?function(St,Xt){mt(St==null?Xt:null)}:mt}function hn(mt){var St=mt.responseType;return St&&St!=="text"?mt.response:mt.responseText}c.dsv=function(mt,St){var Xt=new RegExp('["'+mt+`
|
||
]`),se=mt.charCodeAt(0);function fe(Mr,br,jr){arguments.length<3&&(jr=br,br=null);var Yr=yr(Mr,St,br==null?ve:De(br),jr);return Yr.row=function(tn){return arguments.length?Yr.response((br=tn)==null?ve:De(tn)):br},Yr}function ve(Mr){return fe.parse(Mr.responseText)}function De(Mr){return function(br){return fe.parse(br.responseText,Mr)}}fe.parse=function(Mr,br){var jr;return fe.parseRows(Mr,function(Yr,tn){if(jr)return jr(Yr,tn-1);var Rn=function(sn){for(var Mn={},In=Yr.length,Dn=0;Dn<In;++Dn)Mn[Yr[Dn]]=sn[Dn];return Mn};jr=br?function(sn,Mn){return br(Rn(sn),Mn)}:Rn})},fe.parseRows=function(Mr,br){var jr={},Yr={},tn=[],Rn=Mr.length,sn=0,Mn=0,In,Dn;function jn(){if(sn>=Rn)return Yr;if(Dn)return Dn=!1,jr;var _a=sn;if(Mr.charCodeAt(_a)===34){for(var La=_a;La++<Rn;)if(Mr.charCodeAt(La)===34){if(Mr.charCodeAt(La+1)!==34)break;++La}sn=La+2;var $a=Mr.charCodeAt(La+1);return $a===13?(Dn=!0,Mr.charCodeAt(La+2)===10&&++sn):$a===10&&(Dn=!0),Mr.slice(_a+1,La).replace(/""/g,'"')}for(;sn<Rn;){var $a=Mr.charCodeAt(sn++),ti=1;if($a===10)Dn=!0;else if($a===13)Dn=!0,Mr.charCodeAt(sn)===10&&(++sn,++ti);else if($a!==se)continue;return Mr.slice(_a,sn-ti)}return Mr.slice(_a)}for(;(In=jn())!==Yr;){for(var xn=[];In!==jr&&In!==Yr;)xn.push(In),In=jn();br&&(xn=br(xn,Mn++))==null||tn.push(xn)}return tn},fe.format=function(Mr){if(Array.isArray(Mr[0]))return fe.formatRows(Mr);var br=new O,jr=[];return Mr.forEach(function(Yr){for(var tn in Yr)br.has(tn)||jr.push(br.add(tn))}),[jr.map(Qe).join(mt)].concat(Mr.map(function(Yr){return jr.map(function(tn){return Qe(Yr[tn])}).join(mt)})).join(`
|
||
`)},fe.formatRows=function(Mr){return Mr.map(Ce).join(`
|
||
`)};function Ce(Mr){return Mr.map(Qe).join(mt)}function Qe(Mr){return Xt.test(Mr)?'"'+Mr.replace(/\"/g,'""')+'"':Mr}return fe},c.csv=c.dsv(",","text/csv"),c.tsv=c.dsv(" ","text/tab-separated-values");var En,dn,Kr,Tn,ta=this[L(this,"requestAnimationFrame")]||function(mt){setTimeout(mt,17)};c.timer=function(){Qn.apply(this,arguments)};function Qn(mt,St,Xt){var se=arguments.length;se<2&&(St=0),se<3&&(Xt=Date.now());var fe=Xt+St,ve={c:mt,t:fe,n:null};return dn?dn.n=ve:En=ve,dn=ve,Kr||(Tn=clearTimeout(Tn),Kr=1,ta(Va)),ve}function Va(){var mt=ja(),St=ci()-mt;St>24?(isFinite(St)&&(clearTimeout(Tn),Tn=setTimeout(Va,St)),Kr=0):(Kr=1,ta(Va))}c.timer.flush=function(){ja(),ci()};function ja(){for(var mt=Date.now(),St=En;St;)mt>=St.t&&St.c(mt-St.t)&&(St.c=null),St=St.n;return mt}function ci(){for(var mt,St=En,Xt=1/0;St;)St.c?(St.t<Xt&&(Xt=St.t),St=(mt=St).n):St=mt?mt.n=St.n:En=St.n;return dn=mt,Xt}c.round=function(mt,St){return St?Math.round(mt*(St=Math.pow(10,St)))/St:Math.round(mt)},c.geom={};function pi(mt){return mt[0]}function bi(mt){return mt[1]}c.geom.hull=function(mt){var St=pi,Xt=bi;if(arguments.length)return se(mt);function se(fe){if(fe.length<3)return[];var ve=_e(St),De=_e(Xt),Ce,Qe=fe.length,Mr=[],br=[];for(Ce=0;Ce<Qe;Ce++)Mr.push([+ve.call(this,fe[Ce],Ce),+De.call(this,fe[Ce],Ce),Ce]);for(Mr.sort(Da),Ce=0;Ce<Qe;Ce++)br.push([Mr[Ce][0],-Mr[Ce][1]]);var jr=ri(Mr),Yr=ri(br),tn=Yr[0]===jr[0],Rn=Yr[Yr.length-1]===jr[jr.length-1],sn=[];for(Ce=jr.length-1;Ce>=0;--Ce)sn.push(fe[Mr[jr[Ce]][2]]);for(Ce=+tn;Ce<Yr.length-Rn;++Ce)sn.push(fe[Mr[Yr[Ce]][2]]);return sn}return se.x=function(fe){return arguments.length?(St=fe,se):St},se.y=function(fe){return arguments.length?(Xt=fe,se):Xt},se};function ri(mt){for(var St=mt.length,Xt=[0,1],se=2,fe=2;fe<St;fe++){for(;se>1&&we(mt[Xt[se-2]],mt[Xt[se-1]],mt[fe])<=0;)--se;Xt[se++]=fe}return Xt.slice(0,se)}function Da(mt,St){return mt[0]-St[0]||mt[1]-St[1]}c.geom.polygon=function(mt){return Z(mt,Ui),mt};var Ui=c.geom.polygon.prototype=[];Ui.area=function(){for(var mt=-1,St=this.length,Xt,se=this[St-1],fe=0;++mt<St;)Xt=se,se=this[mt],fe+=Xt[1]*se[0]-Xt[0]*se[1];return fe*.5},Ui.centroid=function(mt){var St=-1,Xt=this.length,se=0,fe=0,ve,De=this[Xt-1],Ce;for(arguments.length||(mt=-1/(6*this.area()));++St<Xt;)ve=De,De=this[St],Ce=ve[0]*De[1]-De[0]*ve[1],se+=(ve[0]+De[0])*Ce,fe+=(ve[1]+De[1])*Ce;return[se*mt,fe*mt]},Ui.clip=function(mt){for(var St,Xt=Bo(mt),se=-1,fe=this.length-Bo(this),ve,De,Ce=this[fe-1],Qe,Mr,br;++se<fe;){for(St=mt.slice(),mt.length=0,Qe=this[se],Mr=St[(De=St.length-Xt)-1],ve=-1;++ve<De;)br=St[ve],lo(br,Ce,Qe)?(lo(Mr,Ce,Qe)||mt.push(Co(Mr,br,Ce,Qe)),mt.push(br)):lo(Mr,Ce,Qe)&&mt.push(Co(Mr,br,Ce,Qe)),Mr=br;Xt&&mt.push(mt[0]),Ce=Qe}return mt};function lo(mt,St,Xt){return(Xt[0]-St[0])*(mt[1]-St[1])<(Xt[1]-St[1])*(mt[0]-St[0])}function Co(mt,St,Xt,se){var fe=mt[0],ve=Xt[0],De=St[0]-fe,Ce=se[0]-ve,Qe=mt[1],Mr=Xt[1],br=St[1]-Qe,jr=se[1]-Mr,Yr=(Ce*(Qe-Mr)-jr*(fe-ve))/(jr*De-Ce*br);return[fe+Yr*De,Qe+Yr*br]}function Bo(mt){var St=mt[0],Xt=mt[mt.length-1];return!(St[0]-Xt[0]||St[1]-Xt[1])}var ai,yi,Si,ko=[],Ao,Do,Pi=[];function Yi(){Zs(this),this.edge=this.site=this.circle=null}function vs(mt){var St=ko.pop()||new Yi;return St.site=mt,St}function es(mt){rs(mt),Si.remove(mt),ko.push(mt),Zs(mt)}function ls(mt){var St=mt.circle,Xt=St.x,se=St.cy,fe={x:Xt,y:se},ve=mt.P,De=mt.N,Ce=[mt];es(mt);for(var Qe=ve;Qe.circle&&l(Xt-Qe.circle.x)<qt&&l(se-Qe.circle.cy)<qt;)ve=Qe.P,Ce.unshift(Qe),es(Qe),Qe=ve;Ce.unshift(Qe),rs(Qe);for(var Mr=De;Mr.circle&&l(Xt-Mr.circle.x)<qt&&l(se-Mr.circle.cy)<qt;)De=Mr.N,Ce.push(Mr),es(Mr),Mr=De;Ce.push(Mr),rs(Mr);var br=Ce.length,jr;for(jr=1;jr<br;++jr)Mr=Ce[jr],Qe=Ce[jr-1],Ci(Mr.edge,Qe.site,Mr.site,fe);Qe=Ce[0],Mr=Ce[br-1],Mr.edge=Ro(Qe.site,Mr.site,null,fe),Po(Qe),Po(Mr)}function Xi(mt){for(var St=mt.x,Xt=mt.y,se,fe,ve,De,Ce=Si._;Ce;)if(ve=ga(Ce,Xt)-St,ve>qt)Ce=Ce.L;else if(De=St-Xa(Ce,Xt),De>qt){if(!Ce.R){se=Ce;break}Ce=Ce.R}else{ve>-qt?(se=Ce.P,fe=Ce):De>-qt?(se=Ce,fe=Ce.N):se=fe=Ce;break}var Qe=vs(mt);if(Si.insert(se,Qe),!(!se&&!fe)){if(se===fe){rs(se),fe=vs(se.site),Si.insert(Qe,fe),Qe.edge=fe.edge=Ro(se.site,Qe.site),Po(se),Po(fe);return}if(!fe){Qe.edge=Ro(se.site,Qe.site);return}rs(se),rs(fe);var Mr=se.site,br=Mr.x,jr=Mr.y,Yr=mt.x-br,tn=mt.y-jr,Rn=fe.site,sn=Rn.x-br,Mn=Rn.y-jr,In=2*(Yr*Mn-tn*sn),Dn=Yr*Yr+tn*tn,jn=sn*sn+Mn*Mn,xn={x:(Mn*Dn-tn*jn)/In+br,y:(Yr*jn-sn*Dn)/In+jr};Ci(fe.edge,Mr,Rn,xn),Qe.edge=Ro(Mr,mt,null,xn),fe.edge=Ro(mt,Rn,null,xn),Po(se),Po(fe)}}function ga(mt,St){var Xt=mt.site,se=Xt.x,fe=Xt.y,ve=fe-St;if(!ve)return se;var De=mt.P;if(!De)return-1/0;Xt=De.site;var Ce=Xt.x,Qe=Xt.y,Mr=Qe-St;if(!Mr)return Ce;var br=Ce-se,jr=1/ve-1/Mr,Yr=br/Mr;return jr?(-Yr+Math.sqrt(Yr*Yr-2*jr*(br*br/(-2*Mr)-Qe+Mr/2+fe-ve/2)))/jr+se:(se+Ce)/2}function Xa(mt,St){var Xt=mt.N;if(Xt)return ga(Xt,St);var se=mt.site;return se.y===St?se.x:1/0}function Ls(mt){this.site=mt,this.edges=[]}Ls.prototype.prepare=function(){for(var mt=this.edges,St=mt.length,Xt;St--;)Xt=mt[St].edge,(!Xt.b||!Xt.a)&&mt.splice(St,1);return mt.sort(qi),mt.length};function fs(mt){for(var St=mt[0][0],Xt=mt[1][0],se=mt[0][1],fe=mt[1][1],ve,De,Ce,Qe,Mr=yi,br=Mr.length,jr,Yr,tn,Rn,sn,Mn;br--;)if(jr=Mr[br],!(!jr||!jr.prepare()))for(tn=jr.edges,Rn=tn.length,Yr=0;Yr<Rn;)Mn=tn[Yr].end(),Ce=Mn.x,Qe=Mn.y,sn=tn[++Yr%Rn].start(),ve=sn.x,De=sn.y,(l(Ce-ve)>qt||l(Qe-De)>qt)&&(tn.splice(Yr,0,new fl(Fo(jr.site,Mn,l(Ce-St)<qt&&fe-Qe>qt?{x:St,y:l(ve-St)<qt?De:fe}:l(Qe-fe)<qt&&Xt-Ce>qt?{x:l(De-fe)<qt?ve:Xt,y:fe}:l(Ce-Xt)<qt&&Qe-se>qt?{x:Xt,y:l(ve-Xt)<qt?De:se}:l(Qe-se)<qt&&Ce-St>qt?{x:l(De-se)<qt?ve:St,y:se}:null),jr.site,null)),++Rn)}function qi(mt,St){return St.angle-mt.angle}function ms(){Zs(this),this.x=this.y=this.arc=this.site=this.cy=null}function Po(mt){var St=mt.P,Xt=mt.N;if(!(!St||!Xt)){var se=St.site,fe=mt.site,ve=Xt.site;if(se!==ve){var De=fe.x,Ce=fe.y,Qe=se.x-De,Mr=se.y-Ce,br=ve.x-De,jr=ve.y-Ce,Yr=2*(Qe*jr-Mr*br);if(!(Yr>=-zt)){var tn=Qe*Qe+Mr*Mr,Rn=br*br+jr*jr,sn=(jr*tn-Mr*Rn)/Yr,Mn=(Qe*Rn-br*tn)/Yr,jr=Mn+Ce,In=Pi.pop()||new ms;In.arc=mt,In.site=fe,In.x=sn+De,In.y=jr+Math.sqrt(sn*sn+Mn*Mn),In.cy=jr,mt.circle=In;for(var Dn=null,jn=Do._;jn;)if(In.y<jn.y||In.y===jn.y&&In.x<=jn.x)if(jn.L)jn=jn.L;else{Dn=jn.P;break}else if(jn.R)jn=jn.R;else{Dn=jn;break}Do.insert(Dn,In),Dn||(Ao=In)}}}}function rs(mt){var St=mt.circle;St&&(St.P||(Ao=St.N),Do.remove(St),Pi.push(St),Zs(St),mt.circle=null)}function hl(mt,St,Xt,se){return function(fe){var ve=fe.a,De=fe.b,Ce=ve.x,Qe=ve.y,Mr=De.x,br=De.y,jr=0,Yr=1,tn=Mr-Ce,Rn=br-Qe,sn;if(sn=mt-Ce,!(!tn&&sn>0)){if(sn/=tn,tn<0){if(sn<jr)return;sn<Yr&&(Yr=sn)}else if(tn>0){if(sn>Yr)return;sn>jr&&(jr=sn)}if(sn=Xt-Ce,!(!tn&&sn<0)){if(sn/=tn,tn<0){if(sn>Yr)return;sn>jr&&(jr=sn)}else if(tn>0){if(sn<jr)return;sn<Yr&&(Yr=sn)}if(sn=St-Qe,!(!Rn&&sn>0)){if(sn/=Rn,Rn<0){if(sn<jr)return;sn<Yr&&(Yr=sn)}else if(Rn>0){if(sn>Yr)return;sn>jr&&(jr=sn)}if(sn=se-Qe,!(!Rn&&sn<0)){if(sn/=Rn,Rn<0){if(sn>Yr)return;sn>jr&&(jr=sn)}else if(Rn>0){if(sn<jr)return;sn<Yr&&(Yr=sn)}return jr>0&&(fe.a={x:Ce+jr*tn,y:Qe+jr*Rn}),Yr<1&&(fe.b={x:Ce+Yr*tn,y:Qe+Yr*Rn}),fe}}}}}}function za(mt){for(var St=ai,Xt=hl(mt[0][0],mt[0][1],mt[1][0],mt[1][1]),se=St.length,fe;se--;)fe=St[se],(!Oi(fe,mt)||!Xt(fe)||l(fe.a.x-fe.b.x)<qt&&l(fe.a.y-fe.b.y)<qt)&&(fe.a=fe.b=null,St.splice(se,1))}function Oi(mt,St){var Xt=mt.b;if(Xt)return!0;var se=mt.a,fe=St[0][0],ve=St[1][0],De=St[0][1],Ce=St[1][1],Qe=mt.l,Mr=mt.r,br=Qe.x,jr=Qe.y,Yr=Mr.x,tn=Mr.y,Rn=(br+Yr)/2,sn=(jr+tn)/2,Mn,In;if(tn===jr){if(Rn<fe||Rn>=ve)return;if(br>Yr){if(!se)se={x:Rn,y:De};else if(se.y>=Ce)return;Xt={x:Rn,y:Ce}}else{if(!se)se={x:Rn,y:Ce};else if(se.y<De)return;Xt={x:Rn,y:De}}}else if(Mn=(br-Yr)/(tn-jr),In=sn-Mn*Rn,Mn<-1||Mn>1)if(br>Yr){if(!se)se={x:(De-In)/Mn,y:De};else if(se.y>=Ce)return;Xt={x:(Ce-In)/Mn,y:Ce}}else{if(!se)se={x:(Ce-In)/Mn,y:Ce};else if(se.y<De)return;Xt={x:(De-In)/Mn,y:De}}else if(jr<tn){if(!se)se={x:fe,y:Mn*fe+In};else if(se.x>=ve)return;Xt={x:ve,y:Mn*ve+In}}else{if(!se)se={x:ve,y:Mn*ve+In};else if(se.x<fe)return;Xt={x:fe,y:Mn*fe+In}}return mt.a=se,mt.b=Xt,!0}function Bi(mt,St){this.l=mt,this.r=St,this.a=this.b=null}function Ro(mt,St,Xt,se){var fe=new Bi(mt,St);return ai.push(fe),Xt&&Ci(fe,mt,St,Xt),se&&Ci(fe,St,mt,se),yi[mt.i].edges.push(new fl(fe,mt,St)),yi[St.i].edges.push(new fl(fe,St,mt)),fe}function Fo(mt,St,Xt){var se=new Bi(mt,null);return se.a=St,se.b=Xt,ai.push(se),se}function Ci(mt,St,Xt,se){!mt.a&&!mt.b?(mt.a=se,mt.l=St,mt.r=Xt):mt.l===Xt?mt.b=se:mt.a=se}function fl(mt,St,Xt){var se=mt.a,fe=mt.b;this.edge=mt,this.site=St,this.angle=Xt?Math.atan2(Xt.y-St.y,Xt.x-St.x):mt.l===St?Math.atan2(fe.x-se.x,se.y-fe.y):Math.atan2(se.x-fe.x,fe.y-se.y)}fl.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}};function ql(){this._=null}function Zs(mt){mt.U=mt.C=mt.L=mt.R=mt.P=mt.N=null}ql.prototype={insert:function(mt,St){var Xt,se,fe;if(mt){if(St.P=mt,St.N=mt.N,mt.N&&(mt.N.P=St),mt.N=St,mt.R){for(mt=mt.R;mt.L;)mt=mt.L;mt.L=St}else mt.R=St;Xt=mt}else this._?(mt=Es(this._),St.P=null,St.N=mt,mt.P=mt.L=St,Xt=mt):(St.P=St.N=null,this._=St,Xt=null);for(St.L=St.R=null,St.U=Xt,St.C=!0,mt=St;Xt&&Xt.C;)se=Xt.U,Xt===se.L?(fe=se.R,fe&&fe.C?(Xt.C=fe.C=!1,se.C=!0,mt=se):(mt===Xt.R&&(Hl(this,Xt),mt=Xt,Xt=mt.U),Xt.C=!1,se.C=!0,Us(this,se))):(fe=se.L,fe&&fe.C?(Xt.C=fe.C=!1,se.C=!0,mt=se):(mt===Xt.L&&(Us(this,Xt),mt=Xt,Xt=mt.U),Xt.C=!1,se.C=!0,Hl(this,se))),Xt=mt.U;this._.C=!1},remove:function(mt){mt.N&&(mt.N.P=mt.P),mt.P&&(mt.P.N=mt.N),mt.N=mt.P=null;var St=mt.U,Xt,se=mt.L,fe=mt.R,ve,De;if(se?fe?ve=Es(fe):ve=se:ve=fe,St?St.L===mt?St.L=ve:St.R=ve:this._=ve,se&&fe?(De=ve.C,ve.C=mt.C,ve.L=se,se.U=ve,ve!==fe?(St=ve.U,ve.U=mt.U,mt=ve.R,St.L=mt,ve.R=fe,fe.U=ve):(ve.U=St,St=ve,mt=ve.R)):(De=mt.C,mt=ve),mt&&(mt.U=St),!De){if(mt&&mt.C){mt.C=!1;return}do{if(mt===this._)break;if(mt===St.L){if(Xt=St.R,Xt.C&&(Xt.C=!1,St.C=!0,Hl(this,St),Xt=St.R),Xt.L&&Xt.L.C||Xt.R&&Xt.R.C){(!Xt.R||!Xt.R.C)&&(Xt.L.C=!1,Xt.C=!0,Us(this,Xt),Xt=St.R),Xt.C=St.C,St.C=Xt.R.C=!1,Hl(this,St),mt=this._;break}}else if(Xt=St.L,Xt.C&&(Xt.C=!1,St.C=!0,Us(this,St),Xt=St.L),Xt.L&&Xt.L.C||Xt.R&&Xt.R.C){(!Xt.L||!Xt.L.C)&&(Xt.R.C=!1,Xt.C=!0,Hl(this,Xt),Xt=St.L),Xt.C=St.C,St.C=Xt.L.C=!1,Us(this,St),mt=this._;break}Xt.C=!0,mt=St,St=St.U}while(!mt.C);mt&&(mt.C=!1)}}};function Hl(mt,St){var Xt=St,se=St.R,fe=Xt.U;fe?fe.L===Xt?fe.L=se:fe.R=se:mt._=se,se.U=fe,Xt.U=se,Xt.R=se.L,Xt.R&&(Xt.R.U=Xt),se.L=Xt}function Us(mt,St){var Xt=St,se=St.L,fe=Xt.U;fe?fe.L===Xt?fe.L=se:fe.R=se:mt._=se,se.U=fe,Xt.U=se,Xt.L=se.R,Xt.L&&(Xt.L.U=Xt),se.R=Xt}function Es(mt){for(;mt.L;)mt=mt.L;return mt}function El(mt,St){var Xt=mt.sort(Wu).pop(),se,fe,ve;for(ai=[],yi=new Array(mt.length),Si=new ql,Do=new ql;;)if(ve=Ao,Xt&&(!ve||Xt.y<ve.y||Xt.y===ve.y&&Xt.x<ve.x))(Xt.x!==se||Xt.y!==fe)&&(yi[Xt.i]=new Ls(Xt),Xi(Xt),se=Xt.x,fe=Xt.y),Xt=mt.pop();else if(ve)ls(ve.arc);else break;St&&(za(St),fs(St));var De={cells:yi,edges:ai};return Si=Do=ai=yi=null,De}function Wu(mt,St){return St.y-mt.y||St.x-mt.x}c.geom.voronoi=function(mt){var St=pi,Xt=bi,se=St,fe=Xt,ve=Mu;if(mt)return De(mt);function De(Qe){var Mr=new Array(Qe.length),br=ve[0][0],jr=ve[0][1],Yr=ve[1][0],tn=ve[1][1];return El(Ce(Qe),ve).cells.forEach(function(Rn,sn){var Mn=Rn.edges,In=Rn.site,Dn=Mr[sn]=Mn.length?Mn.map(function(jn){var xn=jn.start();return[xn.x,xn.y]}):In.x>=br&&In.x<=Yr&&In.y>=jr&&In.y<=tn?[[br,tn],[Yr,tn],[Yr,jr],[br,jr]]:[];Dn.point=Qe[sn]}),Mr}function Ce(Qe){return Qe.map(function(Mr,br){return{x:Math.round(se(Mr,br)/qt)*qt,y:Math.round(fe(Mr,br)/qt)*qt,i:br}})}return De.links=function(Qe){return El(Ce(Qe)).edges.filter(function(Mr){return Mr.l&&Mr.r}).map(function(Mr){return{source:Qe[Mr.l.i],target:Qe[Mr.r.i]}})},De.triangles=function(Qe){var Mr=[];return El(Ce(Qe)).cells.forEach(function(br,jr){for(var Yr=br.site,tn=br.edges.sort(qi),Rn=-1,sn=tn.length,Mn,In,Dn=tn[sn-1].edge,jn=Dn.l===Yr?Dn.r:Dn.l;++Rn<sn;)Mn=Dn,In=jn,Dn=tn[Rn].edge,jn=Dn.l===Yr?Dn.r:Dn.l,jr<In.i&&jr<jn.i&&Fu(Yr,In,jn)<0&&Mr.push([Qe[jr],Qe[In.i],Qe[jn.i]])}),Mr},De.x=function(Qe){return arguments.length?(se=_e(St=Qe),De):St},De.y=function(Qe){return arguments.length?(fe=_e(Xt=Qe),De):Xt},De.clipExtent=function(Qe){return arguments.length?(ve=Qe??Mu,De):ve===Mu?null:ve},De.size=function(Qe){return arguments.length?De.clipExtent(Qe&&[[0,0],Qe]):ve===Mu?null:ve&&ve[1]},De};var Mu=[[-1e6,-1e6],[1e6,1e6]];function Fu(mt,St,Xt){return(mt.x-Xt.x)*(St.y-mt.y)-(mt.x-St.x)*(Xt.y-mt.y)}c.geom.delaunay=function(mt){return c.geom.voronoi().triangles(mt)},c.geom.quadtree=function(mt,St,Xt,se,fe){var ve=pi,De=bi,Ce;if(Ce=arguments.length)return ve=_h,De=ih,Ce===3&&(fe=Xt,se=St,Xt=St=0),Qe(mt);function Qe(Mr){var br,jr=_e(ve),Yr=_e(De),tn,Rn,sn,Mn,In,Dn,jn,xn;if(St!=null)In=St,Dn=Xt,jn=se,xn=fe;else if(jn=xn=-(In=Dn=1/0),tn=[],Rn=[],Mn=Mr.length,Ce)for(sn=0;sn<Mn;++sn)br=Mr[sn],br.x<In&&(In=br.x),br.y<Dn&&(Dn=br.y),br.x>jn&&(jn=br.x),br.y>xn&&(xn=br.y),tn.push(br.x),Rn.push(br.y);else for(sn=0;sn<Mn;++sn){var _a=+jr(br=Mr[sn],sn),La=+Yr(br,sn);_a<In&&(In=_a),La<Dn&&(Dn=La),_a>jn&&(jn=_a),La>xn&&(xn=La),tn.push(_a),Rn.push(La)}var $a=jn-In,ti=xn-Dn;$a>ti?xn=Dn+$a:jn=In+ti;function ii(gi,Ji,qo,Ys,_s,Ja,yo,Lo){if(!(isNaN(qo)||isNaN(Ys)))if(gi.leaf){var bs=gi.x,us=gi.y;if(bs!=null)if(l(bs-qo)+l(us-Ys)<.01)di(gi,Ji,qo,Ys,_s,Ja,yo,Lo);else{var eu=gi.point;gi.x=gi.y=gi.point=null,di(gi,eu,bs,us,_s,Ja,yo,Lo),di(gi,Ji,qo,Ys,_s,Ja,yo,Lo)}else gi.x=qo,gi.y=Ys,gi.point=Ji}else di(gi,Ji,qo,Ys,_s,Ja,yo,Lo)}function di(gi,Ji,qo,Ys,_s,Ja,yo,Lo){var bs=(_s+yo)*.5,us=(Ja+Lo)*.5,eu=qo>=bs,Yo=Ys>=us,gs=Yo<<1|eu;gi.leaf=!1,gi=gi.nodes[gs]||(gi.nodes[gs]=ns()),eu?_s=bs:yo=bs,Yo?Ja=us:Lo=us,ii(gi,Ji,qo,Ys,_s,Ja,yo,Lo)}var Io=ns();if(Io.add=function(gi){ii(Io,gi,+jr(gi,++sn),+Yr(gi,sn),In,Dn,jn,xn)},Io.visit=function(gi){du(gi,Io,In,Dn,jn,xn)},Io.find=function(gi){return Ic(Io,gi[0],gi[1],In,Dn,jn,xn)},sn=-1,St==null){for(;++sn<Mn;)ii(Io,Mr[sn],tn[sn],Rn[sn],In,Dn,jn,xn);--sn}else Mr.forEach(Io.add);return tn=Rn=Mr=br=null,Io}return Qe.x=function(Mr){return arguments.length?(ve=Mr,Qe):ve},Qe.y=function(Mr){return arguments.length?(De=Mr,Qe):De},Qe.extent=function(Mr){return arguments.length?(Mr==null?St=Xt=se=fe=null:(St=+Mr[0][0],Xt=+Mr[0][1],se=+Mr[1][0],fe=+Mr[1][1]),Qe):St==null?null:[[St,Xt],[se,fe]]},Qe.size=function(Mr){return arguments.length?(Mr==null?St=Xt=se=fe=null:(St=Xt=0,se=+Mr[0],fe=+Mr[1]),Qe):St==null?null:[se-St,fe-Xt]},Qe};function _h(mt){return mt.x}function ih(mt){return mt.y}function ns(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function du(mt,St,Xt,se,fe,ve){if(!mt(St,Xt,se,fe,ve)){var De=(Xt+fe)*.5,Ce=(se+ve)*.5,Qe=St.nodes;Qe[0]&&du(mt,Qe[0],Xt,se,De,Ce),Qe[1]&&du(mt,Qe[1],De,se,fe,Ce),Qe[2]&&du(mt,Qe[2],Xt,Ce,De,ve),Qe[3]&&du(mt,Qe[3],De,Ce,fe,ve)}}function Ic(mt,St,Xt,se,fe,ve,De){var Ce=1/0,Qe;return function Mr(br,jr,Yr,tn,Rn){if(!(jr>ve||Yr>De||tn<se||Rn<fe)){if(sn=br.point){var sn,Mn=St-br.x,In=Xt-br.y,Dn=Mn*Mn+In*In;if(Dn<Ce){var jn=Math.sqrt(Ce=Dn);se=St-jn,fe=Xt-jn,ve=St+jn,De=Xt+jn,Qe=sn}}for(var xn=br.nodes,_a=(jr+tn)*.5,La=(Yr+Rn)*.5,$a=St>=_a,ti=Xt>=La,ii=ti<<1|$a,di=ii+4;ii<di;++ii)if(br=xn[ii&3])switch(ii&3){case 0:Mr(br,jr,Yr,_a,La);break;case 1:Mr(br,_a,Yr,tn,La);break;case 2:Mr(br,jr,La,_a,Rn);break;case 3:Mr(br,_a,La,tn,Rn);break}}}(mt,se,fe,ve,De),Qe}c.interpolateRgb=ll;function ll(mt,St){mt=c.rgb(mt),St=c.rgb(St);var Xt=mt.r,se=mt.g,fe=mt.b,ve=St.r-Xt,De=St.g-se,Ce=St.b-fe;return function(Qe){return"#"+dr(Math.round(Xt+ve*Qe))+dr(Math.round(se+De*Qe))+dr(Math.round(fe+Ce*Qe))}}c.interpolateObject=el;function el(mt,St){var Xt={},se={},fe;for(fe in mt)fe in St?Xt[fe]=$o(mt[fe],St[fe]):se[fe]=mt[fe];for(fe in St)fe in mt||(se[fe]=St[fe]);return function(ve){for(fe in Xt)se[fe]=Xt[fe](ve);return se}}c.interpolateNumber=ul;function ul(mt,St){return mt=+mt,St=+St,function(Xt){return mt*(1-Xt)+St*Xt}}c.interpolateString=Zu;function Zu(mt,St){var Xt=ys.lastIndex=pl.lastIndex=0,se,fe,ve,De=-1,Ce=[],Qe=[];for(mt=mt+"",St=St+"";(se=ys.exec(mt))&&(fe=pl.exec(St));)(ve=fe.index)>Xt&&(ve=St.slice(Xt,ve),Ce[De]?Ce[De]+=ve:Ce[++De]=ve),(se=se[0])===(fe=fe[0])?Ce[De]?Ce[De]+=fe:Ce[++De]=fe:(Ce[++De]=null,Qe.push({i:De,x:ul(se,fe)})),Xt=pl.lastIndex;return Xt<St.length&&(ve=St.slice(Xt),Ce[De]?Ce[De]+=ve:Ce[++De]=ve),Ce.length<2?Qe[0]?(St=Qe[0].x,function(Mr){return St(Mr)+""}):function(){return St}:(St=Qe.length,function(Mr){for(var br=0,jr;br<St;++br)Ce[(jr=Qe[br]).i]=jr.x(Mr);return Ce.join("")})}var ys=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pl=new RegExp(ys.source,"g");c.interpolate=$o;function $o(mt,St){for(var Xt=c.interpolators.length,se;--Xt>=0&&!(se=c.interpolators[Xt](mt,St)););return se}c.interpolators=[function(mt,St){var Xt=typeof St;return(Xt==="string"?Jr.has(St.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(St)?ll:Zu:St instanceof An?ll:Array.isArray(St)?ks:Xt==="object"&&isNaN(St)?el:ul)(mt,St)}],c.interpolateArray=ks;function ks(mt,St){var Xt=[],se=[],fe=mt.length,ve=St.length,De=Math.min(mt.length,St.length),Ce;for(Ce=0;Ce<De;++Ce)Xt.push($o(mt[Ce],St[Ce]));for(;Ce<fe;++Ce)se[Ce]=mt[Ce];for(;Ce<ve;++Ce)se[Ce]=St[Ce];return function(Qe){for(Ce=0;Ce<De;++Ce)se[Ce]=Xt[Ce](Qe);return se}}var Bu=function(){return B},Ol=c.map({linear:Bu,poly:pc,quad:function(){return Oh},cubic:function(){return as},sin:function(){return gu},exp:function(){return Pl},circle:function(){return Wc},elastic:$u,back:dc,bounce:function(){return rl}}),Xu=c.map({in:B,out:zh,"in-out":Mo,"out-in":function(mt){return Mo(zh(mt))}});c.ease=function(mt){var St=mt.indexOf("-"),Xt=St>=0?mt.slice(0,St):mt,se=St>=0?mt.slice(St+1):"in";return Xt=Ol.get(Xt)||Bu,se=Xu.get(se)||B,Cs(se(Xt.apply(null,g.call(arguments,1))))};function Cs(mt){return function(St){return St<=0?0:St>=1?1:mt(St)}}function zh(mt){return function(St){return 1-mt(1-St)}}function Mo(mt){return function(St){return .5*(St<.5?mt(2*St):2-mt(2-2*St))}}function Oh(mt){return mt*mt}function as(mt){return mt*mt*mt}function io(mt){if(mt<=0)return 0;if(mt>=1)return 1;var St=mt*mt,Xt=St*mt;return 4*(mt<.5?Xt:3*(mt-St)+Xt-.75)}function pc(mt){return function(St){return Math.pow(St,mt)}}function gu(mt){return 1-Math.cos(mt*Ot)}function Pl(mt){return Math.pow(2,10*(mt-1))}function Wc(mt){return 1-Math.sqrt(1-mt*mt)}function $u(mt,St){var Xt;return arguments.length<2&&(St=.45),arguments.length?Xt=St/yt*Math.asin(1/mt):(mt=1,Xt=St/4),function(se){return 1+mt*Math.pow(2,-10*se)*Math.sin((se-Xt)*yt/St)}}function dc(mt){return mt||(mt=1.70158),function(St){return St*St*((mt+1)*St-mt)}}function rl(mt){return mt<1/2.75?7.5625*mt*mt:mt<2/2.75?7.5625*(mt-=1.5/2.75)*mt+.75:mt<2.5/2.75?7.5625*(mt-=2.25/2.75)*mt+.9375:7.5625*(mt-=2.625/2.75)*mt+.984375}c.interpolateHcl=oh;function oh(mt,St){mt=c.hcl(mt),St=c.hcl(St);var Xt=mt.h,se=mt.c,fe=mt.l,ve=St.h-Xt,De=St.c-se,Ce=St.l-fe;return isNaN(De)&&(De=0,se=isNaN(se)?St.c:se),isNaN(ve)?(ve=0,Xt=isNaN(Xt)?St.h:Xt):ve>180?ve-=360:ve<-180&&(ve+=360),function(Qe){return je(Xt+ve*Qe,se+De*Qe,fe+Ce*Qe)+""}}c.interpolateHsl=Zc;function Zc(mt,St){mt=c.hsl(mt),St=c.hsl(St);var Xt=mt.h,se=mt.s,fe=mt.l,ve=St.h-Xt,De=St.s-se,Ce=St.l-fe;return isNaN(De)&&(De=0,se=isNaN(se)?St.s:se),isNaN(ve)?(ve=0,Xt=isNaN(Xt)?St.h:Xt):ve>180?ve-=360:ve<-180&&(ve+=360),function(Qe){return Nn(Xt+ve*Qe,se+De*Qe,fe+Ce*Qe)+""}}c.interpolateLab=Lc;function Lc(mt,St){mt=c.lab(mt),St=c.lab(St);var Xt=mt.l,se=mt.a,fe=mt.b,ve=St.l-Xt,De=St.a-se,Ce=St.b-fe;return function(Qe){return bn(Xt+ve*Qe,se+De*Qe,fe+Ce*Qe)+""}}c.interpolateRound=Ju;function Ju(mt,St){return St-=mt,function(Xt){return Math.round(mt+St*Xt)}}c.transform=function(mt){var St=A.createElementNS(c.ns.prefix.svg,"g");return(c.transform=function(Xt){if(Xt!=null){St.setAttribute("transform",Xt);var se=St.transform.baseVal.consolidate()}return new Cc(se?se.matrix:nc)})(mt)};function Cc(mt){var St=[mt.a,mt.b],Xt=[mt.c,mt.d],se=mu(St),fe=Xc(St,Xt),ve=mu($c(Xt,St,-fe))||0;St[0]*Xt[1]<Xt[0]*St[1]&&(St[0]*=-1,St[1]*=-1,se*=-1,fe*=-1),this.rotate=(se?Math.atan2(St[1],St[0]):Math.atan2(-Xt[0],Xt[1]))*ee,this.translate=[mt.e,mt.f],this.scale=[se,ve],this.skew=ve?Math.atan2(fe,ve)*ee:0}Cc.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};function Xc(mt,St){return mt[0]*St[0]+mt[1]*St[1]}function mu(mt){var St=Math.sqrt(Xc(mt,mt));return St&&(mt[0]/=St,mt[1]/=St),St}function $c(mt,St,Xt){return mt[0]+=Xt*St[0],mt[1]+=Xt*St[1],mt}var nc={a:1,b:0,c:0,d:1,e:0,f:0};c.interpolateTransform=Dc;function vu(mt){return mt.length?mt.pop()+",":""}function Gl(mt,St,Xt,se){if(mt[0]!==St[0]||mt[1]!==St[1]){var fe=Xt.push("translate(",null,",",null,")");se.push({i:fe-4,x:ul(mt[0],St[0])},{i:fe-2,x:ul(mt[1],St[1])})}else(St[0]||St[1])&&Xt.push("translate("+St+")")}function yc(mt,St,Xt,se){mt!==St?(mt-St>180?St+=360:St-mt>180&&(mt+=360),se.push({i:Xt.push(vu(Xt)+"rotate(",null,")")-2,x:ul(mt,St)})):St&&Xt.push(vu(Xt)+"rotate("+St+")")}function Jc(mt,St,Xt,se){mt!==St?se.push({i:Xt.push(vu(Xt)+"skewX(",null,")")-2,x:ul(mt,St)}):St&&Xt.push(vu(Xt)+"skewX("+St+")")}function ps(mt,St,Xt,se){if(mt[0]!==St[0]||mt[1]!==St[1]){var fe=Xt.push(vu(Xt)+"scale(",null,",",null,")");se.push({i:fe-4,x:ul(mt[0],St[0])},{i:fe-2,x:ul(mt[1],St[1])})}else(St[0]!==1||St[1]!==1)&&Xt.push(vu(Xt)+"scale("+St+")")}function Dc(mt,St){var Xt=[],se=[];return mt=c.transform(mt),St=c.transform(St),Gl(mt.translate,St.translate,Xt,se),yc(mt.rotate,St.rotate,Xt,se),Jc(mt.skew,St.skew,Xt,se),ps(mt.scale,St.scale,Xt,se),mt=St=null,function(fe){for(var ve=-1,De=se.length,Ce;++ve<De;)Xt[(Ce=se[ve]).i]=Ce.x(fe);return Xt.join("")}}function Fh(mt,St){return St=(St-=mt=+mt)||1/St,function(Xt){return(Xt-mt)/St}}function sh(mt,St){return St=(St-=mt=+mt)||1/St,function(Xt){return Math.max(0,Math.min(1,(Xt-mt)/St))}}c.layout={},c.layout.bundle=function(){return function(mt){for(var St=[],Xt=-1,se=mt.length;++Xt<se;)St.push(xc(mt[Xt]));return St}};function xc(mt){for(var St=mt.source,Xt=mt.target,se=Wl(St,Xt),fe=[St];St!==se;)St=St.parent,fe.push(St);for(var ve=fe.length;Xt!==se;)fe.splice(ve,0,Xt),Xt=Xt.parent;return fe}function lh(mt){for(var St=[],Xt=mt.parent;Xt!=null;)St.push(mt),mt=Xt,Xt=Xt.parent;return St.push(mt),St}function Wl(mt,St){if(mt===St)return mt;for(var Xt=lh(mt),se=lh(St),fe=Xt.pop(),ve=se.pop(),De=null;fe===ve;)De=fe,fe=Xt.pop(),ve=se.pop();return De}c.layout.chord=function(){var mt={},St,Xt,se,fe,ve=0,De,Ce,Qe;function Mr(){var jr={},Yr=[],tn=c.range(fe),Rn=[],sn,Mn,In,Dn,jn;for(St=[],Xt=[],sn=0,Dn=-1;++Dn<fe;){for(Mn=0,jn=-1;++jn<fe;)Mn+=se[Dn][jn];Yr.push(Mn),Rn.push(c.range(fe)),sn+=Mn}for(De&&tn.sort(function(Io,gi){return De(Yr[Io],Yr[gi])}),Ce&&Rn.forEach(function(Io,gi){Io.sort(function(Ji,qo){return Ce(se[gi][Ji],se[gi][qo])})}),sn=(yt-ve*fe)/sn,Mn=0,Dn=-1;++Dn<fe;){for(In=Mn,jn=-1;++jn<fe;){var xn=tn[Dn],_a=Rn[xn][jn],La=se[xn][_a],$a=Mn,ti=Mn+=La*sn;jr[xn+"-"+_a]={index:xn,subindex:_a,startAngle:$a,endAngle:ti,value:La}}Xt[xn]={index:xn,startAngle:In,endAngle:Mn,value:Yr[xn]},Mn+=ve}for(Dn=-1;++Dn<fe;)for(jn=Dn-1;++jn<fe;){var ii=jr[Dn+"-"+jn],di=jr[jn+"-"+Dn];(ii.value||di.value)&&St.push(ii.value<di.value?{source:di,target:ii}:{source:ii,target:di})}Qe&&br()}function br(){St.sort(function(jr,Yr){return Qe((jr.source.value+jr.target.value)/2,(Yr.source.value+Yr.target.value)/2)})}return mt.matrix=function(jr){return arguments.length?(fe=(se=jr)&&se.length,St=Xt=null,mt):se},mt.padding=function(jr){return arguments.length?(ve=jr,St=Xt=null,mt):ve},mt.sortGroups=function(jr){return arguments.length?(De=jr,St=Xt=null,mt):De},mt.sortSubgroups=function(jr){return arguments.length?(Ce=jr,St=null,mt):Ce},mt.sortChords=function(jr){return arguments.length?(Qe=jr,St&&br(),mt):Qe},mt.chords=function(){return St||Mr(),St},mt.groups=function(){return Xt||Mr(),Xt},mt},c.layout.force=function(){var mt={},St=c.dispatch("start","tick","end"),Xt,se=[1,1],fe,ve,De=.9,Ce=Qu,Qe=yu,Mr=-30,br=Xl,jr=.1,Yr=.64,tn=[],Rn=[],sn,Mn,In;function Dn(xn){return function(_a,La,$a,ti){if(_a.point!==xn){var ii=_a.cx-xn.x,di=_a.cy-xn.y,Io=ti-La,gi=ii*ii+di*di;if(Io*Io/Yr<gi){if(gi<br){var Ji=_a.charge/gi;xn.px-=ii*Ji,xn.py-=di*Ji}return!0}if(_a.point&&gi&&gi<br){var Ji=_a.pointCharge/gi;xn.px-=ii*Ji,xn.py-=di*Ji}}return!_a.charge}}mt.tick=function(){if((ve*=.99)<.005)return Xt=null,St.end({type:"end",alpha:ve=0}),!0;var xn=tn.length,_a=Rn.length,La,$a,ti,ii,di,Io,gi,Ji,qo;for($a=0;$a<_a;++$a)ti=Rn[$a],ii=ti.source,di=ti.target,Ji=di.x-ii.x,qo=di.y-ii.y,(Io=Ji*Ji+qo*qo)&&(Io=ve*Mn[$a]*((Io=Math.sqrt(Io))-sn[$a])/Io,Ji*=Io,qo*=Io,di.x-=Ji*(gi=ii.weight+di.weight?ii.weight/(ii.weight+di.weight):.5),di.y-=qo*gi,ii.x+=Ji*(gi=1-gi),ii.y+=qo*gi);if((gi=ve*jr)&&(Ji=se[0]/2,qo=se[1]/2,$a=-1,gi))for(;++$a<xn;)ti=tn[$a],ti.x+=(Ji-ti.x)*gi,ti.y+=(qo-ti.y)*gi;if(Mr)for(Xs(La=c.geom.quadtree(tn),ve,In),$a=-1;++$a<xn;)(ti=tn[$a]).fixed||La.visit(Dn(ti));for($a=-1;++$a<xn;)ti=tn[$a],ti.fixed?(ti.x=ti.px,ti.y=ti.py):(ti.x-=(ti.px-(ti.px=ti.x))*De,ti.y-=(ti.py-(ti.py=ti.y))*De);St.tick({type:"tick",alpha:ve})},mt.nodes=function(xn){return arguments.length?(tn=xn,mt):tn},mt.links=function(xn){return arguments.length?(Rn=xn,mt):Rn},mt.size=function(xn){return arguments.length?(se=xn,mt):se},mt.linkDistance=function(xn){return arguments.length?(Ce=typeof xn=="function"?xn:+xn,mt):Ce},mt.distance=mt.linkDistance,mt.linkStrength=function(xn){return arguments.length?(Qe=typeof xn=="function"?xn:+xn,mt):Qe},mt.friction=function(xn){return arguments.length?(De=+xn,mt):De},mt.charge=function(xn){return arguments.length?(Mr=typeof xn=="function"?xn:+xn,mt):Mr},mt.chargeDistance=function(xn){return arguments.length?(br=xn*xn,mt):Math.sqrt(br)},mt.gravity=function(xn){return arguments.length?(jr=+xn,mt):jr},mt.theta=function(xn){return arguments.length?(Yr=xn*xn,mt):Math.sqrt(Yr)},mt.alpha=function(xn){return arguments.length?(xn=+xn,ve?xn>0?ve=xn:(Xt.c=null,Xt.t=NaN,Xt=null,St.end({type:"end",alpha:ve=0})):xn>0&&(St.start({type:"start",alpha:ve=xn}),Xt=Qn(mt.tick)),mt):ve},mt.start=function(){var xn,_a=tn.length,La=Rn.length,$a=se[0],ti=se[1],ii,di;for(xn=0;xn<_a;++xn)(di=tn[xn]).index=xn,di.weight=0;for(xn=0;xn<La;++xn)di=Rn[xn],typeof di.source=="number"&&(di.source=tn[di.source]),typeof di.target=="number"&&(di.target=tn[di.target]),++di.source.weight,++di.target.weight;for(xn=0;xn<_a;++xn)di=tn[xn],isNaN(di.x)&&(di.x=Io("x",$a)),isNaN(di.y)&&(di.y=Io("y",ti)),isNaN(di.px)&&(di.px=di.x),isNaN(di.py)&&(di.py=di.y);if(sn=[],typeof Ce=="function")for(xn=0;xn<La;++xn)sn[xn]=+Ce.call(this,Rn[xn],xn);else for(xn=0;xn<La;++xn)sn[xn]=Ce;if(Mn=[],typeof Qe=="function")for(xn=0;xn<La;++xn)Mn[xn]=+Qe.call(this,Rn[xn],xn);else for(xn=0;xn<La;++xn)Mn[xn]=Qe;if(In=[],typeof Mr=="function")for(xn=0;xn<_a;++xn)In[xn]=+Mr.call(this,tn[xn],xn);else for(xn=0;xn<_a;++xn)In[xn]=Mr;function Io(gi,Ji){if(!ii){for(ii=new Array(_a),_s=0;_s<_a;++_s)ii[_s]=[];for(_s=0;_s<La;++_s){var qo=Rn[_s];ii[qo.source.index].push(qo.target),ii[qo.target.index].push(qo.source)}}for(var Ys=ii[xn],_s=-1,Ja=Ys.length,yo;++_s<Ja;)if(!isNaN(yo=Ys[_s][gi]))return yo;return Math.random()*Ji}return mt.resume()},mt.resume=function(){return mt.alpha(.1)},mt.stop=function(){return mt.alpha(0)},mt.drag=function(){if(fe||(fe=c.behavior.drag().origin(B).on("dragstart.force",uh).on("drag.force",jn).on("dragend.force",Il)),!arguments.length)return fe;this.on("mouseover.force",Zl).on("mouseout.force",Ru).call(fe)};function jn(xn){xn.px=c.event.x,xn.py=c.event.y,mt.resume()}return c.rebind(mt,St,"on")};function uh(mt){mt.fixed|=2}function Il(mt){mt.fixed&=-7}function Zl(mt){mt.fixed|=4,mt.px=mt.x,mt.py=mt.y}function Ru(mt){mt.fixed&=-5}function Xs(mt,St,Xt){var se=0,fe=0;if(mt.charge=0,!mt.leaf)for(var ve=mt.nodes,De=ve.length,Ce=-1,Qe;++Ce<De;)Qe=ve[Ce],Qe!=null&&(Xs(Qe,St,Xt),mt.charge+=Qe.charge,se+=Qe.charge*Qe.cx,fe+=Qe.charge*Qe.cy);if(mt.point){mt.leaf||(mt.point.x+=Math.random()-.5,mt.point.y+=Math.random()-.5);var Mr=St*Xt[mt.point.index];mt.charge+=mt.pointCharge=Mr,se+=Mr*mt.point.x,fe+=Mr*mt.point.y}mt.cx=se/mt.charge,mt.cy=fe/mt.charge}var Qu=20,yu=1,Xl=1/0;c.layout.hierarchy=function(){var mt=bh,St=Yu,Xt=_c;function se(fe){var ve=[fe],De=[],Ce;for(fe.depth=0;(Ce=ve.pop())!=null;)if(De.push(Ce),(Mr=St.call(se,Ce,Ce.depth))&&(Qe=Mr.length)){for(var Qe,Mr,br;--Qe>=0;)ve.push(br=Mr[Qe]),br.parent=Ce,br.depth=Ce.depth+1;Xt&&(Ce.value=0),Ce.children=Mr}else Xt&&(Ce.value=+Xt.call(se,Ce,Ce.depth)||0),delete Ce.children;return Su(fe,function(jr){var Yr,tn;mt&&(Yr=jr.children)&&Yr.sort(mt),Xt&&(tn=jr.parent)&&(tn.value+=jr.value)}),De}return se.sort=function(fe){return arguments.length?(mt=fe,se):mt},se.children=function(fe){return arguments.length?(St=fe,se):St},se.value=function(fe){return arguments.length?(Xt=fe,se):Xt},se.revalue=function(fe){return Xt&&(gc(fe,function(ve){ve.children&&(ve.value=0)}),Su(fe,function(ve){var De;ve.children||(ve.value=+Xt.call(se,ve,ve.depth)||0),(De=ve.parent)&&(De.value+=ve.value)})),fe},se};function Ds(mt,St){return c.rebind(mt,St,"sort","children","value"),mt.nodes=mt,mt.links=Zh,mt}function gc(mt,St){for(var Xt=[mt];(mt=Xt.pop())!=null;)if(St(mt),(fe=mt.children)&&(se=fe.length))for(var se,fe;--se>=0;)Xt.push(fe[se])}function Su(mt,St){for(var Xt=[mt],se=[];(mt=Xt.pop())!=null;)if(se.push(mt),(De=mt.children)&&(ve=De.length))for(var fe=-1,ve,De;++fe<ve;)Xt.push(De[fe]);for(;(mt=se.pop())!=null;)St(mt)}function Yu(mt){return mt.children}function _c(mt){return mt.value}function bh(mt,St){return St.value-mt.value}function Zh(mt){return c.merge(mt.map(function(St){return(St.children||[]).map(function(Xt){return{source:St,target:Xt}})}))}c.layout.partition=function(){var mt=c.layout.hierarchy(),St=[1,1];function Xt(ve,De,Ce,Qe){var Mr=ve.children;if(ve.x=De,ve.y=ve.depth*Qe,ve.dx=Ce,ve.dy=Qe,Mr&&(jr=Mr.length)){var br=-1,jr,Yr,tn;for(Ce=ve.value?Ce/ve.value:0;++br<jr;)Xt(Yr=Mr[br],De,tn=Yr.value*Ce,Qe),De+=tn}}function se(ve){var De=ve.children,Ce=0;if(De&&(Mr=De.length))for(var Qe=-1,Mr;++Qe<Mr;)Ce=Math.max(Ce,se(De[Qe]));return 1+Ce}function fe(ve,De){var Ce=mt.call(this,ve,De);return Xt(Ce[0],0,St[0],St[1]/se(Ce[0])),Ce}return fe.size=function(ve){return arguments.length?(St=ve,fe):St},Ds(fe,mt)},c.layout.pie=function(){var mt=Number,St=ac,Xt=0,se=yt,fe=0;function ve(De){var Ce=De.length,Qe=De.map(function(Dn,jn){return+mt.call(ve,Dn,jn)}),Mr=+(typeof Xt=="function"?Xt.apply(this,arguments):Xt),br=(typeof se=="function"?se.apply(this,arguments):se)-Mr,jr=Math.min(Math.abs(br)/Ce,+(typeof fe=="function"?fe.apply(this,arguments):fe)),Yr=jr*(br<0?-1:1),tn=c.sum(Qe),Rn=tn?(br-Ce*Yr)/tn:0,sn=c.range(Ce),Mn=[],In;return St!=null&&sn.sort(St===ac?function(Dn,jn){return Qe[jn]-Qe[Dn]}:function(Dn,jn){return St(De[Dn],De[jn])}),sn.forEach(function(Dn){Mn[Dn]={data:De[Dn],value:In=Qe[Dn],startAngle:Mr,endAngle:Mr+=In*Rn+Yr,padAngle:jr}}),Mn}return ve.value=function(De){return arguments.length?(mt=De,ve):mt},ve.sort=function(De){return arguments.length?(St=De,ve):St},ve.startAngle=function(De){return arguments.length?(Xt=De,ve):Xt},ve.endAngle=function(De){return arguments.length?(se=De,ve):se},ve.padAngle=function(De){return arguments.length?(fe=De,ve):fe},ve};var ac={};c.layout.stack=function(){var mt=B,St=Oc,Xt=Ku,se=zc,fe=bc,ve=Ll;function De(Ce,Qe){if(!(Rn=Ce.length))return Ce;var Mr=Ce.map(function(Dn,jn){return mt.call(De,Dn,jn)}),br=Mr.map(function(Dn){return Dn.map(function(jn,xn){return[fe.call(De,jn,xn),ve.call(De,jn,xn)]})}),jr=St.call(De,br,Qe);Mr=c.permute(Mr,jr),br=c.permute(br,jr);var Yr=Xt.call(De,br,Qe),tn=Mr[0].length,Rn,sn,Mn,In;for(Mn=0;Mn<tn;++Mn)for(se.call(De,Mr[0][Mn],In=Yr[Mn],br[0][Mn][1]),sn=1;sn<Rn;++sn)se.call(De,Mr[sn][Mn],In+=br[sn-1][Mn][1],br[sn][Mn][1]);return Ce}return De.values=function(Ce){return arguments.length?(mt=Ce,De):mt},De.order=function(Ce){return arguments.length?(St=typeof Ce=="function"?Ce:$l.get(Ce)||Oc,De):St},De.offset=function(Ce){return arguments.length?(Xt=typeof Ce=="function"?Ce:ic.get(Ce)||Ku,De):Xt},De.x=function(Ce){return arguments.length?(fe=Ce,De):fe},De.y=function(Ce){return arguments.length?(ve=Ce,De):ve},De.out=function(Ce){return arguments.length?(se=Ce,De):se},De};function bc(mt){return mt.x}function Ll(mt){return mt.y}function zc(mt,St,Xt){mt.y0=St,mt.y=Xt}var $l=c.map({"inside-out":function(mt){var St=mt.length,Xt,se,fe=mt.map(Os),ve=mt.map(Eu),De=c.range(St).sort(function(jr,Yr){return fe[jr]-fe[Yr]}),Ce=0,Qe=0,Mr=[],br=[];for(Xt=0;Xt<St;++Xt)se=De[Xt],Ce<Qe?(Ce+=ve[se],Mr.push(se)):(Qe+=ve[se],br.push(se));return br.reverse().concat(Mr)},reverse:function(mt){return c.range(mt.length).reverse()},default:Oc}),ic=c.map({silhouette:function(mt){var St=mt.length,Xt=mt[0].length,se=[],fe=0,ve,De,Ce,Qe=[];for(De=0;De<Xt;++De){for(ve=0,Ce=0;ve<St;ve++)Ce+=mt[ve][De][1];Ce>fe&&(fe=Ce),se.push(Ce)}for(De=0;De<Xt;++De)Qe[De]=(fe-se[De])/2;return Qe},wiggle:function(mt){var St=mt.length,Xt=mt[0],se=Xt.length,fe,ve,De,Ce,Qe,Mr,br,jr,Yr,tn=[];for(tn[0]=jr=Yr=0,ve=1;ve<se;++ve){for(fe=0,Ce=0;fe<St;++fe)Ce+=mt[fe][ve][1];for(fe=0,Qe=0,br=Xt[ve][0]-Xt[ve-1][0];fe<St;++fe){for(De=0,Mr=(mt[fe][ve][1]-mt[fe][ve-1][1])/(2*br);De<fe;++De)Mr+=(mt[De][ve][1]-mt[De][ve-1][1])/br;Qe+=Mr*mt[fe][ve][1]}tn[ve]=jr-=Ce?Qe/Ce*br:0,jr<Yr&&(Yr=jr)}for(ve=0;ve<se;++ve)tn[ve]-=Yr;return tn},expand:function(mt){var St=mt.length,Xt=mt[0].length,se=1/St,fe,ve,De,Ce=[];for(ve=0;ve<Xt;++ve){for(fe=0,De=0;fe<St;fe++)De+=mt[fe][ve][1];if(De)for(fe=0;fe<St;fe++)mt[fe][ve][1]/=De;else for(fe=0;fe<St;fe++)mt[fe][ve][1]=se}for(ve=0;ve<Xt;++ve)Ce[ve]=0;return Ce},zero:Ku});function Oc(mt){return c.range(mt.length)}function Ku(mt){for(var St=-1,Xt=mt[0].length,se=[];++St<Xt;)se[St]=0;return se}function Os(mt){for(var St=1,Xt=0,se=mt[0][1],fe,ve=mt.length;St<ve;++St)(fe=mt[St][1])>se&&(Xt=St,se=fe);return Xt}function Eu(mt){return mt.reduce(Jl,0)}function Jl(mt,St){return mt+St[1]}c.layout.histogram=function(){var mt=!0,St=Number,Xt=mc,se=ch;function fe(ve,De){for(var Ce=[],Qe=ve.map(St,this),Mr=Xt.call(this,Qe,De),br=se.call(this,Mr,Qe,De),jr,De=-1,Yr=Qe.length,tn=br.length-1,Rn=mt?1:1/Yr,sn;++De<tn;)jr=Ce[De]=[],jr.dx=br[De+1]-(jr.x=br[De]),jr.y=0;if(tn>0)for(De=-1;++De<Yr;)sn=Qe[De],sn>=Mr[0]&&sn<=Mr[1]&&(jr=Ce[c.bisect(br,sn,1,tn)-1],jr.y+=Rn,jr.push(ve[De]));return Ce}return fe.value=function(ve){return arguments.length?(St=ve,fe):St},fe.range=function(ve){return arguments.length?(Xt=_e(ve),fe):Xt},fe.bins=function(ve){return arguments.length?(se=typeof ve=="number"?function(De){return Ps(De,ve)}:_e(ve),fe):se},fe.frequency=function(ve){return arguments.length?(mt=!!ve,fe):mt},fe};function ch(mt,St){return Ps(mt,Math.ceil(Math.log(St.length)/Math.LN2+1))}function Ps(mt,St){for(var Xt=-1,se=+mt[0],fe=(mt[1]-se)/St,ve=[];++Xt<=St;)ve[Xt]=fe*Xt+se;return ve}function mc(mt){return[c.min(mt),c.max(mt)]}c.layout.pack=function(){var mt=c.layout.hierarchy().sort(ju),St=0,Xt=[1,1],se;function fe(ve,De){var Ce=mt.call(this,ve,De),Qe=Ce[0],Mr=Xt[0],br=Xt[1],jr=se==null?Math.sqrt:typeof se=="function"?se:function(){return se};if(Qe.x=Qe.y=0,Su(Qe,function(tn){tn.r=+jr(tn.value)}),Su(Qe,vc),St){var Yr=St*(se?1:Math.max(2*Qe.r/Mr,2*Qe.r/br))/2;Su(Qe,function(tn){tn.r+=Yr}),Su(Qe,vc),Su(Qe,function(tn){tn.r-=Yr})}return Qc(Qe,Mr/2,br/2,se?1:1/Math.max(2*Qe.r/Mr,2*Qe.r/br)),Ce}return fe.size=function(ve){return arguments.length?(Xt=ve,fe):Xt},fe.radius=function(ve){return arguments.length?(se=ve==null||typeof ve=="function"?ve:+ve,fe):se},fe.padding=function(ve){return arguments.length?(St=+ve,fe):St},Ds(fe,mt)};function ju(mt,St){return mt.value-St.value}function Ql(mt,St){var Xt=mt._pack_next;mt._pack_next=St,St._pack_prev=mt,St._pack_next=Xt,Xt._pack_prev=St}function oc(mt,St){mt._pack_next=St,St._pack_prev=mt}function Nu(mt,St){var Xt=St.x-mt.x,se=St.y-mt.y,fe=mt.r+St.r;return .999*fe*fe>Xt*Xt+se*se}function vc(mt){if(!(St=mt.children)||!(Yr=St.length))return;var St,Xt=1/0,se=-1/0,fe=1/0,ve=-1/0,De,Ce,Qe,Mr,br,jr,Yr;function tn(xn){Xt=Math.min(xn.x-xn.r,Xt),se=Math.max(xn.x+xn.r,se),fe=Math.min(xn.y-xn.r,fe),ve=Math.max(xn.y+xn.r,ve)}if(St.forEach(wh),De=St[0],De.x=-De.r,De.y=0,tn(De),Yr>1&&(Ce=St[1],Ce.x=Ce.r,Ce.y=0,tn(Ce),Yr>2))for(Qe=St[2],Yl(De,Ce,Qe),tn(Qe),Ql(De,Qe),De._pack_prev=Qe,Ql(Qe,Ce),Ce=De._pack_next,Mr=3;Mr<Yr;Mr++){Yl(De,Ce,Qe=St[Mr]);var Rn=0,sn=1,Mn=1;for(br=Ce._pack_next;br!==Ce;br=br._pack_next,sn++)if(Nu(br,Qe)){Rn=1;break}if(Rn==1)for(jr=De._pack_prev;jr!==br._pack_prev&&!Nu(jr,Qe);jr=jr._pack_prev,Mn++);Rn?(sn<Mn||sn==Mn&&Ce.r<De.r?oc(De,Ce=br):oc(De=jr,Ce),Mr--):(Ql(De,Qe),Ce=Qe,tn(Qe))}var In=(Xt+se)/2,Dn=(fe+ve)/2,jn=0;for(Mr=0;Mr<Yr;Mr++)Qe=St[Mr],Qe.x-=In,Qe.y-=Dn,jn=Math.max(jn,Qe.r+Math.sqrt(Qe.x*Qe.x+Qe.y*Qe.y));mt.r=jn,St.forEach(cl)}function wh(mt){mt._pack_next=mt._pack_prev=mt}function cl(mt){delete mt._pack_next,delete mt._pack_prev}function Qc(mt,St,Xt,se){var fe=mt.children;if(mt.x=St+=se*mt.x,mt.y=Xt+=se*mt.y,mt.r*=se,fe)for(var ve=-1,De=fe.length;++ve<De;)Qc(fe[ve],St,Xt,se)}function Yl(mt,St,Xt){var se=mt.r+Xt.r,fe=St.x-mt.x,ve=St.y-mt.y;if(se&&(fe||ve)){var De=St.r+Xt.r,Ce=fe*fe+ve*ve;De*=De,se*=se;var Qe=.5+(se-De)/(2*Ce),Mr=Math.sqrt(Math.max(0,2*De*(se+Ce)-(se-=Ce)*se-De*De))/(2*Ce);Xt.x=mt.x+Qe*fe+Mr*ve,Xt.y=mt.y+Qe*ve-Mr*fe}else Xt.x=mt.x+se,Xt.y=mt.y}c.layout.tree=function(){var mt=c.layout.hierarchy().sort(null).value(null),St=Pu,Xt=[1,1],se=null;function fe(br,jr){var Yr=mt.call(this,br,jr),tn=Yr[0],Rn=ve(tn);if(Su(Rn,De),Rn.parent.m=-Rn.z,gc(Rn,Ce),se)gc(tn,Mr);else{var sn=tn,Mn=tn,In=tn;gc(tn,function(_a){_a.x<sn.x&&(sn=_a),_a.x>Mn.x&&(Mn=_a),_a.depth>In.depth&&(In=_a)});var Dn=St(sn,Mn)/2-sn.x,jn=Xt[0]/(Mn.x+St(Mn,sn)/2+Dn),xn=Xt[1]/(In.depth||1);gc(tn,function(_a){_a.x=(_a.x+Dn)*jn,_a.y=_a.depth*xn})}return Yr}function ve(br){for(var jr={A:null,children:[br]},Yr=[jr],tn;(tn=Yr.pop())!=null;)for(var Rn=tn.children,sn,Mn=0,In=Rn.length;Mn<In;++Mn)Yr.push((Rn[Mn]=sn={_:Rn[Mn],parent:tn,children:(sn=Rn[Mn].children)&&sn.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:Mn}).a=sn);return jr.children[0]}function De(br){var jr=br.children,Yr=br.parent.children,tn=br.i?Yr[br.i-1]:null;if(jr.length){Iu(br);var Rn=(jr[0].z+jr[jr.length-1].z)/2;tn?(br.z=tn.z+St(br._,tn._),br.m=br.z-Rn):br.z=Rn}else tn&&(br.z=tn.z+St(br._,tn._));br.parent.A=Qe(br,tn,br.parent.A||Yr[0])}function Ce(br){br._.x=br.z+br.parent.m,br.m+=br.parent.m}function Qe(br,jr,Yr){if(jr){for(var tn=br,Rn=br,sn=jr,Mn=tn.parent.children[0],In=tn.m,Dn=Rn.m,jn=sn.m,xn=Mn.m,_a;sn=Vs(sn),tn=xu(tn),sn&&tn;)Mn=xu(Mn),Rn=Vs(Rn),Rn.a=br,_a=sn.z+jn-tn.z-In+St(sn._,tn._),_a>0&&(qs(sc(sn,br,Yr),br,_a),In+=_a,Dn+=_a),jn+=sn.m,In+=tn.m,xn+=Mn.m,Dn+=Rn.m;sn&&!Vs(Rn)&&(Rn.t=sn,Rn.m+=jn-Dn),tn&&!xu(Mn)&&(Mn.t=tn,Mn.m+=In-xn,Yr=br)}return Yr}function Mr(br){br.x*=Xt[0],br.y=br.depth*Xt[1]}return fe.separation=function(br){return arguments.length?(St=br,fe):St},fe.size=function(br){return arguments.length?(se=(Xt=br)==null?Mr:null,fe):se?null:Xt},fe.nodeSize=function(br){return arguments.length?(se=(Xt=br)==null?null:Mr,fe):se?Xt:null},Ds(fe,mt)};function Pu(mt,St){return mt.parent==St.parent?1:2}function xu(mt){var St=mt.children;return St.length?St[0]:mt.t}function Vs(mt){var St=mt.children,Xt;return(Xt=St.length)?St[Xt-1]:mt.t}function qs(mt,St,Xt){var se=Xt/(St.i-mt.i);St.c-=se,St.s+=Xt,mt.c+=se,St.z+=Xt,St.m+=Xt}function Iu(mt){for(var St=0,Xt=0,se=mt.children,fe=se.length,ve;--fe>=0;)ve=se[fe],ve.z+=St,ve.m+=St,St+=ve.s+(Xt+=ve.c)}function sc(mt,St,Xt){return mt.a.parent===St.parent?mt.a:Xt}c.layout.cluster=function(){var mt=c.layout.hierarchy().sort(null).value(null),St=Pu,Xt=[1,1],se=!1;function fe(ve,De){var Ce=mt.call(this,ve,De),Qe=Ce[0],Mr,br=0;Su(Qe,function(sn){var Mn=sn.children;Mn&&Mn.length?(sn.x=wc(Mn),sn.y=_u(Mn)):(sn.x=Mr?br+=St(sn,Mr):0,sn.y=0,Mr=sn)});var jr=Ve(Qe),Yr=lr(Qe),tn=jr.x-St(jr,Yr)/2,Rn=Yr.x+St(Yr,jr)/2;return Su(Qe,se?function(sn){sn.x=(sn.x-Qe.x)*Xt[0],sn.y=(Qe.y-sn.y)*Xt[1]}:function(sn){sn.x=(sn.x-tn)/(Rn-tn)*Xt[0],sn.y=(1-(Qe.y?sn.y/Qe.y:1))*Xt[1]}),Ce}return fe.separation=function(ve){return arguments.length?(St=ve,fe):St},fe.size=function(ve){return arguments.length?(se=(Xt=ve)==null,fe):se?null:Xt},fe.nodeSize=function(ve){return arguments.length?(se=(Xt=ve)!=null,fe):se?Xt:null},Ds(fe,mt)};function _u(mt){return 1+c.max(mt,function(St){return St.y})}function wc(mt){return mt.reduce(function(St,Xt){return St+Xt.x},0)/mt.length}function Ve(mt){var St=mt.children;return St&&St.length?Ve(St[0]):mt}function lr(mt){var St=mt.children,Xt;return St&&(Xt=St.length)?lr(St[Xt-1]):mt}c.layout.treemap=function(){var mt=c.layout.hierarchy(),St=Math.round,Xt=[1,1],se=null,fe=Ur,ve=!1,De,Ce="squarify",Qe=.5*(1+Math.sqrt(5));function Mr(sn,Mn){for(var In=-1,Dn=sn.length,jn,xn;++In<Dn;)xn=(jn=sn[In]).value*(Mn<0?0:Mn),jn.area=isNaN(xn)||xn<=0?0:xn}function br(sn){var Mn=sn.children;if(Mn&&Mn.length){var In=fe(sn),Dn=[],jn=Mn.slice(),xn,_a=1/0,La,$a=Ce==="slice"?In.dx:Ce==="dice"?In.dy:Ce==="slice-dice"?sn.depth&1?In.dy:In.dx:Math.min(In.dx,In.dy),ti;for(Mr(jn,In.dx*In.dy/sn.value),Dn.area=0;(ti=jn.length)>0;)Dn.push(xn=jn[ti-1]),Dn.area+=xn.area,Ce!=="squarify"||(La=Yr(Dn,$a))<=_a?(jn.pop(),_a=La):(Dn.area-=Dn.pop().area,tn(Dn,$a,In,!1),$a=Math.min(In.dx,In.dy),Dn.length=Dn.area=0,_a=1/0);Dn.length&&(tn(Dn,$a,In,!0),Dn.length=Dn.area=0),Mn.forEach(br)}}function jr(sn){var Mn=sn.children;if(Mn&&Mn.length){var In=fe(sn),Dn=Mn.slice(),jn,xn=[];for(Mr(Dn,In.dx*In.dy/sn.value),xn.area=0;jn=Dn.pop();)xn.push(jn),xn.area+=jn.area,jn.z!=null&&(tn(xn,jn.z?In.dx:In.dy,In,!Dn.length),xn.length=xn.area=0);Mn.forEach(jr)}}function Yr(sn,Mn){for(var In=sn.area,Dn,jn=0,xn=1/0,_a=-1,La=sn.length;++_a<La;)(Dn=sn[_a].area)&&(Dn<xn&&(xn=Dn),Dn>jn&&(jn=Dn));return In*=In,Mn*=Mn,In?Math.max(Mn*jn*Qe/In,In/(Mn*xn*Qe)):1/0}function tn(sn,Mn,In,Dn){var jn=-1,xn=sn.length,_a=In.x,La=In.y,$a=Mn?St(sn.area/Mn):0,ti;if(Mn==In.dx){for((Dn||$a>In.dy)&&($a=In.dy);++jn<xn;)ti=sn[jn],ti.x=_a,ti.y=La,ti.dy=$a,_a+=ti.dx=Math.min(In.x+In.dx-_a,$a?St(ti.area/$a):0);ti.z=!0,ti.dx+=In.x+In.dx-_a,In.y+=$a,In.dy-=$a}else{for((Dn||$a>In.dx)&&($a=In.dx);++jn<xn;)ti=sn[jn],ti.x=_a,ti.y=La,ti.dx=$a,La+=ti.dy=Math.min(In.y+In.dy-La,$a?St(ti.area/$a):0);ti.z=!1,ti.dy+=In.y+In.dy-La,In.x+=$a,In.dx-=$a}}function Rn(sn){var Mn=De||mt(sn),In=Mn[0];return In.x=In.y=0,In.value?(In.dx=Xt[0],In.dy=Xt[1]):In.dx=In.dy=0,De&&mt.revalue(In),Mr([In],In.dx*In.dy/In.value),(De?jr:br)(In),ve&&(De=Mn),Mn}return Rn.size=function(sn){return arguments.length?(Xt=sn,Rn):Xt},Rn.padding=function(sn){if(!arguments.length)return se;function Mn(jn){var xn=sn.call(Rn,jn,jn.depth);return xn==null?Ur(jn):Or(jn,typeof xn=="number"?[xn,xn,xn,xn]:xn)}function In(jn){return Or(jn,sn)}var Dn;return fe=(se=sn)==null?Ur:(Dn=typeof sn)=="function"?Mn:(Dn==="number"&&(sn=[sn,sn,sn,sn]),In),Rn},Rn.round=function(sn){return arguments.length?(St=sn?Math.round:Number,Rn):St!=Number},Rn.sticky=function(sn){return arguments.length?(ve=sn,De=null,Rn):ve},Rn.ratio=function(sn){return arguments.length?(Qe=sn,Rn):Qe},Rn.mode=function(sn){return arguments.length?(Ce=sn+"",Rn):Ce},Ds(Rn,mt)};function Ur(mt){return{x:mt.x,y:mt.y,dx:mt.dx,dy:mt.dy}}function Or(mt,St){var Xt=mt.x+St[3],se=mt.y+St[0],fe=mt.dx-St[1]-St[3],ve=mt.dy-St[0]-St[2];return fe<0&&(Xt+=fe/2,fe=0),ve<0&&(se+=ve/2,ve=0),{x:Xt,y:se,dx:fe,dy:ve}}c.random={normal:function(mt,St){var Xt=arguments.length;return Xt<2&&(St=1),Xt<1&&(mt=0),function(){var se,fe,ve;do se=Math.random()*2-1,fe=Math.random()*2-1,ve=se*se+fe*fe;while(!ve||ve>1);return mt+St*se*Math.sqrt(-2*Math.log(ve)/ve)}},logNormal:function(){var mt=c.random.normal.apply(c,arguments);return function(){return Math.exp(mt())}},bates:function(mt){var St=c.random.irwinHall(mt);return function(){return St()/mt}},irwinHall:function(mt){return function(){for(var St=0,Xt=0;Xt<mt;Xt++)St+=Math.random();return St}}},c.scale={};function un(mt){var St=mt[0],Xt=mt[mt.length-1];return St<Xt?[St,Xt]:[Xt,St]}function Ln(mt){return mt.rangeExtent?mt.rangeExtent():un(mt.range())}function Gn(mt,St,Xt,se){var fe=Xt(mt[0],mt[1]),ve=se(St[0],St[1]);return function(De){return ve(fe(De))}}function oa(mt,St){var Xt=0,se=mt.length-1,fe=mt[Xt],ve=mt[se],De;return ve<fe&&(De=Xt,Xt=se,se=De,De=fe,fe=ve,ve=De),mt[Xt]=St.floor(fe),mt[se]=St.ceil(ve),mt}function ya(mt){return mt?{floor:function(St){return Math.floor(St/mt)*mt},ceil:function(St){return Math.ceil(St/mt)*mt}}:Pa}var Pa={floor:B,ceil:B};function Jn(mt,St,Xt,se){var fe=[],ve=[],De=0,Ce=Math.min(mt.length,St.length)-1;for(mt[Ce]<mt[0]&&(mt=mt.slice().reverse(),St=St.slice().reverse());++De<=Ce;)fe.push(Xt(mt[De-1],mt[De])),ve.push(se(St[De-1],St[De]));return function(Qe){var Mr=c.bisect(mt,Qe,1,Ce)-1;return ve[Mr](fe[Mr](Qe))}}c.scale.linear=function(){return va([0,1],[0,1],$o,!1)};function va(mt,St,Xt,se){var fe,ve;function De(){var Qe=Math.min(mt.length,St.length)>2?Jn:Gn,Mr=se?sh:Fh;return fe=Qe(mt,St,Mr,Xt),ve=Qe(St,mt,Mr,$o),Ce}function Ce(Qe){return fe(Qe)}return Ce.invert=function(Qe){return ve(Qe)},Ce.domain=function(Qe){return arguments.length?(mt=Qe.map(Number),De()):mt},Ce.range=function(Qe){return arguments.length?(St=Qe,De()):St},Ce.rangeRound=function(Qe){return Ce.range(Qe).interpolate(Ju)},Ce.clamp=function(Qe){return arguments.length?(se=Qe,De()):se},Ce.interpolate=function(Qe){return arguments.length?(Xt=Qe,De()):Xt},Ce.ticks=function(Qe){return Fi(mt,Qe)},Ce.tickFormat=function(Qe,Mr){return d3_scale_linearTickFormat(mt,Qe,Mr)},Ce.nice=function(Qe){return qn(mt,Qe),De()},Ce.copy=function(){return va(mt,St,Xt,se)},De()}function sa(mt,St){return c.rebind(mt,St,"range","rangeRound","interpolate","clamp")}function qn(mt,St){return oa(mt,ya(Fa(mt,St)[2])),oa(mt,ya(Fa(mt,St)[2])),mt}function Fa(mt,St){St==null&&(St=10);var Xt=un(mt),se=Xt[1]-Xt[0],fe=Math.pow(10,Math.floor(Math.log(se/St)/Math.LN10)),ve=St/se*fe;return ve<=.15?fe*=10:ve<=.35?fe*=5:ve<=.75&&(fe*=2),Xt[0]=Math.ceil(Xt[0]/fe)*fe,Xt[1]=Math.floor(Xt[1]/fe)*fe+fe*.5,Xt[2]=fe,Xt}function Fi(mt,St){return c.range.apply(c,Fa(mt,St))}c.scale.log=function(){return Ei(c.scale.linear().domain([0,1]),10,!0,[1,10])};function Ei(mt,St,Xt,se){function fe(Ce){return(Xt?Math.log(Ce<0?0:Ce):-Math.log(Ce>0?0:-Ce))/Math.log(St)}function ve(Ce){return Xt?Math.pow(St,Ce):-Math.pow(St,-Ce)}function De(Ce){return mt(fe(Ce))}return De.invert=function(Ce){return ve(mt.invert(Ce))},De.domain=function(Ce){return arguments.length?(Xt=Ce[0]>=0,mt.domain((se=Ce.map(Number)).map(fe)),De):se},De.base=function(Ce){return arguments.length?(St=+Ce,mt.domain(se.map(fe)),De):St},De.nice=function(){var Ce=oa(se.map(fe),Xt?Math:Ni);return mt.domain(Ce),se=Ce.map(ve),De},De.ticks=function(){var Ce=un(se),Qe=[],Mr=Ce[0],br=Ce[1],jr=Math.floor(fe(Mr)),Yr=Math.ceil(fe(br)),tn=St%1?2:St;if(isFinite(Yr-jr)){if(Xt){for(;jr<Yr;jr++)for(var Rn=1;Rn<tn;Rn++)Qe.push(ve(jr)*Rn);Qe.push(ve(jr))}else for(Qe.push(ve(jr));jr++<Yr;)for(var Rn=tn-1;Rn>0;Rn--)Qe.push(ve(jr)*Rn);for(jr=0;Qe[jr]<Mr;jr++);for(Yr=Qe.length;Qe[Yr-1]>br;Yr--);Qe=Qe.slice(jr,Yr)}return Qe},De.copy=function(){return Ei(mt.copy(),St,Xt,se)},sa(De,mt)}var Ni={floor:function(mt){return-Math.ceil(-mt)},ceil:function(mt){return-Math.floor(-mt)}};c.scale.pow=function(){return Hi(c.scale.linear(),1,[0,1])};function Hi(mt,St,Xt){var se=Ba(St),fe=Ba(1/St);function ve(De){return mt(se(De))}return ve.invert=function(De){return fe(mt.invert(De))},ve.domain=function(De){return arguments.length?(mt.domain((Xt=De.map(Number)).map(se)),ve):Xt},ve.ticks=function(De){return Fi(Xt,De)},ve.tickFormat=function(De,Ce){return d3_scale_linearTickFormat(Xt,De,Ce)},ve.nice=function(De){return ve.domain(qn(Xt,De))},ve.exponent=function(De){return arguments.length?(se=Ba(St=De),fe=Ba(1/St),mt.domain(Xt.map(se)),ve):St},ve.copy=function(){return Hi(mt.copy(),St,Xt)},sa(ve,mt)}function Ba(mt){return function(St){return St<0?-Math.pow(-St,mt):Math.pow(St,mt)}}c.scale.sqrt=function(){return c.scale.pow().exponent(.5)},c.scale.ordinal=function(){return ba([],{t:"range",a:[[]]})};function ba(mt,St){var Xt,se,fe;function ve(Ce){return se[((Xt.get(Ce)||(St.t==="range"?Xt.set(Ce,mt.push(Ce)):NaN))-1)%se.length]}function De(Ce,Qe){return c.range(mt.length).map(function(Mr){return Ce+Qe*Mr})}return ve.domain=function(Ce){if(!arguments.length)return mt;mt=[],Xt=new S;for(var Qe=-1,Mr=Ce.length,br;++Qe<Mr;)Xt.has(br=Ce[Qe])||Xt.set(br,mt.push(br));return ve[St.t].apply(ve,St.a)},ve.range=function(Ce){return arguments.length?(se=Ce,fe=0,St={t:"range",a:arguments},ve):se},ve.rangePoints=function(Ce,Qe){arguments.length<2&&(Qe=0);var Mr=Ce[0],br=Ce[1],jr=mt.length<2?(Mr=(Mr+br)/2,0):(br-Mr)/(mt.length-1+Qe);return se=De(Mr+jr*Qe/2,jr),fe=0,St={t:"rangePoints",a:arguments},ve},ve.rangeRoundPoints=function(Ce,Qe){arguments.length<2&&(Qe=0);var Mr=Ce[0],br=Ce[1],jr=mt.length<2?(Mr=br=Math.round((Mr+br)/2),0):(br-Mr)/(mt.length-1+Qe)|0;return se=De(Mr+Math.round(jr*Qe/2+(br-Mr-(mt.length-1+Qe)*jr)/2),jr),fe=0,St={t:"rangeRoundPoints",a:arguments},ve},ve.rangeBands=function(Ce,Qe,Mr){arguments.length<2&&(Qe=0),arguments.length<3&&(Mr=Qe);var br=Ce[1]<Ce[0],jr=Ce[br-0],Yr=Ce[1-br],tn=(Yr-jr)/(mt.length-Qe+2*Mr);return se=De(jr+tn*Mr,tn),br&&se.reverse(),fe=tn*(1-Qe),St={t:"rangeBands",a:arguments},ve},ve.rangeRoundBands=function(Ce,Qe,Mr){arguments.length<2&&(Qe=0),arguments.length<3&&(Mr=Qe);var br=Ce[1]<Ce[0],jr=Ce[br-0],Yr=Ce[1-br],tn=Math.floor((Yr-jr)/(mt.length-Qe+2*Mr));return se=De(jr+Math.round((Yr-jr-(mt.length-Qe)*tn)/2),tn),br&&se.reverse(),fe=Math.round(tn*(1-Qe)),St={t:"rangeRoundBands",a:arguments},ve},ve.rangeBand=function(){return fe},ve.rangeExtent=function(){return un(St.a[0])},ve.copy=function(){return ba(mt,St)},ve.domain(mt)}c.scale.category10=function(){return c.scale.ordinal().range($i)},c.scale.category20=function(){return c.scale.ordinal().range(So)},c.scale.category20b=function(){return c.scale.ordinal().range(Jo)},c.scale.category20c=function(){return c.scale.ordinal().range(As)};var $i=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(Sr),So=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(Sr),Jo=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(Sr),As=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(Sr);c.scale.quantile=function(){return os([],[])};function os(mt,St){var Xt;function se(){var ve=0,De=St.length;for(Xt=[];++ve<De;)Xt[ve-1]=c.quantile(mt,ve/De);return fe}function fe(ve){if(!isNaN(ve=+ve))return St[c.bisect(Xt,ve)]}return fe.domain=function(ve){return arguments.length?(mt=ve.map(h).filter(v).sort(s),se()):mt},fe.range=function(ve){return arguments.length?(St=ve,se()):St},fe.quantiles=function(){return Xt},fe.invertExtent=function(ve){return ve=St.indexOf(ve),ve<0?[NaN,NaN]:[ve>0?Xt[ve-1]:mt[0],ve<Xt.length?Xt[ve]:mt[mt.length-1]]},fe.copy=function(){return os(mt,St)},se()}c.scale.quantize=function(){return xs(0,1,[0,1])};function xs(mt,St,Xt){var se,fe;function ve(Ce){return Xt[Math.max(0,Math.min(fe,Math.floor(se*(Ce-mt))))]}function De(){return se=Xt.length/(St-mt),fe=Xt.length-1,ve}return ve.domain=function(Ce){return arguments.length?(mt=+Ce[0],St=+Ce[Ce.length-1],De()):[mt,St]},ve.range=function(Ce){return arguments.length?(Xt=Ce,De()):Xt},ve.invertExtent=function(Ce){return Ce=Xt.indexOf(Ce),Ce=Ce<0?NaN:Ce/se+mt,[Ce,Ce+1/se]},ve.copy=function(){return xs(mt,St,Xt)},De()}c.scale.threshold=function(){return No([.5],[0,1])};function No(mt,St){function Xt(se){if(se<=se)return St[c.bisect(mt,se)]}return Xt.domain=function(se){return arguments.length?(mt=se,Xt):mt},Xt.range=function(se){return arguments.length?(St=se,Xt):St},Xt.invertExtent=function(se){return se=St.indexOf(se),[mt[se-1],mt[se]]},Xt.copy=function(){return No(mt,St)},Xt}c.scale.identity=function(){return Qs([0,1])};function Qs(mt){function St(Xt){return+Xt}return St.invert=St,St.domain=St.range=function(Xt){return arguments.length?(mt=Xt.map(St),St):mt},St.ticks=function(Xt){return Fi(mt,Xt)},St.tickFormat=function(Xt,se){return d3_scale_linearTickFormat(mt,Xt,se)},St.copy=function(){return Qs(mt)},St}c.svg={};function Hs(){return 0}c.svg.arc=function(){var mt=ni,St=to,Xt=Hs,se=Ms,fe=ds,ve=Qo,De=Tl;function Ce(){var Mr=Math.max(0,+mt.apply(this,arguments)),br=Math.max(0,+St.apply(this,arguments)),jr=fe.apply(this,arguments)-Ot,Yr=ve.apply(this,arguments)-Ot,tn=Math.abs(Yr-jr),Rn=jr>Yr?0:1;if(br<Mr&&(sn=br,br=Mr,Mr=sn),tn>=Mt)return Qe(br,Rn)+(Mr?Qe(Mr,1-Rn):"")+"Z";var sn,Mn,In,Dn,jn=0,xn=0,_a,La,$a,ti,ii,di,Io,gi,Ji=[];if((Dn=(+De.apply(this,arguments)||0)/2)&&(In=se===Ms?Math.sqrt(Mr*Mr+br*br):+se.apply(this,arguments),Rn||(xn*=-1),br&&(xn=Me(In/br*Math.sin(Dn))),Mr&&(jn=Me(In/Mr*Math.sin(Dn)))),br){_a=br*Math.cos(jr+xn),La=br*Math.sin(jr+xn),$a=br*Math.cos(Yr-xn),ti=br*Math.sin(Yr-xn);var qo=Math.abs(Yr-jr-2*xn)<=ut?0:1;if(xn&&Kl(_a,La,$a,ti)===Rn^qo){var Ys=(jr+Yr)/2;_a=br*Math.cos(Ys),La=br*Math.sin(Ys),$a=ti=null}}else _a=La=0;if(Mr){ii=Mr*Math.cos(Yr-jn),di=Mr*Math.sin(Yr-jn),Io=Mr*Math.cos(jr+jn),gi=Mr*Math.sin(jr+jn);var _s=Math.abs(jr-Yr+2*jn)<=ut?0:1;if(jn&&Kl(ii,di,Io,gi)===1-Rn^_s){var Ja=(jr+Yr)/2;ii=Mr*Math.cos(Ja),di=Mr*Math.sin(Ja),Io=gi=null}}else ii=di=0;if(tn>qt&&(sn=Math.min(Math.abs(br-Mr)/2,+Xt.apply(this,arguments)))>.001){Mn=Mr<br^Rn?0:1;var yo=sn,Lo=sn;if(tn<ut){var bs=Io==null?[ii,di]:$a==null?[_a,La]:Co([_a,La],[Io,gi],[$a,ti],[ii,di]),us=_a-bs[0],eu=La-bs[1],Yo=$a-bs[0],gs=ti-bs[1],wu=1/Math.sin(Math.acos((us*Yo+eu*gs)/(Math.sqrt(us*us+eu*eu)*Math.sqrt(Yo*Yo+gs*gs)))/2),sr=Math.sqrt(bs[0]*bs[0]+bs[1]*bs[1]);Lo=Math.min(sn,(Mr-sr)/(wu-1)),yo=Math.min(sn,(br-sr)/(wu+1))}if($a!=null){var fn=Fl(Io==null?[ii,di]:[Io,gi],[_a,La],br,yo,Rn),gn=Fl([$a,ti],[ii,di],br,yo,Rn);sn===yo?Ji.push("M",fn[0],"A",yo,",",yo," 0 0,",Mn," ",fn[1],"A",br,",",br," 0 ",1-Rn^Kl(fn[1][0],fn[1][1],gn[1][0],gn[1][1]),",",Rn," ",gn[1],"A",yo,",",yo," 0 0,",Mn," ",gn[0]):Ji.push("M",fn[0],"A",yo,",",yo," 0 1,",Mn," ",gn[0])}else Ji.push("M",_a,",",La);if(Io!=null){var ha=Fl([_a,La],[Io,gi],Mr,-Lo,Rn),Ta=Fl([ii,di],$a==null?[_a,La]:[$a,ti],Mr,-Lo,Rn);sn===Lo?Ji.push("L",Ta[0],"A",Lo,",",Lo," 0 0,",Mn," ",Ta[1],"A",Mr,",",Mr," 0 ",Rn^Kl(Ta[1][0],Ta[1][1],ha[1][0],ha[1][1]),",",1-Rn," ",ha[1],"A",Lo,",",Lo," 0 0,",Mn," ",ha[0]):Ji.push("L",Ta[0],"A",Lo,",",Lo," 0 0,",Mn," ",ha[0])}else Ji.push("L",ii,",",di)}else Ji.push("M",_a,",",La),$a!=null&&Ji.push("A",br,",",br," 0 ",qo,",",Rn," ",$a,",",ti),Ji.push("L",ii,",",di),Io!=null&&Ji.push("A",Mr,",",Mr," 0 ",_s,",",1-Rn," ",Io,",",gi);return Ji.push("Z"),Ji.join("")}function Qe(Mr,br){return"M0,"+Mr+"A"+Mr+","+Mr+" 0 1,"+br+" 0,"+-Mr+"A"+Mr+","+Mr+" 0 1,"+br+" 0,"+Mr}return Ce.innerRadius=function(Mr){return arguments.length?(mt=_e(Mr),Ce):mt},Ce.outerRadius=function(Mr){return arguments.length?(St=_e(Mr),Ce):St},Ce.cornerRadius=function(Mr){return arguments.length?(Xt=_e(Mr),Ce):Xt},Ce.padRadius=function(Mr){return arguments.length?(se=Mr==Ms?Ms:_e(Mr),Ce):se},Ce.startAngle=function(Mr){return arguments.length?(fe=_e(Mr),Ce):fe},Ce.endAngle=function(Mr){return arguments.length?(ve=_e(Mr),Ce):ve},Ce.padAngle=function(Mr){return arguments.length?(De=_e(Mr),Ce):De},Ce.centroid=function(){var Mr=(+mt.apply(this,arguments)+ +St.apply(this,arguments))/2,br=(+fe.apply(this,arguments)+ +ve.apply(this,arguments))/2-Ot;return[Math.cos(br)*Mr,Math.sin(br)*Mr]},Ce};var Ms="auto";function ni(mt){return mt.innerRadius}function to(mt){return mt.outerRadius}function ds(mt){return mt.startAngle}function Qo(mt){return mt.endAngle}function Tl(mt){return mt&&mt.padAngle}function Kl(mt,St,Xt,se){return(mt-Xt)*St-(St-se)*mt>0?0:1}function Fl(mt,St,Xt,se,fe){var ve=mt[0]-St[0],De=mt[1]-St[1],Ce=(fe?se:-se)/Math.sqrt(ve*ve+De*De),Qe=Ce*De,Mr=-Ce*ve,br=mt[0]+Qe,jr=mt[1]+Mr,Yr=St[0]+Qe,tn=St[1]+Mr,Rn=(br+Yr)/2,sn=(jr+tn)/2,Mn=Yr-br,In=tn-jr,Dn=Mn*Mn+In*In,jn=Xt-se,xn=br*tn-Yr*jr,_a=(In<0?-1:1)*Math.sqrt(Math.max(0,jn*jn*Dn-xn*xn)),La=(xn*In-Mn*_a)/Dn,$a=(-xn*Mn-In*_a)/Dn,ti=(xn*In+Mn*_a)/Dn,ii=(-xn*Mn+In*_a)/Dn,di=La-Rn,Io=$a-sn,gi=ti-Rn,Ji=ii-sn;return di*di+Io*Io>gi*gi+Ji*Ji&&(La=ti,$a=ii),[[La-Qe,$a-Mr],[La*Xt/jn,$a*Xt/jn]]}function tc(){return!0}function tu(mt){var St=pi,Xt=bi,se=tc,fe=$s,ve=fe.key,De=.7;function Ce(Qe){var Mr=[],br=[],jr=-1,Yr=Qe.length,tn,Rn=_e(St),sn=_e(Xt);function Mn(){Mr.push("M",fe(mt(br),De))}for(;++jr<Yr;)se.call(this,tn=Qe[jr],jr)?br.push([+Rn.call(this,tn,jr),+sn.call(this,tn,jr)]):br.length&&(Mn(),br=[]);return br.length&&Mn(),Mr.length?Mr.join(""):null}return Ce.x=function(Qe){return arguments.length?(St=Qe,Ce):St},Ce.y=function(Qe){return arguments.length?(Xt=Qe,Ce):Xt},Ce.defined=function(Qe){return arguments.length?(se=Qe,Ce):se},Ce.interpolate=function(Qe){return arguments.length?(typeof Qe=="function"?ve=fe=Qe:ve=(fe=Uu.get(Qe)||$s).key,Ce):ve},Ce.tension=function(Qe){return arguments.length?(De=Qe,Ce):De},Ce}c.svg.line=function(){return tu(B)};var Uu=c.map({linear:$s,"linear-closed":ec,step:Ri,"step-before":oo,"step-after":bu,basis:_t,"basis-open":Tt,"basis-closed":Pt,bundle:ie,cardinal:Lt,"cardinal-open":Cl,"cardinal-closed":Th,monotone:Gt});Uu.forEach(function(mt,St){St.key=mt,St.closed=/-closed$/.test(mt)});function $s(mt){return mt.length>1?mt.join("L"):mt+"Z"}function ec(mt){return mt.join("L")+"Z"}function Ri(mt){for(var St=0,Xt=mt.length,se=mt[0],fe=[se[0],",",se[1]];++St<Xt;)fe.push("H",(se[0]+(se=mt[St])[0])/2,"V",se[1]);return Xt>1&&fe.push("H",se[0]),fe.join("")}function oo(mt){for(var St=0,Xt=mt.length,se=mt[0],fe=[se[0],",",se[1]];++St<Xt;)fe.push("V",(se=mt[St])[1],"H",se[0]);return fe.join("")}function bu(mt){for(var St=0,Xt=mt.length,se=mt[0],fe=[se[0],",",se[1]];++St<Xt;)fe.push("H",(se=mt[St])[0],"V",se[1]);return fe.join("")}function Cl(mt,St){return mt.length<4?$s(mt):mt[1]+P(mt.slice(1,-1),at(mt,St))}function Th(mt,St){return mt.length<3?ec(mt):mt[0]+P((mt.push(mt[0]),mt),at([mt[mt.length-2]].concat(mt,[mt[1]]),St))}function Lt(mt,St){return mt.length<3?$s(mt):mt[0]+P(mt,at(mt,St))}function P(mt,St){if(St.length<1||mt.length!=St.length&&mt.length!=St.length+2)return $s(mt);var Xt=mt.length!=St.length,se="",fe=mt[0],ve=mt[1],De=St[0],Ce=De,Qe=1;if(Xt&&(se+="Q"+(ve[0]-De[0]*2/3)+","+(ve[1]-De[1]*2/3)+","+ve[0]+","+ve[1],fe=mt[1],Qe=2),St.length>1){Ce=St[1],ve=mt[Qe],Qe++,se+="C"+(fe[0]+De[0])+","+(fe[1]+De[1])+","+(ve[0]-Ce[0])+","+(ve[1]-Ce[1])+","+ve[0]+","+ve[1];for(var Mr=2;Mr<St.length;Mr++,Qe++)ve=mt[Qe],Ce=St[Mr],se+="S"+(ve[0]-Ce[0])+","+(ve[1]-Ce[1])+","+ve[0]+","+ve[1]}if(Xt){var br=mt[Qe];se+="Q"+(ve[0]+Ce[0]*2/3)+","+(ve[1]+Ce[1]*2/3)+","+br[0]+","+br[1]}return se}function at(mt,St){for(var Xt=[],se=(1-St)/2,fe,ve=mt[0],De=mt[1],Ce=1,Qe=mt.length;++Ce<Qe;)fe=ve,ve=De,De=mt[Ce],Xt.push([se*(De[0]-fe[0]),se*(De[1]-fe[1])]);return Xt}function _t(mt){if(mt.length<3)return $s(mt);var St=1,Xt=mt.length,se=mt[0],fe=se[0],ve=se[1],De=[fe,fe,fe,(se=mt[1])[0]],Ce=[ve,ve,ve,se[1]],Qe=[fe,",",ve,"L",de(ar,De),",",de(ar,Ce)];for(mt.push(mt[Xt-1]);++St<=Xt;)se=mt[St],De.shift(),De.push(se[0]),Ce.shift(),Ce.push(se[1]),ir(Qe,De,Ce);return mt.pop(),Qe.push("L",se),Qe.join("")}function Tt(mt){if(mt.length<4)return $s(mt);for(var St=[],Xt=-1,se=mt.length,fe,ve=[0],De=[0];++Xt<3;)fe=mt[Xt],ve.push(fe[0]),De.push(fe[1]);for(St.push(de(ar,ve)+","+de(ar,De)),--Xt;++Xt<se;)fe=mt[Xt],ve.shift(),ve.push(fe[0]),De.shift(),De.push(fe[1]),ir(St,ve,De);return St.join("")}function Pt(mt){for(var St,Xt=-1,se=mt.length,fe=se+4,ve,De=[],Ce=[];++Xt<4;)ve=mt[Xt%se],De.push(ve[0]),Ce.push(ve[1]);for(St=[de(ar,De),",",de(ar,Ce)],--Xt;++Xt<fe;)ve=mt[Xt%se],De.shift(),De.push(ve[0]),Ce.shift(),Ce.push(ve[1]),ir(St,De,Ce);return St.join("")}function ie(mt,St){var Xt=mt.length-1;if(Xt)for(var se=mt[0][0],fe=mt[0][1],ve=mt[Xt][0]-se,De=mt[Xt][1]-fe,Ce=-1,Qe,Mr;++Ce<=Xt;)Qe=mt[Ce],Mr=Ce/Xt,Qe[0]=St*Qe[0]+(1-St)*(se+Mr*ve),Qe[1]=St*Qe[1]+(1-St)*(fe+Mr*De);return _t(mt)}function de(mt,St){return mt[0]*St[0]+mt[1]*St[1]+mt[2]*St[2]+mt[3]*St[3]}var Ee=[0,2/3,1/3,0],He=[0,1/3,2/3,0],ar=[0,1/6,2/3,1/6];function ir(mt,St,Xt){mt.push("C",de(Ee,St),",",de(Ee,Xt),",",de(He,St),",",de(He,Xt),",",de(ar,St),",",de(ar,Xt))}function zr(mt,St){return(St[1]-mt[1])/(St[0]-mt[0])}function Zr(mt){for(var St=0,Xt=mt.length-1,se=[],fe=mt[0],ve=mt[1],De=se[0]=zr(fe,ve);++St<Xt;)se[St]=(De+(De=zr(fe=ve,ve=mt[St+1])))/2;return se[St]=De,se}function Rt(mt){for(var St=[],Xt,se,fe,ve,De=Zr(mt),Ce=-1,Qe=mt.length-1;++Ce<Qe;)Xt=zr(mt[Ce],mt[Ce+1]),l(Xt)<qt?De[Ce]=De[Ce+1]=0:(se=De[Ce]/Xt,fe=De[Ce+1]/Xt,ve=se*se+fe*fe,ve>9&&(ve=Xt*3/Math.sqrt(ve),De[Ce]=ve*se,De[Ce+1]=ve*fe));for(Ce=-1;++Ce<=Qe;)ve=(mt[Math.min(Qe,Ce+1)][0]-mt[Math.max(0,Ce-1)][0])/(6*(1+De[Ce]*De[Ce])),St.push([ve||0,De[Ce]*ve||0]);return St}function Gt(mt){return mt.length<3?$s(mt):mt[0]+P(mt,Rt(mt))}c.svg.line.radial=function(){var mt=tu(ne);return mt.radius=mt.x,delete mt.x,mt.angle=mt.y,delete mt.y,mt};function ne(mt){for(var St,Xt=-1,se=mt.length,fe,ve;++Xt<se;)St=mt[Xt],fe=St[0],ve=St[1]-Ot,St[0]=fe*Math.cos(ve),St[1]=fe*Math.sin(ve);return mt}function oe(mt){var St=pi,Xt=pi,se=0,fe=bi,ve=tc,De=$s,Ce=De.key,Qe=De,Mr="L",br=.7;function jr(Yr){var tn=[],Rn=[],sn=[],Mn=-1,In=Yr.length,Dn,jn=_e(St),xn=_e(se),_a=St===Xt?function(){return $a}:_e(Xt),La=se===fe?function(){return ti}:_e(fe),$a,ti;function ii(){tn.push("M",De(mt(sn),br),Mr,Qe(mt(Rn.reverse()),br),"Z")}for(;++Mn<In;)ve.call(this,Dn=Yr[Mn],Mn)?(Rn.push([$a=+jn.call(this,Dn,Mn),ti=+xn.call(this,Dn,Mn)]),sn.push([+_a.call(this,Dn,Mn),+La.call(this,Dn,Mn)])):Rn.length&&(ii(),Rn=[],sn=[]);return Rn.length&&ii(),tn.length?tn.join(""):null}return jr.x=function(Yr){return arguments.length?(St=Xt=Yr,jr):Xt},jr.x0=function(Yr){return arguments.length?(St=Yr,jr):St},jr.x1=function(Yr){return arguments.length?(Xt=Yr,jr):Xt},jr.y=function(Yr){return arguments.length?(se=fe=Yr,jr):fe},jr.y0=function(Yr){return arguments.length?(se=Yr,jr):se},jr.y1=function(Yr){return arguments.length?(fe=Yr,jr):fe},jr.defined=function(Yr){return arguments.length?(ve=Yr,jr):ve},jr.interpolate=function(Yr){return arguments.length?(typeof Yr=="function"?Ce=De=Yr:Ce=(De=Uu.get(Yr)||$s).key,Qe=De.reverse||De,Mr=De.closed?"M":"L",jr):Ce},jr.tension=function(Yr){return arguments.length?(br=Yr,jr):br},jr}oo.reverse=bu,bu.reverse=oo,c.svg.area=function(){return oe(B)},c.svg.area.radial=function(){var mt=oe(ne);return mt.radius=mt.x,delete mt.x,mt.innerRadius=mt.x0,delete mt.x0,mt.outerRadius=mt.x1,delete mt.x1,mt.angle=mt.y,delete mt.y,mt.startAngle=mt.y0,delete mt.y0,mt.endAngle=mt.y1,delete mt.y1,mt};function be(mt){return mt.source}function pe(mt){return mt.target}c.svg.chord=function(){var mt=be,St=pe,Xt=Ae,se=ds,fe=Qo;function ve(br,jr){var Yr=De(this,mt,br,jr),tn=De(this,St,br,jr);return"M"+Yr.p0+Qe(Yr.r,Yr.p1,Yr.a1-Yr.a0)+(Ce(Yr,tn)?Mr(Yr.r,Yr.p1,Yr.r,Yr.p0):Mr(Yr.r,Yr.p1,tn.r,tn.p0)+Qe(tn.r,tn.p1,tn.a1-tn.a0)+Mr(tn.r,tn.p1,Yr.r,Yr.p0))+"Z"}function De(br,jr,Yr,tn){var Rn=jr.call(br,Yr,tn),sn=Xt.call(br,Rn,tn),Mn=se.call(br,Rn,tn)-Ot,In=fe.call(br,Rn,tn)-Ot;return{r:sn,a0:Mn,a1:In,p0:[sn*Math.cos(Mn),sn*Math.sin(Mn)],p1:[sn*Math.cos(In),sn*Math.sin(In)]}}function Ce(br,jr){return br.a0==jr.a0&&br.a1==jr.a1}function Qe(br,jr,Yr){return"A"+br+","+br+" 0 "+ +(Yr>ut)+",1 "+jr}function Mr(br,jr,Yr,tn){return"Q 0,0 "+tn}return ve.radius=function(br){return arguments.length?(Xt=_e(br),ve):Xt},ve.source=function(br){return arguments.length?(mt=_e(br),ve):mt},ve.target=function(br){return arguments.length?(St=_e(br),ve):St},ve.startAngle=function(br){return arguments.length?(se=_e(br),ve):se},ve.endAngle=function(br){return arguments.length?(fe=_e(br),ve):fe},ve};function Ae(mt){return mt.radius}c.svg.diagonal=function(){var mt=be,St=pe,Xt=Xe;function se(fe,ve){var De=mt.call(this,fe,ve),Ce=St.call(this,fe,ve),Qe=(De.y+Ce.y)/2,Mr=[De,{x:De.x,y:Qe},{x:Ce.x,y:Qe},Ce];return Mr=Mr.map(Xt),"M"+Mr[0]+"C"+Mr[1]+" "+Mr[2]+" "+Mr[3]}return se.source=function(fe){return arguments.length?(mt=_e(fe),se):mt},se.target=function(fe){return arguments.length?(St=_e(fe),se):St},se.projection=function(fe){return arguments.length?(Xt=fe,se):Xt},se};function Xe(mt){return[mt.x,mt.y]}c.svg.diagonal.radial=function(){var mt=c.svg.diagonal(),St=Xe,Xt=mt.projection;return mt.projection=function(se){return arguments.length?Xt(nr(St=se)):St},mt};function nr(mt){return function(){var St=mt.apply(this,arguments),Xt=St[0],se=St[1]-Ot;return[Xt*Math.cos(se),Xt*Math.sin(se)]}}c.svg.symbol=function(){var mt=Tr,St=or;function Xt(se,fe){return(Qr.get(mt.call(this,se,fe))||Rr)(St.call(this,se,fe))}return Xt.type=function(se){return arguments.length?(mt=_e(se),Xt):mt},Xt.size=function(se){return arguments.length?(St=_e(se),Xt):St},Xt};function or(){return 64}function Tr(){return"circle"}function Rr(mt){var St=Math.sqrt(mt/ut);return"M0,"+St+"A"+St+","+St+" 0 1,1 0,"+-St+"A"+St+","+St+" 0 1,1 0,"+St+"Z"}var Qr=c.map({circle:Rr,cross:function(mt){var St=Math.sqrt(mt/5)/2;return"M"+-3*St+","+-St+"H"+-St+"V"+-3*St+"H"+St+"V"+-St+"H"+3*St+"V"+St+"H"+St+"V"+3*St+"H"+-St+"V"+St+"H"+-3*St+"Z"},diamond:function(mt){var St=Math.sqrt(mt/(2*mn)),Xt=St*mn;return"M0,"+-St+"L"+Xt+",0 0,"+St+" "+-Xt+",0Z"},square:function(mt){var St=Math.sqrt(mt)/2;return"M"+-St+","+-St+"L"+St+","+-St+" "+St+","+St+" "+-St+","+St+"Z"},"triangle-down":function(mt){var St=Math.sqrt(mt/nn),Xt=St*nn/2;return"M0,"+Xt+"L"+St+","+-Xt+" "+-St+","+-Xt+"Z"},"triangle-up":function(mt){var St=Math.sqrt(mt/nn),Xt=St*nn/2;return"M0,"+-Xt+"L"+St+","+Xt+" "+-St+","+Xt+"Z"}});c.svg.symbolTypes=Qr.keys();var nn=Math.sqrt(3),mn=Math.tan(30*$t);Y.transition=function(mt){for(var St=li||++Na,Xt=Uo(mt),se=[],fe,ve,De=Ka||{time:Date.now(),ease:io,delay:0,duration:250},Ce=-1,Qe=this.length;++Ce<Qe;){se.push(fe=[]);for(var Mr=this[Ce],br=-1,jr=Mr.length;++br<jr;)(ve=Mr[br])&&ho(ve,br,Xt,St,De),fe.push(ve)}return Yn(se,Xt,St)},Y.interrupt=function(mt){return this.each(mt==null?zn:na(Uo(mt)))};var zn=na(Uo());function na(mt){return function(){var St,Xt,se;(St=this[mt])&&(se=St[Xt=St.active])&&(se.timer.c=null,se.timer.t=NaN,--St.count?delete St[Xt]:delete this[mt],St.active+=.5,se.event&&se.event.interrupt.call(this,this.__data__,se.index))}}function Yn(mt,St,Xt){return Z(mt,la),mt.namespace=St,mt.id=Xt,mt}var la=[],Na=0,li,Ka;la.call=Y.call,la.empty=Y.empty,la.node=Y.node,la.size=Y.size,c.transition=function(mt,St){return mt&&mt.transition?li?mt.transition(St):mt:c.selection().transition(mt)},c.transition.prototype=la,la.select=function(mt){var St=this.id,Xt=this.namespace,se=[],fe,ve,De;mt=q(mt);for(var Ce=-1,Qe=this.length;++Ce<Qe;){se.push(fe=[]);for(var Mr=this[Ce],br=-1,jr=Mr.length;++br<jr;)(De=Mr[br])&&(ve=mt.call(De,De.__data__,br,Ce))?("__data__"in De&&(ve.__data__=De.__data__),ho(ve,br,Xt,St,De[Xt][St]),fe.push(ve)):fe.push(null)}return Yn(se,Xt,St)},la.selectAll=function(mt){var St=this.id,Xt=this.namespace,se=[],fe,ve,De,Ce,Qe;mt=ot(mt);for(var Mr=-1,br=this.length;++Mr<br;)for(var jr=this[Mr],Yr=-1,tn=jr.length;++Yr<tn;)if(De=jr[Yr]){Qe=De[Xt][St],ve=mt.call(De,De.__data__,Yr,Mr),se.push(fe=[]);for(var Rn=-1,sn=ve.length;++Rn<sn;)(Ce=ve[Rn])&&ho(Ce,Rn,Xt,St,Qe),fe.push(Ce)}return Yn(se,Xt,St)},la.filter=function(mt){var St=[],Xt,se,fe;typeof mt!="function"&&(mt=vt(mt));for(var ve=0,De=this.length;ve<De;ve++){St.push(Xt=[]);for(var se=this[ve],Ce=0,Qe=se.length;Ce<Qe;Ce++)(fe=se[Ce])&&mt.call(fe,fe.__data__,Ce,ve)&&Xt.push(fe)}return Yn(St,this.namespace,this.id)},la.tween=function(mt,St){var Xt=this.id,se=this.namespace;return arguments.length<2?this.node()[se][Xt].tween.get(mt):Kt(this,St==null?function(fe){fe[se][Xt].tween.remove(mt)}:function(fe){fe[se][Xt].tween.set(mt,St)})};function Gi(mt,St,Xt,se){var fe=mt.id,ve=mt.namespace;return Kt(mt,typeof Xt=="function"?function(De,Ce,Qe){De[ve][fe].tween.set(St,se(Xt.call(De,De.__data__,Ce,Qe)))}:(Xt=se(Xt),function(De){De[ve][fe].tween.set(St,Xt)}))}la.attr=function(mt,St){if(arguments.length<2){for(St in mt)this.attr(St,mt[St]);return this}var Xt=mt=="transform"?Dc:$o,se=c.ns.qualify(mt);function fe(){this.removeAttribute(se)}function ve(){this.removeAttributeNS(se.space,se.local)}function De(Qe){return Qe==null?fe:(Qe+="",function(){var Mr=this.getAttribute(se),br;return Mr!==Qe&&(br=Xt(Mr,Qe),function(jr){this.setAttribute(se,br(jr))})})}function Ce(Qe){return Qe==null?ve:(Qe+="",function(){var Mr=this.getAttributeNS(se.space,se.local),br;return Mr!==Qe&&(br=Xt(Mr,Qe),function(jr){this.setAttributeNS(se.space,se.local,br(jr))})})}return Gi(this,"attr."+mt,St,se.local?Ce:De)},la.attrTween=function(mt,St){var Xt=c.ns.qualify(mt);function se(ve,De){var Ce=St.call(this,ve,De,this.getAttribute(Xt));return Ce&&function(Qe){this.setAttribute(Xt,Ce(Qe))}}function fe(ve,De){var Ce=St.call(this,ve,De,this.getAttributeNS(Xt.space,Xt.local));return Ce&&function(Qe){this.setAttributeNS(Xt.space,Xt.local,Ce(Qe))}}return this.tween("attr."+mt,Xt.local?fe:se)},la.style=function(mt,St,Xt){var se=arguments.length;if(se<3){if(typeof mt!="string"){se<2&&(St="");for(Xt in mt)this.style(Xt,mt[Xt],St);return this}Xt=""}function fe(){this.style.removeProperty(mt)}function ve(De){return De==null?fe:(De+="",function(){var Ce=e(this).getComputedStyle(this,null).getPropertyValue(mt),Qe;return Ce!==De&&(Qe=$o(Ce,De),function(Mr){this.style.setProperty(mt,Qe(Mr),Xt)})})}return Gi(this,"style."+mt,St,ve)},la.styleTween=function(mt,St,Xt){arguments.length<3&&(Xt="");function se(fe,ve){var De=St.call(this,fe,ve,e(this).getComputedStyle(this,null).getPropertyValue(mt));return De&&function(Ce){this.style.setProperty(mt,De(Ce),Xt)}}return this.tween("style."+mt,se)},la.text=function(mt){return Gi(this,"text",mt,jo)};function jo(mt){return mt==null&&(mt=""),function(){this.textContent=mt}}la.remove=function(){var mt=this.namespace;return this.each("end.transition",function(){var St;this[mt].count<2&&(St=this.parentNode)&&St.removeChild(this)})},la.ease=function(mt){var St=this.id,Xt=this.namespace;return arguments.length<1?this.node()[Xt][St].ease:(typeof mt!="function"&&(mt=c.ease.apply(c,arguments)),Kt(this,function(se){se[Xt][St].ease=mt}))},la.delay=function(mt){var St=this.id,Xt=this.namespace;return arguments.length<1?this.node()[Xt][St].delay:Kt(this,typeof mt=="function"?function(se,fe,ve){se[Xt][St].delay=+mt.call(se,se.__data__,fe,ve)}:(mt=+mt,function(se){se[Xt][St].delay=mt}))},la.duration=function(mt){var St=this.id,Xt=this.namespace;return arguments.length<1?this.node()[Xt][St].duration:Kt(this,typeof mt=="function"?function(se,fe,ve){se[Xt][St].duration=Math.max(1,mt.call(se,se.__data__,fe,ve))}:(mt=Math.max(1,mt),function(se){se[Xt][St].duration=mt}))},la.each=function(mt,St){var Xt=this.id,se=this.namespace;if(arguments.length<2){var fe=Ka,ve=li;try{li=Xt,Kt(this,function(De,Ce,Qe){Ka=De[se][Xt],mt.call(De,De.__data__,Ce,Qe)})}finally{Ka=fe,li=ve}}else Kt(this,function(De){var Ce=De[se][Xt];(Ce.event||(Ce.event=c.dispatch("start","end","interrupt"))).on(mt,St)});return this},la.transition=function(){for(var mt=this.id,St=++Na,Xt=this.namespace,se=[],fe,ve,De,Ce,Qe=0,Mr=this.length;Qe<Mr;Qe++){se.push(fe=[]);for(var ve=this[Qe],br=0,jr=ve.length;br<jr;br++)(De=ve[br])&&(Ce=De[Xt][mt],ho(De,br,Xt,St,{time:Ce.time,ease:Ce.ease,delay:Ce.delay+Ce.duration,duration:Ce.duration})),fe.push(De)}return Yn(se,Xt,St)};function Uo(mt){return mt==null?"__transition__":"__transition_"+mt+"__"}function ho(mt,St,Xt,se,fe){var ve=mt[Xt]||(mt[Xt]={active:0,count:0}),De=ve[se],Ce,Qe,Mr,br,jr;function Yr(sn){var Mn=De.delay;if(Qe.t=Mn+Ce,Mn<=sn)return tn(sn-Mn);Qe.c=tn}function tn(sn){var Mn=ve.active,In=ve[Mn];In&&(In.timer.c=null,In.timer.t=NaN,--ve.count,delete ve[Mn],In.event&&In.event.interrupt.call(mt,mt.__data__,In.index));for(var Dn in ve)if(+Dn<se){var jn=ve[Dn];jn.timer.c=null,jn.timer.t=NaN,--ve.count,delete ve[Dn]}Qe.c=Rn,Qn(function(){return Qe.c&&Rn(sn||1)&&(Qe.c=null,Qe.t=NaN),1},0,Ce),ve.active=se,De.event&&De.event.start.call(mt,mt.__data__,St),jr=[],De.tween.forEach(function(xn,_a){(_a=_a.call(mt,mt.__data__,St))&&jr.push(_a)}),br=De.ease,Mr=De.duration}function Rn(sn){for(var Mn=sn/Mr,In=br(Mn),Dn=jr.length;Dn>0;)jr[--Dn].call(mt,In);if(Mn>=1)return De.event&&De.event.end.call(mt,mt.__data__,St),--ve.count?delete ve[se]:delete mt[Xt],1}De||(Ce=fe.time,Qe=Qn(Yr,0,Ce),De=ve[se]={tween:new S,time:Ce,timer:Qe,delay:fe.delay,duration:fe.duration,ease:fe.ease,index:St},fe=null,++ve.count)}c.svg.axis=function(){var mt=c.scale.linear(),St=Go,Xt=6,se=6,fe=3,ve=[10],De=null,Ce;function Qe(Mr){Mr.each(function(){var br=c.select(this),jr=this.__chart__||mt,Yr=this.__chart__=mt.copy(),tn=De??(Yr.ticks?Yr.ticks.apply(Yr,ve):Yr.domain()),Rn=Ce??(Yr.tickFormat?Yr.tickFormat.apply(Yr,ve):B),sn=br.selectAll(".tick").data(tn,Yr),Mn=sn.enter().insert("g",".domain").attr("class","tick").style("opacity",qt),In=c.transition(sn.exit()).style("opacity",qt).remove(),Dn=c.transition(sn.order()).style("opacity",1),jn=Math.max(Xt,0)+fe,xn,_a=Ln(Yr),La=br.selectAll(".domain").data([0]),$a=(La.enter().append("path").attr("class","domain"),c.transition(La));Mn.append("line"),Mn.append("text");var ti=Mn.select("line"),ii=Dn.select("line"),di=sn.select("text").text(Rn),Io=Mn.select("text"),gi=Dn.select("text"),Ji=St==="top"||St==="left"?-1:1,qo,Ys,_s,Ja;if(St==="bottom"||St==="top"?(xn=Is,qo="x",_s="y",Ys="x2",Ja="y2",di.attr("dy",Ji<0?"0em":".71em").style("text-anchor","middle"),$a.attr("d","M"+_a[0]+","+Ji*se+"V0H"+_a[1]+"V"+Ji*se)):(xn=bo,qo="y",_s="x",Ys="y2",Ja="x2",di.attr("dy",".32em").style("text-anchor",Ji<0?"end":"start"),$a.attr("d","M"+Ji*se+","+_a[0]+"H0V"+_a[1]+"H"+Ji*se)),ti.attr(Ja,Ji*Xt),Io.attr(_s,Ji*jn),ii.attr(Ys,0).attr(Ja,Ji*Xt),gi.attr(qo,0).attr(_s,Ji*jn),Yr.rangeBand){var yo=Yr,Lo=yo.rangeBand()/2;jr=Yr=function(bs){return yo(bs)+Lo}}else jr.rangeBand?jr=Yr:In.call(xn,Yr,jr);Mn.call(xn,jr,Yr),Dn.call(xn,Yr,Yr)})}return Qe.scale=function(Mr){return arguments.length?(mt=Mr,Qe):mt},Qe.orient=function(Mr){return arguments.length?(St=Mr in js?Mr+"":Go,Qe):St},Qe.ticks=function(){return arguments.length?(ve=E(arguments),Qe):ve},Qe.tickValues=function(Mr){return arguments.length?(De=Mr,Qe):De},Qe.tickFormat=function(Mr){return arguments.length?(Ce=Mr,Qe):Ce},Qe.tickSize=function(Mr){var br=arguments.length;return br?(Xt=+Mr,se=+arguments[br-1],Qe):Xt},Qe.innerTickSize=function(Mr){return arguments.length?(Xt=+Mr,Qe):Xt},Qe.outerTickSize=function(Mr){return arguments.length?(se=+Mr,Qe):se},Qe.tickPadding=function(Mr){return arguments.length?(fe=+Mr,Qe):fe},Qe.tickSubdivide=function(){return arguments.length&&Qe},Qe};var Go="bottom",js={top:1,right:1,bottom:1,left:1};function Is(mt,St,Xt){mt.attr("transform",function(se){var fe=St(se);return"translate("+(isFinite(fe)?fe:Xt(se))+",0)"})}function bo(mt,St,Xt){mt.attr("transform",function(se){var fe=St(se);return"translate(0,"+(isFinite(fe)?fe:Xt(se))+")"})}c.svg.brush=function(){var mt=lt(br,"brushstart","brush","brushend"),St=null,Xt=null,se=[0,0],fe=[0,0],ve,De,Ce=!0,Qe=!0,Mr=nl[0];function br(sn){sn.each(function(){var Mn=c.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",Rn).on("touchstart.brush",Rn),In=Mn.selectAll(".background").data([0]);In.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Mn.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Dn=Mn.selectAll(".resize").data(Mr,B);Dn.exit().remove(),Dn.enter().append("g").attr("class",function(La){return"resize "+La}).style("cursor",function(La){return wo[La]}).append("rect").attr("x",function(La){return/[ew]$/.test(La)?-3:null}).attr("y",function(La){return/^[ns]/.test(La)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Dn.style("display",br.empty()?"none":null);var jn=c.transition(Mn),xn=c.transition(In),_a;St&&(_a=Ln(St),xn.attr("x",_a[0]).attr("width",_a[1]-_a[0]),Yr(jn)),Xt&&(_a=Ln(Xt),xn.attr("y",_a[0]).attr("height",_a[1]-_a[0]),tn(jn)),jr(jn)})}br.event=function(sn){sn.each(function(){var Mn=mt.of(this,arguments),In={x:se,y:fe,i:ve,j:De},Dn=this.__chart__||In;this.__chart__=In,li?c.select(this).transition().each("start.brush",function(){ve=Dn.i,De=Dn.j,se=Dn.x,fe=Dn.y,Mn({type:"brushstart"})}).tween("brush:brush",function(){var jn=ks(se,In.x),xn=ks(fe,In.y);return ve=De=null,function(_a){se=In.x=jn(_a),fe=In.y=xn(_a),Mn({type:"brush",mode:"resize"})}}).each("end.brush",function(){ve=In.i,De=In.j,Mn({type:"brush",mode:"resize"}),Mn({type:"brushend"})}):(Mn({type:"brushstart"}),Mn({type:"brush",mode:"resize"}),Mn({type:"brushend"}))})};function jr(sn){sn.selectAll(".resize").attr("transform",function(Mn){return"translate("+se[+/e$/.test(Mn)]+","+fe[+/^s/.test(Mn)]+")"})}function Yr(sn){sn.select(".extent").attr("x",se[0]),sn.selectAll(".extent,.n>rect,.s>rect").attr("width",se[1]-se[0])}function tn(sn){sn.select(".extent").attr("y",fe[0]),sn.selectAll(".extent,.e>rect,.w>rect").attr("height",fe[1]-fe[0])}function Rn(){var sn=this,Mn=c.select(c.event.target),In=mt.of(sn,arguments),Dn=c.select(sn),jn=Mn.datum(),xn=!/^(n|s)$/.test(jn)&&St,_a=!/^(e|w)$/.test(jn)&&Xt,La=Mn.classed("extent"),$a=Lr(sn),ti,ii=c.mouse(sn),di,Io=c.select(e(sn)).on("keydown.brush",qo).on("keyup.brush",Ys);if(c.event.changedTouches?Io.on("touchmove.brush",_s).on("touchend.brush",yo):Io.on("mousemove.brush",_s).on("mouseup.brush",yo),Dn.interrupt().selectAll("*").interrupt(),La)ii[0]=se[0]-ii[0],ii[1]=fe[0]-ii[1];else if(jn){var gi=+/w$/.test(jn),Ji=+/^n/.test(jn);di=[se[1-gi]-ii[0],fe[1-Ji]-ii[1]],ii[0]=se[gi],ii[1]=fe[Ji]}else c.event.altKey&&(ti=ii.slice());Dn.style("pointer-events","none").selectAll(".resize").style("display",null),c.select("body").style("cursor",Mn.style("cursor")),In({type:"brushstart"}),_s();function qo(){c.event.keyCode==32&&(La||(ti=null,ii[0]-=se[1],ii[1]-=fe[1],La=2),rt())}function Ys(){c.event.keyCode==32&&La==2&&(ii[0]+=se[1],ii[1]+=fe[1],La=0,rt())}function _s(){var Lo=c.mouse(sn),bs=!1;di&&(Lo[0]+=di[0],Lo[1]+=di[1]),La||(c.event.altKey?(ti||(ti=[(se[0]+se[1])/2,(fe[0]+fe[1])/2]),ii[0]=se[+(Lo[0]<ti[0])],ii[1]=fe[+(Lo[1]<ti[1])]):ti=null),xn&&Ja(Lo,St,0)&&(Yr(Dn),bs=!0),_a&&Ja(Lo,Xt,1)&&(tn(Dn),bs=!0),bs&&(jr(Dn),In({type:"brush",mode:La?"move":"resize"}))}function Ja(Lo,bs,us){var eu=Ln(bs),Yo=eu[0],gs=eu[1],wu=ii[us],sr=us?fe:se,fn=sr[1]-sr[0],gn,ha;if(La&&(Yo-=wu,gs-=fn+wu),gn=(us?Qe:Ce)?Math.max(Yo,Math.min(gs,Lo[us])):Lo[us],La?ha=(gn+=wu)+fn:(ti&&(wu=Math.max(Yo,Math.min(gs,2*ti[us]-gn))),wu<gn?(ha=gn,gn=wu):ha=wu),sr[0]!=gn||sr[1]!=ha)return us?De=null:ve=null,sr[0]=gn,sr[1]=ha,!0}function yo(){_s(),Dn.style("pointer-events","all").selectAll(".resize").style("display",br.empty()?"none":null),c.select("body").style("cursor",null),Io.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),$a(),In({type:"brushend"})}}return br.x=function(sn){return arguments.length?(St=sn,Mr=nl[!St<<1|!Xt],br):St},br.y=function(sn){return arguments.length?(Xt=sn,Mr=nl[!St<<1|!Xt],br):Xt},br.clamp=function(sn){return arguments.length?(St&&Xt?(Ce=!!sn[0],Qe=!!sn[1]):St?Ce=!!sn:Xt&&(Qe=!!sn),br):St&&Xt?[Ce,Qe]:St?Ce:Xt?Qe:null},br.extent=function(sn){var Mn,In,Dn,jn,xn;return arguments.length?(St&&(Mn=sn[0],In=sn[1],Xt&&(Mn=Mn[0],In=In[0]),ve=[Mn,In],St.invert&&(Mn=St(Mn),In=St(In)),In<Mn&&(xn=Mn,Mn=In,In=xn),(Mn!=se[0]||In!=se[1])&&(se=[Mn,In])),Xt&&(Dn=sn[0],jn=sn[1],St&&(Dn=Dn[1],jn=jn[1]),De=[Dn,jn],Xt.invert&&(Dn=Xt(Dn),jn=Xt(jn)),jn<Dn&&(xn=Dn,Dn=jn,jn=xn),(Dn!=fe[0]||jn!=fe[1])&&(fe=[Dn,jn])),br):(St&&(ve?(Mn=ve[0],In=ve[1]):(Mn=se[0],In=se[1],St.invert&&(Mn=St.invert(Mn),In=St.invert(In)),In<Mn&&(xn=Mn,Mn=In,In=xn))),Xt&&(De?(Dn=De[0],jn=De[1]):(Dn=fe[0],jn=fe[1],Xt.invert&&(Dn=Xt.invert(Dn),jn=Xt.invert(jn)),jn<Dn&&(xn=Dn,Dn=jn,jn=xn))),St&&Xt?[[Mn,Dn],[In,jn]]:St?[Mn,In]:Xt&&[Dn,jn])},br.clear=function(){return br.empty()||(se=[0,0],fe=[0,0],ve=De=null),br},br.empty=function(){return!!St&&se[0]==se[1]||!!Xt&&fe[0]==fe[1]},c.rebind(br,mt,"on")};var wo={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},nl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];c.text=Je(function(mt){return mt.responseText}),c.json=function(mt,St){return yr(mt,"application/json",dl,St)};function dl(mt){return JSON.parse(mt.responseText)}c.html=function(mt,St){return yr(mt,"text/html",lu,St)};function lu(mt){var St=A.createRange();return St.selectNode(A.body),St.createContextualFragment(mt.responseText)}c.xml=Je(function(mt){return mt.responseXML}),typeof V=="object"&&V.exports?V.exports=c:this.d3=c}).apply(self)}),V_=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X):(c=c||self,g(c.d3=c.d3||{}))})(X,function(c){var g=new Date,E=new Date;function A(vt,Ut,Kt,Zt){function le(Te){return vt(Te=arguments.length===0?new Date:new Date(+Te)),Te}return le.floor=function(Te){return vt(Te=new Date(+Te)),Te},le.ceil=function(Te){return vt(Te=new Date(Te-1)),Ut(Te,1),vt(Te),Te},le.round=function(Te){var Se=le(Te),Fe=le.ceil(Te);return Te-Se<Fe-Te?Se:Fe},le.offset=function(Te,Se){return Ut(Te=new Date(+Te),Se==null?1:Math.floor(Se)),Te},le.range=function(Te,Se,Fe){var Oe=[],ur;if(Te=le.ceil(Te),Fe=Fe==null?1:Math.floor(Fe),!(Te<Se)||!(Fe>0))return Oe;do Oe.push(ur=new Date(+Te)),Ut(Te,Fe),vt(Te);while(ur<Te&&Te<Se);return Oe},le.filter=function(Te){return A(function(Se){if(Se>=Se)for(;vt(Se),!Te(Se);)Se.setTime(Se-1)},function(Se,Fe){if(Se>=Se)if(Fe<0)for(;++Fe<=0;)for(;Ut(Se,-1),!Te(Se););else for(;--Fe>=0;)for(;Ut(Se,1),!Te(Se););})},Kt&&(le.count=function(Te,Se){return g.setTime(+Te),E.setTime(+Se),vt(g),vt(E),Math.floor(Kt(g,E))},le.every=function(Te){return Te=Math.floor(Te),!isFinite(Te)||!(Te>0)?null:Te>1?le.filter(Zt?function(Se){return Zt(Se)%Te===0}:function(Se){return le.count(0,Se)%Te===0}):le}),le}var t=A(function(){},function(vt,Ut){vt.setTime(+vt+Ut)},function(vt,Ut){return Ut-vt});t.every=function(vt){return vt=Math.floor(vt),!isFinite(vt)||!(vt>0)?null:vt>1?A(function(Ut){Ut.setTime(Math.floor(Ut/vt)*vt)},function(Ut,Kt){Ut.setTime(+Ut+Kt*vt)},function(Ut,Kt){return(Kt-Ut)/vt}):t};var e=t.range,r=1e3,i=6e4,n=36e5,o=864e5,a=6048e5,s=A(function(vt){vt.setTime(vt-vt.getMilliseconds())},function(vt,Ut){vt.setTime(+vt+Ut*r)},function(vt,Ut){return(Ut-vt)/r},function(vt){return vt.getUTCSeconds()}),h=s.range,v=A(function(vt){vt.setTime(vt-vt.getMilliseconds()-vt.getSeconds()*r)},function(vt,Ut){vt.setTime(+vt+Ut*i)},function(vt,Ut){return(Ut-vt)/i},function(vt){return vt.getMinutes()}),m=v.range,p=A(function(vt){vt.setTime(vt-vt.getMilliseconds()-vt.getSeconds()*r-vt.getMinutes()*i)},function(vt,Ut){vt.setTime(+vt+Ut*n)},function(vt,Ut){return(Ut-vt)/n},function(vt){return vt.getHours()}),y=p.range,l=A(function(vt){vt.setHours(0,0,0,0)},function(vt,Ut){vt.setDate(vt.getDate()+Ut)},function(vt,Ut){return(Ut-vt-(Ut.getTimezoneOffset()-vt.getTimezoneOffset())*i)/o},function(vt){return vt.getDate()-1}),x=l.range;function b(vt){return A(function(Ut){Ut.setDate(Ut.getDate()-(Ut.getDay()+7-vt)%7),Ut.setHours(0,0,0,0)},function(Ut,Kt){Ut.setDate(Ut.getDate()+Kt*7)},function(Ut,Kt){return(Kt-Ut-(Kt.getTimezoneOffset()-Ut.getTimezoneOffset())*i)/a})}var S=b(0),T=b(1),M=b(2),w=b(3),u=b(4),f=b(5),k=b(6),_=S.range,D=T.range,I=M.range,O=w.range,B=u.range,R=f.range,L=k.range,F=A(function(vt){vt.setDate(1),vt.setHours(0,0,0,0)},function(vt,Ut){vt.setMonth(vt.getMonth()+Ut)},function(vt,Ut){return Ut.getMonth()-vt.getMonth()+(Ut.getFullYear()-vt.getFullYear())*12},function(vt){return vt.getMonth()}),N=F.range,j=A(function(vt){vt.setMonth(0,1),vt.setHours(0,0,0,0)},function(vt,Ut){vt.setFullYear(vt.getFullYear()+Ut)},function(vt,Ut){return Ut.getFullYear()-vt.getFullYear()},function(vt){return vt.getFullYear()});j.every=function(vt){return!isFinite(vt=Math.floor(vt))||!(vt>0)?null:A(function(Ut){Ut.setFullYear(Math.floor(Ut.getFullYear()/vt)*vt),Ut.setMonth(0,1),Ut.setHours(0,0,0,0)},function(Ut,Kt){Ut.setFullYear(Ut.getFullYear()+Kt*vt)})};var G=j.range,rt=A(function(vt){vt.setUTCSeconds(0,0)},function(vt,Ut){vt.setTime(+vt+Ut*i)},function(vt,Ut){return(Ut-vt)/i},function(vt){return vt.getUTCMinutes()}),ct=rt.range,lt=A(function(vt){vt.setUTCMinutes(0,0,0)},function(vt,Ut){vt.setTime(+vt+Ut*n)},function(vt,Ut){return(Ut-vt)/n},function(vt){return vt.getUTCHours()}),tt=lt.range,Z=A(function(vt){vt.setUTCHours(0,0,0,0)},function(vt,Ut){vt.setUTCDate(vt.getUTCDate()+Ut)},function(vt,Ut){return(Ut-vt)/o},function(vt){return vt.getUTCDate()-1}),st=Z.range;function $(vt){return A(function(Ut){Ut.setUTCDate(Ut.getUTCDate()-(Ut.getUTCDay()+7-vt)%7),Ut.setUTCHours(0,0,0,0)},function(Ut,Kt){Ut.setUTCDate(Ut.getUTCDate()+Kt*7)},function(Ut,Kt){return(Kt-Ut)/a})}var Q=$(0),nt=$(1),Y=$(2),q=$(3),ot=$(4),it=$(5),dt=$(6),wt=Q.range,xt=nt.range,Ft=Y.range,Et=q.range,Nt=ot.range,te=it.range,Jt=dt.range,Qt=A(function(vt){vt.setUTCDate(1),vt.setUTCHours(0,0,0,0)},function(vt,Ut){vt.setUTCMonth(vt.getUTCMonth()+Ut)},function(vt,Ut){return Ut.getUTCMonth()-vt.getUTCMonth()+(Ut.getUTCFullYear()-vt.getUTCFullYear())*12},function(vt){return vt.getUTCMonth()}),Wt=Qt.range,gt=A(function(vt){vt.setUTCMonth(0,1),vt.setUTCHours(0,0,0,0)},function(vt,Ut){vt.setUTCFullYear(vt.getUTCFullYear()+Ut)},function(vt,Ut){return Ut.getUTCFullYear()-vt.getUTCFullYear()},function(vt){return vt.getUTCFullYear()});gt.every=function(vt){return!isFinite(vt=Math.floor(vt))||!(vt>0)?null:A(function(Ut){Ut.setUTCFullYear(Math.floor(Ut.getUTCFullYear()/vt)*vt),Ut.setUTCMonth(0,1),Ut.setUTCHours(0,0,0,0)},function(Ut,Kt){Ut.setUTCFullYear(Ut.getUTCFullYear()+Kt*vt)})};var bt=gt.range;c.timeDay=l,c.timeDays=x,c.timeFriday=f,c.timeFridays=R,c.timeHour=p,c.timeHours=y,c.timeInterval=A,c.timeMillisecond=t,c.timeMilliseconds=e,c.timeMinute=v,c.timeMinutes=m,c.timeMonday=T,c.timeMondays=D,c.timeMonth=F,c.timeMonths=N,c.timeSaturday=k,c.timeSaturdays=L,c.timeSecond=s,c.timeSeconds=h,c.timeSunday=S,c.timeSundays=_,c.timeThursday=u,c.timeThursdays=B,c.timeTuesday=M,c.timeTuesdays=I,c.timeWednesday=w,c.timeWednesdays=O,c.timeWeek=S,c.timeWeeks=_,c.timeYear=j,c.timeYears=G,c.utcDay=Z,c.utcDays=st,c.utcFriday=it,c.utcFridays=te,c.utcHour=lt,c.utcHours=tt,c.utcMillisecond=t,c.utcMilliseconds=e,c.utcMinute=rt,c.utcMinutes=ct,c.utcMonday=nt,c.utcMondays=xt,c.utcMonth=Qt,c.utcMonths=Wt,c.utcSaturday=dt,c.utcSaturdays=Jt,c.utcSecond=s,c.utcSeconds=h,c.utcSunday=Q,c.utcSundays=wt,c.utcThursday=ot,c.utcThursdays=Nt,c.utcTuesday=Y,c.utcTuesdays=Ft,c.utcWednesday=q,c.utcWednesdays=Et,c.utcWeek=Q,c.utcWeeks=wt,c.utcYear=gt,c.utcYears=bt,Object.defineProperty(c,"__esModule",{value:!0})})}),fg=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X,V_()):(c=c||self,g(c.d3=c.d3||{},c.d3))})(X,function(c,g){function E(Dt){if(0<=Dt.y&&Dt.y<100){var qt=new Date(-1,Dt.m,Dt.d,Dt.H,Dt.M,Dt.S,Dt.L);return qt.setFullYear(Dt.y),qt}return new Date(Dt.y,Dt.m,Dt.d,Dt.H,Dt.M,Dt.S,Dt.L)}function A(Dt){if(0<=Dt.y&&Dt.y<100){var qt=new Date(Date.UTC(-1,Dt.m,Dt.d,Dt.H,Dt.M,Dt.S,Dt.L));return qt.setUTCFullYear(Dt.y),qt}return new Date(Date.UTC(Dt.y,Dt.m,Dt.d,Dt.H,Dt.M,Dt.S,Dt.L))}function t(Dt,qt,zt){return{y:Dt,m:qt,d:zt,H:0,M:0,S:0,L:0}}function e(Dt){var qt=Dt.dateTime,zt=Dt.date,ut=Dt.time,yt=Dt.periods,Mt=Dt.days,Ot=Dt.shortDays,$t=Dt.months,ee=Dt.shortMonths,we=h(yt),Me=v(yt),Re=h(Mt),Be=v(Mt),Ze=h(Ot),Ue=v(Ot),mr=h($t),ln=v($t),an=h(ee),vn=v(ee),Sn={a:bn,A:Fn,b:on,B:Bn,c:null,d:F,e:F,f:ct,H:N,I:j,j:G,L:rt,m:lt,M:tt,p:ue,q:xe,Q:Se,s:Fe,S:Z,u:st,U:$,V:Q,w:nt,W:Y,x:null,X:null,y:q,Y:ot,Z:it,"%":Te},An={a:Pr,A:Sr,b:gr,B:dr,c:null,d:dt,e:dt,f:Nt,H:wt,I:xt,j:Ft,L:Et,m:te,M:Jt,p:Er,q:Dr,Q:Se,s:Fe,S:Qt,u:Wt,U:gt,V:bt,w:vt,W:Ut,x:null,X:null,y:Kt,Y:Zt,Z:le,"%":Te},pn={a:je,A:Ne,b:_r,B:Xr,c:rn,d:u,e:u,f:O,H:k,I:k,j:f,L:I,m:w,M:_,p:ze,q:M,Q:R,s:L,S:D,u:p,U:y,V:l,w:m,W:x,x:Br,X:_n,y:S,Y:b,Z:T,"%":B};Sn.x=On(zt,Sn),Sn.X=On(ut,Sn),Sn.c=On(qt,Sn),An.x=On(zt,An),An.X=On(ut,An),An.c=On(qt,An);function On(Ar,Gr){return function(Wr){var Jr=[],_e=-1,Je=0,yr=Ar.length,Hr,hn,En;for(Wr instanceof Date||(Wr=new Date(+Wr));++_e<yr;)Ar.charCodeAt(_e)===37&&(Jr.push(Ar.slice(Je,_e)),(hn=r[Hr=Ar.charAt(++_e)])!=null?Hr=Ar.charAt(++_e):hn=Hr==="e"?" ":"0",(En=Gr[Hr])&&(Hr=En(Wr,hn)),Jr.push(Hr),Je=_e+1);return Jr.push(Ar.slice(Je,_e)),Jr.join("")}}function Nn(Ar,Gr){return function(Wr){var Jr=t(1900,void 0,1),_e=ke(Jr,Ar,Wr+="",0),Je,yr;if(_e!=Wr.length)return null;if("Q"in Jr)return new Date(Jr.Q);if("s"in Jr)return new Date(Jr.s*1e3+("L"in Jr?Jr.L:0));if(Gr&&!("Z"in Jr)&&(Jr.Z=0),"p"in Jr&&(Jr.H=Jr.H%12+Jr.p*12),Jr.m===void 0&&(Jr.m="q"in Jr?Jr.q:0),"V"in Jr){if(Jr.V<1||Jr.V>53)return null;"w"in Jr||(Jr.w=1),"Z"in Jr?(Je=A(t(Jr.y,0,1)),yr=Je.getUTCDay(),Je=yr>4||yr===0?g.utcMonday.ceil(Je):g.utcMonday(Je),Je=g.utcDay.offset(Je,(Jr.V-1)*7),Jr.y=Je.getUTCFullYear(),Jr.m=Je.getUTCMonth(),Jr.d=Je.getUTCDate()+(Jr.w+6)%7):(Je=E(t(Jr.y,0,1)),yr=Je.getDay(),Je=yr>4||yr===0?g.timeMonday.ceil(Je):g.timeMonday(Je),Je=g.timeDay.offset(Je,(Jr.V-1)*7),Jr.y=Je.getFullYear(),Jr.m=Je.getMonth(),Jr.d=Je.getDate()+(Jr.w+6)%7)}else("W"in Jr||"U"in Jr)&&("w"in Jr||(Jr.w="u"in Jr?Jr.u%7:"W"in Jr?1:0),yr="Z"in Jr?A(t(Jr.y,0,1)).getUTCDay():E(t(Jr.y,0,1)).getDay(),Jr.m=0,Jr.d="W"in Jr?(Jr.w+6)%7+Jr.W*7-(yr+5)%7:Jr.w+Jr.U*7-(yr+6)%7);return"Z"in Jr?(Jr.H+=Jr.Z/100|0,Jr.M+=Jr.Z%100,A(Jr)):E(Jr)}}function ke(Ar,Gr,Wr,Jr){for(var _e=0,Je=Gr.length,yr=Wr.length,Hr,hn;_e<Je;){if(Jr>=yr)return-1;if(Hr=Gr.charCodeAt(_e++),Hr===37){if(Hr=Gr.charAt(_e++),hn=pn[Hr in r?Gr.charAt(_e++):Hr],!hn||(Jr=hn(Ar,Wr,Jr))<0)return-1}else if(Hr!=Wr.charCodeAt(Jr++))return-1}return Jr}function ze(Ar,Gr,Wr){var Jr=we.exec(Gr.slice(Wr));return Jr?(Ar.p=Me[Jr[0].toLowerCase()],Wr+Jr[0].length):-1}function je(Ar,Gr,Wr){var Jr=Ze.exec(Gr.slice(Wr));return Jr?(Ar.w=Ue[Jr[0].toLowerCase()],Wr+Jr[0].length):-1}function Ne(Ar,Gr,Wr){var Jr=Re.exec(Gr.slice(Wr));return Jr?(Ar.w=Be[Jr[0].toLowerCase()],Wr+Jr[0].length):-1}function _r(Ar,Gr,Wr){var Jr=an.exec(Gr.slice(Wr));return Jr?(Ar.m=vn[Jr[0].toLowerCase()],Wr+Jr[0].length):-1}function Xr(Ar,Gr,Wr){var Jr=mr.exec(Gr.slice(Wr));return Jr?(Ar.m=ln[Jr[0].toLowerCase()],Wr+Jr[0].length):-1}function rn(Ar,Gr,Wr){return ke(Ar,qt,Gr,Wr)}function Br(Ar,Gr,Wr){return ke(Ar,zt,Gr,Wr)}function _n(Ar,Gr,Wr){return ke(Ar,ut,Gr,Wr)}function bn(Ar){return Ot[Ar.getDay()]}function Fn(Ar){return Mt[Ar.getDay()]}function on(Ar){return ee[Ar.getMonth()]}function Bn(Ar){return $t[Ar.getMonth()]}function ue(Ar){return yt[+(Ar.getHours()>=12)]}function xe(Ar){return 1+~~(Ar.getMonth()/3)}function Pr(Ar){return Ot[Ar.getUTCDay()]}function Sr(Ar){return Mt[Ar.getUTCDay()]}function gr(Ar){return ee[Ar.getUTCMonth()]}function dr(Ar){return $t[Ar.getUTCMonth()]}function Er(Ar){return yt[+(Ar.getUTCHours()>=12)]}function Dr(Ar){return 1+~~(Ar.getUTCMonth()/3)}return{format:function(Ar){var Gr=On(Ar+="",Sn);return Gr.toString=function(){return Ar},Gr},parse:function(Ar){var Gr=Nn(Ar+="",!1);return Gr.toString=function(){return Ar},Gr},utcFormat:function(Ar){var Gr=On(Ar+="",An);return Gr.toString=function(){return Ar},Gr},utcParse:function(Ar){var Gr=Nn(Ar+="",!0);return Gr.toString=function(){return Ar},Gr}}}var r={"-":"",_:" ",0:"0"},i=/^\s*\d+/,n=/^%/,o=/[\\^$*+?|[\]().{}]/g;function a(Dt,qt,zt){var ut=Dt<0?"-":"",yt=(ut?-Dt:Dt)+"",Mt=yt.length;return ut+(Mt<zt?new Array(zt-Mt+1).join(qt)+yt:yt)}function s(Dt){return Dt.replace(o,"\\$&")}function h(Dt){return new RegExp("^(?:"+Dt.map(s).join("|")+")","i")}function v(Dt){for(var qt={},zt=-1,ut=Dt.length;++zt<ut;)qt[Dt[zt].toLowerCase()]=zt;return qt}function m(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+1));return ut?(Dt.w=+ut[0],zt+ut[0].length):-1}function p(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+1));return ut?(Dt.u=+ut[0],zt+ut[0].length):-1}function y(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+2));return ut?(Dt.U=+ut[0],zt+ut[0].length):-1}function l(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+2));return ut?(Dt.V=+ut[0],zt+ut[0].length):-1}function x(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+2));return ut?(Dt.W=+ut[0],zt+ut[0].length):-1}function b(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+4));return ut?(Dt.y=+ut[0],zt+ut[0].length):-1}function S(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+2));return ut?(Dt.y=+ut[0]+(+ut[0]>68?1900:2e3),zt+ut[0].length):-1}function T(Dt,qt,zt){var ut=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(qt.slice(zt,zt+6));return ut?(Dt.Z=ut[1]?0:-(ut[2]+(ut[3]||"00")),zt+ut[0].length):-1}function M(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+1));return ut?(Dt.q=ut[0]*3-3,zt+ut[0].length):-1}function w(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+2));return ut?(Dt.m=ut[0]-1,zt+ut[0].length):-1}function u(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+2));return ut?(Dt.d=+ut[0],zt+ut[0].length):-1}function f(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+3));return ut?(Dt.m=0,Dt.d=+ut[0],zt+ut[0].length):-1}function k(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+2));return ut?(Dt.H=+ut[0],zt+ut[0].length):-1}function _(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+2));return ut?(Dt.M=+ut[0],zt+ut[0].length):-1}function D(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+2));return ut?(Dt.S=+ut[0],zt+ut[0].length):-1}function I(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+3));return ut?(Dt.L=+ut[0],zt+ut[0].length):-1}function O(Dt,qt,zt){var ut=i.exec(qt.slice(zt,zt+6));return ut?(Dt.L=Math.floor(ut[0]/1e3),zt+ut[0].length):-1}function B(Dt,qt,zt){var ut=n.exec(qt.slice(zt,zt+1));return ut?zt+ut[0].length:-1}function R(Dt,qt,zt){var ut=i.exec(qt.slice(zt));return ut?(Dt.Q=+ut[0],zt+ut[0].length):-1}function L(Dt,qt,zt){var ut=i.exec(qt.slice(zt));return ut?(Dt.s=+ut[0],zt+ut[0].length):-1}function F(Dt,qt){return a(Dt.getDate(),qt,2)}function N(Dt,qt){return a(Dt.getHours(),qt,2)}function j(Dt,qt){return a(Dt.getHours()%12||12,qt,2)}function G(Dt,qt){return a(1+g.timeDay.count(g.timeYear(Dt),Dt),qt,3)}function rt(Dt,qt){return a(Dt.getMilliseconds(),qt,3)}function ct(Dt,qt){return rt(Dt,qt)+"000"}function lt(Dt,qt){return a(Dt.getMonth()+1,qt,2)}function tt(Dt,qt){return a(Dt.getMinutes(),qt,2)}function Z(Dt,qt){return a(Dt.getSeconds(),qt,2)}function st(Dt){var qt=Dt.getDay();return qt===0?7:qt}function $(Dt,qt){return a(g.timeSunday.count(g.timeYear(Dt)-1,Dt),qt,2)}function Q(Dt,qt){var zt=Dt.getDay();return Dt=zt>=4||zt===0?g.timeThursday(Dt):g.timeThursday.ceil(Dt),a(g.timeThursday.count(g.timeYear(Dt),Dt)+(g.timeYear(Dt).getDay()===4),qt,2)}function nt(Dt){return Dt.getDay()}function Y(Dt,qt){return a(g.timeMonday.count(g.timeYear(Dt)-1,Dt),qt,2)}function q(Dt,qt){return a(Dt.getFullYear()%100,qt,2)}function ot(Dt,qt){return a(Dt.getFullYear()%1e4,qt,4)}function it(Dt){var qt=Dt.getTimezoneOffset();return(qt>0?"-":(qt*=-1,"+"))+a(qt/60|0,"0",2)+a(qt%60,"0",2)}function dt(Dt,qt){return a(Dt.getUTCDate(),qt,2)}function wt(Dt,qt){return a(Dt.getUTCHours(),qt,2)}function xt(Dt,qt){return a(Dt.getUTCHours()%12||12,qt,2)}function Ft(Dt,qt){return a(1+g.utcDay.count(g.utcYear(Dt),Dt),qt,3)}function Et(Dt,qt){return a(Dt.getUTCMilliseconds(),qt,3)}function Nt(Dt,qt){return Et(Dt,qt)+"000"}function te(Dt,qt){return a(Dt.getUTCMonth()+1,qt,2)}function Jt(Dt,qt){return a(Dt.getUTCMinutes(),qt,2)}function Qt(Dt,qt){return a(Dt.getUTCSeconds(),qt,2)}function Wt(Dt){var qt=Dt.getUTCDay();return qt===0?7:qt}function gt(Dt,qt){return a(g.utcSunday.count(g.utcYear(Dt)-1,Dt),qt,2)}function bt(Dt,qt){var zt=Dt.getUTCDay();return Dt=zt>=4||zt===0?g.utcThursday(Dt):g.utcThursday.ceil(Dt),a(g.utcThursday.count(g.utcYear(Dt),Dt)+(g.utcYear(Dt).getUTCDay()===4),qt,2)}function vt(Dt){return Dt.getUTCDay()}function Ut(Dt,qt){return a(g.utcMonday.count(g.utcYear(Dt)-1,Dt),qt,2)}function Kt(Dt,qt){return a(Dt.getUTCFullYear()%100,qt,2)}function Zt(Dt,qt){return a(Dt.getUTCFullYear()%1e4,qt,4)}function le(){return"+0000"}function Te(){return"%"}function Se(Dt){return+Dt}function Fe(Dt){return Math.floor(+Dt/1e3)}var Oe;ur({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"]});function ur(Dt){return Oe=e(Dt),c.timeFormat=Oe.format,c.timeParse=Oe.parse,c.utcFormat=Oe.utcFormat,c.utcParse=Oe.utcParse,Oe}var fr="%Y-%m-%dT%H:%M:%S.%LZ";function We(Dt){return Dt.toISOString()}var Lr=Date.prototype.toISOString?We:c.utcFormat(fr);function kr(Dt){var qt=new Date(Dt);return isNaN(qt)?null:qt}var he=+new Date("2000-01-01T00:00:00.000Z")?kr:c.utcParse(fr);c.isoFormat=Lr,c.isoParse=he,c.timeFormatDefaultLocale=ur,c.timeFormatLocale=e,Object.defineProperty(c,"__esModule",{value:!0})})}),q_=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X):(c=typeof globalThis<"u"?globalThis:c||self,g(c.d3=c.d3||{}))})(X,function(c){function g(w){return Math.abs(w=Math.round(w))>=1e21?w.toLocaleString("en").replace(/,/g,""):w.toString(10)}function E(w,u){if((f=(w=u?w.toExponential(u-1):w.toExponential()).indexOf("e"))<0)return null;var f,k=w.slice(0,f);return[k.length>1?k[0]+k.slice(2):k,+w.slice(f+1)]}function A(w){return w=E(Math.abs(w)),w?w[1]:NaN}function t(w,u){return function(f,k){for(var _=f.length,D=[],I=0,O=w[0],B=0;_>0&&O>0&&(B+O+1>k&&(O=Math.max(1,k-B)),D.push(f.substring(_-=O,_+O)),!((B+=O+1)>k));)O=w[I=(I+1)%w.length];return D.reverse().join(u)}}function e(w){return function(u){return u.replace(/[0-9]/g,function(f){return w[+f]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(w){if(!(u=r.exec(w)))throw new Error("invalid format: "+w);var u;return new n({fill:u[1],align:u[2],sign:u[3],symbol:u[4],zero:u[5],width:u[6],comma:u[7],precision:u[8]&&u[8].slice(1),trim:u[9],type:u[10]})}i.prototype=n.prototype;function n(w){this.fill=w.fill===void 0?" ":w.fill+"",this.align=w.align===void 0?">":w.align+"",this.sign=w.sign===void 0?"-":w.sign+"",this.symbol=w.symbol===void 0?"":w.symbol+"",this.zero=!!w.zero,this.width=w.width===void 0?void 0:+w.width,this.comma=!!w.comma,this.precision=w.precision===void 0?void 0:+w.precision,this.trim=!!w.trim,this.type=w.type===void 0?"":w.type+""}n.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function o(w){t:for(var u=w.length,f=1,k=-1,_;f<u;++f)switch(w[f]){case".":k=_=f;break;case"0":k===0&&(k=f),_=f;break;default:if(!+w[f])break t;k>0&&(k=0);break}return k>0?w.slice(0,k)+w.slice(_+1):w}var a;function s(w,u){var f=E(w,u);if(!f)return w+"";var k=f[0],_=f[1],D=_-(a=Math.max(-8,Math.min(8,Math.floor(_/3)))*3)+1,I=k.length;return D===I?k:D>I?k+new Array(D-I+1).join("0"):D>0?k.slice(0,D)+"."+k.slice(D):"0."+new Array(1-D).join("0")+E(w,Math.max(0,u+D-1))[0]}function h(w,u){var f=E(w,u);if(!f)return w+"";var k=f[0],_=f[1];return _<0?"0."+new Array(-_).join("0")+k:k.length>_+1?k.slice(0,_+1)+"."+k.slice(_+1):k+new Array(_-k.length+2).join("0")}var v={"%":function(w,u){return(w*100).toFixed(u)},b:function(w){return Math.round(w).toString(2)},c:function(w){return w+""},d:g,e:function(w,u){return w.toExponential(u)},f:function(w,u){return w.toFixed(u)},g:function(w,u){return w.toPrecision(u)},o:function(w){return Math.round(w).toString(8)},p:function(w,u){return h(w*100,u)},r:h,s,X:function(w){return Math.round(w).toString(16).toUpperCase()},x:function(w){return Math.round(w).toString(16)}};function m(w){return w}var p=Array.prototype.map,y=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function l(w){var u=w.grouping===void 0||w.thousands===void 0?m:t(p.call(w.grouping,Number),w.thousands+""),f=w.currency===void 0?"":w.currency[0]+"",k=w.currency===void 0?"":w.currency[1]+"",_=w.decimal===void 0?".":w.decimal+"",D=w.numerals===void 0?m:e(p.call(w.numerals,String)),I=w.percent===void 0?"%":w.percent+"",O=w.minus===void 0?"-":w.minus+"",B=w.nan===void 0?"NaN":w.nan+"";function R(F){F=i(F);var N=F.fill,j=F.align,G=F.sign,rt=F.symbol,ct=F.zero,lt=F.width,tt=F.comma,Z=F.precision,st=F.trim,$=F.type;$==="n"?(tt=!0,$="g"):v[$]||(Z===void 0&&(Z=12),st=!0,$="g"),(ct||N==="0"&&j==="=")&&(ct=!0,N="0",j="=");var Q=rt==="$"?f:rt==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",nt=rt==="$"?k:/[%p]/.test($)?I:"",Y=v[$],q=/[defgprs%]/.test($);Z=Z===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,Z)):Math.max(0,Math.min(20,Z));function ot(it){var dt=Q,wt=nt,xt,Ft,Et;if($==="c")wt=Y(it)+wt,it="";else{it=+it;var Nt=it<0||1/it<0;if(it=isNaN(it)?B:Y(Math.abs(it),Z),st&&(it=o(it)),Nt&&+it==0&&G!=="+"&&(Nt=!1),dt=(Nt?G==="("?G:O:G==="-"||G==="("?"":G)+dt,wt=($==="s"?y[8+a/3]:"")+wt+(Nt&&G==="("?")":""),q){for(xt=-1,Ft=it.length;++xt<Ft;)if(Et=it.charCodeAt(xt),48>Et||Et>57){wt=(Et===46?_+it.slice(xt+1):it.slice(xt))+wt,it=it.slice(0,xt);break}}}tt&&!ct&&(it=u(it,1/0));var te=dt.length+it.length+wt.length,Jt=te<lt?new Array(lt-te+1).join(N):"";switch(tt&&ct&&(it=u(Jt+it,Jt.length?lt-wt.length:1/0),Jt=""),j){case"<":it=dt+it+wt+Jt;break;case"=":it=dt+Jt+it+wt;break;case"^":it=Jt.slice(0,te=Jt.length>>1)+dt+it+wt+Jt.slice(te);break;default:it=Jt+dt+it+wt;break}return D(it)}return ot.toString=function(){return F+""},ot}function L(F,N){var j=R((F=i(F),F.type="f",F)),G=Math.max(-8,Math.min(8,Math.floor(A(N)/3)))*3,rt=Math.pow(10,-G),ct=y[8+G/3];return function(lt){return j(rt*lt)+ct}}return{format:R,formatPrefix:L}}var x;b({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function b(w){return x=l(w),c.format=x.format,c.formatPrefix=x.formatPrefix,x}function S(w){return Math.max(0,-A(Math.abs(w)))}function T(w,u){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(A(u)/3)))*3-A(Math.abs(w)))}function M(w,u){return w=Math.abs(w),u=Math.abs(u)-w,Math.max(0,A(u)-A(w))+1}c.FormatSpecifier=n,c.formatDefaultLocale=b,c.formatLocale=l,c.formatSpecifier=i,c.precisionFixed=S,c.precisionPrefix=T,c.precisionRound=M,Object.defineProperty(c,"__esModule",{value:!0})})}),LT=Vt((X,V)=>{V.exports=function(c){for(var g=c.length,E,A=0;A<g;A++)if(E=c.charCodeAt(A),(E<9||E>13)&&E!==32&&E!==133&&E!==160&&E!==5760&&E!==6158&&(E<8192||E>8205)&&E!==8232&&E!==8233&&E!==8239&&E!==8287&&E!==8288&&E!==12288&&E!==65279)return!1;return!0}}),vo=Vt((X,V)=>{var c=LT();V.exports=function(g){var E=typeof g;if(E==="string"){var A=g;if(g=+g,g===0&&c(A))return!1}else if(E!=="number")return!1;return g-g<1}}),ts=Vt((X,V)=>{V.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}),H_=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X):(c=typeof globalThis<"u"?globalThis:c||self,g(c["base64-arraybuffer"]={}))})(X,function(c){for(var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",E=typeof Uint8Array>"u"?[]:new Uint8Array(256),A=0;A<g.length;A++)E[g.charCodeAt(A)]=A;var t=function(r){var i=new Uint8Array(r),n,o=i.length,a="";for(n=0;n<o;n+=3)a+=g[i[n]>>2],a+=g[(i[n]&3)<<4|i[n+1]>>4],a+=g[(i[n+1]&15)<<2|i[n+2]>>6],a+=g[i[n+2]&63];return o%3===2?a=a.substring(0,a.length-1)+"=":o%3===1&&(a=a.substring(0,a.length-2)+"=="),a},e=function(r){var i=r.length*.75,n=r.length,o,a=0,s,h,v,m;r[r.length-1]==="="&&(i--,r[r.length-2]==="="&&i--);var p=new ArrayBuffer(i),y=new Uint8Array(p);for(o=0;o<n;o+=4)s=E[r.charCodeAt(o)],h=E[r.charCodeAt(o+1)],v=E[r.charCodeAt(o+2)],m=E[r.charCodeAt(o+3)],y[a++]=s<<2|h>>4,y[a++]=(h&15)<<4|v>>2,y[a++]=(v&3)<<6|m&63;return p};c.decode=e,c.encode=t,Object.defineProperty(c,"__esModule",{value:!0})})}),jp=Vt((X,V)=>{V.exports=function(c){return window&&window.process&&window.process.versions?Object.prototype.toString.call(c)==="[object Object]":Object.prototype.toString.call(c)==="[object Object]"&&Object.getPrototypeOf(c).hasOwnProperty("hasOwnProperty")}}),nf=Vt(X=>{var V=H_().decode,c=jp(),g=Array.isArray,E=ArrayBuffer,A=DataView;function t(s){return E.isView(s)&&!(s instanceof A)}X.isTypedArray=t;function e(s){return g(s)||t(s)}X.isArrayOrTypedArray=e;function r(s){return!e(s[0])}X.isArray1D=r,X.ensureArray=function(s,h){return g(s)||(s=[]),s.length=h,s};var i={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};i.uint8c=i.u1c,i.uint8=i.u1,i.int8=i.i1,i.uint16=i.u2,i.int16=i.i2,i.uint32=i.u4,i.int32=i.i4,i.float32=i.f4,i.float64=i.f8;function n(s){return s.constructor===ArrayBuffer}X.isArrayBuffer=n,X.decodeTypedArraySpec=function(s){var h=[],v=o(s),m=v.dtype,p=i[m];if(!p)throw new Error('Error in dtype: "'+m+'"');var y=p.BYTES_PER_ELEMENT,l=v.bdata;n(l)||(l=V(l));var x=v.shape===void 0?[l.byteLength/y]:(""+v.shape).split(",");x.reverse();var b=x.length,S,T,M=+x[0],w=y*M,u=0;if(b===1)h=new p(l);else if(b===2)for(S=+x[1],T=0;T<S;T++)h[T]=new p(l,u,M),u+=w;else if(b===3){S=+x[1];for(var f=+x[2],k=0;k<f;k++)for(h[k]=[],T=0;T<S;T++)h[k][T]=new p(l,u,M),u+=w}else throw new Error("ndim: "+b+'is not supported with the shape:"'+v.shape+'"');return h.bdata=v.bdata,h.dtype=v.dtype,h.shape=x.reverse().join(","),s._inputArray=h,h},X.isTypedArraySpec=function(s){return c(s)&&s.hasOwnProperty("dtype")&&typeof s.dtype=="string"&&s.hasOwnProperty("bdata")&&(typeof s.bdata=="string"||n(s.bdata))&&(s.shape===void 0||s.hasOwnProperty("shape")&&(typeof s.shape=="string"||typeof s.shape=="number"))};function o(s){return{bdata:s.bdata,dtype:s.dtype,shape:s.shape}}X.concat=function(){var s=[],h=!0,v=0,m,p,y,l,x,b,S,T;for(y=0;y<arguments.length;y++)l=arguments[y],b=l.length,b&&(p?s.push(l):(p=l,x=b),g(l)?m=!1:(h=!1,v?m!==l.constructor&&(m=!1):m=l.constructor),v+=b);if(!v)return[];if(!s.length)return p;if(h)return p.concat.apply(p,s);if(m){for(S=new m(v),S.set(p),y=0;y<s.length;y++)l=s[y],S.set(l,x),x+=l.length;return S}for(S=new Array(v),T=0;T<p.length;T++)S[T]=p[T];for(y=0;y<s.length;y++){for(l=s[y],T=0;T<l.length;T++)S[x+T]=l[T];x+=T}return S},X.maxRowLength=function(s){return a(s,Math.max,0)},X.minRowLength=function(s){return a(s,Math.min,1/0)};function a(s,h,v){if(e(s))if(e(s[0])){for(var m=v,p=0;p<s.length;p++)m=h(m,s[p].length);return m}else return s.length;return 0}}),Im=Vt((X,V)=>{var c=vo(),g=nf().isArrayOrTypedArray;V.exports=function(a,s){if(c(s))s=String(s);else if(typeof s!="string"||s.substr(s.length-4)==="[-1]")throw"bad property string";var h=s.split("."),v,m,p,y;for(y=0;y<h.length;y++)if(String(h[y]).slice(0,2)==="__")throw"bad property string";for(y=0;y<h.length;){if(v=String(h[y]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/),v){if(v[1])h[y]=v[1];else if(y===0)h.splice(0,1);else throw"bad property string";for(m=v[2].substr(1,v[2].length-2).split("]["),p=0;p<m.length;p++)y++,h.splice(y,0,Number(m[p]))}y++}return typeof a!="object"?o(a,s,h):{set:e(a,h,s),get:E(a,h),astr:s,parts:h,obj:a}};function E(a,s){return function(){var h=a,v,m,p,y,l;for(y=0;y<s.length-1;y++){if(v=s[y],v===-1){for(m=!0,p=[],l=0;l<h.length;l++)p[l]=E(h[l],s.slice(y+1))(),p[l]!==p[0]&&(m=!1);return m?p[0]:p}if(typeof v=="number"&&!g(h)||(h=h[v],typeof h!="object"||h===null))return}if(!(typeof h!="object"||h===null)&&(p=h[s[y]],p!==null))return p}}var A=/(^|\.)args\[/;function t(a,s){return a===void 0||a===null&&!s.match(A)}function e(a,s,h){return function(v){var m=a,p="",y=t(v,h),l,x;for(x=0;x<s.length-1;x++){if(l=s[x],typeof l=="number"&&!g(m))throw"array index but container is not an array";if(l===-1){if(y=!i(m,s.slice(x+1),v,h),y)break;return}if(!n(m,l,s[x+1],y))break;if(m=m[l],typeof m!="object"||m===null)throw"container is not an object";p=r(p,l)}if(y){if(x===s.length-1&&(delete m[s[x]],Array.isArray(m)&&+s[x]===m.length-1))for(;m.length&&m[m.length-1]===void 0;)m.pop()}else m[s[x]]=v}}function r(a,s){var h=s;return c(s)?h="["+s+"]":a&&(h="."+s),a+h}function i(a,s,h,v){var m=g(h),p=!0,y=h,l=v.replace("-1",0),x=m?!1:t(h,l),b=s[0],S;for(S=0;S<a.length;S++)l=v.replace("-1",S),m&&(y=h[S%h.length],x=t(y,l)),x&&(p=!1),n(a,S,b,x)&&e(a[S],s,v.replace("-1",S))(y);return p}function n(a,s,h,v){if(a[s]===void 0){if(v)return!1;typeof h=="number"?a[s]=[]:a[s]={}}return!0}function o(a,s,h){return{set:function(){throw"bad container"},get:function(){},astr:s,parts:h,obj:a}}}),CT=Vt((X,V)=>{var c=Im(),g=/^\w*$/,E=0,A=1,t=2,e=3,r=4;V.exports=function(i,n,o,a){o=o||"name",a=a||"value";var s,h,v,m={};n&&n.length?(v=c(i,n),h=v.get()):h=i,n=n||"";var p={};if(h)for(s=0;s<h.length;s++)p[h[s][o]]=s;var y=g.test(a),l={set:function(x,b){var S=b===null?r:E;if(!h){if(!v||S===r)return;h=[],v.set(h)}var T=p[x];if(T===void 0){if(S===r)return;S=S|e,T=h.length,p[x]=T}else b!==(y?h[T][a]:c(h[T],a).get())&&(S=S|t);var M=h[T]=h[T]||{};return M[o]=x,y?M[a]=b:c(M,a).set(b),b!==null&&(S=S&~r),m[T]=m[T]|S,l},get:function(x){if(h){var b=p[x];if(b!==void 0)return y?h[b][a]:c(h[b],a).get()}},rename:function(x,b){var S=p[x];return S===void 0||(m[S]=m[S]|A,p[b]=S,delete p[x],h[S][o]=b),l},remove:function(x){var b=p[x];if(b===void 0)return l;var S=h[b];if(Object.keys(S).length>2)return m[b]=m[b]|t,l.set(x,null);if(y){for(s=b;s<h.length;s++)m[s]=m[s]|e;for(s=b;s<h.length;s++)p[h[s][o]]--;h.splice(b,1),delete p[x]}else c(S,a).set(null),m[b]=m[b]|t|r;return l},constructUpdate:function(){for(var x,b,S={},T=Object.keys(m),M=0;M<T.length;M++)b=T[M],x=n+"["+b+"]",h[b]?(m[b]&A&&(S[x+"."+o]=h[b][o]),m[b]&t&&(y?S[x+"."+a]=m[b]&r?null:h[b][a]:S[x+"."+a]=m[b]&r?null:c(h[b],a).get())):S[x]=null;return S}};return l}}),DT=Vt((X,V)=>{var c=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,g=/^[^\.\[\]]+$/;V.exports=function(E,A){for(;A;){var t=E.match(c);if(t)E=t[1];else if(E.match(g))E="";else throw new Error("bad relativeAttr call:"+[E,A]);if(A.charAt(0)==="^")A=A.slice(1);else break}return E&&A.charAt(0)!=="["?E+"."+A:E+A}}),Ly=Vt((X,V)=>{var c=vo();V.exports=function(g,E){if(g>0)return Math.log(g)/Math.LN10;var A=Math.log(Math.min(E[0],E[1]))/Math.LN10;return c(A)||(A=Math.log(Math.max(E[0],E[1]))/Math.LN10-6),A}}),zT=Vt((X,V)=>{var c=nf().isArrayOrTypedArray,g=jp();V.exports=function E(A,t){for(var e in t){var r=t[e],i=A[e];if(i!==r)if(e.charAt(0)==="_"||typeof r=="function"){if(e in A)continue;A[e]=r}else if(c(r)&&c(i)&&g(r[0])){if(e==="customdata"||e==="ids")continue;for(var n=Math.min(r.length,i.length),o=0;o<n;o++)i[o]!==r[o]&&g(r[o])&&g(i[o])&&E(i[o],r[o])}else g(r)&&g(i)&&(E(i,r),Object.keys(i).length||delete A[e])}}}),pg=Vt((X,V)=>{function c(E,A){var t=E%A;return t<0?t+A:t}function g(E,A){return Math.abs(E)>A/2?E-Math.round(E/A)*A:E}V.exports={mod:c,modHalf:g}}),yh=Vt((X,V)=>{(function(c){var g=/^\s+/,E=/\s+$/,A=0,t=c.round,e=c.min,r=c.max,i=c.random;function n(q,ot){if(q=q||"",ot=ot||{},q instanceof n)return q;if(!(this instanceof n))return new n(q,ot);var it=o(q);this._originalInput=q,this._r=it.r,this._g=it.g,this._b=it.b,this._a=it.a,this._roundA=t(100*this._a)/100,this._format=ot.format||it.format,this._gradientType=ot.gradientType,this._r<1&&(this._r=t(this._r)),this._g<1&&(this._g=t(this._g)),this._b<1&&(this._b=t(this._b)),this._ok=it.ok,this._tc_id=A++}n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var q=this.toRgb();return(q.r*299+q.g*587+q.b*114)/1e3},getLuminance:function(){var q=this.toRgb(),ot,it,dt,wt,xt,Ft;return ot=q.r/255,it=q.g/255,dt=q.b/255,ot<=.03928?wt=ot/12.92:wt=c.pow((ot+.055)/1.055,2.4),it<=.03928?xt=it/12.92:xt=c.pow((it+.055)/1.055,2.4),dt<=.03928?Ft=dt/12.92:Ft=c.pow((dt+.055)/1.055,2.4),.2126*wt+.7152*xt+.0722*Ft},setAlpha:function(q){return this._a=F(q),this._roundA=t(100*this._a)/100,this},toHsv:function(){var q=v(this._r,this._g,this._b);return{h:q.h*360,s:q.s,v:q.v,a:this._a}},toHsvString:function(){var q=v(this._r,this._g,this._b),ot=t(q.h*360),it=t(q.s*100),dt=t(q.v*100);return this._a==1?"hsv("+ot+", "+it+"%, "+dt+"%)":"hsva("+ot+", "+it+"%, "+dt+"%, "+this._roundA+")"},toHsl:function(){var q=s(this._r,this._g,this._b);return{h:q.h*360,s:q.s,l:q.l,a:this._a}},toHslString:function(){var q=s(this._r,this._g,this._b),ot=t(q.h*360),it=t(q.s*100),dt=t(q.l*100);return this._a==1?"hsl("+ot+", "+it+"%, "+dt+"%)":"hsla("+ot+", "+it+"%, "+dt+"%, "+this._roundA+")"},toHex:function(q){return p(this._r,this._g,this._b,q)},toHexString:function(q){return"#"+this.toHex(q)},toHex8:function(q){return y(this._r,this._g,this._b,this._a,q)},toHex8String:function(q){return"#"+this.toHex8(q)},toRgb:function(){return{r:t(this._r),g:t(this._g),b:t(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+t(this._r)+", "+t(this._g)+", "+t(this._b)+")":"rgba("+t(this._r)+", "+t(this._g)+", "+t(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:t(N(this._r,255)*100)+"%",g:t(N(this._g,255)*100)+"%",b:t(N(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+t(N(this._r,255)*100)+"%, "+t(N(this._g,255)*100)+"%, "+t(N(this._b,255)*100)+"%)":"rgba("+t(N(this._r,255)*100)+"%, "+t(N(this._g,255)*100)+"%, "+t(N(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:R[p(this._r,this._g,this._b,!0)]||!1},toFilter:function(q){var ot="#"+l(this._r,this._g,this._b,this._a),it=ot,dt=this._gradientType?"GradientType = 1, ":"";if(q){var wt=n(q);it="#"+l(wt._r,wt._g,wt._b,wt._a)}return"progid:DXImageTransform.Microsoft.gradient("+dt+"startColorstr="+ot+",endColorstr="+it+")"},toString:function(q){var ot=!!q;q=q||this._format;var it=!1,dt=this._a<1&&this._a>=0,wt=!ot&&dt&&(q==="hex"||q==="hex6"||q==="hex3"||q==="hex4"||q==="hex8"||q==="name");return wt?q==="name"&&this._a===0?this.toName():this.toRgbString():(q==="rgb"&&(it=this.toRgbString()),q==="prgb"&&(it=this.toPercentageRgbString()),(q==="hex"||q==="hex6")&&(it=this.toHexString()),q==="hex3"&&(it=this.toHexString(!0)),q==="hex4"&&(it=this.toHex8String(!0)),q==="hex8"&&(it=this.toHex8String()),q==="name"&&(it=this.toName()),q==="hsl"&&(it=this.toHslString()),q==="hsv"&&(it=this.toHsvString()),it||this.toHexString())},clone:function(){return n(this.toString())},_applyModification:function(q,ot){var it=q.apply(null,[this].concat([].slice.call(ot)));return this._r=it._r,this._g=it._g,this._b=it._b,this.setAlpha(it._a),this},lighten:function(){return this._applyModification(T,arguments)},brighten:function(){return this._applyModification(M,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(x,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(u,arguments)},_applyCombination:function(q,ot){return q.apply(null,[this].concat([].slice.call(ot)))},analogous:function(){return this._applyCombination(I,arguments)},complement:function(){return this._applyCombination(f,arguments)},monochromatic:function(){return this._applyCombination(O,arguments)},splitcomplement:function(){return this._applyCombination(D,arguments)},triad:function(){return this._applyCombination(k,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},n.fromRatio=function(q,ot){if(typeof q=="object"){var it={};for(var dt in q)q.hasOwnProperty(dt)&&(dt==="a"?it[dt]=q[dt]:it[dt]=tt(q[dt]));q=it}return n(q,ot)};function o(q){var ot={r:0,g:0,b:0},it=1,dt=null,wt=null,xt=null,Ft=!1,Et=!1;return typeof q=="string"&&(q=nt(q)),typeof q=="object"&&(Q(q.r)&&Q(q.g)&&Q(q.b)?(ot=a(q.r,q.g,q.b),Ft=!0,Et=String(q.r).substr(-1)==="%"?"prgb":"rgb"):Q(q.h)&&Q(q.s)&&Q(q.v)?(dt=tt(q.s),wt=tt(q.v),ot=m(q.h,dt,wt),Ft=!0,Et="hsv"):Q(q.h)&&Q(q.s)&&Q(q.l)&&(dt=tt(q.s),xt=tt(q.l),ot=h(q.h,dt,xt),Ft=!0,Et="hsl"),q.hasOwnProperty("a")&&(it=q.a)),it=F(it),{ok:Ft,format:q.format||Et,r:e(255,r(ot.r,0)),g:e(255,r(ot.g,0)),b:e(255,r(ot.b,0)),a:it}}function a(q,ot,it){return{r:N(q,255)*255,g:N(ot,255)*255,b:N(it,255)*255}}function s(q,ot,it){q=N(q,255),ot=N(ot,255),it=N(it,255);var dt=r(q,ot,it),wt=e(q,ot,it),xt,Ft,Et=(dt+wt)/2;if(dt==wt)xt=Ft=0;else{var Nt=dt-wt;switch(Ft=Et>.5?Nt/(2-dt-wt):Nt/(dt+wt),dt){case q:xt=(ot-it)/Nt+(ot<it?6:0);break;case ot:xt=(it-q)/Nt+2;break;case it:xt=(q-ot)/Nt+4;break}xt/=6}return{h:xt,s:Ft,l:Et}}function h(q,ot,it){var dt,wt,xt;q=N(q,360),ot=N(ot,100),it=N(it,100);function Ft(te,Jt,Qt){return Qt<0&&(Qt+=1),Qt>1&&(Qt-=1),Qt<1/6?te+(Jt-te)*6*Qt:Qt<1/2?Jt:Qt<2/3?te+(Jt-te)*(2/3-Qt)*6:te}if(ot===0)dt=wt=xt=it;else{var Et=it<.5?it*(1+ot):it+ot-it*ot,Nt=2*it-Et;dt=Ft(Nt,Et,q+1/3),wt=Ft(Nt,Et,q),xt=Ft(Nt,Et,q-1/3)}return{r:dt*255,g:wt*255,b:xt*255}}function v(q,ot,it){q=N(q,255),ot=N(ot,255),it=N(it,255);var dt=r(q,ot,it),wt=e(q,ot,it),xt,Ft,Et=dt,Nt=dt-wt;if(Ft=dt===0?0:Nt/dt,dt==wt)xt=0;else{switch(dt){case q:xt=(ot-it)/Nt+(ot<it?6:0);break;case ot:xt=(it-q)/Nt+2;break;case it:xt=(q-ot)/Nt+4;break}xt/=6}return{h:xt,s:Ft,v:Et}}function m(q,ot,it){q=N(q,360)*6,ot=N(ot,100),it=N(it,100);var dt=c.floor(q),wt=q-dt,xt=it*(1-ot),Ft=it*(1-wt*ot),Et=it*(1-(1-wt)*ot),Nt=dt%6,te=[it,Ft,xt,xt,Et,it][Nt],Jt=[Et,it,it,Ft,xt,xt][Nt],Qt=[xt,xt,Et,it,it,Ft][Nt];return{r:te*255,g:Jt*255,b:Qt*255}}function p(q,ot,it,dt){var wt=[lt(t(q).toString(16)),lt(t(ot).toString(16)),lt(t(it).toString(16))];return dt&&wt[0].charAt(0)==wt[0].charAt(1)&&wt[1].charAt(0)==wt[1].charAt(1)&&wt[2].charAt(0)==wt[2].charAt(1)?wt[0].charAt(0)+wt[1].charAt(0)+wt[2].charAt(0):wt.join("")}function y(q,ot,it,dt,wt){var xt=[lt(t(q).toString(16)),lt(t(ot).toString(16)),lt(t(it).toString(16)),lt(Z(dt))];return wt&&xt[0].charAt(0)==xt[0].charAt(1)&&xt[1].charAt(0)==xt[1].charAt(1)&&xt[2].charAt(0)==xt[2].charAt(1)&&xt[3].charAt(0)==xt[3].charAt(1)?xt[0].charAt(0)+xt[1].charAt(0)+xt[2].charAt(0)+xt[3].charAt(0):xt.join("")}function l(q,ot,it,dt){var wt=[lt(Z(dt)),lt(t(q).toString(16)),lt(t(ot).toString(16)),lt(t(it).toString(16))];return wt.join("")}n.equals=function(q,ot){return!q||!ot?!1:n(q).toRgbString()==n(ot).toRgbString()},n.random=function(){return n.fromRatio({r:i(),g:i(),b:i()})};function x(q,ot){ot=ot===0?0:ot||10;var it=n(q).toHsl();return it.s-=ot/100,it.s=j(it.s),n(it)}function b(q,ot){ot=ot===0?0:ot||10;var it=n(q).toHsl();return it.s+=ot/100,it.s=j(it.s),n(it)}function S(q){return n(q).desaturate(100)}function T(q,ot){ot=ot===0?0:ot||10;var it=n(q).toHsl();return it.l+=ot/100,it.l=j(it.l),n(it)}function M(q,ot){ot=ot===0?0:ot||10;var it=n(q).toRgb();return it.r=r(0,e(255,it.r-t(255*-(ot/100)))),it.g=r(0,e(255,it.g-t(255*-(ot/100)))),it.b=r(0,e(255,it.b-t(255*-(ot/100)))),n(it)}function w(q,ot){ot=ot===0?0:ot||10;var it=n(q).toHsl();return it.l-=ot/100,it.l=j(it.l),n(it)}function u(q,ot){var it=n(q).toHsl(),dt=(it.h+ot)%360;return it.h=dt<0?360+dt:dt,n(it)}function f(q){var ot=n(q).toHsl();return ot.h=(ot.h+180)%360,n(ot)}function k(q){var ot=n(q).toHsl(),it=ot.h;return[n(q),n({h:(it+120)%360,s:ot.s,l:ot.l}),n({h:(it+240)%360,s:ot.s,l:ot.l})]}function _(q){var ot=n(q).toHsl(),it=ot.h;return[n(q),n({h:(it+90)%360,s:ot.s,l:ot.l}),n({h:(it+180)%360,s:ot.s,l:ot.l}),n({h:(it+270)%360,s:ot.s,l:ot.l})]}function D(q){var ot=n(q).toHsl(),it=ot.h;return[n(q),n({h:(it+72)%360,s:ot.s,l:ot.l}),n({h:(it+216)%360,s:ot.s,l:ot.l})]}function I(q,ot,it){ot=ot||6,it=it||30;var dt=n(q).toHsl(),wt=360/it,xt=[n(q)];for(dt.h=(dt.h-(wt*ot>>1)+720)%360;--ot;)dt.h=(dt.h+wt)%360,xt.push(n(dt));return xt}function O(q,ot){ot=ot||6;for(var it=n(q).toHsv(),dt=it.h,wt=it.s,xt=it.v,Ft=[],Et=1/ot;ot--;)Ft.push(n({h:dt,s:wt,v:xt})),xt=(xt+Et)%1;return Ft}n.mix=function(q,ot,it){it=it===0?0:it||50;var dt=n(q).toRgb(),wt=n(ot).toRgb(),xt=it/100,Ft={r:(wt.r-dt.r)*xt+dt.r,g:(wt.g-dt.g)*xt+dt.g,b:(wt.b-dt.b)*xt+dt.b,a:(wt.a-dt.a)*xt+dt.a};return n(Ft)},n.readability=function(q,ot){var it=n(q),dt=n(ot);return(c.max(it.getLuminance(),dt.getLuminance())+.05)/(c.min(it.getLuminance(),dt.getLuminance())+.05)},n.isReadable=function(q,ot,it){var dt=n.readability(q,ot),wt,xt;switch(xt=!1,wt=Y(it),wt.level+wt.size){case"AAsmall":case"AAAlarge":xt=dt>=4.5;break;case"AAlarge":xt=dt>=3;break;case"AAAsmall":xt=dt>=7;break}return xt},n.mostReadable=function(q,ot,it){var dt=null,wt=0,xt,Ft,Et,Nt;it=it||{},Ft=it.includeFallbackColors,Et=it.level,Nt=it.size;for(var te=0;te<ot.length;te++)xt=n.readability(q,ot[te]),xt>wt&&(wt=xt,dt=n(ot[te]));return n.isReadable(q,dt,{level:Et,size:Nt})||!Ft?dt:(it.includeFallbackColors=!1,n.mostReadable(q,["#fff","#000"],it))};var B=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},R=n.hexNames=L(B);function L(q){var ot={};for(var it in q)q.hasOwnProperty(it)&&(ot[q[it]]=it);return ot}function F(q){return q=parseFloat(q),(isNaN(q)||q<0||q>1)&&(q=1),q}function N(q,ot){rt(q)&&(q="100%");var it=ct(q);return q=e(ot,r(0,parseFloat(q))),it&&(q=parseInt(q*ot,10)/100),c.abs(q-ot)<1e-6?1:q%ot/parseFloat(ot)}function j(q){return e(1,r(0,q))}function G(q){return parseInt(q,16)}function rt(q){return typeof q=="string"&&q.indexOf(".")!=-1&&parseFloat(q)===1}function ct(q){return typeof q=="string"&&q.indexOf("%")!=-1}function lt(q){return q.length==1?"0"+q:""+q}function tt(q){return q<=1&&(q=q*100+"%"),q}function Z(q){return c.round(parseFloat(q)*255).toString(16)}function st(q){return G(q)/255}var $=function(){var q="[-\\+]?\\d+%?",ot="[-\\+]?\\d*\\.\\d+%?",it="(?:"+ot+")|(?:"+q+")",dt="[\\s|\\(]+("+it+")[,|\\s]+("+it+")[,|\\s]+("+it+")\\s*\\)?",wt="[\\s|\\(]+("+it+")[,|\\s]+("+it+")[,|\\s]+("+it+")[,|\\s]+("+it+")\\s*\\)?";return{CSS_UNIT:new RegExp(it),rgb:new RegExp("rgb"+dt),rgba:new RegExp("rgba"+wt),hsl:new RegExp("hsl"+dt),hsla:new RegExp("hsla"+wt),hsv:new RegExp("hsv"+dt),hsva:new RegExp("hsva"+wt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Q(q){return!!$.CSS_UNIT.exec(q)}function nt(q){q=q.replace(g,"").replace(E,"").toLowerCase();var ot=!1;if(B[q])q=B[q],ot=!0;else if(q=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var it;return(it=$.rgb.exec(q))?{r:it[1],g:it[2],b:it[3]}:(it=$.rgba.exec(q))?{r:it[1],g:it[2],b:it[3],a:it[4]}:(it=$.hsl.exec(q))?{h:it[1],s:it[2],l:it[3]}:(it=$.hsla.exec(q))?{h:it[1],s:it[2],l:it[3],a:it[4]}:(it=$.hsv.exec(q))?{h:it[1],s:it[2],v:it[3]}:(it=$.hsva.exec(q))?{h:it[1],s:it[2],v:it[3],a:it[4]}:(it=$.hex8.exec(q))?{r:G(it[1]),g:G(it[2]),b:G(it[3]),a:st(it[4]),format:ot?"name":"hex8"}:(it=$.hex6.exec(q))?{r:G(it[1]),g:G(it[2]),b:G(it[3]),format:ot?"name":"hex"}:(it=$.hex4.exec(q))?{r:G(it[1]+""+it[1]),g:G(it[2]+""+it[2]),b:G(it[3]+""+it[3]),a:st(it[4]+""+it[4]),format:ot?"name":"hex8"}:(it=$.hex3.exec(q))?{r:G(it[1]+""+it[1]),g:G(it[2]+""+it[2]),b:G(it[3]+""+it[3]),format:ot?"name":"hex"}:!1}function Y(q){var ot,it;return q=q||{level:"AA",size:"small"},ot=(q.level||"AA").toUpperCase(),it=(q.size||"small").toLowerCase(),ot!=="AA"&&ot!=="AAA"&&(ot="AA"),it!=="small"&&it!=="large"&&(it="small"),{level:ot,size:it}}typeof V<"u"&&V.exports?V.exports=n:window.tinycolor=n})(Math)}),po=Vt(X=>{var V=jp(),c=Array.isArray;function g(A,t){var e,r;for(e=0;e<A.length;e++){if(r=A[e],r!==null&&typeof r=="object")return!1;r!==void 0&&(t[e]=r)}return!0}X.extendFlat=function(){return E(arguments,!1,!1,!1)},X.extendDeep=function(){return E(arguments,!0,!1,!1)},X.extendDeepAll=function(){return E(arguments,!0,!0,!1)},X.extendDeepNoArrays=function(){return E(arguments,!0,!1,!0)};function E(A,t,e,r){var i=A[0],n=A.length,o,a,s,h,v,m,p;if(n===2&&c(i)&&c(A[1])&&i.length===0){if(p=g(A[1],i),p)return i;i.splice(0,i.length)}for(var y=1;y<n;y++){o=A[y];for(a in o)s=i[a],h=o[a],r&&c(h)?i[a]=h:t&&h&&(V(h)||(v=c(h)))?(v?(v=!1,m=s&&c(s)?s:[]):m=s&&V(s)?s:{},i[a]=E([m,h],t,e,r)):(typeof h<"u"||e)&&(i[a]=h)}return i}}),Nl=Vt((X,V)=>{V.exports=function(c){var g=c.variantValues,E=c.editType,A=c.colorEditType;A===void 0&&(A=E);var t={editType:E,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};c.noNumericWeightValues&&(t.valType="enumerated",t.values=t.extras,t.extras=void 0,t.min=void 0,t.max=void 0);var e={family:{valType:"string",noBlank:!0,strict:!0,editType:E},size:{valType:"number",min:1,editType:E},color:{valType:"color",editType:A},weight:t,style:{editType:E,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:c.noFontVariant?void 0:{editType:E,valType:"enumerated",values:g||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:c.noFontTextcase?void 0:{editType:E,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:c.noFontLineposition?void 0:{editType:E,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:c.noFontShadow?void 0:{editType:E,valType:"string",dflt:c.autoShadowDflt?"auto":"none"},editType:E};return c.autoSize&&(e.size.dflt="auto"),c.autoColor&&(e.color.dflt="auto"),c.arrayOk&&(e.family.arrayOk=!0,e.weight.arrayOk=!0,e.style.arrayOk=!0,c.noFontVariant||(e.variant.arrayOk=!0),c.noFontTextcase||(e.textcase.arrayOk=!0),c.noFontLineposition||(e.lineposition.arrayOk=!0),c.noFontShadow||(e.shadow.arrayOk=!0),e.size.arrayOk=!0,e.color.arrayOk=!0),e}}),Lm=Vt((X,V)=>{V.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}),_d=Vt((X,V)=>{var c=Lm(),g=Nl(),E=g({editType:"none"});E.family.dflt=c.HOVERFONT,E.size.dflt=c.HOVERFONTSIZE,V.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:E,grouptitlefont:g({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}),dg=Vt((X,V)=>{var c=Nl(),g=_d().hoverlabel,E=po().extendFlat;V.exports={hoverlabel:{bgcolor:E({},g.bgcolor,{arrayOk:!0}),bordercolor:E({},g.bordercolor,{arrayOk:!0}),font:c({arrayOk:!0,editType:"none"}),align:E({},g.align,{arrayOk:!0}),namelength:E({},g.namelength,{arrayOk:!0}),editType:"none"}}}),Ks=Vt((X,V)=>{var c=Nl(),g=dg();V.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:c({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:g.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}}),i0=Vt((X,V)=>{var c=yh(),g={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},E=g.RdBu;function A(r,i){if(i||(i=E),!r)return i;function n(){try{r=g[r]||JSON.parse(r)}catch{r=i}}return typeof r=="string"&&(n(),typeof r=="string"&&n()),t(r)?r:i}function t(r){var i=0;if(!Array.isArray(r)||r.length<2||!r[0]||!r[r.length-1]||+r[0][0]!=0||+r[r.length-1][0]!=1)return!1;for(var n=0;n<r.length;n++){var o=r[n];if(o.length!==2||+o[0]<i||!c(o[1]).isValid())return!1;i=+o[0]}return!0}function e(r){return g[r]!==void 0?!0:t(r)}V.exports={scales:g,defaultScale:E,get:A,isValid:e}}),Hc=Vt(X=>{X.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],X.defaultLine="#444",X.lightLine="#eee",X.background="#fff",X.borderLine="#BEC8D9",X.lightFraction=100*10/11}),vi=Vt((X,V)=>{var c=yh(),g=vo(),E=nf().isTypedArray,A=V.exports={},t=Hc();A.defaults=t.defaults;var e=A.defaultLine=t.defaultLine;A.lightLine=t.lightLine;var r=A.background=t.background;A.tinyRGB=function(n){var o=n.toRgb();return"rgb("+Math.round(o.r)+", "+Math.round(o.g)+", "+Math.round(o.b)+")"},A.rgb=function(n){return A.tinyRGB(c(n))},A.opacity=function(n){return n?c(n).getAlpha():0},A.addOpacity=function(n,o){var a=c(n).toRgb();return"rgba("+Math.round(a.r)+", "+Math.round(a.g)+", "+Math.round(a.b)+", "+o+")"},A.combine=function(n,o){var a=c(n).toRgb();if(a.a===1)return c(n).toRgbString();var s=c(o||r).toRgb(),h=s.a===1?s:{r:255*(1-s.a)+s.r*s.a,g:255*(1-s.a)+s.g*s.a,b:255*(1-s.a)+s.b*s.a},v={r:h.r*(1-a.a)+a.r*a.a,g:h.g*(1-a.a)+a.g*a.a,b:h.b*(1-a.a)+a.b*a.a};return c(v).toRgbString()},A.interpolate=function(n,o,a){var s=c(n).toRgb(),h=c(o).toRgb(),v={r:a*s.r+(1-a)*h.r,g:a*s.g+(1-a)*h.g,b:a*s.b+(1-a)*h.b};return c(v).toRgbString()},A.contrast=function(n,o,a){var s=c(n);s.getAlpha()!==1&&(s=c(A.combine(n,r)));var h=s.isDark()?o?s.lighten(o):r:a?s.darken(a):e;return h.toString()},A.stroke=function(n,o){var a=c(o);n.style({stroke:A.tinyRGB(a),"stroke-opacity":a.getAlpha()})},A.fill=function(n,o){var a=c(o);n.style({fill:A.tinyRGB(a),"fill-opacity":a.getAlpha()})},A.clean=function(n){if(!(!n||typeof n!="object")){var o=Object.keys(n),a,s,h,v;for(a=0;a<o.length;a++)if(h=o[a],v=n[h],h.substr(h.length-5)==="color")if(Array.isArray(v))for(s=0;s<v.length;s++)v[s]=i(v[s]);else n[h]=i(v);else if(h.substr(h.length-10)==="colorscale"&&Array.isArray(v))for(s=0;s<v.length;s++)Array.isArray(v[s])&&(v[s][1]=i(v[s][1]));else if(Array.isArray(v)){var m=v[0];if(!Array.isArray(m)&&m&&typeof m=="object")for(s=0;s<v.length;s++)A.clean(v[s])}else v&&typeof v=="object"&&!E(v)&&A.clean(v)}};function i(n){if(g(n)||typeof n!="string")return n;var o=n.trim();if(o.substr(0,3)!=="rgb")return n;var a=o.match(/^rgba?\s*\(([^()]*)\)$/);if(!a)return n;var s=a[1].trim().split(/\s*[\s,]\s*/),h=o.charAt(3)==="a"&&s.length===4;if(!h&&s.length!==3)return n;for(var v=0;v<s.length;v++){if(!s[v].length||(s[v]=Number(s[v]),!(s[v]>=0)))return n;if(v===3)s[v]>1&&(s[v]=1);else if(s[v]>=1)return n}var m=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return h?"rgba("+m+", "+s[3]+")":"rgb("+m+")"}}),bd=Vt((X,V)=>{V.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}),gg=Vt(X=>{X.counter=function(V,c,g,E){var A=(c||"")+(g?"":"$"),t=E===!1?"":"^";return V==="xy"?new RegExp(t+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+A):new RegExp(t+V+"([2-9]|[1-9][0-9]+)?"+A)}}),OT=Vt(X=>{var V=vo(),c=yh(),g=po().extendFlat,E=Ks(),A=i0(),t=vi(),e=bd().DESELECTDIM,r=Im(),i=gg().counter,n=pg().modHalf,o=nf().isArrayOrTypedArray,a=nf().isTypedArraySpec,s=nf().decodeTypedArraySpec;X.valObjectMeta={data_array:{coerceFunction:function(v,m,p){m.set(o(v)?v:a(v)?s(v):p)}},enumerated:{coerceFunction:function(v,m,p,y){y.coerceNumber&&(v=+v),y.values.indexOf(v)===-1?m.set(p):m.set(v)},validateFunction:function(v,m){m.coerceNumber&&(v=+v);for(var p=m.values,y=0;y<p.length;y++){var l=String(p[y]);if(l.charAt(0)==="/"&&l.charAt(l.length-1)==="/"){var x=new RegExp(l.substr(1,l.length-2));if(x.test(v))return!0}else if(v===p[y])return!0}return!1}},boolean:{coerceFunction:function(v,m,p){v===!0||v===!1?m.set(v):m.set(p)}},number:{coerceFunction:function(v,m,p,y){a(v)&&(v=s(v)),!V(v)||y.min!==void 0&&v<y.min||y.max!==void 0&&v>y.max?m.set(p):m.set(+v)}},integer:{coerceFunction:function(v,m,p,y){if((y.extras||[]).indexOf(v)!==-1){m.set(v);return}a(v)&&(v=s(v)),v%1||!V(v)||y.min!==void 0&&v<y.min||y.max!==void 0&&v>y.max?m.set(p):m.set(+v)}},string:{coerceFunction:function(v,m,p,y){if(typeof v!="string"){var l=typeof v=="number";y.strict===!0||!l?m.set(p):m.set(String(v))}else y.noBlank&&!v?m.set(p):m.set(v)}},color:{coerceFunction:function(v,m,p){a(v)&&(v=s(v)),c(v).isValid()?m.set(v):m.set(p)}},colorlist:{coerceFunction:function(v,m,p){function y(l){return c(l).isValid()}!Array.isArray(v)||!v.length?m.set(p):v.every(y)?m.set(v):m.set(p)}},colorscale:{coerceFunction:function(v,m,p){m.set(A.get(v,p))}},angle:{coerceFunction:function(v,m,p){a(v)&&(v=s(v)),v==="auto"?m.set("auto"):V(v)?m.set(n(+v,360)):m.set(p)}},subplotid:{coerceFunction:function(v,m,p,y){var l=y.regex||i(p);if(typeof v=="string"&&l.test(v)){m.set(v);return}m.set(p)},validateFunction:function(v,m){var p=m.dflt;return v===p?!0:typeof v!="string"?!1:!!i(p).test(v)}},flaglist:{coerceFunction:function(v,m,p,y){if((y.extras||[]).indexOf(v)!==-1){m.set(v);return}if(typeof v!="string"){m.set(p);return}for(var l=v.split("+"),x=0;x<l.length;){var b=l[x];y.flags.indexOf(b)===-1||l.indexOf(b)<x?l.splice(x,1):x++}l.length?m.set(l.join("+")):m.set(p)}},any:{coerceFunction:function(v,m,p){v===void 0?m.set(p):m.set(a(v)?s(v):v)}},info_array:{coerceFunction:function(v,m,p,y){function l(B,R,L){var F,N={set:function(j){F=j}};return L===void 0&&(L=R.dflt),X.valObjectMeta[R.valType].coerceFunction(B,N,L,R),F}if(a(v)&&(v=s(v)),!o(v)){m.set(p);return}var x=y.dimensions===2||y.dimensions==="1-2"&&Array.isArray(v)&&o(v[0]),b=y.items,S=[],T=Array.isArray(b),M=T&&x&&o(b[0]),w=x&&T&&!M,u=T&&!w?b.length:v.length,f,k,_,D,I,O;if(p=Array.isArray(p)?p:[],x)for(f=0;f<u;f++)for(S[f]=[],_=o(v[f])?v[f]:[],w?I=b.length:T?I=b[f].length:I=_.length,k=0;k<I;k++)w?D=b[k]:T?D=b[f][k]:D=b,O=l(_[k],D,(p[f]||[])[k]),O!==void 0&&(S[f][k]=O);else for(f=0;f<u;f++)O=l(v[f],T?b[f]:b,p[f]),O!==void 0&&(S[f]=O);m.set(S)},validateFunction:function(v,m){if(!o(v))return!1;var p=m.items,y=Array.isArray(p),l=m.dimensions===2;if(!m.freeLength&&v.length!==p.length)return!1;for(var x=0;x<v.length;x++)if(l){if(!o(v[x])||!m.freeLength&&v[x].length!==p[x].length)return!1;for(var b=0;b<v[x].length;b++)if(!h(v[x][b],y?p[x][b]:p))return!1}else if(!h(v[x],y?p[x]:p))return!1;return!0}}},X.coerce=function(v,m,p,y,l){var x=r(p,y).get(),b=r(v,y),S=r(m,y),T=b.get(),M=m._template;if(T===void 0&&M&&(T=r(M,y).get(),M=0),l===void 0&&(l=x.dflt),x.arrayOk){if(o(T))return S.set(T),T;if(a(T))return T=s(T),S.set(T),T}var w=X.valObjectMeta[x.valType].coerceFunction;w(T,S,l,x);var u=S.get();return M&&u===l&&!h(T,x)&&(T=r(M,y).get(),w(T,S,l,x),u=S.get()),u},X.coerce2=function(v,m,p,y,l){var x=r(v,y),b=X.coerce(v,m,p,y,l),S=x.get();return S!=null?b:!1},X.coerceFont=function(v,m,p,y){y||(y={}),p=g({},p),p=g(p,y.overrideDflt||{});var l={family:v(m+".family",p.family),size:v(m+".size",p.size),color:v(m+".color",p.color),weight:v(m+".weight",p.weight),style:v(m+".style",p.style)};if(y.noFontVariant||(l.variant=v(m+".variant",p.variant)),y.noFontLineposition||(l.lineposition=v(m+".lineposition",p.lineposition)),y.noFontTextcase||(l.textcase=v(m+".textcase",p.textcase)),!y.noFontShadow){var x=p.shadow;x==="none"&&y.autoShadowDflt&&(x="auto"),l.shadow=v(m+".shadow",x)}return l},X.coercePattern=function(v,m,p,y){var l=v(m+".shape");if(l){v(m+".solidity"),v(m+".size");var x=v(m+".fillmode"),b=x==="overlay";if(!y){var S=v(m+".bgcolor",b?p:void 0);v(m+".fgcolor",b?t.contrast(S):p)}v(m+".fgopacity",b?.5:1)}},X.coerceHoverinfo=function(v,m,p){var y=m._module.attributes,l=y.hoverinfo?y:E,x=l.hoverinfo,b;if(p._dataLength===1){var S=x.dflt==="all"?x.flags.slice():x.dflt.split("+");S.splice(S.indexOf("name"),1),b=S.join("+")}return X.coerce(v,m,l,"hoverinfo",b)},X.coerceSelectionMarkerOpacity=function(v,m){if(v.marker){var p=v.marker.opacity;if(p!==void 0){var y,l;!o(p)&&!v.selected&&!v.unselected&&(y=p,l=e*p),m("selected.marker.opacity",y),m("unselected.marker.opacity",l)}}};function h(v,m){var p=X.valObjectMeta[m.valType];if(m.arrayOk&&o(v))return!0;if(p.validateFunction)return p.validateFunction(v,m);var y={},l=y,x={set:function(b){l=b}};return p.coerceFunction(v,x,y,m),l!==y}X.validate=h}),o0=Vt((X,V)=>{var c={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},g={};function E(A,t){for(var e in A){var r=A[e];r.valType?t[e]=r.dflt:(t[e]||(t[e]={}),E(r,t[e]))}}E(c,g),V.exports={configAttributes:c,dfltConfig:g}}),G_=Vt((X,V)=>{var c=Ai(),g=vo(),E=[];V.exports=function(A,t){if(E.indexOf(A)!==-1)return;E.push(A);var e=1e3;g(t)?e=t:t==="long"&&(e=3e3);var r=c.select("body").selectAll(".plotly-notifier").data([0]);r.enter().append("div").classed("plotly-notifier",!0);var i=r.selectAll(".notifier-note").data(E);function n(o){o.duration(700).style("opacity",0).each("end",function(a){var s=E.indexOf(a);s!==-1&&E.splice(s,1),c.select(this).remove()})}i.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(o){var a=c.select(this);a.append("button").classed("notifier-close",!0).html("×").on("click",function(){a.transition().call(n)});for(var s=a.append("p"),h=o.split(/<br\s*\/?>/g),v=0;v<h.length;v++)v&&s.append("br"),s.append("span").text(h[v]);t==="stick"?a.transition().duration(350).style("opacity",1):a.transition().duration(700).style("opacity",1).transition().delay(e).call(n)})}}),wd=Vt((X,V)=>{var c=o0().dfltConfig,g=G_(),E=V.exports={};E.log=function(){var A;if(c.logging>1){var t=["LOG:"];for(A=0;A<arguments.length;A++)t.push(arguments[A]);console.trace.apply(console,t)}if(c.notifyOnLogging>1){var e=[];for(A=0;A<arguments.length;A++)e.push(arguments[A]);g(e.join("<br>"),"long")}},E.warn=function(){var A;if(c.logging>0){var t=["WARN:"];for(A=0;A<arguments.length;A++)t.push(arguments[A]);console.trace.apply(console,t)}if(c.notifyOnLogging>0){var e=[];for(A=0;A<arguments.length;A++)e.push(arguments[A]);g(e.join("<br>"),"stick")}},E.error=function(){var A;if(c.logging>0){var t=["ERROR:"];for(A=0;A<arguments.length;A++)t.push(arguments[A]);console.error.apply(console,t)}if(c.notifyOnLogging>0){var e=[];for(A=0;A<arguments.length;A++)e.push(arguments[A]);g(e.join("<br>"),"stick")}}}),Cy=Vt((X,V)=>{V.exports=function(){}}),W_=Vt((X,V)=>{V.exports=function(c,g){if(g instanceof RegExp){for(var E=g.toString(),A=0;A<c.length;A++)if(c[A]instanceof RegExp&&c[A].toString()===E)return c;c.push(g)}else(g||g===0)&&c.indexOf(g)===-1&&c.push(g);return c}}),FT=Vt((X,V)=>{V.exports=c;function c(){var g=new Float32Array(16);return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),BT=Vt((X,V)=>{V.exports=c;function c(g){var E=new Float32Array(16);return E[0]=g[0],E[1]=g[1],E[2]=g[2],E[3]=g[3],E[4]=g[4],E[5]=g[5],E[6]=g[6],E[7]=g[7],E[8]=g[8],E[9]=g[9],E[10]=g[10],E[11]=g[11],E[12]=g[12],E[13]=g[13],E[14]=g[14],E[15]=g[15],E}}),RT=Vt((X,V)=>{V.exports=c;function c(g,E){return g[0]=E[0],g[1]=E[1],g[2]=E[2],g[3]=E[3],g[4]=E[4],g[5]=E[5],g[6]=E[6],g[7]=E[7],g[8]=E[8],g[9]=E[9],g[10]=E[10],g[11]=E[11],g[12]=E[12],g[13]=E[13],g[14]=E[14],g[15]=E[15],g}}),Z_=Vt((X,V)=>{V.exports=c;function c(g){return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),jT=Vt((X,V)=>{V.exports=c;function c(g,E){if(g===E){var A=E[1],t=E[2],e=E[3],r=E[6],i=E[7],n=E[11];g[1]=E[4],g[2]=E[8],g[3]=E[12],g[4]=A,g[6]=E[9],g[7]=E[13],g[8]=t,g[9]=r,g[11]=E[14],g[12]=e,g[13]=i,g[14]=n}else g[0]=E[0],g[1]=E[4],g[2]=E[8],g[3]=E[12],g[4]=E[1],g[5]=E[5],g[6]=E[9],g[7]=E[13],g[8]=E[2],g[9]=E[6],g[10]=E[10],g[11]=E[14],g[12]=E[3],g[13]=E[7],g[14]=E[11],g[15]=E[15];return g}}),NT=Vt((X,V)=>{V.exports=c;function c(g,E){var A=E[0],t=E[1],e=E[2],r=E[3],i=E[4],n=E[5],o=E[6],a=E[7],s=E[8],h=E[9],v=E[10],m=E[11],p=E[12],y=E[13],l=E[14],x=E[15],b=A*n-t*i,S=A*o-e*i,T=A*a-r*i,M=t*o-e*n,w=t*a-r*n,u=e*a-r*o,f=s*y-h*p,k=s*l-v*p,_=s*x-m*p,D=h*l-v*y,I=h*x-m*y,O=v*x-m*l,B=b*O-S*I+T*D+M*_-w*k+u*f;return B?(B=1/B,g[0]=(n*O-o*I+a*D)*B,g[1]=(e*I-t*O-r*D)*B,g[2]=(y*u-l*w+x*M)*B,g[3]=(v*w-h*u-m*M)*B,g[4]=(o*_-i*O-a*k)*B,g[5]=(A*O-e*_+r*k)*B,g[6]=(l*T-p*u-x*S)*B,g[7]=(s*u-v*T+m*S)*B,g[8]=(i*I-n*_+a*f)*B,g[9]=(t*_-A*I-r*f)*B,g[10]=(p*w-y*T+x*b)*B,g[11]=(h*T-s*w-m*b)*B,g[12]=(n*k-i*D-o*f)*B,g[13]=(A*D-t*k+e*f)*B,g[14]=(y*S-p*M-l*b)*B,g[15]=(s*M-h*S+v*b)*B,g):null}}),UT=Vt((X,V)=>{V.exports=c;function c(g,E){var A=E[0],t=E[1],e=E[2],r=E[3],i=E[4],n=E[5],o=E[6],a=E[7],s=E[8],h=E[9],v=E[10],m=E[11],p=E[12],y=E[13],l=E[14],x=E[15];return g[0]=n*(v*x-m*l)-h*(o*x-a*l)+y*(o*m-a*v),g[1]=-(t*(v*x-m*l)-h*(e*x-r*l)+y*(e*m-r*v)),g[2]=t*(o*x-a*l)-n*(e*x-r*l)+y*(e*a-r*o),g[3]=-(t*(o*m-a*v)-n*(e*m-r*v)+h*(e*a-r*o)),g[4]=-(i*(v*x-m*l)-s*(o*x-a*l)+p*(o*m-a*v)),g[5]=A*(v*x-m*l)-s*(e*x-r*l)+p*(e*m-r*v),g[6]=-(A*(o*x-a*l)-i*(e*x-r*l)+p*(e*a-r*o)),g[7]=A*(o*m-a*v)-i*(e*m-r*v)+s*(e*a-r*o),g[8]=i*(h*x-m*y)-s*(n*x-a*y)+p*(n*m-a*h),g[9]=-(A*(h*x-m*y)-s*(t*x-r*y)+p*(t*m-r*h)),g[10]=A*(n*x-a*y)-i*(t*x-r*y)+p*(t*a-r*n),g[11]=-(A*(n*m-a*h)-i*(t*m-r*h)+s*(t*a-r*n)),g[12]=-(i*(h*l-v*y)-s*(n*l-o*y)+p*(n*v-o*h)),g[13]=A*(h*l-v*y)-s*(t*l-e*y)+p*(t*v-e*h),g[14]=-(A*(n*l-o*y)-i*(t*l-e*y)+p*(t*o-e*n)),g[15]=A*(n*v-o*h)-i*(t*v-e*h)+s*(t*o-e*n),g}}),VT=Vt((X,V)=>{V.exports=c;function c(g){var E=g[0],A=g[1],t=g[2],e=g[3],r=g[4],i=g[5],n=g[6],o=g[7],a=g[8],s=g[9],h=g[10],v=g[11],m=g[12],p=g[13],y=g[14],l=g[15],x=E*i-A*r,b=E*n-t*r,S=E*o-e*r,T=A*n-t*i,M=A*o-e*i,w=t*o-e*n,u=a*p-s*m,f=a*y-h*m,k=a*l-v*m,_=s*y-h*p,D=s*l-v*p,I=h*l-v*y;return x*I-b*D+S*_+T*k-M*f+w*u}}),qT=Vt((X,V)=>{V.exports=c;function c(g,E,A){var t=E[0],e=E[1],r=E[2],i=E[3],n=E[4],o=E[5],a=E[6],s=E[7],h=E[8],v=E[9],m=E[10],p=E[11],y=E[12],l=E[13],x=E[14],b=E[15],S=A[0],T=A[1],M=A[2],w=A[3];return g[0]=S*t+T*n+M*h+w*y,g[1]=S*e+T*o+M*v+w*l,g[2]=S*r+T*a+M*m+w*x,g[3]=S*i+T*s+M*p+w*b,S=A[4],T=A[5],M=A[6],w=A[7],g[4]=S*t+T*n+M*h+w*y,g[5]=S*e+T*o+M*v+w*l,g[6]=S*r+T*a+M*m+w*x,g[7]=S*i+T*s+M*p+w*b,S=A[8],T=A[9],M=A[10],w=A[11],g[8]=S*t+T*n+M*h+w*y,g[9]=S*e+T*o+M*v+w*l,g[10]=S*r+T*a+M*m+w*x,g[11]=S*i+T*s+M*p+w*b,S=A[12],T=A[13],M=A[14],w=A[15],g[12]=S*t+T*n+M*h+w*y,g[13]=S*e+T*o+M*v+w*l,g[14]=S*r+T*a+M*m+w*x,g[15]=S*i+T*s+M*p+w*b,g}}),HT=Vt((X,V)=>{V.exports=c;function c(g,E,A){var t=A[0],e=A[1],r=A[2],i,n,o,a,s,h,v,m,p,y,l,x;return E===g?(g[12]=E[0]*t+E[4]*e+E[8]*r+E[12],g[13]=E[1]*t+E[5]*e+E[9]*r+E[13],g[14]=E[2]*t+E[6]*e+E[10]*r+E[14],g[15]=E[3]*t+E[7]*e+E[11]*r+E[15]):(i=E[0],n=E[1],o=E[2],a=E[3],s=E[4],h=E[5],v=E[6],m=E[7],p=E[8],y=E[9],l=E[10],x=E[11],g[0]=i,g[1]=n,g[2]=o,g[3]=a,g[4]=s,g[5]=h,g[6]=v,g[7]=m,g[8]=p,g[9]=y,g[10]=l,g[11]=x,g[12]=i*t+s*e+p*r+E[12],g[13]=n*t+h*e+y*r+E[13],g[14]=o*t+v*e+l*r+E[14],g[15]=a*t+m*e+x*r+E[15]),g}}),GT=Vt((X,V)=>{V.exports=c;function c(g,E,A){var t=A[0],e=A[1],r=A[2];return g[0]=E[0]*t,g[1]=E[1]*t,g[2]=E[2]*t,g[3]=E[3]*t,g[4]=E[4]*e,g[5]=E[5]*e,g[6]=E[6]*e,g[7]=E[7]*e,g[8]=E[8]*r,g[9]=E[9]*r,g[10]=E[10]*r,g[11]=E[11]*r,g[12]=E[12],g[13]=E[13],g[14]=E[14],g[15]=E[15],g}}),WT=Vt((X,V)=>{V.exports=c;function c(g,E,A,t){var e=t[0],r=t[1],i=t[2],n=Math.sqrt(e*e+r*r+i*i),o,a,s,h,v,m,p,y,l,x,b,S,T,M,w,u,f,k,_,D,I,O,B,R;return Math.abs(n)<1e-6?null:(n=1/n,e*=n,r*=n,i*=n,o=Math.sin(A),a=Math.cos(A),s=1-a,h=E[0],v=E[1],m=E[2],p=E[3],y=E[4],l=E[5],x=E[6],b=E[7],S=E[8],T=E[9],M=E[10],w=E[11],u=e*e*s+a,f=r*e*s+i*o,k=i*e*s-r*o,_=e*r*s-i*o,D=r*r*s+a,I=i*r*s+e*o,O=e*i*s+r*o,B=r*i*s-e*o,R=i*i*s+a,g[0]=h*u+y*f+S*k,g[1]=v*u+l*f+T*k,g[2]=m*u+x*f+M*k,g[3]=p*u+b*f+w*k,g[4]=h*_+y*D+S*I,g[5]=v*_+l*D+T*I,g[6]=m*_+x*D+M*I,g[7]=p*_+b*D+w*I,g[8]=h*O+y*B+S*R,g[9]=v*O+l*B+T*R,g[10]=m*O+x*B+M*R,g[11]=p*O+b*B+w*R,E!==g&&(g[12]=E[12],g[13]=E[13],g[14]=E[14],g[15]=E[15]),g)}}),ZT=Vt((X,V)=>{V.exports=c;function c(g,E,A){var t=Math.sin(A),e=Math.cos(A),r=E[4],i=E[5],n=E[6],o=E[7],a=E[8],s=E[9],h=E[10],v=E[11];return E!==g&&(g[0]=E[0],g[1]=E[1],g[2]=E[2],g[3]=E[3],g[12]=E[12],g[13]=E[13],g[14]=E[14],g[15]=E[15]),g[4]=r*e+a*t,g[5]=i*e+s*t,g[6]=n*e+h*t,g[7]=o*e+v*t,g[8]=a*e-r*t,g[9]=s*e-i*t,g[10]=h*e-n*t,g[11]=v*e-o*t,g}}),XT=Vt((X,V)=>{V.exports=c;function c(g,E,A){var t=Math.sin(A),e=Math.cos(A),r=E[0],i=E[1],n=E[2],o=E[3],a=E[8],s=E[9],h=E[10],v=E[11];return E!==g&&(g[4]=E[4],g[5]=E[5],g[6]=E[6],g[7]=E[7],g[12]=E[12],g[13]=E[13],g[14]=E[14],g[15]=E[15]),g[0]=r*e-a*t,g[1]=i*e-s*t,g[2]=n*e-h*t,g[3]=o*e-v*t,g[8]=r*t+a*e,g[9]=i*t+s*e,g[10]=n*t+h*e,g[11]=o*t+v*e,g}}),$T=Vt((X,V)=>{V.exports=c;function c(g,E,A){var t=Math.sin(A),e=Math.cos(A),r=E[0],i=E[1],n=E[2],o=E[3],a=E[4],s=E[5],h=E[6],v=E[7];return E!==g&&(g[8]=E[8],g[9]=E[9],g[10]=E[10],g[11]=E[11],g[12]=E[12],g[13]=E[13],g[14]=E[14],g[15]=E[15]),g[0]=r*e+a*t,g[1]=i*e+s*t,g[2]=n*e+h*t,g[3]=o*e+v*t,g[4]=a*e-r*t,g[5]=s*e-i*t,g[6]=h*e-n*t,g[7]=v*e-o*t,g}}),JT=Vt((X,V)=>{V.exports=c;function c(g,E,A){var t,e,r,i=A[0],n=A[1],o=A[2],a=Math.sqrt(i*i+n*n+o*o);return Math.abs(a)<1e-6?null:(a=1/a,i*=a,n*=a,o*=a,t=Math.sin(E),e=Math.cos(E),r=1-e,g[0]=i*i*r+e,g[1]=n*i*r+o*t,g[2]=o*i*r-n*t,g[3]=0,g[4]=i*n*r-o*t,g[5]=n*n*r+e,g[6]=o*n*r+i*t,g[7]=0,g[8]=i*o*r+n*t,g[9]=n*o*r-i*t,g[10]=o*o*r+e,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g)}}),QT=Vt((X,V)=>{V.exports=c;function c(g,E,A){var t=E[0],e=E[1],r=E[2],i=E[3],n=t+t,o=e+e,a=r+r,s=t*n,h=t*o,v=t*a,m=e*o,p=e*a,y=r*a,l=i*n,x=i*o,b=i*a;return g[0]=1-(m+y),g[1]=h+b,g[2]=v-x,g[3]=0,g[4]=h-b,g[5]=1-(s+y),g[6]=p+l,g[7]=0,g[8]=v+x,g[9]=p-l,g[10]=1-(s+m),g[11]=0,g[12]=A[0],g[13]=A[1],g[14]=A[2],g[15]=1,g}}),YT=Vt((X,V)=>{V.exports=c;function c(g,E){return g[0]=E[0],g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=E[1],g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=E[2],g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),KT=Vt((X,V)=>{V.exports=c;function c(g,E){return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=E[0],g[13]=E[1],g[14]=E[2],g[15]=1,g}}),tk=Vt((X,V)=>{V.exports=c;function c(g,E){var A=Math.sin(E),t=Math.cos(E);return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=t,g[6]=A,g[7]=0,g[8]=0,g[9]=-A,g[10]=t,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),ek=Vt((X,V)=>{V.exports=c;function c(g,E){var A=Math.sin(E),t=Math.cos(E);return g[0]=t,g[1]=0,g[2]=-A,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=A,g[9]=0,g[10]=t,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),rk=Vt((X,V)=>{V.exports=c;function c(g,E){var A=Math.sin(E),t=Math.cos(E);return g[0]=t,g[1]=A,g[2]=0,g[3]=0,g[4]=-A,g[5]=t,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),X_=Vt((X,V)=>{V.exports=c;function c(g,E){var A=E[0],t=E[1],e=E[2],r=E[3],i=A+A,n=t+t,o=e+e,a=A*i,s=t*i,h=t*n,v=e*i,m=e*n,p=e*o,y=r*i,l=r*n,x=r*o;return g[0]=1-h-p,g[1]=s+x,g[2]=v-l,g[3]=0,g[4]=s-x,g[5]=1-a-p,g[6]=m+y,g[7]=0,g[8]=v+l,g[9]=m-y,g[10]=1-a-h,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),nk=Vt((X,V)=>{V.exports=c;function c(g,E,A,t,e,r,i){var n=1/(A-E),o=1/(e-t),a=1/(r-i);return g[0]=r*2*n,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=r*2*o,g[6]=0,g[7]=0,g[8]=(A+E)*n,g[9]=(e+t)*o,g[10]=(i+r)*a,g[11]=-1,g[12]=0,g[13]=0,g[14]=i*r*2*a,g[15]=0,g}}),ak=Vt((X,V)=>{V.exports=c;function c(g,E,A,t,e){var r=1/Math.tan(E/2),i=1/(t-e);return g[0]=r/A,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=r,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=(e+t)*i,g[11]=-1,g[12]=0,g[13]=0,g[14]=2*e*t*i,g[15]=0,g}}),ik=Vt((X,V)=>{V.exports=c;function c(g,E,A,t){var e=Math.tan(E.upDegrees*Math.PI/180),r=Math.tan(E.downDegrees*Math.PI/180),i=Math.tan(E.leftDegrees*Math.PI/180),n=Math.tan(E.rightDegrees*Math.PI/180),o=2/(i+n),a=2/(e+r);return g[0]=o,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=a,g[6]=0,g[7]=0,g[8]=-((i-n)*o*.5),g[9]=(e-r)*a*.5,g[10]=t/(A-t),g[11]=-1,g[12]=0,g[13]=0,g[14]=t*A/(A-t),g[15]=0,g}}),ok=Vt((X,V)=>{V.exports=c;function c(g,E,A,t,e,r,i){var n=1/(E-A),o=1/(t-e),a=1/(r-i);return g[0]=-2*n,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=-2*o,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=2*a,g[11]=0,g[12]=(E+A)*n,g[13]=(e+t)*o,g[14]=(i+r)*a,g[15]=1,g}}),sk=Vt((X,V)=>{var c=Z_();V.exports=g;function g(E,A,t,e){var r,i,n,o,a,s,h,v,m,p,y=A[0],l=A[1],x=A[2],b=e[0],S=e[1],T=e[2],M=t[0],w=t[1],u=t[2];return Math.abs(y-M)<1e-6&&Math.abs(l-w)<1e-6&&Math.abs(x-u)<1e-6?c(E):(h=y-M,v=l-w,m=x-u,p=1/Math.sqrt(h*h+v*v+m*m),h*=p,v*=p,m*=p,r=S*m-T*v,i=T*h-b*m,n=b*v-S*h,p=Math.sqrt(r*r+i*i+n*n),p?(p=1/p,r*=p,i*=p,n*=p):(r=0,i=0,n=0),o=v*n-m*i,a=m*r-h*n,s=h*i-v*r,p=Math.sqrt(o*o+a*a+s*s),p?(p=1/p,o*=p,a*=p,s*=p):(o=0,a=0,s=0),E[0]=r,E[1]=o,E[2]=h,E[3]=0,E[4]=i,E[5]=a,E[6]=v,E[7]=0,E[8]=n,E[9]=s,E[10]=m,E[11]=0,E[12]=-(r*y+i*l+n*x),E[13]=-(o*y+a*l+s*x),E[14]=-(h*y+v*l+m*x),E[15]=1,E)}}),lk=Vt((X,V)=>{V.exports=c;function c(g){return"mat4("+g[0]+", "+g[1]+", "+g[2]+", "+g[3]+", "+g[4]+", "+g[5]+", "+g[6]+", "+g[7]+", "+g[8]+", "+g[9]+", "+g[10]+", "+g[11]+", "+g[12]+", "+g[13]+", "+g[14]+", "+g[15]+")"}}),$_=Vt((X,V)=>{V.exports={create:FT(),clone:BT(),copy:RT(),identity:Z_(),transpose:jT(),invert:NT(),adjoint:UT(),determinant:VT(),multiply:qT(),translate:HT(),scale:GT(),rotate:WT(),rotateX:ZT(),rotateY:XT(),rotateZ:$T(),fromRotation:JT(),fromRotationTranslation:QT(),fromScaling:YT(),fromTranslation:KT(),fromXRotation:tk(),fromYRotation:ek(),fromZRotation:rk(),fromQuat:X_(),frustum:nk(),perspective:ak(),perspectiveFromFieldOfView:ik(),ortho:ok(),lookAt:sk(),str:lk()}}),Dy=Vt(X=>{var V=$_();X.init2dArray=function(c,g){for(var E=new Array(c),A=0;A<c;A++)E[A]=new Array(g);return E},X.transposeRagged=function(c){var g=0,E=c.length,A,t;for(A=0;A<E;A++)g=Math.max(g,c[A].length);var e=new Array(g);for(A=0;A<g;A++)for(e[A]=new Array(E),t=0;t<E;t++)e[A][t]=c[t][A];return e},X.dot=function(c,g){if(!(c.length&&g.length)||c.length!==g.length)return null;var E=c.length,A,t;if(c[0].length)for(A=new Array(E),t=0;t<E;t++)A[t]=X.dot(c[t],g);else if(g[0].length){var e=X.transposeRagged(g);for(A=new Array(e.length),t=0;t<e.length;t++)A[t]=X.dot(c,e[t])}else for(A=0,t=0;t<E;t++)A+=c[t]*g[t];return A},X.translationMatrix=function(c,g){return[[1,0,c],[0,1,g],[0,0,1]]},X.rotationMatrix=function(c){var g=c*Math.PI/180;return[[Math.cos(g),-Math.sin(g),0],[Math.sin(g),Math.cos(g),0],[0,0,1]]},X.rotationXYMatrix=function(c,g,E){return X.dot(X.dot(X.translationMatrix(g,E),X.rotationMatrix(c)),X.translationMatrix(-g,-E))},X.apply3DTransform=function(c){return function(){var g=arguments,E=arguments.length===1?g[0]:[g[0],g[1],g[2]||0];return X.dot(c,[E[0],E[1],E[2],1]).slice(0,3)}},X.apply2DTransform=function(c){return function(){var g=arguments;g.length===3&&(g=g[0]);var E=arguments.length===1?g[0]:[g[0],g[1]];return X.dot(c,[E[0],E[1],1]).slice(0,2)}},X.apply2DTransform2=function(c){var g=X.apply2DTransform(c);return function(E){return g(E.slice(0,2)).concat(g(E.slice(2,4)))}},X.convertCssMatrix=function(c){if(c){var g=c.length;if(g===16)return c;if(g===6)return[c[0],c[1],0,0,c[2],c[3],0,0,0,0,1,0,c[4],c[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},X.inverseTransformMatrix=function(c){var g=[];return V.invert(g,c),[[g[0],g[1],g[2],g[3]],[g[4],g[5],g[6],g[7]],[g[8],g[9],g[10],g[11]],[g[12],g[13],g[14],g[15]]]}}),Cm=Vt((X,V)=>{var c=Ai(),g=wd(),E=Dy(),A=$_();function t(y){var l;if(typeof y=="string"){if(l=document.getElementById(y),l===null)throw new Error("No DOM element with id '"+y+"' exists on the page.");return l}else if(y==null)throw new Error("DOM element provided is null or undefined");return y}function e(y){var l=c.select(y);return l.node()instanceof HTMLElement&&l.size()&&l.classed("js-plotly-plot")}function r(y){var l=y&&y.parentNode;l&&l.removeChild(y)}function i(y,l){n("global",y,l)}function n(y,l,x){var b="plotly.js-style-"+y,S=document.getElementById(b);if(!(S&&S.matches(".no-inline-styles"))){S||(S=document.createElement("style"),S.setAttribute("id",b),S.appendChild(document.createTextNode("")),document.head.appendChild(S));var T=S.sheet;T?T.insertRule?T.insertRule(l+"{"+x+"}",0):T.addRule?T.addRule(l,x,0):g.warn("addStyleRule failed"):g.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function o(y){var l="plotly.js-style-"+y,x=document.getElementById(l);x&&r(x)}function a(y,l,x,b,S,T){var M=b.split(":"),w=S.split(":"),u="data-btn-style-event-added";T||(T=document),T.querySelectorAll(y).forEach(function(f){f.getAttribute(u)||(f.addEventListener("mouseenter",function(){var k=this.querySelector(x);k&&(k.style[M[0]]=M[1])}),f.addEventListener("mouseleave",function(){var k=this.querySelector(x);k&&(l&&this.matches(l)?k.style[M[0]]=M[1]:k.style[w[0]]=w[1])}),f.setAttribute(u,!0))})}function s(y){var l=v(y),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return l.forEach(function(b){var S=h(b);if(S){var T=E.convertCssMatrix(S);x=A.multiply(x,x,T)}}),x}function h(y){var l=window.getComputedStyle(y,null),x=l.getPropertyValue("-webkit-transform")||l.getPropertyValue("-moz-transform")||l.getPropertyValue("-ms-transform")||l.getPropertyValue("-o-transform")||l.getPropertyValue("transform");return x==="none"?null:x.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(b){return+b})}function v(y){for(var l=[];m(y);)l.push(y),y=y.parentNode,typeof ShadowRoot=="function"&&y instanceof ShadowRoot&&(y=y.host);return l}function m(y){return y&&(y instanceof Element||y instanceof HTMLElement)}function p(y,l){return y&&l&&y.top===l.top&&y.left===l.left&&y.right===l.right&&y.bottom===l.bottom}V.exports={getGraphDiv:t,isPlotDiv:e,removeElement:r,addStyleRule:i,addRelatedStyleRule:n,deleteRelatedStyleRule:o,setStyleOnHover:a,getFullTransformMatrix:s,getElementTransformMatrix:h,getElementAndAncestors:v,equalDomRects:p}}),Dm=Vt((X,V)=>{V.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}}),su=Vt((X,V)=>{var c=po().extendFlat,g=jp(),E={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},A={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},t=E.flags.slice().concat(["fullReplot"]),e=A.flags.slice().concat("layoutReplot");V.exports={traces:E,layout:A,traceFlags:function(){return r(t)},layoutFlags:function(){return r(e)},update:function(o,a){var s=a.editType;if(s&&s!=="none")for(var h=s.split("+"),v=0;v<h.length;v++)o[h[v]]=!0},overrideAll:i};function r(o){for(var a={},s=0;s<o.length;s++)a[o[s]]=!1;return a}function i(o,a,s){var h=c({},o);for(var v in h){var m=h[v];g(m)&&(h[v]=n(m,a,s,v))}return s==="from-root"&&(h.editType=a),h}function n(o,a,s,h){if(o.valType){var v=c({},o);if(v.editType=a,Array.isArray(o.items)){v.items=new Array(o.items.length);for(var m=0;m<o.items.length;m++)v.items[m]=n(o.items[m],a)}return v}else return i(o,a,h.charAt(0)==="_"?"nested":"from-root")}}),Eh=Vt(X=>{X.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},X.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}}),J_=Vt((X,V)=>{V.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}}),Zo=Vt(X=>{var V=J_();V.FORMAT_LINK,V.DATE_FORMAT_LINK;function c(g){var E=g.description?" "+g.description:"",A=g.keys||[];if(A.length>0){for(var t=[],e=0;e<A.length;e++)t[e]="`"+A[e]+"`";E=E+"Finally, the template string has access to ",A.length===1?E=E+"variable "+t[0]:E=E+"variables "+t.slice(0,-1).join(", ")+" and "+t.slice(-1)+"."}return E}X.hovertemplateAttrs=function(g,E){g=g||{},E=E||{},c(E);var A={valType:"string",dflt:"",editType:g.editType||"none"};return g.arrayOk!==!1&&(A.arrayOk=!0),A},X.texttemplateAttrs=function(g,E){g=g||{},E=E||{},c(E);var A={valType:"string",dflt:"",editType:g.editType||"calc"};return g.arrayOk!==!1&&(A.arrayOk=!0),A},X.shapeTexttemplateAttrs=function(g,E){g=g||{},E=E||{},g.newshape,c(E);var A={valType:"string",dflt:"",editType:g.editType||"arraydraw"};return A}}),zy=Vt((X,V)=>{function c(x,b){return b?b.d2l(x):x}function g(x,b){return b?b.l2d(x):x}function E(x){return x.x0}function A(x){return x.x1}function t(x){return x.y0}function e(x){return x.y1}function r(x){return x.x0shift||0}function i(x){return x.x1shift||0}function n(x){return x.y0shift||0}function o(x){return x.y1shift||0}function a(x,b){return c(x.x1,b)+i(x)-c(x.x0,b)-r(x)}function s(x,b,S){return c(x.y1,S)+o(x)-c(x.y0,S)-n(x)}function h(x,b){return Math.abs(a(x,b))}function v(x,b,S){return Math.abs(s(x,b,S))}function m(x,b,S){return x.type!=="line"?void 0:Math.sqrt(Math.pow(a(x,b),2)+Math.pow(s(x,b,S),2))}function p(x,b){return g((c(x.x1,b)+i(x)+c(x.x0,b)+r(x))/2,b)}function y(x,b,S){return g((c(x.y1,S)+o(x)+c(x.y0,S)+n(x))/2,S)}function l(x,b,S){return x.type!=="line"?void 0:s(x,b,S)/a(x,b)}V.exports={x0:E,x1:A,y0:t,y1:e,slope:l,dx:a,dy:s,width:h,height:v,length:m,xcenter:p,ycenter:y}}),uk=Vt((X,V)=>{var c=su().overrideAll,g=Ks(),E=Nl(),A=Eh().dash,t=po().extendFlat,e=Zo().shapeTexttemplateAttrs,r=zy();V.exports=c({newshape:{visible:t({},g.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:t({},g.legend,{}),legendgroup:t({},g.legendgroup,{}),legendgrouptitle:{text:t({},g.legendgrouptitle.text,{}),font:E({})},legendrank:t({},g.legendrank,{}),legendwidth:t({},g.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:t({},A,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:t({},g.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:e({newshape:!0},{keys:Object.keys(r)}),font:E({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)"},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}),ck=Vt((X,V)=>{var c=Eh().dash,g=po().extendFlat;V.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:g({},c,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}),Oy=Vt((X,V)=>{V.exports=function(c){var g=c.editType;return{t:{valType:"number",dflt:0,editType:g},r:{valType:"number",dflt:0,editType:g},b:{valType:"number",dflt:0,editType:g},l:{valType:"number",dflt:0,editType:g},editType:g}}}),mg=Vt((X,V)=>{var c=Nl(),g=Dm(),E=Hc(),A=uk(),t=ck(),e=Oy(),r=po().extendFlat,i=c({editType:"calc"});i.family.dflt='"Open Sans", verdana, arial, sans-serif',i.size.dflt=12,i.color.dflt=E.defaultLine,V.exports={font:i,title:{text:{valType:"string",editType:"layoutstyle"},font:c({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:c({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:r(e({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:E.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:E.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:E.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:A.newshape,activeshape:A.activeshape,newselection:t.newselection,activeselection:t.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:r({},g.transition,{editType:"none"})}}),hk=bl(()=>{}),fk={},pk=bl(()=>{hk()}),Mi=Vt(X=>{var V=wd(),c=Cy(),g=W_(),E=jp(),A=Cm().addStyleRule,t=po(),e=Ks(),r=mg(),i=t.extendFlat,n=t.extendDeepAll;X.modules={},X.allCategories={},X.allTypes=[],X.subplotsRegistry={},X.componentsRegistry={},X.layoutArrayContainers=[],X.layoutArrayRegexes=[],X.traceLayoutAttributes={},X.localeRegistry={},X.apiMethodRegistry={},X.collectableSubplotTypes=null,X.register=function(x){if(X.collectableSubplotTypes=null,x)x&&!Array.isArray(x)&&(x=[x]);else throw new Error("No argument passed to Plotly.register.");for(var b=0;b<x.length;b++){var S=x[b];if(!S)throw new Error("Invalid module was attempted to be registered!");switch(S.moduleType){case"trace":o(S);break;case"transform":h(S);break;case"component":s(S);break;case"locale":v(S);break;case"apiMethod":var T=S.name;X.apiMethodRegistry[T]=S.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},X.getModule=function(x){var b=X.modules[l(x)];return b?b._module:!1},X.traceIs=function(x,b){if(x=l(x),x==="various")return!1;var S=X.modules[x];return S||(x&&V.log("Unrecognized trace type "+x+"."),S=X.modules[e.type.dflt]),!!S.categories[b]},X.getComponentMethod=function(x,b){var S=X.componentsRegistry[x];return S&&S[b]||c},X.call=function(){var x=arguments[0],b=[].slice.call(arguments,1);return X.apiMethodRegistry[x].apply(null,b)};function o(x){var b=x.name,S=x.categories,T=x.meta;if(X.modules[b]){V.log("Type "+b+" already registered");return}X.subplotsRegistry[x.basePlotModule.name]||a(x.basePlotModule);for(var M={},w=0;w<S.length;w++)M[S[w]]=!0,X.allCategories[S[w]]=!0;X.modules[b]={_module:x,categories:M},T&&Object.keys(T).length&&(X.modules[b].meta=T),X.allTypes.push(b);for(var u in X.componentsRegistry)p(u,b);x.layoutAttributes&&i(X.traceLayoutAttributes,x.layoutAttributes);var f=x.basePlotModule,k=f.name;if(k==="mapbox"){var _=f.constants.styleRules;for(var D in _)A(".js-plotly-plot .plotly .mapboxgl-"+D,_[D])}k==="map"&&(pk(),xd(fk)),(k==="geo"||k==="mapbox"||k==="map")&&window.PlotlyGeoAssets===void 0&&(window.PlotlyGeoAssets={topojson:{}})}function a(x){var b=x.name;if(X.subplotsRegistry[b]){V.log("Plot type "+b+" already registered.");return}m(x),X.subplotsRegistry[b]=x;for(var S in X.componentsRegistry)y(S,x.name)}function s(x){if(typeof x.name!="string")throw new Error("Component module *name* must be a string.");var b=x.name;X.componentsRegistry[b]=x,x.layoutAttributes&&(x.layoutAttributes._isLinkedToArray&&g(X.layoutArrayContainers,b),m(x));for(var S in X.modules)p(b,S);for(var T in X.subplotsRegistry)y(b,T);x.schema&&x.schema.layout&&n(r,x.schema.layout)}function h(x){if(typeof x.name!="string")throw new Error("Transform module *name* must be a string.");var b="Transform module "+x.name,S=typeof x.transform=="function",T=typeof x.calcTransform=="function";if(!S&&!T)throw new Error(b+" is missing a *transform* or *calcTransform* method.");S&&T&&V.log([b+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),E(x.attributes)||V.log(b+" registered without an *attributes* object."),typeof x.supplyDefaults!="function"&&V.log(b+" registered without a *supplyDefaults* method.")}function v(x){var b=x.name,S=b.split("-")[0],T=x.dictionary,M=x.format,w=T&&Object.keys(T).length,u=M&&Object.keys(M).length,f=X.localeRegistry,k=f[b];if(k||(f[b]=k={}),S!==b){var _=f[S];_||(f[S]=_={}),w&&_.dictionary===k.dictionary&&(_.dictionary=T),u&&_.format===k.format&&(_.format=M)}w&&(k.dictionary=T),u&&(k.format=M)}function m(x){if(x.layoutAttributes){var b=x.layoutAttributes._arrayAttrRegexps;if(b)for(var S=0;S<b.length;S++)g(X.layoutArrayRegexes,b[S])}}function p(x,b){var S=X.componentsRegistry[x].schema;if(!(!S||!S.traces)){var T=S.traces[b];T&&n(X.modules[b]._module.attributes,T)}}function y(x,b){var S=X.componentsRegistry[x].schema;if(!(!S||!S.subplots)){var T=X.subplotsRegistry[b],M=T.layoutAttributes,w=T.attr==="subplot"?T.name:T.attr;Array.isArray(w)&&(w=w[0]);var u=S.subplots[w];M&&u&&n(M,u)}}function l(x){return typeof x=="object"&&(x=x.type),x}}),dk=Vt(X=>{var V=fg().timeFormat,c=vo(),g=wd(),E=pg().mod,A=ts(),t=A.BADNUM,e=A.ONEDAY,r=A.ONEHOUR,i=A.ONEMIN,n=A.ONESEC,o=A.EPOCHJD,a=Mi(),s=fg().utcFormat,h=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,v=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,m=new Date().getFullYear()-70;function p(B){return B&&a.componentsRegistry.calendars&&typeof B=="string"&&B!=="gregorian"}X.dateTick0=function(B,R){var L=y(B,!!R);if(R<2)return L;var F=X.dateTime2ms(L,B);return F+=e*(R-1),X.ms2DateTime(F,0,B)};function y(B,R){return p(B)?R?a.getComponentMethod("calendars","CANONICAL_SUNDAY")[B]:a.getComponentMethod("calendars","CANONICAL_TICK")[B]:R?"2000-01-02":"2000-01-01"}X.dfltRange=function(B){return p(B)?a.getComponentMethod("calendars","DFLTRANGE")[B]:["2000-01-01","2001-01-01"]},X.isJSDate=function(B){return typeof B=="object"&&B!==null&&typeof B.getTime=="function"};var l,x;X.dateTime2ms=function(B,R){if(X.isJSDate(B)){var L=B.getTimezoneOffset()*i,F=(B.getUTCMinutes()-B.getMinutes())*i+(B.getUTCSeconds()-B.getSeconds())*n+(B.getUTCMilliseconds()-B.getMilliseconds());if(F){var N=3*i;L=L-N/2+E(F-L+N/2,N)}return B=Number(B)-L,B>=l&&B<=x?B:t}if(typeof B!="string"&&typeof B!="number")return t;B=String(B);var j=p(R),G=B.charAt(0);j&&(G==="G"||G==="g")&&(B=B.substr(1),R="");var rt=j&&R.substr(0,7)==="chinese",ct=B.match(rt?v:h);if(!ct)return t;var lt=ct[1],tt=ct[3]||"1",Z=Number(ct[5]||1),st=Number(ct[7]||0),$=Number(ct[9]||0),Q=Number(ct[11]||0);if(j){if(lt.length===2)return t;lt=Number(lt);var nt;try{var Y=a.getComponentMethod("calendars","getCal")(R);if(rt){var q=tt.charAt(tt.length-1)==="i";tt=parseInt(tt,10),nt=Y.newDate(lt,Y.toMonthIndex(lt,tt,q),Z)}else nt=Y.newDate(lt,Number(tt),Z)}catch{return t}return nt?(nt.toJD()-o)*e+st*r+$*i+Q*n:t}lt.length===2?lt=(Number(lt)+2e3-m)%100+m:lt=Number(lt),tt-=1;var ot=new Date(Date.UTC(2e3,tt,Z,st,$));return ot.setUTCFullYear(lt),ot.getUTCMonth()!==tt||ot.getUTCDate()!==Z?t:ot.getTime()+Q*n},l=X.MIN_MS=X.dateTime2ms("-9999"),x=X.MAX_MS=X.dateTime2ms("9999-12-31 23:59:59.9999"),X.isDateTime=function(B,R){return X.dateTime2ms(B,R)!==t};function b(B,R){return String(B+Math.pow(10,R)).substr(1)}var S=90*e,T=3*r,M=5*i;X.ms2DateTime=function(B,R,L){if(typeof B!="number"||!(B>=l&&B<=x))return t;R||(R=0);var F=Math.floor(E(B+.05,1)*10),N=Math.round(B-F/10),j,G,rt,ct,lt,tt;if(p(L)){var Z=Math.floor(N/e)+o,st=Math.floor(E(B,e));try{j=a.getComponentMethod("calendars","getCal")(L).fromJD(Z).formatDate("yyyy-mm-dd")}catch{j=s("G%Y-%m-%d")(new Date(N))}if(j.charAt(0)==="-")for(;j.length<11;)j="-0"+j.substr(1);else for(;j.length<10;)j="0"+j;G=R<S?Math.floor(st/r):0,rt=R<S?Math.floor(st%r/i):0,ct=R<T?Math.floor(st%i/n):0,lt=R<M?st%n*10+F:0}else tt=new Date(N),j=s("%Y-%m-%d")(tt),G=R<S?tt.getUTCHours():0,rt=R<S?tt.getUTCMinutes():0,ct=R<T?tt.getUTCSeconds():0,lt=R<M?tt.getUTCMilliseconds()*10+F:0;return w(j,G,rt,ct,lt)},X.ms2DateTimeLocal=function(B){if(!(B>=l+e&&B<=x-e))return t;var R=Math.floor(E(B+.05,1)*10),L=new Date(Math.round(B-R/10)),F=V("%Y-%m-%d")(L),N=L.getHours(),j=L.getMinutes(),G=L.getSeconds(),rt=L.getUTCMilliseconds()*10+R;return w(F,N,j,G,rt)};function w(B,R,L,F,N){if((R||L||F||N)&&(B+=" "+b(R,2)+":"+b(L,2),(F||N)&&(B+=":"+b(F,2),N))){for(var j=4;N%10===0;)j-=1,N/=10;B+="."+b(N,j)}return B}X.cleanDate=function(B,R,L){if(B===t)return R;if(X.isJSDate(B)||typeof B=="number"&&isFinite(B)){if(p(L))return g.error("JS Dates and milliseconds are incompatible with world calendars",B),R;if(B=X.ms2DateTimeLocal(+B),!B&&R!==void 0)return R}else if(!X.isDateTime(B,L))return g.error("unrecognized date",B),R;return B};var u=/%\d?f/g,f=/%h/g,k={1:"1",2:"1",3:"2",4:"2"};function _(B,R,L,F){B=B.replace(u,function(j){var G=Math.min(+j.charAt(1)||6,6),rt=(R/1e3%1+2).toFixed(G).substr(2).replace(/0+$/,"")||"0";return rt});var N=new Date(Math.floor(R+.05));if(B=B.replace(f,function(){return k[L("%q")(N)]}),p(F))try{B=a.getComponentMethod("calendars","worldCalFmt")(B,R,F)}catch{return"Invalid"}return L(B)(N)}var D=[59,59.9,59.99,59.999,59.9999];function I(B,R){var L=E(B+.05,e),F=b(Math.floor(L/r),2)+":"+b(E(Math.floor(L/i),60),2);if(R!=="M"){c(R)||(R=0);var N=Math.min(E(B/n,60),D[R]),j=(100+N).toFixed(R).substr(1);R>0&&(j=j.replace(/0+$/,"").replace(/[\.]$/,"")),F+=":"+j}return F}X.formatDate=function(B,R,L,F,N,j){if(N=p(N)&&N,!R)if(L==="y")R=j.year;else if(L==="m")R=j.month;else if(L==="d")R=j.dayMonth+`
|
||
`+j.year;else return I(B,L)+`
|
||
`+_(j.dayMonthYear,B,F,N);return _(R,B,F,N)};var O=3*e;X.incrementMonth=function(B,R,L){L=p(L)&&L;var F=E(B,e);if(B=Math.round(B-F),L)try{var N=Math.round(B/e)+o,j=a.getComponentMethod("calendars","getCal")(L),G=j.fromJD(N);return R%12?j.add(G,R,"m"):j.add(G,R/12,"y"),(G.toJD()-o)*e+F}catch{g.error("invalid ms "+B+" in calendar "+L)}var rt=new Date(B+O);return rt.setUTCMonth(rt.getUTCMonth()+R)+F-O},X.findExactDates=function(B,R){for(var L=0,F=0,N=0,j=0,G,rt,ct=p(R)&&a.getComponentMethod("calendars","getCal")(R),lt=0;lt<B.length;lt++){if(rt=B[lt],!c(rt)){j++;continue}if(!(rt%e))if(ct)try{G=ct.fromJD(rt/e+o),G.day()===1?G.month()===1?L++:F++:N++}catch{}else G=new Date(rt),G.getUTCDate()===1?G.getUTCMonth()===0?L++:F++:N++}F+=L,N+=F;var tt=B.length-j;return{exactYears:L/tt,exactMonths:F/tt,exactDays:N/tt}}}),zm=Vt((X,V)=>{V.exports=function(c){return c}}),Fy=Vt(X=>{var V=vo(),c=wd(),g=zm(),E=ts().BADNUM,A=1e-9;X.findBin=function(n,o,a){if(V(o.start))return a?Math.ceil((n-o.start)/o.size-A)-1:Math.floor((n-o.start)/o.size+A);var s=0,h=o.length,v=0,m=h>1?(o[h-1]-o[0])/(h-1):1,p,y;for(m>=0?y=a?t:e:y=a?i:r,n+=m*A*(a?-1:1)*(m>=0?1:-1);s<h&&v++<100;)p=Math.floor((s+h)/2),y(o[p],n)?s=p+1:h=p;return v>90&&c.log("Long binary search..."),s-1};function t(n,o){return n<o}function e(n,o){return n<=o}function r(n,o){return n>o}function i(n,o){return n>=o}X.sorterAsc=function(n,o){return n-o},X.sorterDes=function(n,o){return o-n},X.distinctVals=function(n){var o=n.slice();o.sort(X.sorterAsc);var a;for(a=o.length-1;a>-1&&o[a]===E;a--);for(var s=o[a]-o[0]||1,h=s/(a||1)/1e4,v=[],m,p=0;p<=a;p++){var y=o[p],l=y-m;m===void 0?(v.push(y),m=y):l>h&&(s=Math.min(s,l),v.push(y),m=y)}return{vals:v,minDiff:s}},X.roundUp=function(n,o,a){for(var s=0,h=o.length-1,v,m=0,p=a?0:1,y=a?1:0,l=a?Math.ceil:Math.floor;s<h&&m++<100;)v=l((s+h)/2),o[v]<=n?s=v+p:h=v-y;return o[s]},X.sort=function(n,o){for(var a=0,s=0,h=1;h<n.length;h++){var v=o(n[h],n[h-1]);if(v<0?a=1:v>0&&(s=1),a&&s)return n.sort(o)}return s?n:n.reverse()},X.findIndexOfMin=function(n,o){o=o||g;for(var a=1/0,s,h=0;h<n.length;h++){var v=o(n[h]);v<a&&(a=v,s=h)}return s}}),Td=Vt((X,V)=>{V.exports=function(c){return Object.keys(c).sort()}}),gk=Vt(X=>{var V=vo(),c=nf().isArrayOrTypedArray;X.aggNums=function(g,E,A,t){var e,r;if((!t||t>A.length)&&(t=A.length),V(E)||(E=!1),c(A[0])){for(r=new Array(t),e=0;e<t;e++)r[e]=X.aggNums(g,E,A[e]);A=r}for(e=0;e<t;e++)V(E)?V(A[e])&&(E=g(+E,+A[e])):E=A[e];return E},X.len=function(g){return X.aggNums(function(E){return E+1},0,g)},X.mean=function(g,E){return E||(E=X.len(g)),X.aggNums(function(A,t){return A+t},0,g)/E},X.geometricMean=function(g,E){return E||(E=X.len(g)),Math.pow(X.aggNums(function(A,t){return A*t},1,g),1/E)},X.midRange=function(g){if(!(g===void 0||g.length===0))return(X.aggNums(Math.max,null,g)+X.aggNums(Math.min,null,g))/2},X.variance=function(g,E,A){return E||(E=X.len(g)),V(A)||(A=X.mean(g,E)),X.aggNums(function(t,e){return t+Math.pow(e-A,2)},0,g)/E},X.stdev=function(g,E,A){return Math.sqrt(X.variance(g,E,A))},X.median=function(g){var E=g.slice().sort();return X.interp(E,.5)},X.interp=function(g,E){if(!V(E))throw"n should be a finite number";if(E=E*g.length-.5,E<0)return g[0];if(E>g.length-1)return g[g.length-1];var A=E%1;return A*g[Math.ceil(E)]+(1-A)*g[Math.floor(E)]}}),mk=Vt((X,V)=>{var c=pg(),g=c.mod,E=c.modHalf,A=Math.PI,t=2*A;function e(y){return y/180*A}function r(y){return y/A*180}function i(y){return Math.abs(y[1]-y[0])>t-1e-14}function n(y,l){return E(l-y,t)}function o(y,l){return Math.abs(n(y,l))}function a(y,l){if(i(l))return!0;var x,b;l[0]<l[1]?(x=l[0],b=l[1]):(x=l[1],b=l[0]),x=g(x,t),b=g(b,t),x>b&&(b+=t);var S=g(y,t),T=S+t;return S>=x&&S<=b||T>=x&&T<=b}function s(y,l,x,b){if(!a(l,b))return!1;var S,T;return x[0]<x[1]?(S=x[0],T=x[1]):(S=x[1],T=x[0]),y>=S&&y<=T}function h(y,l,x,b,S,T,M){S=S||0,T=T||0;var w=i([x,b]),u,f,k,_,D;w?(u=0,f=A,k=t):x<b?(u=x,k=b):(u=b,k=x),y<l?(_=y,D=l):(_=l,D=y);function I(L,F){return[L*Math.cos(F)+S,T-L*Math.sin(F)]}var O=Math.abs(k-u)<=A?0:1;function B(L,F,N){return"A"+[L,L]+" "+[0,O,N]+" "+I(L,F)}var R;return w?_===null?R="M"+I(D,u)+B(D,f,0)+B(D,k,0)+"Z":R="M"+I(_,u)+B(_,f,0)+B(_,k,0)+"ZM"+I(D,u)+B(D,f,1)+B(D,k,1)+"Z":_===null?(R="M"+I(D,u)+B(D,k,0),M&&(R+="L0,0Z")):R="M"+I(_,u)+"L"+I(D,u)+B(D,k,0)+"L"+I(_,k)+B(_,u,1)+"Z",R}function v(y,l,x,b,S){return h(null,y,l,x,b,S,0)}function m(y,l,x,b,S){return h(null,y,l,x,b,S,1)}function p(y,l,x,b,S,T){return h(y,l,x,b,S,T,1)}V.exports={deg2rad:e,rad2deg:r,angleDelta:n,angleDist:o,isFullCircle:i,isAngleInsideSector:a,isPtInsideSector:s,pathArc:v,pathSector:m,pathAnnulus:p}}),vk=Vt(X=>{X.isLeftAnchor=function(V){return V.xanchor==="left"||V.xanchor==="auto"&&V.x<=1/3},X.isCenterAnchor=function(V){return V.xanchor==="center"||V.xanchor==="auto"&&V.x>1/3&&V.x<2/3},X.isRightAnchor=function(V){return V.xanchor==="right"||V.xanchor==="auto"&&V.x>=2/3},X.isTopAnchor=function(V){return V.yanchor==="top"||V.yanchor==="auto"&&V.y>=2/3},X.isMiddleAnchor=function(V){return V.yanchor==="middle"||V.yanchor==="auto"&&V.y>1/3&&V.y<2/3},X.isBottomAnchor=function(V){return V.yanchor==="bottom"||V.yanchor==="auto"&&V.y<=1/3}}),yk=Vt(X=>{var V=pg().mod;X.segmentsIntersect=c;function c(e,r,i,n,o,a,s,h){var v=i-e,m=o-e,p=s-o,y=n-r,l=a-r,x=h-a,b=v*x-p*y;if(b===0)return null;var S=(m*x-p*l)/b,T=(m*y-v*l)/b;return T<0||T>1||S<0||S>1?null:{x:e+v*S,y:r+y*S}}X.segmentDistance=function(e,r,i,n,o,a,s,h){if(c(e,r,i,n,o,a,s,h))return 0;var v=i-e,m=n-r,p=s-o,y=h-a,l=v*v+m*m,x=p*p+y*y,b=Math.min(g(v,m,l,o-e,a-r),g(v,m,l,s-e,h-r),g(p,y,x,e-o,r-a),g(p,y,x,i-o,n-a));return Math.sqrt(b)};function g(e,r,i,n,o){var a=n*e+o*r;if(a<0)return n*n+o*o;if(a>i){var s=n-e,h=o-r;return s*s+h*h}else{var v=n*r-o*e;return v*v/i}}var E,A,t;X.getTextLocation=function(e,r,i,n){if((e!==A||n!==t)&&(E={},A=e,t=n),E[i])return E[i];var o=e.getPointAtLength(V(i-n/2,r)),a=e.getPointAtLength(V(i+n/2,r)),s=Math.atan((a.y-o.y)/(a.x-o.x)),h=e.getPointAtLength(V(i,r)),v=(h.x*4+o.x+a.x)/6,m=(h.y*4+o.y+a.y)/6,p={x:v,y:m,theta:s};return E[i]=p,p},X.clearLocationCache=function(){A=null},X.getVisibleSegment=function(e,r,i){var n=r.left,o=r.right,a=r.top,s=r.bottom,h=0,v=e.getTotalLength(),m=v,p,y;function l(b){var S=e.getPointAtLength(b);b===0?p=S:b===v&&(y=S);var T=S.x<n?n-S.x:S.x>o?S.x-o:0,M=S.y<a?a-S.y:S.y>s?S.y-s:0;return Math.sqrt(T*T+M*M)}for(var x=l(h);x;){if(h+=x+i,h>m)return;x=l(h)}for(x=l(m);x;){if(m-=x+i,h>m)return;x=l(m)}return{min:h,max:m,len:m-h,total:v,isClosed:h===0&&m===v&&Math.abs(p.x-y.x)<.1&&Math.abs(p.y-y.y)<.1}},X.findPointOnPath=function(e,r,i,n){n=n||{};for(var o=n.pathLength||e.getTotalLength(),a=n.tolerance||.001,s=n.iterationLimit||30,h=e.getPointAtLength(0)[i]>e.getPointAtLength(o)[i]?-1:1,v=0,m=0,p=o,y,l,x;v<s;){if(y=(m+p)/2,l=e.getPointAtLength(y),x=l[i]-r,Math.abs(x)<a)return l;h*x>0?p=y:m=y,v++}return l}}),By=Vt(X=>{var V={};X.throttle=function(g,E,A){var t=V[g],e=Date.now();if(!t){for(var r in V)V[r].ts<e-6e4&&delete V[r];t=V[g]={ts:0,timer:null}}c(t);function i(){A(),t.ts=Date.now(),t.onDone&&(t.onDone(),t.onDone=null)}if(e>t.ts+E){i();return}t.timer=setTimeout(function(){i(),t.timer=null},E)},X.done=function(g){var E=V[g];return!E||!E.timer?Promise.resolve():new Promise(function(A){var t=E.onDone;E.onDone=function(){t&&t(),A(),E.onDone=null}})},X.clear=function(g){if(g)c(V[g]),delete V[g];else for(var E in V)X.clear(E)};function c(g){g&&g.timer!==null&&(clearTimeout(g.timer),g.timer=null)}}),xk=Vt((X,V)=>{V.exports=function(c){c._responsiveChartHandler&&(window.removeEventListener("resize",c._responsiveChartHandler),delete c._responsiveChartHandler)}}),_k=Vt((X,V)=>{V.exports=A,V.exports.isMobile=A,V.exports.default=A;var c=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,g=/CrOS/,E=/android|ipad|playbook|silk/i;function A(t){t||(t={});let e=t.ua;if(!e&&typeof navigator<"u"&&(e=navigator.userAgent),e&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string")return!1;let r=c.test(e)&&!g.test(e)||!!t.tablet&&E.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.indexOf("Macintosh")!==-1&&e.indexOf("Safari")!==-1&&(r=!0),r}}),bk=Vt((X,V)=>{var c=vo(),g=_k();V.exports=function(A){var t;if(A&&A.hasOwnProperty("userAgent")?t=A.userAgent:t=E(),typeof t!="string")return!0;var e=g({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!e)for(var r=t.split(" "),i=1;i<r.length;i++){var n=r[i];if(n.indexOf("Safari")!==-1)for(var o=i-1;o>-1;o--){var a=r[o];if(a.substr(0,8)==="Version/"){var s=a.substr(8).split(".")[0];if(c(s)&&(s=+s),s>=13)return!0}}}return e};function E(){var A;return typeof navigator<"u"&&(A=navigator.userAgent),A&&A.headers&&typeof A.headers["user-agent"]=="string"&&(A=A.headers["user-agent"]),A}}),wk=Vt((X,V)=>{var c=Ai();V.exports=function(g,E,A){var t=g.selectAll("g."+A.replace(/\s/g,".")).data(E,function(r){return r[0].trace.uid});t.exit().remove(),t.enter().append("g").attr("class",A),t.order();var e=g.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(r){r[0][e]=c.select(this)}),t}}),Tk=Vt((X,V)=>{var c=Mi();V.exports=function(g,E){for(var A=g._context.locale,t=0;t<2;t++){for(var e=g._context.locales,r=0;r<2;r++){var i=(e[A]||{}).dictionary;if(i){var n=i[E];if(n)return n}e=c.localeRegistry}var o=A.split("-")[0];if(o===A)break;A=o}return E}}),Q_=Vt((X,V)=>{V.exports=function(c){for(var g={},E=[],A=0,t=0;t<c.length;t++){var e=c[t];g[e]!==1&&(g[e]=1,E[A++]=e)}return E}}),kk=Vt((X,V)=>{V.exports=function(A){for(var t=E(A)?g:c,e=[],r=0;r<A.length;r++){var i=A[r];t(i)&&e.push(i)}return e};function c(A){return A.visible===!0}function g(A){var t=A[0].trace;return t.visible===!0&&t._length!==0}function E(A){return Array.isArray(A)&&Array.isArray(A[0])&&A[0][0]&&A[0][0].trace}}),Ak=Vt((X,V)=>{V.exports=function(c,g){if(!g)return c;var E=1/Math.abs(g),A=E>1?(E*c+E*g)/E:c+g,t=String(A).length;if(t>16){var e=String(g).length,r=String(c).length;if(t>=r+e){var i=parseFloat(A).toPrecision(12);i.indexOf("e+")===-1&&(A=+i)}}return A}}),Mk=Vt((X,V)=>{var c=vo(),g=ts().BADNUM,E=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;V.exports=function(A){return typeof A=="string"&&(A=A.replace(E,"")),c(A)?Number(A):g}}),qr=Vt((X,V)=>{var c=Ai(),g=fg().utcFormat,E=q_().format,A=vo(),t=ts(),e=t.FP_SAFE,r=-e,i=t.BADNUM,n=V.exports={};n.adjustFormat=function(nt){return!nt||/^\d[.]\df/.test(nt)||/[.]\d%/.test(nt)?nt:nt==="0.f"?"~f":/^\d%/.test(nt)?"~%":/^\ds/.test(nt)?"~s":!/^[~,.0$]/.test(nt)&&/[&fps]/.test(nt)?"~"+nt:nt};var o={};n.warnBadFormat=function(nt){var Y=String(nt);o[Y]||(o[Y]=1,n.warn('encountered bad format: "'+Y+'"'))},n.noFormat=function(nt){return String(nt)},n.numberFormat=function(nt){var Y;try{Y=E(n.adjustFormat(nt))}catch{return n.warnBadFormat(nt),n.noFormat}return Y},n.nestedProperty=Im(),n.keyedContainer=CT(),n.relativeAttr=DT(),n.isPlainObject=jp(),n.toLogRange=Ly(),n.relinkPrivateKeys=zT();var a=nf();n.isArrayBuffer=a.isArrayBuffer,n.isTypedArray=a.isTypedArray,n.isArrayOrTypedArray=a.isArrayOrTypedArray,n.isArray1D=a.isArray1D,n.ensureArray=a.ensureArray,n.concat=a.concat,n.maxRowLength=a.maxRowLength,n.minRowLength=a.minRowLength;var s=pg();n.mod=s.mod,n.modHalf=s.modHalf;var h=OT();n.valObjectMeta=h.valObjectMeta,n.coerce=h.coerce,n.coerce2=h.coerce2,n.coerceFont=h.coerceFont,n.coercePattern=h.coercePattern,n.coerceHoverinfo=h.coerceHoverinfo,n.coerceSelectionMarkerOpacity=h.coerceSelectionMarkerOpacity,n.validate=h.validate;var v=dk();n.dateTime2ms=v.dateTime2ms,n.isDateTime=v.isDateTime,n.ms2DateTime=v.ms2DateTime,n.ms2DateTimeLocal=v.ms2DateTimeLocal,n.cleanDate=v.cleanDate,n.isJSDate=v.isJSDate,n.formatDate=v.formatDate,n.incrementMonth=v.incrementMonth,n.dateTick0=v.dateTick0,n.dfltRange=v.dfltRange,n.findExactDates=v.findExactDates,n.MIN_MS=v.MIN_MS,n.MAX_MS=v.MAX_MS;var m=Fy();n.findBin=m.findBin,n.sorterAsc=m.sorterAsc,n.sorterDes=m.sorterDes,n.distinctVals=m.distinctVals,n.roundUp=m.roundUp,n.sort=m.sort,n.findIndexOfMin=m.findIndexOfMin,n.sortObjectKeys=Td();var p=gk();n.aggNums=p.aggNums,n.len=p.len,n.mean=p.mean,n.geometricMean=p.geometricMean,n.median=p.median,n.midRange=p.midRange,n.variance=p.variance,n.stdev=p.stdev,n.interp=p.interp;var y=Dy();n.init2dArray=y.init2dArray,n.transposeRagged=y.transposeRagged,n.dot=y.dot,n.translationMatrix=y.translationMatrix,n.rotationMatrix=y.rotationMatrix,n.rotationXYMatrix=y.rotationXYMatrix,n.apply3DTransform=y.apply3DTransform,n.apply2DTransform=y.apply2DTransform,n.apply2DTransform2=y.apply2DTransform2,n.convertCssMatrix=y.convertCssMatrix,n.inverseTransformMatrix=y.inverseTransformMatrix;var l=mk();n.deg2rad=l.deg2rad,n.rad2deg=l.rad2deg,n.angleDelta=l.angleDelta,n.angleDist=l.angleDist,n.isFullCircle=l.isFullCircle,n.isAngleInsideSector=l.isAngleInsideSector,n.isPtInsideSector=l.isPtInsideSector,n.pathArc=l.pathArc,n.pathSector=l.pathSector,n.pathAnnulus=l.pathAnnulus;var x=vk();n.isLeftAnchor=x.isLeftAnchor,n.isCenterAnchor=x.isCenterAnchor,n.isRightAnchor=x.isRightAnchor,n.isTopAnchor=x.isTopAnchor,n.isMiddleAnchor=x.isMiddleAnchor,n.isBottomAnchor=x.isBottomAnchor;var b=yk();n.segmentsIntersect=b.segmentsIntersect,n.segmentDistance=b.segmentDistance,n.getTextLocation=b.getTextLocation,n.clearLocationCache=b.clearLocationCache,n.getVisibleSegment=b.getVisibleSegment,n.findPointOnPath=b.findPointOnPath;var S=po();n.extendFlat=S.extendFlat,n.extendDeep=S.extendDeep,n.extendDeepAll=S.extendDeepAll,n.extendDeepNoArrays=S.extendDeepNoArrays;var T=wd();n.log=T.log,n.warn=T.warn,n.error=T.error;var M=gg();n.counterRegex=M.counter;var w=By();n.throttle=w.throttle,n.throttleDone=w.done,n.clearThrottle=w.clear;var u=Cm();n.getGraphDiv=u.getGraphDiv,n.isPlotDiv=u.isPlotDiv,n.removeElement=u.removeElement,n.addStyleRule=u.addStyleRule,n.addRelatedStyleRule=u.addRelatedStyleRule,n.deleteRelatedStyleRule=u.deleteRelatedStyleRule,n.setStyleOnHover=u.setStyleOnHover,n.getFullTransformMatrix=u.getFullTransformMatrix,n.getElementTransformMatrix=u.getElementTransformMatrix,n.getElementAndAncestors=u.getElementAndAncestors,n.equalDomRects=u.equalDomRects,n.clearResponsive=xk(),n.preserveDrawingBuffer=bk(),n.makeTraceGroups=wk(),n._=Tk(),n.notifier=G_(),n.filterUnique=Q_(),n.filterVisible=kk(),n.pushUnique=W_(),n.increment=Ak(),n.cleanNumber=Mk(),n.ensureNumber=function(nt){return A(nt)?(nt=Number(nt),nt>e||nt<r?i:nt):i},n.isIndex=function(nt,Y){return Y!==void 0&&nt>=Y?!1:A(nt)&&nt>=0&&nt%1===0},n.noop=Cy(),n.identity=zm(),n.repeat=function(nt,Y){for(var q=new Array(Y),ot=0;ot<Y;ot++)q[ot]=nt;return q},n.swapAttrs=function(nt,Y,q,ot){q||(q="x"),ot||(ot="y");for(var it=0;it<Y.length;it++){var dt=Y[it],wt=n.nestedProperty(nt,dt.replace("?",q)),xt=n.nestedProperty(nt,dt.replace("?",ot)),Ft=wt.get();wt.set(xt.get()),xt.set(Ft)}},n.raiseToTop=function(nt){nt.parentNode.appendChild(nt)},n.cancelTransition=function(nt){return nt.transition().duration(0)},n.constrain=function(nt,Y,q){return Y>q?Math.max(q,Math.min(Y,nt)):Math.max(Y,Math.min(q,nt))},n.bBoxIntersect=function(nt,Y,q){return q=q||0,nt.left<=Y.right+q&&Y.left<=nt.right+q&&nt.top<=Y.bottom+q&&Y.top<=nt.bottom+q},n.simpleMap=function(nt,Y,q,ot,it){for(var dt=nt.length,wt=new Array(dt),xt=0;xt<dt;xt++)wt[xt]=Y(nt[xt],q,ot,it);return wt},n.randstr=function nt(Y,q,ot,it){if(ot||(ot=16),q===void 0&&(q=24),q<=0)return"0";var dt=Math.log(Math.pow(2,q))/Math.log(ot),wt="",xt,Ft,Et;for(xt=2;dt===1/0;xt*=2)dt=Math.log(Math.pow(2,q/xt))/Math.log(ot)*xt;var Nt=dt-Math.floor(dt);for(xt=0;xt<Math.floor(dt);xt++)Et=Math.floor(Math.random()*ot).toString(ot),wt=Et+wt;Nt&&(Ft=Math.pow(ot,Nt),Et=Math.floor(Math.random()*Ft).toString(ot),wt=Et+wt);var te=parseInt(wt,ot);return Y&&Y[wt]||te!==1/0&&te>=Math.pow(2,q)?it>10?(n.warn("randstr failed uniqueness"),wt):nt(Y,q,ot,(it||0)+1):wt},n.OptionControl=function(nt,Y){nt||(nt={}),Y||(Y="opt");var q={};return q.optionList=[],q._newoption=function(ot){ot[Y]=nt,q[ot.name]=ot,q.optionList.push(ot)},q["_"+Y]=nt,q},n.smooth=function(nt,Y){if(Y=Math.round(Y)||0,Y<2)return nt;var q=nt.length,ot=2*q,it=2*Y-1,dt=new Array(it),wt=new Array(q),xt,Ft,Et,Nt;for(xt=0;xt<it;xt++)dt[xt]=(1-Math.cos(Math.PI*(xt+1)/Y))/(2*Y);for(xt=0;xt<q;xt++){for(Nt=0,Ft=0;Ft<it;Ft++)Et=xt+Ft+1-Y,Et<-q?Et-=ot*Math.round(Et/ot):Et>=ot&&(Et-=ot*Math.floor(Et/ot)),Et<0?Et=-1-Et:Et>=q&&(Et=ot-1-Et),Nt+=nt[Et]*dt[Ft];wt[xt]=Nt}return wt},n.syncOrAsync=function(nt,Y,q){var ot,it;function dt(){return n.syncOrAsync(nt,Y,q)}for(;nt.length;)if(it=nt.splice(0,1)[0],ot=it(Y),ot&&ot.then)return ot.then(dt);return q&&q(Y)},n.stripTrailingSlash=function(nt){return nt.substr(-1)==="/"?nt.substr(0,nt.length-1):nt},n.noneOrAll=function(nt,Y,q){if(nt){var ot=!1,it=!0,dt,wt;for(dt=0;dt<q.length;dt++)wt=nt[q[dt]],wt!=null?ot=!0:it=!1;if(ot&&!it)for(dt=0;dt<q.length;dt++)nt[q[dt]]=Y[q[dt]]}},n.mergeArray=function(nt,Y,q,ot){var it=typeof ot=="function";if(n.isArrayOrTypedArray(nt))for(var dt=Math.min(nt.length,Y.length),wt=0;wt<dt;wt++){var xt=nt[wt];Y[wt][q]=it?ot(xt):xt}},n.mergeArrayCastPositive=function(nt,Y,q){return n.mergeArray(nt,Y,q,function(ot){var it=+ot;return isFinite(it)&&it>0?it:0})},n.fillArray=function(nt,Y,q,ot){if(ot=ot||n.identity,n.isArrayOrTypedArray(nt))for(var it=0;it<Y.length;it++)Y[it][q]=ot(nt[it])},n.castOption=function(nt,Y,q,ot){ot=ot||n.identity;var it=n.nestedProperty(nt,q).get();return n.isArrayOrTypedArray(it)?Array.isArray(Y)&&n.isArrayOrTypedArray(it[Y[0]])?ot(it[Y[0]][Y[1]]):ot(it[Y]):it},n.extractOption=function(nt,Y,q,ot){if(q in nt)return nt[q];var it=n.nestedProperty(Y,ot).get();if(!Array.isArray(it))return it};function f(nt){var Y={};for(var q in nt)for(var ot=nt[q],it=0;it<ot.length;it++)Y[ot[it]]=+q;return Y}n.tagSelected=function(nt,Y,q){var ot=Y.selectedpoints,it=Y._indexToPoints,dt;it&&(dt=f(it));function wt(te){return te!==void 0&&te<nt.length}for(var xt=0;xt<ot.length;xt++){var Ft=ot[xt];if(n.isIndex(Ft)||n.isArrayOrTypedArray(Ft)&&n.isIndex(Ft[0])&&n.isIndex(Ft[1])){var Et=dt?dt[Ft]:Ft,Nt=q?q[Et]:Et;wt(Nt)&&(nt[Nt].selected=1)}}},n.selIndices2selPoints=function(nt){var Y=nt.selectedpoints,q=nt._indexToPoints;if(q){for(var ot=f(q),it=[],dt=0;dt<Y.length;dt++){var wt=Y[dt];if(n.isIndex(wt)){var xt=ot[wt];n.isIndex(xt)&&it.push(xt)}}return it}else return Y},n.getTargetArray=function(nt,Y){var q=Y.target;if(typeof q=="string"&&q){var ot=n.nestedProperty(nt,q).get();return n.isArrayOrTypedArray(ot)?ot:!1}else if(n.isArrayOrTypedArray(q))return q;return!1};function k(nt,Y,q){var ot={};typeof Y!="object"&&(Y={});var it=q==="pieLike"?-1:3,dt=Object.keys(nt),wt,xt,Ft;for(wt=0;wt<dt.length;wt++)xt=dt[wt],Ft=nt[xt],!(xt.charAt(0)==="_"||typeof Ft=="function")&&(xt==="module"?ot[xt]=Ft:Array.isArray(Ft)?xt==="colorscale"||it===-1?ot[xt]=Ft.slice():ot[xt]=Ft.slice(0,it):n.isTypedArray(Ft)?it===-1?ot[xt]=Ft.subarray():ot[xt]=Ft.subarray(0,it):Ft&&typeof Ft=="object"?ot[xt]=k(nt[xt],Y[xt],q):ot[xt]=Ft);for(dt=Object.keys(Y),wt=0;wt<dt.length;wt++)xt=dt[wt],Ft=Y[xt],(typeof Ft!="object"||!(xt in ot)||typeof ot[xt]!="object")&&(ot[xt]=Ft);return ot}n.minExtend=k,n.titleCase=function(nt){return nt.charAt(0).toUpperCase()+nt.substr(1)},n.containsAny=function(nt,Y){for(var q=0;q<Y.length;q++)if(nt.indexOf(Y[q])!==-1)return!0;return!1};var _=/Version\/[\d\.]+.*Safari/;n.isSafari=function(){return _.test(window.navigator.userAgent)};var D=/iPad|iPhone|iPod/;n.isIOS=function(){return D.test(window.navigator.userAgent)};var I=/Firefox\/(\d+)\.\d+/;n.getFirefoxVersion=function(){var nt=I.exec(window.navigator.userAgent);if(nt&&nt.length===2){var Y=parseInt(nt[1]);if(!isNaN(Y))return Y}return null},n.isD3Selection=function(nt){return nt instanceof c.selection},n.ensureSingle=function(nt,Y,q,ot){var it=nt.select(Y+(q?"."+q:""));if(it.size())return it;var dt=nt.append(Y);return q&&dt.classed(q,!0),ot&&dt.call(ot),dt},n.ensureSingleById=function(nt,Y,q,ot){var it=nt.select(Y+"#"+q);if(it.size())return it;var dt=nt.append(Y).attr("id",q);return ot&&dt.call(ot),dt},n.objectFromPath=function(nt,Y){for(var q=nt.split("."),ot,it=ot={},dt=0;dt<q.length;dt++){var wt=q[dt],xt=null,Ft=q[dt].match(/(.*)\[([0-9]+)\]/);Ft?(wt=Ft[1],xt=Ft[2],ot=ot[wt]=[],dt===q.length-1?ot[xt]=Y:ot[xt]={},ot=ot[xt]):(dt===q.length-1?ot[wt]=Y:ot[wt]={},ot=ot[wt])}return it};var O=/^([^\[\.]+)\.(.+)?/,B=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function R(nt){return nt.slice(0,2)==="__"}n.expandObjectPaths=function(nt){var Y,q,ot,it,dt,wt,xt;if(typeof nt=="object"&&!Array.isArray(nt)){for(q in nt)if(nt.hasOwnProperty(q))if(Y=q.match(O)){if(it=nt[q],ot=Y[1],R(ot))continue;delete nt[q],nt[ot]=n.extendDeepNoArrays(nt[ot]||{},n.objectFromPath(q,n.expandObjectPaths(it))[ot])}else if(Y=q.match(B)){if(it=nt[q],ot=Y[1],R(ot))continue;if(dt=parseInt(Y[2]),delete nt[q],nt[ot]=nt[ot]||[],Y[3]===".")xt=Y[4],wt=nt[ot][dt]=nt[ot][dt]||{},n.extendDeepNoArrays(wt,n.objectFromPath(xt,n.expandObjectPaths(it)));else{if(R(ot))continue;nt[ot][dt]=n.expandObjectPaths(it)}}else{if(R(q))continue;nt[q]=n.expandObjectPaths(nt[q])}}return nt},n.numSeparate=function(nt,Y,q){if(q||(q=!1),typeof Y!="string"||Y.length===0)throw new Error("Separator string required for formatting!");typeof nt=="number"&&(nt=String(nt));var ot=/(\d+)(\d{3})/,it=Y.charAt(0),dt=Y.charAt(1),wt=nt.split("."),xt=wt[0],Ft=wt.length>1?it+wt[1]:"";if(dt&&(wt.length>1||xt.length>4||q))for(;ot.test(xt);)xt=xt.replace(ot,"$1"+dt+"$2");return xt+Ft},n.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var L=/^\w*$/;n.templateString=function(nt,Y){var q={};return nt.replace(n.TEMPLATE_STRING_REGEX,function(ot,it){var dt;return L.test(it)?dt=Y[it]:(q[it]=q[it]||n.nestedProperty(Y,it).get,dt=q[it]()),n.isValidTextValue(dt)?dt:""})};var F={max:10,count:0,name:"hovertemplate"};n.hovertemplateString=function(){return lt.apply(F,arguments)};var N={max:10,count:0,name:"texttemplate"};n.texttemplateString=function(){return lt.apply(N,arguments)};var j=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function G(nt){var Y=nt.match(j);return Y?{key:Y[1],op:Y[2],number:Number(Y[3])}:{key:nt,op:null,number:null}}var rt={max:10,count:0,name:"texttemplate",parseMultDiv:!0};n.texttemplateStringForShapes=function(){return lt.apply(rt,arguments)};var ct=/^[:|\|]/;function lt(nt,Y,q){var ot=this,it=arguments;Y||(Y={});var dt={};return nt.replace(n.TEMPLATE_STRING_REGEX,function(wt,xt,Ft){var Et=xt==="xother"||xt==="yother",Nt=xt==="_xother"||xt==="_yother",te=xt==="_xother_"||xt==="_yother_",Jt=xt==="xother_"||xt==="yother_",Qt=Et||Nt||Jt||te,Wt=xt;(Nt||te)&&(Wt=Wt.substring(1)),(Jt||te)&&(Wt=Wt.substring(0,Wt.length-1));var gt=null,bt=null;if(ot.parseMultDiv){var vt=G(Wt);Wt=vt.key,gt=vt.op,bt=vt.number}var Ut;if(Qt){if(Ut=Y[Wt],Ut===void 0)return""}else{var Kt,Zt;for(Zt=3;Zt<it.length;Zt++)if(Kt=it[Zt],!!Kt){if(Kt.hasOwnProperty(Wt)){Ut=Kt[Wt];break}if(L.test(Wt)||(Ut=n.nestedProperty(Kt,Wt).get(),Ut=dt[Wt]||n.nestedProperty(Kt,Wt).get(),Ut&&(dt[Wt]=Ut)),Ut!==void 0)break}}if(Ut!==void 0&&(gt==="*"&&(Ut*=bt),gt==="/"&&(Ut/=bt)),Ut===void 0&&ot)return ot.count<ot.max&&(n.warn("Variable '"+Wt+"' in "+ot.name+" could not be found!"),Ut=wt),ot.count===ot.max&&n.warn("Too many "+ot.name+" warnings - additional warnings will be suppressed"),ot.count++,wt;if(Ft){var le;if(Ft[0]===":"&&(le=q?q.numberFormat:n.numberFormat,Ut!==""&&(Ut=le(Ft.replace(ct,""))(Ut))),Ft[0]==="|"){le=q?q.timeFormat:g;var Te=n.dateTime2ms(Ut);Ut=n.formatDate(Te,Ft.replace(ct,""),!1,le)}}else{var Se=Wt+"Label";Y.hasOwnProperty(Se)&&(Ut=Y[Se])}return Qt&&(Ut="("+Ut+")",(Nt||te)&&(Ut=" "+Ut),(Jt||te)&&(Ut=Ut+" ")),Ut})}var tt=48,Z=57;n.subplotSort=function(nt,Y){for(var q=Math.min(nt.length,Y.length)+1,ot=0,it=0,dt=0;dt<q;dt++){var wt=nt.charCodeAt(dt)||0,xt=Y.charCodeAt(dt)||0,Ft=wt>=tt&&wt<=Z,Et=xt>=tt&&xt<=Z;if(Ft&&(ot=10*ot+wt-tt),Et&&(it=10*it+xt-tt),!Ft||!Et){if(ot!==it)return ot-it;if(wt!==xt)return wt-xt}}return it-ot};var st=2e9;n.seedPseudoRandom=function(){st=2e9},n.pseudoRandom=function(){var nt=st;return st=(69069*st+1)%4294967296,Math.abs(st-nt)<429496729?n.pseudoRandom():st/4294967296},n.fillText=function(nt,Y,q){var ot=Array.isArray(q)?function(wt){q.push(wt)}:function(wt){q.text=wt},it=n.extractOption(nt,Y,"htx","hovertext");if(n.isValidTextValue(it))return ot(it);var dt=n.extractOption(nt,Y,"tx","text");if(n.isValidTextValue(dt))return ot(dt)},n.isValidTextValue=function(nt){return nt||nt===0},n.formatPercent=function(nt,Y){Y=Y||0;for(var q=(Math.round(100*nt*Math.pow(10,Y))*Math.pow(.1,Y)).toFixed(Y)+"%",ot=0;ot<Y;ot++)q.indexOf(".")!==-1&&(q=q.replace("0%","%"),q=q.replace(".%","%"));return q},n.isHidden=function(nt){var Y=window.getComputedStyle(nt).display;return!Y||Y==="none"},n.strTranslate=function(nt,Y){return nt||Y?"translate("+nt+","+Y+")":""},n.strRotate=function(nt){return nt?"rotate("+nt+")":""},n.strScale=function(nt){return nt!==1?"scale("+nt+")":""},n.getTextTransform=function(nt){var Y=nt.noCenter,q=nt.textX,ot=nt.textY,it=nt.targetX,dt=nt.targetY,wt=nt.anchorX||0,xt=nt.anchorY||0,Ft=nt.rotate,Et=nt.scale;return Et?Et>1&&(Et=1):Et=0,n.strTranslate(it-Et*(q+wt),dt-Et*(ot+xt))+n.strScale(Et)+(Ft?"rotate("+Ft+(Y?"":" "+q+" "+ot)+")":"")},n.setTransormAndDisplay=function(nt,Y){nt.attr("transform",n.getTextTransform(Y)),nt.style("display",Y.scale?null:"none")},n.ensureUniformFontSize=function(nt,Y){var q=n.extendFlat({},Y);return q.size=Math.max(Y.size,nt._fullLayout.uniformtext.minsize||0),q},n.join2=function(nt,Y,q){var ot=nt.length;return ot>1?nt.slice(0,-1).join(Y)+q+nt[ot-1]:nt.join(Y)},n.bigFont=function(nt){return Math.round(1.2*nt)};var $=n.getFirefoxVersion(),Q=$!==null&&$<86;n.getPositionFromD3Event=function(){return Q?[c.event.layerX,c.event.layerY]:[c.event.offsetX,c.event.offsetY]}}),Sk=Vt(()=>{var X=qr(),V={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(g in V)c=g.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),X.addStyleRule(c,V[g]);var c,g}),Y_=Vt((X,V)=>{V.exports=!0}),K_=Vt((X,V)=>{var c=Y_(),g;typeof window.matchMedia=="function"?g=!window.matchMedia("(hover: none)").matches:g=c,V.exports=g}),s0=Vt((X,V)=>{var c=typeof Reflect=="object"?Reflect:null,g=c&&typeof c.apply=="function"?c.apply:function(S,T,M){return Function.prototype.apply.call(S,T,M)},E;c&&typeof c.ownKeys=="function"?E=c.ownKeys:Object.getOwnPropertySymbols?E=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:E=function(S){return Object.getOwnPropertyNames(S)};function A(S){console&&console.warn&&console.warn(S)}var t=Number.isNaN||function(S){return S!==S};function e(){e.init.call(this)}V.exports=e,V.exports.once=l,e.EventEmitter=e,e.prototype._events=void 0,e.prototype._eventsCount=0,e.prototype._maxListeners=void 0;var r=10;function i(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(e,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(S){if(typeof S!="number"||S<0||t(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");r=S}}),e.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},e.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||t(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function n(S){return S._maxListeners===void 0?e.defaultMaxListeners:S._maxListeners}e.prototype.getMaxListeners=function(){return n(this)},e.prototype.emit=function(S){for(var T=[],M=1;M<arguments.length;M++)T.push(arguments[M]);var w=S==="error",u=this._events;if(u!==void 0)w=w&&u.error===void 0;else if(!w)return!1;if(w){var f;if(T.length>0&&(f=T[0]),f instanceof Error)throw f;var k=new Error("Unhandled error."+(f?" ("+f.message+")":""));throw k.context=f,k}var _=u[S];if(_===void 0)return!1;if(typeof _=="function")g(_,this,T);else for(var D=_.length,I=m(_,D),M=0;M<D;++M)g(I[M],this,T);return!0};function o(S,T,M,w){var u,f,k;if(i(M),f=S._events,f===void 0?(f=S._events=Object.create(null),S._eventsCount=0):(f.newListener!==void 0&&(S.emit("newListener",T,M.listener?M.listener:M),f=S._events),k=f[T]),k===void 0)k=f[T]=M,++S._eventsCount;else if(typeof k=="function"?k=f[T]=w?[M,k]:[k,M]:w?k.unshift(M):k.push(M),u=n(S),u>0&&k.length>u&&!k.warned){k.warned=!0;var _=new Error("Possible EventEmitter memory leak detected. "+k.length+" "+String(T)+" listeners added. Use emitter.setMaxListeners() to increase limit");_.name="MaxListenersExceededWarning",_.emitter=S,_.type=T,_.count=k.length,A(_)}return S}e.prototype.addListener=function(S,T){return o(this,S,T,!1)},e.prototype.on=e.prototype.addListener,e.prototype.prependListener=function(S,T){return o(this,S,T,!0)};function a(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(S,T,M){var w={fired:!1,wrapFn:void 0,target:S,type:T,listener:M},u=a.bind(w);return u.listener=M,w.wrapFn=u,u}e.prototype.once=function(S,T){return i(T),this.on(S,s(this,S,T)),this},e.prototype.prependOnceListener=function(S,T){return i(T),this.prependListener(S,s(this,S,T)),this},e.prototype.removeListener=function(S,T){var M,w,u,f,k;if(i(T),w=this._events,w===void 0)return this;if(M=w[S],M===void 0)return this;if(M===T||M.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete w[S],w.removeListener&&this.emit("removeListener",S,M.listener||T));else if(typeof M!="function"){for(u=-1,f=M.length-1;f>=0;f--)if(M[f]===T||M[f].listener===T){k=M[f].listener,u=f;break}if(u<0)return this;u===0?M.shift():p(M,u),M.length===1&&(w[S]=M[0]),w.removeListener!==void 0&&this.emit("removeListener",S,k||T)}return this},e.prototype.off=e.prototype.removeListener,e.prototype.removeAllListeners=function(S){var T,M,w;if(M=this._events,M===void 0)return this;if(M.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):M[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete M[S]),this;if(arguments.length===0){var u=Object.keys(M),f;for(w=0;w<u.length;++w)f=u[w],f!=="removeListener"&&this.removeAllListeners(f);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=M[S],typeof T=="function")this.removeListener(S,T);else if(T!==void 0)for(w=T.length-1;w>=0;w--)this.removeListener(S,T[w]);return this};function h(S,T,M){var w=S._events;if(w===void 0)return[];var u=w[T];return u===void 0?[]:typeof u=="function"?M?[u.listener||u]:[u]:M?y(u):m(u,u.length)}e.prototype.listeners=function(S){return h(this,S,!0)},e.prototype.rawListeners=function(S){return h(this,S,!1)},e.listenerCount=function(S,T){return typeof S.listenerCount=="function"?S.listenerCount(T):v.call(S,T)},e.prototype.listenerCount=v;function v(S){var T=this._events;if(T!==void 0){var M=T[S];if(typeof M=="function")return 1;if(M!==void 0)return M.length}return 0}e.prototype.eventNames=function(){return this._eventsCount>0?E(this._events):[]};function m(S,T){for(var M=new Array(T),w=0;w<T;++w)M[w]=S[w];return M}function p(S,T){for(;T+1<S.length;T++)S[T]=S[T+1];S.pop()}function y(S){for(var T=new Array(S.length),M=0;M<T.length;++M)T[M]=S[M].listener||S[M];return T}function l(S,T){return new Promise(function(M,w){function u(k){S.removeListener(T,f),w(k)}function f(){typeof S.removeListener=="function"&&S.removeListener("error",u),M([].slice.call(arguments))}b(S,T,f,{once:!0}),T!=="error"&&x(S,u,{once:!0})})}function x(S,T,M){typeof S.on=="function"&&b(S,"error",T,M)}function b(S,T,M,w){if(typeof S.on=="function")w.once?S.once(T,M):S.on(T,M);else if(typeof S.addEventListener=="function")S.addEventListener(T,function u(f){w.once&&S.removeEventListener(T,u),M(f)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}}),vg=Vt((X,V)=>{var c=s0().EventEmitter,g={init:function(E){if(E._ev instanceof c)return E;var A=new c,t=new c;return E._ev=A,E._internalEv=t,E.on=A.on.bind(A),E.once=A.once.bind(A),E.removeListener=A.removeListener.bind(A),E.removeAllListeners=A.removeAllListeners.bind(A),E._internalOn=t.on.bind(t),E._internalOnce=t.once.bind(t),E._removeInternalListener=t.removeListener.bind(t),E._removeAllInternalListeners=t.removeAllListeners.bind(t),E.emit=function(e,r){A.emit(e,r),t.emit(e,r)},E},triggerHandler:function(E,A,t){var e,r=E._ev;if(!r)return;var i=r._events[A];if(!i)return;function n(a){if(a.listener){if(r.removeListener(A,a.listener),!a.fired)return a.fired=!0,a.listener.apply(r,[t])}else return a.apply(r,[t])}i=Array.isArray(i)?i:[i];var o;for(o=0;o<i.length-1;o++)n(i[o]);return e=n(i[o]),e},purge:function(E){return delete E._ev,delete E.on,delete E.once,delete E.removeListener,delete E.removeAllListeners,delete E.emit,delete E._ev,delete E._internalEv,delete E._internalOn,delete E._internalOnce,delete E._removeInternalListener,delete E._removeAllInternalListeners,E}};V.exports=g}),Ek=Vt((X,V)=>{var c=qr(),g=o0().dfltConfig;function E(t,e){for(var r=[],i,n=0;n<e.length;n++)i=e[n],i===t?r[n]=i:typeof i=="object"?r[n]=Array.isArray(i)?c.extendDeep([],i):c.extendDeepAll({},i):r[n]=i;return r}var A={};A.add=function(t,e,r,i,n){var o,a;if(t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},a=t.undoQueue.index,t.autoplay){t.undoQueue.inSequence||(t.autoplay=!1);return}!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(a,t.undoQueue.queue.length-a,o),t.undoQueue.index+=1):o=t.undoQueue.queue[a-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(i),o.redo.args.push(n)),t.undoQueue.queue.length>g.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},A.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},A.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},A.undo=function(t){var e,r;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.undo.calls.length;r++)A.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},A.redo=function(t){var e,r;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)A.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},A.plotDo=function(t,e,r){t.autoplay=!0,r=E(t,r),e.apply(null,r)},V.exports=A}),tb=Vt((X,V)=>{V.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}}),yg=Vt(X=>{var V=Mi(),c=qr(),g=Ks(),E=mg(),A=tb(),t=Dm(),e=o0().configAttributes,r=su(),i=c.extendDeepAll,n=c.isPlainObject,o=c.isArrayOrTypedArray,a=c.nestedProperty,s=c.valObjectMeta,h="_isSubplotObj",v="_isLinkedToArray",m="_arrayAttrRegexps",p="_deprecated",y=[h,v,m,p];X.IS_SUBPLOT_OBJ=h,X.IS_LINKED_TO_ARRAY=v,X.DEPRECATED=p,X.UNDERSCORE_ATTRS=y,X.get=function(){var I={};return V.allTypes.forEach(function(O){I[O]=S(O)}),{defs:{valObjects:s,metaKeys:y.concat(["description","role","editType","impliedEdits"]),editType:{traces:r.traces,layout:r.layout},impliedEdits:{}},traces:I,layout:T(),frames:M(),animation:w(t),config:w(e)}},X.crawl=function(I,O,B,R){var L=B||0;R=R||"",Object.keys(I).forEach(function(F){var N=I[F];if(y.indexOf(F)===-1){var j=(R?R+".":"")+F;O(N,F,I,L,j),!X.isValObject(N)&&n(N)&&F!=="impliedEdits"&&X.crawl(N,O,L+1,j)}})},X.isValObject=function(I){return I&&I.valType!==void 0},X.findArrayAttributes=function(I){var O=[],B=[],R=[],L,F;function N(G,rt,ct,lt){B=B.slice(0,lt).concat([rt]),R=R.slice(0,lt).concat([G&&G._isLinkedToArray]);var tt=G&&(G.valType==="data_array"||G.arrayOk===!0)&&!(B[lt-1]==="colorbar"&&(rt==="ticktext"||rt==="tickvals"));tt&&j(L,0,"")}function j(G,rt,ct){var lt=G[B[rt]],tt=ct+B[rt];if(rt===B.length-1)o(lt)&&O.push(F+tt);else if(R[rt]){if(Array.isArray(lt))for(var Z=0;Z<lt.length;Z++)n(lt[Z])&&j(lt[Z],rt+1,tt+"["+Z+"].")}else n(lt)&&j(lt,rt+1,tt+".")}return L=I,F="",X.crawl(g,N),I._module&&I._module.attributes&&X.crawl(I._module.attributes,N),O},X.getTraceValObject=function(I,O){var B=O[0],R=1,L,F,N=I._module;if(N||(N=(V.modules[I.type||g.type.dflt]||{})._module),!N)return!1;if(L=N.attributes,F=L&&L[B],!F){var j=N.basePlotModule;j&&j.attributes&&(F=j.attributes[B])}return F||(F=g[B]),x(F,O,R)},X.getLayoutValObject=function(I,O){var B=l(I,O[0]);return x(B,O,1)};function l(I,O){var B,R,L,F,N=I._basePlotModules;if(N){var j;for(B=0;B<N.length;B++){if(L=N[B],L.attrRegex&&L.attrRegex.test(O)){if(L.layoutAttrOverrides)return L.layoutAttrOverrides;!j&&L.layoutAttributes&&(j=L.layoutAttributes)}var G=L.baseLayoutAttrOverrides;if(G&&O in G)return G[O]}if(j)return j}var rt=I._modules;if(rt){for(B=0;B<rt.length;B++)if(F=rt[B].layoutAttributes,F&&O in F)return F[O]}for(R in V.componentsRegistry){if(L=V.componentsRegistry[R],L.name==="colorscale"&&O.indexOf("coloraxis")===0)return L.layoutAttributes[O];if(!L.schema&&O===L.name)return L.layoutAttributes}return O in E?E[O]:!1}function x(I,O,B){if(!I)return!1;if(I._isLinkedToArray){if(b(O[B]))B++;else if(B<O.length)return!1}for(;B<O.length;B++){var R=I[O[B]];if(n(R))I=R;else break;if(B===O.length-1)break;if(I._isLinkedToArray){if(B++,!b(O[B]))return!1}else if(I.valType==="info_array"){B++;var L=O[B];if(!b(L))return!1;var F=I.items;if(Array.isArray(F)){if(L>=F.length)return!1;if(I.dimensions===2){if(B++,O.length===B)return I;var N=O[B];if(!b(N))return!1;I=F[L][N]}else I=F[L]}else I=F}}return I}function b(I){return I===Math.round(I)&&I>=0}function S(I){var O,B;O=V.modules[I]._module,B=O.basePlotModule;var R={};R.type=null;var L=i({},g),F=i({},O.attributes);X.crawl(F,function(G,rt,ct,lt,tt){a(L,tt).set(void 0),G===void 0&&a(F,tt).set(void 0)}),i(R,L),V.traceIs(I,"noOpacity")&&delete R.opacity,V.traceIs(I,"showLegend")||(delete R.showlegend,delete R.legendgroup),V.traceIs(I,"noHover")&&(delete R.hoverinfo,delete R.hoverlabel),O.selectPoints||delete R.selectedpoints,i(R,F),B.attributes&&i(R,B.attributes),R.type=I;var N={meta:O.meta||{},categories:O.categories||{},animatable:!!O.animatable,type:I,attributes:w(R)};if(O.layoutAttributes){var j={};i(j,O.layoutAttributes),N.layoutAttributes=w(j)}return O.animatable||X.crawl(N,function(G){X.isValObject(G)&&"anim"in G&&delete G.anim}),N}function T(){var I={},O,B;i(I,E);for(O in V.subplotsRegistry)if(B=V.subplotsRegistry[O],!!B.layoutAttributes)if(Array.isArray(B.attr))for(var R=0;R<B.attr.length;R++)_(I,B,B.attr[R]);else{var L=B.attr==="subplot"?B.name:B.attr;_(I,B,L)}for(O in V.componentsRegistry){B=V.componentsRegistry[O];var F=B.schema;if(F&&(F.subplots||F.layout)){var N=F.subplots;if(N&&N.xaxis&&!N.yaxis)for(var j in N.xaxis)delete I.yaxis[j];delete I.xaxis.shift,delete I.xaxis.autoshift}else B.name==="colorscale"?i(I,B.layoutAttributes):B.layoutAttributes&&D(I,B.layoutAttributes,B.name)}return{layoutAttributes:w(I)}}function M(){var I={frames:i({},A)};return w(I),I.frames}function w(I){return u(I),f(I),k(I),I}function u(I){function O(R){return{valType:"string",editType:"none"}}function B(R,L,F){X.isValObject(R)?(R.arrayOk===!0||R.valType==="data_array")&&(F[L+"src"]=O()):n(R)&&(R.role="object")}X.crawl(I,B)}function f(I){function O(B,R,L){if(B){var F=B[v];F&&(delete B[v],L[R]={items:{}},L[R].items[F]=B,L[R].role="object")}}X.crawl(I,O)}function k(I){function O(B){for(var R in B)if(n(B[R]))O(B[R]);else if(Array.isArray(B[R]))for(var L=0;L<B[R].length;L++)O(B[R][L]);else B[R]instanceof RegExp&&(B[R]=B[R].toString())}O(I)}function _(I,O,B){var R=a(I,B),L=i({},O.layoutAttributes);L[h]=!0,R.set(L)}function D(I,O,B){var R=a(I,B);R.set(i(R.get()||{},O))}}),Ns=Vt(X=>{var V=qr(),c=Ks(),g="templateitemname",E={name:{valType:"string",editType:"none"}};E[g]={valType:"string",editType:"calc"},X.templatedArray=function(e,r){return r._isLinkedToArray=e,r.name=E.name,r[g]=E[g],r},X.traceTemplater=function(e){var r={},i,n;for(i in e)n=e[i],Array.isArray(n)&&n.length&&(r[i]=0);function o(a){i=V.coerce(a,{},c,"type");var s={type:i,_template:null};if(i in r){n=e[i];var h=r[i]%n.length;r[i]++,s._template=n[h]}return s}return{newTrace:o}},X.newContainer=function(e,r,i){var n=e._template,o=n&&(n[r]||i&&n[i]);V.isPlainObject(o)||(o=null);var a=e[r]={_template:o};return a},X.arrayTemplater=function(e,r,i){var n=e._template,o=n&&n[t(r)],a=n&&n[r];(!Array.isArray(a)||!a.length)&&(a=[]);var s={};function h(m){var p={name:m.name,_input:m},y=p[g]=m[g];if(!A(y))return p._template=o,p;for(var l=0;l<a.length;l++){var x=a[l];if(x.name===y)return s[y]=1,p._template=x,p}return p[i]=m[i]||!1,p._template=!1,p}function v(){for(var m=[],p=0;p<a.length;p++){var y=a[p],l=y.name;if(A(l)&&!s[l]){var x={_template:y,name:l,_input:{_templateitemname:l}};x[g]=y[g],m.push(x),s[l]=1}}return m}return{newItem:h,defaultItems:v}};function A(e){return e&&typeof e=="string"}function t(e){var r=e.length-1;return e.charAt(r)!=="s"&&V.warn("bad argument to arrayDefaultKey: "+e),e.substr(0,e.length-1)+"defaults"}X.arrayDefaultKey=t,X.arrayEditor=function(e,r,i){var n=(V.nestedProperty(e,r).get()||[]).length,o=i._index,a=o>=n&&(i._input||{})._templateitemname;a&&(o=n);var s=r+"["+o+"]",h;function v(){h={},a&&(h[s]={},h[s][g]=a)}v();function m(x,b){h[x]=b}function p(x,b){a?V.nestedProperty(h[s],x).set(b):h[s+"."+x]=b}function y(){var x=h;return v(),x}function l(x,b){x&&p(x,b);var S=y();for(var T in S)V.nestedProperty(e,T).set(S[T])}return{modifyBase:m,modifyItem:p,getUpdateObj:y,applyUpdate:l}}}),xh=Vt((X,V)=>{var c=gg().counter;V.exports={idRegex:{x:c("x","( domain)?"),y:c("y","( domain)?")},attrRegex:c("[xy]axis"),xAxisMatch:c("xaxis"),yAxisMatch:c("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}),rc=Vt(X=>{var V=Mi(),c=xh();X.id2name=function(E){if(!(typeof E!="string"||!E.match(c.AX_ID_PATTERN))){var A=E.split(" ")[0].substr(1);return A==="1"&&(A=""),E.charAt(0)+"axis"+A}},X.name2id=function(E){if(E.match(c.AX_NAME_PATTERN)){var A=E.substr(5);return A==="1"&&(A=""),E.charAt(0)+A}},X.cleanId=function(E,A,t){var e=/( domain)$/.test(E);if(!(typeof E!="string"||!E.match(c.AX_ID_PATTERN))&&!(A&&E.charAt(0)!==A)&&!(e&&!t)){var r=E.split(" ")[0].substr(1).replace(/^0+/,"");return r==="1"&&(r=""),E.charAt(0)+r+(e&&t?" domain":"")}},X.list=function(E,A,t){var e=E._fullLayout;if(!e)return[];var r=X.listIds(E,A),i=new Array(r.length),n;for(n=0;n<r.length;n++){var o=r[n];i[n]=e[o.charAt(0)+"axis"+o.substr(1)]}if(!t){var a=e._subplots.gl3d||[];for(n=0;n<a.length;n++){var s=e[a[n]];A?i.push(s[A+"axis"]):i.push(s.xaxis,s.yaxis,s.zaxis)}}return i},X.listIds=function(E,A){var t=E._fullLayout;if(!t)return[];var e=t._subplots;return A?e[A+"axis"]:e.xaxis.concat(e.yaxis)},X.getFromId=function(E,A,t){var e=E._fullLayout;return A=A===void 0||typeof A!="string"?A:A.replace(" domain",""),t==="x"?A=A.replace(/y[0-9]*/,""):t==="y"&&(A=A.replace(/x[0-9]*/,"")),e[X.id2name(A)]},X.getFromTrace=function(E,A,t){var e=E._fullLayout,r=null;if(V.traceIs(A,"gl3d")){var i=A.scene;i.substr(0,5)==="scene"&&(r=e[i][t+"axis"])}else r=X.getFromId(E,A[t+"axis"]||t);return r},X.idSort=function(E,A){var t=E.charAt(0),e=A.charAt(0);return t!==e?t>e?1:-1:+(E.substr(1)||1)-+(A.substr(1)||1)},X.ref2id=function(E){return/^[xyz]/.test(E)?E.split(" ")[0]:!1};function g(E,A){if(A&&A.length){for(var t=0;t<A.length;t++)if(A[t][E])return!0}return!1}X.isLinked=function(E,A){return g(A,E._axisMatchGroups)||g(A,E._axisConstraintGroups)}}),kd=Vt((X,V)=>{function c(E){var A=E._fullLayout._zoomlayer;A&&A.selectAll(".outline-controllers").remove()}function g(E){var A=E._fullLayout._zoomlayer;A&&A.selectAll(".select-outline").remove(),E._fullLayout._outlining=!1}V.exports={clearOutlineControllers:c,clearOutline:g}}),Ry=Vt((X,V)=>{V.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}),Ph=Vt(X=>{var V=Mi();xh().SUBPLOT_PATTERN,X.getSubplotCalcData=function(c,g,E){var A=V.subplotsRegistry[g];if(!A)return[];for(var t=A.attr,e=[],r=0;r<c.length;r++){var i=c[r],n=i[0].trace;n[t]===E&&e.push(i)}return e},X.getModuleCalcData=function(c,g,E){var A=[],t=[],e;if(typeof g=="string"?e=V.getModule(g).plot:typeof g=="function"?e=g:e=g.plot,!e)return[A,c];for(var r=E,i=0;i<c.length;i++){var n=c[i],o=n[0].trace,a=o.zorder!==void 0;o.visible!==!0||o._length===0||(o._module&&o._module.plot===e&&(!a||o.zorder===r)?A.push(n):t.push(n))}return[A,t]},X.getSubplotData=function(c,g,E){if(!V.subplotsRegistry[g])return[];for(var A=V.subplotsRegistry[g].attr,t=[],e,r,i,n=0;n<c.length;n++)e=c[n],e[A]===E&&t.push(e);return t}}),Pk=Vt(X=>{var V=Mi(),c=qr();X.manageCommandObserver=function(r,i,n,o){var a={},s=!0;i&&i._commandObserver&&(a=i._commandObserver),a.cache||(a.cache={}),a.lookupTable={};var h=X.hasSimpleAPICommandBindings(r,n,a.lookupTable);if(i&&i._commandObserver){if(h)return a;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,a}if(h){g(r,h,a.cache),a.check=function(){if(s){var p=g(r,h,a.cache);return p.changed&&o&&a.lookupTable[p.value]!==void 0&&(a.disable(),Promise.resolve(o({value:p.value,type:h.type,prop:h.prop,traces:h.traces,index:a.lookupTable[p.value]})).then(a.enable,a.enable)),p.changed}};for(var v=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],m=0;m<v.length;m++)r._internalOn(v[m],a.check);a.remove=function(){for(var p=0;p<v.length;p++)r._removeInternalListener(v[p],a.check)}}else c.log("Unable to automatically bind plot updates to API command"),a.lookupTable={},a.remove=function(){};return a.disable=function(){s=!1},a.enable=function(){s=!0},i&&(i._commandObserver=a),a},X.hasSimpleAPICommandBindings=function(r,i,n){var o,a=i.length,s;for(o=0;o<a;o++){var h,v=i[o],m=v.method,p=v.args;if(Array.isArray(p)||(p=[]),!m)return!1;var y=X.computeAPICommandBindings(r,m,p);if(y.length!==1)return!1;if(!s)s=y[0],Array.isArray(s.traces)&&s.traces.sort();else{if(h=y[0],h.type!==s.type||h.prop!==s.prop)return!1;if(Array.isArray(s.traces))if(Array.isArray(h.traces)){h.traces.sort();for(var l=0;l<s.traces.length;l++)if(s.traces[l]!==h.traces[l])return!1}else return!1;else if(h.prop!==s.prop)return!1}h=y[0];var x=h.value;if(Array.isArray(x))if(x.length===1)x=x[0];else return!1;n&&(n[x]=o)}return s};function g(r,i,n){var o,a,s,h=!1;if(i.type==="data")o=r._fullData[i.traces!==null?i.traces[0]:0];else if(i.type==="layout")o=r._fullLayout;else return!1;return a=c.nestedProperty(o,i.prop).get(),s=n[i.type]=n[i.type]||{},s.hasOwnProperty(i.prop)&&s[i.prop]!==a&&(h=!0),s[i.prop]=a,{changed:h,value:a}}X.executeAPICommand=function(r,i,n){if(i==="skip")return Promise.resolve();var o=V.apiMethodRegistry[i],a=[r];Array.isArray(n)||(n=[]);for(var s=0;s<n.length;s++)a.push(n[s]);return o.apply(null,a).catch(function(h){return c.warn("API call to Plotly."+i+" rejected.",h),Promise.reject(h)})},X.computeAPICommandBindings=function(r,i,n){var o;switch(Array.isArray(n)||(n=[]),i){case"restyle":o=t(r,n);break;case"relayout":o=A(r,n);break;case"update":o=t(r,[n[0],n[2]]).concat(A(r,[n[1]]));break;case"animate":o=E(r,n);break;default:o=[]}return o};function E(r,i){return Array.isArray(i[0])&&i[0].length===1&&["string","number"].indexOf(typeof i[0][0])!==-1?[{type:"layout",prop:"_currentFrame",value:i[0][0].toString()}]:[]}function A(r,i){var n=[],o=i[0],a={};if(typeof o=="string")a[o]=i[1];else if(c.isPlainObject(o))a=o;else return n;return e(a,function(s,h,v){n.push({type:"layout",prop:s,value:v})},"",0),n}function t(r,i){var n,o,a,s,h=[];if(o=i[0],a=i[1],n=i[2],s={},typeof o=="string")s[o]=a;else if(c.isPlainObject(o))s=o,n===void 0&&(n=a);else return h;return n===void 0&&(n=null),e(s,function(v,m,p){var y,l;if(Array.isArray(p)){l=p.slice();var x=Math.min(l.length,r.data.length);n&&(x=Math.min(x,n.length)),y=[];for(var b=0;b<x;b++)y[b]=n?n[b]:b}else l=p,y=n?n.slice():null;if(y===null)Array.isArray(l)&&(l=l[0]);else if(Array.isArray(y)){if(!Array.isArray(l)){var S=l;l=[];for(var T=0;T<y.length;T++)l[T]=S}l.length=Math.min(y.length,l.length)}h.push({type:"data",prop:v,traces:y,value:l})},"",0),h}function e(r,i,n,o){Object.keys(r).forEach(function(a){var s=r[a];if(a[0]!=="_"){var h=n+(o>0?".":"")+a;c.isPlainObject(s)?e(s,i,h,o+1):i(h,a,s)}})}}),fu=Vt((X,V)=>{var c=Ai(),g=fg().timeFormatLocale,E=q_().formatLocale,A=vo(),t=H_(),e=Mi(),r=yg(),i=Ns(),n=qr(),o=vi(),a=ts().BADNUM,s=rc(),h=kd().clearOutline,v=Ry(),m=Dm(),p=tb(),y=Ph().getModuleCalcData,l=n.relinkPrivateKeys,x=n._,b=V.exports={};n.extendFlat(b,e),b.attributes=Ks(),b.attributes.type.values=b.allTypes,b.fontAttrs=Nl(),b.layoutAttributes=mg();var S=Pk();b.executeAPICommand=S.executeAPICommand,b.computeAPICommandBindings=S.computeAPICommandBindings,b.manageCommandObserver=S.manageCommandObserver,b.hasSimpleAPICommandBindings=S.hasSimpleAPICommandBindings,b.redrawText=function(Z){return Z=n.getGraphDiv(Z),new Promise(function(st){setTimeout(function(){Z._fullLayout&&(e.getComponentMethod("annotations","draw")(Z),e.getComponentMethod("legend","draw")(Z),e.getComponentMethod("colorbar","draw")(Z),st(b.previousPromises(Z)))},300)})},b.resize=function(Z){Z=n.getGraphDiv(Z);var st,$=new Promise(function(Q,nt){(!Z||n.isHidden(Z))&&nt(new Error("Resize must be passed a displayed plot div element.")),Z._redrawTimer&&clearTimeout(Z._redrawTimer),Z._resolveResize&&(st=Z._resolveResize),Z._resolveResize=Q,Z._redrawTimer=setTimeout(function(){if(!Z.layout||Z.layout.width&&Z.layout.height||n.isHidden(Z)){Q(Z);return}delete Z.layout.width,delete Z.layout.height;var Y=Z.changed;Z.autoplay=!0,e.call("relayout",Z,{autosize:!0}).then(function(){Z.changed=Y,Z._resolveResize===Q&&(delete Z._resolveResize,Q(Z))})},100)});return st&&st($),$},b.previousPromises=function(Z){if((Z._promises||[]).length)return Promise.all(Z._promises).then(function(){Z._promises=[]})},b.addLinks=function(Z){if(!(!Z._context.showLink&&!Z._context.showSources)){var st=Z._fullLayout,$=n.ensureSingle(st._paper,"text","js-plot-link-container",function(it){it.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:o.defaultLine,"pointer-events":"all"}).each(function(){var dt=c.select(this);dt.append("tspan").classed("js-link-to-tool",!0),dt.append("tspan").classed("js-link-spacer",!0),dt.append("tspan").classed("js-sourcelinks",!0)})}),Q=$.node(),nt={y:st._paper.attr("height")-9};document.body.contains(Q)&&Q.getComputedTextLength()>=st.width-20?(nt["text-anchor"]="start",nt.x=5):(nt["text-anchor"]="end",nt.x=st._paper.attr("width")-7),$.attr(nt);var Y=$.select(".js-link-to-tool"),q=$.select(".js-link-spacer"),ot=$.select(".js-sourcelinks");Z._context.showSources&&Z._context.showSources(Z),Z._context.showLink&&T(Z,Y),q.text(Y.text()&&ot.text()?" - ":"")}};function T(Z,st){st.text("");var $=st.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(Z._context.linkText+" »");if(Z._context.sendData)$.on("click",function(){b.sendDataToCloud(Z)});else{var Q=window.location.pathname.split("/"),nt=window.location.search;$.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+Q[2].split(".")[0]+"/"+Q[1]+nt})}}b.sendDataToCloud=function(Z){var st=(window.PLOTLYENV||{}).BASE_URL||Z._context.plotlyServerURL;if(st){Z.emit("plotly_beforeexport");var $=c.select(Z).append("div").attr("id","hiddenform").style("display","none"),Q=$.append("form").attr({action:st+"/external",method:"post",target:"_blank"}),nt=Q.append("input").attr({type:"text",name:"data"});return nt.node().value=b.graphJson(Z,!1,"keepdata"),Q.node().submit(),$.remove(),Z.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];b.supplyDefaults=function(Z,st){var $=st&&st.skipUpdateCalc,Q=Z._fullLayout||{};if(Q._skipDefaults){delete Q._skipDefaults;return}var nt=Z._fullLayout={},Y=Z.layout||{},q=Z._fullData||[],ot=Z._fullData=[],it=Z.data||[],dt=Z.calcdata||[],wt=Z._context||{},xt;Z._transitionData||b.createTransitionData(Z),nt._dfltTitle={plot:x(Z,"Click to enter Plot title"),subtitle:x(Z,"Click to enter Plot subtitle"),x:x(Z,"Click to enter X axis title"),y:x(Z,"Click to enter Y axis title"),colorbar:x(Z,"Click to enter Colorscale title"),annotation:x(Z,"new text")},nt._traceWord=x(Z,"trace");var Ft=k(Z,M);if(nt._mapboxAccessToken=wt.mapboxAccessToken,Q._initialAutoSizeIsDone){var Et=Q.width,Nt=Q.height;b.supplyLayoutGlobalDefaults(Y,nt,Ft),Y.width||(nt.width=Et),Y.height||(nt.height=Nt),b.sanitizeMargins(nt)}else{b.supplyLayoutGlobalDefaults(Y,nt,Ft);var te=!Y.width||!Y.height,Jt=nt.autosize,Qt=wt.autosizable,Wt=te&&(Jt||Qt);Wt?b.plotAutoSize(Z,Y,nt):te&&b.sanitizeMargins(nt),!Jt&&te&&(Y.width=nt.width,Y.height=nt.height)}nt._d3locale=_(Ft,nt.separators),nt._extraFormat=k(Z,w),nt._initialAutoSizeIsDone=!0,nt._dataLength=it.length,nt._modules=[],nt._visibleModules=[],nt._basePlotModules=[];var gt=nt._subplots=f(),bt=nt._splomAxes={x:{},y:{}},vt=nt._splomSubplots={};nt._splomGridDflt={},nt._scatterStackOpts={},nt._firstScatter={},nt._alignmentOpts={},nt._colorAxes={},nt._requestRangeslider={},nt._traceUids=u(q,it),b.supplyDataDefaults(it,ot,Y,nt);var Ut=Object.keys(bt.x),Kt=Object.keys(bt.y);if(Ut.length>1&&Kt.length>1){for(e.getComponentMethod("grid","sizeDefaults")(Y,nt),xt=0;xt<Ut.length;xt++)n.pushUnique(gt.xaxis,Ut[xt]);for(xt=0;xt<Kt.length;xt++)n.pushUnique(gt.yaxis,Kt[xt]);for(var Zt in vt)n.pushUnique(gt.cartesian,Zt)}if(nt._has=b._hasPlotType.bind(nt),q.length===ot.length)for(xt=0;xt<ot.length;xt++)l(ot[xt],q[xt]);b.supplyLayoutModuleDefaults(Y,nt,ot,Z._transitionData);var le=nt._visibleModules,Te=[];for(xt=0;xt<le.length;xt++){var Se=le[xt].crossTraceDefaults;Se&&n.pushUnique(Te,Se)}for(xt=0;xt<Te.length;xt++)Te[xt](ot,nt);nt._hasOnlyLargeSploms=nt._basePlotModules.length===1&&nt._basePlotModules[0].name==="splom"&&Ut.length>15&&Kt.length>15&&nt.shapes.length===0&&nt.images.length===0,b.linkSubplots(ot,nt,q,Q),b.cleanPlot(ot,nt,q,Q);var Fe=!!(Q._has&&Q._has("cartesian")),Oe=!!(nt._has&&nt._has("cartesian")),ur=Fe,fr=Oe;ur&&!fr?Q._bgLayer.remove():fr&&!ur&&(nt._shouldCreateBgLayer=!0),Q._zoomlayer&&!Z._dragging&&h({_fullLayout:Q}),D(ot,nt),l(nt,Q),e.getComponentMethod("colorscale","crossTraceDefaults")(ot,nt),nt._preGUI||(nt._preGUI={}),nt._tracePreGUI||(nt._tracePreGUI={});var We=nt._tracePreGUI,Lr={},kr;for(kr in We)Lr[kr]="old";for(xt=0;xt<ot.length;xt++)kr=ot[xt]._fullInput.uid,Lr[kr]||(We[kr]={}),Lr[kr]="new";for(kr in Lr)Lr[kr]==="old"&&delete We[kr];B(nt),e.getComponentMethod("rangeslider","makeData")(nt),!$&&dt.length===ot.length&&b.supplyDefaultsUpdateCalc(dt,ot)},b.supplyDefaultsUpdateCalc=function(Z,st){for(var $=0;$<st.length;$++){var Q=st[$],nt=(Z[$]||[])[0];if(nt&&nt.trace){var Y=nt.trace;if(Y._hasCalcTransform){var q=Y._arrayAttrs,ot,it,dt;for(ot=0;ot<q.length;ot++)it=q[ot],dt=n.nestedProperty(Y,it).get().slice(),n.nestedProperty(Q,it).set(dt)}nt.trace=Q}}};function u(Z,st){var $=st.length,Q=[],nt,Y;for(nt=0;nt<Z.length;nt++){var q=Z[nt]._fullInput;q!==Y&&Q.push(q),Y=q}var ot=Q.length,it=new Array($),dt={};function wt(Et,Nt){it[Nt]=Et,dt[Et]=1}function xt(Et,Nt){if(Et&&typeof Et=="string"&&!dt[Et])return wt(Et,Nt),!0}for(nt=0;nt<$;nt++){var Ft=st[nt].uid;typeof Ft=="number"&&(Ft=String(Ft)),!xt(Ft,nt)&&(nt<ot&&xt(Q[nt].uid,nt)||wt(n.randstr(dt),nt))}return it}function f(){var Z=e.collectableSubplotTypes,st={},$,Q;if(!Z){Z=[];var nt=e.subplotsRegistry;for(var Y in nt){var q=nt[Y],ot=q.attr;if(ot&&(Z.push(Y),Array.isArray(ot)))for(Q=0;Q<ot.length;Q++)n.pushUnique(Z,ot[Q])}}for($=0;$<Z.length;$++)st[Z[$]]=[];return st}function k(Z,st){var $=Z._context.locale;$||($="en-US");var Q=!1,nt={};function Y(xt){for(var Ft=!0,Et=0;Et<st.length;Et++){var Nt=st[Et];nt[Nt]||(xt[Nt]?nt[Nt]=xt[Nt]:Ft=!1)}Ft&&(Q=!0)}for(var q=0;q<2;q++){for(var ot=Z._context.locales,it=0;it<2;it++){var dt=(ot[$]||{}).format;if(dt&&(Y(dt),Q))break;ot=e.localeRegistry}var wt=$.split("-")[0];if(Q||wt===$)break;$=wt}return Q||Y(e.localeRegistry.en.format),nt}function _(Z,st){return Z.decimal=st.charAt(0),Z.thousands=st.charAt(1),{numberFormat:function($){try{$=E(Z).format(n.adjustFormat($))}catch{return n.warnBadFormat($),n.noFormat}return $},timeFormat:g(Z).utcFormat}}function D(Z,st){var $,Q=[];st.meta&&($=st._meta={meta:st.meta,layout:{meta:st.meta}});for(var nt=0;nt<Z.length;nt++){var Y=Z[nt];Y.meta?Q[Y.index]=Y._meta={meta:Y.meta}:st.meta&&(Y._meta={meta:st.meta}),st.meta&&(Y._meta.layout={meta:st.meta})}Q.length&&($||($=st._meta={}),$.data=Q)}b.createTransitionData=function(Z){Z._transitionData||(Z._transitionData={}),Z._transitionData._frames||(Z._transitionData._frames=[]),Z._transitionData._frameHash||(Z._transitionData._frameHash={}),Z._transitionData._counter||(Z._transitionData._counter=0),Z._transitionData._interruptCallbacks||(Z._transitionData._interruptCallbacks=[])},b._hasPlotType=function(Z){var st,$=this._basePlotModules||[];for(st=0;st<$.length;st++)if($[st].name===Z)return!0;var Q=this._modules||[];for(st=0;st<Q.length;st++){var nt=Q[st].name;if(nt===Z)return!0;var Y=e.modules[nt];if(Y&&Y.categories[Z])return!0}return!1},b.cleanPlot=function(Z,st,$,Q){var nt,Y,q=Q._basePlotModules||[];for(nt=0;nt<q.length;nt++){var ot=q[nt];ot.clean&&ot.clean(Z,st,$,Q)}var it=Q._has&&Q._has("gl"),dt=st._has&&st._has("gl");it&&!dt&&Q._glcontainer!==void 0&&(Q._glcontainer.selectAll(".gl-canvas").remove(),Q._glcontainer.selectAll(".no-webgl").remove(),Q._glcanvas=null);var wt=!!Q._infolayer;t:for(nt=0;nt<$.length;nt++){var xt=$[nt],Ft=xt.uid;for(Y=0;Y<Z.length;Y++){var Et=Z[Y];if(Ft===Et.uid)continue t}wt&&Q._infolayer.select(".cb"+Ft).remove()}},b.linkSubplots=function(Z,st,$,Q){var nt,Y,q=Q._plots||{},ot=st._plots={},it=st._subplots,dt={_fullData:Z,_fullLayout:st},wt=it.cartesian||[];for(nt=0;nt<wt.length;nt++){var xt=wt[nt],Ft=q[xt],Et=s.getFromId(dt,xt,"x"),Nt=s.getFromId(dt,xt,"y"),te;for(Ft?te=ot[xt]=Ft:(te=ot[xt]={},te.id=xt),Et._counterAxes.push(Nt._id),Nt._counterAxes.push(Et._id),Et._subplotsWith.push(xt),Nt._subplotsWith.push(xt),te.xaxis=Et,te.yaxis=Nt,te._hasClipOnAxisFalse=!1,Y=0;Y<Z.length;Y++){var Jt=Z[Y];if(Jt.xaxis===te.xaxis._id&&Jt.yaxis===te.yaxis._id&&Jt.cliponaxis===!1){te._hasClipOnAxisFalse=!0;break}}}var Qt=s.list(dt,null,!0),Wt;for(nt=0;nt<Qt.length;nt++){Wt=Qt[nt];var gt=null;Wt.overlaying&&(gt=s.getFromId(dt,Wt.overlaying),gt&>.overlaying&&(Wt.overlaying=!1,gt=null)),Wt._mainAxis=gt||Wt,gt&&(Wt.domain=gt.domain.slice()),Wt._anchorAxis=Wt.anchor==="free"?null:s.getFromId(dt,Wt.anchor)}for(nt=0;nt<Qt.length;nt++)if(Wt=Qt[nt],Wt._counterAxes.sort(s.idSort),Wt._subplotsWith.sort(n.subplotSort),Wt._mainSubplot=I(Wt,st),Wt._counterAxes.length&&(Wt.spikemode&&Wt.spikemode.indexOf("across")!==-1||Wt.automargin&&Wt.mirror&&Wt.anchor!=="free"||e.getComponentMethod("rangeslider","isVisible")(Wt))){var bt=1,vt=0;for(Y=0;Y<Wt._counterAxes.length;Y++){var Ut=s.getFromId(dt,Wt._counterAxes[Y]);bt=Math.min(bt,Ut.domain[0]),vt=Math.max(vt,Ut.domain[1])}bt<vt&&(Wt._counterDomainMin=bt,Wt._counterDomainMax=vt)}};function I(Z,st){var $={_fullLayout:st},Q=Z._id.charAt(0)==="x",nt=Z._mainAxis._anchorAxis,Y="",q="",ot="";if(nt&&(ot=nt._mainAxis._id,Y=Q?Z._id+ot:ot+Z._id),!Y||!st._plots[Y]){Y="";for(var it=Z._counterAxes,dt=0;dt<it.length;dt++){var wt=it[dt],xt=Q?Z._id+wt:wt+Z._id;q||(q=xt);var Ft=s.getFromId($,wt);if(ot&&Ft.overlaying===ot){Y=xt;break}}}return Y||q}b.clearExpandedTraceDefaultColors=function(Z){var st,$,Q;function nt(q,ot,it,dt){$[dt]=ot,$.length=dt+1,q.valType==="color"&&q.dflt===void 0&&st.push($.join("."))}for($=[],st=Z._module._colorAttrs,st||(Z._module._colorAttrs=st=[],r.crawl(Z._module.attributes,nt)),Q=0;Q<st.length;Q++){var Y=n.nestedProperty(Z,"_input."+st[Q]);Y.get()||n.nestedProperty(Z,st[Q]).set(null)}},b.supplyDataDefaults=function(Z,st,$,Q){var nt=Q._modules,Y=Q._visibleModules,q=Q._basePlotModules,ot=0,it,dt,wt;Q._transformModules=[];function xt(Qt){st.push(Qt);var Wt=Qt._module;Wt&&(n.pushUnique(nt,Wt),Qt.visible===!0&&n.pushUnique(Y,Wt),n.pushUnique(q,Qt._module.basePlotModule),Qt._input.visible!==!1&&ot++)}var Ft={},Et=[],Nt=($.template||{}).data||{},te=i.traceTemplater(Nt);for(it=0;it<Z.length;it++)wt=Z[it],dt=te.newTrace(wt),dt.uid=Q._traceUids[it],b.supplyTraceDefaults(wt,dt,ot,Q,it),dt.index=it,dt._input=wt,dt._fullInput=dt,xt(dt),e.traceIs(dt,"carpetAxis")&&(Ft[dt.carpet]=dt),e.traceIs(dt,"carpetDependent")&&Et.push(it);for(it=0;it<Et.length;it++)if(dt=st[Et[it]],!!dt.visible){var Jt=Ft[dt.carpet];if(dt._carpet=Jt,!Jt||!Jt.visible){dt.visible=!1;continue}dt.xaxis=Jt.xaxis,dt.yaxis=Jt.yaxis}},b.supplyAnimationDefaults=function(Z){Z=Z||{};var st,$={};function Q(nt,Y){return n.coerce(Z||{},$,m,nt,Y)}if(Q("mode"),Q("direction"),Q("fromcurrent"),Array.isArray(Z.frame))for($.frame=[],st=0;st<Z.frame.length;st++)$.frame[st]=b.supplyAnimationFrameDefaults(Z.frame[st]||{});else $.frame=b.supplyAnimationFrameDefaults(Z.frame||{});if(Array.isArray(Z.transition))for($.transition=[],st=0;st<Z.transition.length;st++)$.transition[st]=b.supplyAnimationTransitionDefaults(Z.transition[st]||{});else $.transition=b.supplyAnimationTransitionDefaults(Z.transition||{});return $},b.supplyAnimationFrameDefaults=function(Z){var st={};function $(Q,nt){return n.coerce(Z||{},st,m.frame,Q,nt)}return $("duration"),$("redraw"),st},b.supplyAnimationTransitionDefaults=function(Z){var st={};function $(Q,nt){return n.coerce(Z||{},st,m.transition,Q,nt)}return $("duration"),$("easing"),st},b.supplyFrameDefaults=function(Z){var st={};function $(Q,nt){return n.coerce(Z,st,p,Q,nt)}return $("group"),$("name"),$("traces"),$("baseframe"),$("data"),$("layout"),st},b.supplyTraceDefaults=function(Z,st,$,Q,nt){var Y=Q.colorway||o.defaults,q=Y[$%Y.length],ot;function it(gt,bt){return n.coerce(Z,st,b.attributes,gt,bt)}var dt=it("visible");it("type"),it("name",Q._traceWord+" "+nt),it("uirevision",Q.uirevision);var wt=b.getModule(st);if(st._module=wt,wt){var xt=wt.basePlotModule,Ft=xt.attr,Et=xt.attributes;if(Ft&&Et){var Nt=Q._subplots,te="";if(Array.isArray(Ft))for(ot=0;ot<Ft.length;ot++){var Jt=Ft[ot],Qt=n.coerce(Z,st,Et,Jt);Nt[Jt]&&n.pushUnique(Nt[Jt],Qt),te+=Qt}else te=n.coerce(Z,st,Et,Ft);Nt[xt.name]&&n.pushUnique(Nt[xt.name],te)}}if(dt&&(it("customdata"),it("ids"),it("meta"),e.traceIs(st,"showLegend")?(n.coerce(Z,st,wt.attributes.showlegend?wt.attributes:b.attributes,"showlegend"),it("legend"),it("legendwidth"),it("legendgroup"),it("legendgrouptitle.text"),it("legendrank"),st._dfltShowLegend=!0):st._dfltShowLegend=!1,wt&&wt.supplyDefaults(Z,st,q,Q),e.traceIs(st,"noOpacity")||it("opacity"),e.traceIs(st,"notLegendIsolatable")&&(st.visible=!!st.visible),e.traceIs(st,"noHover")||(st.hovertemplate||n.coerceHoverinfo(Z,st,Q),st.type!=="parcats"&&e.getComponentMethod("fx","supplyDefaults")(Z,st,q,Q)),wt&&wt.selectPoints)){var Wt=it("selectedpoints");n.isTypedArray(Wt)&&(st.selectedpoints=Array.from(Wt))}return st},b.supplyLayoutGlobalDefaults=function(Z,st,$){function Q(xt,Ft){return n.coerce(Z,st,b.layoutAttributes,xt,Ft)}var nt=Z.template;n.isPlainObject(nt)&&(st.template=nt,st._template=nt.layout,st._dataTemplate=nt.data),Q("autotypenumbers");var Y=n.coerceFont(Q,"font"),q=Y.size;n.coerceFont(Q,"title.font",Y,{overrideDflt:{size:Math.round(q*1.4)}}),Q("title.text",st._dfltTitle.plot),Q("title.xref");var ot=Q("title.yref");Q("title.pad.t"),Q("title.pad.r"),Q("title.pad.b"),Q("title.pad.l");var it=Q("title.automargin");Q("title.x"),Q("title.xanchor"),Q("title.y"),Q("title.yanchor"),Q("title.subtitle.text",st._dfltTitle.subtitle),n.coerceFont(Q,"title.subtitle.font",Y,{overrideDflt:{size:Math.round(st.title.font.size*.7)}}),it&&(ot==="paper"&&(st.title.y!==0&&(st.title.y=1),st.title.yanchor==="auto"&&(st.title.yanchor=st.title.y===0?"top":"bottom")),ot==="container"&&(st.title.y==="auto"&&(st.title.y=1),st.title.yanchor==="auto"&&(st.title.yanchor=st.title.y<.5?"bottom":"top")));var dt=Q("uniformtext.mode");dt&&Q("uniformtext.minsize"),Q("autosize",!(Z.width&&Z.height)),Q("width"),Q("height"),Q("minreducedwidth"),Q("minreducedheight"),Q("margin.l"),Q("margin.r"),Q("margin.t"),Q("margin.b"),Q("margin.pad"),Q("margin.autoexpand"),Z.width&&Z.height&&b.sanitizeMargins(st),e.getComponentMethod("grid","sizeDefaults")(Z,st),Q("paper_bgcolor"),Q("separators",$.decimal+$.thousands),Q("hidesources"),Q("colorway"),Q("datarevision");var wt=Q("uirevision");Q("editrevision",wt),Q("selectionrevision",wt),e.getComponentMethod("modebar","supplyLayoutDefaults")(Z,st),e.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(Z,st,Q),e.getComponentMethod("selections","supplyDrawNewSelectionDefaults")(Z,st,Q),Q("meta"),n.isPlainObject(Z.transition)&&(Q("transition.duration"),Q("transition.easing"),Q("transition.ordering")),e.getComponentMethod("calendars","handleDefaults")(Z,st,"calendar"),e.getComponentMethod("fx","supplyLayoutGlobalDefaults")(Z,st,Q),n.coerce(Z,st,v,"scattermode")};function O(Z){return typeof Z=="string"&&Z.substr(Z.length-2)==="px"&&parseFloat(Z)}b.plotAutoSize=function(Z,st,$){var Q=Z._context||{},nt=Q.frameMargins,Y,q,ot=n.isPlotDiv(Z);if(ot&&Z.emit("plotly_autosize"),Q.fillFrame)Y=window.innerWidth,q=window.innerHeight,document.body.style.overflow="hidden";else{var it=ot?window.getComputedStyle(Z):{};if(Y=O(it.width)||O(it.maxWidth)||$.width,q=O(it.height)||O(it.maxHeight)||$.height,A(nt)&&nt>0){var dt=1-2*nt;Y=Math.round(dt*Y),q=Math.round(dt*q)}}var wt=b.layoutAttributes.width.min,xt=b.layoutAttributes.height.min;Y<wt&&(Y=wt),q<xt&&(q=xt);var Ft=!st.width&&Math.abs($.width-Y)>1,Et=!st.height&&Math.abs($.height-q)>1;(Et||Ft)&&(Ft&&($.width=Y),Et&&($.height=q)),Z._initialAutoSize||(Z._initialAutoSize={width:Y,height:q}),b.sanitizeMargins($)},b.supplyLayoutModuleDefaults=function(Z,st,$,Q){var nt=e.componentsRegistry,Y=st._basePlotModules,q,ot,it,dt=e.subplotsRegistry.cartesian;for(q in nt)it=nt[q],it.includeBasePlot&&it.includeBasePlot(Z,st);Y.length||Y.push(dt),st._has("cartesian")&&(e.getComponentMethod("grid","contentDefaults")(Z,st),dt.finalizeSubplots(Z,st));for(var wt in st._subplots)st._subplots[wt].sort(n.subplotSort);for(ot=0;ot<Y.length;ot++)it=Y[ot],it.supplyLayoutDefaults&&it.supplyLayoutDefaults(Z,st,$);var xt=st._modules;for(ot=0;ot<xt.length;ot++)it=xt[ot],it.supplyLayoutDefaults&&it.supplyLayoutDefaults(Z,st,$);var Ft=st._transformModules;for(ot=0;ot<Ft.length;ot++)it=Ft[ot],it.supplyLayoutDefaults&&it.supplyLayoutDefaults(Z,st,$,Q);for(q in nt)it=nt[q],it.supplyLayoutDefaults&&it.supplyLayoutDefaults(Z,st,$)},b.purge=function(Z){var st=Z._fullLayout||{};st._glcontainer!==void 0&&(st._glcontainer.selectAll(".gl-canvas").remove(),st._glcontainer.remove(),st._glcanvas=null),st._modeBar&&st._modeBar.destroy(),Z._transitionData&&(Z._transitionData._interruptCallbacks&&(Z._transitionData._interruptCallbacks.length=0),Z._transitionData._animationRaf&&window.cancelAnimationFrame(Z._transitionData._animationRaf)),n.clearThrottle(),n.clearResponsive(Z),delete Z.data,delete Z.layout,delete Z._fullData,delete Z._fullLayout,delete Z.calcdata,delete Z.empty,delete Z.fid,delete Z.undoqueue,delete Z.undonum,delete Z.autoplay,delete Z.changed,delete Z._promises,delete Z._redrawTimer,delete Z._hmlumcount,delete Z._hmpixcount,delete Z._transitionData,delete Z._transitioning,delete Z._initialAutoSize,delete Z._transitioningWithDuration,delete Z._dragging,delete Z._dragged,delete Z._dragdata,delete Z._hoverdata,delete Z._snapshotInProgress,delete Z._editing,delete Z._mouseDownTime,delete Z._legendMouseDownTime,Z.removeAllListeners&&Z.removeAllListeners()},b.style=function(Z){var st=Z._fullLayout._visibleModules,$=[],Q;for(Q=0;Q<st.length;Q++){var nt=st[Q];nt.style&&n.pushUnique($,nt.style)}for(Q=0;Q<$.length;Q++)$[Q](Z)},b.sanitizeMargins=function(Z){if(!(!Z||!Z.margin)){var st=Z.width,$=Z.height,Q=Z.margin,nt=st-(Q.l+Q.r),Y=$-(Q.t+Q.b),q;nt<0&&(q=(st-1)/(Q.l+Q.r),Q.l=Math.floor(q*Q.l),Q.r=Math.floor(q*Q.r)),Y<0&&(q=($-1)/(Q.t+Q.b),Q.t=Math.floor(q*Q.t),Q.b=Math.floor(q*Q.b))}},b.clearAutoMarginIds=function(Z){Z._fullLayout._pushmarginIds={}},b.allowAutoMargin=function(Z,st){Z._fullLayout._pushmarginIds[st]=1};function B(Z){var st=Z.margin;if(!Z._size){var $=Z._size={l:Math.round(st.l),r:Math.round(st.r),t:Math.round(st.t),b:Math.round(st.b),p:Math.round(st.pad)};$.w=Math.round(Z.width)-$.l-$.r,$.h=Math.round(Z.height)-$.t-$.b}Z._pushmargin||(Z._pushmargin={}),Z._pushmarginIds||(Z._pushmarginIds={}),Z._reservedMargin||(Z._reservedMargin={})}var R=2,L=2;b.autoMargin=function(Z,st,$){var Q=Z._fullLayout,nt=Q.width,Y=Q.height,q=Q.margin,ot=Q.minreducedwidth,it=Q.minreducedheight,dt=n.constrain(nt-q.l-q.r,R,ot),wt=n.constrain(Y-q.t-q.b,L,it),xt=Math.max(0,nt-dt),Ft=Math.max(0,Y-wt),Et=Q._pushmargin,Nt=Q._pushmarginIds;if(q.autoexpand!==!1){if(!$)delete Et[st],delete Nt[st];else{var te=$.pad;if(te===void 0&&(te=Math.min(12,q.l,q.r,q.t,q.b)),xt){var Jt=($.l+$.r)/xt;Jt>1&&($.l/=Jt,$.r/=Jt)}if(Ft){var Qt=($.t+$.b)/Ft;Qt>1&&($.t/=Qt,$.b/=Qt)}var Wt=$.xl!==void 0?$.xl:$.x,gt=$.xr!==void 0?$.xr:$.x,bt=$.yt!==void 0?$.yt:$.y,vt=$.yb!==void 0?$.yb:$.y;Et[st]={l:{val:Wt,size:$.l+te},r:{val:gt,size:$.r+te},b:{val:vt,size:$.b+te},t:{val:bt,size:$.t+te}},Nt[st]=1}if(!Q._replotting)return b.doAutoMargin(Z)}};function F(Z){if("_redrawFromAutoMarginCount"in Z._fullLayout)return!1;var st=s.list(Z,"",!0);for(var $ in st)if(st[$].autoshift||st[$].shift)return!0;return!1}b.doAutoMargin=function(Z){var st=Z._fullLayout,$=st.width,Q=st.height;st._size||(st._size={}),B(st);var nt=st._size,Y=st.margin,q={t:0,b:0,l:0,r:0},ot=n.extendFlat({},nt),it=Y.l,dt=Y.r,wt=Y.t,xt=Y.b,Ft=st._pushmargin,Et=st._pushmarginIds,Nt=st.minreducedwidth,te=st.minreducedheight;if(Y.autoexpand!==!1){for(var Jt in Ft)Et[Jt]||delete Ft[Jt];var Qt=Z._fullLayout._reservedMargin;for(var Wt in Qt)for(var gt in Qt[Wt]){var bt=Qt[Wt][gt];q[gt]=Math.max(q[gt],bt)}Ft.base={l:{val:0,size:it},r:{val:1,size:dt},t:{val:1,size:wt},b:{val:0,size:xt}};for(var vt in q){var Ut=0;for(var Kt in Ft)Kt!=="base"&&A(Ft[Kt][vt].size)&&(Ut=Ft[Kt][vt].size>Ut?Ft[Kt][vt].size:Ut);var Zt=Math.max(0,Y[vt]-Ut);q[vt]=Math.max(0,q[vt]-Zt)}for(var le in Ft){var Te=Ft[le].l||{},Se=Ft[le].b||{},Fe=Te.val,Oe=Te.size,ur=Se.val,fr=Se.size,We=$-q.r-q.l,Lr=Q-q.t-q.b;for(var kr in Ft){if(A(Oe)&&Ft[kr].r){var he=Ft[kr].r.val,Dt=Ft[kr].r.size;if(he>Fe){var qt=(Oe*he+(Dt-We)*Fe)/(he-Fe),zt=(Dt*(1-Fe)+(Oe-We)*(1-he))/(he-Fe);qt+zt>it+dt&&(it=qt,dt=zt)}}if(A(fr)&&Ft[kr].t){var ut=Ft[kr].t.val,yt=Ft[kr].t.size;if(ut>ur){var Mt=(fr*ut+(yt-Lr)*ur)/(ut-ur),Ot=(yt*(1-ur)+(fr-Lr)*(1-ut))/(ut-ur);Mt+Ot>xt+wt&&(xt=Mt,wt=Ot)}}}}}var $t=n.constrain($-Y.l-Y.r,R,Nt),ee=n.constrain(Q-Y.t-Y.b,L,te),we=Math.max(0,$-$t),Me=Math.max(0,Q-ee);if(we){var Re=(it+dt)/we;Re>1&&(it/=Re,dt/=Re)}if(Me){var Be=(xt+wt)/Me;Be>1&&(xt/=Be,wt/=Be)}if(nt.l=Math.round(it)+q.l,nt.r=Math.round(dt)+q.r,nt.t=Math.round(wt)+q.t,nt.b=Math.round(xt)+q.b,nt.p=Math.round(Y.pad),nt.w=Math.round($)-nt.l-nt.r,nt.h=Math.round(Q)-nt.t-nt.b,!st._replotting&&(b.didMarginChange(ot,nt)||F(Z))){"_redrawFromAutoMarginCount"in st?st._redrawFromAutoMarginCount++:st._redrawFromAutoMarginCount=1;var Ze=3*(1+Object.keys(Et).length);if(st._redrawFromAutoMarginCount<Ze)return e.call("_doPlot",Z);st._size=ot,n.warn("Too many auto-margin redraws.")}N(Z)};function N(Z){var st=s.list(Z,"",!0);["_adjustTickLabelsOverflow","_hideCounterAxisInsideTickLabels"].forEach(function($){for(var Q=0;Q<st.length;Q++){var nt=st[Q][$];nt&&nt()}})}var j=["l","r","t","b","p","w","h"];b.didMarginChange=function(Z,st){for(var $=0;$<j.length;$++){var Q=j[$],nt=Z[Q],Y=st[Q];if(!A(nt)||Math.abs(Y-nt)>1)return!0}return!1},b.graphJson=function(Z,st,$,Q,nt,Y){(nt&&st&&!Z._fullData||nt&&!st&&!Z._fullLayout)&&b.supplyDefaults(Z);var q=nt?Z._fullData:Z.data,ot=nt?Z._fullLayout:Z.layout,it=(Z._transitionData||{})._frames;function dt(Ft,Et){if(typeof Ft=="function")return Et?"_function_":null;if(n.isPlainObject(Ft)){var Nt={},te;return Object.keys(Ft).sort().forEach(function(gt){if(["_","["].indexOf(gt.charAt(0))===-1){if(typeof Ft[gt]=="function"){Et&&(Nt[gt]="_function");return}if($==="keepdata"){if(gt.substr(gt.length-3)==="src")return}else if($==="keepstream"){if(te=Ft[gt+"src"],typeof te=="string"&&te.indexOf(":")>0&&!n.isPlainObject(Ft.stream))return}else if($!=="keepall"&&(te=Ft[gt+"src"],typeof te=="string"&&te.indexOf(":")>0))return;Nt[gt]=dt(Ft[gt],Et)}}),Nt}var Jt=Array.isArray(Ft),Qt=n.isTypedArray(Ft);if((Jt||Qt)&&Ft.dtype&&Ft.shape){var Wt=Ft.bdata;return dt({dtype:Ft.dtype,shape:Ft.shape,bdata:n.isArrayBuffer(Wt)?t.encode(Wt):Wt},Et)}return Jt?Ft.map(function(gt){return dt(gt,Et)}):Qt?n.simpleMap(Ft,n.identity):n.isJSDate(Ft)?n.ms2DateTimeLocal(+Ft):Ft}var wt={data:(q||[]).map(function(Ft){var Et=dt(Ft);return st&&delete Et.fit,Et})};if(!st&&(wt.layout=dt(ot),nt)){var xt=ot._size;wt.layout.computed={margin:{b:xt.b,l:xt.l,r:xt.r,t:xt.t}}}return it&&(wt.frames=dt(it)),Y&&(wt.config=dt(Z._context,!0)),Q==="object"?wt:JSON.stringify(wt)},b.modifyFrames=function(Z,st){var $,Q,nt,Y=Z._transitionData._frames,q=Z._transitionData._frameHash;for($=0;$<st.length;$++)switch(Q=st[$],Q.type){case"replace":nt=Q.value;var ot=(Y[Q.index]||{}).name,it=nt.name;Y[Q.index]=q[it]=nt,it!==ot&&(delete q[ot],q[it]=nt);break;case"insert":nt=Q.value,q[nt.name]=nt,Y.splice(Q.index,0,nt);break;case"delete":nt=Y[Q.index],delete q[nt.name],Y.splice(Q.index,1);break}return Promise.resolve()},b.computeFrame=function(Z,st){var $=Z._transitionData._frameHash,Q,nt,Y,q;if(!st)throw new Error("computeFrame must be given a string frame name");var ot=$[st.toString()];if(!ot)return!1;for(var it=[ot],dt=[ot.name];ot.baseframe&&(ot=$[ot.baseframe.toString()])&&dt.indexOf(ot.name)===-1;)it.push(ot),dt.push(ot.name);for(var wt={};ot=it.pop();)if(ot.layout&&(wt.layout=b.extendLayout(wt.layout,ot.layout)),ot.data){if(wt.data||(wt.data=[]),nt=ot.traces,!nt)for(nt=[],Q=0;Q<ot.data.length;Q++)nt[Q]=Q;for(wt.traces||(wt.traces=[]),Q=0;Q<ot.data.length;Q++)Y=nt[Q],Y!=null&&(q=wt.traces.indexOf(Y),q===-1&&(q=wt.data.length,wt.traces[q]=Y),wt.data[q]=b.extendTrace(wt.data[q],ot.data[Q]))}return wt},b.recomputeFrameHash=function(Z){for(var st=Z._transitionData._frameHash={},$=Z._transitionData._frames,Q=0;Q<$.length;Q++){var nt=$[Q];nt&&nt.name&&(st[nt.name]=nt)}},b.extendObjectWithContainers=function(Z,st,$){var Q,nt,Y,q,ot,it,dt,wt,xt=n.extendDeepNoArrays({},st||{}),Ft=n.expandObjectPaths(xt),Et={};if($&&$.length)for(Y=0;Y<$.length;Y++)Q=n.nestedProperty(Ft,$[Y]),nt=Q.get(),nt===void 0?n.nestedProperty(Et,$[Y]).set(null):(Q.set(null),n.nestedProperty(Et,$[Y]).set(nt));if(Z=n.extendDeepNoArrays(Z||{},Ft),$&&$.length){for(Y=0;Y<$.length;Y++)if(ot=n.nestedProperty(Et,$[Y]),dt=ot.get(),!!dt){for(it=n.nestedProperty(Z,$[Y]),wt=it.get(),Array.isArray(wt)||(wt=[],it.set(wt)),q=0;q<dt.length;q++){var Nt=dt[q];Nt===null?wt[q]=null:wt[q]=b.extendObjectWithContainers(wt[q],Nt)}it.set(wt)}}return Z},b.dataArrayContainers=["transforms","dimensions"],b.layoutArrayContainers=e.layoutArrayContainers,b.extendTrace=function(Z,st){return b.extendObjectWithContainers(Z,st,b.dataArrayContainers)},b.extendLayout=function(Z,st){return b.extendObjectWithContainers(Z,st,b.layoutArrayContainers)},b.transition=function(Z,st,$,Q,nt,Y){var q={redraw:nt.redraw},ot={},it=[];return q.prepareFn=function(){for(var dt=Array.isArray(st)?st.length:0,wt=Q.slice(0,dt),xt=0;xt<wt.length;xt++){var Ft=wt[xt],Et=Z._fullData[Ft],Nt=Et._module;if(Nt){if(Nt.animatable){var te=Nt.basePlotModule.name;ot[te]||(ot[te]=[]),ot[te].push(Ft)}Z.data[wt[xt]]=b.extendTrace(Z.data[wt[xt]],st[xt])}}var Jt=n.expandObjectPaths(n.extendDeepNoArrays({},$)),Qt=/^[xy]axis[0-9]*$/;for(var Wt in Jt)Qt.test(Wt)&&delete Jt[Wt].range;b.extendLayout(Z.layout,Jt),delete Z.calcdata,b.supplyDefaults(Z),b.doCalcdata(Z);var gt=n.expandObjectPaths($);if(gt){var bt=Z._fullLayout._plots;for(var vt in bt){var Ut=bt[vt],Kt=Ut.xaxis,Zt=Ut.yaxis,le=Kt.range.slice(),Te=Zt.range.slice(),Se=null,Fe=null,Oe=null,ur=null;Array.isArray(gt[Kt._name+".range"])?Se=gt[Kt._name+".range"].slice():Array.isArray((gt[Kt._name]||{}).range)&&(Se=gt[Kt._name].range.slice()),Array.isArray(gt[Zt._name+".range"])?Fe=gt[Zt._name+".range"].slice():Array.isArray((gt[Zt._name]||{}).range)&&(Fe=gt[Zt._name].range.slice()),le&&Se&&(Kt.r2l(le[0])!==Kt.r2l(Se[0])||Kt.r2l(le[1])!==Kt.r2l(Se[1]))&&(Oe={xr0:le,xr1:Se}),Te&&Fe&&(Zt.r2l(Te[0])!==Zt.r2l(Fe[0])||Zt.r2l(Te[1])!==Zt.r2l(Fe[1]))&&(ur={yr0:Te,yr1:Fe}),(Oe||ur)&&it.push(n.extendFlat({plotinfo:Ut},Oe,ur))}}return Promise.resolve()},q.runFn=function(dt){var wt,xt=Z._fullLayout._basePlotModules,Ft=it.length,Et;if($)for(Et=0;Et<xt.length;Et++)xt[Et].transitionAxes&&xt[Et].transitionAxes(Z,it,Y,dt);Ft?(wt=n.extendFlat({},Y),wt.duration=0,delete ot.cartesian):wt=Y;for(var Nt in ot){var te=ot[Nt],Jt=Z._fullData[te[0]]._module;Jt.basePlotModule.plot(Z,te,wt,dt)}},G(Z,Y,q)},b.transitionFromReact=function(Z,st,$,Q){var nt=Z._fullLayout,Y=nt.transition,q={},ot=[];return q.prepareFn=function(){var it=nt._plots;q.redraw=!1,st.anim==="some"&&(q.redraw=!0),$.anim==="some"&&(q.redraw=!0);for(var dt in it){var wt=it[dt],xt=wt.xaxis,Ft=wt.yaxis,Et=Q[xt._name].range.slice(),Nt=Q[Ft._name].range.slice(),te=xt.range.slice(),Jt=Ft.range.slice();xt.setScale(),Ft.setScale();var Qt=null,Wt=null;(xt.r2l(Et[0])!==xt.r2l(te[0])||xt.r2l(Et[1])!==xt.r2l(te[1]))&&(Qt={xr0:Et,xr1:te}),(Ft.r2l(Nt[0])!==Ft.r2l(Jt[0])||Ft.r2l(Nt[1])!==Ft.r2l(Jt[1]))&&(Wt={yr0:Nt,yr1:Jt}),(Qt||Wt)&&ot.push(n.extendFlat({plotinfo:wt},Qt,Wt))}return Promise.resolve()},q.runFn=function(it){for(var dt=Z._fullData,wt=Z._fullLayout,xt=wt._basePlotModules,Ft,Et,Nt,te=[],Jt=0;Jt<dt.length;Jt++)te.push(Jt);function Qt(){if(Z._fullLayout)for(var gt=0;gt<xt.length;gt++)xt[gt].transitionAxes&&xt[gt].transitionAxes(Z,ot,Ft,it)}function Wt(){if(Z._fullLayout)for(var gt=0;gt<xt.length;gt++)xt[gt].plot(Z,Nt,Et,it)}ot.length&&st.anim?Y.ordering==="traces first"?(Ft=n.extendFlat({},Y,{duration:0}),Nt=te,Et=Y,setTimeout(Qt,Y.duration),Wt()):(Ft=Y,Nt=null,Et=n.extendFlat({},Y,{duration:0}),setTimeout(Wt,Ft.duration),Qt()):ot.length?(Ft=Y,Qt()):st.anim&&(Nt=te,Et=Y,Wt())},G(Z,Y,q)};function G(Z,st,$){var Q=!1;function nt(xt){var Ft=Promise.resolve();if(!xt)return Ft;for(;xt.length;)Ft=Ft.then(xt.shift());return Ft}function Y(xt){if(xt)for(;xt.length;)xt.shift()}function q(){return Z.emit("plotly_transitioning",[]),new Promise(function(xt){Z._transitioning=!0,st.duration>0&&(Z._transitioningWithDuration=!0),Z._transitionData._interruptCallbacks.push(function(){Q=!0}),$.redraw&&Z._transitionData._interruptCallbacks.push(function(){return e.call("redraw",Z)}),Z._transitionData._interruptCallbacks.push(function(){Z.emit("plotly_transitioninterrupted",[])});var Ft=0,Et=0;function Nt(){return Ft++,function(){Et++,!Q&&Et===Ft&&ot(xt)}}$.runFn(Nt),setTimeout(Nt())})}function ot(xt){if(Z._transitionData)return Y(Z._transitionData._interruptCallbacks),Promise.resolve().then(function(){if($.redraw)return e.call("redraw",Z)}).then(function(){Z._transitioning=!1,Z._transitioningWithDuration=!1,Z.emit("plotly_transitioned",[])}).then(xt)}function it(){if(Z._transitionData)return Z._transitioning=!1,nt(Z._transitionData._interruptCallbacks)}var dt=[b.previousPromises,it,$.prepareFn,b.rehover,b.reselect,q],wt=n.syncOrAsync(dt,Z);return(!wt||!wt.then)&&(wt=Promise.resolve()),wt.then(function(){return Z})}b.doCalcdata=function(Z,st){var $=s.list(Z),Q=Z._fullData,nt=Z._fullLayout,Y,q,ot,it,dt=new Array(Q.length),wt=(Z.calcdata||[]).slice();for(Z.calcdata=dt,nt._numBoxes=0,nt._numViolins=0,nt._violinScaleGroupStats={},Z._hmpixcount=0,Z._hmlumcount=0,nt._piecolormap={},nt._sunburstcolormap={},nt._treemapcolormap={},nt._iciclecolormap={},nt._funnelareacolormap={},ot=0;ot<Q.length;ot++)if(Array.isArray(st)&&st.indexOf(ot)===-1){dt[ot]=wt[ot];continue}for(ot=0;ot<Q.length;ot++)Y=Q[ot],Y._arrayAttrs=r.findArrayAttributes(Y),Y._extremes={};var xt=nt._subplots.polar||[];for(ot=0;ot<xt.length;ot++)$.push(nt[xt[ot]].radialaxis,nt[xt[ot]].angularaxis);for(var Ft in nt._colorAxes){var Et=nt[Ft];Et.cauto!==!1&&(delete Et.cmin,delete Et.cmax)}var Nt=!1;function te(Wt){if(Y=Q[Wt],q=Y._module,Y.visible===!0&&Y.transforms){if(q&&q.calc){var gt=q.calc(Z,Y);gt[0]&>[0].t&>[0].t._scene&&delete gt[0].t._scene.dirty}for(it=0;it<Y.transforms.length;it++){var bt=Y.transforms[it];q=transformsRegistry[bt.type],q&&q.calcTransform&&(Y._hasCalcTransform=!0,Nt=!0,q.calcTransform(Z,Y,bt))}}}function Jt(Wt,gt){if(Y=Q[Wt],q=Y._module,!!q.isContainer===gt){var bt=[];if(Y.visible===!0&&Y._length!==0){delete Y._indexToPoints;var vt=Y.transforms||[];for(it=vt.length-1;it>=0;it--)if(vt[it].enabled){Y._indexToPoints=vt[it]._indexToPoints;break}q&&q.calc&&(bt=q.calc(Z,Y))}(!Array.isArray(bt)||!bt[0])&&(bt=[{x:a,y:a}]),bt[0].t||(bt[0].t={}),bt[0].trace=Y,dt[Wt]=bt}}for(lt($,Q,nt),ot=0;ot<Q.length;ot++)Jt(ot,!0);for(ot=0;ot<Q.length;ot++)te(ot);for(Nt&<($,Q,nt),ot=0;ot<Q.length;ot++)Jt(ot,!0);for(ot=0;ot<Q.length;ot++)Jt(ot,!1);tt(Z);var Qt=ct($,Z);if(Qt.length){for(nt._numBoxes=0,nt._numViolins=0,ot=0;ot<Qt.length;ot++)Jt(Qt[ot],!0);for(ot=0;ot<Qt.length;ot++)Jt(Qt[ot],!1);tt(Z)}e.getComponentMethod("fx","calc")(Z),e.getComponentMethod("errorbars","calc")(Z)};var rt=/(total|sum|min|max|mean|geometric mean|median) (ascending|descending)/;function ct(Z,st){var $=[],Q,nt,Y,q,ot;function it(kr,he,Dt){var qt=he._id.charAt(0);if(kr==="histogram2dcontour"){var zt=he._counterAxes[0],ut=s.getFromId(st,zt),yt=qt==="x"||zt==="x"&&ut.type==="category",Mt=qt==="y"||zt==="y"&&ut.type==="category";return function(Ot,$t){return Ot===0||$t===0||yt&&Ot===Dt[$t].length-1||Mt&&$t===Dt.length-1?-1:(qt==="y"?$t:Ot)-1}}else return function(Ot,$t){return qt==="y"?$t:Ot}}var dt={min:function(kr){return n.aggNums(Math.min,null,kr)},max:function(kr){return n.aggNums(Math.max,null,kr)},sum:function(kr){return n.aggNums(function(he,Dt){return he+Dt},null,kr)},total:function(kr){return n.aggNums(function(he,Dt){return he+Dt},null,kr)},mean:function(kr){return n.mean(kr)},"geometric mean":function(kr){return n.geometricMean(kr)},median:function(kr){return n.median(kr)}};function wt(kr,he){return kr[1]-he[1]}function xt(kr,he){return he[1]-kr[1]}for(Q=0;Q<Z.length;Q++){var Ft=Z[Q];if(Ft.type==="category"){var Et=Ft.categoryorder.match(rt);if(Et){var Nt=Et[1],te=Et[2],Jt=Ft._id.charAt(0),Qt=Jt==="x",Wt=[];for(nt=0;nt<Ft._categories.length;nt++)Wt.push([Ft._categories[nt],[]]);for(nt=0;nt<Ft._traceIndices.length;nt++){var gt=Ft._traceIndices[nt],bt=st._fullData[gt];if(bt.visible===!0){var vt=bt.type;e.traceIs(bt,"histogram")&&(delete bt._xautoBinFinished,delete bt._yautoBinFinished);var Ut=vt==="splom",Kt=vt==="scattergl",Zt=st.calcdata[gt];for(Y=0;Y<Zt.length;Y++){var le=Zt[Y],Te,Se;if(Ut){var Fe=bt._axesDim[Ft._id];if(!Qt){var Oe=bt._diag[Fe][0];Oe&&(Ft=st._fullLayout[s.id2name(Oe)])}var ur=le.trace.dimensions[Fe].values;for(q=0;q<ur.length;q++)for(Te=Ft._categoriesMap[ur[q]],ot=0;ot<le.trace.dimensions.length;ot++)if(ot!==Fe){var fr=le.trace.dimensions[ot];Wt[Te][1].push(fr.values[q])}}else if(Kt){for(q=0;q<le.t.x.length;q++)Qt?(Te=le.t.x[q],Se=le.t.y[q]):(Te=le.t.y[q],Se=le.t.x[q]),Wt[Te][1].push(Se);le.t&&le.t._scene&&delete le.t._scene.dirty}else if(le.hasOwnProperty("z")){Se=le.z;var We=it(bt.type,Ft,Se);for(q=0;q<Se.length;q++)for(ot=0;ot<Se[q].length;ot++)Te=We(ot,q),Te+1&&Wt[Te][1].push(Se[q][ot])}else for(Te=le.p,Te===void 0&&(Te=le[Jt]),Se=le.s,Se===void 0&&(Se=le.v),Se===void 0&&(Se=Qt?le.y:le.x),Array.isArray(Se)||(Se===void 0?Se=[]:Se=[Se]),q=0;q<Se.length;q++)Wt[Te][1].push(Se[q])}}}Ft._categoriesValue=Wt;var Lr=[];for(nt=0;nt<Wt.length;nt++)Lr.push([Wt[nt][0],dt[Nt](Wt[nt][1])]);Lr.sort(te==="descending"?xt:wt),Ft._categoriesAggregatedValue=Lr,Ft._initialCategories=Lr.map(function(kr){return kr[0]}),$=$.concat(Ft.sortByInitialCategories())}}}return $}function lt(Z,st,$){var Q={};function nt(it){it.clearCalc(),it.type==="multicategory"&&it.setupMultiCategory(st),Q[it._id]=1}n.simpleMap(Z,nt);for(var Y=$._axisMatchGroups||[],q=0;q<Y.length;q++)for(var ot in Y[q])Q[ot]||nt($[s.id2name(ot)])}function tt(Z){var st=Z._fullLayout,$=st._visibleModules,Q={},nt,Y,q;for(Y=0;Y<$.length;Y++){var ot=$[Y],it=ot.crossTraceCalc;if(it){var dt=ot.basePlotModule.name;Q[dt]?n.pushUnique(Q[dt],it):Q[dt]=[it]}}for(q in Q){var wt=Q[q],xt=st._subplots[q];if(Array.isArray(xt))for(nt=0;nt<xt.length;nt++){var Ft=xt[nt],Et=q==="cartesian"?st._plots[Ft]:st[Ft];for(Y=0;Y<wt.length;Y++)wt[Y](Z,Et,Ft)}else for(Y=0;Y<wt.length;Y++)wt[Y](Z)}}b.rehover=function(Z){Z._fullLayout._rehover&&Z._fullLayout._rehover()},b.redrag=function(Z){Z._fullLayout._redrag&&Z._fullLayout._redrag()},b.reselect=function(Z){var st=Z._fullLayout,$=(Z.layout||{}).selections,Q=st._previousSelections;st._previousSelections=$;var nt=st._reselect||JSON.stringify($)!==JSON.stringify(Q);e.getComponentMethod("selections","reselect")(Z,nt)},b.generalUpdatePerTraceModule=function(Z,st,$,Q){var nt=st.traceHash,Y={},q;for(q=0;q<$.length;q++){var ot=$[q],it=ot[0].trace;it.visible&&(Y[it.type]=Y[it.type]||[],Y[it.type].push(ot))}for(var dt in nt)if(!Y[dt]){var wt=nt[dt][0],xt=wt[0].trace;xt.visible=!1,Y[dt]=[wt]}for(var Ft in Y){var Et=Y[Ft],Nt=Et[0][0].trace._module;Nt.plot(Z,st,n.filterVisible(Et),Q)}st.traceHash=Y},b.plotBasePlot=function(Z,st,$,Q,nt){var Y=e.getModule(Z),q=y(st.calcdata,Y)[0];Y.plot(st,q,Q,nt)},b.cleanBasePlot=function(Z,st,$,Q,nt){var Y=nt._has&&nt._has(Z),q=$._has&&$._has(Z);Y&&!q&&nt["_"+Z+"layer"].selectAll("g.trace").remove()}}),Cf=Vt(X=>{X.xmlns="http://www.w3.org/2000/xmlns/",X.svg="http://www.w3.org/2000/svg",X.xlink="http://www.w3.org/1999/xlink",X.svgAttrs={xmlns:X.svg,"xmlns:xlink":X.xlink}}),nh=Vt((X,V)=>{V.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}}),sl=Vt(X=>{var V=Ai(),c=qr(),g=c.strTranslate,E=Cf(),A=nh().LINE_SPACING,t=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;X.convertToTspans=function(L,F,N){var j=L.text(),G=!L.attr("data-notex")&&F&&F._context.typesetMath&&typeof MathJax<"u"&&j.match(t),rt=V.select(L.node().parentNode);if(rt.empty())return;var ct=L.attr("class")?L.attr("class").split(" ")[0]:"text";ct+="-math",rt.selectAll("svg."+ct).remove(),rt.selectAll("g."+ct+"-group").remove(),L.style("display",null).attr({"data-unformatted":j,"data-math":"N"});function lt(){rt.empty()||(ct=L.attr("class")+"-math",rt.select("svg."+ct).remove()),L.text("").style("white-space","pre");var tt=I(L.node(),j);tt&&L.style("pointer-events","all"),X.positionText(L),N&&N.call(L)}return G?(F&&F._promises||[]).push(new Promise(function(tt){L.style("display","none");var Z=parseInt(L.node().style.fontSize,10),st={fontSize:Z};o(G[2],st,function($,Q,nt){rt.selectAll("svg."+ct).remove(),rt.selectAll("g."+ct+"-group").remove();var Y=$&&$.select("svg");if(!Y||!Y.node()){lt(),tt();return}var q=rt.append("g").classed(ct+"-group",!0).attr({"pointer-events":"none","data-unformatted":j,"data-math":"Y"});q.node().appendChild(Y.node()),Q&&Q.node()&&Y.node().insertBefore(Q.node().cloneNode(!0),Y.node().firstChild);var ot=nt.width,it=nt.height;Y.attr({class:ct,height:it,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var dt=L.node().style.fill||"black",wt=Y.select("g");wt.attr({fill:dt,stroke:dt});var xt=wt.node().getBoundingClientRect(),Ft=xt.width,Et=xt.height;(Ft>ot||Et>it)&&(Y.style("overflow","hidden"),xt=Y.node().getBoundingClientRect(),Ft=xt.width,Et=xt.height);var Nt=+L.attr("x"),te=+L.attr("y"),Jt=Z||L.node().getBoundingClientRect().height,Qt=-Jt/4;if(ct[0]==="y")q.attr({transform:"rotate("+[-90,Nt,te]+")"+g(-Ft/2,Qt-Et/2)});else if(ct[0]==="l")te=Qt-Et/2;else if(ct[0]==="a"&&ct.indexOf("atitle")!==0)Nt=0,te=Qt;else{var Wt=L.attr("text-anchor");Nt=Nt-Ft*(Wt==="middle"?.5:Wt==="end"?1:0),te=te+Qt-Et/2}Y.attr({x:Nt,y:te}),N&&N.call(L,q),tt(q)})})):lt(),L};var e=/(<|<|<)/g,r=/(>|>|>)/g;function i(L){return L.replace(e,"\\lt ").replace(r,"\\gt ")}var n=[["$","$"],["\\(","\\)"]];function o(L,F,N){var j=parseInt((MathJax.version||"").split(".")[0]);if(j!==2&&j!==3){c.warn("No MathJax version:",MathJax.version);return}var G,rt,ct,lt,tt=function(){return rt=c.extendDeepAll({},MathJax.Hub.config),ct=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:n},displayAlign:"left"})},Z=function(){rt=c.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=n},st=function(){if(G=MathJax.Hub.config.menuSettings.renderer,G!=="SVG")return MathJax.Hub.setRenderer("SVG")},$=function(){G=MathJax.config.startup.output,G!=="svg"&&(MathJax.config.startup.output="svg")},Q=function(){var dt="math-output-"+c.randstr({},64);lt=V.select("body").append("div").attr({id:dt}).style({visibility:"hidden",position:"absolute","font-size":F.fontSize+"px"}).text(i(L));var wt=lt.node();return j===2?MathJax.Hub.Typeset(wt):MathJax.typeset([wt])},nt=function(){var dt=lt.select(j===2?".MathJax_SVG":".MathJax"),wt=!dt.empty()&<.select("svg").node();if(!wt)c.log("There was an error in the tex syntax.",L),N();else{var xt=wt.getBoundingClientRect(),Ft;j===2?Ft=V.select("body").select("#MathJax_SVG_glyphs"):Ft=dt.select("defs"),N(dt,Ft,xt)}lt.remove()},Y=function(){if(G!=="SVG")return MathJax.Hub.setRenderer(G)},q=function(){G!=="svg"&&(MathJax.config.startup.output=G)},ot=function(){return ct!==void 0&&(MathJax.Hub.processSectionDelay=ct),MathJax.Hub.Config(rt)},it=function(){MathJax.config=rt};j===2?MathJax.Hub.Queue(tt,st,Q,nt,Y,ot):j===3&&(Z(),$(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){Q(),nt(),q(),it()}))}var a={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},s={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},v="",m=["http:","https:","mailto:","",void 0,":"],p=X.NEWLINES=/(\r\n?|\n)/g,y=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=/<br(\s+.*)?>/i;X.BR_TAG_ALL=/<br(\s+.*)?>/gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,S=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,T=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function w(L,F){if(!L)return null;var N=L.match(F),j=N&&(N[3]||N[4]);return j&&_(j)}var u=/(^|;)\s*color:/;X.plainText=function(L,F){F=F||{};for(var N=F.len!==void 0&&F.len!==-1?F.len:1/0,j=F.allowedTags!==void 0?F.allowedTags:["br"],G="...",rt=G.length,ct=L.split(y),lt=[],tt="",Z=0,st=0;st<ct.length;st++){var $=ct[st],Q=$.match(l),nt=Q&&Q[2].toLowerCase();if(nt)j.indexOf(nt)!==-1&&(lt.push($),tt=nt);else{var Y=$.length;if(Z+Y<N)lt.push($),Z+=Y;else if(Z<N){var q=N-Z;tt&&(tt!=="br"||q<=rt||Y<=rt)&<.pop(),N>rt?lt.push($.substr(0,q-rt)+G):lt.push($.substr(0,q));break}tt=""}}return lt.join("")};var f={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},k=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function _(L){return L.replace(k,function(F,N){var j;return N.charAt(0)==="#"?j=D(N.charAt(1)==="x"?parseInt(N.substr(2),16):parseInt(N.substr(1),10)):j=f[N],j||F})}X.convertEntities=_;function D(L){if(!(L>1114111)){var F=String.fromCodePoint;if(F)return F(L);var N=String.fromCharCode;return L<=65535?N(L):N((L>>10)+55232,L%1024+56320)}}function I(L,F){F=F.replace(p," ");var N=!1,j=[],G,rt=-1;function ct(){rt++;var Et=document.createElementNS(E.svg,"tspan");V.select(Et).attr({class:"line",dy:rt*A+"em"}),L.appendChild(Et),G=Et;var Nt=j;if(j=[{node:Et}],Nt.length>1)for(var te=1;te<Nt.length;te++)lt(Nt[te])}function lt(Et){var Nt=Et.type,te={},Jt;if(Nt==="a"){Jt="a";var Qt=Et.target,Wt=Et.href,gt=Et.popup;Wt&&(te={"xlink:xlink:show":Qt==="_blank"||Qt.charAt(0)!=="_"?"new":"replace",target:Qt,"xlink:xlink:href":Wt},gt&&(te.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+gt+'");return false;'))}else Jt="tspan";Et.style&&(te.style=Et.style);var bt=document.createElementNS(E.svg,Jt);if(Nt==="sup"||Nt==="sub"){tt(G,v),G.appendChild(bt);var vt=document.createElementNS(E.svg,"tspan");tt(vt,v),V.select(vt).attr("dy",h[Nt]),te.dy=s[Nt],G.appendChild(bt),G.appendChild(vt)}else G.appendChild(bt);V.select(bt).attr(te),G=Et.node=bt,j.push(Et)}function tt(Et,Nt){Et.appendChild(document.createTextNode(Nt))}function Z(Et){if(j.length===1){c.log("Ignoring unexpected end tag </"+Et+">.",F);return}var Nt=j.pop();Et!==Nt.type&&c.log("Start tag <"+Nt.type+"> doesnt match end tag <"+Et+">. Pretending it did match.",F),G=j[j.length-1].node}var st=x.test(F);st?ct():(G=L,j=[{node:L}]);for(var $=F.split(y),Q=0;Q<$.length;Q++){var nt=$[Q],Y=nt.match(l),q=Y&&Y[2].toLowerCase(),ot=a[q];if(q==="br")ct();else if(ot===void 0)tt(G,_(nt));else if(Y[1])Z(q);else{var it=Y[4],dt={type:q},wt=w(it,b);if(wt?(wt=wt.replace(u,"$1 fill:"),ot&&(wt+=";"+ot)):ot&&(wt=ot),wt&&(dt.style=wt),q==="a"){N=!0;var xt=w(it,S);if(xt){var Ft=O(xt);Ft&&(dt.href=Ft,dt.target=w(it,T)||"_blank",dt.popup=w(it,M))}}lt(dt)}}return N}function O(L){var F=encodeURI(decodeURI(L)),N=document.createElement("a"),j=document.createElement("a");N.href=L,j.href=F;var G=N.protocol,rt=j.protocol;return m.indexOf(G)!==-1&&m.indexOf(rt)!==-1?F:""}X.sanitizeHTML=function(L){L=L.replace(p," ");for(var F=document.createElement("p"),N=F,j=[],G=L.split(y),rt=0;rt<G.length;rt++){var ct=G[rt],lt=ct.match(l),tt=lt&<[2].toLowerCase();if(tt in a)if(lt[1])j.length&&(N=j.pop());else{var Z=lt[4],st=w(Z,b),$=st?{style:st}:{};if(tt==="a"){var Q=w(Z,S);if(Q){var nt=O(Q);if(nt){$.href=nt;var Y=w(Z,T);Y&&($.target=Y)}}}var q=document.createElement(tt);N.appendChild(q),V.select(q).attr($),N=q,j.push(q)}else N.appendChild(document.createTextNode(_(ct)))}var ot="innerHTML";return F[ot]},X.lineCount=function(L){return L.selectAll("tspan.line").size()||1},X.positionText=function(L,F,N){return L.each(function(){var j=V.select(this);function G(lt,tt){return tt===void 0?(tt=j.attr(lt),tt===null&&(j.attr(lt,0),tt=0)):j.attr(lt,tt),tt}var rt=G("x",F),ct=G("y",N);this.nodeName==="text"&&j.selectAll("tspan.line").attr({x:rt,y:ct})})};function B(L,F,N){var j=N.horizontalAlign,G=N.verticalAlign||"top",rt=L.node().getBoundingClientRect(),ct=F.node().getBoundingClientRect(),lt,tt,Z;return G==="bottom"?tt=function(){return rt.bottom-lt.height}:G==="middle"?tt=function(){return rt.top+(rt.height-lt.height)/2}:tt=function(){return rt.top},j==="right"?Z=function(){return rt.right-lt.width}:j==="center"?Z=function(){return rt.left+(rt.width-lt.width)/2}:Z=function(){return rt.left},function(){lt=this.node().getBoundingClientRect();var st=Z()-ct.left,$=tt()-ct.top,Q=N.gd||{};if(N.gd){Q._fullLayout._calcInverseTransform(Q);var nt=c.apply3DTransform(Q._fullLayout._invTransform)(st,$);st=nt[0],$=nt[1]}return this.style({top:$+"px",left:st+"px","z-index":1e3}),this}}var R="1px ";X.makeTextShadow=function(L){var F=R,N=R,j=R;return F+N+j+L+", -"+F+"-"+N+j+L+", "+F+"-"+N+j+L+", -"+F+N+j+L},X.makeEditable=function(L,F){var N=F.gd,j=F.delegate,G=V.dispatch("edit","input","cancel"),rt=j||L;if(L.style({"pointer-events":j?"none":"all"}),L.size()!==1)throw new Error("boo");function ct(){tt(),L.style({opacity:0});var Z=rt.attr("class"),st;Z?st="."+Z.split(" ")[0]+"-math-group":st="[class*=-math-group]",st&&V.select(L.node().parentNode).select(st).style({opacity:0})}function lt(Z){var st=Z.node(),$=document.createRange();$.selectNodeContents(st);var Q=window.getSelection();Q.removeAllRanges(),Q.addRange($),st.focus()}function tt(){var Z=V.select(N),st=Z.select(".svg-container"),$=st.append("div"),Q=L.node().style,nt=parseFloat(Q.fontSize||12),Y=F.text;Y===void 0&&(Y=L.attr("data-unformatted")),$.classed("plugin-editable editable",!0).style({position:"absolute","font-family":Q.fontFamily||"Arial","font-size":nt,color:F.fill||Q.fill||"black",opacity:1,"background-color":F.background||"transparent",outline:"#ffffff33 1px solid",margin:[-nt/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(Y).call(B(L,st,F)).on("blur",function(){N._editing=!1,L.text(this.textContent).style({opacity:1});var q=V.select(this).attr("class"),ot;q?ot="."+q.split(" ")[0]+"-math-group":ot="[class*=-math-group]",ot&&V.select(L.node().parentNode).select(ot).style({opacity:0});var it=this.textContent;V.select(this).transition().duration(0).remove(),V.select(document).on("mouseup",null),G.edit.call(L,it)}).on("focus",function(){var q=this;N._editing=!0,V.select(document).on("mouseup",function(){if(V.event.target===q)return!1;document.activeElement===$.node()&&$.node().blur()})}).on("keyup",function(){V.event.which===27?(N._editing=!1,L.style({opacity:1}),V.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),G.cancel.call(L,this.textContent)):(G.input.call(L,this.textContent),V.select(this).call(B(L,st,F)))}).on("keydown",function(){V.event.which===13&&this.blur()}).call(lt)}return F.immediate?ct():rt.on("click",ct),V.rebind(L,G,"on")}}),pf=Vt((X,V)=>{var c=Ai(),g=yh(),E=vo(),A=qr(),t=vi(),e=i0().isValid;function r(p,y,l){var x=y?A.nestedProperty(p,y).get()||{}:p,b=x[l||"color"];b&&b._inputArray&&(b=b._inputArray);var S=!1;if(A.isArrayOrTypedArray(b)){for(var T=0;T<b.length;T++)if(E(b[T])){S=!0;break}}return A.isPlainObject(x)&&(S||x.showscale===!0||E(x.cmin)&&E(x.cmax)||e(x.colorscale)||A.isPlainObject(x.colorbar))}var i=["showscale","autocolorscale","colorscale","reversescale","colorbar"],n=["min","max","mid","auto"];function o(p){var y=p._colorAx,l=y||p,x={},b,S,T;for(S=0;S<i.length;S++)T=i[S],x[T]=l[T];if(y)for(b="c",S=0;S<n.length;S++)T=n[S],x[T]=l["c"+T];else{var M;for(S=0;S<n.length;S++){if(T=n[S],M="c"+T,M in l){x[T]=l[M];continue}M="z"+T,M in l&&(x[T]=l[M])}b=M.charAt(0)}return x._sync=function(w,u){var f=n.indexOf(w)!==-1?b+w:w;l[f]=l["_"+f]=u},x}function a(p){for(var y=o(p),l=y.min,x=y.max,b=y.reversescale?s(y.colorscale):y.colorscale,S=b.length,T=new Array(S),M=new Array(S),w=0;w<S;w++){var u=b[w];T[w]=l+u[0]*(x-l),M[w]=u[1]}return{domain:T,range:M}}function s(p){for(var y=p.length,l=new Array(y),x=y-1,b=0;x>=0;x--,b++){var S=p[x];l[b]=[1-S[0],S[1]]}return l}function h(p,y){y=y||{};for(var l=p.domain,x=p.range,b=x.length,S=new Array(b),T=0;T<b;T++){var M=g(x[T]).toRgb();S[T]=[M.r,M.g,M.b,M.a]}var w=c.scale.linear().domain(l).range(S).clamp(!0),u=y.noNumericCheck,f=y.returnArray,k;return u&&f?k=w:u?k=function(_){return m(w(_))}:f?k=function(_){return E(_)?w(_):g(_).isValid()?_:t.defaultLine}:k=function(_){return E(_)?m(w(_)):g(_).isValid()?_:t.defaultLine},k.domain=w.domain,k.range=function(){return x},k}function v(p,y){return h(a(p),y)}function m(p){var y={r:p[0],g:p[1],b:p[2],a:p[3]};return g(y).toRgbString()}V.exports={hasColorscale:r,extractOpts:o,extractScale:a,flipScale:s,makeColorScaleFunc:h,makeColorScaleFuncFromTrace:v}}),qu=Vt((X,V)=>{var c=J_(),g=c.FORMAT_LINK,E=c.DATE_FORMAT_LINK;function A(r,i){return{valType:"string",dflt:"",editType:"none",description:(i?t:e)("hover text",r)+["By default the values are formatted using "+(i?"generic number format":"`"+r+"axis.hoverformat`")+"."].join(" ")}}function t(r,i){return["Sets the "+r+" formatting rule"+(i?"for `"+i+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+g+"."].join(" ")}function e(r,i){return t(r,i)+[" And for dates see: "+E+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}V.exports={axisHoverFormat:A,descriptionOnlyNumbers:t,descriptionWithDates:e}}),Ih=Vt((X,V)=>{var c=Nl(),g=Hc(),E=Eh().dash,A=po().extendFlat,t=Ns().templatedArray,e=qu().descriptionWithDates,r=ts().ONEDAY,i=xh(),n=i.HOUR_PATTERN,o=i.WEEKDAY_PATTERN,a={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},s=A({},a,{values:a.values.slice().concat(["sync"])});function h(u){return{valType:"integer",min:0,dflt:u?5:0,editType:"ticks"}}var v={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},m={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},p={valType:"data_array",editType:"ticks"},y={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function l(u){var f={valType:"number",min:0,editType:"ticks"};return u||(f.dflt=5),f}function x(u){var f={valType:"number",min:0,editType:"ticks"};return u||(f.dflt=1),f}var b={valType:"color",dflt:g.defaultLine,editType:"ticks"},S={valType:"color",dflt:g.lightLine,editType:"ticks"};function T(u){var f={valType:"number",min:0,editType:"ticks"};return u||(f.dflt=1),f}var M=A({},E,{editType:"ticks"}),w={valType:"boolean",editType:"ticks"};V.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:g.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:c({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},scaleanchor:{valType:"enumerated",values:[i.idRegex.x.toString(),i.idRegex.y.toString(),!1],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[i.idRegex.x.toString(),i.idRegex.y.toString()],editType:"calc"},rangebreaks:t("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[o,n,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:r},editType:"calc"}),tickmode:s,nticks:h(),tick0:v,dtick:m,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:p,ticktext:{valType:"data_array",editType:"ticks"},ticks:y,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc"},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks"},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks"},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:l(),tickwidth:x(),tickcolor:b,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},labelalias:{valType:"any",dflt:!1,editType:"ticks"},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:A({},E,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:c({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks",description:e("tick label")},tickformatstops:t("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:e("hover text")},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:g.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:w,gridcolor:S,gridwidth:T(),griddash:M,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:g.defaultLine,editType:"ticks"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:g.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",i.idRegex.x.toString(),i.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",i.idRegex.x.toString(),i.idRegex.y.toString()],editType:"plot"},minor:{tickmode:a,nticks:h("minor"),tick0:v,dtick:m,tickvals:p,ticks:y,ticklen:l("minor"),tickwidth:x("minor"),tickcolor:b,gridcolor:S,gridwidth:T("minor"),griddash:M,showgrid:w,editType:"ticks"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},autoshift:{valType:"boolean",dflt:!1,editType:"plot"},shift:{valType:"number",editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),jy=Vt((X,V)=>{var c=Ih(),g=Nl(),E=po().extendFlat,A=su().overrideAll;V.exports=A({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:c.linecolor,outlinewidth:c.linewidth,bordercolor:c.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:c.minor.tickmode,nticks:c.nticks,tick0:c.tick0,dtick:c.dtick,tickvals:c.tickvals,ticktext:c.ticktext,ticks:E({},c.ticks,{dflt:""}),ticklabeloverflow:E({},c.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:c.ticklen,tickwidth:c.tickwidth,tickcolor:c.tickcolor,ticklabelstep:c.ticklabelstep,showticklabels:c.showticklabels,labelalias:c.labelalias,tickfont:g({}),tickangle:c.tickangle,tickformat:c.tickformat,tickformatstops:c.tickformatstops,tickprefix:c.tickprefix,showtickprefix:c.showtickprefix,ticksuffix:c.ticksuffix,showticksuffix:c.showticksuffix,separatethousands:c.separatethousands,exponentformat:c.exponentformat,minexponent:c.minexponent,showexponent:c.showexponent,title:{text:{valType:"string"},font:g({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}),wl=Vt((X,V)=>{var c=jy(),g=gg().counter,E=Td(),A=i0().scales;E(A);function t(e){return"`"+e+"`"}V.exports=function(e,r){e=e||"",r=r||{};var i=r.cLetter||"c";"onlyIfNumerical"in r&&r.onlyIfNumerical;var n="noScale"in r?r.noScale:e==="marker.line",o="showScaleDflt"in r?r.showScaleDflt:i==="z",a=typeof r.colorscaleDflt=="string"?A[r.colorscaleDflt]:null,s=r.editTypeOverride||"",h=e?e+".":"",v;"colorAttr"in r?(v=r.colorAttr,r.colorAttr):(v={z:"z",c:"color"}[i],""+t(h+v));var m=i+"auto",p=i+"min",y=i+"max",l=i+"mid",x={};x[p]=x[y]=void 0;var b={};b[m]=!1;var S={};return v==="color"&&(S.color={valType:"color",arrayOk:!0,editType:s||"style"},r.anim&&(S.color.anim=!0)),S[m]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:x},S[p]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:b},S[y]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:b},S[l]={valType:"number",dflt:null,editType:"calc",impliedEdits:x},S.colorscale={valType:"colorscale",editType:"calc",dflt:a,impliedEdits:{autocolorscale:!1}},S.autocolorscale={valType:"boolean",dflt:r.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0}},S.reversescale={valType:"boolean",dflt:!1,editType:"plot"},n||(S.showscale={valType:"boolean",dflt:o,editType:"calc"},S.colorbar=c),r.noColorAxis||(S.coloraxis={valType:"subplotid",regex:g("coloraxis"),dflt:null,editType:"calc"}),S}}),eb=Vt((X,V)=>{var c=po().extendFlat,g=wl(),E=i0().scales;V.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:E.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:E.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:E.RdBu,editType:"calc"}},coloraxis:c({_isSubplotObj:!0,editType:"calc"},g("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}),rb=Vt((X,V)=>{var c=qr();V.exports=function(g){return c.isPlainObject(g.colorbar)}}),nb=Vt(X=>{var V=vo(),c=qr(),g=ts(),E=g.ONEDAY,A=g.ONEWEEK;X.dtick=function(t,e){var r=e==="log",i=e==="date",n=e==="category",o=i?E:1;if(!t)return o;if(V(t))return t=Number(t),t<=0?o:n?Math.max(1,Math.round(t)):i?Math.max(.1,t):t;if(typeof t!="string"||!(i||r))return o;var a=t.charAt(0),s=t.substr(1);return s=V(s)?Number(s):0,s<=0||!(i&&a==="M"&&s===Math.round(s)||r&&a==="L"||r&&a==="D"&&(s===1||s===2))?o:t},X.tick0=function(t,e,r,i){if(e==="date")return c.cleanDate(t,c.dateTick0(r,i%A===0?1:0));if(!(i==="D1"||i==="D2"))return V(t)?Number(t):0}}),l0=Vt((X,V)=>{var c=nb(),g=qr().isArrayOrTypedArray,E=nf().isTypedArraySpec,A=nf().decodeTypedArraySpec;V.exports=function(t,e,r,i,n){n||(n={});var o=n.isMinor,a=o?t.minor||{}:t,s=o?e.minor:e,h=o?"minor.":"";function v(T){var M=a[T];return E(M)&&(M=A(M)),M!==void 0?M:(s._template||{})[T]}var m=v("tick0"),p=v("dtick"),y=v("tickvals"),l=g(y)?"array":p?"linear":"auto",x=r(h+"tickmode",l);if(x==="auto"||x==="sync")r(h+"nticks");else if(x==="linear"){var b=s.dtick=c.dtick(p,i);s.tick0=c.tick0(m,i,e.calendar,b)}else if(i!=="multicategory"){var S=r(h+"tickvals");S===void 0?s.tickmode="auto":o||r("ticktext")}}}),xg=Vt((X,V)=>{var c=qr(),g=Ih();V.exports=function(E,A,t,e){var r=e.isMinor,i=r?E.minor||{}:E,n=r?A.minor:A,o=r?g.minor:g,a=r?"minor.":"",s=c.coerce2(i,n,o,"ticklen",r?(A.ticklen||5)*.6:void 0),h=c.coerce2(i,n,o,"tickwidth",r?A.tickwidth||1:void 0),v=c.coerce2(i,n,o,"tickcolor",(r?A.tickcolor:void 0)||n.color),m=t(a+"ticks",!r&&e.outerTicks||s||h||v?"outside":"");m||(delete n.ticklen,delete n.tickwidth,delete n.tickcolor)}}),ab=Vt((X,V)=>{V.exports=function(c){var g=["showexponent","showtickprefix","showticksuffix"],E=g.filter(function(t){return c[t]!==void 0}),A=function(t){return c[t]===c[E[0]]};if(E.every(A)||E.length===1)return c[E[0]]}}),Gh=Vt((X,V)=>{var c=qr(),g=Ns();V.exports=function(E,A,t){var e=t.name,r=t.inclusionAttr||"visible",i=A[e],n=c.isArrayOrTypedArray(E[e])?E[e]:[],o=A[e]=[],a=g.arrayTemplater(A,e,r),s,h;for(s=0;s<n.length;s++){var v=n[s];c.isPlainObject(v)?h=a.newItem(v):(h=a.newItem({}),h[r]=!1),h._index=s,h[r]!==!1&&t.handleItemDefaults(v,h,A,t),o.push(h)}var m=a.defaultItems();for(s=0;s<m.length;s++)h=m[s],h._index=o.length,t.handleItemDefaults({},h,A,t,{}),o.push(h);if(c.isArrayOrTypedArray(i)){var p=Math.min(i.length,o.length);for(s=0;s<p;s++)c.relinkPrivateKeys(o[s],i[s])}return o}}),Ad=Vt((X,V)=>{var c=qr(),g=vi().contrast,E=Ih(),A=ab(),t=Gh();V.exports=function(r,i,n,o,a){a||(a={});var s=n("labelalias");c.isPlainObject(s)||delete i.labelalias;var h=A(r),v=n("showticklabels");if(v){a.noTicklabelshift||n("ticklabelshift"),a.noTicklabelstandoff||n("ticklabelstandoff");var m=a.font||{},p=i.color,y=i.ticklabelposition||"",l=y.indexOf("inside")!==-1?g(a.bgColor):p&&p!==E.color.dflt?p:m.color;if(c.coerceFont(n,"tickfont",m,{overrideDflt:{color:l}}),!a.noTicklabelstep&&o!=="multicategory"&&o!=="log"&&n("ticklabelstep"),!a.noAng){var x=n("tickangle");!a.noAutotickangles&&x==="auto"&&n("autotickangles")}if(o!=="category"){var b=n("tickformat");t(r,i,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:e}),i.tickformatstops.length||delete i.tickformatstops,!a.noExp&&!b&&o!=="date"&&(n("showexponent",h),n("exponentformat"),n("minexponent"),n("separatethousands"))}}};function e(r,i){function n(a,s){return c.coerce(r,i,E.tickformatstops,a,s)}var o=n("enabled");o&&(n("dtickrange"),n("value"))}}),Md=Vt((X,V)=>{var c=ab();V.exports=function(g,E,A,t,e){e||(e={});var r=e.tickSuffixDflt,i=c(g),n=A("tickprefix");n&&A("showtickprefix",i);var o=A("ticksuffix",r);o&&A("showticksuffix",i)}}),ib=Vt((X,V)=>{var c=qr(),g=Ns(),E=l0(),A=xg(),t=Ad(),e=Md(),r=jy();V.exports=function(i,n,o){var a=g.newContainer(n,"colorbar"),s=i.colorbar||{};function h(L,F){return c.coerce(s,a,r,L,F)}var v=o.margin||{t:0,b:0,l:0,r:0},m=o.width-v.l-v.r,p=o.height-v.t-v.b,y=h("orientation"),l=y==="v",x=h("thicknessmode");h("thickness",x==="fraction"?30/(l?m:p):30);var b=h("lenmode");h("len",b==="fraction"?1:l?p:m);var S=h("yref"),T=h("xref"),M=S==="paper",w=T==="paper",u,f,k,_="left";l?(k="middle",_=w?"left":"right",u=w?1.02:1,f=.5):(k=M?"bottom":"top",_="center",u=.5,f=M?1.02:1),c.coerce(s,a,{x:{valType:"number",min:w?-2:0,max:w?3:1,dflt:u}},"x"),c.coerce(s,a,{y:{valType:"number",min:M?-2:0,max:M?3:1,dflt:f}},"y"),h("xanchor",_),h("xpad"),h("yanchor",k),h("ypad"),c.noneOrAll(s,a,["x","y"]),h("outlinecolor"),h("outlinewidth"),h("bordercolor"),h("borderwidth"),h("bgcolor");var D=c.coerce(s,a,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:l?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");h("ticklabeloverflow",D.indexOf("inside")!==-1?"hide past domain":"hide past div"),E(s,a,h,"linear");var I=o.font,O={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:I};D.indexOf("inside")!==-1&&(O.bgColor="black"),e(s,a,h,"linear",O),t(s,a,h,"linear",O),A(s,a,h,"linear",O),h("title.text",o._dfltTitle.colorbar);var B=a.showticklabels?a.tickfont:I,R=c.extendFlat({},I,{family:B.family,size:c.bigFont(B.size)});c.coerceFont(h,"title.font",R),h("title.side",l?"top":"right")}}),ah=Vt((X,V)=>{var c=vo(),g=qr(),E=rb(),A=ib(),t=i0().isValid,e=Mi().traceIs;function r(i,n){var o=n.slice(0,n.length-1);return n?g.nestedProperty(i,o).get()||{}:i}V.exports=function i(n,o,a,s,h){var v=h.prefix,m=h.cLetter,p="_module"in o,y=r(n,v),l=r(o,v),x=r(o._template||{},v)||{},b=function(){return delete n.coloraxis,delete o.coloraxis,i(n,o,a,s,h)};if(p){var S=a._colorAxes||{},T=s(v+"coloraxis");if(T){var M=e(o,"contour")&&g.nestedProperty(o,"contours.coloring").get()||"heatmap",w=S[T];w?(w[2].push(b),w[0]!==M&&(w[0]=!1,g.warn(["Ignoring coloraxis:",T,"setting","as it is linked to incompatible colorscales."].join(" ")))):S[T]=[M,o,[b]];return}}var u=y[m+"min"],f=y[m+"max"],k=c(u)&&c(f)&&u<f,_=s(v+m+"auto",!k);_?s(v+m+"mid"):(s(v+m+"min"),s(v+m+"max"));var D=y.colorscale,I=x.colorscale,O;if(D!==void 0&&(O=!t(D)),I!==void 0&&(O=!t(I)),s(v+"autocolorscale",O),s(v+"colorscale"),s(v+"reversescale"),v!=="marker.line."){var B;v&&p&&(B=E(y));var R=s(v+"showscale",B);R&&(v&&x&&(l._template=x),A(y,l,a))}}}),Ik=Vt((X,V)=>{var c=qr(),g=Ns(),E=eb(),A=ah();V.exports=function(t,e){function r(m,p){return c.coerce(t,e,E,m,p)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var i=e._colorAxes,n,o;function a(m,p){return c.coerce(n,o,E.coloraxis,m,p)}for(var s in i){var h=i[s];if(h[0])n=t[s]||{},o=g.newContainer(e,s,"coloraxis"),o._name=s,A(n,o,e,a,{prefix:"",cLetter:"c"});else{for(var v=0;v<h[2].length;v++)h[2][v]();delete e._colorAxes[s]}}}}),Lk=Vt((X,V)=>{var c=qr(),g=pf().hasColorscale,E=pf().extractOpts;V.exports=function(A,t){function e(h,v){var m=h["_"+v];m!==void 0&&(h[v]=m)}function r(h,v){var m=v.container?c.nestedProperty(h,v.container).get():h;if(m)if(m.coloraxis)m._colorAx=t[m.coloraxis];else{var p=E(m),y=p.auto;(y||p.min===void 0)&&e(m,v.min),(y||p.max===void 0)&&e(m,v.max),p.autocolorscale&&e(m,"colorscale")}}for(var i=0;i<A.length;i++){var n=A[i],o=n._module.colorbar;if(o)if(Array.isArray(o))for(var a=0;a<o.length;a++)r(n,o[a]);else r(n,o);g(n,"marker.line")&&r(n,{container:"marker.line",min:"cmin",max:"cmax"})}for(var s in t._colorAxes)r(t[s],{min:"cmin",max:"cmax"})}}),df=Vt((X,V)=>{var c=vo(),g=qr(),E=pf().extractOpts;V.exports=function(A,t,e){var r=A._fullLayout,i=e.vals,n=e.containerStr,o=n?g.nestedProperty(t,n).get():t,a=E(o),s=a.auto!==!1,h=a.min,v=a.max,m=a.mid,p=function(){return g.aggNums(Math.min,null,i)},y=function(){return g.aggNums(Math.max,null,i)};if(h===void 0?h=p():s&&(o._colorAx&&c(h)?h=Math.min(h,p()):h=p()),v===void 0?v=y():s&&(o._colorAx&&c(v)?v=Math.max(v,y()):v=y()),s&&m!==void 0&&(v-m>m-h?h=m-(v-m):v-m<m-h&&(v=m+(m-h))),h===v&&(h-=.5,v+=.5),a._sync("min",h),a._sync("max",v),a.autocolorscale){var l;h*v<0?l=r.colorscale.diverging:h>=0?l=r.colorscale.sequential:l=r.colorscale.sequentialminus,a._sync("colorscale",l)}}}),Ul=Vt((X,V)=>{var c=i0(),g=pf();V.exports={moduleType:"component",name:"colorscale",attributes:wl(),layoutAttributes:eb(),supplyLayoutDefaults:Ik(),handleDefaults:ah(),crossTraceDefaults:Lk(),calc:df(),scales:c.scales,defaultScale:c.defaultScale,getScale:c.get,isValidScale:c.isValid,hasColorscale:g.hasColorscale,extractOpts:g.extractOpts,extractScale:g.extractScale,flipScale:g.flipScale,makeColorScaleFunc:g.makeColorScaleFunc,makeColorScaleFuncFromTrace:g.makeColorScaleFuncFromTrace}}),Sl=Vt((X,V)=>{var c=qr(),g=nf().isTypedArraySpec;V.exports={hasLines:function(E){return E.visible&&E.mode&&E.mode.indexOf("lines")!==-1},hasMarkers:function(E){return E.visible&&(E.mode&&E.mode.indexOf("markers")!==-1||E.type==="splom")},hasText:function(E){return E.visible&&E.mode&&E.mode.indexOf("text")!==-1},isBubble:function(E){var A=E.marker;return c.isPlainObject(A)&&(c.isArrayOrTypedArray(A.size)||g(A.size))}}}),_g=Vt((X,V)=>{var c=vo();V.exports=function(g,E){E||(E=2);var A=g.marker,t=A.sizeref||1,e=A.sizemin||0,r=A.sizemode==="area"?function(i){return Math.sqrt(i/t)}:function(i){return i/t};return function(i){var n=r(i/E);return c(n)&&n>0?Math.max(n,e):0}}}),vf=Vt(X=>{var V=qr();X.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo},X.isTraceInSubplots=function(e,r){if(e.type==="splom"){for(var i=e.xaxes||[],n=e.yaxes||[],o=0;o<i.length;o++)for(var a=0;a<n.length;a++)if(r.indexOf(i[o]+n[a])!==-1)return!0;return!1}return r.indexOf(X.getSubplot(e))!==-1},X.flat=function(e,r){for(var i=new Array(e.length),n=0;n<e.length;n++)i[n]=r;return i},X.p2c=function(e,r){for(var i=new Array(e.length),n=0;n<e.length;n++)i[n]=e[n].p2c(r);return i},X.getDistanceFunction=function(e,r,i,n){return e==="closest"?n||X.quadrature(r,i):e.charAt(0)==="x"?r:i},X.getClosest=function(e,r,i){if(i.index!==!1)i.index>=0&&i.index<e.length?i.distance=0:i.index=!1;else for(var n=1/0,o=e.length,a=0;a<o;a++)n=r(e[a]),n<=i.distance&&(i.index=a,i.distance=n);return i},X.inbox=function(e,r,i){return e*r<0||e===0?i:1/0},X.quadrature=function(e,r){return function(i){var n=e(i),o=r(i);return Math.sqrt(n*n+o*o)}},X.makeEventData=function(e,r,i){var n="index"in e?e.index:e.pointNumber,o={data:r._input,fullData:r,curveNumber:r.index,pointNumber:n};if(r._indexToPoints){var a=r._indexToPoints[n];a.length===1?o.pointIndex=a[0]:o.pointIndices=a}else o.pointIndex=n;return r._module.eventData?o=r._module.eventData(o,e,r,i,n):("xVal"in e?o.x=e.xVal:"x"in e&&(o.x=e.x),"yVal"in e?o.y=e.yVal:"y"in e&&(o.y=e.y),e.xa&&(o.xaxis=e.xa),e.ya&&(o.yaxis=e.ya),e.zLabelVal!==void 0&&(o.z=e.zLabelVal)),X.appendArrayPointValue(o,r,n),o},X.appendArrayPointValue=function(e,r,i){var n=r._arrayAttrs;if(n)for(var o=0;o<n.length;o++){var a=n[o],s=g(a);if(e[s]===void 0){var h=V.nestedProperty(r,a).get(),v=E(h,i);v!==void 0&&(e[s]=v)}}},X.appendArrayMultiPointValues=function(e,r,i){var n=r._arrayAttrs;if(n)for(var o=0;o<n.length;o++){var a=n[o],s=g(a);if(e[s]===void 0){for(var h=V.nestedProperty(r,a).get(),v=new Array(i.length),m=0;m<i.length;m++)v[m]=E(h,i[m]);e[s]=v}}};var c={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function g(e){return c[e]||e}function E(e,r){if(Array.isArray(r)){if(Array.isArray(e)&&Array.isArray(e[r[0]]))return e[r[0]][r[1]]}else return e[r]}var A={x:!0,y:!0},t={"x unified":!0,"y unified":!0};X.isUnifiedHover=function(e){return typeof e!="string"?!1:!!t[e]},X.isXYhover=function(e){return typeof e!="string"?!1:!!A[e]}}),Om=Vt((X,V)=>{V.exports=E;var c={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},g=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function E(e){var r=[];return e.replace(g,function(i,n,o){var a=n.toLowerCase();for(o=t(o),a=="m"&&o.length>2&&(r.push([n].concat(o.splice(0,2))),a="l",n=n=="m"?"l":"L");;){if(o.length==c[a])return o.unshift(n),r.push(o);if(o.length<c[a])throw new Error("malformed path data");r.push([n].concat(o.splice(0,c[a])))}}),r}var A=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function t(e){var r=e.match(A);return r?r.map(Number):[]}}),Ck=Vt((X,V)=>{var c=Om(),g=function(m,p){return p?Math.round(m*(p=Math.pow(10,p)))/p:Math.round(m)},E="M0,0Z",A=Math.sqrt(2),t=Math.sqrt(3),e=Math.PI,r=Math.cos,i=Math.sin;V.exports={circle:{n:0,f:function(m,p,y){if(n(p))return E;var l=g(m,2),x="M"+l+",0A"+l+","+l+" 0 1,1 0,-"+l+"A"+l+","+l+" 0 0,1 "+l+",0Z";return y?v(p,y,x):x}},square:{n:1,f:function(m,p,y){if(n(p))return E;var l=g(m,2);return v(p,y,"M"+l+","+l+"H-"+l+"V-"+l+"H"+l+"Z")}},diamond:{n:2,f:function(m,p,y){if(n(p))return E;var l=g(m*1.3,2);return v(p,y,"M"+l+",0L0,"+l+"L-"+l+",0L0,-"+l+"Z")}},cross:{n:3,f:function(m,p,y){if(n(p))return E;var l=g(m*.4,2),x=g(m*1.2,2);return v(p,y,"M"+x+","+l+"H"+l+"V"+x+"H-"+l+"V"+l+"H-"+x+"V-"+l+"H-"+l+"V-"+x+"H"+l+"V-"+l+"H"+x+"Z")}},x:{n:4,f:function(m,p,y){if(n(p))return E;var l=g(m*.8/A,2),x="l"+l+","+l,b="l"+l+",-"+l,S="l-"+l+",-"+l,T="l-"+l+","+l;return v(p,y,"M0,"+l+x+b+S+b+S+T+S+T+x+T+x+"Z")}},"triangle-up":{n:5,f:function(m,p,y){if(n(p))return E;var l=g(m*2/t,2),x=g(m/2,2),b=g(m,2);return v(p,y,"M-"+l+","+x+"H"+l+"L0,-"+b+"Z")}},"triangle-down":{n:6,f:function(m,p,y){if(n(p))return E;var l=g(m*2/t,2),x=g(m/2,2),b=g(m,2);return v(p,y,"M-"+l+",-"+x+"H"+l+"L0,"+b+"Z")}},"triangle-left":{n:7,f:function(m,p,y){if(n(p))return E;var l=g(m*2/t,2),x=g(m/2,2),b=g(m,2);return v(p,y,"M"+x+",-"+l+"V"+l+"L-"+b+",0Z")}},"triangle-right":{n:8,f:function(m,p,y){if(n(p))return E;var l=g(m*2/t,2),x=g(m/2,2),b=g(m,2);return v(p,y,"M-"+x+",-"+l+"V"+l+"L"+b+",0Z")}},"triangle-ne":{n:9,f:function(m,p,y){if(n(p))return E;var l=g(m*.6,2),x=g(m*1.2,2);return v(p,y,"M-"+x+",-"+l+"H"+l+"V"+x+"Z")}},"triangle-se":{n:10,f:function(m,p,y){if(n(p))return E;var l=g(m*.6,2),x=g(m*1.2,2);return v(p,y,"M"+l+",-"+x+"V"+l+"H-"+x+"Z")}},"triangle-sw":{n:11,f:function(m,p,y){if(n(p))return E;var l=g(m*.6,2),x=g(m*1.2,2);return v(p,y,"M"+x+","+l+"H-"+l+"V-"+x+"Z")}},"triangle-nw":{n:12,f:function(m,p,y){if(n(p))return E;var l=g(m*.6,2),x=g(m*1.2,2);return v(p,y,"M-"+l+","+x+"V-"+l+"H"+x+"Z")}},pentagon:{n:13,f:function(m,p,y){if(n(p))return E;var l=g(m*.951,2),x=g(m*.588,2),b=g(-m,2),S=g(m*-.309,2),T=g(m*.809,2);return v(p,y,"M"+l+","+S+"L"+x+","+T+"H-"+x+"L-"+l+","+S+"L0,"+b+"Z")}},hexagon:{n:14,f:function(m,p,y){if(n(p))return E;var l=g(m,2),x=g(m/2,2),b=g(m*t/2,2);return v(p,y,"M"+b+",-"+x+"V"+x+"L0,"+l+"L-"+b+","+x+"V-"+x+"L0,-"+l+"Z")}},hexagon2:{n:15,f:function(m,p,y){if(n(p))return E;var l=g(m,2),x=g(m/2,2),b=g(m*t/2,2);return v(p,y,"M-"+x+","+b+"H"+x+"L"+l+",0L"+x+",-"+b+"H-"+x+"L-"+l+",0Z")}},octagon:{n:16,f:function(m,p,y){if(n(p))return E;var l=g(m*.924,2),x=g(m*.383,2);return v(p,y,"M-"+x+",-"+l+"H"+x+"L"+l+",-"+x+"V"+x+"L"+x+","+l+"H-"+x+"L-"+l+","+x+"V-"+x+"Z")}},star:{n:17,f:function(m,p,y){if(n(p))return E;var l=m*1.4,x=g(l*.225,2),b=g(l*.951,2),S=g(l*.363,2),T=g(l*.588,2),M=g(-l,2),w=g(l*-.309,2),u=g(l*.118,2),f=g(l*.809,2),k=g(l*.382,2);return v(p,y,"M"+x+","+w+"H"+b+"L"+S+","+u+"L"+T+","+f+"L0,"+k+"L-"+T+","+f+"L-"+S+","+u+"L-"+b+","+w+"H-"+x+"L0,"+M+"Z")}},hexagram:{n:18,f:function(m,p,y){if(n(p))return E;var l=g(m*.66,2),x=g(m*.38,2),b=g(m*.76,2);return v(p,y,"M-"+b+",0l-"+x+",-"+l+"h"+b+"l"+x+",-"+l+"l"+x+","+l+"h"+b+"l-"+x+","+l+"l"+x+","+l+"h-"+b+"l-"+x+","+l+"l-"+x+",-"+l+"h-"+b+"Z")}},"star-triangle-up":{n:19,f:function(m,p,y){if(n(p))return E;var l=g(m*t*.8,2),x=g(m*.8,2),b=g(m*1.6,2),S=g(m*4,2),T="A "+S+","+S+" 0 0 1 ";return v(p,y,"M-"+l+","+x+T+l+","+x+T+"0,-"+b+T+"-"+l+","+x+"Z")}},"star-triangle-down":{n:20,f:function(m,p,y){if(n(p))return E;var l=g(m*t*.8,2),x=g(m*.8,2),b=g(m*1.6,2),S=g(m*4,2),T="A "+S+","+S+" 0 0 1 ";return v(p,y,"M"+l+",-"+x+T+"-"+l+",-"+x+T+"0,"+b+T+l+",-"+x+"Z")}},"star-square":{n:21,f:function(m,p,y){if(n(p))return E;var l=g(m*1.1,2),x=g(m*2,2),b="A "+x+","+x+" 0 0 1 ";return v(p,y,"M-"+l+",-"+l+b+"-"+l+","+l+b+l+","+l+b+l+",-"+l+b+"-"+l+",-"+l+"Z")}},"star-diamond":{n:22,f:function(m,p,y){if(n(p))return E;var l=g(m*1.4,2),x=g(m*1.9,2),b="A "+x+","+x+" 0 0 1 ";return v(p,y,"M-"+l+",0"+b+"0,"+l+b+l+",0"+b+"0,-"+l+b+"-"+l+",0Z")}},"diamond-tall":{n:23,f:function(m,p,y){if(n(p))return E;var l=g(m*.7,2),x=g(m*1.4,2);return v(p,y,"M0,"+x+"L"+l+",0L0,-"+x+"L-"+l+",0Z")}},"diamond-wide":{n:24,f:function(m,p,y){if(n(p))return E;var l=g(m*1.4,2),x=g(m*.7,2);return v(p,y,"M0,"+x+"L"+l+",0L0,-"+x+"L-"+l+",0Z")}},hourglass:{n:25,f:function(m,p,y){if(n(p))return E;var l=g(m,2);return v(p,y,"M"+l+","+l+"H-"+l+"L"+l+",-"+l+"H-"+l+"Z")},noDot:!0},bowtie:{n:26,f:function(m,p,y){if(n(p))return E;var l=g(m,2);return v(p,y,"M"+l+","+l+"V-"+l+"L-"+l+","+l+"V-"+l+"Z")},noDot:!0},"circle-cross":{n:27,f:function(m,p,y){if(n(p))return E;var l=g(m,2);return v(p,y,"M0,"+l+"V-"+l+"M"+l+",0H-"+l+"M"+l+",0A"+l+","+l+" 0 1,1 0,-"+l+"A"+l+","+l+" 0 0,1 "+l+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(m,p,y){if(n(p))return E;var l=g(m,2),x=g(m/A,2);return v(p,y,"M"+x+","+x+"L-"+x+",-"+x+"M"+x+",-"+x+"L-"+x+","+x+"M"+l+",0A"+l+","+l+" 0 1,1 0,-"+l+"A"+l+","+l+" 0 0,1 "+l+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(m,p,y){if(n(p))return E;var l=g(m,2);return v(p,y,"M0,"+l+"V-"+l+"M"+l+",0H-"+l+"M"+l+","+l+"H-"+l+"V-"+l+"H"+l+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(m,p,y){if(n(p))return E;var l=g(m,2);return v(p,y,"M"+l+","+l+"L-"+l+",-"+l+"M"+l+",-"+l+"L-"+l+","+l+"M"+l+","+l+"H-"+l+"V-"+l+"H"+l+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(m,p,y){if(n(p))return E;var l=g(m*1.3,2);return v(p,y,"M"+l+",0L0,"+l+"L-"+l+",0L0,-"+l+"ZM0,-"+l+"V"+l+"M-"+l+",0H"+l)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(m,p,y){if(n(p))return E;var l=g(m*1.3,2),x=g(m*.65,2);return v(p,y,"M"+l+",0L0,"+l+"L-"+l+",0L0,-"+l+"ZM-"+x+",-"+x+"L"+x+","+x+"M-"+x+","+x+"L"+x+",-"+x)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(m,p,y){if(n(p))return E;var l=g(m*1.4,2);return v(p,y,"M0,"+l+"V-"+l+"M"+l+",0H-"+l)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(m,p,y){if(n(p))return E;var l=g(m,2);return v(p,y,"M"+l+","+l+"L-"+l+",-"+l+"M"+l+",-"+l+"L-"+l+","+l)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(m,p,y){if(n(p))return E;var l=g(m*1.2,2),x=g(m*.85,2);return v(p,y,"M0,"+l+"V-"+l+"M"+l+",0H-"+l+"M"+x+","+x+"L-"+x+",-"+x+"M"+x+",-"+x+"L-"+x+","+x)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(m,p,y){if(n(p))return E;var l=g(m/2,2),x=g(m,2);return v(p,y,"M"+l+","+x+"V-"+x+"M"+(l-x)+",-"+x+"V"+x+"M"+x+","+l+"H-"+x+"M-"+x+","+(l-x)+"H"+x)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(m,p,y){if(n(p))return E;var l=g(m*1.2,2),x=g(m*1.6,2),b=g(m*.8,2);return v(p,y,"M-"+l+","+b+"L0,0M"+l+","+b+"L0,0M0,-"+x+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(m,p,y){if(n(p))return E;var l=g(m*1.2,2),x=g(m*1.6,2),b=g(m*.8,2);return v(p,y,"M-"+l+",-"+b+"L0,0M"+l+",-"+b+"L0,0M0,"+x+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(m,p,y){if(n(p))return E;var l=g(m*1.2,2),x=g(m*1.6,2),b=g(m*.8,2);return v(p,y,"M"+b+","+l+"L0,0M"+b+",-"+l+"L0,0M-"+x+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(m,p,y){if(n(p))return E;var l=g(m*1.2,2),x=g(m*1.6,2),b=g(m*.8,2);return v(p,y,"M-"+b+","+l+"L0,0M-"+b+",-"+l+"L0,0M"+x+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(m,p,y){if(n(p))return E;var l=g(m*1.4,2);return v(p,y,"M"+l+",0H-"+l)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(m,p,y){if(n(p))return E;var l=g(m*1.4,2);return v(p,y,"M0,"+l+"V-"+l)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(m,p,y){if(n(p))return E;var l=g(m,2);return v(p,y,"M"+l+",-"+l+"L-"+l+","+l)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(m,p,y){if(n(p))return E;var l=g(m,2);return v(p,y,"M"+l+","+l+"L-"+l+",-"+l)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(m,p,y){if(n(p))return E;var l=g(m,2),x=g(m*2,2);return v(p,y,"M0,0L-"+l+","+x+"H"+l+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(m,p,y){if(n(p))return E;var l=g(m,2),x=g(m*2,2);return v(p,y,"M0,0L-"+l+",-"+x+"H"+l+"Z")},noDot:!0},"arrow-left":{n:47,f:function(m,p,y){if(n(p))return E;var l=g(m*2,2),x=g(m,2);return v(p,y,"M0,0L"+l+",-"+x+"V"+x+"Z")},noDot:!0},"arrow-right":{n:48,f:function(m,p,y){if(n(p))return E;var l=g(m*2,2),x=g(m,2);return v(p,y,"M0,0L-"+l+",-"+x+"V"+x+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(m,p,y){if(n(p))return E;var l=g(m,2),x=g(m*2,2);return v(p,y,"M-"+l+",0H"+l+"M0,0L-"+l+","+x+"H"+l+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(m,p,y){if(n(p))return E;var l=g(m,2),x=g(m*2,2);return v(p,y,"M-"+l+",0H"+l+"M0,0L-"+l+",-"+x+"H"+l+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(m,p,y){if(n(p))return E;var l=g(m*2,2),x=g(m,2);return v(p,y,"M0,-"+x+"V"+x+"M0,0L"+l+",-"+x+"V"+x+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(m,p,y){if(n(p))return E;var l=g(m*2,2),x=g(m,2);return v(p,y,"M0,-"+x+"V"+x+"M0,0L-"+l+",-"+x+"V"+x+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(m,p,y){if(n(p))return E;var l=e/2.5,x=2*m*r(l),b=2*m*i(l);return v(p,y,"M0,0L"+-x+","+b+"L"+x+","+b+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(m,p,y){if(n(p))return E;var l=e/4,x=2*m*r(l),b=2*m*i(l);return v(p,y,"M0,0L"+-x+","+b+"A "+2*m+","+2*m+" 0 0 1 "+x+","+b+"Z")},backoff:.4,noDot:!0}};function n(m){return m===null}var o,a,s,h;function v(m,p,y){if((!m||m%360===0)&&!p)return y;if(s===m&&h===p&&o===y)return a;s=m,h=p,o=y;function l(O,B){var R=r(O),L=i(O),F=B[0],N=B[1]+(p||0);return[F*R-N*L,F*L+N*R]}for(var x=m/180*e,b=0,S=0,T=c(y),M="",w=0;w<T.length;w++){var u=T[w],f=u[0],k=b,_=S;if(f==="M"||f==="L")b=+u[1],S=+u[2];else if(f==="m"||f==="l")b+=+u[1],S+=+u[2];else if(f==="H")b=+u[1];else if(f==="h")b+=+u[1];else if(f==="V")S=+u[1];else if(f==="v")S+=+u[1];else if(f==="A"){b=+u[1],S=+u[2];var D=l(x,[+u[6],+u[7]]);u[6]=D[0],u[7]=D[1],u[3]=+u[3]+m}(f==="H"||f==="V")&&(f="L"),(f==="h"||f==="v")&&(f="l"),(f==="m"||f==="l")&&(b-=k,S-=_);var I=l(x,[b,S]);(f==="H"||f==="V")&&(f="L"),(f==="M"||f==="L"||f==="m"||f==="l")&&(u[1]=I[0],u[2]=I[1]),u[0]=f,M+=u[0]+u.slice(1).join(",")}return a=M,M}}),go=Vt((X,V)=>{var c=Ai(),g=qr(),E=g.numberFormat,A=vo(),t=yh(),e=Mi(),r=vi(),i=Ul(),n=g.strTranslate,o=sl(),a=Cf(),s=nh(),h=s.LINE_SPACING,v=bd().DESELECTDIM,m=Sl(),p=_g(),y=vf().appendArrayPointValue,l=V.exports={};l.font=function(gt,bt){var vt=bt.variant,Ut=bt.style,Kt=bt.weight,Zt=bt.color,le=bt.size,Te=bt.family,Se=bt.shadow,Fe=bt.lineposition,Oe=bt.textcase;Te&>.style("font-family",Te),le+1&>.style("font-size",le+"px"),Zt&>.call(r.fill,Zt),Kt&>.style("font-weight",Kt),Ut&>.style("font-style",Ut),vt&>.style("font-variant",vt),Oe&>.style("text-transform",x(S(Oe))),Se&>.style("text-shadow",Se==="auto"?o.makeTextShadow(r.contrast(Zt)):x(Se)),Fe&>.style("text-decoration-line",x(T(Fe)))};function x(gt){return gt==="none"?void 0:gt}var b={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function S(gt){return b[gt]}function T(gt){return gt.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}l.setPosition=function(gt,bt,vt){gt.attr("x",bt).attr("y",vt)},l.setSize=function(gt,bt,vt){gt.attr("width",bt).attr("height",vt)},l.setRect=function(gt,bt,vt,Ut,Kt){gt.call(l.setPosition,bt,vt).call(l.setSize,Ut,Kt)},l.translatePoint=function(gt,bt,vt,Ut){var Kt=vt.c2p(gt.x),Zt=Ut.c2p(gt.y);if(A(Kt)&&A(Zt)&&bt.node())bt.node().nodeName==="text"?bt.attr("x",Kt).attr("y",Zt):bt.attr("transform",n(Kt,Zt));else return!1;return!0},l.translatePoints=function(gt,bt,vt){gt.each(function(Ut){var Kt=c.select(this);l.translatePoint(Ut,Kt,bt,vt)})},l.hideOutsideRangePoint=function(gt,bt,vt,Ut,Kt,Zt){bt.attr("display",vt.isPtWithinRange(gt,Kt)&&Ut.isPtWithinRange(gt,Zt)?null:"none")},l.hideOutsideRangePoints=function(gt,bt){if(bt._hasClipOnAxisFalse){var vt=bt.xaxis,Ut=bt.yaxis;gt.each(function(Kt){var Zt=Kt[0].trace,le=Zt.xcalendar,Te=Zt.ycalendar,Se=e.traceIs(Zt,"bar-like")?".bartext":".point,.textpoint";gt.selectAll(Se).each(function(Fe){l.hideOutsideRangePoint(Fe,c.select(this),vt,Ut,le,Te)})})}},l.crispRound=function(gt,bt,vt){return!bt||!A(bt)?vt||0:gt._context.staticPlot?bt:bt<1?1:Math.round(bt)},l.singleLineStyle=function(gt,bt,vt,Ut,Kt){bt.style("fill","none");var Zt=(((gt||[])[0]||{}).trace||{}).line||{},le=vt||Zt.width||0,Te=Kt||Zt.dash||"";r.stroke(bt,Ut||Zt.color),l.dashLine(bt,Te,le)},l.lineGroupStyle=function(gt,bt,vt,Ut){gt.style("fill","none").each(function(Kt){var Zt=(((Kt||[])[0]||{}).trace||{}).line||{},le=bt||Zt.width||0,Te=Ut||Zt.dash||"";c.select(this).call(r.stroke,vt||Zt.color).call(l.dashLine,Te,le)})},l.dashLine=function(gt,bt,vt){vt=+vt||0,bt=l.dashStyle(bt,vt),gt.style({"stroke-dasharray":bt,"stroke-width":vt+"px"})},l.dashStyle=function(gt,bt){bt=+bt||1;var vt=Math.max(bt,3);return gt==="solid"?gt="":gt==="dot"?gt=vt+"px,"+vt+"px":gt==="dash"?gt=3*vt+"px,"+3*vt+"px":gt==="longdash"?gt=5*vt+"px,"+5*vt+"px":gt==="dashdot"?gt=3*vt+"px,"+vt+"px,"+vt+"px,"+vt+"px":gt==="longdashdot"&&(gt=5*vt+"px,"+2*vt+"px,"+vt+"px,"+2*vt+"px"),gt};function M(gt,bt,vt,Ut){var Kt=bt.fillpattern,Zt=bt.fillgradient,le=Kt&&l.getPatternAttr(Kt.shape,0,"");if(le){var Te=l.getPatternAttr(Kt.bgcolor,0,null),Se=l.getPatternAttr(Kt.fgcolor,0,null),Fe=Kt.fgopacity,Oe=l.getPatternAttr(Kt.size,0,8),ur=l.getPatternAttr(Kt.solidity,0,.3),fr=bt.uid;l.pattern(gt,"point",vt,fr,le,Oe,ur,void 0,Kt.fillmode,Te,Se,Fe)}else if(Zt&&Zt.type!=="none"){var We=Zt.type,Lr="scatterfill-"+bt.uid;if(Ut&&(Lr="legendfill-"+bt.uid),!Ut&&(Zt.start!==void 0||Zt.stop!==void 0)){var kr,he;We==="horizontal"?(kr={x:Zt.start,y:0},he={x:Zt.stop,y:0}):We==="vertical"&&(kr={x:0,y:Zt.start},he={x:0,y:Zt.stop}),kr.x=bt._xA.c2p(kr.x===void 0?bt._extremes.x.min[0].val:kr.x,!0),kr.y=bt._yA.c2p(kr.y===void 0?bt._extremes.y.min[0].val:kr.y,!0),he.x=bt._xA.c2p(he.x===void 0?bt._extremes.x.max[0].val:he.x,!0),he.y=bt._yA.c2p(he.y===void 0?bt._extremes.y.max[0].val:he.y,!0),gt.call(I,vt,Lr,"linear",Zt.colorscale,"fill",kr,he,!0,!1)}else We==="horizontal"&&(We=We+"reversed"),gt.call(l.gradient,vt,Lr,We,Zt.colorscale,"fill")}else bt.fillcolor&>.call(r.fill,bt.fillcolor)}l.singleFillStyle=function(gt,bt){var vt=c.select(gt.node()),Ut=vt.data(),Kt=((Ut[0]||[])[0]||{}).trace||{};M(gt,Kt,bt,!1)},l.fillGroupStyle=function(gt,bt,vt){gt.style("stroke-width",0).each(function(Ut){var Kt=c.select(this);Ut[0].trace&&M(Kt,Ut[0].trace,bt,vt)})};var w=Ck();l.symbolNames=[],l.symbolFuncs=[],l.symbolBackOffs=[],l.symbolNeedLines={},l.symbolNoDot={},l.symbolNoFill={},l.symbolList=[],Object.keys(w).forEach(function(gt){var bt=w[gt],vt=bt.n;l.symbolList.push(vt,String(vt),gt,vt+100,String(vt+100),gt+"-open"),l.symbolNames[vt]=gt,l.symbolFuncs[vt]=bt.f,l.symbolBackOffs[vt]=bt.backoff||0,bt.needLine&&(l.symbolNeedLines[vt]=!0),bt.noDot?l.symbolNoDot[vt]=!0:l.symbolList.push(vt+200,String(vt+200),gt+"-dot",vt+300,String(vt+300),gt+"-open-dot"),bt.noFill&&(l.symbolNoFill[vt]=!0)});var u=l.symbolNames.length,f="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";l.symbolNumber=function(gt){if(A(gt))gt=+gt;else if(typeof gt=="string"){var bt=0;gt.indexOf("-open")>0&&(bt=100,gt=gt.replace("-open","")),gt.indexOf("-dot")>0&&(bt+=200,gt=gt.replace("-dot","")),gt=l.symbolNames.indexOf(gt),gt>=0&&(gt+=bt)}return gt%100>=u||gt>=400?0:Math.floor(Math.max(gt,0))};function k(gt,bt,vt,Ut){var Kt=gt%100;return l.symbolFuncs[Kt](bt,vt,Ut)+(gt>=200?f:"")}var _=E("~f"),D={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};l.gradient=function(gt,bt,vt,Ut,Kt,Zt){var le=D[Ut];return I(gt,bt,vt,le.type,Kt,Zt,le.start,le.stop,!1,le.reversed)};function I(gt,bt,vt,Ut,Kt,Zt,le,Te,Se,Fe){var Oe=Kt.length,ur;Ut==="linear"?ur={node:"linearGradient",attrs:{x1:le.x,y1:le.y,x2:Te.x,y2:Te.y,gradientUnits:Se?"userSpaceOnUse":"objectBoundingBox"},reversed:Fe}:Ut==="radial"&&(ur={node:"radialGradient",reversed:Fe});for(var fr=new Array(Oe),We=0;We<Oe;We++)ur.reversed?fr[Oe-1-We]=[_((1-Kt[We][0])*100),Kt[We][1]]:fr[We]=[_(Kt[We][0]*100),Kt[We][1]];var Lr=bt._fullLayout,kr="g"+Lr._uid+"-"+vt,he=Lr._defs.select(".gradients").selectAll("#"+kr).data([Ut+fr.join(";")],g.identity);he.exit().remove(),he.enter().append(ur.node).each(function(){var Dt=c.select(this);ur.attrs&&Dt.attr(ur.attrs),Dt.attr("id",kr);var qt=Dt.selectAll("stop").data(fr);qt.exit().remove(),qt.enter().append("stop"),qt.each(function(zt){var ut=t(zt[1]);c.select(this).attr({offset:zt[0]+"%","stop-color":r.tinyRGB(ut),"stop-opacity":ut.getAlpha()})})}),gt.style(Zt,nt(kr,bt)).style(Zt+"-opacity",null),gt.classed("gradient_filled",!0)}l.pattern=function(gt,bt,vt,Ut,Kt,Zt,le,Te,Se,Fe,Oe,ur){var fr=bt==="legend";Te&&(Se==="overlay"?(Fe=Te,Oe=r.contrast(Fe)):(Fe=void 0,Oe=Te));var We=vt._fullLayout,Lr="p"+We._uid+"-"+Ut,kr,he,Dt=function(Be,Ze,Ue,mr,ln){return mr+(ln-mr)*(Be-Ze)/(Ue-Ze)},qt,zt,ut,yt,Mt={},Ot=t(Oe),$t=r.tinyRGB(Ot),ee=Ot.getAlpha(),we=ur*ee;switch(Kt){case"/":kr=Zt*Math.sqrt(2),he=Zt*Math.sqrt(2),qt="M-"+kr/4+","+he/4+"l"+kr/2+",-"+he/2+"M0,"+he+"L"+kr+",0M"+kr/4*3+","+he/4*5+"l"+kr/2+",-"+he/2,zt=le*Zt,yt="path",Mt={d:qt,opacity:we,stroke:$t,"stroke-width":zt+"px"};break;case"\\":kr=Zt*Math.sqrt(2),he=Zt*Math.sqrt(2),qt="M"+kr/4*3+",-"+he/4+"l"+kr/2+","+he/2+"M0,0L"+kr+","+he+"M-"+kr/4+","+he/4*3+"l"+kr/2+","+he/2,zt=le*Zt,yt="path",Mt={d:qt,opacity:we,stroke:$t,"stroke-width":zt+"px"};break;case"x":kr=Zt*Math.sqrt(2),he=Zt*Math.sqrt(2),qt="M-"+kr/4+","+he/4+"l"+kr/2+",-"+he/2+"M0,"+he+"L"+kr+",0M"+kr/4*3+","+he/4*5+"l"+kr/2+",-"+he/2+"M"+kr/4*3+",-"+he/4+"l"+kr/2+","+he/2+"M0,0L"+kr+","+he+"M-"+kr/4+","+he/4*3+"l"+kr/2+","+he/2,zt=Zt-Zt*Math.sqrt(1-le),yt="path",Mt={d:qt,opacity:we,stroke:$t,"stroke-width":zt+"px"};break;case"|":kr=Zt,he=Zt,yt="path",qt="M"+kr/2+",0L"+kr/2+","+he,zt=le*Zt,yt="path",Mt={d:qt,opacity:we,stroke:$t,"stroke-width":zt+"px"};break;case"-":kr=Zt,he=Zt,yt="path",qt="M0,"+he/2+"L"+kr+","+he/2,zt=le*Zt,yt="path",Mt={d:qt,opacity:we,stroke:$t,"stroke-width":zt+"px"};break;case"+":kr=Zt,he=Zt,yt="path",qt="M"+kr/2+",0L"+kr/2+","+he+"M0,"+he/2+"L"+kr+","+he/2,zt=Zt-Zt*Math.sqrt(1-le),yt="path",Mt={d:qt,opacity:we,stroke:$t,"stroke-width":zt+"px"};break;case".":kr=Zt,he=Zt,le<Math.PI/4?ut=Math.sqrt(le*Zt*Zt/Math.PI):ut=Dt(le,Math.PI/4,1,Zt/2,Zt/Math.sqrt(2)),yt="circle",Mt={cx:kr/2,cy:he/2,r:ut,opacity:we,fill:$t};break}var Me=[Kt||"noSh",Fe||"noBg",Oe||"noFg",Zt,le].join(";"),Re=We._defs.select(".patterns").selectAll("#"+Lr).data([Me],g.identity);Re.exit().remove(),Re.enter().append("pattern").each(function(){var Be=c.select(this);if(Be.attr({id:Lr,width:kr+"px",height:he+"px",patternUnits:"userSpaceOnUse",patternTransform:fr?"scale(0.8)":""}),Fe){var Ze=t(Fe),Ue=r.tinyRGB(Ze),mr=Ze.getAlpha(),ln=Be.selectAll("rect").data([0]);ln.exit().remove(),ln.enter().append("rect").attr({width:kr+"px",height:he+"px",fill:Ue,"fill-opacity":mr})}var an=Be.selectAll(yt).data([0]);an.exit().remove(),an.enter().append(yt).attr(Mt)}),gt.style("fill",nt(Lr,vt)).style("fill-opacity",null),gt.classed("pattern_filled",!0)},l.initGradients=function(gt){var bt=gt._fullLayout,vt=g.ensureSingle(bt._defs,"g","gradients");vt.selectAll("linearGradient,radialGradient").remove(),c.select(gt).selectAll(".gradient_filled").classed("gradient_filled",!1)},l.initPatterns=function(gt){var bt=gt._fullLayout,vt=g.ensureSingle(bt._defs,"g","patterns");vt.selectAll("pattern").remove(),c.select(gt).selectAll(".pattern_filled").classed("pattern_filled",!1)},l.getPatternAttr=function(gt,bt,vt){return gt&&g.isArrayOrTypedArray(gt)?bt<gt.length?gt[bt]:vt:gt},l.pointStyle=function(gt,bt,vt,Ut){if(gt.size()){var Kt=l.makePointStyleFns(bt);gt.each(function(Zt){l.singlePointStyle(Zt,c.select(this),bt,Kt,vt,Ut)})}},l.singlePointStyle=function(gt,bt,vt,Ut,Kt,Zt){var le=vt.marker,Te=le.line;if(Zt&&Zt.i>=0&>.i===void 0&&(gt.i=Zt.i),bt.style("opacity",Ut.selectedOpacityFn?Ut.selectedOpacityFn(gt):gt.mo===void 0?le.opacity:gt.mo),Ut.ms2mrc){var Se;gt.ms==="various"||le.size==="various"?Se=3:Se=Ut.ms2mrc(gt.ms),gt.mrc=Se,Ut.selectedSizeFn&&(Se=gt.mrc=Ut.selectedSizeFn(gt));var Fe=l.symbolNumber(gt.mx||le.symbol)||0;gt.om=Fe%200>=100;var Oe=Wt(gt,vt),ur=ot(gt,vt);bt.attr("d",k(Fe,Se,Oe,ur))}var fr=!1,We,Lr,kr;if(gt.so)kr=Te.outlierwidth,Lr=Te.outliercolor,We=le.outliercolor;else{var he=(Te||{}).width;kr=(gt.mlw+1||he+1||(gt.trace?(gt.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in gt?Lr=gt.mlcc=Ut.lineScale(gt.mlc):g.isArrayOrTypedArray(Te.color)?Lr=r.defaultLine:Lr=Te.color,g.isArrayOrTypedArray(le.color)&&(We=r.defaultLine,fr=!0),"mc"in gt?We=gt.mcc=Ut.markerScale(gt.mc):We=le.color||le.colors||"rgba(0,0,0,0)",Ut.selectedColorFn&&(We=Ut.selectedColorFn(gt))}if(gt.om)bt.call(r.stroke,We).style({"stroke-width":(kr||1)+"px",fill:"none"});else{bt.style("stroke-width",(gt.isBlank?0:kr)+"px");var Dt=le.gradient,qt=gt.mgt;qt?fr=!0:qt=Dt&&Dt.type,g.isArrayOrTypedArray(qt)&&(qt=qt[0],D[qt]||(qt=0));var zt=le.pattern,ut=zt&&l.getPatternAttr(zt.shape,gt.i,"");if(qt&&qt!=="none"){var yt=gt.mgc;yt?fr=!0:yt=Dt.color;var Mt=vt.uid;fr&&(Mt+="-"+gt.i),l.gradient(bt,Kt,Mt,qt,[[0,yt],[1,We]],"fill")}else if(ut){var Ot=!1,$t=zt.fgcolor;!$t&&Zt&&Zt.color&&($t=Zt.color,Ot=!0);var ee=l.getPatternAttr($t,gt.i,Zt&&Zt.color||null),we=l.getPatternAttr(zt.bgcolor,gt.i,null),Me=zt.fgopacity,Re=l.getPatternAttr(zt.size,gt.i,8),Be=l.getPatternAttr(zt.solidity,gt.i,.3);Ot=Ot||gt.mcc||g.isArrayOrTypedArray(zt.shape)||g.isArrayOrTypedArray(zt.bgcolor)||g.isArrayOrTypedArray(zt.fgcolor)||g.isArrayOrTypedArray(zt.size)||g.isArrayOrTypedArray(zt.solidity);var Ze=vt.uid;Ot&&(Ze+="-"+gt.i),l.pattern(bt,"point",Kt,Ze,ut,Re,Be,gt.mcc,zt.fillmode,we,ee,Me)}else g.isArrayOrTypedArray(We)?r.fill(bt,We[gt.i]):r.fill(bt,We);kr&&r.stroke(bt,Lr)}},l.makePointStyleFns=function(gt){var bt={},vt=gt.marker;return bt.markerScale=l.tryColorscale(vt,""),bt.lineScale=l.tryColorscale(vt,"line"),e.traceIs(gt,"symbols")&&(bt.ms2mrc=m.isBubble(gt)?p(gt):function(){return(vt.size||6)/2}),gt.selectedpoints&&g.extendFlat(bt,l.makeSelectedPointStyleFns(gt)),bt},l.makeSelectedPointStyleFns=function(gt){var bt={},vt=gt.selected||{},Ut=gt.unselected||{},Kt=gt.marker||{},Zt=vt.marker||{},le=Ut.marker||{},Te=Kt.opacity,Se=Zt.opacity,Fe=le.opacity,Oe=Se!==void 0,ur=Fe!==void 0;(g.isArrayOrTypedArray(Te)||Oe||ur)&&(bt.selectedOpacityFn=function(ut){var yt=ut.mo===void 0?Kt.opacity:ut.mo;return ut.selected?Oe?Se:yt:ur?Fe:v*yt});var fr=Kt.color,We=Zt.color,Lr=le.color;(We||Lr)&&(bt.selectedColorFn=function(ut){var yt=ut.mcc||fr;return ut.selected?We||yt:Lr||yt});var kr=Kt.size,he=Zt.size,Dt=le.size,qt=he!==void 0,zt=Dt!==void 0;return e.traceIs(gt,"symbols")&&(qt||zt)&&(bt.selectedSizeFn=function(ut){var yt=ut.mrc||kr/2;return ut.selected?qt?he/2:yt:zt?Dt/2:yt}),bt},l.makeSelectedTextStyleFns=function(gt){var bt={},vt=gt.selected||{},Ut=gt.unselected||{},Kt=gt.textfont||{},Zt=vt.textfont||{},le=Ut.textfont||{},Te=Kt.color,Se=Zt.color,Fe=le.color;return bt.selectedTextColorFn=function(Oe){var ur=Oe.tc||Te;return Oe.selected?Se||ur:Fe||(Se?ur:r.addOpacity(ur,v))},bt},l.selectedPointStyle=function(gt,bt){if(!(!gt.size()||!bt.selectedpoints)){var vt=l.makeSelectedPointStyleFns(bt),Ut=bt.marker||{},Kt=[];vt.selectedOpacityFn&&Kt.push(function(Zt,le){Zt.style("opacity",vt.selectedOpacityFn(le))}),vt.selectedColorFn&&Kt.push(function(Zt,le){r.fill(Zt,vt.selectedColorFn(le))}),vt.selectedSizeFn&&Kt.push(function(Zt,le){var Te=le.mx||Ut.symbol||0,Se=vt.selectedSizeFn(le);Zt.attr("d",k(l.symbolNumber(Te),Se,Wt(le,bt),ot(le,bt))),le.mrc2=Se}),Kt.length&>.each(function(Zt){for(var le=c.select(this),Te=0;Te<Kt.length;Te++)Kt[Te](le,Zt)})}},l.tryColorscale=function(gt,bt){var vt=bt?g.nestedProperty(gt,bt).get():gt;if(vt){var Ut=vt.color;if((vt.colorscale||vt._colorAx)&&g.isArrayOrTypedArray(Ut))return i.makeColorScaleFuncFromTrace(vt)}return g.identity};var O={start:1,end:-1,middle:0,bottom:1,top:-1};function B(gt,bt,vt,Ut,Kt){var Zt=c.select(gt.node().parentNode),le=bt.indexOf("top")!==-1?"top":bt.indexOf("bottom")!==-1?"bottom":"middle",Te=bt.indexOf("left")!==-1?"end":bt.indexOf("right")!==-1?"start":"middle",Se=Ut?Ut/.8+1:0,Fe=(o.lineCount(gt)-1)*h+1,Oe=O[Te]*Se,ur=vt*.75+O[le]*Se+(O[le]-1)*Fe*vt/2;gt.attr("text-anchor",Te),Kt||Zt.attr("transform",n(Oe,ur))}function R(gt,bt){var vt=gt.ts||bt.textfont.size;return A(vt)&&vt>0?vt:0}l.textPointStyle=function(gt,bt,vt){if(gt.size()){var Ut;if(bt.selectedpoints){var Kt=l.makeSelectedTextStyleFns(bt);Ut=Kt.selectedTextColorFn}var Zt=bt.texttemplate,le=vt._fullLayout;gt.each(function(Te){var Se=c.select(this),Fe=Zt?g.extractOption(Te,bt,"txt","texttemplate"):g.extractOption(Te,bt,"tx","text");if(!Fe&&Fe!==0){Se.remove();return}if(Zt){var Oe=bt._module.formatLabels,ur=Oe?Oe(Te,bt,le):{},fr={};y(fr,bt,Te.i);var We=bt._meta||{};Fe=g.texttemplateString(Fe,ur,le._d3locale,fr,Te,We)}var Lr=Te.tp||bt.textposition,kr=R(Te,bt),he=Ut?Ut(Te):Te.tc||bt.textfont.color;Se.call(l.font,{family:Te.tf||bt.textfont.family,weight:Te.tw||bt.textfont.weight,style:Te.ty||bt.textfont.style,variant:Te.tv||bt.textfont.variant,textcase:Te.tC||bt.textfont.textcase,lineposition:Te.tE||bt.textfont.lineposition,shadow:Te.tS||bt.textfont.shadow,size:kr,color:he}).text(Fe).call(o.convertToTspans,vt).call(B,Lr,kr,Te.mrc)})}},l.selectedTextStyle=function(gt,bt){if(!(!gt.size()||!bt.selectedpoints)){var vt=l.makeSelectedTextStyleFns(bt);gt.each(function(Ut){var Kt=c.select(this),Zt=vt.selectedTextColorFn(Ut),le=Ut.tp||bt.textposition,Te=R(Ut,bt);r.fill(Kt,Zt);var Se=e.traceIs(bt,"bar-like");B(Kt,le,Te,Ut.mrc2||Ut.mrc,Se)})}};var L=.5;l.smoothopen=function(gt,bt){if(gt.length<3)return"M"+gt.join("L");var vt="M"+gt[0],Ut=[],Kt;for(Kt=1;Kt<gt.length-1;Kt++)Ut.push(ct(gt[Kt-1],gt[Kt],gt[Kt+1],bt));for(vt+="Q"+Ut[0][0]+" "+gt[1],Kt=2;Kt<gt.length-1;Kt++)vt+="C"+Ut[Kt-2][1]+" "+Ut[Kt-1][0]+" "+gt[Kt];return vt+="Q"+Ut[gt.length-3][1]+" "+gt[gt.length-1],vt},l.smoothclosed=function(gt,bt){if(gt.length<3)return"M"+gt.join("L")+"Z";var vt="M"+gt[0],Ut=gt.length-1,Kt=[ct(gt[Ut],gt[0],gt[1],bt)],Zt;for(Zt=1;Zt<Ut;Zt++)Kt.push(ct(gt[Zt-1],gt[Zt],gt[Zt+1],bt));for(Kt.push(ct(gt[Ut-1],gt[Ut],gt[0],bt)),Zt=1;Zt<=Ut;Zt++)vt+="C"+Kt[Zt-1][1]+" "+Kt[Zt][0]+" "+gt[Zt];return vt+="C"+Kt[Ut][1]+" "+Kt[0][0]+" "+gt[0]+"Z",vt};var F,N;function j(gt,bt,vt){return vt&&(gt=Z(gt)),bt?rt(gt[1]):G(gt[0])}function G(gt){var bt=c.round(gt,2);return F=bt,bt}function rt(gt){var bt=c.round(gt,2);return N=bt,bt}function ct(gt,bt,vt,Ut){var Kt=gt[0]-bt[0],Zt=gt[1]-bt[1],le=vt[0]-bt[0],Te=vt[1]-bt[1],Se=Math.pow(Kt*Kt+Zt*Zt,L/2),Fe=Math.pow(le*le+Te*Te,L/2),Oe=(Fe*Fe*Kt-Se*Se*le)*Ut,ur=(Fe*Fe*Zt-Se*Se*Te)*Ut,fr=3*Fe*(Se+Fe),We=3*Se*(Se+Fe);return[[G(bt[0]+(fr&&Oe/fr)),rt(bt[1]+(fr&&ur/fr))],[G(bt[0]-(We&&Oe/We)),rt(bt[1]-(We&&ur/We))]]}var lt={hv:function(gt,bt,vt){return"H"+G(bt[0])+"V"+j(bt,1,vt)},vh:function(gt,bt,vt){return"V"+rt(bt[1])+"H"+j(bt,0,vt)},hvh:function(gt,bt,vt){return"H"+G((gt[0]+bt[0])/2)+"V"+rt(bt[1])+"H"+j(bt,0,vt)},vhv:function(gt,bt,vt){return"V"+rt((gt[1]+bt[1])/2)+"H"+G(bt[0])+"V"+j(bt,1,vt)}},tt=function(gt,bt,vt){return"L"+j(bt,0,vt)+","+j(bt,1,vt)};l.steps=function(gt){var bt=lt[gt]||tt;return function(vt){for(var Ut="M"+G(vt[0][0])+","+rt(vt[0][1]),Kt=vt.length,Zt=1;Zt<Kt;Zt++)Ut+=bt(vt[Zt-1],vt[Zt],Zt===Kt-1);return Ut}};function Z(gt,bt){var vt=gt.backoff,Ut=gt.trace,Kt=gt.d,Zt=gt.i;if(vt&&Ut&&Ut.marker&&Ut.marker.angle%360===0&&Ut.line&&Ut.line.shape!=="spline"){var le=g.isArrayOrTypedArray(vt),Te=gt,Se=bt?bt[0]:F||0,Fe=bt?bt[1]:N||0,Oe=Te[0],ur=Te[1],fr=Oe-Se,We=ur-Fe,Lr=Math.atan2(We,fr),kr=le?vt[Zt]:vt;if(kr==="auto"){var he=Te.i;Ut.type==="scatter"&&he--;var Dt=Te.marker,qt=Dt.symbol;g.isArrayOrTypedArray(qt)&&(qt=qt[he]);var zt=Dt.size;g.isArrayOrTypedArray(zt)&&(zt=zt[he]),kr=Dt?l.symbolBackOffs[l.symbolNumber(qt)]*zt:0,kr+=l.getMarkerStandoff(Kt[he],Ut)||0}var ut=Oe-kr*Math.cos(Lr),yt=ur-kr*Math.sin(Lr);(ut<=Oe&&ut>=Se||ut>=Oe&&ut<=Se)&&(yt<=ur&&yt>=Fe||yt>=ur&&yt<=Fe)&&(gt=[ut,yt])}return gt}l.applyBackoff=Z,l.makeTester=function(){var gt=g.ensureSingleById(c.select("body"),"svg","js-plotly-tester",function(vt){vt.attr(a.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),bt=g.ensureSingle(gt,"path","js-reference-point",function(vt){vt.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=gt,l.testref=bt},l.savedBBoxes={};var st=0,$=1e4;l.bBox=function(gt,bt,vt){vt||(vt=Q(gt));var Ut;if(vt){if(Ut=l.savedBBoxes[vt],Ut)return g.extendFlat({},Ut)}else if(gt.childNodes.length===1){var Kt=gt.childNodes[0];if(vt=Q(Kt),vt){var Zt=+Kt.getAttribute("x")||0,le=+Kt.getAttribute("y")||0,Te=Kt.getAttribute("transform");if(!Te){var Se=l.bBox(Kt,!1,vt);return Zt&&(Se.left+=Zt,Se.right+=Zt),le&&(Se.top+=le,Se.bottom+=le),Se}if(vt+="~"+Zt+"~"+le+"~"+Te,Ut=l.savedBBoxes[vt],Ut)return g.extendFlat({},Ut)}}var Fe,Oe;bt?Fe=gt:(Oe=l.tester.node(),Fe=gt.cloneNode(!0),Oe.appendChild(Fe)),c.select(Fe).attr("transform",null).call(o.positionText,0,0);var ur=Fe.getBoundingClientRect(),fr=l.testref.node().getBoundingClientRect();bt||Oe.removeChild(Fe);var We={height:ur.height,width:ur.width,left:ur.left-fr.left,top:ur.top-fr.top,right:ur.right-fr.left,bottom:ur.bottom-fr.top};return st>=$&&(l.savedBBoxes={},st=0),vt&&(l.savedBBoxes[vt]=We),st++,g.extendFlat({},We)};function Q(gt){var bt=gt.getAttribute("data-unformatted");if(bt!==null)return bt+gt.getAttribute("data-math")+gt.getAttribute("text-anchor")+gt.getAttribute("style")}l.setClipUrl=function(gt,bt,vt){gt.attr("clip-path",nt(bt,vt))};function nt(gt,bt){if(!gt)return null;var vt=bt._context,Ut=vt._exportedPlot?"":vt._baseUrl||"";return Ut?"url('"+Ut+"#"+gt+"')":"url(#"+gt+")"}l.getTranslate=function(gt){var bt=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,vt=gt.attr?"attr":"getAttribute",Ut=gt[vt]("transform")||"",Kt=Ut.replace(bt,function(Zt,le,Te){return[le,Te].join(" ")}).split(" ");return{x:+Kt[0]||0,y:+Kt[1]||0}},l.setTranslate=function(gt,bt,vt){var Ut=/(\btranslate\(.*?\);?)/,Kt=gt.attr?"attr":"getAttribute",Zt=gt.attr?"attr":"setAttribute",le=gt[Kt]("transform")||"";return bt=bt||0,vt=vt||0,le=le.replace(Ut,"").trim(),le+=n(bt,vt),le=le.trim(),gt[Zt]("transform",le),le},l.getScale=function(gt){var bt=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,vt=gt.attr?"attr":"getAttribute",Ut=gt[vt]("transform")||"",Kt=Ut.replace(bt,function(Zt,le,Te){return[le,Te].join(" ")}).split(" ");return{x:+Kt[0]||1,y:+Kt[1]||1}},l.setScale=function(gt,bt,vt){var Ut=/(\bscale\(.*?\);?)/,Kt=gt.attr?"attr":"getAttribute",Zt=gt.attr?"attr":"setAttribute",le=gt[Kt]("transform")||"";return bt=bt||1,vt=vt||1,le=le.replace(Ut,"").trim(),le+="scale("+bt+","+vt+")",le=le.trim(),gt[Zt]("transform",le),le};var Y=/\s*sc.*/;l.setPointGroupScale=function(gt,bt,vt){if(bt=bt||1,vt=vt||1,!!gt){var Ut=bt===1&&vt===1?"":"scale("+bt+","+vt+")";gt.each(function(){var Kt=(this.getAttribute("transform")||"").replace(Y,"");Kt+=Ut,Kt=Kt.trim(),this.setAttribute("transform",Kt)})}};var q=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(gt,bt,vt){gt&>.each(function(){var Ut,Kt=c.select(this),Zt=Kt.select("text");if(Zt.node()){var le=parseFloat(Zt.attr("x")||0),Te=parseFloat(Zt.attr("y")||0),Se=(Kt.attr("transform")||"").match(q);bt===1&&vt===1?Ut=[]:Ut=[n(le,Te),"scale("+bt+","+vt+")",n(-le,-Te)],Se&&Ut.push(Se),Kt.attr("transform",Ut.join(""))}})};function ot(gt,bt){var vt;return gt&&(vt=gt.mf),vt===void 0&&(vt=bt.marker&&bt.marker.standoff||0),!bt._geo&&!bt._xA?-vt:vt}l.getMarkerStandoff=ot;var it=Math.atan2,dt=Math.cos,wt=Math.sin;function xt(gt,bt){var vt=bt[0],Ut=bt[1];return[vt*dt(gt)-Ut*wt(gt),vt*wt(gt)+Ut*dt(gt)]}var Ft,Et,Nt,te,Jt,Qt;function Wt(gt,bt){var vt=gt.ma;vt===void 0&&(vt=bt.marker.angle,(!vt||g.isArrayOrTypedArray(vt))&&(vt=0));var Ut,Kt,Zt=bt.marker.angleref;if(Zt==="previous"||Zt==="north"){if(bt._geo){var le=bt._geo.project(gt.lonlat);Ut=le[0],Kt=le[1]}else{var Te=bt._xA,Se=bt._yA;if(Te&&Se)Ut=Te.c2p(gt.x),Kt=Se.c2p(gt.y);else return 90}if(bt._geo){var Fe=gt.lonlat[0],Oe=gt.lonlat[1],ur=bt._geo.project([Fe,Oe+1e-5]),fr=bt._geo.project([Fe+1e-5,Oe]),We=it(fr[1]-Kt,fr[0]-Ut),Lr=it(ur[1]-Kt,ur[0]-Ut),kr;if(Zt==="north")kr=vt/180*Math.PI;else if(Zt==="previous"){var he=Fe/180*Math.PI,Dt=Oe/180*Math.PI,qt=Ft/180*Math.PI,zt=Et/180*Math.PI,ut=qt-he,yt=dt(zt)*wt(ut),Mt=wt(zt)*dt(Dt)-dt(zt)*wt(Dt)*dt(ut);kr=-it(yt,Mt)-Math.PI,Ft=Fe,Et=Oe}var Ot=xt(We,[dt(kr),0]),$t=xt(Lr,[wt(kr),0]);vt=it(Ot[1]+$t[1],Ot[0]+$t[0])/Math.PI*180,Zt==="previous"&&!(Qt===bt.uid&>.i===Jt+1)&&(vt=null)}if(Zt==="previous"&&!bt._geo)if(Qt===bt.uid&>.i===Jt+1&&A(Ut)&&A(Kt)){var ee=Ut-Nt,we=Kt-te,Me=bt.line&&bt.line.shape||"",Re=Me.slice(Me.length-1);Re==="h"&&(we=0),Re==="v"&&(ee=0),vt+=it(we,ee)/Math.PI*180+90}else vt=null}return Nt=Ut,te=Kt,Jt=gt.i,Qt=bt.uid,vt}l.getMarkerAngle=Wt}),u0=Vt((X,V)=>{var c=Ai(),g=vo(),E=fu(),A=Mi(),t=qr(),e=t.strTranslate,r=go(),i=vi(),n=sl(),o=bd(),a=nh().OPPOSITE_SIDE,s=/ [XY][0-9]* /,h=1.6,v=1.6;function m(p,y,l){var x=p._fullLayout,b=l.propContainer,S=l.propName,T=l.placeholder,M=l.traceIndex,w=l.avoid||{},u=l.attributes,f=l.transform,k=l.containerGroup,_=1,D=b.title,I=(D&&D.text?D.text:"").trim(),O=!1,B=D&&D.font?D.font:{},R=B.family,L=B.size,F=B.color,N=B.weight,j=B.style,G=B.variant,rt=B.textcase,ct=B.lineposition,lt=B.shadow,tt=l.subtitlePropName,Z=!!tt,st=l.subtitlePlaceholder,$=(b.title||{}).subtitle||{text:"",font:{}},Q=$.text.trim(),nt=!1,Y=1,q=$.font,ot=q.family,it=q.size,dt=q.color,wt=q.weight,xt=q.style,Ft=q.variant,Et=q.textcase,Nt=q.lineposition,te=q.shadow,Jt;S==="title.text"?Jt="titleText":S.indexOf("axis")!==-1?Jt="axisTitleText":S.indexOf("colorbar"!==-1)&&(Jt="colorbarTitleText");var Qt=p._context.edits[Jt];function Wt(fr,We){return fr===void 0||We===void 0?!1:fr.replace(s," % ")===We.replace(s," % ")}I===""?_=0:Wt(I,T)&&(Qt||(I=""),_=.2,O=!0),Z&&(Q===""?Y=0:Wt(Q,st)&&(Qt||(Q=""),Y=.2,nt=!0)),l._meta?I=t.templateString(I,l._meta):x._meta&&(I=t.templateString(I,x._meta));var gt=I||Q||Qt,bt;k||(k=t.ensureSingle(x._infolayer,"g","g-"+y),bt=x._hColorbarMoveTitle);var vt=k.selectAll("text."+y).data(gt?[0]:[]);vt.enter().append("text"),vt.text(I).attr("class",y),vt.exit().remove();var Ut=null,Kt=y+"-subtitle",Zt=Q||Qt;if(Z&&Zt&&(Ut=k.selectAll("text."+Kt).data(Zt?[0]:[]),Ut.enter().append("text"),Ut.text(Q).attr("class",Kt),Ut.exit().remove()),!gt)return k;function le(fr,We){t.syncOrAsync([Te,Se],{title:fr,subtitle:We})}function Te(fr){var We=fr.title,Lr=fr.subtitle,kr;!f&&bt&&(f={}),f?(kr="",f.rotate&&(kr+="rotate("+[f.rotate,u.x,u.y]+")"),(f.offset||bt)&&(kr+=e(0,(f.offset||0)-(bt||0)))):kr=null,We.attr("transform",kr);function he(Mt){if(Mt){var Ot=c.select(Mt.node().parentNode).select("."+Kt);if(!Ot.empty()){var $t=Mt.node().getBBox();if($t.height){var ee=$t.y+$t.height+h*it;Ot.attr("y",ee)}}}}if(We.style("opacity",_*i.opacity(F)).call(r.font,{color:i.rgb(F),size:c.round(L,2),family:R,weight:N,style:j,variant:G,textcase:rt,shadow:lt,lineposition:ct}).attr(u).call(n.convertToTspans,p,he),Lr){var Dt=k.select("."+y+"-math-group"),qt=We.node().getBBox(),zt=Dt.node()?Dt.node().getBBox():void 0,ut=zt?zt.y+zt.height+h*it:qt.y+qt.height+v*it,yt=t.extendFlat({},u,{y:ut});Lr.attr("transform",kr),Lr.style("opacity",Y*i.opacity(dt)).call(r.font,{color:i.rgb(dt),size:c.round(it,2),family:ot,weight:wt,style:xt,variant:Ft,textcase:Et,shadow:te,lineposition:Nt}).attr(yt).call(n.convertToTspans,p)}return E.previousPromises(p)}function Se(fr){var We=fr.title,Lr=c.select(We.node().parentNode);if(w&&w.selection&&w.side&&I){Lr.attr("transform",null);var kr=a[w.side],he=w.side==="left"||w.side==="top"?-1:1,Dt=g(w.pad)?w.pad:2,qt=r.bBox(Lr.node()),zt={t:0,b:0,l:0,r:0},ut=p._fullLayout._reservedMargin;for(var yt in ut)for(var Mt in ut[yt]){var Ot=ut[yt][Mt];zt[Mt]=Math.max(zt[Mt],Ot)}var $t={left:zt.l,top:zt.t,right:x.width-zt.r,bottom:x.height-zt.b},ee=w.maxShift||he*($t[w.side]-qt[w.side]),we=0;if(ee<0)we=ee;else{var Me=w.offsetLeft||0,Re=w.offsetTop||0;qt.left-=Me,qt.right-=Me,qt.top-=Re,qt.bottom-=Re,w.selection.each(function(){var Ze=r.bBox(this);t.bBoxIntersect(qt,Ze,Dt)&&(we=Math.max(we,he*(Ze[w.side]-qt[kr])+Dt))}),we=Math.min(ee,we),b._titleScoot=Math.abs(we)}if(we>0||ee<0){var Be={left:[-we,0],right:[we,0],top:[0,-we],bottom:[0,we]}[w.side];Lr.attr("transform",e(Be[0],Be[1]))}}}vt.call(le,Ut);function Fe(fr,We){fr.text(We).on("mouseover.opacity",function(){c.select(this).transition().duration(o.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){c.select(this).transition().duration(o.HIDE_PLACEHOLDER).style("opacity",0)})}if(Qt&&(I?vt.on(".opacity",null):(Fe(vt,T),O=!0),vt.call(n.makeEditable,{gd:p}).on("edit",function(fr){M!==void 0?A.call("_guiRestyle",p,S,fr,M):A.call("_guiRelayout",p,S,fr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(le)}).on("input",function(fr){this.text(fr||" ").call(n.positionText,u.x,u.y)}),Z)){if(Z&&!I){var Oe=vt.node().getBBox(),ur=Oe.y+Oe.height+v*it;Ut.attr("y",ur)}Q?Ut.on(".opacity",null):(Fe(Ut,st),nt=!0),Ut.call(n.makeEditable,{gd:p}).on("edit",function(fr){A.call("_guiRelayout",p,"title.subtitle.text",fr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(le)}).on("input",function(fr){this.text(fr||" ").call(n.positionText,Ut.attr("x"),Ut.attr("y"))})}return vt.classed("js-placeholder",O),Ut&&Ut.classed("js-placeholder",nt),k}V.exports={draw:m,SUBTITLE_PADDING_EM:v,SUBTITLE_PADDING_MATHJAX_EM:h}}),xp=Vt((X,V)=>{var c=Ai(),g=fg().utcFormat,E=qr(),A=E.numberFormat,t=vo(),e=E.cleanNumber,r=E.ms2DateTime,i=E.dateTime2ms,n=E.ensureNumber,o=E.isArrayOrTypedArray,a=ts(),s=a.FP_SAFE,h=a.BADNUM,v=a.LOG_CLIP,m=a.ONEWEEK,p=a.ONEDAY,y=a.ONEHOUR,l=a.ONEMIN,x=a.ONESEC,b=rc(),S=xh(),T=S.HOUR_PATTERN,M=S.WEEKDAY_PATTERN;function w(f){return Math.pow(10,f)}function u(f){return f!=null}V.exports=function(f,k){k=k||{};var _=f._id||"x",D=_.charAt(0);function I($,Q){if($>0)return Math.log($)/Math.LN10;if($<=0&&Q&&f.range&&f.range.length===2){var nt=f.range[0],Y=f.range[1];return .5*(nt+Y-2*v*Math.abs(nt-Y))}else return h}function O($,Q,nt,Y){if((Y||{}).msUTC&&t($))return+$;var q=i($,nt||f.calendar);if(q===h)if(t($)){$=+$;var ot=Math.floor(E.mod($+.05,1)*10),it=Math.round($-ot/10);q=i(new Date(it))+ot/10}else return h;return q}function B($,Q,nt){return r($,Q,nt||f.calendar)}function R($){return f._categories[Math.round($)]}function L($){if(u($)){if(f._categoriesMap===void 0&&(f._categoriesMap={}),f._categoriesMap[$]!==void 0)return f._categoriesMap[$];f._categories.push(typeof $=="number"?String($):$);var Q=f._categories.length-1;return f._categoriesMap[$]=Q,Q}return h}function F($,Q){for(var nt=new Array(Q),Y=0;Y<Q;Y++){var q=($[0]||[])[Y],ot=($[1]||[])[Y];nt[Y]=N([q,ot])}return nt}function N($){if(f._categoriesMap)return f._categoriesMap[$]}function j($){var Q=N($);if(Q!==void 0)return Q;if(t($))return+$}function G($){return t($)?+$:N($)}function rt($,Q,nt){return c.round(nt+Q*$,2)}function ct($,Q,nt){return($-nt)/Q}var lt=function($){return t($)?rt($,f._m,f._b):h},tt=function($){return ct($,f._m,f._b)};if(f.rangebreaks){var Z=D==="y";lt=function($){if(!t($))return h;var Q=f._rangebreaks.length;if(!Q)return rt($,f._m,f._b);var nt=Z;f.range[0]>f.range[1]&&(nt=!nt);for(var Y=nt?-1:1,q=Y*$,ot=0,it=0;it<Q;it++){var dt=Y*f._rangebreaks[it].min,wt=Y*f._rangebreaks[it].max;if(q<dt)break;if(q>wt)ot=it+1;else{ot=q<(dt+wt)/2?it:it+1;break}}var xt=f._B[ot]||0;return isFinite(xt)?rt($,f._m2,xt):0},tt=function($){var Q=f._rangebreaks.length;if(!Q)return ct($,f._m,f._b);for(var nt=0,Y=0;Y<Q&&!($<f._rangebreaks[Y].pmin);Y++)$>f._rangebreaks[Y].pmax&&(nt=Y+1);return ct($,f._m2,f._B[nt])}}f.c2l=f.type==="log"?I:n,f.l2c=f.type==="log"?w:n,f.l2p=lt,f.p2l=tt,f.c2p=f.type==="log"?function($,Q){return lt(I($,Q))}:lt,f.p2c=f.type==="log"?function($){return w(tt($))}:tt,["linear","-"].indexOf(f.type)!==-1?(f.d2r=f.r2d=f.d2c=f.r2c=f.d2l=f.r2l=e,f.c2d=f.c2r=f.l2d=f.l2r=n,f.d2p=f.r2p=function($){return f.l2p(e($))},f.p2d=f.p2r=tt,f.cleanPos=n):f.type==="log"?(f.d2r=f.d2l=function($,Q){return I(e($),Q)},f.r2d=f.r2c=function($){return w(e($))},f.d2c=f.r2l=e,f.c2d=f.l2r=n,f.c2r=I,f.l2d=w,f.d2p=function($,Q){return f.l2p(f.d2r($,Q))},f.p2d=function($){return w(tt($))},f.r2p=function($){return f.l2p(e($))},f.p2r=tt,f.cleanPos=n):f.type==="date"?(f.d2r=f.r2d=E.identity,f.d2c=f.r2c=f.d2l=f.r2l=O,f.c2d=f.c2r=f.l2d=f.l2r=B,f.d2p=f.r2p=function($,Q,nt){return f.l2p(O($,0,nt))},f.p2d=f.p2r=function($,Q,nt){return B(tt($),Q,nt)},f.cleanPos=function($){return E.cleanDate($,h,f.calendar)}):f.type==="category"?(f.d2c=f.d2l=L,f.r2d=f.c2d=f.l2d=R,f.d2r=f.d2l_noadd=j,f.r2c=function($){var Q=G($);return Q!==void 0?Q:f.fraction2r(.5)},f.l2r=f.c2r=n,f.r2l=G,f.d2p=function($){return f.l2p(f.r2c($))},f.p2d=function($){return R(tt($))},f.r2p=f.d2p,f.p2r=tt,f.cleanPos=function($){return typeof $=="string"&&$!==""?$:n($)}):f.type==="multicategory"&&(f.r2d=f.c2d=f.l2d=R,f.d2r=f.d2l_noadd=j,f.r2c=function($){var Q=j($);return Q!==void 0?Q:f.fraction2r(.5)},f.r2c_just_indices=N,f.l2r=f.c2r=n,f.r2l=j,f.d2p=function($){return f.l2p(f.r2c($))},f.p2d=function($){return R(tt($))},f.r2p=f.d2p,f.p2r=tt,f.cleanPos=function($){return Array.isArray($)||typeof $=="string"&&$!==""?$:n($)},f.setupMultiCategory=function($){var Q=f._traceIndices,nt,Y,q=f._matchGroup;if(q&&f._categories.length===0){for(var ot in q)if(ot!==_){var it=k[b.id2name(ot)];Q=Q.concat(it._traceIndices)}}var dt=[[0,{}],[0,{}]],wt=[];for(nt=0;nt<Q.length;nt++){var xt=$[Q[nt]];if(D in xt){var Ft=xt[D],Et=xt._length||E.minRowLength(Ft);if(o(Ft[0])&&o(Ft[1]))for(Y=0;Y<Et;Y++){var Nt=Ft[0][Y],te=Ft[1][Y];u(Nt)&&u(te)&&(wt.push([Nt,te]),Nt in dt[0][1]||(dt[0][1][Nt]=dt[0][0]++),te in dt[1][1]||(dt[1][1][te]=dt[1][0]++))}}}for(wt.sort(function(Jt,Qt){var Wt=dt[0][1],gt=Wt[Jt[0]]-Wt[Qt[0]];if(gt)return gt;var bt=dt[1][1];return bt[Jt[1]]-bt[Qt[1]]}),nt=0;nt<wt.length;nt++)L(wt[nt])}),f.fraction2r=function($){var Q=f.r2l(f.range[0]),nt=f.r2l(f.range[1]);return f.l2r(Q+$*(nt-Q))},f.r2fraction=function($){var Q=f.r2l(f.range[0]),nt=f.r2l(f.range[1]);return(f.r2l($)-Q)/(nt-Q)},f.limitRange=function($){var Q=f.minallowed,nt=f.maxallowed;if(!(Q===void 0&&nt===void 0)){$||($="range");var Y=E.nestedProperty(f,$).get(),q=E.simpleMap(Y,f.r2l),ot=q[1]<q[0];ot&&q.reverse();var it=E.simpleMap([Q,nt],f.r2l);if(Q!==void 0&&q[0]<it[0]&&(Y[ot?1:0]=Q),nt!==void 0&&q[1]>it[1]&&(Y[ot?0:1]=nt),Y[0]===Y[1]){var dt=f.l2r(Q),wt=f.l2r(nt);if(Q!==void 0){var xt=dt+1;nt!==void 0&&(xt=Math.min(xt,wt)),Y[ot?1:0]=xt}if(nt!==void 0){var Ft=wt+1;Q!==void 0&&(Ft=Math.max(Ft,dt)),Y[ot?0:1]=Ft}}}},f.cleanRange=function($,Q){f._cleanRange($,Q),f.limitRange($)},f._cleanRange=function($,Q){Q||(Q={}),$||($="range");var nt=E.nestedProperty(f,$).get(),Y,q;if(f.type==="date"?q=E.dfltRange(f.calendar):D==="y"?q=S.DFLTRANGEY:f._name==="realaxis"?q=[0,1]:q=Q.dfltRange||S.DFLTRANGEX,q=q.slice(),(f.rangemode==="tozero"||f.rangemode==="nonnegative")&&(q[0]=0),!nt||nt.length!==2){E.nestedProperty(f,$).set(q);return}var ot=nt[0]===null,it=nt[1]===null;for(f.type==="date"&&!f.autorange&&(nt[0]=E.cleanDate(nt[0],h,f.calendar),nt[1]=E.cleanDate(nt[1],h,f.calendar)),Y=0;Y<2;Y++)if(f.type==="date"){if(!E.isDateTime(nt[Y],f.calendar)){f[$]=q;break}if(f.r2l(nt[0])===f.r2l(nt[1])){var dt=E.constrain(f.r2l(nt[0]),E.MIN_MS+1e3,E.MAX_MS-1e3);nt[0]=f.l2r(dt-1e3),nt[1]=f.l2r(dt+1e3);break}}else{if(!t(nt[Y]))if(!(ot||it)&&t(nt[1-Y]))nt[Y]=nt[1-Y]*(Y?10:.1);else{f[$]=q;break}if(nt[Y]<-s?nt[Y]=-s:nt[Y]>s&&(nt[Y]=s),nt[0]===nt[1]){var wt=Math.max(1,Math.abs(nt[0]*1e-6));nt[0]-=wt,nt[1]+=wt}}},f.setScale=function($){var Q=k._size;if(f.overlaying){var nt=b.getFromId({_fullLayout:k},f.overlaying);f.domain=nt.domain}var Y=$&&f._r?"_r":"range",q=f.calendar;f.cleanRange(Y);var ot=f.r2l(f[Y][0],q),it=f.r2l(f[Y][1],q),dt=D==="y";if(dt?(f._offset=Q.t+(1-f.domain[1])*Q.h,f._length=Q.h*(f.domain[1]-f.domain[0]),f._m=f._length/(ot-it),f._b=-f._m*it):(f._offset=Q.l+f.domain[0]*Q.w,f._length=Q.w*(f.domain[1]-f.domain[0]),f._m=f._length/(it-ot),f._b=-f._m*ot),f._rangebreaks=[],f._lBreaks=0,f._m2=0,f._B=[],f.rangebreaks){var wt,xt;if(f._rangebreaks=f.locateBreaks(Math.min(ot,it),Math.max(ot,it)),f._rangebreaks.length){for(wt=0;wt<f._rangebreaks.length;wt++)xt=f._rangebreaks[wt],f._lBreaks+=Math.abs(xt.max-xt.min);var Ft=dt;ot>it&&(Ft=!Ft),Ft&&f._rangebreaks.reverse();var Et=Ft?-1:1;for(f._m2=Et*f._length/(Math.abs(it-ot)-f._lBreaks),f._B.push(-f._m2*(dt?it:ot)),wt=0;wt<f._rangebreaks.length;wt++)xt=f._rangebreaks[wt],f._B.push(f._B[f._B.length-1]-Et*f._m2*(xt.max-xt.min));for(wt=0;wt<f._rangebreaks.length;wt++)xt=f._rangebreaks[wt],xt.pmin=lt(xt.min),xt.pmax=lt(xt.max)}}if(!isFinite(f._m)||!isFinite(f._b)||f._length<0)throw k._replotting=!1,new Error("Something went wrong with axis scaling")},f.maskBreaks=function($){var Q=f.rangebreaks||[],nt,Y,q,ot,it;Q._cachedPatterns||(Q._cachedPatterns=Q.map(function(Wt){return Wt.enabled&&Wt.bounds?E.simpleMap(Wt.bounds,Wt.pattern?e:f.d2c):null})),Q._cachedValues||(Q._cachedValues=Q.map(function(Wt){return Wt.enabled&&Wt.values?E.simpleMap(Wt.values,f.d2c).sort(E.sorterAsc):null}));for(var dt=0;dt<Q.length;dt++){var wt=Q[dt];if(wt.enabled){if(wt.bounds){var xt=wt.pattern;switch(nt=Q._cachedPatterns[dt],Y=nt[0],q=nt[1],xt){case M:it=new Date($),ot=it.getUTCDay(),Y>q&&(q+=7,ot<Y&&(ot+=7));break;case T:it=new Date($);var Ft=it.getUTCHours(),Et=it.getUTCMinutes(),Nt=it.getUTCSeconds(),te=it.getUTCMilliseconds();ot=Ft+(Et/60+Nt/3600+te/36e5),Y>q&&(q+=24,ot<Y&&(ot+=24));break;case"":ot=$;break}if(ot>=Y&&ot<q)return h}else for(var Jt=Q._cachedValues[dt],Qt=0;Qt<Jt.length;Qt++)if(Y=Jt[Qt],q=Y+wt.dvalue,$>=Y&&$<q)return h}}return $},f.locateBreaks=function($,Q){var nt,Y,q,ot,it=[];if(!f.rangebreaks)return it;var dt=f.rangebreaks.slice().sort(function(bt,vt){return bt.pattern===M&&vt.pattern===T?-1:vt.pattern===M&&bt.pattern===T?1:0}),wt=function(bt,vt){if(bt=E.constrain(bt,$,Q),vt=E.constrain(vt,$,Q),bt!==vt){for(var Ut=!0,Kt=0;Kt<it.length;Kt++){var Zt=it[Kt];bt<Zt.max&&vt>=Zt.min&&(bt<Zt.min&&(Zt.min=bt),vt>Zt.max&&(Zt.max=vt),Ut=!1)}Ut&&it.push({min:bt,max:vt})}};for(nt=0;nt<dt.length;nt++){var xt=dt[nt];if(xt.enabled)if(xt.bounds){var Ft=$,Et=Q;xt.pattern&&(Ft=Math.floor(Ft)),Y=E.simpleMap(xt.bounds,xt.pattern?e:f.r2l),q=Y[0],ot=Y[1];var Nt=new Date(Ft),te,Jt;switch(xt.pattern){case M:Jt=m,te=((ot<q?7:0)+(ot-q))*p,Ft+=q*p-(Nt.getUTCDay()*p+Nt.getUTCHours()*y+Nt.getUTCMinutes()*l+Nt.getUTCSeconds()*x+Nt.getUTCMilliseconds());break;case T:Jt=p,te=((ot<q?24:0)+(ot-q))*y,Ft+=q*y-(Nt.getUTCHours()*y+Nt.getUTCMinutes()*l+Nt.getUTCSeconds()*x+Nt.getUTCMilliseconds());break;default:Ft=Math.min(Y[0],Y[1]),Et=Math.max(Y[0],Y[1]),Jt=Et-Ft,te=Jt}for(var Qt=Ft;Qt<Et;Qt+=Jt)wt(Qt,Qt+te)}else for(var Wt=E.simpleMap(xt.values,f.d2c),gt=0;gt<Wt.length;gt++)q=Wt[gt],ot=q+xt.dvalue,wt(q,ot)}return it.sort(function(bt,vt){return bt.min-vt.min}),it},f.makeCalcdata=function($,Q,nt){var Y,q,ot,it,dt=f.type,wt=dt==="date"&&$[Q+"calendar"];if(Q in $){if(Y=$[Q],it=$._length||E.minRowLength(Y),E.isTypedArray(Y)&&(dt==="linear"||dt==="log")){if(it===Y.length)return Y;if(Y.subarray)return Y.subarray(0,it)}if(dt==="multicategory")return F(Y,it);for(q=new Array(it),ot=0;ot<it;ot++)q[ot]=f.d2c(Y[ot],0,wt,nt)}else{var xt=Q+"0"in $?f.d2c($[Q+"0"],0,wt):0,Ft=$["d"+Q]?Number($["d"+Q]):1;for(Y=$[{x:"y",y:"x"}[Q]],it=$._length||Y.length,q=new Array(it),ot=0;ot<it;ot++)q[ot]=xt+ot*Ft}if(f.rangebreaks)for(ot=0;ot<it;ot++)q[ot]=f.maskBreaks(q[ot]);return q},f.isValidRange=function($,Q){return Array.isArray($)&&$.length===2&&(Q&&$[0]===null||t(f.r2l($[0])))&&(Q&&$[1]===null||t(f.r2l($[1])))},f.getAutorangeDflt=function($,Q){var nt=!f.isValidRange($,"nullOk");return nt&&Q&&Q.reverseDflt?nt="reversed":$&&($[0]===null&&$[1]===null?nt=!0:$[0]===null&&$[1]!==null?nt="min":$[0]!==null&&$[1]===null&&(nt="max")),nt},f.isReversed=function(){var $=f.autorange;return $==="reversed"||$==="min reversed"||$==="max reversed"},f.isPtWithinRange=function($,Q){var nt=f.c2l($[D],null,Q),Y=f.r2l(f.range[0]),q=f.r2l(f.range[1]);return Y<q?Y<=nt&&nt<=q:q<=nt&&nt<=Y},f._emptyCategories=function(){f._categories=[],f._categoriesMap={}},f.clearCalc=function(){var $=f._matchGroup;if($){var Q=null,nt=null;for(var Y in $){var q=k[b.id2name(Y)];if(q._categories){Q=q._categories,nt=q._categoriesMap;break}}Q&&nt?(f._categories=Q,f._categoriesMap=nt):f._emptyCategories()}else f._emptyCategories();if(f._initialCategories)for(var ot=0;ot<f._initialCategories.length;ot++)L(f._initialCategories[ot])},f.sortByInitialCategories=function(){var $=[];if(f._emptyCategories(),f._initialCategories)for(var Q=0;Q<f._initialCategories.length;Q++)L(f._initialCategories[Q]);$=$.concat(f._traceIndices);var nt=f._matchGroup;for(var Y in nt)if(_!==Y){var q=k[b.id2name(Y)];q._categories=f._categories,q._categoriesMap=f._categoriesMap,$=$.concat(q._traceIndices)}return $};var st=k._d3locale;f.type==="date"&&(f._dateFormat=st?st.timeFormat:g,f._extraFormat=k._extraFormat),f._separators=k.separators,f._numFormat=st?st.numberFormat:A,delete f._minDtick,delete f._forceTick0}}),bg=Vt((X,V)=>{var c=vo(),g=qr(),E=ts().BADNUM,A=g.isArrayOrTypedArray,t=g.isDateTime,e=g.cleanNumber,r=Math.round;V.exports=function(v,m,p){var y=v,l=p.noMultiCategory;if(A(y)&&!y.length)return"-";if(!l&&h(y))return"multicategory";if(l&&Array.isArray(y[0])){for(var x=[],b=0;b<y.length;b++)if(A(y[b]))for(var S=0;S<y[b].length;S++)x.push(y[b][S]);y=x}if(o(y,m))return"date";var T=p.autotypenumbers!=="strict";return s(y,T)?"category":n(y,T)?"linear":"-"};function i(v,m){return m?c(v):typeof v=="number"}function n(v,m){for(var p=v.length,y=0;y<p;y++)if(i(v[y],m))return!0;return!1}function o(v,m){for(var p=v.length,y=a(p),l=0,x=0,b={},S=0;S<p;S+=y){var T=r(S),M=v[T],w=String(M);b[w]||(b[w]=1,t(M,m)&&l++,c(M)&&x++)}return l>x*2}function a(v){return Math.max(1,(v-1)/1e3)}function s(v,m){for(var p=v.length,y=a(p),l=0,x=0,b={},S=0;S<p;S+=y){var T=r(S),M=v[T],w=String(M);if(!b[w]){b[w]=1;var u=typeof M;u==="boolean"?x++:(m?e(M)!==E:u==="number")?l++:u==="string"&&x++}}return x>l*2}function h(v){return A(v[0])&&A(v[1])}}),Kf=Vt((X,V)=>{var c=Ai(),g=vo(),E=qr(),A=ts().FP_SAFE,t=Mi(),e=go(),r=rc(),i=r.getFromId,n=r.isLinked;V.exports={applyAutorangeOptions:k,getAutoRange:o,makePadFn:s,doAutoRange:p,findExtremes:y,concatExtremes:m};function o(_,D){var I,O,B=[],R=_._fullLayout,L=s(R,D,0),F=s(R,D,1),N=m(_,D),j=N.min,G=N.max;if(j.length===0||G.length===0)return E.simpleMap(D.range,D.r2l);var rt=j[0].val,ct=G[0].val;for(I=1;I<j.length&&rt===ct;I++)rt=Math.min(rt,j[I].val);for(I=1;I<G.length&&rt===ct;I++)ct=Math.max(ct,G[I].val);var lt=D.autorange,tt=lt==="reversed"||lt==="min reversed"||lt==="max reversed";if(!tt&&D.range){var Z=E.simpleMap(D.range,D.r2l);tt=Z[1]<Z[0]}D.autorange==="reversed"&&(D.autorange=!0);var st=D.rangemode,$=st==="tozero",Q=st==="nonnegative",nt=D._length,Y=nt/10,q=0,ot,it,dt,wt,xt,Ft;for(I=0;I<j.length;I++)for(ot=j[I],O=0;O<G.length;O++)it=G[O],Ft=it.val-ot.val-a(D,ot.val,it.val),Ft>0&&(xt=nt-L(ot)-F(it),xt>Y?Ft/xt>q&&(dt=ot,wt=it,q=Ft/xt):Ft/nt>q&&(dt={val:ot.val,nopad:1},wt={val:it.val,nopad:1},q=Ft/nt));function Et(Wt,gt){return Math.max(Wt,F(gt))}if(rt===ct){var Nt=rt-1,te=rt+1;if($)if(rt===0)B=[0,1];else{var Jt=(rt>0?G:j).reduce(Et,0),Qt=rt/(1-Math.min(.5,Jt/nt));B=rt>0?[0,Qt]:[Qt,0]}else Q?B=[Math.max(0,Nt),Math.max(1,te)]:B=[Nt,te]}else $?(dt.val>=0&&(dt={val:0,nopad:1}),wt.val<=0&&(wt={val:0,nopad:1})):Q&&(dt.val-q*L(dt)<0&&(dt={val:0,nopad:1}),wt.val<=0&&(wt={val:1,nopad:1})),q=(wt.val-dt.val-a(D,ot.val,it.val))/(nt-L(dt)-F(wt)),B=[dt.val-q*L(dt),wt.val+q*F(wt)];return B=k(B,D),D.limitRange&&D.limitRange(),tt&&B.reverse(),E.simpleMap(B,D.l2r||Number)}function a(_,D,I){var O=0;if(_.rangebreaks)for(var B=_.locateBreaks(D,I),R=0;R<B.length;R++){var L=B[R];O+=L.max-L.min}return O}function s(_,D,I){var O=.05*D._length,B=D._anchorAxis||{};if((D.ticklabelposition||"").indexOf("inside")!==-1||(B.ticklabelposition||"").indexOf("inside")!==-1){var R=D.isReversed();if(!R){var L=E.simpleMap(D.range,D.r2l);R=L[1]<L[0]}R&&(I=!I)}var F=0;return n(_,D._id)||(F=v(_,D,I)),O=Math.max(F,O),D.constrain==="domain"&&D._inputDomain&&(O*=(D._inputDomain[1]-D._inputDomain[0])/(D.domain[1]-D.domain[0])),function(N){return N.nopad?0:N.pad+(N.extrapad?O:F)}}var h=3;function v(_,D,I){var O=0,B=D._id.charAt(0)==="x";for(var R in _._plots){var L=_._plots[R];if(!(D._id!==L.xaxis._id&&D._id!==L.yaxis._id)){var F=(B?L.yaxis:L.xaxis)||{};if((F.ticklabelposition||"").indexOf("inside")!==-1&&(!I&&(F.side==="left"||F.side==="bottom")||I&&(F.side==="top"||F.side==="right"))){if(F._vals){var N=E.deg2rad(F._tickAngles[F._id+"tick"]||0),j=Math.abs(Math.cos(N)),G=Math.abs(Math.sin(N));if(!F._vals[0].bb){var rt=F._id+"tick",ct=F._selections[rt];ct.each(function(Q){var nt=c.select(this),Y=nt.select(".text-math-group");Y.empty()&&(Q.bb=e.bBox(nt.node()))})}for(var lt=0;lt<F._vals.length;lt++){var tt=F._vals[lt],Z=tt.bb;if(Z){var st=2*h+Z.width,$=2*h+Z.height;O=Math.max(O,B?Math.max(st*j,$*G):Math.max($*j,st*G))}}}F.ticks==="inside"&&F.ticklabelposition==="inside"&&(O+=F.ticklen||0)}}}return O}function m(_,D,I){var O=D._id,B=_._fullData,R=_._fullLayout,L=[],F=[],N,j,G;function rt(st,$){for(N=0;N<$.length;N++){var Q=st[$[N]],nt=(Q._extremes||{})[O];if(Q.visible===!0&&nt){for(j=0;j<nt.min.length;j++)G=nt.min[j],l(L,G.val,G.pad,{extrapad:G.extrapad});for(j=0;j<nt.max.length;j++)G=nt.max[j],x(F,G.val,G.pad,{extrapad:G.extrapad})}}}if(rt(B,D._traceIndices),rt(R.annotations||[],D._annIndices||[]),rt(R.shapes||[],D._shapeIndices||[]),D._matchGroup&&!I){for(var ct in D._matchGroup)if(ct!==D._id){var lt=i(_,ct),tt=m(_,lt,!0),Z=D._length/lt._length;for(j=0;j<tt.min.length;j++)G=tt.min[j],l(L,G.val,G.pad*Z,{extrapad:G.extrapad});for(j=0;j<tt.max.length;j++)G=tt.max[j],x(F,G.val,G.pad*Z,{extrapad:G.extrapad})}}return{min:L,max:F}}function p(_,D,I){if(D.setScale(),D.autorange){D.range=I?I.slice():o(_,D),D._r=D.range.slice(),D._rl=E.simpleMap(D._r,D.r2l);var O=D._input,B={};B[D._attr+".range"]=D.range,B[D._attr+".autorange"]=D.autorange,t.call("_storeDirectGUIEdit",_.layout,_._fullLayout._preGUI,B),O.range=D.range.slice(),O.autorange=D.autorange}var R=D._anchorAxis;if(R&&R.rangeslider){var L=R.rangeslider[D._name];L&&L.rangemode==="auto"&&(L.range=o(_,D)),R._input.rangeslider[D._name]=E.extendFlat({},L)}}function y(_,D,I){I||(I={}),_._m||_.setScale();var O=[],B=[],R=D.length,L=I.padded||!1,F=I.tozero&&(_.type==="linear"||_.type==="-"),N=_.type==="log",j=!1,G=I.vpadLinearized||!1,rt,ct,lt,tt,Z,st,$,Q,nt;function Y(Et){if(Array.isArray(Et))return j=!0,function(te){return Math.max(Number(Et[te]||0),0)};var Nt=Math.max(Number(Et||0),0);return function(){return Nt}}var q=Y((_._m>0?I.ppadplus:I.ppadminus)||I.ppad||0),ot=Y((_._m>0?I.ppadminus:I.ppadplus)||I.ppad||0),it=Y(I.vpadplus||I.vpad),dt=Y(I.vpadminus||I.vpad);if(!j){if(Q=1/0,nt=-1/0,N)for(rt=0;rt<R;rt++)ct=D[rt],ct<Q&&ct>0&&(Q=ct),ct>nt&&ct<A&&(nt=ct);else for(rt=0;rt<R;rt++)ct=D[rt],ct<Q&&ct>-A&&(Q=ct),ct>nt&&ct<A&&(nt=ct);D=[Q,nt],R=2}var wt={tozero:F,extrapad:L};function xt(Et){lt=D[Et],g(lt)&&(st=q(Et),$=ot(Et),G?(tt=_.c2l(lt)-dt(Et),Z=_.c2l(lt)+it(Et)):(Q=lt-dt(Et),nt=lt+it(Et),N&&Q<nt/10&&(Q=nt/10),tt=_.c2l(Q),Z=_.c2l(nt)),F&&(tt=Math.min(0,tt),Z=Math.max(0,Z)),S(tt)&&l(O,tt,$,wt),S(Z)&&x(B,Z,st,wt))}var Ft=Math.min(6,R);for(rt=0;rt<Ft;rt++)xt(rt);for(rt=R-1;rt>=Ft;rt--)xt(rt);return{min:O,max:B,opts:I}}function l(_,D,I,O){b(_,D,I,O,T)}function x(_,D,I,O){b(_,D,I,O,M)}function b(_,D,I,O,B){for(var R=O.tozero,L=O.extrapad,F=!0,N=0;N<_.length&&F;N++){var j=_[N];if(B(j.val,D)&&j.pad>=I&&(j.extrapad||!L)){F=!1;break}else B(D,j.val)&&j.pad<=I&&(L||!j.extrapad)&&(_.splice(N,1),N--)}if(F){var G=R&&D===0;_.push({val:D,pad:G?0:I,extrapad:G?!1:L})}}function S(_){return g(_)&&Math.abs(_)<A}function T(_,D){return _<=D}function M(_,D){return _>=D}function w(_,D){var I=D.autorangeoptions;return I&&I.minallowed!==void 0&&f(D,I.minallowed,I.maxallowed)?I.minallowed:I&&I.clipmin!==void 0&&f(D,I.clipmin,I.clipmax)?Math.max(_,D.d2l(I.clipmin)):_}function u(_,D){var I=D.autorangeoptions;return I&&I.maxallowed!==void 0&&f(D,I.minallowed,I.maxallowed)?I.maxallowed:I&&I.clipmax!==void 0&&f(D,I.clipmin,I.clipmax)?Math.min(_,D.d2l(I.clipmax)):_}function f(_,D,I){return D!==void 0&&I!==void 0?(D=_.d2l(D),I=_.d2l(I),D<I):!0}function k(_,D){if(!D||!D.autorangeoptions)return _;var I=_[0],O=_[1],B=D.autorangeoptions.include;if(B!==void 0){var R=D.d2l(I),L=D.d2l(O);E.isArrayOrTypedArray(B)||(B=[B]);for(var F=0;F<B.length;F++){var N=D.d2l(B[F]);R>=N&&(R=N,I=N),L<=N&&(L=N,O=N)}}return I=w(I,D),O=u(O,D),[I,O]}}),ao=Vt((X,V)=>{var c=Ai(),g=vo(),E=fu(),A=Mi(),t=qr(),e=t.strTranslate,r=sl(),i=u0(),n=vi(),o=go(),a=Ih(),s=nb(),h=ts(),v=h.ONEMAXYEAR,m=h.ONEAVGYEAR,p=h.ONEMINYEAR,y=h.ONEMAXQUARTER,l=h.ONEAVGQUARTER,x=h.ONEMINQUARTER,b=h.ONEMAXMONTH,S=h.ONEAVGMONTH,T=h.ONEMINMONTH,M=h.ONEWEEK,w=h.ONEDAY,u=w/2,f=h.ONEHOUR,k=h.ONEMIN,_=h.ONESEC,D=h.ONEMILLI,I=h.ONEMICROSEC,O=h.MINUS_SIGN,B=h.BADNUM,R={K:"zeroline"},L={K:"gridline",L:"path"},F={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},j={K:"tick",L:"text"},G={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},rt=nh(),ct=rt.MID_SHIFT,lt=rt.CAP_SHIFT,tt=rt.LINE_SPACING,Z=rt.OPPOSITE_SIDE,st=3,$=V.exports={};$.setConvert=xp();var Q=bg(),nt=rc(),Y=nt.idSort,q=nt.isLinked;$.id2name=nt.id2name,$.name2id=nt.name2id,$.cleanId=nt.cleanId,$.list=nt.list,$.listIds=nt.listIds,$.getFromId=nt.getFromId,$.getFromTrace=nt.getFromTrace;var ot=Kf();$.getAutoRange=ot.getAutoRange,$.findExtremes=ot.findExtremes;var it=1e-4;function dt(ue){var xe=(ue[1]-ue[0])*it;return[ue[0]-xe,ue[1]+xe]}$.coerceRef=function(ue,xe,Pr,Sr,gr,dr){var Er=Sr.charAt(Sr.length-1),Dr=Pr._fullLayout._subplots[Er+"axis"],Ar=Sr+"ref",Gr={};return gr||(gr=Dr[0]||(typeof dr=="string"?dr:dr[0])),dr||(dr=gr),Dr=Dr.concat(Dr.map(function(Wr){return Wr+" domain"})),Gr[Ar]={valType:"enumerated",values:Dr.concat(dr?typeof dr=="string"?[dr]:dr:[]),dflt:gr},t.coerce(ue,xe,Gr,Ar)},$.getRefType=function(ue){return ue===void 0?ue:ue==="paper"?"paper":ue==="pixel"?"pixel":/( domain)$/.test(ue)?"domain":"range"},$.coercePosition=function(ue,xe,Pr,Sr,gr,dr){var Er,Dr,Ar=$.getRefType(Sr);if(Ar!=="range")Er=t.ensureNumber,Dr=Pr(gr,dr);else{var Gr=$.getFromId(xe,Sr);dr=Gr.fraction2r(dr),Dr=Pr(gr,dr),Er=Gr.cleanPos}ue[gr]=Er(Dr)},$.cleanPosition=function(ue,xe,Pr){var Sr=Pr==="paper"||Pr==="pixel"?t.ensureNumber:$.getFromId(xe,Pr).cleanPos;return Sr(ue)},$.redrawComponents=function(ue,xe){xe=xe||$.listIds(ue);var Pr=ue._fullLayout;function Sr(gr,dr,Er,Dr){for(var Ar=A.getComponentMethod(gr,dr),Gr={},Wr=0;Wr<xe.length;Wr++)for(var Jr=Pr[$.id2name(xe[Wr])],_e=Jr[Er],Je=0;Je<_e.length;Je++){var yr=_e[Je];if(!Gr[yr]&&(Ar(ue,yr),Gr[yr]=1,Dr))return}}Sr("annotations","drawOne","_annIndices"),Sr("shapes","drawOne","_shapeIndices"),Sr("images","draw","_imgIndices",!0),Sr("selections","drawOne","_selectionIndices")};var wt=$.getDataConversions=function(ue,xe,Pr,Sr){var gr,dr=Pr==="x"||Pr==="y"||Pr==="z"?Pr:Sr;if(t.isArrayOrTypedArray(dr)){if(gr={type:Q(Sr,void 0,{autotypenumbers:ue._fullLayout.autotypenumbers}),_categories:[]},$.setConvert(gr),gr.type==="category")for(var Er=0;Er<Sr.length;Er++)gr.d2c(Sr[Er])}else gr=$.getFromTrace(ue,xe,dr);return gr?{d2c:gr.d2c,c2d:gr.c2d}:dr==="ids"?{d2c:Ft,c2d:Ft}:{d2c:xt,c2d:xt}};function xt(ue){return+ue}function Ft(ue){return String(ue)}$.getDataToCoordFunc=function(ue,xe,Pr,Sr){return wt(ue,xe,Pr,Sr).d2c},$.counterLetter=function(ue){var xe=ue.charAt(0);if(xe==="x")return"y";if(xe==="y")return"x"},$.minDtick=function(ue,xe,Pr,Sr){["log","category","multicategory"].indexOf(ue.type)!==-1||!Sr?ue._minDtick=0:ue._minDtick===void 0?(ue._minDtick=xe,ue._forceTick0=Pr):ue._minDtick&&((ue._minDtick/xe+1e-6)%1<2e-6&&((Pr-ue._forceTick0)/xe%1+1.000001)%1<2e-6?(ue._minDtick=xe,ue._forceTick0=Pr):((xe/ue._minDtick+1e-6)%1>2e-6||((Pr-ue._forceTick0)/ue._minDtick%1+1.000001)%1>2e-6)&&(ue._minDtick=0))},$.saveRangeInitial=function(ue,xe){for(var Pr=$.list(ue,"",!0),Sr=!1,gr=0;gr<Pr.length;gr++){var dr=Pr[gr],Er=dr._rangeInitial0===void 0&&dr._rangeInitial1===void 0,Dr=Er||dr.range[0]!==dr._rangeInitial0||dr.range[1]!==dr._rangeInitial1,Ar=dr.autorange;(Er&&Ar!==!0||xe&&Dr)&&(dr._rangeInitial0=Ar==="min"||Ar==="max reversed"?void 0:dr.range[0],dr._rangeInitial1=Ar==="max"||Ar==="min reversed"?void 0:dr.range[1],dr._autorangeInitial=Ar,Sr=!0)}return Sr},$.saveShowSpikeInitial=function(ue,xe){for(var Pr=$.list(ue,"",!0),Sr=!1,gr="on",dr=0;dr<Pr.length;dr++){var Er=Pr[dr],Dr=Er._showSpikeInitial===void 0,Ar=Dr||Er.showspikes!==Er._showspikes;(Dr||xe&&Ar)&&(Er._showSpikeInitial=Er.showspikes,Sr=!0),gr==="on"&&!Er.showspikes&&(gr="off")}return ue._fullLayout._cartesianSpikesEnabled=gr,Sr},$.autoBin=function(ue,xe,Pr,Sr,gr,dr){var Er=t.aggNums(Math.min,null,ue),Dr=t.aggNums(Math.max,null,ue);if(xe.type==="category"||xe.type==="multicategory")return{start:Er-.5,end:Dr+.5,size:Math.max(1,Math.round(dr)||1),_dataSpan:Dr-Er};gr||(gr=xe.calendar);var Ar;if(xe.type==="log"?Ar={type:"linear",range:[Er,Dr]}:Ar={type:xe.type,range:t.simpleMap([Er,Dr],xe.c2r,0,gr),calendar:gr},$.setConvert(Ar),dr=dr&&s.dtick(dr,Ar.type),dr)Ar.dtick=dr,Ar.tick0=s.tick0(void 0,Ar.type,gr);else{var Gr;if(Pr)Gr=(Dr-Er)/Pr;else{var Wr=t.distinctVals(ue),Jr=Math.pow(10,Math.floor(Math.log(Wr.minDiff)/Math.LN10)),_e=Jr*t.roundUp(Wr.minDiff/Jr,[.9,1.9,4.9,9.9],!0);Gr=Math.max(_e,2*t.stdev(ue)/Math.pow(ue.length,Sr?.25:.4)),g(Gr)||(Gr=1)}$.autoTicks(Ar,Gr)}var Je=Ar.dtick,yr=$.tickIncrement($.tickFirst(Ar),Je,"reverse",gr),Hr,hn;if(typeof Je=="number")yr=Et(yr,ue,Ar,Er,Dr),hn=1+Math.floor((Dr-yr)/Je),Hr=yr+hn*Je;else for(Ar.dtick.charAt(0)==="M"&&(yr=Nt(yr,ue,Je,Er,gr)),Hr=yr,hn=0;Hr<=Dr;)Hr=$.tickIncrement(Hr,Je,!1,gr),hn++;return{start:xe.c2r(yr,0,gr),end:xe.c2r(Hr,0,gr),size:Je,_dataSpan:Dr-Er}};function Et(ue,xe,Pr,Sr,gr){var dr=0,Er=0,Dr=0,Ar=0;function Gr(Je){return(1+(Je-ue)*100/Pr.dtick)%100<2}for(var Wr=0;Wr<xe.length;Wr++)xe[Wr]%1===0?Dr++:g(xe[Wr])||Ar++,Gr(xe[Wr])&&dr++,Gr(xe[Wr]+Pr.dtick/2)&&Er++;var Jr=xe.length-Ar;if(Dr===Jr&&Pr.type!=="date")Pr.dtick<1?ue=Sr-.5*Pr.dtick:(ue-=.5,ue+Pr.dtick<Sr&&(ue+=Pr.dtick));else if(Er<Jr*.1&&(dr>Jr*.3||Gr(Sr)||Gr(gr))){var _e=Pr.dtick/2;ue+=ue+_e<Sr?_e:-_e}return ue}function Nt(ue,xe,Pr,Sr,gr){var dr=t.findExactDates(xe,gr),Er=.8;if(dr.exactDays>Er){var Dr=Number(Pr.substr(1));dr.exactYears>Er&&Dr%12===0?ue=$.tickIncrement(ue,"M6","reverse")+w*1.5:dr.exactMonths>Er?ue=$.tickIncrement(ue,"M1","reverse")+w*15.5:ue-=u;var Ar=$.tickIncrement(ue,Pr);if(Ar<=Sr)return Ar}return ue}$.prepMinorTicks=function(ue,xe,Pr){if(!xe.minor.dtick){delete ue.dtick;var Sr=xe.dtick&&g(xe._tmin),gr;if(Sr){var dr=$.tickIncrement(xe._tmin,xe.dtick,!0);gr=[xe._tmin,dr*.99+xe._tmin*.01]}else{var Er=t.simpleMap(xe.range,xe.r2l);gr=[Er[0],.8*Er[0]+.2*Er[1]]}if(ue.range=t.simpleMap(gr,xe.l2r),ue._isMinor=!0,$.prepTicks(ue,Pr),Sr){var Dr=g(xe.dtick),Ar=g(ue.dtick),Gr=Dr?xe.dtick:+xe.dtick.substring(1),Wr=Ar?ue.dtick:+ue.dtick.substring(1);Dr&&Ar?te(Gr,Wr)?Gr===2*M&&Wr===2*w&&(ue.dtick=M):Gr===2*M&&Wr===3*w?ue.dtick=M:Gr===M&&!(xe._input.minor||{}).nticks?ue.dtick=w:Jt(Gr/Wr,2.5)?ue.dtick=Gr/2:ue.dtick=Gr:String(xe.dtick).charAt(0)==="M"?Ar?ue.dtick="M1":te(Gr,Wr)?Gr>=12&&Wr===2&&(ue.dtick="M3"):ue.dtick=xe.dtick:String(ue.dtick).charAt(0)==="L"?String(xe.dtick).charAt(0)==="L"?te(Gr,Wr)||(ue.dtick=Jt(Gr/Wr,2.5)?xe.dtick/2:xe.dtick):ue.dtick="D1":ue.dtick==="D2"&&+xe.dtick>1&&(ue.dtick=1)}ue.range=xe.range}xe.minor._tick0Init===void 0&&(ue.tick0=xe.tick0)};function te(ue,xe){return Math.abs((ue/xe+.5)%1-.5)<.001}function Jt(ue,xe){return Math.abs(ue/xe-1)<.001}$.prepTicks=function(ue,xe){var Pr=t.simpleMap(ue.range,ue.r2l,void 0,void 0,xe);if(ue.tickmode==="auto"||!ue.dtick){var Sr=ue.nticks,gr;Sr||(ue.type==="category"||ue.type==="multicategory"?(gr=ue.tickfont?t.bigFont(ue.tickfont.size||12):15,Sr=ue._length/gr):(gr=ue._id.charAt(0)==="y"?40:80,Sr=t.constrain(ue._length/gr,4,9)+1),ue._name==="radialaxis"&&(Sr*=2)),ue.minor&&ue.minor.tickmode!=="array"||ue.tickmode==="array"&&(Sr*=100),ue._roughDTick=Math.abs(Pr[1]-Pr[0])/Sr,$.autoTicks(ue,ue._roughDTick),ue._minDtick>0&&ue.dtick<ue._minDtick*2&&(ue.dtick=ue._minDtick,ue.tick0=ue.l2r(ue._forceTick0))}ue.ticklabelmode==="period"&&Wt(ue),ue.tick0||(ue.tick0=ue.type==="date"?"2000-01-01":0),ue.type==="date"&&ue.dtick<.1&&(ue.dtick=.1),fr(ue)};function Qt(ue){return+ue.substring(1)}function Wt(ue){var xe;function Pr(){return!(g(ue.dtick)||ue.dtick.charAt(0)!=="M")}var Sr=Pr(),gr=$.getTickFormat(ue);if(gr){var dr=ue._dtickInit!==ue.dtick;/%[fLQsSMX]/.test(gr)||(/%[HI]/.test(gr)?(xe=f,dr&&!Sr&&ue.dtick<f&&(ue.dtick=f)):/%p/.test(gr)?(xe=u,dr&&!Sr&&ue.dtick<u&&(ue.dtick=u)):/%[Aadejuwx]/.test(gr)?(xe=w,dr&&!Sr&&ue.dtick<w&&(ue.dtick=w)):/%[UVW]/.test(gr)?(xe=M,dr&&!Sr&&ue.dtick<M&&(ue.dtick=M)):/%[Bbm]/.test(gr)?(xe=S,dr&&(Sr?Qt(ue.dtick)<1:ue.dtick<T)&&(ue.dtick="M1")):/%[q]/.test(gr)?(xe=l,dr&&(Sr?Qt(ue.dtick)<3:ue.dtick<x)&&(ue.dtick="M3")):/%[Yy]/.test(gr)&&(xe=m,dr&&(Sr?Qt(ue.dtick)<12:ue.dtick<p)&&(ue.dtick="M12")))}Sr=Pr(),Sr&&ue.tick0===ue._dowTick0&&(ue.tick0=ue._rawTick0),ue._definedDelta=xe}function gt(ue,xe,Pr){for(var Sr=0;Sr<ue.length;Sr++){var gr=ue[Sr].value,dr=Sr,Er=Sr+1;Sr<ue.length-1?(dr=Sr,Er=Sr+1):Sr>0?(dr=Sr-1,Er=Sr):(dr=Sr,Er=Sr);var Dr=ue[dr].value,Ar=ue[Er].value,Gr=Math.abs(Ar-Dr),Wr=Pr||Gr,Jr=0;Wr>=p?Gr>=p&&Gr<=v?Jr=Gr:Jr=m:Pr===l&&Wr>=x?Gr>=x&&Gr<=y?Jr=Gr:Jr=l:Wr>=T?Gr>=T&&Gr<=b?Jr=Gr:Jr=S:Pr===M&&Wr>=M?Jr=M:Wr>=w?Jr=w:Pr===u&&Wr>=u?Jr=u:Pr===f&&Wr>=f&&(Jr=f);var _e;Jr>=Gr&&(Jr=Gr,_e=!0);var Je=gr+Jr;if(xe.rangebreaks&&Jr>0){for(var yr=84,Hr=0,hn=0;hn<yr;hn++){var En=(hn+.5)/yr;xe.maskBreaks(gr*(1-En)+En*Je)!==B&&Hr++}Jr*=Hr/yr,Jr||(ue[Sr].drop=!0),_e&&Gr>M&&(Jr=Gr)}(Jr>0||Sr===0)&&(ue[Sr].periodX=gr+Jr/2)}}$.calcTicks=function(ue,xe){for(var Pr=ue.type,Sr=ue.calendar,gr=ue.ticklabelstep,dr=ue.ticklabelmode==="period",Er=ue.range[0]>ue.range[1],Dr=!ue.ticklabelindex||t.isArrayOrTypedArray(ue.ticklabelindex)?ue.ticklabelindex:[ue.ticklabelindex],Ar=t.simpleMap(ue.range,ue.r2l,void 0,void 0,xe),Gr=Ar[1]<Ar[0],Wr=Math.min(Ar[0],Ar[1]),Jr=Math.max(Ar[0],Ar[1]),_e=Math.max(1e3,ue._length||0),Je=[],yr=[],Hr=[],hn=[],En=[],dn=ue.minor&&(ue.minor.ticks||ue.minor.showgrid),Kr=1;Kr>=(dn?0:1);Kr--){var Tn=!Kr;Kr?(ue._dtickInit=ue.dtick,ue._tick0Init=ue.tick0):(ue.minor._dtickInit=ue.minor.dtick,ue.minor._tick0Init=ue.minor.tick0);var ta=Kr?ue:t.extendFlat({},ue,ue.minor);if(Tn?$.prepMinorTicks(ta,ue,xe):$.prepTicks(ta,xe),ta.tickmode==="array"){Kr?(Hr=[],Je=Ut(ue,!Tn)):(hn=[],yr=Ut(ue,!Tn));continue}if(ta.tickmode==="sync"){Hr=[],Je=vt(ue);continue}var Qn=dt(Ar),Va=Qn[0],ja=Qn[1],ci=g(ta.dtick),pi=Pr==="log"&&!(ci||ta.dtick.charAt(0)==="L"),bi=$.tickFirst(ta,xe);if(Kr){if(ue._tmin=bi,bi<Va!==Gr)break;(Pr==="category"||Pr==="multicategory")&&(ja=Gr?Math.max(-.5,ja):Math.min(ue._categories.length-.5,ja))}var ri=null,Da=bi,Ui;if(Kr){var lo;ci?lo=ue.dtick:Pr==="date"?typeof ue.dtick=="string"&&ue.dtick.charAt(0)==="M"&&(lo=S*ue.dtick.substring(1)):lo=ue._roughDTick,Ui=Math.round((ue.r2l(Da)-ue.r2l(ue.tick0))/lo)-1}var Co=ta.dtick;for(ta.rangebreaks&&ta._tick0Init!==ta.tick0&&(Da=Br(Da,ue),Gr||(Da=$.tickIncrement(Da,Co,!Gr,Sr))),Kr&&dr&&(Da=$.tickIncrement(Da,Co,!Gr,Sr),Ui--);Gr?Da>=ja:Da<=ja;Da=$.tickIncrement(Da,Co,Gr,Sr)){if(Kr&&Ui++,ta.rangebreaks&&!Gr){if(Da<Va)continue;if(ta.maskBreaks(Da)===B&&Br(Da,ta)>=Jr)break}if(Hr.length>_e||Da===ri)break;ri=Da;var Bo={value:Da};Kr?(pi&&Da!==(Da|0)&&(Bo.simpleLabel=!0),gr>1&&Ui%gr&&(Bo.skipLabel=!0),Hr.push(Bo)):(Bo.minor=!0,hn.push(Bo))}}if(!hn||hn.length<2)Dr=!1;else{var ai=(hn[1].value-hn[0].value)*(Er?-1:1);Bn(ai,ue.tickformat)||(Dr=!1)}if(!Dr)En=Hr;else{var yi=Hr.concat(hn);dr&&Hr.length&&(yi=yi.slice(1)),yi=yi.sort(function(Oi,Bi){return Oi.value-Bi.value}).filter(function(Oi,Bi,Ro){return Bi===0||Oi.value!==Ro[Bi-1].value});var Si=yi.map(function(Oi,Bi){return Oi.minor===void 0&&!Oi.skipLabel?Bi:null}).filter(function(Oi){return Oi!==null});Si.forEach(function(Oi){Dr.map(function(Bi){var Ro=Oi+Bi;Ro>=0&&Ro<yi.length&&t.pushUnique(En,yi[Ro])})})}if(dn){var ko=ue.minor.ticks==="inside"&&ue.ticks==="outside"||ue.minor.ticks==="outside"&&ue.ticks==="inside";if(!ko){for(var Ao=Hr.map(function(Oi){return Oi.value}),Do=[],Pi=0;Pi<hn.length;Pi++){var Yi=hn[Pi],vs=Yi.value;if(Ao.indexOf(vs)===-1){for(var es=!1,ls=0;!es&&ls<Hr.length;ls++)1e7+Hr[ls].value===1e7+vs&&(es=!0);es||Do.push(Yi)}}hn=Do}}dr&>(En,ue,ue._definedDelta);var Xi;if(ue.rangebreaks){var ga=ue._id.charAt(0)==="y",Xa=1;ue.tickmode==="auto"&&(Xa=ue.tickfont?ue.tickfont.size:12);var Ls=NaN;for(Xi=Hr.length-1;Xi>-1;Xi--){if(Hr[Xi].drop){Hr.splice(Xi,1);continue}Hr[Xi].value=Br(Hr[Xi].value,ue);var fs=ue.c2p(Hr[Xi].value);(ga?Ls>fs-Xa:Ls<fs+Xa)?Hr.splice(Gr?Xi+1:Xi,1):Ls=fs}}rn(ue)&&Math.abs(Ar[1]-Ar[0])===360&&Hr.pop(),ue._tmax=(Hr[Hr.length-1]||{}).value,ue._prevDateHead="",ue._inCalcTicks=!0;var qi,ms=function(Oi){Oi.text="",ue._prevDateHead=qi};Hr=Hr.concat(hn);function Po(Oi,Bi){var Ro=$.tickText(Oi,Bi.value,!1,Bi.simpleLabel),Fo=Bi.periodX;return Fo!==void 0&&(Ro.periodX=Fo,(Fo>Jr||Fo<Wr)&&(Fo>Jr&&(Ro.periodX=Jr),Fo<Wr&&(Ro.periodX=Wr),ms(Ro))),Ro}var rs;for(Xi=0;Xi<Hr.length;Xi++){var hl=Hr[Xi].minor,za=Hr[Xi].value;hl?(Dr&&En.indexOf(Hr[Xi])!==-1?rs=Po(ue,Hr[Xi]):rs={x:za},rs.minor=!0,yr.push(rs)):(qi=ue._prevDateHead,rs=Po(ue,Hr[Xi]),(Hr[Xi].skipLabel||Dr&&En.indexOf(Hr[Xi])===-1)&&ms(rs),Je.push(rs))}return Je=Je.concat(yr),ue._inCalcTicks=!1,dr&&Je.length&&(Je[0].noTick=!0),Je};function bt(ue,xe){return ue.rangebreaks&&(xe=xe.filter(function(Pr){return ue.maskBreaks(Pr.x)!==B})),xe}function vt(ue){var xe=ue._mainAxis,Pr=[];if(xe._vals){for(var Sr=0;Sr<xe._vals.length;Sr++)if(!xe._vals[Sr].noTick){var gr=xe.l2p(xe._vals[Sr].x),dr=ue.p2l(gr),Er=$.tickText(ue,dr);xe._vals[Sr].minor&&(Er.minor=!0,Er.text=""),Pr.push(Er)}}return Pr=bt(ue,Pr),Pr}function Ut(ue,xe){var Pr=t.simpleMap(ue.range,ue.r2l),Sr=dt(Pr),gr=Math.min(Sr[0],Sr[1]),dr=Math.max(Sr[0],Sr[1]),Er=ue.type==="category"?ue.d2l_noadd:ue.d2l;ue.type==="log"&&String(ue.dtick).charAt(0)!=="L"&&(ue.dtick="L"+Math.pow(10,Math.floor(Math.min(ue.range[0],ue.range[1]))-1));for(var Dr=[],Ar=0;Ar<=1;Ar++)if(!(xe!==void 0&&(xe&&Ar||xe===!1&&!Ar))&&!(Ar&&!ue.minor)){var Gr=Ar?ue.minor.tickvals:ue.tickvals,Wr=Ar?[]:ue.ticktext;if(Gr){t.isArrayOrTypedArray(Wr)||(Wr=[]);for(var Jr=0;Jr<Gr.length;Jr++){var _e=Er(Gr[Jr]);if(_e>gr&&_e<dr){var Je=$.tickText(ue,_e,!1,String(Wr[Jr]));Ar&&(Je.minor=!0,Je.text=""),Dr.push(Je)}}}}return Dr=bt(ue,Dr),Dr}var Kt=[2,5,10],Zt=[1,2,3,6,12],le=[1,2,5,10,15,30],Te=[1,2,3,7,14],Se=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],Fe=[-.301,0,.301,.699,1],Oe=[15,30,45,90,180];function ur(ue,xe,Pr){return xe*t.roundUp(ue/xe,Pr)}$.autoTicks=function(ue,xe,Pr){var Sr;function gr(Jr){return Math.pow(Jr,Math.floor(Math.log(xe)/Math.LN10))}if(ue.type==="date"){ue.tick0=t.dateTick0(ue.calendar,0);var dr=2*xe;if(dr>m)xe/=m,Sr=gr(10),ue.dtick="M"+12*ur(xe,Sr,Kt);else if(dr>S)xe/=S,ue.dtick="M"+ur(xe,1,Zt);else if(dr>w){if(ue.dtick=ur(xe,w,ue._hasDayOfWeekBreaks?[1,2,7,14]:Te),!Pr){var Er=$.getTickFormat(ue),Dr=ue.ticklabelmode==="period";Dr&&(ue._rawTick0=ue.tick0),/%[uVW]/.test(Er)?ue.tick0=t.dateTick0(ue.calendar,2):ue.tick0=t.dateTick0(ue.calendar,1),Dr&&(ue._dowTick0=ue.tick0)}}else dr>f?ue.dtick=ur(xe,f,Zt):dr>k?ue.dtick=ur(xe,k,le):dr>_?ue.dtick=ur(xe,_,le):(Sr=gr(10),ue.dtick=ur(xe,Sr,Kt))}else if(ue.type==="log"){ue.tick0=0;var Ar=t.simpleMap(ue.range,ue.r2l);if(ue._isMinor&&(xe*=1.5),xe>.7)ue.dtick=Math.ceil(xe);else if(Math.abs(Ar[1]-Ar[0])<1){var Gr=1.5*Math.abs((Ar[1]-Ar[0])/xe);xe=Math.abs(Math.pow(10,Ar[1])-Math.pow(10,Ar[0]))/Gr,Sr=gr(10),ue.dtick="L"+ur(xe,Sr,Kt)}else ue.dtick=xe>.3?"D2":"D1"}else ue.type==="category"||ue.type==="multicategory"?(ue.tick0=0,ue.dtick=Math.ceil(Math.max(xe,1))):rn(ue)?(ue.tick0=0,Sr=1,ue.dtick=ur(xe,Sr,Oe)):(ue.tick0=0,Sr=gr(10),ue.dtick=ur(xe,Sr,Kt));if(ue.dtick===0&&(ue.dtick=1),!g(ue.dtick)&&typeof ue.dtick!="string"){var Wr=ue.dtick;throw ue.dtick=1,"ax.dtick error: "+String(Wr)}};function fr(ue){var xe=ue.dtick;if(ue._tickexponent=0,!g(xe)&&typeof xe!="string"&&(xe=1),(ue.type==="category"||ue.type==="multicategory")&&(ue._tickround=null),ue.type==="date"){var Pr=ue.r2l(ue.tick0),Sr=ue.l2r(Pr).replace(/(^-|i)/g,""),gr=Sr.length;if(String(xe).charAt(0)==="M")gr>10||Sr.substr(5)!=="01-01"?ue._tickround="d":ue._tickround=+xe.substr(1)%12===0?"y":"m";else if(xe>=w&&gr<=10||xe>=w*15)ue._tickround="d";else if(xe>=k&&gr<=16||xe>=f)ue._tickround="M";else if(xe>=_&&gr<=19||xe>=k)ue._tickround="S";else{var dr=ue.l2r(Pr+xe).replace(/^-/,"").length;ue._tickround=Math.max(gr,dr)-20,ue._tickround<0&&(ue._tickround=4)}}else if(g(xe)||xe.charAt(0)==="L"){var Er=ue.range.map(ue.r2d||Number);g(xe)||(xe=Number(xe.substr(1))),ue._tickround=2-Math.floor(Math.log(xe)/Math.LN10+.01);var Dr=Math.max(Math.abs(Er[0]),Math.abs(Er[1])),Ar=Math.floor(Math.log(Dr)/Math.LN10+.01),Gr=ue.minexponent===void 0?3:ue.minexponent;Math.abs(Ar)>Gr&&(Mt(ue.exponentformat)&&!Ot(Ar)?ue._tickexponent=3*Math.round((Ar-1)/3):ue._tickexponent=Ar)}else ue._tickround=null}$.tickIncrement=function(ue,xe,Pr,Sr){var gr=Pr?-1:1;if(g(xe))return t.increment(ue,gr*xe);var dr=xe.charAt(0),Er=gr*Number(xe.substr(1));if(dr==="M")return t.incrementMonth(ue,Er,Sr);if(dr==="L")return Math.log(Math.pow(10,ue)+Er)/Math.LN10;if(dr==="D"){var Dr=xe==="D2"?Fe:Se,Ar=ue+gr*.01,Gr=t.roundUp(t.mod(Ar,1),Dr,Pr);return Math.floor(Ar)+Math.log(c.round(Math.pow(10,Gr),1))/Math.LN10}throw"unrecognized dtick "+String(xe)},$.tickFirst=function(ue,xe){var Pr=ue.r2l||Number,Sr=t.simpleMap(ue.range,Pr,void 0,void 0,xe),gr=Sr[1]<Sr[0],dr=gr?Math.floor:Math.ceil,Er=dt(Sr)[0],Dr=ue.dtick,Ar=Pr(ue.tick0);if(g(Dr)){var Gr=dr((Er-Ar)/Dr)*Dr+Ar;return(ue.type==="category"||ue.type==="multicategory")&&(Gr=t.constrain(Gr,0,ue._categories.length-1)),Gr}var Wr=Dr.charAt(0),Jr=Number(Dr.substr(1));if(Wr==="M"){for(var _e=0,Je=Ar,yr,Hr,hn;_e<10;){if(yr=$.tickIncrement(Je,Dr,gr,ue.calendar),(yr-Er)*(Je-Er)<=0)return gr?Math.min(Je,yr):Math.max(Je,yr);Hr=(Er-(Je+yr)/2)/(yr-Je),hn=Wr+(Math.abs(Math.round(Hr))||1)*Jr,Je=$.tickIncrement(Je,hn,Hr<0?!gr:gr,ue.calendar),_e++}return t.error("tickFirst did not converge",ue),Je}else{if(Wr==="L")return Math.log(dr((Math.pow(10,Er)-Ar)/Jr)*Jr+Ar)/Math.LN10;if(Wr==="D"){var En=Dr==="D2"?Fe:Se,dn=t.roundUp(t.mod(Er,1),En,gr);return Math.floor(Er)+Math.log(c.round(Math.pow(10,dn),1))/Math.LN10}else throw"unrecognized dtick "+String(Dr)}},$.tickText=function(ue,xe,Pr,Sr){var gr=We(ue,xe),dr=ue.tickmode==="array",Er=Pr||dr,Dr=ue.type,Ar=Dr==="category"?ue.d2l_noadd:ue.d2l,Gr,Wr=function(hn){var En=ue.l2p(hn);return En>=0&&En<=ue._length?hn:null};if(dr&&t.isArrayOrTypedArray(ue.ticktext)){var Jr=t.simpleMap(ue.range,ue.r2l),_e=(Math.abs(Jr[1]-Jr[0])-(ue._lBreaks||0))/1e4;for(Gr=0;Gr<ue.ticktext.length&&!(Math.abs(xe-Ar(ue.tickvals[Gr]))<_e);Gr++);if(Gr<ue.ticktext.length)return gr.text=String(ue.ticktext[Gr]),gr.xbnd=[Wr(gr.x-.5),Wr(gr.x+ue.dtick-.5)],gr}function Je(hn){if(hn===void 0)return!0;if(Pr)return hn==="none";var En={first:ue._tmin,last:ue._tmax}[hn];return hn!=="all"&&xe!==En}var yr=Pr?"never":ue.exponentformat!=="none"&&Je(ue.showexponent)?"hide":"";if(Dr==="date"?Lr(ue,gr,Pr,Er):Dr==="log"?kr(ue,gr,Pr,Er,yr):Dr==="category"?he(ue,gr):Dr==="multicategory"?Dt(ue,gr,Pr):rn(ue)?zt(ue,gr,Pr,Er,yr):qt(ue,gr,Pr,Er,yr),Sr||(ue.tickprefix&&!Je(ue.showtickprefix)&&(gr.text=ue.tickprefix+gr.text),ue.ticksuffix&&!Je(ue.showticksuffix)&&(gr.text+=ue.ticksuffix)),ue.labelalias&&ue.labelalias.hasOwnProperty(gr.text)){var Hr=ue.labelalias[gr.text];typeof Hr=="string"&&(gr.text=Hr)}return(ue.tickson==="boundaries"||ue.showdividers)&&(gr.xbnd=[Wr(gr.x-.5),Wr(gr.x+ue.dtick-.5)]),gr},$.hoverLabelText=function(ue,xe,Pr){Pr&&(ue=t.extendFlat({},ue,{hoverformat:Pr}));var Sr=t.isArrayOrTypedArray(xe)?xe[0]:xe,gr=t.isArrayOrTypedArray(xe)?xe[1]:void 0;if(gr!==void 0&&gr!==Sr)return $.hoverLabelText(ue,Sr,Pr)+" - "+$.hoverLabelText(ue,gr,Pr);var dr=ue.type==="log"&&Sr<=0,Er=$.tickText(ue,ue.c2l(dr?-Sr:Sr),"hover").text;return dr?Sr===0?"0":O+Er:Er};function We(ue,xe,Pr){var Sr=ue.tickfont||{};return{x:xe,dx:0,dy:0,text:Pr||"",fontSize:Sr.size,font:Sr.family,fontWeight:Sr.weight,fontStyle:Sr.style,fontVariant:Sr.variant,fontTextcase:Sr.textcase,fontLineposition:Sr.lineposition,fontShadow:Sr.shadow,fontColor:Sr.color}}function Lr(ue,xe,Pr,Sr){var gr=ue._tickround,dr=Pr&&ue.hoverformat||$.getTickFormat(ue);Sr=!dr&&Sr,Sr&&(g(gr)?gr=4:gr={y:"m",m:"d",d:"M",M:"S",S:4}[gr]);var Er=t.formatDate(xe.x,dr,gr,ue._dateFormat,ue.calendar,ue._extraFormat),Dr,Ar=Er.indexOf(`
|
||
`);if(Ar!==-1&&(Dr=Er.substr(Ar+1),Er=Er.substr(0,Ar)),Sr&&(Dr!==void 0&&(Er==="00:00:00"||Er==="00:00")?(Er=Dr,Dr=""):Er.length===8&&(Er=Er.replace(/:00$/,""))),Dr)if(Pr)gr==="d"?Er+=", "+Dr:Er=Dr+(Er?", "+Er:"");else if(!ue._inCalcTicks||ue._prevDateHead!==Dr)ue._prevDateHead=Dr,Er+="<br>"+Dr;else{var Gr=_n(ue),Wr=ue._trueSide||ue.side;(!Gr&&Wr==="top"||Gr&&Wr==="bottom")&&(Er+="<br> ")}xe.text=Er}function kr(ue,xe,Pr,Sr,gr){var dr=ue.dtick,Er=xe.x,Dr=ue.tickformat,Ar=typeof dr=="string"&&dr.charAt(0);if(gr==="never"&&(gr=""),Sr&&Ar!=="L"&&(dr="L3",Ar="L"),Dr||Ar==="L")xe.text=$t(Math.pow(10,Er),ue,gr,Sr);else if(g(dr)||Ar==="D"&&t.mod(Er+.01,1)<.1){var Gr=Math.round(Er),Wr=Math.abs(Gr),Jr=ue.exponentformat;Jr==="power"||Mt(Jr)&&Ot(Gr)?(Gr===0?xe.text=1:Gr===1?xe.text="10":xe.text="10<sup>"+(Gr>1?"":O)+Wr+"</sup>",xe.fontSize*=1.25):(Jr==="e"||Jr==="E")&&Wr>2?xe.text="1"+Jr+(Gr>0?"+":O)+Wr:(xe.text=$t(Math.pow(10,Er),ue,"","fakehover"),dr==="D1"&&ue._id.charAt(0)==="y"&&(xe.dy-=xe.fontSize/6))}else if(Ar==="D")xe.text=String(Math.round(Math.pow(10,t.mod(Er,1)))),xe.fontSize*=.75;else throw"unrecognized dtick "+String(dr);if(ue.dtick==="D1"){var _e=String(xe.text).charAt(0);(_e==="0"||_e==="1")&&(ue._id.charAt(0)==="y"?xe.dx-=xe.fontSize/4:(xe.dy+=xe.fontSize/2,xe.dx+=(ue.range[1]>ue.range[0]?1:-1)*xe.fontSize*(Er<0?.5:.25)))}}function he(ue,xe){var Pr=ue._categories[Math.round(xe.x)];Pr===void 0&&(Pr=""),xe.text=String(Pr)}function Dt(ue,xe,Pr){var Sr=Math.round(xe.x),gr=ue._categories[Sr]||[],dr=gr[1]===void 0?"":String(gr[1]),Er=gr[0]===void 0?"":String(gr[0]);Pr?xe.text=Er+" - "+dr:(xe.text=dr,xe.text2=Er)}function qt(ue,xe,Pr,Sr,gr){gr==="never"?gr="":ue.showexponent==="all"&&Math.abs(xe.x/ue.dtick)<1e-6&&(gr="hide"),xe.text=$t(xe.x,ue,gr,Sr)}function zt(ue,xe,Pr,Sr,gr){if(ue.thetaunit==="radians"&&!Pr){var dr=xe.x/180;if(dr===0)xe.text="0";else{var Er=ut(dr);if(Er[1]>=100)xe.text=$t(t.deg2rad(xe.x),ue,gr,Sr);else{var Dr=xe.x<0;Er[1]===1?Er[0]===1?xe.text="π":xe.text=Er[0]+"π":xe.text=["<sup>",Er[0],"</sup>","⁄","<sub>",Er[1],"</sub>","π"].join(""),Dr&&(xe.text=O+xe.text)}}}else xe.text=$t(xe.x,ue,gr,Sr)}function ut(ue){function xe(Dr,Ar){return Math.abs(Dr-Ar)<=1e-6}function Pr(Dr,Ar){return xe(Ar,0)?Dr:Pr(Ar,Dr%Ar)}function Sr(Dr){for(var Ar=1;!xe(Math.round(Dr*Ar)/Ar,Dr);)Ar*=10;return Ar}var gr=Sr(ue),dr=ue*gr,Er=Math.abs(Pr(dr,gr));return[Math.round(dr/Er),Math.round(gr/Er)]}var yt=["f","p","n","μ","m","","k","M","G","T"];function Mt(ue){return ue==="SI"||ue==="B"}function Ot(ue){return ue>14||ue<-15}function $t(ue,xe,Pr,Sr){var gr=ue<0,dr=xe._tickround,Er=Pr||xe.exponentformat||"B",Dr=xe._tickexponent,Ar=$.getTickFormat(xe),Gr=xe.separatethousands;if(Sr){var Wr={exponentformat:Er,minexponent:xe.minexponent,dtick:xe.showexponent==="none"?xe.dtick:g(ue)&&Math.abs(ue)||1,range:xe.showexponent==="none"?xe.range.map(xe.r2d):[0,ue||1]};fr(Wr),dr=(Number(Wr._tickround)||0)+4,Dr=Wr._tickexponent,xe.hoverformat&&(Ar=xe.hoverformat)}if(Ar)return xe._numFormat(Ar)(ue).replace(/-/g,O);var Jr=Math.pow(10,-dr)/2;if(Er==="none"&&(Dr=0),ue=Math.abs(ue),ue<Jr)ue="0",gr=!1;else{if(ue+=Jr,Dr&&(ue*=Math.pow(10,-Dr),dr+=Dr),dr===0)ue=String(Math.floor(ue));else if(dr<0){ue=String(Math.round(ue)),ue=ue.substr(0,ue.length+dr);for(var _e=dr;_e<0;_e++)ue+="0"}else{ue=String(ue);var Je=ue.indexOf(".")+1;Je&&(ue=ue.substr(0,Je+dr).replace(/\.?0+$/,""))}ue=t.numSeparate(ue,xe._separators,Gr)}if(Dr&&Er!=="hide"){Mt(Er)&&Ot(Dr)&&(Er="power");var yr;Dr<0?yr=O+-Dr:Er!=="power"?yr="+"+Dr:yr=String(Dr),Er==="e"||Er==="E"?ue+=Er+yr:Er==="power"?ue+="×10<sup>"+yr+"</sup>":Er==="B"&&Dr===9?ue+="B":Mt(Er)&&(ue+=yt[Dr/3+5])}return gr?O+ue:ue}$.getTickFormat=function(ue){var xe;function Pr(Ar){return typeof Ar!="string"?Ar:Number(Ar.replace("M",""))*S}function Sr(Ar,Gr){var Wr=["L","D"];if(typeof Ar==typeof Gr){if(typeof Ar=="number")return Ar-Gr;var Jr=Wr.indexOf(Ar.charAt(0)),_e=Wr.indexOf(Gr.charAt(0));return Jr===_e?Number(Ar.replace(/(L|D)/g,""))-Number(Gr.replace(/(L|D)/g,"")):Jr-_e}else return typeof Ar=="number"?1:-1}function gr(Ar,Gr,Wr){var Jr=Wr||function(yr){return yr},_e=Gr[0],Je=Gr[1];return(!_e&&typeof _e!="number"||Jr(_e)<=Jr(Ar))&&(!Je&&typeof Je!="number"||Jr(Je)>=Jr(Ar))}function dr(Ar,Gr){var Wr=Gr[0]===null,Jr=Gr[1]===null,_e=Sr(Ar,Gr[0])>=0,Je=Sr(Ar,Gr[1])<=0;return(Wr||_e)&&(Jr||Je)}var Er,Dr;if(ue.tickformatstops&&ue.tickformatstops.length>0)switch(ue.type){case"date":case"linear":{for(xe=0;xe<ue.tickformatstops.length;xe++)if(Dr=ue.tickformatstops[xe],Dr.enabled&&gr(ue.dtick,Dr.dtickrange,Pr)){Er=Dr;break}break}case"log":{for(xe=0;xe<ue.tickformatstops.length;xe++)if(Dr=ue.tickformatstops[xe],Dr.enabled&&dr(ue.dtick,Dr.dtickrange)){Er=Dr;break}break}}return Er?Er.value:ue.tickformat},$.getSubplots=function(ue,xe){var Pr=ue._fullLayout._subplots,Sr=Pr.cartesian.concat(Pr.gl2d||[]),gr=xe?$.findSubplotsWithAxis(Sr,xe):Sr;return gr.sort(function(dr,Er){var Dr=dr.substr(1).split("y"),Ar=Er.substr(1).split("y");return Dr[0]===Ar[0]?+Dr[1]-+Ar[1]:+Dr[0]-+Ar[0]}),gr},$.findSubplotsWithAxis=function(ue,xe){for(var Pr=new RegExp(xe._id.charAt(0)==="x"?"^"+xe._id+"y":xe._id+"$"),Sr=[],gr=0;gr<ue.length;gr++){var dr=ue[gr];Pr.test(dr)&&Sr.push(dr)}return Sr},$.makeClipPaths=function(ue){var xe=ue._fullLayout;if(!xe._hasOnlyLargeSploms){var Pr={_offset:0,_length:xe.width,_id:""},Sr={_offset:0,_length:xe.height,_id:""},gr=$.list(ue,"x",!0),dr=$.list(ue,"y",!0),Er=[],Dr,Ar;for(Dr=0;Dr<gr.length;Dr++)for(Er.push({x:gr[Dr],y:Sr}),Ar=0;Ar<dr.length;Ar++)Dr===0&&Er.push({x:Pr,y:dr[Ar]}),Er.push({x:gr[Dr],y:dr[Ar]});var Gr=xe._clips.selectAll(".axesclip").data(Er,function(Wr){return Wr.x._id+Wr.y._id});Gr.enter().append("clipPath").classed("axesclip",!0).attr("id",function(Wr){return"clip"+xe._uid+Wr.x._id+Wr.y._id}).append("rect"),Gr.exit().remove(),Gr.each(function(Wr){c.select(this).select("rect").attr({x:Wr.x._offset||0,y:Wr.y._offset||0,width:Wr.x._length||1,height:Wr.y._length||1})})}},$.draw=function(ue,xe,Pr){var Sr=ue._fullLayout;xe==="redraw"&&Sr._paper.selectAll("g.subplot").each(function(Ar){var Gr=Ar[0],Wr=Sr._plots[Gr];if(Wr){var Jr=Wr.xaxis,_e=Wr.yaxis;Wr.xaxislayer.selectAll("."+Jr._id+"tick").remove(),Wr.yaxislayer.selectAll("."+_e._id+"tick").remove(),Wr.xaxislayer.selectAll("."+Jr._id+"tick2").remove(),Wr.yaxislayer.selectAll("."+_e._id+"tick2").remove(),Wr.xaxislayer.selectAll("."+Jr._id+"divider").remove(),Wr.yaxislayer.selectAll("."+_e._id+"divider").remove(),Wr.minorGridlayer&&Wr.minorGridlayer.selectAll("path").remove(),Wr.gridlayer&&Wr.gridlayer.selectAll("path").remove(),Wr.zerolinelayer&&Wr.zerolinelayer.selectAll("path").remove(),Sr._infolayer.select(".g-"+Jr._id+"title").remove(),Sr._infolayer.select(".g-"+_e._id+"title").remove()}});var gr=!xe||xe==="redraw"?$.listIds(ue):xe,dr=$.list(ue),Er=dr.filter(function(Ar){return Ar.autoshift}).map(function(Ar){return Ar.overlaying});gr.map(function(Ar){var Gr=$.getFromId(ue,Ar);if(Gr.tickmode==="sync"&&Gr.overlaying){var Wr=gr.findIndex(function(Jr){return Jr===Gr.overlaying});Wr>=0&&gr.unshift(gr.splice(Wr,1).shift())}});var Dr={false:{left:0,right:0}};return t.syncOrAsync(gr.map(function(Ar){return function(){if(Ar){var Gr=$.getFromId(ue,Ar);Pr||(Pr={}),Pr.axShifts=Dr,Pr.overlayingShiftedAx=Er;var Wr=$.drawOne(ue,Gr,Pr);return Gr._shiftPusher&&Fn(Gr,Gr._fullDepth||0,Dr,!0),Gr._r=Gr.range.slice(),Gr._rl=t.simpleMap(Gr._r,Gr.r2l),Wr}}}))},$.drawOne=function(ue,xe,Pr){Pr=Pr||{};var Sr=Pr.axShifts||{},gr=Pr.overlayingShiftedAx||[],dr,Er,Dr;xe.setScale();var Ar=ue._fullLayout,Gr=xe._id,Wr=Gr.charAt(0),Jr=$.counterLetter(Gr),_e=Ar._plots[xe._mainSubplot];if(!_e)return;if(xe._shiftPusher=xe.autoshift||gr.indexOf(xe._id)!==-1||gr.indexOf(xe.overlaying)!==-1,xe._shiftPusher&xe.anchor==="free"){var Je=xe.linewidth/2||0;xe.ticks==="inside"&&(Je+=xe.ticklen),Fn(xe,Je,Sr,!0),Fn(xe,xe.shift||0,Sr,!1)}(Pr.skipTitle!==!0||xe._shift===void 0)&&(xe._shift=on(xe,Sr));var yr=_e[Wr+"axislayer"],Hr=xe._mainLinePosition,hn=Hr+=xe._shift,En=xe._mainMirrorPosition,dn=xe._vals=$.calcTicks(xe),Kr=[xe.mirror,hn,En].join("_");for(dr=0;dr<dn.length;dr++)dn[dr].axInfo=Kr;xe._selections={},xe._tickAngles&&(xe._prevTickAngles=xe._tickAngles),xe._tickAngles={},xe._depth=null;var Tn={};function ta(za){var Oi=Gr+(za||"tick");return Tn[Oi]||(Tn[Oi]=Be(xe,Oi,hn)),Tn[Oi]}if(xe.visible){var Qn=$.makeTransTickFn(xe),Va=$.makeTransTickLabelFn(xe),ja,ci,pi=xe.ticks==="inside",bi=xe.ticks==="outside";if(xe.tickson==="boundaries"){var ri=we(xe,dn);ci=$.clipEnds(xe,ri),ja=pi?ci:ri}else ci=$.clipEnds(xe,dn),ja=pi&&xe.ticklabelmode!=="period"?ci:dn;var Da=xe._gridVals=ci,Ui=Re(xe,dn);if(!Ar._hasOnlyLargeSploms){var lo=xe._subplotsWith,Co={};for(dr=0;dr<lo.length;dr++){Er=lo[dr],Dr=Ar._plots[Er];var Bo=Dr[Jr+"axis"],ai=Bo._mainAxis._id;if(!Co[ai]){Co[ai]=1;var yi=Wr==="x"?"M0,"+Bo._offset+"v"+Bo._length:"M"+Bo._offset+",0h"+Bo._length;$.drawGrid(ue,xe,{vals:Da,counterAxis:Bo,layer:Dr.gridlayer.select("."+Gr),minorLayer:Dr.minorGridlayer.select("."+Gr),path:yi,transFn:Qn}),$.drawZeroLine(ue,xe,{counterAxis:Bo,layer:Dr.zerolinelayer,path:yi,transFn:Qn})}}}var Si,ko=$.getTickSigns(xe),Ao=$.getTickSigns(xe,"minor");if(xe.ticks||xe.minor&&xe.minor.ticks){var Do=$.makeTickPath(xe,hn,ko[2]),Pi=$.makeTickPath(xe,hn,Ao[2],{minor:!0}),Yi,vs,es,ls;if(xe._anchorAxis&&xe.mirror&&xe.mirror!==!0?(Yi=$.makeTickPath(xe,En,ko[3]),vs=$.makeTickPath(xe,En,Ao[3],{minor:!0}),es=Do+Yi,ls=Pi+vs):(Yi="",vs="",es=Do,ls=Pi),xe.showdividers&&bi&&xe.tickson==="boundaries"){var Xi={};for(dr=0;dr<Ui.length;dr++)Xi[Ui[dr].x]=1;Si=function(za){return Xi[za.x]?Yi:es}}else Si=function(za){return za.minor?ls:es}}if($.drawTicks(ue,xe,{vals:ja,layer:yr,path:Si,transFn:Qn}),xe.mirror==="allticks"){var ga=Object.keys(xe._linepositions||{});for(dr=0;dr<ga.length;dr++){Er=ga[dr],Dr=Ar._plots[Er];var Xa=xe._linepositions[Er]||[],Ls=Xa[0],fs=Xa[1],qi=Xa[2],ms=$.makeTickPath(xe,Ls,qi?ko[0]:Ao[0],{minor:qi})+$.makeTickPath(xe,fs,qi?ko[1]:Ao[1],{minor:qi});$.drawTicks(ue,xe,{vals:ja,layer:Dr[Wr+"axislayer"],path:ms,transFn:Qn})}}var Po=[];if(Po.push(function(){return $.drawLabels(ue,xe,{vals:dn,layer:yr,plotinfo:Dr,transFn:Va,labelFns:$.makeLabelFns(xe,hn)})}),xe.type==="multicategory"){var rs={x:2,y:10}[Wr];Po.push(function(){var za={x:"height",y:"width"}[Wr],Oi=ta()[za]+rs+(xe._tickAngles[Gr+"tick"]?xe.tickfont.size*tt:0);return $.drawLabels(ue,xe,{vals:Me(xe,dn),layer:yr,cls:Gr+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:Qn,labelFns:$.makeLabelFns(xe,hn+Oi*ko[4])})}),Po.push(function(){return xe._depth=ko[4]*(ta("tick2")[xe.side]-hn),ln(ue,xe,{vals:Ui,layer:yr,path:$.makeTickPath(xe,hn,ko[4],{len:xe._depth}),transFn:Qn})})}else xe.title.hasOwnProperty("standoff")&&Po.push(function(){xe._depth=ko[4]*(ta()[xe.side]-hn)});var hl=A.getComponentMethod("rangeslider","isVisible")(xe);return!Pr.skipTitle&&!(hl&&xe.side==="bottom")&&Po.push(function(){return vn(ue,xe)}),Po.push(function(){var za=xe.side.charAt(0),Oi=Z[xe.side].charAt(0),Bi=$.getPxPosition(ue,xe),Ro=bi?xe.ticklen:0,Fo,Ci,fl,ql;(xe.automargin||hl||xe._shiftPusher)&&(xe.type==="multicategory"?Fo=ta("tick2"):(Fo=ta(),Wr==="x"&&za==="b"&&(xe._depth=Math.max(Fo.width>0?Fo.bottom-Bi:0,Ro))));var Zs=0,Hl=0;if(xe._shiftPusher&&(Zs=Math.max(Ro,Fo.height>0?za==="l"?Bi-Fo.left:Fo.right-Bi:0),xe.title.text!==Ar._dfltTitle[Wr]&&(Hl=(xe._titleStandoff||0)+(xe._titleScoot||0),za==="l"&&(Hl+=an(xe))),xe._fullDepth=Math.max(Zs,Hl)),xe.automargin){Ci={x:0,y:0,r:0,l:0,t:0,b:0};var Us=[0,1],Es=typeof xe._shift=="number"?xe._shift:0;if(Wr==="x"){if(za==="b"?Ci[za]=xe._depth:(Ci[za]=xe._depth=Math.max(Fo.width>0?Bi-Fo.top:0,Ro),Us.reverse()),Fo.width>0){var El=Fo.right-(xe._offset+xe._length);El>0&&(Ci.xr=1,Ci.r=El);var Wu=xe._offset-Fo.left;Wu>0&&(Ci.xl=0,Ci.l=Wu)}}else if(za==="l"?(xe._depth=Math.max(Fo.height>0?Bi-Fo.left:0,Ro),Ci[za]=xe._depth-Es):(xe._depth=Math.max(Fo.height>0?Fo.right-Bi:0,Ro),Ci[za]=xe._depth+Es,Us.reverse()),Fo.height>0){var Mu=Fo.bottom-(xe._offset+xe._length);Mu>0&&(Ci.yb=0,Ci.b=Mu);var Fu=xe._offset-Fo.top;Fu>0&&(Ci.yt=1,Ci.t=Fu)}Ci[Jr]=xe.anchor==="free"?xe.position:xe._anchorAxis.domain[Us[0]],xe.title.text!==Ar._dfltTitle[Wr]&&(Ci[za]+=an(xe)+(xe.title.standoff||0)),xe.mirror&&xe.anchor!=="free"&&(fl={x:0,y:0,r:0,l:0,t:0,b:0},fl[Oi]=xe.linewidth,xe.mirror&&xe.mirror!==!0&&(fl[Oi]+=Ro),xe.mirror===!0||xe.mirror==="ticks"?fl[Jr]=xe._anchorAxis.domain[Us[1]]:(xe.mirror==="all"||xe.mirror==="allticks")&&(fl[Jr]=[xe._counterDomainMin,xe._counterDomainMax][Us[1]]))}hl&&(ql=A.getComponentMethod("rangeslider","autoMarginOpts")(ue,xe)),typeof xe.automargin=="string"&&(ee(Ci,xe.automargin),ee(fl,xe.automargin)),E.autoMargin(ue,Nn(xe),Ci),E.autoMargin(ue,ke(xe),fl),E.autoMargin(ue,ze(xe),ql)}),t.syncOrAsync(Po)}};function ee(ue,xe){if(ue){var Pr=Object.keys(G).reduce(function(Sr,gr){return xe.indexOf(gr)!==-1&&G[gr].forEach(function(dr){Sr[dr]=1}),Sr},{});Object.keys(ue).forEach(function(Sr){Pr[Sr]||(Sr.length===1?ue[Sr]=0:delete ue[Sr])})}}function we(ue,xe){var Pr=[],Sr,gr=function(dr,Er){var Dr=dr.xbnd[Er];Dr!==null&&Pr.push(t.extendFlat({},dr,{x:Dr}))};if(xe.length){for(Sr=0;Sr<xe.length;Sr++)gr(xe[Sr],0);gr(xe[Sr-1],1)}return Pr}function Me(ue,xe){for(var Pr=[],Sr={},gr=0;gr<xe.length;gr++){var dr=xe[gr];Sr[dr.text2]?Sr[dr.text2].push(dr.x):Sr[dr.text2]=[dr.x]}for(var Er in Sr)Pr.push(We(ue,t.interp(Sr[Er],.5),Er));return Pr}function Re(ue,xe){var Pr=[],Sr,gr,dr=xe.length&&xe[xe.length-1].x<xe[0].x,Er=function(Ar,Gr){var Wr=Ar.xbnd[Gr];Wr!==null&&Pr.push(t.extendFlat({},Ar,{x:Wr}))};if(ue.showdividers&&xe.length){for(Sr=0;Sr<xe.length;Sr++){var Dr=xe[Sr];Dr.text2!==gr&&Er(Dr,dr?1:0),gr=Dr.text2}Er(xe[Sr-1],dr?0:1)}return Pr}function Be(ue,xe,Pr){var Sr,gr,dr,Er;if(ue._selections[xe].size())Sr=1/0,gr=-1/0,dr=1/0,Er=-1/0,ue._selections[xe].each(function(){var Ar=On(this),Gr=o.bBox(Ar.node().parentNode);Sr=Math.min(Sr,Gr.top),gr=Math.max(gr,Gr.bottom),dr=Math.min(dr,Gr.left),Er=Math.max(Er,Gr.right)});else{var Dr=$.makeLabelFns(ue,Pr);Sr=gr=Dr.yFn({dx:0,dy:0,fontSize:0}),dr=Er=Dr.xFn({dx:0,dy:0,fontSize:0})}return{top:Sr,bottom:gr,left:dr,right:Er,height:gr-Sr,width:Er-dr}}$.getTickSigns=function(ue,xe){var Pr=ue._id.charAt(0),Sr={x:"top",y:"right"}[Pr],gr=ue.side===Sr?1:-1,dr=[-1,1,gr,-gr],Er=xe?(ue.minor||{}).ticks:ue.ticks;return Er!=="inside"==(Pr==="x")&&(dr=dr.map(function(Dr){return-Dr})),ue.side&&dr.push({l:-1,t:-1,r:1,b:1}[ue.side.charAt(0)]),dr},$.makeTransTickFn=function(ue){return ue._id.charAt(0)==="x"?function(xe){return e(ue._offset+ue.l2p(xe.x),0)}:function(xe){return e(0,ue._offset+ue.l2p(xe.x))}},$.makeTransTickLabelFn=function(ue){var xe=Ue(ue),Pr=ue.ticklabelshift||0,Sr=ue.ticklabelstandoff||0,gr=xe[0],dr=xe[1],Er=ue.range[0]>ue.range[1],Dr=ue.ticklabelposition&&ue.ticklabelposition.indexOf("inside")!==-1,Ar=!Dr;if(Pr){var Gr=Er?-1:1;Pr=Pr*Gr}if(Sr){var Wr=ue.side,Jr=Dr&&(Wr==="top"||Wr==="left")||Ar&&(Wr==="bottom"||Wr==="right")?1:-1;Sr=Sr*Jr}return ue._id.charAt(0)==="x"?function(_e){return e(gr+ue._offset+ue.l2p(Ze(_e))+Pr,dr+Sr)}:function(_e){return e(dr+Sr,gr+ue._offset+ue.l2p(Ze(_e))+Pr)}};function Ze(ue){return ue.periodX!==void 0?ue.periodX:ue.x}function Ue(ue){var xe=ue.ticklabelposition||"",Pr=function(Je){return xe.indexOf(Je)!==-1},Sr=Pr("top"),gr=Pr("left"),dr=Pr("right"),Er=Pr("bottom"),Dr=Pr("inside"),Ar=Er||gr||Sr||dr;if(!Ar&&!Dr)return[0,0];var Gr=ue.side,Wr=Ar?(ue.tickwidth||0)/2:0,Jr=st,_e=ue.tickfont?ue.tickfont.size:12;return(Er||Sr)&&(Wr+=_e*lt,Jr+=(ue.linewidth||0)/2),(gr||dr)&&(Wr+=(ue.linewidth||0)/2,Jr+=st),Dr&&Gr==="top"&&(Jr-=_e*(1-lt)),(gr||Sr)&&(Wr=-Wr),(Gr==="bottom"||Gr==="right")&&(Jr=-Jr),[Ar?Wr:0,Dr?Jr:0]}$.makeTickPath=function(ue,xe,Pr,Sr){Sr||(Sr={});var gr=Sr.minor;if(gr&&!ue.minor)return"";var dr=Sr.len!==void 0?Sr.len:gr?ue.minor.ticklen:ue.ticklen,Er=ue._id.charAt(0),Dr=(ue.linewidth||1)/2;return Er==="x"?"M0,"+(xe+Dr*Pr)+"v"+dr*Pr:"M"+(xe+Dr*Pr)+",0h"+dr*Pr},$.makeLabelFns=function(ue,xe,Pr){var Sr=ue.ticklabelposition||"",gr=function(ri){return Sr.indexOf(ri)!==-1},dr=gr("top"),Er=gr("left"),Dr=gr("right"),Ar=gr("bottom"),Gr=Ar||Er||dr||Dr,Wr=gr("inside"),Jr=Sr==="inside"&&ue.ticks==="inside"||!Wr&&ue.ticks==="outside"&&ue.tickson!=="boundaries",_e=0,Je=0,yr=Jr?ue.ticklen:0;if(Wr?yr*=-1:Gr&&(yr=0),Jr&&(_e+=yr,Pr)){var Hr=t.deg2rad(Pr);_e=yr*Math.cos(Hr)+1,Je=yr*Math.sin(Hr)}ue.showticklabels&&(Jr||ue.showline)&&(_e+=.2*ue.tickfont.size),_e+=(ue.linewidth||1)/2*(Wr?-1:1);var hn={labelStandoff:_e,labelShift:Je},En,dn,Kr,Tn,ta=0,Qn=ue.side,Va=ue._id.charAt(0),ja=ue.tickangle,ci;if(Va==="x")ci=!Wr&&Qn==="bottom"||Wr&&Qn==="top",Tn=ci?1:-1,Wr&&(Tn*=-1),En=Je*Tn,dn=xe+_e*Tn,Kr=ci?1:-.2,Math.abs(ja)===90&&(Wr?Kr+=ct:ja===-90&&Qn==="bottom"?Kr=lt:ja===90&&Qn==="top"?Kr=ct:Kr=.5,ta=ct/2*(ja/90)),hn.xFn=function(ri){return ri.dx+En+ta*ri.fontSize},hn.yFn=function(ri){return ri.dy+dn+ri.fontSize*Kr},hn.anchorFn=function(ri,Da){if(Gr){if(Er)return"end";if(Dr)return"start"}return!g(Da)||Da===0||Da===180?"middle":Da*Tn<0!==Wr?"end":"start"},hn.heightFn=function(ri,Da,Ui){return Da<-60||Da>60?-.5*Ui:ue.side==="top"!==Wr?-Ui:0};else if(Va==="y"){if(ci=!Wr&&Qn==="left"||Wr&&Qn==="right",Tn=ci?1:-1,Wr&&(Tn*=-1),En=_e,dn=Je*Tn,Kr=0,!Wr&&Math.abs(ja)===90&&(ja===-90&&Qn==="left"||ja===90&&Qn==="right"?Kr=lt:Kr=.5),Wr){var pi=g(ja)?+ja:0;if(pi!==0){var bi=t.deg2rad(pi);ta=Math.abs(Math.sin(bi))*lt*Tn,Kr=0}}hn.xFn=function(ri){return ri.dx+xe-(En+ri.fontSize*Kr)*Tn+ta*ri.fontSize},hn.yFn=function(ri){return ri.dy+dn+ri.fontSize*ct},hn.anchorFn=function(ri,Da){return g(Da)&&Math.abs(Da)===90?"middle":ci?"end":"start"},hn.heightFn=function(ri,Da,Ui){return ue.side==="right"&&(Da*=-1),Da<-30?-Ui:Da<30?-.5*Ui:0}}return hn};function mr(ue){return[ue.text,ue.x,ue.axInfo,ue.font,ue.fontSize,ue.fontColor].join("_")}$.drawTicks=function(ue,xe,Pr){Pr=Pr||{};var Sr=xe._id+"tick",gr=[].concat(xe.minor&&xe.minor.ticks?Pr.vals.filter(function(Er){return Er.minor&&!Er.noTick}):[]).concat(xe.ticks?Pr.vals.filter(function(Er){return!Er.minor&&!Er.noTick}):[]),dr=Pr.layer.selectAll("path."+Sr).data(gr,mr);dr.exit().remove(),dr.enter().append("path").classed(Sr,1).classed("ticks",1).classed("crisp",Pr.crisp!==!1).each(function(Er){return n.stroke(c.select(this),Er.minor?xe.minor.tickcolor:xe.tickcolor)}).style("stroke-width",function(Er){return o.crispRound(ue,Er.minor?xe.minor.tickwidth:xe.tickwidth,1)+"px"}).attr("d",Pr.path).style("display",null),bn(xe,[N]),dr.attr("transform",Pr.transFn)},$.drawGrid=function(ue,xe,Pr){if(Pr=Pr||{},xe.tickmode!=="sync"){var Sr=xe._id+"grid",gr=xe.minor&&xe.minor.showgrid,dr=gr?Pr.vals.filter(function(En){return En.minor}):[],Er=xe.showgrid?Pr.vals.filter(function(En){return!En.minor}):[],Dr=Pr.counterAxis;if(Dr&&$.shouldShowZeroLine(ue,xe,Dr))for(var Ar=xe.tickmode==="array",Gr=0;Gr<Er.length;Gr++){var Wr=Er[Gr].x;if(Ar?!Wr:Math.abs(Wr)<xe.dtick/100)if(Er=Er.slice(0,Gr).concat(Er.slice(Gr+1)),Ar)Gr--;else break}xe._gw=o.crispRound(ue,xe.gridwidth,1);for(var Jr=gr?o.crispRound(ue,xe.minor.gridwidth,1):0,_e=Pr.layer,Je=Pr.minorLayer,yr=1;yr>=0;yr--){var Hr=yr?_e:Je;if(Hr){var hn=Hr.selectAll("path."+Sr).data(yr?Er:dr,mr);hn.exit().remove(),hn.enter().append("path").classed(Sr,1).classed("crisp",Pr.crisp!==!1),hn.attr("transform",Pr.transFn).attr("d",Pr.path).each(function(En){return n.stroke(c.select(this),En.minor?xe.minor.gridcolor:xe.gridcolor||"#ddd")}).style("stroke-dasharray",function(En){return o.dashStyle(En.minor?xe.minor.griddash:xe.griddash,En.minor?xe.minor.gridwidth:xe.gridwidth)}).style("stroke-width",function(En){return(En.minor?Jr:xe._gw)+"px"}).style("display",null),typeof Pr.path=="function"&&hn.attr("d",Pr.path)}}bn(xe,[L,F])}},$.drawZeroLine=function(ue,xe,Pr){Pr=Pr||Pr;var Sr=xe._id+"zl",gr=$.shouldShowZeroLine(ue,xe,Pr.counterAxis),dr=Pr.layer.selectAll("path."+Sr).data(gr?[{x:0,id:xe._id}]:[]);dr.exit().remove(),dr.enter().append("path").classed(Sr,1).classed("zl",1).classed("crisp",Pr.crisp!==!1).each(function(){Pr.layer.selectAll("path").sort(function(Er,Dr){return Y(Er.id,Dr.id)})}),dr.attr("transform",Pr.transFn).attr("d",Pr.path).call(n.stroke,xe.zerolinecolor||n.defaultLine).style("stroke-width",o.crispRound(ue,xe.zerolinewidth,xe._gw||1)+"px").style("display",null),bn(xe,[R])},$.drawLabels=function(ue,xe,Pr){Pr=Pr||{};var Sr=ue._fullLayout,gr=xe._id,dr=Pr.cls||gr+"tick",Er=Pr.vals.filter(function(ai){return ai.text}),Dr=Pr.labelFns,Ar=Pr.secondary?0:xe.tickangle,Gr=(xe._prevTickAngles||{})[dr],Wr=Pr.layer.selectAll("g."+dr).data(xe.showticklabels?Er:[],mr),Jr=[];Wr.enter().append("g").classed(dr,1).append("text").attr("text-anchor","middle").each(function(ai){var yi=c.select(this),Si=ue._promises.length;yi.call(r.positionText,Dr.xFn(ai),Dr.yFn(ai)).call(o.font,{family:ai.font,size:ai.fontSize,color:ai.fontColor,weight:ai.fontWeight,style:ai.fontStyle,variant:ai.fontVariant,textcase:ai.fontTextcase,lineposition:ai.fontLineposition,shadow:ai.fontShadow}).text(ai.text).call(r.convertToTspans,ue),ue._promises[Si]?Jr.push(ue._promises.pop().then(function(){_e(yi,Ar)})):_e(yi,Ar)}),bn(xe,[j]),Wr.exit().remove(),Pr.repositionOnUpdate&&Wr.each(function(ai){c.select(this).select("text").call(r.positionText,Dr.xFn(ai),Dr.yFn(ai))});function _e(ai,yi){ai.each(function(Si){var ko=c.select(this),Ao=ko.select(".text-math-group"),Do=Dr.anchorFn(Si,yi),Pi=Pr.transFn.call(ko.node(),Si)+(g(yi)&&+yi!=0?" rotate("+yi+","+Dr.xFn(Si)+","+(Dr.yFn(Si)-Si.fontSize/2)+")":""),Yi=r.lineCount(ko),vs=tt*Si.fontSize,es=Dr.heightFn(Si,g(yi)?+yi:0,(Yi-1)*vs);if(es&&(Pi+=e(0,es)),Ao.empty()){var ls=ko.select("text");ls.attr({transform:Pi,"text-anchor":Do}),ls.style("opacity",1),xe._adjustTickLabelsOverflow&&xe._adjustTickLabelsOverflow()}else{var Xi=o.bBox(Ao.node()).width,ga=Xi*{end:-.5,start:.5}[Do];Ao.attr("transform",Pi+e(ga,0))}})}xe._adjustTickLabelsOverflow=function(){var ai=xe.ticklabeloverflow;if(!(!ai||ai==="allow")){var yi=ai.indexOf("hide")!==-1,Si=xe._id.charAt(0)==="x",ko=0,Ao=Si?ue._fullLayout.width:ue._fullLayout.height;if(ai.indexOf("domain")!==-1){var Do=t.simpleMap(xe.range,xe.r2l);ko=xe.l2p(Do[0])+xe._offset,Ao=xe.l2p(Do[1])+xe._offset}var Pi=Math.min(ko,Ao),Yi=Math.max(ko,Ao),vs=xe.side,es=1/0,ls=-1/0;Wr.each(function(Ls){var fs=c.select(this),qi=fs.select(".text-math-group");if(qi.empty()){var ms=o.bBox(fs.node()),Po=0;Si?(ms.right>Yi||ms.left<Pi)&&(Po=1):(ms.bottom>Yi||ms.top+(xe.tickangle?0:Ls.fontSize/4)<Pi)&&(Po=1);var rs=fs.select("text");Po?yi&&rs.style("opacity",0):(rs.style("opacity",1),vs==="bottom"||vs==="right"?es=Math.min(es,Si?ms.top:ms.left):es=-1/0,vs==="top"||vs==="left"?ls=Math.max(ls,Si?ms.bottom:ms.right):ls=1/0)}});for(var Xi in Sr._plots){var ga=Sr._plots[Xi];if(!(xe._id!==ga.xaxis._id&&xe._id!==ga.yaxis._id)){var Xa=Si?ga.yaxis:ga.xaxis;Xa&&(Xa["_visibleLabelMin_"+xe._id]=es,Xa["_visibleLabelMax_"+xe._id]=ls)}}}},xe._hideCounterAxisInsideTickLabels=function(ai){var yi=xe._id.charAt(0)==="x",Si=[];for(var ko in Sr._plots){var Ao=Sr._plots[ko];xe._id!==Ao.xaxis._id&&xe._id!==Ao.yaxis._id||Si.push(yi?Ao.yaxis:Ao.xaxis)}Si.forEach(function(Do,Pi){Do&&_n(Do)&&(ai||[R,F,L,N,j]).forEach(function(Yi){var vs=Yi.K==="tick"&&Yi.L==="text"&&xe.ticklabelmode==="period",es=Sr._plots[xe._mainSubplot],ls;Yi.K===R.K?ls=es.zerolinelayer.selectAll("."+xe._id+"zl"):Yi.K===F.K?ls=es.minorGridlayer.selectAll("."+xe._id):Yi.K===L.K?ls=es.gridlayer.selectAll("."+xe._id):ls=es[xe._id.charAt(0)+"axislayer"],ls.each(function(){var Xi=c.select(this);Yi.L&&(Xi=Xi.selectAll(Yi.L)),Xi.each(function(ga){var Xa=xe.l2p(vs?Ze(ga):ga.x)+xe._offset,Ls=c.select(this);Xa<xe["_visibleLabelMax_"+Do._id]&&Xa>xe["_visibleLabelMin_"+Do._id]?Ls.style("display","none"):Yi.K==="tick"&&!Pi&&Ls.style("display",null)})})})})},_e(Wr,Gr+1?Gr:Ar);function Je(){return Jr.length&&Promise.all(Jr)}var yr=null;function Hr(){if(_e(Wr,Ar),Er.length&&xe.autotickangles&&(xe.type!=="log"||String(xe.dtick).charAt(0)!=="D")){yr=xe.autotickangles[0];var ai=0,yi=[],Si,ko=1;Wr.each(function(Fo){ai=Math.max(ai,Fo.fontSize);var Ci=xe.l2p(Fo.x),fl=On(this),ql=o.bBox(fl.node());ko=Math.max(ko,r.lineCount(fl)),yi.push({top:0,bottom:10,height:10,left:Ci-ql.width/2,right:Ci+ql.width/2+2,width:ql.width+2})});var Ao=(xe.tickson==="boundaries"||xe.showdividers)&&!Pr.secondary,Do=Er.length,Pi=Math.abs((Er[Do-1].x-Er[0].x)*xe._m)/(Do-1),Yi=Ao?Pi/2:Pi,vs=Ao?xe.ticklen:ai*1.25*ko,es=Math.sqrt(Math.pow(Yi,2)+Math.pow(vs,2)),ls=Yi/es,Xi=xe.autotickangles.map(function(Fo){return Fo*Math.PI/180}),ga=Xi.find(function(Fo){return Math.abs(Math.cos(Fo))<=ls});ga===void 0&&(ga=Xi.reduce(function(Fo,Ci){return Math.abs(Math.cos(Fo))<Math.abs(Math.cos(Ci))?Fo:Ci},Xi[0]));var Xa=ga*(180/Math.PI);if(Ao){var Ls=2;for(xe.ticks&&(Ls+=xe.tickwidth/2),Si=0;Si<yi.length;Si++){var fs=Er[Si].xbnd,qi=yi[Si];if(fs[0]!==null&&qi.left-xe.l2p(fs[0])<Ls||fs[1]!==null&&xe.l2p(fs[1])-qi.right<Ls){yr=Xa;break}}}else{var ms=xe.ticklabelposition||"",Po=function(Fo){return ms.indexOf(Fo)!==-1},rs=Po("top"),hl=Po("left"),za=Po("right"),Oi=Po("bottom"),Bi=Oi||hl||rs||za,Ro=Bi?(xe.tickwidth||0)+2*st:0;for(Si=0;Si<yi.length-1;Si++)if(t.bBoxIntersect(yi[Si],yi[Si+1],Ro)){yr=Xa;break}}yr&&_e(Wr,yr)}}xe._selections&&(xe._selections[dr]=Wr);var hn=[Je];xe.automargin&&Sr._redrawFromAutoMarginCount&&Gr===90?(yr=Gr,hn.push(function(){_e(Wr,Gr)})):hn.push(Hr),xe._tickAngles&&hn.push(function(){xe._tickAngles[dr]=yr===null?g(Ar)?Ar:0:yr});var En=function(){var ai=0,yi=0;return Wr.each(function(Si,ko){var Ao=On(this),Do=Ao.select(".text-math-group");if(Do.empty()){var Pi;xe._vals[ko]&&(Pi=xe._vals[ko].bb||o.bBox(Ao.node()),xe._vals[ko].bb=Pi),ai=Math.max(ai,Pi.width),yi=Math.max(yi,Pi.height)}}),{labelsMaxW:ai,labelsMaxH:yi}},dn=xe._anchorAxis;if(dn&&(dn.autorange||dn.insiderange)&&_n(xe)&&!q(Sr,xe._id)&&(Sr._insideTickLabelsUpdaterange||(Sr._insideTickLabelsUpdaterange={}),dn.autorange&&(Sr._insideTickLabelsUpdaterange[dn._name+".autorange"]=dn.autorange,hn.push(En)),dn.insiderange)){var Kr=En(),Tn=xe._id.charAt(0)==="y"?Kr.labelsMaxW:Kr.labelsMaxH;Tn+=2*st,xe.ticklabelposition==="inside"&&(Tn+=xe.ticklen||0);var ta=xe.side==="right"||xe.side==="top"?1:-1,Qn=ta===1?1:0,Va=ta===1?0:1,ja=[];ja[Va]=dn.range[Va];var ci=dn.range,pi=dn.r2p(ci[Qn]),bi=dn.r2p(ci[Va]),ri=Sr._insideTickLabelsUpdaterange[dn._name+".range"];if(ri){var Da=dn.r2p(ri[Qn]),Ui=dn.r2p(ri[Va]),lo=ta*(xe._id.charAt(0)==="y"?1:-1);lo*pi<lo*Da&&(pi=Da,ja[Qn]=ci[Qn]=ri[Qn]),lo*bi>lo*Ui&&(bi=Ui,ja[Va]=ci[Va]=ri[Va])}var Co=Math.abs(bi-pi);Co-Tn>0?(Co-=Tn,Tn*=1+Tn/Co):Tn=0,xe._id.charAt(0)!=="y"&&(Tn=-Tn),ja[Qn]=dn.p2r(dn.r2p(ci[Qn])+ta*Tn),dn.autorange==="min"||dn.autorange==="max reversed"?(ja[0]=null,dn._rangeInitial0=void 0,dn._rangeInitial1=void 0):(dn.autorange==="max"||dn.autorange==="min reversed")&&(ja[1]=null,dn._rangeInitial0=void 0,dn._rangeInitial1=void 0),Sr._insideTickLabelsUpdaterange[dn._name+".range"]=ja}var Bo=t.syncOrAsync(hn);return Bo&&Bo.then&&ue._promises.push(Bo),Bo};function ln(ue,xe,Pr){var Sr=xe._id+"divider",gr=Pr.vals,dr=Pr.layer.selectAll("path."+Sr).data(gr,mr);dr.exit().remove(),dr.enter().insert("path",":first-child").classed(Sr,1).classed("crisp",1).call(n.stroke,xe.dividercolor).style("stroke-width",o.crispRound(ue,xe.dividerwidth,1)+"px"),dr.attr("transform",Pr.transFn).attr("d",Pr.path)}$.getPxPosition=function(ue,xe){var Pr=ue._fullLayout._size,Sr=xe._id.charAt(0),gr=xe.side,dr;if(xe.anchor!=="free"?dr=xe._anchorAxis:Sr==="x"?dr={_offset:Pr.t+(1-(xe.position||0))*Pr.h,_length:0}:Sr==="y"&&(dr={_offset:Pr.l+(xe.position||0)*Pr.w+xe._shift,_length:0}),gr==="top"||gr==="left")return dr._offset;if(gr==="bottom"||gr==="right")return dr._offset+dr._length};function an(ue){var xe=ue.title.font.size,Pr=(ue.title.text.match(r.BR_TAG_ALL)||[]).length;return ue.title.hasOwnProperty("standoff")?xe*(lt+Pr*tt):Pr?xe*(Pr+1)*tt:xe}function vn(ue,xe){var Pr=ue._fullLayout,Sr=xe._id,gr=Sr.charAt(0),dr=xe.title.font.size,Er,Dr=(xe.title.text.match(r.BR_TAG_ALL)||[]).length;if(xe.title.hasOwnProperty("standoff"))xe.side==="bottom"||xe.side==="right"?Er=xe._depth+xe.title.standoff+dr*lt:(xe.side==="top"||xe.side==="left")&&(Er=xe._depth+xe.title.standoff+dr*(ct+Dr*tt));else{var Ar=_n(xe);if(xe.type==="multicategory")Er=xe._depth;else{var Gr=1.5*dr;Ar&&(Gr=.5*dr,xe.ticks==="outside"&&(Gr+=xe.ticklen)),Er=10+Gr+(xe.linewidth?xe.linewidth-1:0)}Ar||(gr==="x"?Er+=xe.side==="top"?dr*(xe.showticklabels?1:0):dr*(xe.showticklabels?1.5:.5):Er+=xe.side==="right"?dr*(xe.showticklabels?1:.5):dr*(xe.showticklabels?.5:0))}var Wr=$.getPxPosition(ue,xe),Jr,_e,Je;gr==="x"?(_e=xe._offset+xe._length/2,Je=xe.side==="top"?Wr-Er:Wr+Er):(Je=xe._offset+xe._length/2,_e=xe.side==="right"?Wr+Er:Wr-Er,Jr={rotate:"-90",offset:0});var yr;if(xe.type!=="multicategory"){var Hr=xe._selections[xe._id+"tick"];if(yr={selection:Hr,side:xe.side},Hr&&Hr.node()&&Hr.node().parentNode){var hn=o.getTranslate(Hr.node().parentNode);yr.offsetLeft=hn.x,yr.offsetTop=hn.y}xe.title.hasOwnProperty("standoff")&&(yr.pad=0)}return xe._titleStandoff=Er,i.draw(ue,Sr+"title",{propContainer:xe,propName:xe._name+".title.text",placeholder:Pr._dfltTitle[gr],avoid:yr,transform:Jr,attributes:{x:_e,y:Je,"text-anchor":"middle"}})}$.shouldShowZeroLine=function(ue,xe,Pr){var Sr=t.simpleMap(xe.range,xe.r2l);return Sr[0]*Sr[1]<=0&&xe.zeroline&&(xe.type==="linear"||xe.type==="-")&&!(xe.rangebreaks&&xe.maskBreaks(0)===B)&&(Sn(xe,0)||!An(ue,xe,Pr,Sr)||pn(ue,xe))},$.clipEnds=function(ue,xe){return xe.filter(function(Pr){return Sn(ue,Pr.x)})};function Sn(ue,xe){var Pr=ue.l2p(xe);return Pr>1&&Pr<ue._length-1}function An(ue,xe,Pr,Sr){var gr=Pr._mainAxis;if(!gr)return;var dr=ue._fullLayout,Er=xe._id.charAt(0),Dr=$.counterLetter(xe._id),Ar=xe._offset+(Math.abs(Sr[0])<Math.abs(Sr[1])==(Er==="x")?0:xe._length);function Gr(yr){if(!yr.showline||!yr.linewidth)return!1;var Hr=Math.max((yr.linewidth+xe.zerolinewidth)/2,1);function hn(Kr){return typeof Kr=="number"&&Math.abs(Kr-Ar)<Hr}if(hn(yr._mainLinePosition)||hn(yr._mainMirrorPosition))return!0;var En=yr._linepositions||{};for(var dn in En)if(hn(En[dn][0])||hn(En[dn][1]))return!0}var Wr=dr._plots[Pr._mainSubplot];if(!(Wr.mainplotinfo||Wr).overlays.length)return Gr(Pr);for(var Jr=$.list(ue,Dr),_e=0;_e<Jr.length;_e++){var Je=Jr[_e];if(Je._mainAxis===gr&&Gr(Je))return!0}}function pn(ue,xe){for(var Pr=ue._fullData,Sr=xe._mainSubplot,gr=xe._id.charAt(0),dr=0;dr<Pr.length;dr++){var Er=Pr[dr];if(Er.visible===!0&&Er.xaxis+Er.yaxis===Sr&&(A.traceIs(Er,"bar-like")&&Er.orientation==={x:"h",y:"v"}[gr]||Er.fill&&Er.fill.charAt(Er.fill.length-1)===gr))return!0}return!1}function On(ue){var xe=c.select(ue),Pr=xe.select(".text-math-group");return Pr.empty()?xe.select("text"):Pr}$.allowAutoMargin=function(ue){for(var xe=$.list(ue,"",!0),Pr=0;Pr<xe.length;Pr++){var Sr=xe[Pr];Sr.automargin&&(E.allowAutoMargin(ue,Nn(Sr)),Sr.mirror&&E.allowAutoMargin(ue,ke(Sr))),A.getComponentMethod("rangeslider","isVisible")(Sr)&&E.allowAutoMargin(ue,ze(Sr))}};function Nn(ue){return ue._id+".automargin"}function ke(ue){return Nn(ue)+".mirror"}function ze(ue){return ue._id+".rangeslider"}$.swap=function(ue,xe){for(var Pr=je(ue,xe),Sr=0;Sr<Pr.length;Sr++)_r(ue,Pr[Sr].x,Pr[Sr].y)};function je(ue,xe){var Pr=[],Sr,gr;for(Sr=0;Sr<xe.length;Sr++){var dr=[],Er=ue._fullData[xe[Sr]].xaxis,Dr=ue._fullData[xe[Sr]].yaxis;if(!(!Er||!Dr)){for(gr=0;gr<Pr.length;gr++)(Pr[gr].x.indexOf(Er)!==-1||Pr[gr].y.indexOf(Dr)!==-1)&&dr.push(gr);if(!dr.length){Pr.push({x:[Er],y:[Dr]});continue}var Ar=Pr[dr[0]],Gr;if(dr.length>1)for(gr=1;gr<dr.length;gr++)Gr=Pr[dr[gr]],Ne(Ar.x,Gr.x),Ne(Ar.y,Gr.y);Ne(Ar.x,[Er]),Ne(Ar.y,[Dr])}}return Pr}function Ne(ue,xe){for(var Pr=0;Pr<xe.length;Pr++)ue.indexOf(xe[Pr])===-1&&ue.push(xe[Pr])}function _r(ue,xe,Pr){var Sr=[],gr=[],dr=ue.layout,Er,Dr;for(Er=0;Er<xe.length;Er++)Sr.push($.getFromId(ue,xe[Er]));for(Er=0;Er<Pr.length;Er++)gr.push($.getFromId(ue,Pr[Er]));var Ar=Object.keys(a),Gr=["anchor","domain","overlaying","position","side","tickangle","editType"],Wr=["linear","log"];for(Er=0;Er<Ar.length;Er++){var Jr=Ar[Er],_e=Sr[0][Jr],Je=gr[0][Jr],yr=!0,Hr=!1,hn=!1;if(!(Jr.charAt(0)==="_"||typeof _e=="function"||Gr.indexOf(Jr)!==-1)){for(Dr=1;Dr<Sr.length&&yr;Dr++){var En=Sr[Dr][Jr];Jr==="type"&&Wr.indexOf(_e)!==-1&&Wr.indexOf(En)!==-1&&_e!==En?Hr=!0:En!==_e&&(yr=!1)}for(Dr=1;Dr<gr.length&&yr;Dr++){var dn=gr[Dr][Jr];Jr==="type"&&Wr.indexOf(Je)!==-1&&Wr.indexOf(dn)!==-1&&Je!==dn?hn=!0:gr[Dr][Jr]!==Je&&(yr=!1)}yr&&(Hr&&(dr[Sr[0]._name].type="linear"),hn&&(dr[gr[0]._name].type="linear"),Xr(dr,Jr,Sr,gr,ue._fullLayout._dfltTitle))}}for(Er=0;Er<ue._fullLayout.annotations.length;Er++){var Kr=ue._fullLayout.annotations[Er];xe.indexOf(Kr.xref)!==-1&&Pr.indexOf(Kr.yref)!==-1&&t.swapAttrs(dr.annotations[Er],["?"])}}function Xr(ue,xe,Pr,Sr,gr){var dr=t.nestedProperty,Er=dr(ue[Pr[0]._name],xe).get(),Dr=dr(ue[Sr[0]._name],xe).get(),Ar;for(xe==="title"&&(Er&&Er.text===gr.x&&(Er.text=gr.y),Dr&&Dr.text===gr.y&&(Dr.text=gr.x)),Ar=0;Ar<Pr.length;Ar++)dr(ue,Pr[Ar]._name+"."+xe).set(Dr);for(Ar=0;Ar<Sr.length;Ar++)dr(ue,Sr[Ar]._name+"."+xe).set(Er)}function rn(ue){return ue._id==="angularaxis"}function Br(ue,xe){for(var Pr=xe._rangebreaks.length,Sr=0;Sr<Pr;Sr++){var gr=xe._rangebreaks[Sr];if(ue>=gr.min&&ue<gr.max)return gr.max}return ue}function _n(ue){return(ue.ticklabelposition||"").indexOf("inside")!==-1}function bn(ue,xe){_n(ue._anchorAxis||{})&&ue._hideCounterAxisInsideTickLabels&&ue._hideCounterAxisInsideTickLabels(xe)}function Fn(ue,xe,Pr,Sr){var gr=ue.anchor!=="free"&&(ue.overlaying===void 0||ue.overlaying===!1)?ue._id:ue.overlaying,dr;Sr?dr=ue.side==="right"?xe:-xe:dr=xe,gr in Pr||(Pr[gr]={}),ue.side in Pr[gr]||(Pr[gr][ue.side]=0),Pr[gr][ue.side]+=dr}function on(ue,xe){return ue.autoshift?xe[ue.overlaying][ue.side]:ue.shift||0}function Bn(ue,xe){return/%f/.test(xe)?ue>=I:/%L/.test(xe)?ue>=D:/%[SX]/.test(xe)?ue>=_:/%M/.test(xe)?ue>=k:/%[HI]/.test(xe)?ue>=f:/%p/.test(xe)?ue>=u:/%[Aadejuwx]/.test(xe)?ue>=w:/%[UVW]/.test(xe)?ue>=M:/%[Bbm]/.test(xe)?ue>=T:/%[q]/.test(xe)?ue>=x:/%[Yy]/.test(xe)?ue>=p:!0}}),ob=Vt((X,V)=>{V.exports=function(c,g,E){var A,t;if(E){var e=g==="reversed"||g==="min reversed"||g==="max reversed";A=E[e?1:0],t=E[e?0:1]}var r=c("autorangeoptions.minallowed",t===null?A:void 0),i=c("autorangeoptions.maxallowed",A===null?t:void 0);r===void 0&&c("autorangeoptions.clipmin"),i===void 0&&c("autorangeoptions.clipmax"),c("autorangeoptions.include")}}),sb=Vt((X,V)=>{var c=ob();V.exports=function(g,E,A,t){var e=E._template||{},r=E.type||e.type||"-";A("minallowed"),A("maxallowed");var i=A("range");if(!i){var n;!t.noInsiderange&&r!=="log"&&(n=A("insiderange"),n&&(n[0]===null||n[1]===null)&&(E.insiderange=!1,n=void 0),n&&(i=A("range",n)))}var o=E.getAutorangeDflt(i,t),a=A("autorange",o),s;i&&(i[0]===null&&i[1]===null||(i[0]===null||i[1]===null)&&(a==="reversed"||a===!0)||i[0]!==null&&(a==="min"||a==="max reversed")||i[1]!==null&&(a==="max"||a==="min reversed"))&&(i=void 0,delete E.range,E.autorange=!0,s=!0),s||(o=E.getAutorangeDflt(i,t),a=A("autorange",o)),a&&(c(A,a,i),(r==="linear"||r==="-")&&A("rangemode")),E.cleanRange()}}),Dk=Vt((X,V)=>{var c={left:0,top:0};V.exports=g;function g(A,t,e){t=t||A.currentTarget||A.srcElement,Array.isArray(e)||(e=[0,0]);var r=A.clientX||0,i=A.clientY||0,n=E(t);return e[0]=r-n.left,e[1]=i-n.top,e}function E(A){return A===window||A===document||A===document.body?c:A.getBoundingClientRect()}}),Ny=Vt((X,V)=>{var c=Y_();function g(){var E=!1;try{var A=Object.defineProperty({},"passive",{get:function(){E=!0}});window.addEventListener("test",null,A),window.removeEventListener("test",null,A)}catch{E=!1}return E}V.exports=c&&g()}),zk=Vt((X,V)=>{V.exports=function(c,g,E,A,t){var e=(c-E)/(A-E),r=e+g/(A-E),i=(e+r)/2;return t==="left"||t==="bottom"?e:t==="center"||t==="middle"?i:t==="right"||t==="top"?r:e<2/3-i?e:r>4/3-i?r:i}}),Ok=Vt((X,V)=>{var c=qr(),g=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];V.exports=function(E,A,t,e){return t==="left"?E=0:t==="center"?E=1:t==="right"?E=2:E=c.constrain(Math.floor(E*3),0,2),e==="bottom"?A=0:e==="middle"?A=1:e==="top"?A=2:A=c.constrain(Math.floor(A*3),0,2),g[A][E]}}),Fk=Vt((X,V)=>{var c=vg(),g=By(),E=Cm().getGraphDiv,A=Lm(),t=V.exports={};t.wrapped=function(e,r,i){e=E(e),e._fullLayout&&g.clear(e._fullLayout._uid+A.HOVERID),t.raw(e,r,i)},t.raw=function(e,r){var i=e._fullLayout,n=e._hoverdata;r||(r={}),!(r.target&&!e._dragged&&c.triggerHandler(e,"plotly_beforehover",r)===!1)&&(i._hoverlayer.selectAll("g").remove(),i._hoverlayer.selectAll("line").remove(),i._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,r.target&&n&&e.emit("plotly_unhover",{event:r,points:n}))}}),af=Vt((X,V)=>{var c=Dk(),g=K_(),E=Ny(),A=qr().removeElement,t=xh(),e=V.exports={};e.align=zk(),e.getCursor=Ok();var r=Fk();e.unhover=r.wrapped,e.unhoverRaw=r.raw,e.init=function(o){var a=o.gd,s=1,h=a._context.doubleClickDelay,v=o.element,m,p,y,l,x,b,S,T;a._mouseDownTime||(a._mouseDownTime=0),v.style.pointerEvents="all",v.onmousedown=u,E?(v._ontouchstart&&v.removeEventListener("touchstart",v._ontouchstart),v._ontouchstart=u,v.addEventListener("touchstart",u,{passive:!1})):v.ontouchstart=u;function M(_,D,I){return Math.abs(_)<I&&(_=0),Math.abs(D)<I&&(D=0),[_,D]}var w=o.clampFn||M;function u(_){a._dragged=!1,a._dragging=!0;var D=n(_);m=D[0],p=D[1],S=_.target,b=_,T=_.buttons===2||_.ctrlKey,typeof _.clientX>"u"&&typeof _.clientY>"u"&&(_.clientX=m,_.clientY=p),y=new Date().getTime(),y-a._mouseDownTime<h?s+=1:(s=1,a._mouseDownTime=y),o.prepFn&&o.prepFn(_,m,p),g&&!T?(x=i(),x.style.cursor=window.getComputedStyle(v).cursor):g||(x=document,l=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(v).cursor),document.addEventListener("mouseup",k),document.addEventListener("touchend",k),o.dragmode!==!1&&(_.preventDefault(),document.addEventListener("mousemove",f),document.addEventListener("touchmove",f,{passive:!1}))}function f(_){_.preventDefault();var D=n(_),I=o.minDrag||t.MINDRAG,O=w(D[0]-m,D[1]-p,I),B=O[0],R=O[1];(B||R)&&(a._dragged=!0,e.unhover(a,_)),a._dragged&&o.moveFn&&!T&&(a._dragdata={element:v,dx:B,dy:R},o.moveFn(B,R))}function k(_){if(delete a._dragdata,o.dragmode!==!1&&(_.preventDefault(),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",f)),document.removeEventListener("mouseup",k),document.removeEventListener("touchend",k),g?A(x):l&&(x.documentElement.style.cursor=l,l=null),!a._dragging){a._dragged=!1;return}if(a._dragging=!1,new Date().getTime()-a._mouseDownTime>h&&(s=Math.max(s-1,1)),a._dragged)o.doneFn&&o.doneFn();else if(o.clickFn&&o.clickFn(s,b),!T){var D;try{D=new MouseEvent("click",_)}catch{var I=n(_);D=document.createEvent("MouseEvents"),D.initMouseEvent("click",_.bubbles,_.cancelable,_.view,_.detail,_.screenX,_.screenY,I[0],I[1],_.ctrlKey,_.altKey,_.shiftKey,_.metaKey,_.button,_.relatedTarget)}S.dispatchEvent(D)}a._dragging=!1,a._dragged=!1}};function i(){var o=document.createElement("div");o.className="dragcover";var a=o.style;return a.position="fixed",a.left=0,a.right=0,a.top=0,a.bottom=0,a.zIndex=999999999,a.background="none",document.body.appendChild(o),o}e.coverSlip=i;function n(o){return c(o.changedTouches?o.changedTouches[0]:o,document.body)}}),tp=Vt((X,V)=>{V.exports=function(c,g){(c.attr("class")||"").split(" ").forEach(function(E){E.indexOf("cursor-")===0&&c.classed(E,!1)}),g&&c.classed("cursor-"+g,!0)}}),Bk=Vt((X,V)=>{var c=tp(),g="data-savedcursor",E="!!";V.exports=function(A,t){var e=A.attr(g);if(t){if(!e){for(var r=(A.attr("class")||"").split(" "),i=0;i<r.length;i++){var n=r[i];n.indexOf("cursor-")===0&&A.attr(g,n.substr(7)).classed(n,!1)}A.attr(g)||A.attr(g,E)}c(A,t)}else e&&(A.attr(g,null),e===E?c(A):c(A,e))}}),lb=Vt((X,V)=>{var c=Nl(),g=Hc();V.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:g.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:c({editType:"legend"}),grouptitlefont:c({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},entrywidth:{valType:"number",min:0,editType:"legend"},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend"},indentation:{valType:"number",min:-15,dflt:0,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},x:{valType:"number",editType:"legend"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",editType:"legend"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:c({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}),Uy=Vt(X=>{X.isGrouped=function(V){return(V.traceorder||"").indexOf("grouped")!==-1},X.isVertical=function(V){return V.orientation!=="h"},X.isReversed=function(V){return(V.traceorder||"").indexOf("reversed")!==-1}}),ub=Vt((X,V)=>{var c=Mi(),g=qr(),E=Ns(),A=Ks(),t=lb(),e=mg(),r=Uy();function i(n,o,a,s){var h=o[n]||{},v=E.newContainer(a,n);function m(tt,Z){return g.coerce(h,v,t,tt,Z)}var p=g.coerceFont(m,"font",a.font);m("bgcolor",a.paper_bgcolor),m("bordercolor");var y=m("visible");if(y){for(var l,x=function(tt,Z){var st=l._input,$=l;return g.coerce(st,$,A,tt,Z)},b=a.font||{},S=g.coerceFont(m,"grouptitlefont",b,{overrideDflt:{size:Math.round(b.size*1.1)}}),T=0,M=!1,w="normal",u=(a.shapes||[]).filter(function(tt){return tt.showlegend}),f=s.concat(u).filter(function(tt){return n===(tt.legend||"legend")}),k=0;k<f.length;k++)if(l=f[k],!!l.visible){var _=l._isShape;(l.showlegend||l._dfltShowLegend&&!(l._module&&l._module.attributes&&l._module.attributes.showlegend&&l._module.attributes.showlegend.dflt===!1))&&(T++,l.showlegend&&(M=!0,(!_&&c.traceIs(l,"pie-like")||l._input.showlegend===!0)&&T++),g.coerceFont(x,"legendgrouptitle.font",S)),(!_&&c.traceIs(l,"bar")&&a.barmode==="stack"||["tonextx","tonexty"].indexOf(l.fill)!==-1)&&(w=r.isGrouped({traceorder:w})?"grouped+reversed":"reversed"),l.legendgroup!==void 0&&l.legendgroup!==""&&(w=r.isReversed({traceorder:w})?"reversed+grouped":"grouped")}var D=g.coerce(o,a,e,"showlegend",M&&T>(n==="legend"?1:0));if(D===!1&&(a[n]=void 0),!(D===!1&&!h.uirevision)&&(m("uirevision",a.uirevision),D!==!1)){m("borderwidth");var I=m("orientation"),O=m("yref"),B=m("xref"),R=I==="h",L=O==="paper",F=B==="paper",N,j,G,rt="left";R?(N=0,c.getComponentMethod("rangeslider","isVisible")(o.xaxis)?L?(j=1.1,G="bottom"):(j=1,G="top"):L?(j=-.1,G="top"):(j=0,G="bottom")):(j=1,G="auto",F?N=1.02:(N=1,rt="right")),g.coerce(h,v,{x:{valType:"number",editType:"legend",min:F?-2:0,max:F?3:1,dflt:N}},"x"),g.coerce(h,v,{y:{valType:"number",editType:"legend",min:L?-2:0,max:L?3:1,dflt:j}},"y"),m("traceorder",w),r.isGrouped(a[n])&&m("tracegroupgap"),m("entrywidth"),m("entrywidthmode"),m("indentation"),m("itemsizing"),m("itemwidth"),m("itemclick"),m("itemdoubleclick"),m("groupclick"),m("xanchor",rt),m("yanchor",G),m("valign"),g.noneOrAll(h,v,["x","y"]);var ct=m("title.text");if(ct){m("title.side",R?"left":"top");var lt=g.extendFlat({},p,{size:g.bigFont(p.size)});g.coerceFont(m,"title.font",lt)}}}}V.exports=function(n,o,a){var s,h=a.slice(),v=o.shapes;if(v)for(s=0;s<v.length;s++){var m=v[s];if(m.showlegend){var p={_input:m._input,visible:m.visible,showlegend:m.showlegend,legend:m.legend};h.push(p)}}var y=["legend"];for(s=0;s<h.length;s++)g.pushUnique(y,h[s].legend);for(o._legends=[],s=0;s<y.length;s++){var l=y[s];i(l,n,o,h),o[l]&&o[l].visible&&(o[l]._id=l),o._legends.push(l)}}}),Rk=Vt((X,V)=>{var c=Mi(),g=qr(),E=g.pushUnique,A=!0;V.exports=function(t,e,r){var i=e._fullLayout;if(e._dragged||e._editing)return;var n=i.legend.itemclick,o=i.legend.itemdoubleclick,a=i.legend.groupclick;r===1&&n==="toggle"&&o==="toggleothers"&&A&&e.data&&e._context.showTips&&g.notifier(g._(e,"Double-click on legend to isolate one trace"),"long"),A=!1;var s;if(r===1?s=n:r===2&&(s=o),!s)return;var h=a==="togglegroup",v=i.hiddenlabels?i.hiddenlabels.slice():[],m=t.data()[0][0];if(m.groupTitle&&m.noClick)return;var p=e._fullData,y=(i.shapes||[]).filter(function(Wt){return Wt.showlegend}),l=p.concat(y),x=m.trace;x._isShape&&(x=x._fullInput);var b=x.legendgroup,S,T,M,w,u,f,k={},_=[],D=[],I=[];function O(Wt,gt){var bt=_.indexOf(Wt),vt=k.visible;return vt||(vt=k.visible=[]),_.indexOf(Wt)===-1&&(_.push(Wt),bt=_.length-1),vt[bt]=gt,bt}var B=(i.shapes||[]).map(function(Wt){return Wt._input}),R=!1;function L(Wt,gt){B[Wt].visible=gt,R=!0}function F(Wt,gt){if(!(m.groupTitle&&!h)){var bt=Wt._fullInput||Wt,vt=bt._isShape,Ut=bt.index;Ut===void 0&&(Ut=bt._index);var Kt=bt.visible===!1?!1:gt;vt?L(Ut,Kt):O(Ut,Kt)}}var N=x.legend,j=x._fullInput,G=j&&j._isShape;if(!G&&c.traceIs(x,"pie-like")){var rt=m.label,ct=v.indexOf(rt);if(s==="toggle")ct===-1?v.push(rt):v.splice(ct,1);else if(s==="toggleothers"){var lt=ct!==-1,tt=[];for(S=0;S<e.calcdata.length;S++){var Z=e.calcdata[S];for(T=0;T<Z.length;T++){var st=Z[T],$=st.label;N===Z[0].trace.legend&&rt!==$&&(v.indexOf($)===-1&&(lt=!0),E(v,$),tt.push($))}}if(!lt)for(var Q=0;Q<tt.length;Q++){var nt=v.indexOf(tt[Q]);nt!==-1&&v.splice(nt,1)}}c.call("_guiRelayout",e,"hiddenlabels",v)}else{var Y=b&&b.length,q=[],ot;if(Y)for(S=0;S<l.length;S++)ot=l[S],ot.visible&&ot.legendgroup===b&&q.push(S);if(s==="toggle"){var it;switch(x.visible){case!0:it="legendonly";break;case!1:it=!1;break;case"legendonly":it=!0;break}if(Y)if(h)for(S=0;S<l.length;S++){var dt=l[S];dt.visible!==!1&&dt.legendgroup===b&&F(dt,it)}else F(x,it);else F(x,it)}else if(s==="toggleothers"){var wt,xt,Ft,Et,Nt,te=!0;for(S=0;S<l.length;S++)if(Nt=l[S],wt=Nt===x,Ft=Nt.showlegend!==!0,!(wt||Ft)&&(xt=Y&&Nt.legendgroup===b,!xt&&Nt.legend===N&&Nt.visible===!0&&!c.traceIs(Nt,"notLegendIsolatable"))){te=!1;break}for(S=0;S<l.length;S++)if(Nt=l[S],!(Nt.visible===!1||Nt.legend!==N)&&!c.traceIs(Nt,"notLegendIsolatable"))switch(x.visible){case"legendonly":F(Nt,!0);break;case!0:Et=te?!0:"legendonly",wt=Nt===x,Ft=Nt.showlegend!==!0&&!Nt.legendgroup,xt=wt||Y&&Nt.legendgroup===b,F(Nt,xt||Ft?!0:Et);break}}for(S=0;S<D.length;S++)if(M=D[S],!!M){var Jt=M.constructUpdate(),Qt=Object.keys(Jt);for(T=0;T<Qt.length;T++)w=Qt[T],f=k[w]=k[w]||[],f[I[S]]=Jt[w]}for(u=Object.keys(k),S=0;S<u.length;S++)for(w=u[S],T=0;T<_.length;T++)k[w].hasOwnProperty(T)||(k[w][T]=void 0);R?c.call("_guiUpdate",e,k,{shapes:B},_):c.call("_guiRestyle",e,k,_)}}}),cb=Vt((X,V)=>{V.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}),jk=Vt((X,V)=>{var c=Mi(),g=Uy();V.exports=function(E,A,t){var e=A._inHover,r=g.isGrouped(A),i=g.isReversed(A),n={},o=[],a=!1,s={},h=0,v=0,m,p;function y(F,N,j){if(A.visible!==!1&&!(t&&F!==A._id))if(N===""||!g.isGrouped(A)){var G="~~i"+h;o.push(G),n[G]=[j],h++}else o.indexOf(N)===-1?(o.push(N),a=!0,n[N]=[j]):n[N].push(j)}for(m=0;m<E.length;m++){var l=E[m],x=l[0],b=x.trace,S=b.legend,T=b.legendgroup;if(!(!e&&(!b.visible||!b.showlegend)))if(c.traceIs(b,"pie-like"))for(s[T]||(s[T]={}),p=0;p<l.length;p++){var M=l[p].label;s[T][M]||(y(S,T,{label:M,color:l[p].color,i:l[p].i,trace:b,pts:l[p].pts}),s[T][M]=!0,v=Math.max(v,(M||"").length))}else y(S,T,x),v=Math.max(v,(b.name||"").length)}if(!o.length)return[];var w=!a||!r,u=[];for(m=0;m<o.length;m++){var f=n[o[m]];w?u.push(f[0]):u.push(f)}for(w&&(u=[u]),m=0;m<u.length;m++){var k=1/0;for(p=0;p<u[m].length;p++){var _=u[m][p].trace.legendrank;k>_&&(k=_)}u[m][0]._groupMinRank=k,u[m][0]._preGroupSort=m}var D=function(F,N){return F[0]._groupMinRank-N[0]._groupMinRank||F[0]._preGroupSort-N[0]._preGroupSort},I=function(F,N){return F.trace.legendrank-N.trace.legendrank||F._preSort-N._preSort};for(u.forEach(function(F,N){F[0]._preGroupSort=N}),u.sort(D),m=0;m<u.length;m++){u[m].forEach(function(F,N){F._preSort=N}),u[m].sort(I);var O=u[m][0].trace,B=null;for(p=0;p<u[m].length;p++){var R=u[m][p].trace.legendgrouptitle;if(R&&R.text){B=R,e&&(R.font=A._groupTitleFont);break}}if(i&&u[m].reverse(),B){var L=!1;for(p=0;p<u[m].length;p++)if(c.traceIs(u[m][p].trace,"pie-like")){L=!0;break}u[m].unshift({i:-1,groupTitle:B,noClick:L,trace:{showlegend:O.showlegend,legendgroup:O.legendgroup,visible:A.groupclick==="toggleitem"?!0:O.visible}})}for(p=0;p<u[m].length;p++)u[m][p]=[u[m][p]]}return A._lgroupsLength=u.length,A._maxNameLength=v,u}}),Sd=Vt(X=>{var V=qr();function c(g){return g.indexOf("e")!==-1?g.replace(/[.]?0+e/,"e"):g.indexOf(".")!==-1?g.replace(/[.]?0+$/,""):g}X.formatPiePercent=function(g,E){var A=c((g*100).toPrecision(3));return V.numSeparate(A,E)+"%"},X.formatPieValue=function(g,E){var A=c(g.toPrecision(10));return V.numSeparate(A,E)},X.getFirstFilled=function(g,E){if(V.isArrayOrTypedArray(g))for(var A=0;A<E.length;A++){var t=g[E[A]];if(t||t===0||t==="")return t}},X.castOption=function(g,E){if(V.isArrayOrTypedArray(g))return X.getFirstFilled(g,E);if(g)return g},X.getRotationAngle=function(g){return(g==="auto"?0:g)*Math.PI/180}}),Nk=Vt((X,V)=>{var c=go(),g=vi();V.exports=function(E,A,t,e){var r=t.marker.pattern;r&&r.shape?c.pointStyle(E,t,e,A):g.fill(E,A.color)}}),wg=Vt((X,V)=>{var c=vi(),g=Sd().castOption,E=Nk();V.exports=function(A,t,e,r){var i=e.marker.line,n=g(i.color,t.pts)||c.defaultLine,o=g(i.width,t.pts)||0;A.call(E,t,e,r).style("stroke-width",o).call(c.stroke,n)}}),hb=Vt((X,V)=>{var c=Ai(),g=Mi(),E=qr(),A=E.strTranslate,t=go(),e=vi(),r=pf().extractOpts,i=Sl(),n=wg(),o=Sd().castOption,a=cb(),s=12,h=5,v=2,m=10,p=5;V.exports=function(b,S,T){var M=S._fullLayout;T||(T=M.legend);var w=T.itemsizing==="constant",u=T.itemwidth,f=(u+a.itemGap*2)/2,k=A(f,0),_=function(tt,Z,st,$){var Q;if(tt+1)Q=tt;else if(Z&&Z.width>0)Q=Z.width;else return 0;return w?$:Math.min(Q,st)};b.each(function(tt){var Z=c.select(this),st=E.ensureSingle(Z,"g","layers");st.style("opacity",tt[0].trace.opacity);var $=T.indentation,Q=T.valign,nt=tt[0].lineHeight,Y=tt[0].height;if(Q==="middle"&&$===0||!nt||!Y)st.attr("transform",null);else{var q={top:1,bottom:-1}[Q],ot=q*(.5*(nt-Y+3))||0,it=T.indentation;st.attr("transform",A(it,ot))}var dt=st.selectAll("g.legendfill").data([tt]);dt.enter().append("g").classed("legendfill",!0);var wt=st.selectAll("g.legendlines").data([tt]);wt.enter().append("g").classed("legendlines",!0);var xt=st.selectAll("g.legendsymbols").data([tt]);xt.enter().append("g").classed("legendsymbols",!0),xt.selectAll("g.legendpoints").data([tt]).enter().append("g").classed("legendpoints",!0)}).each(lt).each(O).each(R).each(B).each(F).each(rt).each(G).each(D).each(I).each(N).each(j);function D(tt){var Z=l(tt),st=Z.showFill,$=Z.showLine,Q=Z.showGradientLine,nt=Z.showGradientFill,Y=Z.anyFill,q=Z.anyLine,ot=tt[0],it=ot.trace,dt,wt,xt=r(it),Ft=xt.colorscale,Et=xt.reversescale,Nt=function(vt){if(vt.size())if(st)t.fillGroupStyle(vt,S,!0);else{var Ut="legendfill-"+it.uid;t.gradient(vt,S,Ut,y(Et),Ft,"fill")}},te=function(vt){if(vt.size()){var Ut="legendline-"+it.uid;t.lineGroupStyle(vt),t.gradient(vt,S,Ut,y(Et),Ft,"stroke")}},Jt=i.hasMarkers(it)||!Y?"M5,0":q?"M5,-2":"M5,-3",Qt=c.select(this),Wt=Qt.select(".legendfill").selectAll("path").data(st||nt?[tt]:[]);if(Wt.enter().append("path").classed("js-fill",!0),Wt.exit().remove(),Wt.attr("d",Jt+"h"+u+"v6h-"+u+"z").call(Nt),$||Q){var gt=_(void 0,it.line,m,h);wt=E.minExtend(it,{line:{width:gt}}),dt=[E.minExtend(ot,{trace:wt})]}var bt=Qt.select(".legendlines").selectAll("path").data($||Q?[dt]:[]);bt.enter().append("path").classed("js-line",!0),bt.exit().remove(),bt.attr("d",Jt+(Q?"l"+u+",0.0001":"h"+u)).call($?t.lineGroupStyle:te)}function I(tt){var Z=l(tt),st=Z.anyFill,$=Z.anyLine,Q=Z.showLine,nt=Z.showMarker,Y=tt[0],q=Y.trace,ot=!nt&&!$&&!st&&i.hasText(q),it,dt;function wt(Wt,gt,bt,vt){var Ut=E.nestedProperty(q,Wt).get(),Kt=E.isArrayOrTypedArray(Ut)&>?gt(Ut):Ut;if(w&&Kt&&vt!==void 0&&(Kt=vt),bt){if(Kt<bt[0])return bt[0];if(Kt>bt[1])return bt[1]}return Kt}function xt(Wt){return Y._distinct&&Y.index&&Wt[Y.index]?Wt[Y.index]:Wt[0]}if(nt||ot||Q){var Ft={},Et={};if(nt){Ft.mc=wt("marker.color",xt),Ft.mx=wt("marker.symbol",xt),Ft.mo=wt("marker.opacity",E.mean,[.2,1]),Ft.mlc=wt("marker.line.color",xt),Ft.mlw=wt("marker.line.width",E.mean,[0,5],v),Et.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var Nt=wt("marker.size",E.mean,[2,16],s);Ft.ms=Nt,Et.marker.size=Nt}Q&&(Et.line={width:wt("line.width",xt,[0,10],h)}),ot&&(Ft.tx="Aa",Ft.tp=wt("textposition",xt),Ft.ts=10,Ft.tc=wt("textfont.color",xt),Ft.tf=wt("textfont.family",xt),Ft.tw=wt("textfont.weight",xt),Ft.ty=wt("textfont.style",xt),Ft.tv=wt("textfont.variant",xt),Ft.tC=wt("textfont.textcase",xt),Ft.tE=wt("textfont.lineposition",xt),Ft.tS=wt("textfont.shadow",xt)),it=[E.minExtend(Y,Ft)],dt=E.minExtend(q,Et),dt.selectedpoints=null,dt.texttemplate=null}var te=c.select(this).select("g.legendpoints"),Jt=te.selectAll("path.scatterpts").data(nt?it:[]);Jt.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",k),Jt.exit().remove(),Jt.call(t.pointStyle,dt,S),nt&&(it[0].mrc=3);var Qt=te.selectAll("g.pointtext").data(ot?it:[]);Qt.enter().append("g").classed("pointtext",!0).append("text").attr("transform",k),Qt.exit().remove(),Qt.selectAll("text").call(t.textPointStyle,dt,S)}function O(tt){var Z=tt[0].trace,st=Z.type==="waterfall";if(tt[0]._distinct&&st){var $=tt[0].trace[tt[0].dir].marker;return tt[0].mc=$.color,tt[0].mlw=$.line.width,tt[0].mlc=$.line.color,L(tt,this,"waterfall")}var Q=[];Z.visible&&st&&(Q=tt[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var nt=c.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(Q);nt.enter().append("path").classed("legendwaterfall",!0).attr("transform",k).style("stroke-miterlimit",1),nt.exit().remove(),nt.each(function(Y){var q=c.select(this),ot=Z[Y[0]].marker,it=_(void 0,ot.line,p,v);q.attr("d",Y[1]).style("stroke-width",it+"px").call(e.fill,ot.color),it&&q.call(e.stroke,ot.line.color)})}function B(tt){L(tt,this)}function R(tt){L(tt,this,"funnel")}function L(tt,Z,st){var $=tt[0].trace,Q=$.marker||{},nt=Q.line||{},Y=Q.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",q=st?$.visible&&$.type===st:g.traceIs($,"bar"),ot=c.select(Z).select("g.legendpoints").selectAll("path.legend"+st).data(q?[tt]:[]);ot.enter().append("path").classed("legend"+st,!0).attr("d",Y).attr("transform",k),ot.exit().remove(),ot.each(function(it){var dt=c.select(this),wt=it[0],xt=_(wt.mlw,Q.line,p,v);dt.style("stroke-width",xt+"px");var Ft=wt.mcc;if(!T._inHover&&"mc"in wt){var Et=r(Q),Nt=Et.mid;Nt===void 0&&(Nt=(Et.max+Et.min)/2),Ft=t.tryColorscale(Q,"")(Nt)}var te=Ft||wt.mc||Q.color,Jt=Q.pattern,Qt=Jt&&t.getPatternAttr(Jt.shape,0,"");if(Qt){var Wt=t.getPatternAttr(Jt.bgcolor,0,null),gt=t.getPatternAttr(Jt.fgcolor,0,null),bt=Jt.fgopacity,vt=x(Jt.size,8,10),Ut=x(Jt.solidity,.5,1),Kt="legend-"+$.uid;dt.call(t.pattern,"legend",S,Kt,Qt,vt,Ut,Ft,Jt.fillmode,Wt,gt,bt)}else dt.call(e.fill,te);xt&&e.stroke(dt,wt.mlc||nt.color)})}function F(tt){var Z=tt[0].trace,st=c.select(this).select("g.legendpoints").selectAll("path.legendbox").data(Z.visible&&g.traceIs(Z,"box-violin")?[tt]:[]);st.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",k),st.exit().remove(),st.each(function(){var $=c.select(this);if((Z.boxpoints==="all"||Z.points==="all")&&e.opacity(Z.fillcolor)===0&&e.opacity((Z.line||{}).color)===0){var Q=E.minExtend(Z,{marker:{size:w?s:E.constrain(Z.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});st.call(t.pointStyle,Q,S)}else{var nt=_(void 0,Z.line,p,v);$.style("stroke-width",nt+"px").call(e.fill,Z.fillcolor),nt&&e.stroke($,Z.line.color)}})}function N(tt){var Z=tt[0].trace,st=c.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(Z.visible&&Z.type==="candlestick"?[tt,tt]:[]);st.enter().append("path").classed("legendcandle",!0).attr("d",function($,Q){return Q?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",k).style("stroke-miterlimit",1),st.exit().remove(),st.each(function($,Q){var nt=c.select(this),Y=Z[Q?"increasing":"decreasing"],q=_(void 0,Y.line,p,v);nt.style("stroke-width",q+"px").call(e.fill,Y.fillcolor),q&&e.stroke(nt,Y.line.color)})}function j(tt){var Z=tt[0].trace,st=c.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(Z.visible&&Z.type==="ohlc"?[tt,tt]:[]);st.enter().append("path").classed("legendohlc",!0).attr("d",function($,Q){return Q?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",k).style("stroke-miterlimit",1),st.exit().remove(),st.each(function($,Q){var nt=c.select(this),Y=Z[Q?"increasing":"decreasing"],q=_(void 0,Y.line,p,v);nt.style("fill","none").call(t.dashLine,Y.line.dash,q),q&&e.stroke(nt,Y.line.color)})}function G(tt){ct(tt,this,"pie")}function rt(tt){ct(tt,this,"funnelarea")}function ct(tt,Z,st){var $=tt[0],Q=$.trace,nt=st?Q.visible&&Q.type===st:g.traceIs(Q,st),Y=c.select(Z).select("g.legendpoints").selectAll("path.legend"+st).data(nt?[tt]:[]);if(Y.enter().append("path").classed("legend"+st,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",k),Y.exit().remove(),Y.size()){var q=Q.marker||{},ot=_(o(q.line.width,$.pts),q.line,p,v),it="pieLike",dt=E.minExtend(Q,{marker:{line:{width:ot}}},it),wt=E.minExtend($,{trace:dt},it);n(Y,wt,dt,S)}}function lt(tt){var Z=tt[0].trace,st,$=[];if(Z.visible)switch(Z.type){case"histogram2d":case"heatmap":$=[["M-15,-2V4H15V-2Z"]],st=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":$=[["M-6,-6V6H6V-6Z"]],st=!0;break;case"densitymapbox":case"densitymap":$=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],st="radial";break;case"cone":$=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],st=!1;break;case"streamtube":$=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],st=!1;break;case"surface":$=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],st=!0;break;case"mesh3d":$=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],st=!1;break;case"volume":$=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],st=!0;break;case"isosurface":$=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],st=!1;break}var Q=c.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data($);Q.enter().append("path").classed("legend3dandfriends",!0).attr("transform",k).style("stroke-miterlimit",1),Q.exit().remove(),Q.each(function(nt,Y){var q=c.select(this),ot=r(Z),it=ot.colorscale,dt=ot.reversescale,wt=function(Nt){if(Nt.size()){var te="legendfill-"+Z.uid;t.gradient(Nt,S,te,y(dt,st==="radial"),it,"fill")}},xt;if(it){if(!st){var Ft=it.length;xt=Y===0?it[dt?Ft-1:0][1]:Y===1?it[dt?0:Ft-1][1]:it[Math.floor((Ft-1)/2)][1]}}else{var Et=Z.vertexcolor||Z.facecolor||Z.color;xt=E.isArrayOrTypedArray(Et)?Et[Y]||Et[0]:Et}q.attr("d",nt[0]),xt?q.call(e.fill,xt):q.call(wt)})}};function y(b,S){var T=S?"radial":"horizontal";return T+(b?"":"reversed")}function l(b){var S=b[0].trace,T=S.contours,M=i.hasLines(S),w=i.hasMarkers(S),u=S.visible&&S.fill&&S.fill!=="none",f=!1,k=!1;if(T){var _=T.coloring;_==="lines"?f=!0:M=_==="none"||_==="heatmap"||T.showlines,T.type==="constraint"?u=T._operation!=="=":(_==="fill"||_==="heatmap")&&(k=!0)}return{showMarker:w,showLine:M,showFill:u,showGradientLine:f,showGradientFill:k,anyLine:M||f,anyFill:u||k}}function x(b,S,T){return b&&E.isArrayOrTypedArray(b)?S:b>T?T:b}}),fb=Vt((X,V)=>{var c=Ai(),g=qr(),E=fu(),A=Mi(),t=vg(),e=af(),r=go(),i=vi(),n=sl(),o=Rk(),a=cb(),s=nh(),h=s.LINE_SPACING,v=s.FROM_TL,m=s.FROM_BR,p=jk(),y=hb(),l=Uy(),x=1,b=/^legend[0-9]*$/;V.exports=function(N,j){if(j)T(N,j);else{var G=N._fullLayout,rt=G._legends,ct=G._infolayer.selectAll('[class^="legend"]');ct.each(function(){var st=c.select(this),$=st.attr("class"),Q=$.split(" ")[0];Q.match(b)&&rt.indexOf(Q)===-1&&st.remove()});for(var lt=0;lt<rt.length;lt++){var tt=rt[lt],Z=N._fullLayout[tt];T(N,Z)}}};function S(N,j,G){if(!(j.title.side!=="top center"&&j.title.side!=="top right")){var rt=j.title.font,ct=rt.size*h,lt=0,tt=N.node(),Z=r.bBox(tt).width;j.title.side==="top center"?lt=.5*(j._width-2*G-2*a.titlePad-Z):j.title.side==="top right"&&(lt=j._width-2*G-2*a.titlePad-Z),n.positionText(N,G+a.titlePad+lt,G+ct)}}function T(N,j){var G=j||{},rt=N._fullLayout,ct=F(G),lt,tt,Z=G._inHover;if(Z?(tt=G.layer,lt="hover"):(tt=rt._infolayer,lt=ct),!!tt){lt+=rt._uid,N._legendMouseDownTime||(N._legendMouseDownTime=0);var st;if(Z){if(!G.entries)return;st=p(G.entries,G)}else{for(var $=(N.calcdata||[]).slice(),Q=rt.shapes,nt=0;nt<Q.length;nt++){var Y=Q[nt];if(Y.showlegend){var q={_isShape:!0,_fullInput:Y,index:Y._index,name:Y.name||Y.label.text||"shape "+Y._index,legend:Y.legend,legendgroup:Y.legendgroup,legendgrouptitle:Y.legendgrouptitle,legendrank:Y.legendrank,legendwidth:Y.legendwidth,showlegend:Y.showlegend,visible:Y.visible,opacity:Y.opacity,mode:Y.type==="line"?"lines":"markers",line:Y.line,marker:{line:Y.line,color:Y.fillcolor,size:12,symbol:Y.type==="rect"?"square":Y.type==="circle"?"circle":"hexagon2"}};$.push([{trace:q}])}}st=rt.showlegend&&p($,G,rt._legends.length>1)}var ot=rt.hiddenlabels||[];if(!Z&&(!rt.showlegend||!st.length))return tt.selectAll("."+ct).remove(),rt._topdefs.select("#"+lt).remove(),E.autoMargin(N,ct);var it=g.ensureSingle(tt,"g",ct,function(Qt){Z||Qt.attr("pointer-events","all")}),dt=g.ensureSingleById(rt._topdefs,"clipPath",lt,function(Qt){Qt.append("rect")}),wt=g.ensureSingle(it,"rect","bg",function(Qt){Qt.attr("shape-rendering","crispEdges")});wt.call(i.stroke,G.bordercolor).call(i.fill,G.bgcolor).style("stroke-width",G.borderwidth+"px");var xt=g.ensureSingle(it,"g","scrollbox"),Ft=G.title;G._titleWidth=0,G._titleHeight=0;var Et;Ft.text?(Et=g.ensureSingle(xt,"text",ct+"titletext"),Et.attr("text-anchor","start").call(r.font,Ft.font).text(Ft.text),_(Et,xt,N,G,x)):xt.selectAll("."+ct+"titletext").remove();var Nt=g.ensureSingle(it,"rect","scrollbar",function(Qt){Qt.attr(a.scrollBarEnterAttrs).call(i.fill,a.scrollBarColor)}),te=xt.selectAll("g.groups").data(st);te.enter().append("g").attr("class","groups"),te.exit().remove();var Jt=te.selectAll("g.traces").data(g.identity);Jt.enter().append("g").attr("class","traces"),Jt.exit().remove(),Jt.style("opacity",function(Qt){var Wt=Qt[0].trace;return A.traceIs(Wt,"pie-like")?ot.indexOf(Qt[0].label)!==-1?.5:1:Wt.visible==="legendonly"?.5:1}).each(function(){c.select(this).call(u,N,G)}).call(y,N,G).each(function(){Z||c.select(this).call(k,N,ct)}),g.syncOrAsync([E.previousPromises,function(){return O(N,te,Jt,G)},function(){var Qt=rt._size,Wt=G.borderwidth,gt=G.xref==="paper",bt=G.yref==="paper";if(Ft.text&&S(Et,G,Wt),!Z){var vt,Ut;gt?vt=Qt.l+Qt.w*G.x-v[R(G)]*G._width:vt=rt.width*G.x-v[R(G)]*G._width,bt?Ut=Qt.t+Qt.h*(1-G.y)-v[L(G)]*G._effHeight:Ut=rt.height*(1-G.y)-v[L(G)]*G._effHeight;var Kt=B(N,ct,vt,Ut);if(Kt)return;if(rt.margin.autoexpand){var Zt=vt,le=Ut;vt=gt?g.constrain(vt,0,rt.width-G._width):Zt,Ut=bt?g.constrain(Ut,0,rt.height-G._effHeight):le,vt!==Zt&&g.log("Constrain "+ct+".x to make legend fit inside graph"),Ut!==le&&g.log("Constrain "+ct+".y to make legend fit inside graph")}r.setTranslate(it,vt,Ut)}if(Nt.on(".drag",null),it.on("wheel",null),Z||G._height<=G._maxHeight||N._context.staticPlot){var Te=G._effHeight;Z&&(Te=G._height),wt.attr({width:G._width-Wt,height:Te-Wt,x:Wt/2,y:Wt/2}),r.setTranslate(xt,0,0),dt.select("rect").attr({width:G._width-2*Wt,height:Te-2*Wt,x:Wt,y:Wt}),r.setClipUrl(xt,lt,N),r.setRect(Nt,0,0,0,0),delete G._scrollY}else{var Se=Math.max(a.scrollBarMinHeight,G._effHeight*G._effHeight/G._height),Fe=G._effHeight-Se-2*a.scrollBarMargin,Oe=G._height-G._effHeight,ur=Fe/Oe,fr=Math.min(G._scrollY||0,Oe);wt.attr({width:G._width-2*Wt+a.scrollBarWidth+a.scrollBarMargin,height:G._effHeight-Wt,x:Wt/2,y:Wt/2}),dt.select("rect").attr({width:G._width-2*Wt+a.scrollBarWidth+a.scrollBarMargin,height:G._effHeight-2*Wt,x:Wt,y:Wt+fr}),r.setClipUrl(xt,lt,N),ut(fr,Se,ur),it.on("wheel",function(){fr=g.constrain(G._scrollY+c.event.deltaY/Fe*Oe,0,Oe),ut(fr,Se,ur),fr!==0&&fr!==Oe&&c.event.preventDefault()});var We,Lr,kr,he=function(ee,we,Me){var Re=(Me-we)/ur+ee;return g.constrain(Re,0,Oe)},Dt=function(ee,we,Me){var Re=(we-Me)/ur+ee;return g.constrain(Re,0,Oe)},qt=c.behavior.drag().on("dragstart",function(){var ee=c.event.sourceEvent;ee.type==="touchstart"?We=ee.changedTouches[0].clientY:We=ee.clientY,kr=fr}).on("drag",function(){var ee=c.event.sourceEvent;ee.buttons===2||ee.ctrlKey||(ee.type==="touchmove"?Lr=ee.changedTouches[0].clientY:Lr=ee.clientY,fr=he(kr,We,Lr),ut(fr,Se,ur))});Nt.call(qt);var zt=c.behavior.drag().on("dragstart",function(){var ee=c.event.sourceEvent;ee.type==="touchstart"&&(We=ee.changedTouches[0].clientY,kr=fr)}).on("drag",function(){var ee=c.event.sourceEvent;ee.type==="touchmove"&&(Lr=ee.changedTouches[0].clientY,fr=Dt(kr,We,Lr),ut(fr,Se,ur))});xt.call(zt)}function ut(ee,we,Me){G._scrollY=N._fullLayout[ct]._scrollY=ee,r.setTranslate(xt,0,-ee),r.setRect(Nt,G._width,a.scrollBarMargin+ee*Me,a.scrollBarWidth,we),dt.select("rect").attr("y",Wt+ee)}if(N._context.edits.legendPosition){var yt,Mt,Ot,$t;it.classed("cursor-move",!0),e.init({element:it.node(),gd:N,prepFn:function(ee){if(ee.target!==Nt.node()){var we=r.getTranslate(it);Ot=we.x,$t=we.y}},moveFn:function(ee,we){if(Ot!==void 0&&$t!==void 0){var Me=Ot+ee,Re=$t+we;r.setTranslate(it,Me,Re),yt=e.align(Me,G._width,Qt.l,Qt.l+Qt.w,G.xanchor),Mt=e.align(Re+G._height,-G._height,Qt.t+Qt.h,Qt.t,G.yanchor)}},doneFn:function(){if(yt!==void 0&&Mt!==void 0){var ee={};ee[ct+".x"]=yt,ee[ct+".y"]=Mt,A.call("_guiRelayout",N,ee)}},clickFn:function(ee,we){var Me=tt.selectAll("g.traces").filter(function(){var Re=this.getBoundingClientRect();return we.clientX>=Re.left&&we.clientX<=Re.right&&we.clientY>=Re.top&&we.clientY<=Re.bottom});Me.size()>0&&w(N,it,Me,ee,we)}})}}],N)}}function M(N,j,G){var rt=N[0],ct=rt.width,lt=j.entrywidthmode,tt=rt.trace.legendwidth||j.entrywidth;return lt==="fraction"?j._maxWidth*tt:G+(tt||ct)}function w(N,j,G,rt,ct){var lt=G.data()[0][0].trace,tt={event:ct,node:G.node(),curveNumber:lt.index,expandedIndex:lt.index,data:N.data,layout:N.layout,frames:N._transitionData._frames,config:N._context,fullData:N._fullData,fullLayout:N._fullLayout};lt._group&&(tt.group=lt._group),A.traceIs(lt,"pie-like")&&(tt.label=G.datum()[0].label);var Z=t.triggerHandler(N,"plotly_legendclick",tt);if(rt===1){if(Z===!1)return;j._clickTimeout=setTimeout(function(){N._fullLayout&&o(G,N,rt)},N._context.doubleClickDelay)}else if(rt===2){j._clickTimeout&&clearTimeout(j._clickTimeout),N._legendMouseDownTime=0;var st=t.triggerHandler(N,"plotly_legenddoubleclick",tt);st!==!1&&Z!==!1&&o(G,N,rt)}}function u(N,j,G){var rt=F(G),ct=N.data()[0][0],lt=ct.trace,tt=A.traceIs(lt,"pie-like"),Z=!G._inHover&&j._context.edits.legendText&&!tt,st=G._maxNameLength,$,Q;ct.groupTitle?($=ct.groupTitle.text,Q=ct.groupTitle.font):(Q=G.font,G.entries?$=ct.text:($=tt?ct.label:lt.name,lt._meta&&($=g.templateString($,lt._meta))));var nt=g.ensureSingle(N,"text",rt+"text");nt.attr("text-anchor","start").call(r.font,Q).text(Z?f($,st):$);var Y=G.indentation+G.itemwidth+a.itemGap*2;n.positionText(nt,Y,0),Z?nt.call(n.makeEditable,{gd:j,text:$}).call(_,N,j,G).on("edit",function(q){this.text(f(q,st)).call(_,N,j,G);var ot=ct.trace._fullInput||{},it={};return it.name=q,ot._isShape?A.call("_guiRelayout",j,"shapes["+lt.index+"].name",it.name):A.call("_guiRestyle",j,it,lt.index)}):_(nt,N,j,G)}function f(N,j){var G=Math.max(4,j);if(N&&N.trim().length>=G/2)return N;N=N||"";for(var rt=G-N.length;rt>0;rt--)N+=" ";return N}function k(N,j,G){var rt=j._context.doubleClickDelay,ct,lt=1,tt=g.ensureSingle(N,"rect",G+"toggle",function(Z){j._context.staticPlot||Z.style("cursor","pointer").attr("pointer-events","all"),Z.call(i.fill,"rgba(0,0,0,0)")});j._context.staticPlot||(tt.on("mousedown",function(){ct=new Date().getTime(),ct-j._legendMouseDownTime<rt?lt+=1:(lt=1,j._legendMouseDownTime=ct)}),tt.on("mouseup",function(){if(!(j._dragged||j._editing)){var Z=j._fullLayout[G];new Date().getTime()-j._legendMouseDownTime>rt&&(lt=Math.max(lt-1,1)),w(j,Z,N,lt,c.event)}}))}function _(N,j,G,rt,ct){rt._inHover&&N.attr("data-notex",!0),n.convertToTspans(N,G,function(){D(j,G,rt,ct)})}function D(N,j,G,rt){var ct=N.data()[0][0];if(!G._inHover&&ct&&!ct.trace.showlegend){N.remove();return}var lt=N.select("g[class*=math-group]"),tt=lt.node(),Z=F(G);G||(G=j._fullLayout[Z]);var st=G.borderwidth,$;rt===x?$=G.title.font:ct.groupTitle?$=ct.groupTitle.font:$=G.font;var Q=$.size*h,nt,Y;if(tt){var q=r.bBox(tt);nt=q.height,Y=q.width,rt===x?r.setTranslate(lt,st,st+nt*.75):r.setTranslate(lt,0,nt*.25)}else{var ot="."+Z+(rt===x?"title":"")+"text",it=N.select(ot),dt=n.lineCount(it),wt=it.node();if(nt=Q*dt,Y=wt?r.bBox(wt).width:0,rt===x)G.title.side==="left"&&(Y+=a.itemGap*2),n.positionText(it,st+a.titlePad,st+Q);else{var xt=a.itemGap*2+G.indentation+G.itemwidth;ct.groupTitle&&(xt=a.itemGap,Y-=G.indentation+G.itemwidth),n.positionText(it,xt,-Q*((dt-1)/2-.3))}}rt===x?(G._titleWidth=Y,G._titleHeight=nt):(ct.lineHeight=Q,ct.height=Math.max(nt,16)+3,ct.width=Y)}function I(N){var j=0,G=0,rt=N.title.side;return rt&&(rt.indexOf("left")!==-1&&(j=N._titleWidth),rt.indexOf("top")!==-1&&(G=N._titleHeight)),[j,G]}function O(N,j,G,rt){var ct=N._fullLayout,lt=F(rt);rt||(rt=ct[lt]);var tt=ct._size,Z=l.isVertical(rt),st=l.isGrouped(rt),$=rt.entrywidthmode==="fraction",Q=rt.borderwidth,nt=2*Q,Y=a.itemGap,q=rt.indentation+rt.itemwidth+Y*2,ot=2*(Q+Y),it=L(rt),dt=rt.y<0||rt.y===0&&it==="top",wt=rt.y>1||rt.y===1&&it==="bottom",xt=rt.tracegroupgap,Ft={};rt._maxHeight=Math.max(dt||wt?ct.height/2:tt.h,30);var Et=0;rt._width=0,rt._height=0;var Nt=I(rt);if(Z)G.each(function(kr){var he=kr[0].height;r.setTranslate(this,Q+Nt[0],Q+Nt[1]+rt._height+he/2+Y),rt._height+=he,rt._width=Math.max(rt._width,kr[0].width)}),Et=q+rt._width,rt._width+=Y+q+nt,rt._height+=ot,st&&(j.each(function(kr,he){r.setTranslate(this,0,he*rt.tracegroupgap)}),rt._height+=(rt._lgroupsLength-1)*rt.tracegroupgap);else{var te=R(rt),Jt=rt.x<0||rt.x===0&&te==="right",Qt=rt.x>1||rt.x===1&&te==="left",Wt=wt||dt,gt=ct.width/2;rt._maxWidth=Math.max(Jt?Wt&&te==="left"?tt.l+tt.w:gt:Qt?Wt&&te==="right"?tt.r+tt.w:gt:tt.w,2*q);var bt=0,vt=0;G.each(function(kr){var he=M(kr,rt,q);bt=Math.max(bt,he),vt+=he}),Et=null;var Ut=0;if(st){var Kt=0,Zt=0,le=0;j.each(function(){var kr=0,he=0;c.select(this).selectAll("g.traces").each(function(qt){var zt=M(qt,rt,q),ut=qt[0].height;r.setTranslate(this,Nt[0],Nt[1]+Q+Y+ut/2+he),he+=ut,kr=Math.max(kr,zt),Ft[qt[0].trace.legendgroup]=kr});var Dt=kr+Y;Zt>0&&Dt+Q+Zt>rt._maxWidth?(Ut=Math.max(Ut,Zt),Zt=0,le+=Kt+xt,Kt=he):Kt=Math.max(Kt,he),r.setTranslate(this,Zt,le),Zt+=Dt}),rt._width=Math.max(Ut,Zt)+Q,rt._height=le+Kt+ot}else{var Te=G.size(),Se=vt+nt+(Te-1)*Y<rt._maxWidth,Fe=0,Oe=0,ur=0,fr=0;G.each(function(kr){var he=kr[0].height,Dt=M(kr,rt,q),qt=Se?Dt:bt;$||(qt+=Y),qt+Q+Oe-Y>=rt._maxWidth&&(Ut=Math.max(Ut,fr),Oe=0,ur+=Fe,rt._height+=Fe,Fe=0),r.setTranslate(this,Nt[0]+Q+Oe,Nt[1]+Q+ur+he/2+Y),fr=Oe+Dt+Y,Oe+=qt,Fe=Math.max(Fe,he)}),Se?(rt._width=Oe+nt,rt._height=Fe+ot):(rt._width=Math.max(Ut,fr)+nt,rt._height+=Fe+ot)}}rt._width=Math.ceil(Math.max(rt._width+Nt[0],rt._titleWidth+2*(Q+a.titlePad))),rt._height=Math.ceil(Math.max(rt._height+Nt[1],rt._titleHeight+2*(Q+a.itemGap))),rt._effHeight=Math.min(rt._height,rt._maxHeight);var We=N._context.edits,Lr=We.legendText||We.legendPosition;G.each(function(kr){var he=c.select(this).select("."+lt+"toggle"),Dt=kr[0].height,qt=kr[0].trace.legendgroup,zt=M(kr,rt,q);st&&qt!==""&&(zt=Ft[qt]);var ut=Lr?q:Et||zt;!Z&&!$&&(ut+=Y/2),r.setRect(he,0,-Dt/2,ut,Dt)})}function B(N,j,G,rt){var ct=N._fullLayout,lt=ct[j],tt=R(lt),Z=L(lt),st=lt.xref==="paper",$=lt.yref==="paper";N._fullLayout._reservedMargin[j]={};var Q=lt.y<.5?"b":"t",nt=lt.x<.5?"l":"r",Y={r:ct.width-G,l:G+lt._width,b:ct.height-rt,t:rt+lt._effHeight};if(st&&$)return E.autoMargin(N,j,{x:lt.x,y:lt.y,l:lt._width*v[tt],r:lt._width*m[tt],b:lt._effHeight*m[Z],t:lt._effHeight*v[Z]});st?N._fullLayout._reservedMargin[j][Q]=Y[Q]:$||lt.orientation==="v"?N._fullLayout._reservedMargin[j][nt]=Y[nt]:N._fullLayout._reservedMargin[j][Q]=Y[Q]}function R(N){return g.isRightAnchor(N)?"right":g.isCenterAnchor(N)?"center":"left"}function L(N){return g.isBottomAnchor(N)?"bottom":g.isMiddleAnchor(N)?"middle":"top"}function F(N){return N._id||"legend"}}),pb=Vt(X=>{var V=Ai(),c=vo(),g=yh(),E=qr(),A=E.pushUnique,t=E.strTranslate,e=E.strRotate,r=vg(),i=sl(),n=Bk(),o=go(),a=vi(),s=af(),h=ao(),v=xh().zindexSeparator,m=Mi(),p=vf(),y=Lm(),l=ub(),x=fb(),b=y.YANGLE,S=Math.PI*b/180,T=1/Math.sin(S),M=Math.cos(S),w=Math.sin(S),u=y.HOVERARROWSIZE,f=y.HOVERTEXTPAD,k={box:!0,ohlc:!0,violin:!0,candlestick:!0},_={scatter:!0,scattergl:!0,splom:!0};function D(q,ot){return q.distance-ot.distance}X.hover=function(q,ot,it,dt){q=E.getGraphDiv(q);var wt=ot.target;E.throttle(q._fullLayout._uid+y.HOVERID,y.HOVERMINTIME,function(){I(q,ot,it,dt,wt)})},X.loneHover=function(q,ot){var it=!0;Array.isArray(q)||(it=!1,q=[q]);var dt=ot.gd,wt=Q(dt),xt=nt(dt),Ft=q.map(function(vt){var Ut=vt._x0||vt.x0||vt.x||0,Kt=vt._x1||vt.x1||vt.x||0,Zt=vt._y0||vt.y0||vt.y||0,le=vt._y1||vt.y1||vt.y||0,Te=vt.eventData;if(Te){var Se=Math.min(Ut,Kt),Fe=Math.max(Ut,Kt),Oe=Math.min(Zt,le),ur=Math.max(Zt,le),fr=vt.trace;if(m.traceIs(fr,"gl3d")){var We=dt._fullLayout[fr.scene]._scene.container,Lr=We.offsetLeft,kr=We.offsetTop;Se+=Lr,Fe+=Lr,Oe+=kr,ur+=kr}Te.bbox={x0:Se+xt,x1:Fe+xt,y0:Oe+wt,y1:ur+wt},ot.inOut_bbox&&ot.inOut_bbox.push(Te.bbox)}else Te=!1;return{color:vt.color||a.defaultLine,x0:vt.x0||vt.x||0,x1:vt.x1||vt.x||0,y0:vt.y0||vt.y||0,y1:vt.y1||vt.y||0,xLabel:vt.xLabel,yLabel:vt.yLabel,zLabel:vt.zLabel,text:vt.text,name:vt.name,idealAlign:vt.idealAlign,borderColor:vt.borderColor,fontFamily:vt.fontFamily,fontSize:vt.fontSize,fontColor:vt.fontColor,fontWeight:vt.fontWeight,fontStyle:vt.fontStyle,fontVariant:vt.fontVariant,nameLength:vt.nameLength,textAlign:vt.textAlign,trace:vt.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:vt.hovertemplate||!1,hovertemplateLabels:vt.hovertemplateLabels||!1,eventData:Te}}),Et=!1,Nt=R(Ft,{gd:dt,hovermode:"closest",rotateLabels:Et,bgColor:ot.bgColor||a.background,container:V.select(ot.container),outerContainer:ot.outerContainer||ot.container}),te=Nt.hoverLabels,Jt=5,Qt=0,Wt=0;te.sort(function(vt,Ut){return vt.y0-Ut.y0}).each(function(vt,Ut){var Kt=vt.y0-vt.by/2;Kt-Jt<Qt?vt.offset=Qt-Kt+Jt:vt.offset=0,Qt=Kt+vt.by+vt.offset,Ut===ot.anchorIndex&&(Wt=vt.offset)}).each(function(vt){vt.offset-=Wt});var gt=dt._fullLayout._invScaleX,bt=dt._fullLayout._invScaleY;return G(te,Et,gt,bt),it?te:te.node()};function I(q,ot,it,dt,wt){it||(it="xy"),typeof it=="string"&&(it=it.split(v)[0]);var xt=Array.isArray(it)?it:[it],Ft,Et=q._fullLayout,Nt=Et.hoversubplots,te=Et._plots||[],Jt=te[it],Qt=Et._has("cartesian"),Wt=ot.hovermode||Et.hovermode,gt=(Wt||"").charAt(0)==="x",bt=(Wt||"").charAt(0)==="y",vt,Ut;if(Qt&&(gt||bt)&&Nt==="axis"){for(var Kt=xt.length,Zt=0;Zt<Kt;Zt++)if(Ft=xt[Zt],te[Ft]){vt=h.getFromId(q,Ft,"x"),Ut=h.getFromId(q,Ft,"y");var le=(gt?vt:Ut)._subplotsWith;if(le&&le.length)for(var Te=0;Te<le.length;Te++)A(xt,le[Te])}}if(Jt&&Nt!=="single"){var Se=Jt.overlays.map(function(Da){return Da.id});xt=xt.concat(Se)}for(var Fe=xt.length,Oe=new Array(Fe),ur=new Array(Fe),fr=!1,We=0;We<Fe;We++)if(Ft=xt[We],te[Ft])fr=!0,Oe[We]=te[Ft].xaxis,ur[We]=te[Ft].yaxis;else if(Et[Ft]&&Et[Ft]._subplot){var Lr=Et[Ft]._subplot;Oe[We]=Lr.xaxis,ur[We]=Lr.yaxis}else{E.warn("Unrecognized subplot: "+Ft);return}if(Wt&&!fr&&(Wt="closest"),["x","y","closest","x unified","y unified"].indexOf(Wt)===-1||!q.calcdata||q.querySelector(".zoombox")||q._dragging)return s.unhoverRaw(q,ot);var kr=Et.hoverdistance;kr===-1&&(kr=1/0);var he=Et.spikedistance;he===-1&&(he=1/0);var Dt=[],qt=[],zt,ut,yt,Mt,Ot,$t,ee,we,Me,Re,Be,Ze,Ue,mr={hLinePoint:null,vLinePoint:null},ln=!1;if(Array.isArray(ot))for(Wt="array",yt=0;yt<ot.length;yt++)Ot=q.calcdata[ot[yt].curveNumber||0],Ot&&($t=Ot[0].trace,Ot[0].trace.hoverinfo!=="skip"&&(qt.push(Ot),$t.orientation==="h"&&(ln=!0)));else{var an=q.calcdata.slice();for(an.sort(function(Da,Ui){var lo=Da[0].trace.zorder||0,Co=Ui[0].trace.zorder||0;return lo-Co}),Mt=0;Mt<an.length;Mt++)Ot=an[Mt],$t=Ot[0].trace,$t.hoverinfo!=="skip"&&p.isTraceInSubplots($t,xt)&&(qt.push(Ot),$t.orientation==="h"&&(ln=!0));var vn=!wt,Sn,An;if(vn)"xpx"in ot?Sn=ot.xpx:Sn=Oe[0]._length/2,"ypx"in ot?An=ot.ypx:An=ur[0]._length/2;else{if(r.triggerHandler(q,"plotly_beforehover",ot)===!1)return;var pn=wt.getBoundingClientRect();Sn=ot.clientX-pn.left,An=ot.clientY-pn.top,Et._calcInverseTransform(q);var On=E.apply3DTransform(Et._invTransform)(Sn,An);if(Sn=On[0],An=On[1],Sn<0||Sn>Oe[0]._length||An<0||An>ur[0]._length)return s.unhoverRaw(q,ot)}if(ot.pointerX=Sn+Oe[0]._offset,ot.pointerY=An+ur[0]._offset,"xval"in ot?zt=p.flat(xt,ot.xval):zt=p.p2c(Oe,Sn),"yval"in ot?ut=p.flat(xt,ot.yval):ut=p.p2c(ur,An),!c(zt[0])||!c(ut[0]))return E.warn("Fx.hover failed",ot,q),s.unhoverRaw(q,ot)}var Nn=1/0;function ke(Da,Ui){for(Mt=0;Mt<qt.length;Mt++)if(Ot=qt[Mt],!(!Ot||!Ot[0]||!Ot[0].trace)&&($t=Ot[0].trace,!($t.visible!==!0||$t._length===0)&&["carpet","contourcarpet"].indexOf($t._module.name)===-1)){if(Me=Wt,p.isUnifiedHover(Me)&&(Me=Me.charAt(0)),$t.type==="splom"?(we=0,ee=xt[we]):(ee=p.getSubplot($t),we=xt.indexOf(ee)),Ze={cd:Ot,trace:$t,xa:Oe[we],ya:ur[we],maxHoverDistance:kr,maxSpikeDistance:he,index:!1,distance:Math.min(Nn,kr),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:a.defaultLine,name:$t.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},Et[ee]&&(Ze.subplot=Et[ee]._subplot),Et._splomScenes&&Et._splomScenes[$t.uid]&&(Ze.scene=Et._splomScenes[$t.uid]),Me==="array"){var lo=ot[Mt];"pointNumber"in lo?(Ze.index=lo.pointNumber,Me="closest"):(Me="","xval"in lo&&(Re=lo.xval,Me="x"),"yval"in lo&&(Be=lo.yval,Me=Me?"closest":"y"))}else Da!==void 0&&Ui!==void 0?(Re=Da,Be=Ui):(Re=zt[we],Be=ut[we]);if(Ue=Dt.length,kr!==0)if($t._module&&$t._module.hoverPoints){var Co=$t._module.hoverPoints(Ze,Re,Be,Me,{finiteRange:!0,hoverLayer:Et._hoverlayer,hoversubplots:Nt,gd:q});if(Co)for(var Bo,ai=0;ai<Co.length;ai++)Bo=Co[ai],c(Bo.x0)&&c(Bo.y0)&&Dt.push(rt(Bo,Wt))}else E.log("Unrecognized trace type in hover:",$t);if(Wt==="closest"&&Dt.length>Ue&&(Dt.splice(0,Ue),Nn=Dt[0].distance),Qt&&he!==0&&Dt.length===0){Ze.distance=he,Ze.index=!1;var yi=$t._module.hoverPoints(Ze,Re,Be,"closest",{hoverLayer:Et._hoverlayer});if(yi&&(yi=yi.filter(function(Yi){return Yi.spikeDistance<=he})),yi&&yi.length){var Si,ko=yi.filter(function(Yi){return Yi.xa.showspikes&&Yi.xa.spikesnap!=="hovered data"});if(ko.length){var Ao=ko[0];c(Ao.x0)&&c(Ao.y0)&&(Si=je(Ao),(!mr.vLinePoint||mr.vLinePoint.spikeDistance>Si.spikeDistance)&&(mr.vLinePoint=Si))}var Do=yi.filter(function(Yi){return Yi.ya.showspikes&&Yi.ya.spikesnap!=="hovered data"});if(Do.length){var Pi=Do[0];c(Pi.x0)&&c(Pi.y0)&&(Si=je(Pi),(!mr.hLinePoint||mr.hLinePoint.spikeDistance>Si.spikeDistance)&&(mr.hLinePoint=Si))}}}}}ke();function ze(Da,Ui,lo){for(var Co=null,Bo=1/0,ai,yi=0;yi<Da.length;yi++)vt&&vt._id!==Da[yi].xa._id||Ut&&Ut._id!==Da[yi].ya._id||(ai=Da[yi].spikeDistance,lo&&yi===0&&(ai=-1/0),ai<=Bo&&ai<=Ui&&(Co=Da[yi],Bo=ai));return Co}function je(Da){return Da?{xa:Da.xa,ya:Da.ya,x:Da.xSpike!==void 0?Da.xSpike:(Da.x0+Da.x1)/2,y:Da.ySpike!==void 0?Da.ySpike:(Da.y0+Da.y1)/2,distance:Da.distance,spikeDistance:Da.spikeDistance,curveNumber:Da.trace.index,color:Da.color,pointNumber:Da.index}:null}var Ne={fullLayout:Et,container:Et._hoverlayer,event:ot};q._spikepoints;var _r={vLinePoint:mr.vLinePoint,hLinePoint:mr.hLinePoint};q._spikepoints=_r;var Xr=function(){var Da=Dt.filter(function(lo){return vt&&vt._id===lo.xa._id&&Ut&&Ut._id===lo.ya._id}),Ui=Dt.filter(function(lo){return!(vt&&vt._id===lo.xa._id&&Ut&&Ut._id===lo.ya._id)});Da.sort(D),Ui.sort(D),Dt=Da.concat(Ui),Dt=st(Dt,Wt)};Xr();var rn=Wt.charAt(0),Br=(rn==="x"||rn==="y")&&Dt[0]&&_[Dt[0].trace.type];if(Qt&&he!==0&&Dt.length!==0){var _n=Dt.filter(function(Da){return Da.ya.showspikes}),bn=ze(_n,he,Br);mr.hLinePoint=je(bn);var Fn=Dt.filter(function(Da){return Da.xa.showspikes}),on=ze(Fn,he,Br);mr.vLinePoint=je(on)}if(Dt.length===0){var Bn=s.unhoverRaw(q,ot);return Qt&&(mr.hLinePoint!==null||mr.vLinePoint!==null)&&tt()&&ct(q,mr,Ne),Bn}if(Qt&&tt()&&ct(q,mr,Ne),p.isXYhover(Me)&&Dt[0].length!==0&&Dt[0].trace.type!=="splom"){var ue=Dt[0];k[ue.trace.type]?Dt=Dt.filter(function(Da){return Da.trace.index===ue.trace.index}):Dt=[ue];var xe=Dt.length,Pr=$("x",ue,Et),Sr=$("y",ue,Et);ke(Pr,Sr);var gr=[],dr={},Er=0,Dr=function(Da){var Ui=k[Da.trace.type]?O(Da):Da.trace.index;if(!dr[Ui])Er++,dr[Ui]=Er,gr.push(Da);else{var lo=dr[Ui]-1,Co=gr[lo];lo>0&&Math.abs(Da.distance)<Math.abs(Co.distance)&&(gr[lo]=Da)}},Ar;for(Ar=0;Ar<xe;Ar++)Dr(Dt[Ar]);for(Ar=Dt.length-1;Ar>xe-1;Ar--)Dr(Dt[Ar]);Dt=gr,Xr()}var Gr=q._hoverdata,Wr=[],Jr=Q(q),_e=nt(q);for(yt=0;yt<Dt.length;yt++){var Je=Dt[yt],yr=p.makeEventData(Je,Je.trace,Je.cd);if(Je.hovertemplate!==!1){var Hr=!1;Je.cd[Je.index]&&Je.cd[Je.index].ht&&(Hr=Je.cd[Je.index].ht),Je.hovertemplate=Hr||Je.trace.hovertemplate||!1}if(Je.xa&&Je.ya){var hn=Je.x0+Je.xa._offset,En=Je.x1+Je.xa._offset,dn=Je.y0+Je.ya._offset,Kr=Je.y1+Je.ya._offset,Tn=Math.min(hn,En),ta=Math.max(hn,En),Qn=Math.min(dn,Kr),Va=Math.max(dn,Kr);yr.bbox={x0:Tn+_e,x1:ta+_e,y0:Qn+Jr,y1:Va+Jr}}Je.eventData=[yr],Wr.push(yr)}q._hoverdata=Wr;var ja=Wt==="y"&&(qt.length>1||Dt.length>1)||Wt==="closest"&&ln&&Dt.length>1,ci=a.combine(Et.plot_bgcolor||a.background,Et.paper_bgcolor),pi=R(Dt,{gd:q,hovermode:Wt,rotateLabels:ja,bgColor:ci,container:Et._hoverlayer,outerContainer:Et._paper.node(),commonLabelOpts:Et.hoverlabel,hoverdistance:Et.hoverdistance}),bi=pi.hoverLabels;if(p.isUnifiedHover(Wt)||(F(bi,ja,Et,pi.commonLabelBoundingBox),G(bi,ja,Et._invScaleX,Et._invScaleY)),wt&&wt.tagName){var ri=m.getComponentMethod("annotations","hasClickToShow")(q,Wr);n(V.select(wt),ri?"pointer":"")}!wt||dt||!lt(q,ot,Gr)||(Gr&&q.emit("plotly_unhover",{event:ot,points:Gr}),q.emit("plotly_hover",{event:ot,points:q._hoverdata,xaxes:Oe,yaxes:ur,xvals:zt,yvals:ut}))}function O(q){return[q.trace.index,q.index,q.x0,q.y0,q.name,q.attr,q.xa?q.xa._id:"",q.ya?q.ya._id:""].join(",")}var B=/<extra>([\s\S]*)<\/extra>/;function R(q,ot){var it=ot.gd,dt=it._fullLayout,wt=ot.hovermode,xt=ot.rotateLabels,Ft=ot.bgColor,Et=ot.container,Nt=ot.outerContainer,te=ot.commonLabelOpts||{};if(q.length===0)return[[]];var Jt=ot.fontFamily||y.HOVERFONT,Qt=ot.fontSize||y.HOVERFONTSIZE,Wt=ot.fontWeight||dt.font.weight,gt=ot.fontStyle||dt.font.style,bt=ot.fontVariant||dt.font.variant,vt=ot.fontTextcase||dt.font.textcase,Ut=ot.fontLineposition||dt.font.lineposition,Kt=ot.fontShadow||dt.font.shadow,Zt=q[0],le=Zt.xa,Te=Zt.ya,Se=wt.charAt(0),Fe=Se+"Label",Oe=Zt[Fe];if(Oe===void 0&&le.type==="multicategory")for(var ur=0;ur<q.length&&(Oe=q[ur][Fe],Oe===void 0);ur++);var fr=Y(it,Nt),We=fr.top,Lr=fr.width,kr=fr.height,he=Oe!==void 0&&Zt.distance<=ot.hoverdistance&&(wt==="x"||wt==="y");if(he){var Dt=!0,qt,zt;for(qt=0;qt<q.length;qt++)if(Dt&&q[qt].zLabel===void 0&&(Dt=!1),zt=q[qt].hoverinfo||q[qt].trace.hoverinfo,zt){var ut=Array.isArray(zt)?zt:zt.split("+");if(ut.indexOf("all")===-1&&ut.indexOf(wt)===-1){he=!1;break}}Dt&&(he=!1)}var yt=Et.selectAll("g.axistext").data(he?[0]:[]);yt.enter().append("g").classed("axistext",!0),yt.exit().remove();var Mt={minX:0,maxX:0,minY:0,maxY:0};if(yt.each(function(){var on=V.select(this),Bn=E.ensureSingle(on,"path","",function(ta){ta.style({"stroke-width":"1px"})}),ue=E.ensureSingle(on,"text","",function(ta){ta.attr("data-notex",1)}),xe=te.bgcolor||a.defaultLine,Pr=te.bordercolor||a.contrast(xe),Sr=a.contrast(xe),gr=te.font,dr={weight:gr.weight||Wt,style:gr.style||gt,variant:gr.variant||bt,textcase:gr.textcase||vt,lineposition:gr.lineposition||Ut,shadow:gr.shadow||Kt,family:gr.family||Jt,size:gr.size||Qt,color:gr.color||Sr};Bn.style({fill:xe,stroke:Pr}),ue.text(Oe).call(o.font,dr).call(i.positionText,0,0).call(i.convertToTspans,it),on.attr("transform","");var Er=Y(it,ue.node()),Dr,Ar;if(wt==="x"){var Gr=le.side==="top"?"-":"";ue.attr("text-anchor","middle").call(i.positionText,0,le.side==="top"?We-Er.bottom-u-f:We-Er.top+u+f),Dr=le._offset+(Zt.x0+Zt.x1)/2,Ar=Te._offset+(le.side==="top"?0:Te._length);var Wr=Er.width/2+f,Jr=Dr;Dr<Wr?Jr=Wr:Dr>dt.width-Wr&&(Jr=dt.width-Wr),Bn.attr("d","M"+(Dr-Jr)+",0L"+(Dr-Jr+u)+","+Gr+u+"H"+Wr+"v"+Gr+(f*2+Er.height)+"H"+-Wr+"V"+Gr+u+"H"+(Dr-Jr-u)+"Z"),Dr=Jr,Mt.minX=Dr-Wr,Mt.maxX=Dr+Wr,le.side==="top"?(Mt.minY=Ar-(f*2+Er.height),Mt.maxY=Ar-f):(Mt.minY=Ar+f,Mt.maxY=Ar+(f*2+Er.height))}else{var _e,Je,yr;Te.side==="right"?(_e="start",Je=1,yr="",Dr=le._offset+le._length):(_e="end",Je=-1,yr="-",Dr=le._offset),Ar=Te._offset+(Zt.y0+Zt.y1)/2,ue.attr("text-anchor",_e),Bn.attr("d","M0,0L"+yr+u+","+u+"V"+(f+Er.height/2)+"h"+yr+(f*2+Er.width)+"V-"+(f+Er.height/2)+"H"+yr+u+"V-"+u+"Z"),Mt.minY=Ar-(f+Er.height/2),Mt.maxY=Ar+(f+Er.height/2),Te.side==="right"?(Mt.minX=Dr+u,Mt.maxX=Dr+u+(f*2+Er.width)):(Mt.minX=Dr-u-(f*2+Er.width),Mt.maxX=Dr-u);var Hr=Er.height/2,hn=We-Er.top-Hr,En="clip"+dt._uid+"commonlabel"+Te._id,dn;if(Dr<Er.width+2*f+u){dn="M-"+(u+f)+"-"+Hr+"h-"+(Er.width-f)+"V"+Hr+"h"+(Er.width-f)+"Z";var Kr=Er.width-Dr+f;i.positionText(ue,Kr,hn),_e==="end"&&ue.selectAll("tspan").each(function(){var ta=V.select(this),Qn=o.tester.append("text").text(ta.text()).call(o.font,dr),Va=Y(it,Qn.node());Math.round(Va.width)<Math.round(Er.width)&&ta.attr("x",Kr-Va.width),Qn.remove()})}else i.positionText(ue,Je*(f+u),hn),dn=null;var Tn=dt._topclips.selectAll("#"+En).data(dn?[0]:[]);Tn.enter().append("clipPath").attr("id",En).append("path"),Tn.exit().remove(),Tn.select("path").attr("d",dn),o.setClipUrl(ue,dn?En:null,it)}on.attr("transform",t(Dr,Ar))}),p.isUnifiedHover(wt)){Et.selectAll("g.hovertext").remove();var Ot=q.filter(function(on){return on.hoverinfo!=="none"});if(Ot.length===0)return[];var $t=dt.hoverlabel,ee=$t.font,we={showlegend:!0,legend:{title:{text:Oe,font:ee},font:ee,bgcolor:$t.bgcolor,bordercolor:$t.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:dt.legend?dt.legend.traceorder:void 0,orientation:"v"}},Me={font:ee};l(we,Me,it._fullData);var Re=Me.legend;Re.entries=[];for(var Be=0;Be<Ot.length;Be++){var Ze=Ot[Be];if(Ze.hoverinfo!=="none"){var Ue=L(Ze,!0,wt,dt,Oe),mr=Ue[0],ln=Ue[1];Ze.name=ln,ln!==""?Ze.text=ln+" : "+mr:Ze.text=mr;var an=Ze.cd[Ze.index];an&&(an.mc&&(Ze.mc=an.mc),an.mcc&&(Ze.mc=an.mcc),an.mlc&&(Ze.mlc=an.mlc),an.mlcc&&(Ze.mlc=an.mlcc),an.mlw&&(Ze.mlw=an.mlw),an.mrc&&(Ze.mrc=an.mrc),an.dir&&(Ze.dir=an.dir)),Ze._distinct=!0,Re.entries.push([Ze])}}Re.entries.sort(function(on,Bn){return on[0].trace.index-Bn[0].trace.index}),Re.layer=Et,Re._inHover=!0,Re._groupTitleFont=$t.grouptitlefont,x(it,Re);var vn=Et.select("g.legend"),Sn=Y(it,vn.node()),An=Sn.width+2*f,pn=Sn.height+2*f,On=Ot[0],Nn=(On.x0+On.x1)/2,ke=(On.y0+On.y1)/2,ze=!(m.traceIs(On.trace,"bar-like")||m.traceIs(On.trace,"box-violin")),je,Ne;Se==="y"?ze?(Ne=ke-f,je=ke+f):(Ne=Math.min.apply(null,Ot.map(function(on){return Math.min(on.y0,on.y1)})),je=Math.max.apply(null,Ot.map(function(on){return Math.max(on.y0,on.y1)}))):Ne=je=E.mean(Ot.map(function(on){return(on.y0+on.y1)/2}))-pn/2;var _r,Xr;Se==="x"?ze?(_r=Nn+f,Xr=Nn-f):(_r=Math.max.apply(null,Ot.map(function(on){return Math.max(on.x0,on.x1)})),Xr=Math.min.apply(null,Ot.map(function(on){return Math.min(on.x0,on.x1)}))):_r=Xr=E.mean(Ot.map(function(on){return(on.x0+on.x1)/2}))-An/2;var rn=le._offset,Br=Te._offset;je+=Br,_r+=rn,Xr+=rn-An,Ne+=Br-pn;var _n,bn;return _r+An<Lr&&_r>=0?_n=_r:Xr+An<Lr&&Xr>=0?_n=Xr:rn+An<Lr?_n=rn:_r-Nn<Nn-Xr+An?_n=Lr-An:_n=0,_n+=f,je+pn<kr&&je>=0?bn=je:Ne+pn<kr&&Ne>=0?bn=Ne:Br+pn<kr?bn=Br:je-ke<ke-Ne+pn?bn=kr-pn:bn=0,bn+=f,vn.attr("transform",t(_n-1,bn-1)),vn}var Fn=Et.selectAll("g.hovertext").data(q,function(on){return O(on)});return Fn.enter().append("g").classed("hovertext",!0).each(function(){var on=V.select(this);on.append("rect").call(a.fill,a.addOpacity(Ft,.8)),on.append("text").classed("name",!0),on.append("path").style("stroke-width","1px"),on.append("text").classed("nums",!0).call(o.font,{weight:Wt,style:gt,variant:bt,textcase:vt,lineposition:Ut,shadow:Kt,family:Jt,size:Qt})}),Fn.exit().remove(),Fn.each(function(on){var Bn=V.select(this).attr("transform",""),ue=on.color;Array.isArray(ue)&&(ue=ue[on.eventData[0].pointNumber]);var xe=on.bgcolor||ue,Pr=a.combine(a.opacity(xe)?xe:a.defaultLine,Ft),Sr=a.combine(a.opacity(ue)?ue:a.defaultLine,Ft),gr=on.borderColor||a.contrast(Pr),dr=L(on,he,wt,dt,Oe,Bn),Er=dr[0],Dr=dr[1],Ar=Bn.select("text.nums").call(o.font,{family:on.fontFamily||Jt,size:on.fontSize||Qt,color:on.fontColor||gr,weight:on.fontWeight||Wt,style:on.fontStyle||gt,variant:on.fontVariant||bt,textcase:on.fontTextcase||vt,lineposition:on.fontLineposition||Ut,shadow:on.fontShadow||Kt}).text(Er).attr("data-notex",1).call(i.positionText,0,0).call(i.convertToTspans,it),Gr=Bn.select("text.name"),Wr=0,Jr=0;if(Dr&&Dr!==Er){Gr.call(o.font,{family:on.fontFamily||Jt,size:on.fontSize||Qt,color:Sr,weight:on.fontWeight||Wt,style:on.fontStyle||gt,variant:on.fontVariant||bt,textcase:on.fontTextcase||vt,lineposition:on.fontLineposition||Ut,shadow:on.fontShadow||Kt}).text(Dr).attr("data-notex",1).call(i.positionText,0,0).call(i.convertToTspans,it);var _e=Y(it,Gr.node());Wr=_e.width+2*f,Jr=_e.height+2*f}else Gr.remove(),Bn.select("rect").remove();Bn.select("path").style({fill:Pr,stroke:gr});var Je=on.xa._offset+(on.x0+on.x1)/2,yr=on.ya._offset+(on.y0+on.y1)/2,Hr=Math.abs(on.x1-on.x0),hn=Math.abs(on.y1-on.y0),En=Y(it,Ar.node()),dn=En.width/dt._invScaleX,Kr=En.height/dt._invScaleY;on.ty0=(We-En.top)/dt._invScaleY,on.bx=dn+2*f,on.by=Math.max(Kr+2*f,Jr),on.anchor="start",on.txwidth=dn,on.tx2width=Wr,on.offset=0;var Tn=(dn+u+f+Wr)*dt._invScaleX,ta,Qn;if(xt)on.pos=Je,ta=yr+hn/2+Tn<=kr,Qn=yr-hn/2-Tn>=0,(on.idealAlign==="top"||!ta)&&Qn?(yr-=hn/2,on.anchor="end"):ta?(yr+=hn/2,on.anchor="start"):on.anchor="middle",on.crossPos=yr;else{if(on.pos=yr,ta=Je+Hr/2+Tn<=Lr,Qn=Je-Hr/2-Tn>=0,(on.idealAlign==="left"||!ta)&&Qn)Je-=Hr/2,on.anchor="end";else if(ta)Je+=Hr/2,on.anchor="start";else{on.anchor="middle";var Va=Tn/2,ja=Je+Va-Lr,ci=Je-Va;ja>0&&(Je-=ja),ci<0&&(Je+=-ci)}on.crossPos=Je}Ar.attr("text-anchor",on.anchor),Wr&&Gr.attr("text-anchor",on.anchor),Bn.attr("transform",t(Je,yr)+(xt?e(b):""))}),{hoverLabels:Fn,commonLabelBoundingBox:Mt}}function L(q,ot,it,dt,wt,xt){var Ft="",Et="";q.nameOverride!==void 0&&(q.name=q.nameOverride),q.name&&(q.trace._meta&&(q.name=E.templateString(q.name,q.trace._meta)),Ft=Z(q.name,q.nameLength));var Nt=it.charAt(0),te=Nt==="x"?"y":"x";q.zLabel!==void 0?(q.xLabel!==void 0&&(Et+="x: "+q.xLabel+"<br>"),q.yLabel!==void 0&&(Et+="y: "+q.yLabel+"<br>"),q.trace.type!=="choropleth"&&q.trace.type!=="choroplethmapbox"&&q.trace.type!=="choroplethmap"&&(Et+=(Et?"z: ":"")+q.zLabel)):ot&&q[Nt+"Label"]===wt?Et=q[te+"Label"]||"":q.xLabel===void 0?q.yLabel!==void 0&&q.trace.type!=="scattercarpet"&&(Et=q.yLabel):q.yLabel===void 0?Et=q.xLabel:Et="("+q.xLabel+", "+q.yLabel+")",(q.text||q.text===0)&&!Array.isArray(q.text)&&(Et+=(Et?"<br>":"")+q.text),q.extraText!==void 0&&(Et+=(Et?"<br>":"")+q.extraText),xt&&Et===""&&!q.hovertemplate&&(Ft===""&&xt.remove(),Et=Ft);var Jt=q.hovertemplate||!1;if(Jt){var Qt=q.hovertemplateLabels||q;q[Nt+"Label"]!==wt&&(Qt[Nt+"other"]=Qt[Nt+"Val"],Qt[Nt+"otherLabel"]=Qt[Nt+"Label"]),Et=E.hovertemplateString(Jt,Qt,dt._d3locale,q.eventData[0]||{},q.trace._meta),Et=Et.replace(B,function(Wt,gt){return Ft=Z(gt,q.nameLength),""})}return[Et,Ft]}function F(q,ot,it,dt){var wt=ot?"xa":"ya",xt=ot?"ya":"xa",Ft=0,Et=1,Nt=q.size(),te=new Array(Nt),Jt=0,Qt=dt.minX,Wt=dt.maxX,gt=dt.minY,bt=dt.maxY,vt=function(zt){return zt*it._invScaleX},Ut=function(zt){return zt*it._invScaleY};q.each(function(zt){var ut=zt[wt],yt=zt[xt],Mt=ut._id.charAt(0)==="x",Ot=ut.range;Jt===0&&Ot&&Ot[0]>Ot[1]!==Mt&&(Et=-1);var $t=0,ee=Mt?it.width:it.height;if(it.hovermode==="x"||it.hovermode==="y"){var we=N(zt,ot),Me=zt.anchor,Re=Me==="end"?-1:1,Be,Ze;if(Me==="middle")Be=zt.crossPos+(Mt?Ut(we.y-zt.by/2):vt(zt.bx/2+zt.tx2width/2)),Ze=Be+(Mt?Ut(zt.by):vt(zt.bx));else if(Mt)Be=zt.crossPos+Ut(u+we.y)-Ut(zt.by/2-u),Ze=Be+Ut(zt.by);else{var Ue=vt(Re*u+we.x),mr=Ue+vt(Re*zt.bx);Be=zt.crossPos+Math.min(Ue,mr),Ze=zt.crossPos+Math.max(Ue,mr)}Mt?gt!==void 0&&bt!==void 0&&Math.min(Ze,bt)-Math.max(Be,gt)>1&&(yt.side==="left"?($t=yt._mainLinePosition,ee=it.width):ee=yt._mainLinePosition):Qt!==void 0&&Wt!==void 0&&Math.min(Ze,Wt)-Math.max(Be,Qt)>1&&(yt.side==="top"?($t=yt._mainLinePosition,ee=it.height):ee=yt._mainLinePosition)}te[Jt++]=[{datum:zt,traceIndex:zt.trace.index,dp:0,pos:zt.pos,posref:zt.posref,size:zt.by*(Mt?T:1)/2,pmin:$t,pmax:ee}]}),te.sort(function(zt,ut){return zt[0].posref-ut[0].posref||Et*(ut[0].traceIndex-zt[0].traceIndex)});var Kt,Zt,le,Te,Se,Fe,Oe;function ur(zt){var ut=zt[0],yt=zt[zt.length-1];if(Zt=ut.pmin-ut.pos-ut.dp+ut.size,le=yt.pos+yt.dp+yt.size-ut.pmax,Zt>.01){for(Se=zt.length-1;Se>=0;Se--)zt[Se].dp+=Zt;Kt=!1}if(!(le<.01)){if(Zt<-.01){for(Se=zt.length-1;Se>=0;Se--)zt[Se].dp-=le;Kt=!1}if(Kt){var Mt=0;for(Te=0;Te<zt.length;Te++)Fe=zt[Te],Fe.pos+Fe.dp+Fe.size>ut.pmax&&Mt++;for(Te=zt.length-1;Te>=0&&!(Mt<=0);Te--)Fe=zt[Te],Fe.pos>ut.pmax-1&&(Fe.del=!0,Mt--);for(Te=0;Te<zt.length&&!(Mt<=0);Te++)if(Fe=zt[Te],Fe.pos<ut.pmin+1)for(Fe.del=!0,Mt--,le=Fe.size*2,Se=zt.length-1;Se>=0;Se--)zt[Se].dp-=le;for(Te=zt.length-1;Te>=0&&!(Mt<=0);Te--)Fe=zt[Te],Fe.pos+Fe.dp+Fe.size>ut.pmax&&(Fe.del=!0,Mt--)}}}for(;!Kt&&Ft<=Nt;){for(Ft++,Kt=!0,Te=0;Te<te.length-1;){var fr=te[Te],We=te[Te+1],Lr=fr[fr.length-1],kr=We[0];if(Zt=Lr.pos+Lr.dp+Lr.size-kr.pos-kr.dp+kr.size,Zt>.01){for(Se=We.length-1;Se>=0;Se--)We[Se].dp+=Zt;for(fr.push.apply(fr,We),te.splice(Te+1,1),Oe=0,Se=fr.length-1;Se>=0;Se--)Oe+=fr[Se].dp;for(le=Oe/fr.length,Se=fr.length-1;Se>=0;Se--)fr[Se].dp-=le;Kt=!1}else Te++}te.forEach(ur)}for(Te=te.length-1;Te>=0;Te--){var he=te[Te];for(Se=he.length-1;Se>=0;Se--){var Dt=he[Se],qt=Dt.datum;qt.offset=Dt.dp,qt.del=Dt.del}}}function N(q,ot){var it=0,dt=q.offset;return ot&&(dt*=-w,it=q.offset*M),{x:it,y:dt}}function j(q){var ot={start:1,end:-1,middle:0}[q.anchor],it=ot*(u+f),dt=it+ot*(q.txwidth+f),wt=q.anchor==="middle";return wt&&(it-=q.tx2width/2,dt+=q.txwidth/2+f),{alignShift:ot,textShiftX:it,text2ShiftX:dt}}function G(q,ot,it,dt){var wt=function(Ft){return Ft*it},xt=function(Ft){return Ft*dt};q.each(function(Ft){var Et=V.select(this);if(Ft.del)return Et.remove();var Nt=Et.select("text.nums"),te=Ft.anchor,Jt=te==="end"?-1:1,Qt=j(Ft),Wt=N(Ft,ot),gt=Wt.x,bt=Wt.y,vt=te==="middle";Et.select("path").attr("d",vt?"M-"+wt(Ft.bx/2+Ft.tx2width/2)+","+xt(bt-Ft.by/2)+"h"+wt(Ft.bx)+"v"+xt(Ft.by)+"h-"+wt(Ft.bx)+"Z":"M0,0L"+wt(Jt*u+gt)+","+xt(u+bt)+"v"+xt(Ft.by/2-u)+"h"+wt(Jt*Ft.bx)+"v-"+xt(Ft.by)+"H"+wt(Jt*u+gt)+"V"+xt(bt-u)+"Z");var Ut=gt+Qt.textShiftX,Kt=bt+Ft.ty0-Ft.by/2+f,Zt=Ft.textAlign||"auto";Zt!=="auto"&&(Zt==="left"&&te!=="start"?(Nt.attr("text-anchor","start"),Ut=vt?-Ft.bx/2-Ft.tx2width/2+f:-Ft.bx-f):Zt==="right"&&te!=="end"&&(Nt.attr("text-anchor","end"),Ut=vt?Ft.bx/2-Ft.tx2width/2-f:Ft.bx+f)),Nt.call(i.positionText,wt(Ut),xt(Kt)),Ft.tx2width&&(Et.select("text.name").call(i.positionText,wt(Qt.text2ShiftX+Qt.alignShift*f+gt),xt(bt+Ft.ty0-Ft.by/2+f)),Et.select("rect").call(o.setRect,wt(Qt.text2ShiftX+(Qt.alignShift-1)*Ft.tx2width/2+gt),xt(bt-Ft.by/2-1),wt(Ft.tx2width),xt(Ft.by+2)))})}function rt(q,ot){var it=q.index,dt=q.trace||{},wt=q.cd[0],xt=q.cd[it]||{};function Ft(Wt){return Wt||c(Wt)&&Wt===0}var Et=Array.isArray(it)?function(Wt,gt){var bt=E.castOption(wt,it,Wt);return Ft(bt)?bt:E.extractOption({},dt,"",gt)}:function(Wt,gt){return E.extractOption(xt,dt,Wt,gt)};function Nt(Wt,gt,bt){var vt=Et(gt,bt);Ft(vt)&&(q[Wt]=vt)}if(Nt("hoverinfo","hi","hoverinfo"),Nt("bgcolor","hbg","hoverlabel.bgcolor"),Nt("borderColor","hbc","hoverlabel.bordercolor"),Nt("fontFamily","htf","hoverlabel.font.family"),Nt("fontSize","hts","hoverlabel.font.size"),Nt("fontColor","htc","hoverlabel.font.color"),Nt("fontWeight","htw","hoverlabel.font.weight"),Nt("fontStyle","hty","hoverlabel.font.style"),Nt("fontVariant","htv","hoverlabel.font.variant"),Nt("nameLength","hnl","hoverlabel.namelength"),Nt("textAlign","hta","hoverlabel.align"),q.posref=ot==="y"||ot==="closest"&&dt.orientation==="h"?q.xa._offset+(q.x0+q.x1)/2:q.ya._offset+(q.y0+q.y1)/2,q.x0=E.constrain(q.x0,0,q.xa._length),q.x1=E.constrain(q.x1,0,q.xa._length),q.y0=E.constrain(q.y0,0,q.ya._length),q.y1=E.constrain(q.y1,0,q.ya._length),q.xLabelVal!==void 0&&(q.xLabel="xLabel"in q?q.xLabel:h.hoverLabelText(q.xa,q.xLabelVal,dt.xhoverformat),q.xVal=q.xa.c2d(q.xLabelVal)),q.yLabelVal!==void 0&&(q.yLabel="yLabel"in q?q.yLabel:h.hoverLabelText(q.ya,q.yLabelVal,dt.yhoverformat),q.yVal=q.ya.c2d(q.yLabelVal)),q.zLabelVal!==void 0&&q.zLabel===void 0&&(q.zLabel=String(q.zLabelVal)),!isNaN(q.xerr)&&!(q.xa.type==="log"&&q.xerr<=0)){var te=h.tickText(q.xa,q.xa.c2l(q.xerr),"hover").text;q.xerrneg!==void 0?q.xLabel+=" +"+te+" / -"+h.tickText(q.xa,q.xa.c2l(q.xerrneg),"hover").text:q.xLabel+=" ± "+te,ot==="x"&&(q.distance+=1)}if(!isNaN(q.yerr)&&!(q.ya.type==="log"&&q.yerr<=0)){var Jt=h.tickText(q.ya,q.ya.c2l(q.yerr),"hover").text;q.yerrneg!==void 0?q.yLabel+=" +"+Jt+" / -"+h.tickText(q.ya,q.ya.c2l(q.yerrneg),"hover").text:q.yLabel+=" ± "+Jt,ot==="y"&&(q.distance+=1)}var Qt=q.hoverinfo||q.trace.hoverinfo;return Qt&&Qt!=="all"&&(Qt=Array.isArray(Qt)?Qt:Qt.split("+"),Qt.indexOf("x")===-1&&(q.xLabel=void 0),Qt.indexOf("y")===-1&&(q.yLabel=void 0),Qt.indexOf("z")===-1&&(q.zLabel=void 0),Qt.indexOf("text")===-1&&(q.text=void 0),Qt.indexOf("name")===-1&&(q.name=void 0)),q}function ct(q,ot,it){var dt=it.container,wt=it.fullLayout,xt=wt._size,Ft=it.event,Et=!!ot.hLinePoint,Nt=!!ot.vLinePoint,te,Jt;if(dt.selectAll(".spikeline").remove(),!!(Nt||Et)){var Qt=a.combine(wt.plot_bgcolor,wt.paper_bgcolor);if(Et){var Wt=ot.hLinePoint,gt,bt;te=Wt&&Wt.xa,Jt=Wt&&Wt.ya;var vt=Jt.spikesnap;vt==="cursor"?(gt=Ft.pointerX,bt=Ft.pointerY):(gt=te._offset+Wt.x,bt=Jt._offset+Wt.y);var Ut=g.readability(Wt.color,Qt)<1.5?a.contrast(Qt):Wt.color,Kt=Jt.spikemode,Zt=Jt.spikethickness,le=Jt.spikecolor||Ut,Te=h.getPxPosition(q,Jt),Se,Fe;if(Kt.indexOf("toaxis")!==-1||Kt.indexOf("across")!==-1){if(Kt.indexOf("toaxis")!==-1&&(Se=Te,Fe=gt),Kt.indexOf("across")!==-1){var Oe=Jt._counterDomainMin,ur=Jt._counterDomainMax;Jt.anchor==="free"&&(Oe=Math.min(Oe,Jt.position),ur=Math.max(ur,Jt.position)),Se=xt.l+Oe*xt.w,Fe=xt.l+ur*xt.w}dt.insert("line",":first-child").attr({x1:Se,x2:Fe,y1:bt,y2:bt,"stroke-width":Zt,stroke:le,"stroke-dasharray":o.dashStyle(Jt.spikedash,Zt)}).classed("spikeline",!0).classed("crisp",!0),dt.insert("line",":first-child").attr({x1:Se,x2:Fe,y1:bt,y2:bt,"stroke-width":Zt+2,stroke:Qt}).classed("spikeline",!0).classed("crisp",!0)}Kt.indexOf("marker")!==-1&&dt.insert("circle",":first-child").attr({cx:Te+(Jt.side!=="right"?Zt:-Zt),cy:bt,r:Zt,fill:le}).classed("spikeline",!0)}if(Nt){var fr=ot.vLinePoint,We,Lr;te=fr&&fr.xa,Jt=fr&&fr.ya;var kr=te.spikesnap;kr==="cursor"?(We=Ft.pointerX,Lr=Ft.pointerY):(We=te._offset+fr.x,Lr=Jt._offset+fr.y);var he=g.readability(fr.color,Qt)<1.5?a.contrast(Qt):fr.color,Dt=te.spikemode,qt=te.spikethickness,zt=te.spikecolor||he,ut=h.getPxPosition(q,te),yt,Mt;if(Dt.indexOf("toaxis")!==-1||Dt.indexOf("across")!==-1){if(Dt.indexOf("toaxis")!==-1&&(yt=ut,Mt=Lr),Dt.indexOf("across")!==-1){var Ot=te._counterDomainMin,$t=te._counterDomainMax;te.anchor==="free"&&(Ot=Math.min(Ot,te.position),$t=Math.max($t,te.position)),yt=xt.t+(1-$t)*xt.h,Mt=xt.t+(1-Ot)*xt.h}dt.insert("line",":first-child").attr({x1:We,x2:We,y1:yt,y2:Mt,"stroke-width":qt,stroke:zt,"stroke-dasharray":o.dashStyle(te.spikedash,qt)}).classed("spikeline",!0).classed("crisp",!0),dt.insert("line",":first-child").attr({x1:We,x2:We,y1:yt,y2:Mt,"stroke-width":qt+2,stroke:Qt}).classed("spikeline",!0).classed("crisp",!0)}Dt.indexOf("marker")!==-1&&dt.insert("circle",":first-child").attr({cx:We,cy:ut-(te.side!=="top"?qt:-qt),r:qt,fill:zt}).classed("spikeline",!0)}}}function lt(q,ot,it){if(!it||it.length!==q._hoverdata.length)return!0;for(var dt=it.length-1;dt>=0;dt--){var wt=it[dt],xt=q._hoverdata[dt];if(wt.curveNumber!==xt.curveNumber||String(wt.pointNumber)!==String(xt.pointNumber)||String(wt.pointNumbers)!==String(xt.pointNumbers))return!0}return!1}function tt(q,ot){return!ot}function Z(q,ot){return i.plainText(q||"",{len:ot,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function st(q,ot){for(var it=ot.charAt(0),dt=[],wt=[],xt=[],Ft=0;Ft<q.length;Ft++){var Et=q[Ft];m.traceIs(Et.trace,"bar-like")||m.traceIs(Et.trace,"box-violin")?xt.push(Et):Et.trace[it+"period"]?wt.push(Et):dt.push(Et)}return dt.concat(wt).concat(xt)}function $(q,ot,it){var dt=ot[q+"a"],wt=ot[q+"Val"],xt=ot.cd[0];if(dt.type==="category"||dt.type==="multicategory")wt=dt._categoriesMap[wt];else if(dt.type==="date"){var Ft=ot.trace[q+"periodalignment"];if(Ft){var Et=ot.cd[ot.index],Nt=Et[q+"Start"];Nt===void 0&&(Nt=Et[q]);var te=Et[q+"End"];te===void 0&&(te=Et[q]);var Jt=te-Nt;Ft==="end"?wt+=Jt:Ft==="middle"&&(wt+=Jt/2)}wt=dt.d2c(wt)}return xt&&xt.t&&xt.t.posLetter===dt._id&&(it.boxmode==="group"||it.violinmode==="group")&&(wt+=xt.t.dPos),wt}function Q(q){return q.offsetTop+q.clientTop}function nt(q){return q.offsetLeft+q.clientLeft}function Y(q,ot){var it=q._fullLayout,dt=ot.getBoundingClientRect(),wt=dt.left,xt=dt.top,Ft=wt+dt.width,Et=xt+dt.height,Nt=E.apply3DTransform(it._invTransform)(wt,xt),te=E.apply3DTransform(it._invTransform)(Ft,Et),Jt=Nt[0],Qt=Nt[1],Wt=te[0],gt=te[1];return{x:Jt,y:Qt,width:Wt-Jt,height:gt-Qt,top:Math.min(Qt,gt),left:Math.min(Jt,Wt),right:Math.max(Jt,Wt),bottom:Math.max(Qt,gt)}}}),Fm=Vt((X,V)=>{var c=qr(),g=vi(),E=vf().isUnifiedHover;V.exports=function(A,t,e,r){r=r||{};var i=t.legend;function n(o){r.font[o]||(r.font[o]=i?t.legend.font[o]:t.font[o])}t&&E(t.hovermode)&&(r.font||(r.font={}),n("size"),n("family"),n("color"),n("weight"),n("style"),n("variant"),i?(r.bgcolor||(r.bgcolor=g.combine(t.legend.bgcolor,t.paper_bgcolor)),r.bordercolor||(r.bordercolor=t.legend.bordercolor)):r.bgcolor||(r.bgcolor=t.paper_bgcolor)),e("hoverlabel.bgcolor",r.bgcolor),e("hoverlabel.bordercolor",r.bordercolor),e("hoverlabel.namelength",r.namelength),c.coerceFont(e,"hoverlabel.font",r.font),e("hoverlabel.align",r.align)}}),Uk=Vt((X,V)=>{var c=qr(),g=Fm(),E=_d();V.exports=function(A,t){function e(r,i){return c.coerce(A,t,E,r,i)}g(A,t,e)}}),Vk=Vt((X,V)=>{var c=qr(),g=dg(),E=Fm();V.exports=function(A,t,e,r){function i(o,a){return c.coerce(A,t,g,o,a)}var n=c.extendFlat({},r.hoverlabel);t.hovertemplate&&(n.namelength=-1),E(A,t,i,n)}}),db=Vt((X,V)=>{var c=qr(),g=_d();V.exports=function(E,A){function t(e,r){return A[e]!==void 0?A[e]:c.coerce(E,A,g,e,r)}return t("clickmode"),t("hoversubplots"),t("hovermode")}}),qk=Vt((X,V)=>{var c=qr(),g=_d(),E=db(),A=Fm();V.exports=function(t,e){function r(v,m){return c.coerce(t,e,g,v,m)}var i=E(t,e);i&&(r("hoverdistance"),r("spikedistance"));var n=r("dragmode");n==="select"&&r("selectdirection");var o=e._has("mapbox"),a=e._has("map"),s=e._has("geo"),h=e._basePlotModules.length;e.dragmode==="zoom"&&((o||a||s)&&h===1||(o||a)&&s&&h===2)&&(e.dragmode="pan"),A(t,e,r),c.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}}),Hk=Vt((X,V)=>{var c=qr(),g=Mi();V.exports=function(A){var t=A.calcdata,e=A._fullLayout;function r(s){return function(h){return c.coerceHoverinfo({hoverinfo:h},{_module:s._module},e)}}for(var i=0;i<t.length;i++){var n=t[i],o=n[0].trace;if(!g.traceIs(o,"pie-like")){var a=g.traceIs(o,"2dMap")?E:c.fillArray;a(o.hoverinfo,n,"hi",r(o)),o.hovertemplate&&a(o.hovertemplate,n,"ht"),o.hoverlabel&&(a(o.hoverlabel.bgcolor,n,"hbg"),a(o.hoverlabel.bordercolor,n,"hbc"),a(o.hoverlabel.font.size,n,"hts"),a(o.hoverlabel.font.color,n,"htc"),a(o.hoverlabel.font.family,n,"htf"),a(o.hoverlabel.font.weight,n,"htw"),a(o.hoverlabel.font.style,n,"hty"),a(o.hoverlabel.font.variant,n,"htv"),a(o.hoverlabel.namelength,n,"hnl"),a(o.hoverlabel.align,n,"hta"))}}};function E(A,t,e,r){r=r||c.identity,Array.isArray(A)&&(t[0][e]=r(A))}}),Gk=Vt((X,V)=>{var c=Mi(),g=pb().hover;V.exports=function(E,A,t){var e=c.getComponentMethod("annotations","onClick")(E,E._hoverdata);t!==void 0&&g(E,A,t,!0);function r(){E.emit("plotly_click",{points:E._hoverdata,event:A})}E._hoverdata&&A&&A.target&&(e&&e.then?e.then(r):r(),A.stopImmediatePropagation&&A.stopImmediatePropagation())}}),Hu=Vt((X,V)=>{var c=Ai(),g=qr(),E=af(),A=vf(),t=_d(),e=pb();V.exports={moduleType:"component",name:"fx",constants:Lm(),schema:{layout:t},attributes:dg(),layoutAttributes:t,supplyLayoutGlobalDefaults:Uk(),supplyDefaults:Vk(),supplyLayoutDefaults:qk(),calc:Hk(),getDistanceFunction:A.getDistanceFunction,getClosest:A.getClosest,inbox:A.inbox,quadrature:A.quadrature,appendArrayPointValue:A.appendArrayPointValue,castHoverOption:i,castHoverinfo:n,hover:e.hover,unhover:E.unhover,loneHover:e.loneHover,loneUnhover:r,click:Gk()};function r(o){var a=g.isD3Selection(o)?o:c.select(o);a.selectAll("g.hovertext").remove(),a.selectAll(".spikeline").remove()}function i(o,a,s){return g.castOption(o,a,"hoverlabel."+s)}function n(o,a,s){function h(v){return g.coerceHoverinfo({hoverinfo:v},{_module:o._module},a)}return g.castOption(o,s,"hoverinfo",h)}}),ep=Vt(X=>{X.selectMode=function(V){return V==="lasso"||V==="select"},X.drawMode=function(V){return V==="drawclosedpath"||V==="drawopenpath"||V==="drawline"||V==="drawrect"||V==="drawcircle"},X.openMode=function(V){return V==="drawline"||V==="drawopenpath"},X.rectMode=function(V){return V==="select"||V==="drawline"||V==="drawrect"||V==="drawcircle"},X.freeMode=function(V){return V==="lasso"||V==="drawclosedpath"||V==="drawopenpath"},X.selectingOrDrawing=function(V){return X.freeMode(V)||X.rectMode(V)}}),Bm=Vt((X,V)=>{V.exports=function(c){var g=c._fullLayout;g._glcanvas&&g._glcanvas.size()&&g._glcanvas.each(function(E){E.regl&&E.regl.clear({color:!0,depth:!0})})}}),Vy=Vt((X,V)=>{V.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:["<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'>"," <title>plotly-logomark</title>"," <g id='symbol'>"," <rect fill='#000' x='0' y='0' width='132' height='132' rx='18' ry='18'/>"," <circle fill='#9EF' cx='102' cy='30' r='6'/>"," <circle fill='#BAC' cx='78' cy='30' r='6'/>"," <circle fill='#BAC' cx='78' cy='54' r='6'/>"," <circle fill='#D69' cx='54' cy='30' r='6'/>"," <circle fill='#F26' cx='30' cy='30' r='6'/>"," <circle fill='#F26' cx='30' cy='54' r='6'/>"," <path fill='#FFF' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/>"," <path fill='#FFF' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/>"," <path fill='#FFF' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/>"," <path fill='#FFF' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/>"," </g>","</svg>"].join("")}}}),qy=Vt((X,V)=>{var c=32;V.exports={CIRCLE_SIDES:c,i000:0,i090:c/4,i180:c/2,i270:c/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}),Hy=Vt((X,V)=>{var c=qr().strTranslate;function g(e,r){switch(e.type){case"log":return e.p2d(r);case"date":return e.p2r(r,0,e.calendar);default:return e.p2r(r)}}function E(e,r){switch(e.type){case"log":return e.d2p(r);case"date":return e.r2p(r,0,e.calendar);default:return e.r2p(r)}}function A(e){var r=e._id.charAt(0)==="y"?1:0;return function(i){return g(e,i[r])}}function t(e){return c(e.xaxis._offset,e.yaxis._offset)}V.exports={p2r:g,r2p:E,axValue:A,getTransform:t}}),Ed=Vt(X=>{var V=Om(),c=qy(),g=c.CIRCLE_SIDES,E=c.SQRT2,A=Hy(),t=A.p2r,e=A.r2p,r=[0,3,4,5,6,1,2],i=[0,3,4,1,2];X.writePaths=function(a){var s=a.length;if(!s)return"M0,0Z";for(var h="",v=0;v<s;v++)for(var m=a[v].length,p=0;p<m;p++){var y=a[v][p][0];if(y==="Z")h+="Z";else for(var l=a[v][p].length,x=0;x<l;x++){var b=x;y==="Q"||y==="S"?b=i[x]:y==="C"&&(b=r[x]),h+=a[v][p][b],x>0&&x<l-1&&(h+=",")}}return h},X.readPaths=function(a,s,h,v){var m=V(a),p=[],y=-1,l=function(){y++,p[y]=[]},x,b=0,S=0,T,M,w=function(){T=b,M=S};w();for(var u=0;u<m.length;u++){var f=[],k,_,D,I,O=m[u][0],B=O;switch(O){case"M":l(),b=+m[u][1],S=+m[u][2],f.push([B,b,S]),w();break;case"Q":case"S":k=+m[u][1],D=+m[u][2],b=+m[u][3],S=+m[u][4],f.push([B,b,S,k,D]);break;case"C":k=+m[u][1],D=+m[u][2],_=+m[u][3],I=+m[u][4],b=+m[u][5],S=+m[u][6],f.push([B,b,S,k,D,_,I]);break;case"T":case"L":b=+m[u][1],S=+m[u][2],f.push([B,b,S]);break;case"H":B="L",b=+m[u][1],f.push([B,b,S]);break;case"V":B="L",S=+m[u][1],f.push([B,b,S]);break;case"A":B="L";var R=+m[u][1],L=+m[u][2];+m[u][4]||(R=-R,L=-L);var F=b-R,N=S;for(x=1;x<=g/2;x++){var j=2*Math.PI*x/g;f.push([B,F+R*Math.cos(j),N+L*Math.sin(j)])}break;case"Z":(b!==T||S!==M)&&(b=T,S=M,f.push([B,b,S]));break}for(var G=(h||{}).domain,rt=s._fullLayout._size,ct=h&&h.xsizemode==="pixel",lt=h&&h.ysizemode==="pixel",tt=v===!1,Z=0;Z<f.length;Z++){for(x=0;x+2<7;x+=2){var st=f[Z][x+1],$=f[Z][x+2];st===void 0||$===void 0||(b=st,S=$,h&&(h.xaxis&&h.xaxis.p2r?(tt&&(st-=h.xaxis._offset),ct?st=e(h.xaxis,h.xanchor)+st:st=t(h.xaxis,st)):(tt&&(st-=rt.l),G?st=G.x[0]+st/rt.w:st=st/rt.w),h.yaxis&&h.yaxis.p2r?(tt&&($-=h.yaxis._offset),lt?$=e(h.yaxis,h.yanchor)-$:$=t(h.yaxis,$)):(tt&&($-=rt.t),G?$=G.y[1]-$/rt.h:$=1-$/rt.h)),f[Z][x+1]=st,f[Z][x+2]=$)}p[y].push(f[Z].slice())}}return p};function n(a,s){return Math.abs(a-s)<=1e-6}function o(a,s){var h=s[1]-a[1],v=s[2]-a[2];return Math.sqrt(h*h+v*v)}X.pointsOnRectangle=function(a){var s=a.length;if(s!==5)return!1;for(var h=1;h<3;h++){var v=a[0][h]-a[1][h],m=a[3][h]-a[2][h];if(!n(v,m))return!1;var p=a[0][h]-a[3][h],y=a[1][h]-a[2][h];if(!n(p,y))return!1}return!n(a[0][1],a[1][1])&&!n(a[0][1],a[3][1])?!1:!!(o(a[0],a[1])*o(a[0],a[3]))},X.pointsOnEllipse=function(a){var s=a.length;if(s!==g+1)return!1;s=g;for(var h=0;h<s;h++){var v=(s*2-h)%s,m=(s/2+v)%s,p=(s/2+h)%s;if(!n(o(a[h],a[p]),o(a[v],a[m])))return!1}return!0},X.handleEllipse=function(a,s,h){if(!a)return[s,h];var v=X.ellipseOver({x0:s[0],y0:s[1],x1:h[0],y1:h[1]}),m=(v.x1+v.x0)/2,p=(v.y1+v.y0)/2,y=(v.x1-v.x0)/2,l=(v.y1-v.y0)/2;y||(y=l=l/E),l||(l=y=y/E);for(var x=[],b=0;b<g;b++){var S=b*2*Math.PI/g;x.push([m+y*Math.cos(S),p+l*Math.sin(S)])}return x},X.ellipseOver=function(a){var s=a.x0,h=a.y0,v=a.x1,m=a.y1,p=v-s,y=m-h;s-=p,h-=y;var l=(s+v)/2,x=(h+m)/2,b=E;return p*=b,y*=b,{x0:l-p,y0:x-y,x1:l+p,y1:x+y}},X.fixDatesForPaths=function(a,s,h){var v=s.type==="date",m=h.type==="date";if(!v&&!m)return a;for(var p=0;p<a.length;p++)for(var y=0;y<a[p].length;y++)for(var l=0;l+2<a[p][y].length;l+=2)v&&(a[p][y][l+1]=a[p][y][l+1].replace(" ","_")),m&&(a[p][y][l+2]=a[p][y][l+2].replace(" ","_"));return a}}),Gy=Vt((X,V)=>{var c=ep(),g=c.drawMode,E=c.openMode,A=qy(),t=A.i000,e=A.i090,r=A.i180,i=A.i270,n=A.cos45,o=A.sin45,a=Hy(),s=a.p2r,h=a.r2p,v=kd(),m=v.clearOutline,p=Ed(),y=p.readPaths,l=p.writePaths,x=p.ellipseOver,b=p.fixDatesForPaths;function S(M,w){if(M.length){var u=M[0][0];if(u){var f=w.gd,k=w.isActiveShape,_=w.dragmode,D=(f.layout||{}).shapes||[];if(!g(_)&&k!==void 0){var I=f._fullLayout._activeShapeIndex;if(I<D.length)switch(f._fullLayout.shapes[I].type){case"rect":_="drawrect";break;case"circle":_="drawcircle";break;case"line":_="drawline";break;case"path":var O=D[I].path||"";O[O.length-1]==="Z"?_="drawclosedpath":_="drawopenpath";break}}var B=T(M,w,_);m(f);for(var R=w.editHelpers,L=(R||{}).modifyItem,F=[],N=0;N<D.length;N++){var j=f._fullLayout.shapes[N];if(F[N]=j._input,k!==void 0&&N===f._fullLayout._activeShapeIndex){var G=B;switch(j.type){case"line":case"rect":case"circle":L("x0",G.x0-(j.x0shift||0)),L("x1",G.x1-(j.x1shift||0)),L("y0",G.y0-(j.y0shift||0)),L("y1",G.y1-(j.y1shift||0));break;case"path":L("path",G.path);break}}}return k===void 0?(F.push(B),F):R?R.getUpdateObj():{}}}}function T(M,w,u){var f=M[0][0],k=w.gd,_=f.getAttribute("d"),D=k._fullLayout.newshape,I=w.plotinfo,O=w.isActiveShape,B=I.xaxis,R=I.yaxis,L=!!I.domain||!I.xaxis,F=!!I.domain||!I.yaxis,N=E(u),j=y(_,k,I,O),G={editable:!0,visible:D.visible,name:D.name,showlegend:D.showlegend,legend:D.legend,legendwidth:D.legendwidth,legendgroup:D.legendgroup,legendgrouptitle:{text:D.legendgrouptitle.text,font:D.legendgrouptitle.font},legendrank:D.legendrank,label:D.label,xref:L?"paper":B._id,yref:F?"paper":R._id,layer:D.layer,opacity:D.opacity,line:{color:D.line.color,width:D.line.width,dash:D.line.dash}};N||(G.fillcolor=D.fillcolor,G.fillrule=D.fillrule);var rt;if(j.length===1&&(rt=j[0]),rt&&rt.length===5&&u==="drawrect")G.type="rect",G.x0=rt[0][1],G.y0=rt[0][2],G.x1=rt[2][1],G.y1=rt[2][2];else if(rt&&u==="drawline")G.type="line",G.x0=rt[0][1],G.y0=rt[0][2],G.x1=rt[1][1],G.y1=rt[1][2];else if(rt&&u==="drawcircle"){G.type="circle";var ct=rt[t][1],lt=rt[e][1],tt=rt[r][1],Z=rt[i][1],st=rt[t][2],$=rt[e][2],Q=rt[r][2],nt=rt[i][2],Y=I.xaxis&&(I.xaxis.type==="date"||I.xaxis.type==="log"),q=I.yaxis&&(I.yaxis.type==="date"||I.yaxis.type==="log");Y&&(ct=h(I.xaxis,ct),lt=h(I.xaxis,lt),tt=h(I.xaxis,tt),Z=h(I.xaxis,Z)),q&&(st=h(I.yaxis,st),$=h(I.yaxis,$),Q=h(I.yaxis,Q),nt=h(I.yaxis,nt));var ot=(lt+Z)/2,it=(st+Q)/2,dt=(Z-lt+tt-ct)/2,wt=(nt-$+Q-st)/2,xt=x({x0:ot,y0:it,x1:ot+dt*n,y1:it+wt*o});Y&&(xt.x0=s(I.xaxis,xt.x0),xt.x1=s(I.xaxis,xt.x1)),q&&(xt.y0=s(I.yaxis,xt.y0),xt.y1=s(I.yaxis,xt.y1)),G.x0=xt.x0,G.y0=xt.y0,G.x1=xt.x1,G.y1=xt.y1}else G.type="path",B&&R&&b(j,B,R),G.path=l(j),rt=null;return G}V.exports={newShapes:S,createShapeObj:T}}),gb=Vt((X,V)=>{var c=ep(),g=c.selectMode,E=kd(),A=E.clearOutline,t=Ed(),e=t.readPaths,r=t.writePaths,i=t.fixDatesForPaths;V.exports=function(n,o){if(n.length){var a=n[0][0];if(a){var s=a.getAttribute("d"),h=o.gd,v=h._fullLayout.newselection,m=o.plotinfo,p=m.xaxis,y=m.yaxis,l=o.isActiveSelection,x=o.dragmode,b=(h.layout||{}).selections||[];if(!g(x)&&l!==void 0){var S=h._fullLayout._activeSelectionIndex;if(S<b.length)switch(h._fullLayout.selections[S].type){case"rect":x="select";break;case"path":x="lasso";break}}var T=e(s,h,m,l),M={xref:p._id,yref:y._id,opacity:v.opacity,line:{color:v.line.color,width:v.line.width,dash:v.line.dash}},w;T.length===1&&(w=T[0]),w&&w.length===5&&x==="select"?(M.type="rect",M.x0=w[0][1],M.y0=w[0][2],M.x1=w[2][1],M.y1=w[2][2]):(M.type="path",p&&y&&i(T,p,y),M.path=r(T),w=null),A(h);for(var u=o.editHelpers,f=(u||{}).modifyItem,k=[],_=0;_<b.length;_++){var D=h._fullLayout.selections[_];if(!D){k[_]=D;continue}if(k[_]=D._input,l!==void 0&&_===h._fullLayout._activeSelectionIndex){var I=M;switch(D.type){case"rect":f("x0",I.x0),f("x1",I.x1),f("y0",I.y0),f("y1",I.y1);break;case"path":f("path",I.path);break}}}return l===void 0?(k.push(M),k):u?u.getUpdateObj():{}}}}}),Rm=Vt((X,V)=>{V.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}}),Pd=Vt(X=>{var V=Rm(),c=qr(),g=ao();X.rangeToShapePosition=function(t){return t.type==="log"?t.r2d:function(e){return e}},X.shapePositionToRange=function(t){return t.type==="log"?t.d2r:function(e){return e}},X.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},X.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},X.extractPathCoords=function(t,e,r){var i=[],n=t.match(V.segmentRE);return n.forEach(function(o){var a=e[o.charAt(0)].drawn;if(a!==void 0){var s=o.substr(1).match(V.paramRE);if(!(!s||s.length<a)){var h=s[a],v=r?h:c.cleanNumber(h);i.push(v)}}}),i},X.getDataToPixel=function(t,e,r,i,n){var o=t._fullLayout._size,a;if(e)if(n==="domain")a=function(h){return e._length*(i?1-h:h)+e._offset};else{var s=X.shapePositionToRange(e);a=function(h){var v=A(e,r);return e._offset+e.r2p(s(h,!0))+v},e.type==="date"&&(a=X.decodeDate(a))}else i?a=function(h){return o.t+o.h*(1-h)}:a=function(h){return o.l+o.w*h};return a},X.getPixelToData=function(t,e,r,i){var n=t._fullLayout._size,o;if(e)if(i==="domain")o=function(s){var h=(s-e._offset)/e._length;return r?1-h:h};else{var a=X.rangeToShapePosition(e);o=function(s){return a(e.p2r(s-e._offset))}}else r?o=function(s){return 1-(s-n.t)/n.h}:o=function(s){return(s-n.l)/n.w};return o},X.roundPositionForSharpStrokeRendering=function(t,e){var r=Math.round(e%2)===1,i=Math.round(t);return r?i+.5:i},X.makeShapesOptionsAndPlotinfo=function(t,e){var r=t._fullLayout.shapes[e]||{},i=t._fullLayout._plots[r.xref+r.yref],n=!!i;return n?i._hadPlotinfo=!0:(i={},r.xref&&r.xref!=="paper"&&(i.xaxis=t._fullLayout[r.xref+"axis"]),r.yref&&r.yref!=="paper"&&(i.yaxis=t._fullLayout[r.yref+"axis"])),i.xsizemode=r.xsizemode,i.ysizemode=r.ysizemode,i.xanchor=r.xanchor,i.yanchor=r.yanchor,{options:r,plotinfo:i}},X.makeSelectionsOptionsAndPlotinfo=function(t,e){var r=t._fullLayout.selections[e]||{},i=t._fullLayout._plots[r.xref+r.yref],n=!!i;return n?i._hadPlotinfo=!0:(i={},r.xref&&(i.xaxis=t._fullLayout[r.xref+"axis"]),r.yref&&(i.yaxis=t._fullLayout[r.yref+"axis"])),{options:r,plotinfo:i}},X.getPathString=function(t,e){var r=e.type,i=g.getRefType(e.xref),n=g.getRefType(e.yref),o=g.getFromId(t,e.xref),a=g.getFromId(t,e.yref),s=t._fullLayout._size,h,v,m,p,y=A(o,e.x0shift),l=A(o,e.x1shift),x=A(a,e.y0shift),b=A(a,e.y1shift),S,T,M,w;if(o?i==="domain"?v=function(L){return o._offset+o._length*L}:(h=X.shapePositionToRange(o),v=function(L){return o._offset+o.r2p(h(L,!0))}):v=function(L){return s.l+s.w*L},a?n==="domain"?p=function(L){return a._offset+a._length*(1-L)}:(m=X.shapePositionToRange(a),p=function(L){return a._offset+a.r2p(m(L,!0))}):p=function(L){return s.t+s.h*(1-L)},r==="path")return o&&o.type==="date"&&(v=X.decodeDate(v)),a&&a.type==="date"&&(p=X.decodeDate(p)),E(e,v,p);if(e.xsizemode==="pixel"){var u=v(e.xanchor);S=u+e.x0+y,T=u+e.x1+l}else S=v(e.x0)+y,T=v(e.x1)+l;if(e.ysizemode==="pixel"){var f=p(e.yanchor);M=f-e.y0+x,w=f-e.y1+b}else M=p(e.y0)+x,w=p(e.y1)+b;if(r==="line")return"M"+S+","+M+"L"+T+","+w;if(r==="rect")return"M"+S+","+M+"H"+T+"V"+w+"H"+S+"Z";var k=(S+T)/2,_=(M+w)/2,D=Math.abs(k-S),I=Math.abs(_-M),O="A"+D+","+I,B=k+D+","+_,R=k+","+(_-I);return"M"+B+O+" 0 1,1 "+R+O+" 0 0,1 "+B+"Z"};function E(t,e,r){var i=t.path,n=t.xsizemode,o=t.ysizemode,a=t.xanchor,s=t.yanchor;return i.replace(V.segmentRE,function(h){var v=0,m=h.charAt(0),p=V.paramIsX[m],y=V.paramIsY[m],l=V.numParams[m],x=h.substr(1).replace(V.paramRE,function(b){return p[v]?n==="pixel"?b=e(a)+Number(b):b=e(b):y[v]&&(o==="pixel"?b=r(s)-Number(b):b=r(b)),v++,v>l&&(b="X"),b});return v>l&&(x=x.replace(/[\s,]*X.*/,""),c.log("Ignoring extra params in segment "+h)),m+x})}function A(t,e){e=e||0;var r=0;return e&&t&&(t.type==="category"||t.type==="multicategory")&&(r=(t.r2p(1)-t.r2p(0))*e),r}}),mb=Vt((X,V)=>{var c=qr(),g=ao(),E=sl(),A=go(),t=Ed().readPaths,e=Pd(),r=e.getPathString,i=zy(),n=nh().FROM_TL;V.exports=function(s,h,v,m){if(m.selectAll(".shape-label").remove(),!!(v.label.text||v.label.texttemplate)){var p;if(v.label.texttemplate){var y={};if(v.type!=="path"){var l=g.getFromId(s,v.xref),x=g.getFromId(s,v.yref);for(var b in i){var S=i[b](v,l,x);S!==void 0&&(y[b]=S)}}p=c.texttemplateStringForShapes(v.label.texttemplate,{},s._fullLayout._d3locale,y)}else p=v.label.text;var T={"data-index":h},M=v.label.font,w={"data-notex":1},u=m.append("g").attr(T).classed("shape-label",!0),f=u.append("text").attr(w).classed("shape-label-text",!0).text(p),k,_,D,I;if(v.path){var O=r(s,v),B=t(O,s);k=1/0,D=1/0,_=-1/0,I=-1/0;for(var R=0;R<B.length;R++)for(var L=0;L<B[R].length;L++)for(var F=B[R][L],N=1;N<F.length;N+=2){var j=F[N],G=F[N+1];k=Math.min(k,j),_=Math.max(_,j),D=Math.min(D,G),I=Math.max(I,G)}}else{var rt=g.getFromId(s,v.xref),ct=v.x0shift,lt=v.x1shift,tt=g.getRefType(v.xref),Z=g.getFromId(s,v.yref),st=v.y0shift,$=v.y1shift,Q=g.getRefType(v.yref),nt=function(Ft,Et){var Nt=e.getDataToPixel(s,rt,Et,!1,tt);return Nt(Ft)},Y=function(Ft,Et){var Nt=e.getDataToPixel(s,Z,Et,!0,Q);return Nt(Ft)};k=nt(v.x0,ct),_=nt(v.x1,lt),D=Y(v.y0,st),I=Y(v.y1,$)}var q=v.label.textangle;q==="auto"&&(v.type==="line"?q=o(k,D,_,I):q=0),f.call(function(Ft){return Ft.call(A.font,M).attr({}),E.convertToTspans(Ft,s),Ft});var ot=A.bBox(f.node()),it=a(k,D,_,I,v,q,ot),dt=it.textx,wt=it.texty,xt=it.xanchor;f.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[xt],y:wt,x:dt,transform:"rotate("+q+","+dt+","+wt+")"}).call(E.positionText,dt,wt)}};function o(s,h,v,m){var p,y;return y=Math.abs(v-s),v>=s?p=h-m:p=m-h,-180/Math.PI*Math.atan2(p,y)}function a(s,h,v,m,p,y,l){var x=p.label.textposition,b=p.label.textangle,S=p.label.padding,T=p.type,M=Math.PI/180*y,w=Math.sin(M),u=Math.cos(M),f=p.label.xanchor,k=p.label.yanchor,_,D,I,O;if(T==="line"){x==="start"?(_=s,D=h):x==="end"?(_=v,D=m):(_=(s+v)/2,D=(h+m)/2),f==="auto"&&(x==="start"?b==="auto"?v>s?f="left":v<s?f="right":f="center":v>s?f="right":v<s?f="left":f="center":x==="end"?b==="auto"?v>s?f="right":v<s?f="left":f="center":v>s?f="left":v<s?f="right":f="center":f="center");var B={left:1,center:0,right:-1},R={bottom:-1,middle:0,top:1};if(b==="auto"){var L=R[k];I=-S*w*L,O=S*u*L}else{var F=B[f],N=R[k];I=S*F,O=S*N}_=_+I,D=D+O}else I=S+3,x.indexOf("right")!==-1?(_=Math.max(s,v)-I,f==="auto"&&(f="right")):x.indexOf("left")!==-1?(_=Math.min(s,v)+I,f==="auto"&&(f="left")):(_=(s+v)/2,f==="auto"&&(f="center")),x.indexOf("top")!==-1?D=Math.min(h,m):x.indexOf("bottom")!==-1?D=Math.max(h,m):D=(h+m)/2,O=S,k==="bottom"?D=D-O:k==="top"&&(D=D+O);var j=n[k],G=p.label.font.size,rt=l.height,ct=(rt*j-G)*w,lt=-(rt*j-G)*u;return{textx:_+ct,texty:D+lt,xanchor:f}}}),Wy=Vt((X,V)=>{var c=qr(),g=c.strTranslate,E=af(),A=ep(),t=A.drawMode,e=A.selectMode,r=Mi(),i=vi(),n=qy(),o=n.i000,a=n.i090,s=n.i180,h=n.i270,v=kd(),m=v.clearOutlineControllers,p=Ed(),y=p.pointsOnRectangle,l=p.pointsOnEllipse,x=p.writePaths,b=Gy().newShapes,S=Gy().createShapeObj,T=gb(),M=mb();V.exports=function k(_,D,I,O){O||(O=0);var B=I.gd;function R(){k(_,D,I,O++),(l(_[0])||I.hasText)&&L({redrawing:!0})}function L(Qt){var Wt={};I.isActiveShape!==void 0&&(I.isActiveShape=!1,Wt=b(D,I)),I.isActiveSelection!==void 0&&(I.isActiveSelection=!1,Wt=T(D,I),B._fullLayout._reselect=!0),Object.keys(Wt).length&&r.call((Qt||{}).redrawing?"relayout":"_guiRelayout",B,Wt)}var F=B._fullLayout,N=F._zoomlayer,j=I.dragmode,G=t(j),rt=e(j);(G||rt)&&(B._fullLayout._outlining=!0),m(B),D.attr("d",x(_));var ct,lt,tt,Z,st;if(!O&&(I.isActiveShape||I.isActiveSelection)){st=w([],_);var $=N.append("g").attr("class","outline-controllers");wt($),Jt()}if(G&&I.hasText){var Q=N.select(".label-temp"),nt=S(D,I,I.dragmode);M(B,"label-temp",nt,Q)}function Y(Qt){tt=+Qt.srcElement.getAttribute("data-i"),Z=+Qt.srcElement.getAttribute("data-j"),ct[tt][Z].moveFn=q}function q(Qt,Wt){if(_.length){var gt=st[tt][Z][1],bt=st[tt][Z][2],vt=_[tt],Ut=vt.length;if(y(vt)){var Kt=Qt,Zt=Wt;if(I.isActiveSelection){var le=u(vt,Z);le[1]===vt[Z][1]?Zt=0:Kt=0}for(var Te=0;Te<Ut;Te++)if(Te!==Z){var Se=vt[Te];Se[1]===vt[Z][1]&&(Se[1]=gt+Kt),Se[2]===vt[Z][2]&&(Se[2]=bt+Zt)}if(vt[Z][1]=gt+Kt,vt[Z][2]=bt+Zt,!y(vt))for(var Fe=0;Fe<Ut;Fe++)for(var Oe=0;Oe<vt[Fe].length;Oe++)vt[Fe][Oe]=st[tt][Fe][Oe]}else vt[Z][1]=gt+Qt,vt[Z][2]=bt+Wt;R()}}function ot(){L()}function it(){if(_.length&&_[tt]&&_[tt].length){for(var Qt=[],Wt=0;Wt<_[tt].length;Wt++)Wt!==Z&&Qt.push(_[tt][Wt]);Qt.length>1&&!(Qt.length===2&&Qt[1][0]==="Z")&&(Z===0&&(Qt[0][0]="M"),_[tt]=Qt,R(),L())}}function dt(Qt,Wt){if(Qt===2){tt=+Wt.srcElement.getAttribute("data-i"),Z=+Wt.srcElement.getAttribute("data-j");var gt=_[tt];!y(gt)&&!l(gt)&&it()}}function wt(Qt){ct=[];for(var Wt=0;Wt<_.length;Wt++){var gt=_[Wt],bt=y(gt),vt=!bt&&l(gt);ct[Wt]=[];for(var Ut=gt.length,Kt=0;Kt<Ut;Kt++)if(gt[Kt][0]!=="Z"&&!(vt&&Kt!==o&&Kt!==a&&Kt!==s&&Kt!==h)){var Zt=bt&&I.isActiveSelection,le;Zt&&(le=u(gt,Kt));var Te=gt[Kt][1],Se=gt[Kt][2],Fe=Qt.append(Zt?"rect":"circle").attr("data-i",Wt).attr("data-j",Kt).style({fill:i.background,stroke:i.defaultLine,"stroke-width":1,"shape-rendering":"crispEdges"});if(Zt){var Oe=le[1]-Te,ur=le[2]-Se,fr=ur?5:Math.max(Math.min(25,Math.abs(Oe)-5),5),We=Oe?5:Math.max(Math.min(25,Math.abs(ur)-5),5);Fe.classed(ur?"cursor-ew-resize":"cursor-ns-resize",!0).attr("width",fr).attr("height",We).attr("x",Te-fr/2).attr("y",Se-We/2).attr("transform",g(Oe/2,ur/2))}else Fe.classed("cursor-grab",!0).attr("r",5).attr("cx",Te).attr("cy",Se);ct[Wt][Kt]={element:Fe.node(),gd:B,prepFn:Y,doneFn:ot,clickFn:dt},E.init(ct[Wt][Kt])}}}function xt(Qt,Wt){if(_.length)for(var gt=0;gt<_.length;gt++)for(var bt=0;bt<_[gt].length;bt++)for(var vt=0;vt+2<_[gt][bt].length;vt+=2)_[gt][bt][vt+1]=st[gt][bt][vt+1]+Qt,_[gt][bt][vt+2]=st[gt][bt][vt+2]+Wt}function Ft(Qt,Wt){xt(Qt,Wt),R()}function Et(Qt){tt=+Qt.srcElement.getAttribute("data-i"),tt||(tt=0),lt[tt].moveFn=Ft}function Nt(){L()}function te(Qt){Qt===2&&f(B)}function Jt(){if(lt=[],!!_.length){var Qt=0;lt[Qt]={element:D[0][0],gd:B,prepFn:Et,doneFn:Nt,clickFn:te},E.init(lt[Qt])}}};function w(k,_){for(var D=0;D<_.length;D++){var I=_[D];k[D]=[];for(var O=0;O<I.length;O++){k[D][O]=[];for(var B=0;B<I[O].length;B++)k[D][O][B]=I[O][B]}}return k}function u(k,_){var D=k[_][1],I=k[_][2],O=k.length,B,R,L;return B=(_+1)%O,R=k[B][1],L=k[B][2],R===D&&L===I&&(B=(_+2)%O,R=k[B][1],L=k[B][2]),[B,R,L]}function f(k){if(e(k._fullLayout.dragmode)){m(k);var _=k._fullLayout._activeSelectionIndex,D=(k.layout||{}).selections||[];if(_<D.length){for(var I=[],O=0;O<D.length;O++)O!==_&&I.push(D[O]);delete k._fullLayout._activeSelectionIndex;var B=k._fullLayout.selections[_];k._fullLayout._deselect={xref:B.xref,yref:B.yref},r.call("_guiRelayout",k,{selections:I})}}}}),Zy=Vt((X,V)=>{var c=Ai(),g=Mi(),E=qr(),A=ao(),t=Ed().readPaths,e=Wy(),r=mb(),i=kd().clearOutlineControllers,n=vi(),o=go(),a=Ns().arrayEditor,s=af(),h=tp(),v=Rm(),m=Pd(),p=m.getPathString;V.exports={draw:y,drawOne:b,eraseActiveShape:f,drawLabel:r};function y(k){var _=k._fullLayout;_._shapeUpperLayer.selectAll("path").remove(),_._shapeLowerLayer.selectAll("path").remove(),_._shapeUpperLayer.selectAll("text").remove(),_._shapeLowerLayer.selectAll("text").remove();for(var D in _._plots){var I=_._plots[D].shapelayer;I&&(I.selectAll("path").remove(),I.selectAll("text").remove())}for(var O=0;O<_.shapes.length;O++)_.shapes[O].visible===!0&&b(k,O)}function l(k){return!!k._fullLayout._outlining}function x(k){return!k._context.edits.shapePosition}function b(k,_){k._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+_+'"]').remove();var D=m.makeShapesOptionsAndPlotinfo(k,_),I=D.options,O=D.plotinfo;if(!I._input||I.visible!==!0)return;if(I.layer==="above")R(k._fullLayout._shapeUpperLayer);else if(I.xref==="paper"||I.yref==="paper")R(k._fullLayout._shapeLowerLayer);else if(I.layer==="between")R(O.shapelayerBetween);else if(O._hadPlotinfo){var B=O.mainplotinfo||O;R(B.shapelayer)}else R(k._fullLayout._shapeLowerLayer);function R(L){var F=p(k,I),N={"data-index":_,"fill-rule":I.fillrule,d:F},j=I.opacity,G=I.fillcolor,rt=I.line.width?I.line.color:"rgba(0,0,0,0)",ct=I.line.width,lt=I.line.dash;!ct&&I.editable===!0&&(ct=5,lt="solid");var tt=F[F.length-1]!=="Z",Z=x(k)&&I.editable&&k._fullLayout._activeShapeIndex===_;Z&&(G=tt?"rgba(0,0,0,0)":k._fullLayout.activeshape.fillcolor,j=k._fullLayout.activeshape.opacity);var st=L.append("g").classed("shape-group",!0).attr({"data-index":_}),$=st.append("path").attr(N).style("opacity",j).call(n.stroke,rt).call(n.fill,G).call(o.dashLine,lt,ct);S(st,k,I),r(k,_,I,st);var Q;if((Z||k._context.edits.shapePosition)&&(Q=a(k.layout,"shapes",I)),Z){$.style({cursor:"move"});var nt={element:$.node(),plotinfo:O,gd:k,editHelpers:Q,hasText:I.label.text||I.label.texttemplate,isActiveShape:!0},Y=t(F,k);e(Y,$,nt)}else k._context.edits.shapePosition?T(k,$,I,_,L,Q):I.editable===!0&&$.style("pointer-events",tt||n.opacity(G)*j<=.5?"stroke":"all");$.node().addEventListener("click",function(){return w(k,$)})}}function S(k,_,D){var I=(D.xref+D.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");o.setClipUrl(k,I?"clip"+_._fullLayout._uid+I:null,_)}function T(k,_,D,I,O,B){var R=10,L=10,F=D.xsizemode==="pixel",N=D.ysizemode==="pixel",j=D.type==="line",G=D.type==="path",rt=B.modifyItem,ct,lt,tt,Z,st,$,Q,nt,Y,q,ot,it,dt,wt,xt,Ft=c.select(_.node().parentNode),Et=A.getFromId(k,D.xref),Nt=A.getRefType(D.xref),te=A.getFromId(k,D.yref),Jt=A.getRefType(D.yref),Qt=D.x0shift,Wt=D.x1shift,gt=D.y0shift,bt=D.y1shift,vt=function(ut,yt){var Mt=m.getDataToPixel(k,Et,yt,!1,Nt);return Mt(ut)},Ut=function(ut,yt){var Mt=m.getDataToPixel(k,te,yt,!0,Jt);return Mt(ut)},Kt=m.getPixelToData(k,Et,!1,Nt),Zt=m.getPixelToData(k,te,!0,Jt),le=Fe(),Te={element:le.node(),gd:k,prepFn:fr,doneFn:We,clickFn:Lr},Se;s.init(Te),le.node().onmousemove=ur;function Fe(){return j?Oe():_}function Oe(){var ut=10,yt=Math.max(D.line.width,ut),Mt=O.append("g").attr("data-index",I).attr("drag-helper",!0);Mt.append("path").attr("d",_.attr("d")).style({cursor:"move","stroke-width":yt,"stroke-opacity":"0"});var Ot={"fill-opacity":"0"},$t=Math.max(yt/2,ut);return Mt.append("circle").attr({"data-line-point":"start-point",cx:F?vt(D.xanchor)+D.x0:vt(D.x0,Qt),cy:N?Ut(D.yanchor)-D.y0:Ut(D.y0,gt),r:$t}).style(Ot).classed("cursor-grab",!0),Mt.append("circle").attr({"data-line-point":"end-point",cx:F?vt(D.xanchor)+D.x1:vt(D.x1,Wt),cy:N?Ut(D.yanchor)-D.y1:Ut(D.y1,bt),r:$t}).style(Ot).classed("cursor-grab",!0),Mt}function ur(ut){if(l(k)){Se=null;return}if(j)ut.target.tagName==="path"?Se="move":Se=ut.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var yt=Te.element.getBoundingClientRect(),Mt=yt.right-yt.left,Ot=yt.bottom-yt.top,$t=ut.clientX-yt.left,ee=ut.clientY-yt.top,we=!G&&Mt>R&&Ot>L&&!ut.shiftKey?s.getCursor($t/Mt,1-ee/Ot):"move";h(_,we),Se=we.split("-")[0]}}function fr(ut){l(k)||(F&&(st=vt(D.xanchor)),N&&($=Ut(D.yanchor)),D.type==="path"?xt=D.path:(ct=F?D.x0:vt(D.x0),lt=N?D.y0:Ut(D.y0),tt=F?D.x1:vt(D.x1),Z=N?D.y1:Ut(D.y1)),ct<tt?(Y=ct,dt="x0",q=tt,wt="x1"):(Y=tt,dt="x1",q=ct,wt="x0"),!N&<<Z||N&<>Z?(Q=lt,ot="y0",nt=Z,it="y1"):(Q=Z,ot="y1",nt=lt,it="y0"),ur(ut),Dt(O,D),zt(_,D,k),Te.moveFn=Se==="move"?kr:he,Te.altKey=ut.altKey)}function We(){l(k)||(h(_),qt(O),S(_,k,D),g.call("_guiRelayout",k,B.getUpdateObj()))}function Lr(){l(k)||qt(O)}function kr(ut,yt){if(D.type==="path"){var Mt=function(ee){return ee},Ot=Mt,$t=Mt;F?rt("xanchor",D.xanchor=Kt(st+ut)):(Ot=function(ee){return Kt(vt(ee)+ut)},Et&&Et.type==="date"&&(Ot=m.encodeDate(Ot))),N?rt("yanchor",D.yanchor=Zt($+yt)):($t=function(ee){return Zt(Ut(ee)+yt)},te&&te.type==="date"&&($t=m.encodeDate($t))),rt("path",D.path=M(xt,Ot,$t))}else F?rt("xanchor",D.xanchor=Kt(st+ut)):(rt("x0",D.x0=Kt(ct+ut)),rt("x1",D.x1=Kt(tt+ut))),N?rt("yanchor",D.yanchor=Zt($+yt)):(rt("y0",D.y0=Zt(lt+yt)),rt("y1",D.y1=Zt(Z+yt)));_.attr("d",p(k,D)),Dt(O,D),r(k,I,D,Ft)}function he(ut,yt){if(G){var Mt=function(pn){return pn},Ot=Mt,$t=Mt;F?rt("xanchor",D.xanchor=Kt(st+ut)):(Ot=function(pn){return Kt(vt(pn)+ut)},Et&&Et.type==="date"&&(Ot=m.encodeDate(Ot))),N?rt("yanchor",D.yanchor=Zt($+yt)):($t=function(pn){return Zt(Ut(pn)+yt)},te&&te.type==="date"&&($t=m.encodeDate($t))),rt("path",D.path=M(xt,Ot,$t))}else if(j){if(Se==="resize-over-start-point"){var ee=ct+ut,we=N?lt-yt:lt+yt;rt("x0",D.x0=F?ee:Kt(ee)),rt("y0",D.y0=N?we:Zt(we))}else if(Se==="resize-over-end-point"){var Me=tt+ut,Re=N?Z-yt:Z+yt;rt("x1",D.x1=F?Me:Kt(Me)),rt("y1",D.y1=N?Re:Zt(Re))}}else{var Be=function(pn){return Se.indexOf(pn)!==-1},Ze=Be("n"),Ue=Be("s"),mr=Be("w"),ln=Be("e"),an=Ze?Q+yt:Q,vn=Ue?nt+yt:nt,Sn=mr?Y+ut:Y,An=ln?q+ut:q;N&&(Ze&&(an=Q-yt),Ue&&(vn=nt-yt)),(!N&&vn-an>L||N&&an-vn>L)&&(rt(ot,D[ot]=N?an:Zt(an)),rt(it,D[it]=N?vn:Zt(vn))),An-Sn>R&&(rt(dt,D[dt]=F?Sn:Kt(Sn)),rt(wt,D[wt]=F?An:Kt(An)))}_.attr("d",p(k,D)),Dt(O,D),r(k,I,D,Ft)}function Dt(ut,yt){(F||N)&&Mt();function Mt(){var Ot=yt.type!=="path",$t=ut.selectAll(".visual-cue").data([0]),ee=1;$t.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":ee}).classed("visual-cue",!0);var we=vt(F?yt.xanchor:E.midRange(Ot?[yt.x0,yt.x1]:m.extractPathCoords(yt.path,v.paramIsX))),Me=Ut(N?yt.yanchor:E.midRange(Ot?[yt.y0,yt.y1]:m.extractPathCoords(yt.path,v.paramIsY)));if(we=m.roundPositionForSharpStrokeRendering(we,ee),Me=m.roundPositionForSharpStrokeRendering(Me,ee),F&&N){var Re="M"+(we-1-ee)+","+(Me-1-ee)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";$t.attr("d",Re)}else if(F){var Be="M"+(we-1-ee)+","+(Me-9-ee)+"v18 h2 v-18 Z";$t.attr("d",Be)}else{var Ze="M"+(we-9-ee)+","+(Me-1-ee)+"h18 v2 h-18 Z";$t.attr("d",Ze)}}}function qt(ut){ut.selectAll(".visual-cue").remove()}function zt(ut,yt,Mt){var Ot=yt.xref,$t=yt.yref,ee=A.getFromId(Mt,Ot),we=A.getFromId(Mt,$t),Me="";Ot!=="paper"&&!ee.autorange&&(Me+=Ot),$t!=="paper"&&!we.autorange&&(Me+=$t),o.setClipUrl(ut,Me?"clip"+Mt._fullLayout._uid+Me:null,Mt)}}function M(k,_,D){return k.replace(v.segmentRE,function(I){var O=0,B=I.charAt(0),R=v.paramIsX[B],L=v.paramIsY[B],F=v.numParams[B],N=I.substr(1).replace(v.paramRE,function(j){return O>=F||(R[O]?j=_(j):L[O]&&(j=D(j)),O++),j});return B+N})}function w(k,_){if(x(k)){var D=_.node(),I=+D.getAttribute("data-index");if(I>=0){if(I===k._fullLayout._activeShapeIndex){u(k);return}k._fullLayout._activeShapeIndex=I,k._fullLayout._deactivateShape=u,y(k)}}}function u(k){if(x(k)){var _=k._fullLayout._activeShapeIndex;_>=0&&(i(k),delete k._fullLayout._activeShapeIndex,y(k))}}function f(k){if(x(k)){i(k);var _=k._fullLayout._activeShapeIndex,D=(k.layout||{}).shapes||[];if(_<D.length){for(var I=[],O=0;O<D.length;O++)O!==_&&I.push(D[O]);return delete k._fullLayout._activeShapeIndex,g.call("_guiRelayout",k,{shapes:I})}}}}),vb=Vt((X,V)=>{var c=Mi(),g=fu(),E=rc(),A=Vy(),t=Zy().eraseActiveShape,e=qr(),r=e._,i=V.exports={};i.toImage={name:"toImage",title:function(T){var M=T._context.toImageButtonOptions||{},w=M.format||"png";return w==="png"?r(T,"Download plot as a png"):r(T,"Download plot")},icon:A.camera,click:function(T){var M=T._context.toImageButtonOptions,w={format:M.format||"png"};e.notifier(r(T,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach(function(u){u in M&&(w[u]=M[u])}),c.call("downloadImage",T,w).then(function(u){e.notifier(r(T,"Snapshot succeeded")+" - "+u,"long")}).catch(function(){e.notifier(r(T,"Sorry, there was a problem downloading your snapshot!"),"long")})}},i.sendDataToCloud={name:"sendDataToCloud",title:function(T){return r(T,"Edit in Chart Studio")},icon:A.disk,click:function(T){g.sendDataToCloud(T)}},i.editInChartStudio={name:"editInChartStudio",title:function(T){return r(T,"Edit in Chart Studio")},icon:A.pencil,click:function(T){g.sendDataToCloud(T)}},i.zoom2d={name:"zoom2d",_cat:"zoom",title:function(T){return r(T,"Zoom")},attr:"dragmode",val:"zoom",icon:A.zoombox,click:n},i.pan2d={name:"pan2d",_cat:"pan",title:function(T){return r(T,"Pan")},attr:"dragmode",val:"pan",icon:A.pan,click:n},i.select2d={name:"select2d",_cat:"select",title:function(T){return r(T,"Box Select")},attr:"dragmode",val:"select",icon:A.selectbox,click:n},i.lasso2d={name:"lasso2d",_cat:"lasso",title:function(T){return r(T,"Lasso Select")},attr:"dragmode",val:"lasso",icon:A.lasso,click:n},i.drawclosedpath={name:"drawclosedpath",title:function(T){return r(T,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:A.drawclosedpath,click:n},i.drawopenpath={name:"drawopenpath",title:function(T){return r(T,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:A.drawopenpath,click:n},i.drawline={name:"drawline",title:function(T){return r(T,"Draw line")},attr:"dragmode",val:"drawline",icon:A.drawline,click:n},i.drawrect={name:"drawrect",title:function(T){return r(T,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:A.drawrect,click:n},i.drawcircle={name:"drawcircle",title:function(T){return r(T,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:A.drawcircle,click:n},i.eraseshape={name:"eraseshape",title:function(T){return r(T,"Erase active shape")},icon:A.eraseshape,click:t},i.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(T){return r(T,"Zoom in")},attr:"zoom",val:"in",icon:A.zoom_plus,click:n},i.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(T){return r(T,"Zoom out")},attr:"zoom",val:"out",icon:A.zoom_minus,click:n},i.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(T){return r(T,"Autoscale")},attr:"zoom",val:"auto",icon:A.autoscale,click:n},i.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(T){return r(T,"Reset axes")},attr:"zoom",val:"reset",icon:A.home,click:n},i.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(T){return r(T,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:A.tooltip_basic,gravity:"ne",click:n},i.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(T){return r(T,"Compare data on hover")},attr:"hovermode",val:function(T){return T._fullLayout._isHoriz?"y":"x"},icon:A.tooltip_compare,gravity:"ne",click:n};function n(T,M){var w=M.currentTarget,u=w.getAttribute("data-attr"),f=w.getAttribute("data-val")||!0,k=T._fullLayout,_={},D=E.list(T,null,!0),I=k._cartesianSpikesEnabled,O,B;if(u==="zoom"){var R=f==="in"?.5:2,L=(1+R)/2,F=(1-R)/2,N;for(B=0;B<D.length;B++)if(O=D[B],!O.fixedrange)if(N=O._name,f==="auto")_[N+".autorange"]=!0;else if(f==="reset")O._rangeInitial0===void 0&&O._rangeInitial1===void 0?_[N+".autorange"]=!0:O._rangeInitial0===void 0?(_[N+".autorange"]=O._autorangeInitial,_[N+".range"]=[null,O._rangeInitial1]):O._rangeInitial1===void 0?(_[N+".range"]=[O._rangeInitial0,null],_[N+".autorange"]=O._autorangeInitial):_[N+".range"]=[O._rangeInitial0,O._rangeInitial1],O._showSpikeInitial!==void 0&&(_[N+".showspikes"]=O._showSpikeInitial,I==="on"&&!O._showSpikeInitial&&(I="off"));else{var j=[O.r2l(O.range[0]),O.r2l(O.range[1])],G=[L*j[0]+F*j[1],L*j[1]+F*j[0]];_[N+".range[0]"]=O.l2r(G[0]),_[N+".range[1]"]=O.l2r(G[1])}}else u==="hovermode"&&(f==="x"||f==="y")&&(f=k._isHoriz?"y":"x",w.setAttribute("data-val",f)),_[u]=f;k._cartesianSpikesEnabled=I,c.call("_guiRelayout",T,_)}i.zoom3d={name:"zoom3d",_cat:"zoom",title:function(T){return r(T,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:A.zoombox,click:o},i.pan3d={name:"pan3d",_cat:"pan",title:function(T){return r(T,"Pan")},attr:"scene.dragmode",val:"pan",icon:A.pan,click:o},i.orbitRotation={name:"orbitRotation",title:function(T){return r(T,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:A["3d_rotate"],click:o},i.tableRotation={name:"tableRotation",title:function(T){return r(T,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:A["z-axis"],click:o};function o(T,M){for(var w=M.currentTarget,u=w.getAttribute("data-attr"),f=w.getAttribute("data-val")||!0,k=T._fullLayout._subplots.gl3d||[],_={},D=u.split("."),I=0;I<k.length;I++)_[k[I]+"."+D[1]]=f;var O=f==="pan"?f:"zoom";_.dragmode=O,c.call("_guiRelayout",T,_)}i.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(T){return r(T,"Reset camera to default")},attr:"resetDefault",icon:A.home,click:a},i.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(T){return r(T,"Reset camera to last save")},attr:"resetLastSave",icon:A.movie,click:a};function a(T,M){for(var w=M.currentTarget,u=w.getAttribute("data-attr"),f=u==="resetLastSave",k=u==="resetDefault",_=T._fullLayout,D=_._subplots.gl3d||[],I={},O=0;O<D.length;O++){var B=D[O],R=B+".camera",L=B+".aspectratio",F=B+".aspectmode",N=_[B]._scene,j;f?(I[R+".up"]=N.viewInitial.up,I[R+".eye"]=N.viewInitial.eye,I[R+".center"]=N.viewInitial.center,j=!0):k&&(I[R+".up"]=null,I[R+".eye"]=null,I[R+".center"]=null,j=!0),j&&(I[L+".x"]=N.viewInitial.aspectratio.x,I[L+".y"]=N.viewInitial.aspectratio.y,I[L+".z"]=N.viewInitial.aspectratio.z,I[F]=N.viewInitial.aspectmode)}c.call("_guiRelayout",T,I)}i.hoverClosest3d={name:"hoverClosest3d",_cat:"hoverclosest",title:function(T){return r(T,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:A.tooltip_basic,gravity:"ne",click:h};function s(T,M){var w=M.currentTarget,u=w._previousVal,f=T._fullLayout,k=f._subplots.gl3d||[],_=["xaxis","yaxis","zaxis"],D={},I={};if(u)I=u,w._previousVal=null;else{for(var O=0;O<k.length;O++){var B=k[O],R=f[B],L=B+".hovermode";D[L]=R.hovermode,I[L]=!1;for(var F=0;F<3;F++){var N=_[F],j=B+"."+N+".showspikes";I[j]=!1,D[j]=R[N].showspikes}}w._previousVal=D}return I}function h(T,M){var w=s(T,M);c.call("_guiRelayout",T,w)}i.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(T){return r(T,"Zoom in")},attr:"zoom",val:"in",icon:A.zoom_plus,click:v},i.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(T){return r(T,"Zoom out")},attr:"zoom",val:"out",icon:A.zoom_minus,click:v},i.resetGeo={name:"resetGeo",_cat:"reset",title:function(T){return r(T,"Reset")},attr:"reset",val:null,icon:A.autoscale,click:v},i.hoverClosestGeo={name:"hoverClosestGeo",_cat:"hoverclosest",title:function(T){return r(T,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:A.tooltip_basic,gravity:"ne",click:p};function v(T,M){for(var w=M.currentTarget,u=w.getAttribute("data-attr"),f=w.getAttribute("data-val")||!0,k=T._fullLayout,_=k._subplots.geo||[],D=0;D<_.length;D++){var I=_[D],O=k[I];if(u==="zoom"){var B=O.projection.scale,R=f==="in"?2*B:.5*B;c.call("_guiRelayout",T,I+".projection.scale",R)}}u==="reset"&&S(T,"geo")}i.hoverClosestPie={name:"hoverClosestPie",_cat:"hoverclosest",title:function(T){return r(T,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:A.tooltip_basic,gravity:"ne",click:p};function m(T){var M=T._fullLayout;return M.hovermode?!1:M._has("cartesian")?M._isHoriz?"y":"x":"closest"}function p(T){var M=m(T);c.call("_guiRelayout",T,"hovermode",M)}i.resetViewSankey={name:"resetSankeyGroup",title:function(T){return r(T,"Reset view")},icon:A.home,click:function(T){for(var M={"node.groups":[],"node.x":[],"node.y":[]},w=0;w<T._fullData.length;w++){var u=T._fullData[w]._viewInitial;M["node.groups"].push(u.node.groups.slice()),M["node.x"].push(u.node.x.slice()),M["node.y"].push(u.node.y.slice())}c.call("restyle",T,M)}},i.toggleHover={name:"toggleHover",title:function(T){return r(T,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:A.tooltip_basic,gravity:"ne",click:function(T,M){var w=s(T,M);w.hovermode=m(T),c.call("_guiRelayout",T,w)}},i.resetViews={name:"resetViews",title:function(T){return r(T,"Reset views")},icon:A.home,click:function(T,M){var w=M.currentTarget;w.setAttribute("data-attr","zoom"),w.setAttribute("data-val","reset"),n(T,M),w.setAttribute("data-attr","resetLastSave"),a(T,M),S(T,"geo"),S(T,"mapbox"),S(T,"map")}},i.toggleSpikelines={name:"toggleSpikelines",title:function(T){return r(T,"Toggle Spike Lines")},icon:A.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(T){var M=T._fullLayout,w=M._cartesianSpikesEnabled;M._cartesianSpikesEnabled=w==="on"?"off":"on",c.call("_guiRelayout",T,y(T))}};function y(T){for(var M=T._fullLayout,w=M._cartesianSpikesEnabled==="on",u=E.list(T,null,!0),f={},k=0;k<u.length;k++){var _=u[k];f[_._name+".showspikes"]=w?!0:_._showSpikeInitial}return f}i.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(T){return r(T,"Reset view")},attr:"reset",icon:A.home,click:function(T){S(T,"mapbox")}},i.resetViewMap={name:"resetViewMap",_cat:"resetView",title:function(T){return r(T,"Reset view")},attr:"reset",icon:A.home,click:function(T){S(T,"map")}},i.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(T){return r(T,"Zoom in")},attr:"zoom",val:"in",icon:A.zoom_plus,click:l},i.zoomInMap={name:"zoomInMap",_cat:"zoomin",title:function(T){return r(T,"Zoom in")},attr:"zoom",val:"in",icon:A.zoom_plus,click:x},i.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(T){return r(T,"Zoom out")},attr:"zoom",val:"out",icon:A.zoom_minus,click:l},i.zoomOutMap={name:"zoomOutMap",_cat:"zoomout",title:function(T){return r(T,"Zoom out")},attr:"zoom",val:"out",icon:A.zoom_minus,click:x};function l(T,M){b(T,M,"mapbox")}function x(T,M){b(T,M,"map")}function b(T,M,w){for(var u=M.currentTarget,f=u.getAttribute("data-val"),k=T._fullLayout,_=k._subplots[w]||[],D=1.05,I={},O=0;O<_.length;O++){var B=_[O],R=k[B].zoom,L=f==="in"?D*R:R/D;I[B+".zoom"]=L}c.call("_guiRelayout",T,I)}function S(T,M){for(var w=T._fullLayout,u=w._subplots[M]||[],f={},k=0;k<u.length;k++)for(var _=u[k],D=w[_]._subplot,I=D.viewInitial,O=Object.keys(I),B=0;B<O.length;B++){var R=O[B];f[_+"."+R]=I[R]}c.call("_guiRelayout",T,f)}}),yb=Vt((X,V)=>{var c=vb(),g=Object.keys(c),E=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],A=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(E),t=[],e=function(r){if(A.indexOf(r._cat||r.name)===-1){var i=r.name,n=(r._cat||r.name).toLowerCase();t.indexOf(i)===-1&&t.push(i),t.indexOf(n)===-1&&t.push(n)}};g.forEach(function(r){e(c[r])}),t.sort(),V.exports={DRAW_MODES:E,backButtons:A,foreButtons:t}}),xb=Vt((X,V)=>{yb(),V.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}}),Wk=Vt((X,V)=>{var c=qr(),g=vi(),E=Ns(),A=xb();V.exports=function(t,e){var r=t.modebar||{},i=E.newContainer(e,"modebar");function n(a,s){return c.coerce(r,i,A,a,s)}n("orientation"),n("bgcolor",g.addOpacity(e.paper_bgcolor,.5));var o=g.contrast(g.rgb(e.modebar.bgcolor));n("color",g.addOpacity(o,.3)),n("activecolor",g.addOpacity(o,.7)),n("uirevision",e.uirevision),n("add"),n("remove")}}),Zk=Vt((X,V)=>{var c=Ai(),g=vo(),E=qr(),A=Vy(),t=Iy().version,e=new DOMParser;function r(a){this.container=a.container,this.element=document.createElement("div"),this.update(a.graphInfo,a.buttons),this.container.appendChild(this.element)}var i=r.prototype;i.update=function(a,s){this.graphInfo=a;var h=this.graphInfo._context,v=this.graphInfo._fullLayout,m="modebar-"+v._uid;this.element.setAttribute("id",m),this._uid=m,this.element.className="modebar",h.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),v.modebar.orientation==="v"&&(this.element.className+=" vertical",s=s.reverse());var p=v.modebar,y="#"+m+" .modebar-group";document.querySelectorAll(y).forEach(function(T){T.style.backgroundColor=p.bgcolor});var l=!this.hasButtons(s),x=this.hasLogo!==h.displaylogo,b=this.locale!==h.locale;if(this.locale=h.locale,(l||x||b)&&(this.removeAllButtons(),this.updateButtons(s),h.watermark||h.displaylogo)){var S=this.getLogo();h.watermark&&(S.className=S.className+" watermark"),v.modebar.orientation==="v"?this.element.insertBefore(S,this.element.childNodes[0]):this.element.appendChild(S),this.hasLogo=!0}this.updateActiveButton(),E.setStyleOnHover("#"+m+" .modebar-btn",".active",".icon path","fill: "+p.activecolor,"fill: "+p.color,this.element)},i.updateButtons=function(a){var s=this;this.buttons=a,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(h){var v=s.createGroup();h.forEach(function(m){var p=m.name;if(!p)throw new Error("must provide button 'name' in button config");if(s.buttonsNames.indexOf(p)!==-1)throw new Error("button name '"+p+"' is taken");s.buttonsNames.push(p);var y=s.createButton(m);s.buttonElements.push(y),v.appendChild(y)}),s.element.appendChild(v)})},i.createGroup=function(){var a=document.createElement("div");a.className="modebar-group";var s=this.graphInfo._fullLayout.modebar;return a.style.backgroundColor=s.bgcolor,a},i.createButton=function(a){var s=this,h=document.createElement("a");h.setAttribute("rel","tooltip"),h.className="modebar-btn";var v=a.title;v===void 0?v=a.name:typeof v=="function"&&(v=v(this.graphInfo)),(v||v===0)&&h.setAttribute("data-title",v),a.attr!==void 0&&h.setAttribute("data-attr",a.attr);var m=a.val;m!==void 0&&(typeof m=="function"&&(m=m(this.graphInfo)),h.setAttribute("data-val",m));var p=a.click;if(typeof p!="function")throw new Error("must provide button 'click' function in button config");h.addEventListener("click",function(l){a.click(s.graphInfo,l),s.updateActiveButton(l.currentTarget)}),h.setAttribute("data-toggle",a.toggle||!1),a.toggle&&c.select(h).classed("active",!0);var y=a.icon;return typeof y=="function"?h.appendChild(y()):h.appendChild(this.createIcon(y||A.question)),h.setAttribute("data-gravity",a.gravity||"n"),h},i.createIcon=function(a){var s=g(a.height)?Number(a.height):a.ascent-a.descent,h="http://www.w3.org/2000/svg",v;if(a.path){v=document.createElementNS(h,"svg"),v.setAttribute("viewBox",[0,0,a.width,s].join(" ")),v.setAttribute("class","icon");var m=document.createElementNS(h,"path");m.setAttribute("d",a.path),a.transform?m.setAttribute("transform",a.transform):a.ascent!==void 0&&m.setAttribute("transform","matrix(1 0 0 -1 0 "+a.ascent+")"),v.appendChild(m)}if(a.svg){var p=e.parseFromString(a.svg,"application/xml");v=p.childNodes[0]}return v.setAttribute("height","1em"),v.setAttribute("width","1em"),v},i.updateActiveButton=function(a){var s=this.graphInfo._fullLayout,h=a!==void 0?a.getAttribute("data-attr"):null;this.buttonElements.forEach(function(v){var m=v.getAttribute("data-val")||!0,p=v.getAttribute("data-attr"),y=v.getAttribute("data-toggle")==="true",l=c.select(v),x=function(T,M){var w=s.modebar,u=T.querySelector(".icon path");u&&(M||T.matches(":hover")?u.style.fill=w.activecolor:u.style.fill=w.color)};if(y){if(p===h){var b=!l.classed("active");l.classed("active",b),x(v,b)}}else{var S=p===null?p:E.nestedProperty(s,p).get();l.classed("active",S===m),x(v,S===m)}})},i.hasButtons=function(a){var s=this.buttons;if(!s||a.length!==s.length)return!1;for(var h=0;h<a.length;++h){if(a[h].length!==s[h].length)return!1;for(var v=0;v<a[h].length;v++)if(a[h][v].name!==s[h][v].name)return!1}return!0};function n(a){return a+" (v"+t+")"}i.getLogo=function(){var a=this.createGroup(),s=document.createElement("a");return s.href="https://plotly.com/",s.target="_blank",s.setAttribute("data-title",n(E._(this.graphInfo,"Produced with Plotly.js"))),s.className="modebar-btn plotlyjsicon modebar-btn--logo",s.appendChild(this.createIcon(A.newplotlylogo)),a.appendChild(s),a},i.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},i.destroy=function(){E.removeElement(this.container.querySelector(".modebar"))};function o(a,s){var h=a._fullLayout,v=new r({graphInfo:a,container:h._modebardiv.node(),buttons:s});return h._privateplot&&c.select(v.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),v}V.exports=o}),Xk=Vt((X,V)=>{var c=rc(),g=Sl(),E=Mi(),A=vf().isUnifiedHover,t=Zk(),e=vb(),r=yb().DRAW_MODES,i=qr().extendDeep;V.exports=function(m){var p=m._fullLayout,y=m._context,l=p._modeBar;if(!y.displayModeBar&&!y.watermark){l&&(l.destroy(),delete p._modeBar);return}if(!Array.isArray(y.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(y.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var x=y.modeBarButtons,b;Array.isArray(x)&&x.length?b=v(x):!y.displayModeBar&&y.watermark?b=[]:b=n(m),l?l.update(m,b):p._modeBar=t(m,b)};function n(m){var p=m._fullLayout,y=m._fullData,l=m._context;function x(q,ot){if(typeof ot=="string"){if(ot.toLowerCase()===q.toLowerCase())return!0}else{var it=ot.name,dt=ot._cat||ot.name;if(it===q||dt===q.toLowerCase())return!0}return!1}var b=p.modebar.add;typeof b=="string"&&(b=[b]);var S=p.modebar.remove;typeof S=="string"&&(S=[S]);var T=l.modeBarButtonsToAdd.concat(b.filter(function(q){for(var ot=0;ot<l.modeBarButtonsToRemove.length;ot++)if(x(q,l.modeBarButtonsToRemove[ot]))return!1;return!0})),M=l.modeBarButtonsToRemove.concat(S.filter(function(q){for(var ot=0;ot<l.modeBarButtonsToAdd.length;ot++)if(x(q,l.modeBarButtonsToAdd[ot]))return!1;return!0})),w=p._has("cartesian"),u=p._has("gl3d"),f=p._has("geo"),k=p._has("pie"),_=p._has("funnelarea"),D=p._has("ternary"),I=p._has("mapbox"),O=p._has("map"),B=p._has("polar"),R=p._has("smith"),L=p._has("sankey"),F=o(p),N=A(p.hovermode),j=[];function G(q){if(q.length){for(var ot=[],it=0;it<q.length;it++){for(var dt=q[it],wt=e[dt],xt=wt.name.toLowerCase(),Ft=(wt._cat||wt.name).toLowerCase(),Et=!1,Nt=0;Nt<M.length;Nt++){var te=M[Nt].toLowerCase();if(te===xt||te===Ft){Et=!0;break}}Et||ot.push(e[dt])}j.push(ot)}}var rt=["toImage"];l.showEditInChartStudio?rt.push("editInChartStudio"):l.showSendToCloud&&rt.push("sendDataToCloud"),G(rt);var ct=[],lt=[],tt=[],Z=[];(w||k||_||D)+f+u+I+O+B+R>1?(lt=["toggleHover"],tt=["resetViews"]):f?(ct=["zoomInGeo","zoomOutGeo"],lt=["hoverClosestGeo"],tt=["resetGeo"]):u?(lt=["hoverClosest3d"],tt=["resetCameraDefault3d","resetCameraLastSave3d"]):I?(ct=["zoomInMapbox","zoomOutMapbox"],lt=["toggleHover"],tt=["resetViewMapbox"]):O?(ct=["zoomInMap","zoomOutMap"],lt=["toggleHover"],tt=["resetViewMap"]):k?lt=["hoverClosestPie"]:L?(lt=["hoverClosestCartesian","hoverCompareCartesian"],tt=["resetViewSankey"]):lt=["toggleHover"],w&<.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(y)||N)&&(lt=[]),w&&!F&&(ct=["zoomIn2d","zoomOut2d","autoScale2d"],tt[0]!=="resetViews"&&(tt=["resetScale2d"])),u?Z=["zoom3d","pan3d","orbitRotation","tableRotation"]:w&&!F||D?Z=["zoom2d","pan2d"]:I||O||f?Z=["pan2d"]:B&&(Z=["zoom2d"]),a(y)&&Z.push("select2d","lasso2d");var st=[],$=function(q){st.indexOf(q)===-1&<.indexOf(q)!==-1&&st.push(q)};if(Array.isArray(T)){for(var Q=[],nt=0;nt<T.length;nt++){var Y=T[nt];typeof Y=="string"?(Y=Y.toLowerCase(),r.indexOf(Y)!==-1?(p._has("mapbox")||p._has("map")||p._has("cartesian"))&&Z.push(Y):Y==="togglespikelines"?$("toggleSpikelines"):Y==="togglehover"?$("toggleHover"):Y==="hovercompare"?$("hoverCompareCartesian"):Y==="hoverclosest"?($("hoverClosestCartesian"),$("hoverClosestGeo"),$("hoverClosest3d"),$("hoverClosestPie")):Y==="v1hovermode"&&($("hoverClosestCartesian"),$("hoverCompareCartesian"),$("hoverClosestGeo"),$("hoverClosest3d"),$("hoverClosestPie"))):Q.push(Y)}T=Q}return G(Z),G(ct.concat(tt)),G(st),h(j,T)}function o(m){for(var p=c.list({_fullLayout:m},null,!0),y=0;y<p.length;y++)if(!p[y].fixedrange)return!1;return!0}function a(m){for(var p=!1,y=0;y<m.length&&!p;y++){var l=m[y];!l._module||!l._module.selectPoints||(E.traceIs(l,"scatter-like")?(g.hasMarkers(l)||g.hasText(l))&&(p=!0):E.traceIs(l,"box-violin")?(l.boxpoints==="all"||l.points==="all")&&(p=!0):p=!0)}return p}function s(m){for(var p=0;p<m.length;p++)if(!E.traceIs(m[p],"noHover"))return!1;return!0}function h(m,p){if(p.length)if(Array.isArray(p[0]))for(var y=0;y<p.length;y++)m.push(p[y]);else m.push(p);return m}function v(m){for(var p=i([],m),y=0;y<p.length;y++)for(var l=p[y],x=0;x<l.length;x++){var b=l[x];if(typeof b=="string")if(e[b]!==void 0)p[y][x]=e[b];else throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "))}return p}}),_b=Vt((X,V)=>{V.exports={moduleType:"component",name:"modebar",layoutAttributes:xb(),supplyLayoutDefaults:Wk(),manage:Xk()}}),bb=Vt((X,V)=>{var c=nh().FROM_BL;V.exports=function(g,E,A){A===void 0&&(A=c[g.constraintoward||"center"]);var t=[g.r2l(g.range[0]),g.r2l(g.range[1])],e=t[0]+(t[1]-t[0])*A;g.range=g._input.range=[g.l2r(e+(t[0]-e)*E),g.l2r(e+(t[1]-e)*E)],g.setScale()}}),c0=Vt(X=>{var V=qr(),c=Kf(),g=rc().id2name,E=Ih(),A=bb(),t=xp(),e=ts().ALMOST_EQUAL,r=nh().FROM_BL;X.handleDefaults=function(m,p,y){var l=y.axIds,x=y.axHasImage,b=p._axisConstraintGroups=[],S=p._axisMatchGroups=[],T,M,w,u,f,k,_,D;for(T=0;T<l.length;T++)u=g(l[T]),f=m[u],k=p[u],i(f,k,{axIds:l,layoutOut:p,hasImage:x[u]});function I(rt,ct){for(T=0;T<rt.length;T++){M=rt[T];for(w in M)p[g(w)][ct]=M}}for(I(S,"_matchGroup"),T=0;T<b.length;T++){M=b[T];for(w in M)if(k=p[g(w)],k.fixedrange){for(var O in M){var B=g(O);(m[B]||{}).fixedrange===!1&&V.warn("fixedrange was specified as false for axis "+B+" but was overridden because another axis in its constraint group has fixedrange true"),p[B].fixedrange=!0}break}}for(T=0;T<b.length;){M=b[T];for(w in M){k=p[g(w)],k._matchGroup&&Object.keys(k._matchGroup).length===Object.keys(M).length&&(b.splice(T,1),T--);break}T++}I(b,"_constraintGroup");var R=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],L=!1,F=!1;function N(){D=k[_],_==="rangebreaks"&&(F=k._hasDayOfWeekBreaks)}for(T=0;T<S.length;T++){M=S[T];for(var j=0;j<R.length;j++){_=R[j],D=null;var G;for(w in M)if(u=g(w),f=m[u],k=p[u],_ in k){if(!k.matches&&(G=k,_ in f)){N();break}D===null&&_ in f&&N()}if(_==="range"&&D&&f.range&&f.range.length===2&&f.range[0]!==null&&f.range[1]!==null&&(L=!0),_==="autorange"&&D===null&&L&&(D=!1),D===null&&_ in G&&(D=G[_]),D!==null)for(w in M)k=p[g(w)],k[_]=_==="range"?D.slice():D,_==="rangebreaks"&&(k._hasDayOfWeekBreaks=F,t(k,p))}}};function i(m,p,y){var l=y.axIds,x=y.layoutOut,b=y.hasImage,S=x._axisConstraintGroups,T=x._axisMatchGroups,M=p._id,w=M.charAt(0),u=((x._splomAxes||{})[w]||{})[M]||{},f=p._id,k=f.charAt(0)==="x";p._matchGroup=null,p._constraintGroup=null;function _(Z,st){return V.coerce(m,p,E,Z,st)}_("constrain",b?"domain":"range"),V.coerce(m,p,{constraintoward:{valType:"enumerated",values:k?["left","center","right"]:["bottom","middle","top"],dflt:k?"center":"middle"}},"constraintoward");var D=p.type,I,O,B=[];for(I=0;I<l.length;I++)if(O=l[I],O!==f){var R=x[g(O)];R.type===D&&B.push(O)}var L=o(S,f);if(L){var F=[];for(I=0;I<B.length;I++)O=B[I],L[O]||F.push(O);B=F}var N=B.length,j,G;N&&(m.matches||u.matches)&&(j=V.coerce(m,p,{matches:{valType:"enumerated",values:B,dflt:B.indexOf(u.matches)!==-1?u.matches:void 0}},"matches"));var rt=b&&!k?p.anchor:void 0;if(N&&!j&&(m.scaleanchor||rt)&&(G=V.coerce(m,p,{scaleanchor:{valType:"enumerated",values:B.concat([!1])}},"scaleanchor",rt)),j){p._matchGroup=a(T,f,j,1);var ct=x[g(j)],lt=n(x,p)/n(x,ct);k!==(j.charAt(0)==="x")&&(lt=(k?"x":"y")+lt),a(S,f,j,lt)}else m.matches&&l.indexOf(m.matches)!==-1&&V.warn("ignored "+p._name+'.matches: "'+m.matches+'" to avoid an infinite loop');if(G){var tt=_("scaleratio");tt||(tt=p.scaleratio=1),a(S,f,G,tt)}else m.scaleanchor&&l.indexOf(m.scaleanchor)!==-1&&V.warn("ignored "+p._name+'.scaleanchor: "'+m.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function n(m,p){var y=p.domain;return y||(y=m[g(p.overlaying)].domain),y[1]-y[0]}function o(m,p){for(var y=0;y<m.length;y++)if(m[y][p])return m[y];return null}function a(m,p,y,l){var x,b,S,T,M,w=o(m,p);w===null?(w={},w[p]=1,M=m.length,m.push(w)):M=m.indexOf(w);var u=Object.keys(w);for(x=0;x<m.length;x++)if(S=m[x],x!==M&&S[y]){var f=S[y];for(b=0;b<u.length;b++)T=u[b],S[T]=s(f,s(l,w[T]));m.splice(M,1);return}if(l!==1)for(b=0;b<u.length;b++){var k=u[b];w[k]=s(l,w[k])}w[y]=1}function s(m,p){var y="",l="",x,b;typeof m=="string"&&(y=m.match(/^[xy]*/)[0],x=y.length,m=+m.substr(x)),typeof p=="string"&&(l=p.match(/^[xy]*/)[0],b=l.length,p=+p.substr(b));var S=m*p;return!x&&!b?S:!x||!b||y.charAt(0)===l.charAt(0)?y+l+m*p:x===b?S:(x>b?y.substr(b):l.substr(x))+S}function h(m,p){for(var y=p._size,l=y.h/y.w,x={},b=Object.keys(m),S=0;S<b.length;S++){var T=b[S],M=m[T];if(typeof M=="string"){var w=M.match(/^[xy]*/)[0],u=w.length;M=+M.substr(u);for(var f=w.charAt(0)==="y"?l:1/l,k=0;k<u;k++)M*=f}x[T]=M}return x}X.enforce=function(m){var p=m._fullLayout,y=p._axisConstraintGroups||[],l,x,b,S,T,M,w,u;for(l=0;l<y.length;l++){b=h(y[l],p);var f=Object.keys(b),k=1/0,_=0,D=1/0,I={},O={},B=!1;for(x=0;x<f.length;x++)S=f[x],O[S]=T=p[g(S)],T._inputDomain?T.domain=T._inputDomain.slice():T._inputDomain=T.domain.slice(),T._inputRange||(T._inputRange=T.range.slice()),T.setScale(),I[S]=M=Math.abs(T._m)/b[S],k=Math.min(k,M),(T.constrain==="domain"||!T._constraintShrinkable)&&(D=Math.min(D,M)),delete T._constraintShrinkable,_=Math.max(_,M),T.constrain==="domain"&&(B=!0);if(!(k>e*_&&!B)){for(x=0;x<f.length;x++)if(S=f[x],M=I[S],T=O[S],w=T.constrain,M!==D||w==="domain")if(u=M/D,w==="range")A(T,u);else{var R=T._inputDomain,L=(T.domain[1]-T.domain[0])/(R[1]-R[0]),F=(T.r2l(T.range[1])-T.r2l(T.range[0]))/(T.r2l(T._inputRange[1])-T.r2l(T._inputRange[0]));if(u/=L,u*F<1){T.domain=T._input.domain=R.slice(),A(T,u);continue}if(F<1&&(T.range=T._input.range=T._inputRange.slice(),u*=F),T.autorange){var N=T.r2l(T.range[0]),j=T.r2l(T.range[1]),G=(N+j)/2,rt=G,ct=G,lt=Math.abs(j-G),tt=G-lt*u*1.0001,Z=G+lt*u*1.0001,st=c.makePadFn(p,T,0),$=c.makePadFn(p,T,1);v(T,u);var Q=Math.abs(T._m),nt=c.concatExtremes(m,T),Y=nt.min,q=nt.max,ot,it;for(it=0;it<Y.length;it++)ot=Y[it].val-st(Y[it])/Q,ot>tt&&ot<rt&&(rt=ot);for(it=0;it<q.length;it++)ot=q[it].val+$(q[it])/Q,ot<Z&&ot>ct&&(ct=ot);var dt=(ct-rt)/(2*lt);u/=dt,rt=T.l2r(rt),ct=T.l2r(ct),T.range=T._input.range=N<j?[rt,ct]:[ct,rt]}v(T,u)}}}},X.getAxisGroup=function(m,p){for(var y=m._axisMatchGroups,l=0;l<y.length;l++){var x=y[l];if(x[p])return"g"+l}return p},X.clean=function(m,p){if(p._inputDomain){for(var y=!1,l=p._id,x=m._fullLayout._axisConstraintGroups,b=0;b<x.length;b++)if(x[b][l]){y=!0;break}(!y||p.constrain!=="domain")&&(p._input.domain=p.domain=p._inputDomain,delete p._inputDomain)}};function v(m,p){var y=m._inputDomain,l=r[m.constraintoward],x=y[0]+(y[1]-y[0])*l;m.domain=m._input.domain=[x+(y[0]-x)/p,x+(y[1]-x)/p],m.setScale()}}),jm=Vt(X=>{var V=Ai(),c=Mi(),g=fu(),E=qr(),A=sl(),t=Bm(),e=vi(),r=go(),i=u0(),n=_b(),o=ao(),a=nh(),s=c0(),h=s.enforce,v=s.clean,m=Kf().doAutoRange,p="start",y="middle",l="end",x=xh().zindexSeparator;X.layoutStyles=function(L){return E.syncOrAsync([g.doAutoMargin,S],L)};function b(L,F,N){for(var j=0;j<N.length;j++){var G=N[j][0],rt=N[j][1];if(!(G[0]>=L[1]||G[1]<=L[0])&&rt[0]<F[1]&&rt[1]>F[0])return!0}return!1}function S(L){var F=L._fullLayout,N=F._size,j=N.p,G=o.list(L,"",!0),rt,ct,lt,tt,Z,st;if(F._paperdiv.style({width:L._context.responsive&&F.autosize&&!L._context._hasZeroWidth&&!L.layout.width?"100%":F.width+"px",height:L._context.responsive&&F.autosize&&!L._context._hasZeroHeight&&!L.layout.height?"100%":F.height+"px"}).selectAll(".main-svg").call(r.setSize,F.width,F.height),L._context.setBackground(L,F.paper_bgcolor),X.drawMainTitle(L),n.manage(L),!F._has("cartesian"))return g.previousPromises(L);function $(zt,ut,yt){var Mt=zt._lw/2;if(zt._id.charAt(0)==="x"){if(ut){if(yt==="top")return ut._offset-j-Mt}else return N.t+N.h*(1-(zt.position||0))+Mt%1;return ut._offset+ut._length+j+Mt}if(ut){if(yt==="right")return ut._offset+ut._length+j+Mt}else return N.l+N.w*(zt.position||0)+Mt%1;return ut._offset-j-Mt}for(rt=0;rt<G.length;rt++){tt=G[rt];var Q=tt._anchorAxis;tt._linepositions={},tt._lw=r.crispRound(L,tt.linewidth,1),tt._mainLinePosition=$(tt,Q,tt.side),tt._mainMirrorPosition=tt.mirror&&Q?$(tt,Q,a.OPPOSITE_SIDE[tt.side]):null}var nt=[],Y=[],q=[],ot=e.opacity(F.paper_bgcolor)===1&&e.opacity(F.plot_bgcolor)===1&&F.paper_bgcolor===F.plot_bgcolor;for(ct in F._plots)if(lt=F._plots[ct],lt.mainplot)lt.bg&<.bg.remove(),lt.bg=void 0;else{var it=lt.xaxis.domain,dt=lt.yaxis.domain,wt=lt.plotgroup;if(b(it,dt,q)&&ct.indexOf(x)===-1){var xt=wt.node(),Ft=lt.bg=E.ensureSingle(wt,"rect","bg");xt.insertBefore(Ft.node(),xt.childNodes[0]),Y.push(ct)}else wt.select("rect.bg").remove(),q.push([it,dt]),ot||(nt.push(ct),Y.push(ct))}var Et=F._bgLayer.selectAll(".bg").data(nt);for(Et.enter().append("rect").classed("bg",!0),Et.exit().remove(),Et.each(function(zt){F._plots[zt].bg=V.select(this)}),rt=0;rt<Y.length;rt++)lt=F._plots[Y[rt]],Z=lt.xaxis,st=lt.yaxis,lt.bg&&Z._offset!==void 0&&st._offset!==void 0&<.bg.call(r.setRect,Z._offset-j,st._offset-j,Z._length+2*j,st._length+2*j).call(e.fill,F.plot_bgcolor).style("stroke-width",0);if(!F._hasOnlyLargeSploms)for(ct in F._plots){lt=F._plots[ct],Z=lt.xaxis,st=lt.yaxis;var Nt=lt.clipId="clip"+F._uid+ct+"plot",te=E.ensureSingleById(F._clips,"clipPath",Nt,function(zt){zt.classed("plotclip",!0).append("rect")});lt.clipRect=te.select("rect").attr({width:Z._length,height:st._length}),r.setTranslate(lt.plot,Z._offset,st._offset);var Jt,Qt;lt._hasClipOnAxisFalse?(Jt=null,Qt=Nt):(Jt=Nt,Qt=null),r.setClipUrl(lt.plot,Jt,L),lt.layerClipId=Qt}var Wt,gt,bt,vt,Ut,Kt,Zt,le,Te,Se,Fe,Oe,ur;function fr(zt){return"M"+Wt+","+zt+"H"+gt}function We(zt){return"M"+Z._offset+","+zt+"h"+Z._length}function Lr(zt){return"M"+zt+","+le+"V"+Zt}function kr(zt){return st._shift!==void 0&&(zt+=st._shift),"M"+zt+","+st._offset+"v"+st._length}function he(zt,ut,yt){if(!zt.showline||ct!==zt._mainSubplot)return"";if(!zt._anchorAxis)return yt(zt._mainLinePosition);var Mt=ut(zt._mainLinePosition);return zt.mirror&&(Mt+=ut(zt._mainMirrorPosition)),Mt}for(ct in F._plots){lt=F._plots[ct],Z=lt.xaxis,st=lt.yaxis;var Dt="M0,0";T(Z,ct)&&(Ut=w(Z,"left",st,G),Wt=Z._offset-(Ut?j+Ut:0),Kt=w(Z,"right",st,G),gt=Z._offset+Z._length+(Kt?j+Kt:0),bt=$(Z,st,"bottom"),vt=$(Z,st,"top"),ur=!Z._anchorAxis||ct!==Z._mainSubplot,ur&&(Z.mirror==="allticks"||Z.mirror==="all")&&(Z._linepositions[ct]=[bt,vt]),Dt=he(Z,fr,We),ur&&Z.showline&&(Z.mirror==="all"||Z.mirror==="allticks")&&(Dt+=fr(bt)+fr(vt)),lt.xlines.style("stroke-width",Z._lw+"px").call(e.stroke,Z.showline?Z.linecolor:"rgba(0,0,0,0)")),lt.xlines.attr("d",Dt);var qt="M0,0";T(st,ct)&&(Fe=w(st,"bottom",Z,G),Zt=st._offset+st._length+(Fe?j:0),Oe=w(st,"top",Z,G),le=st._offset-(Oe?j:0),Te=$(st,Z,"left"),Se=$(st,Z,"right"),ur=!st._anchorAxis||ct!==st._mainSubplot,ur&&(st.mirror==="allticks"||st.mirror==="all")&&(st._linepositions[ct]=[Te,Se]),qt=he(st,Lr,kr),ur&&st.showline&&(st.mirror==="all"||st.mirror==="allticks")&&(qt+=Lr(Te)+Lr(Se)),lt.ylines.style("stroke-width",st._lw+"px").call(e.stroke,st.showline?st.linecolor:"rgba(0,0,0,0)")),lt.ylines.attr("d",qt)}return o.makeClipPaths(L),g.previousPromises(L)}function T(L,F){return(L.ticks||L.showline)&&(F===L._mainSubplot||L.mirror==="all"||L.mirror==="allticks")}function M(L,F,N){if(!N.showline||!N._lw)return!1;if(N.mirror==="all"||N.mirror==="allticks")return!0;var j=N._anchorAxis;if(!j)return!1;var G=a.FROM_BL[F];return N.side===F?j.domain[G]===L.domain[G]:N.mirror&&j.domain[1-G]===L.domain[1-G]}function w(L,F,N,j){if(M(L,F,N))return N._lw;for(var G=0;G<j.length;G++){var rt=j[G];if(rt._mainAxis===N._mainAxis&&M(L,F,rt))return rt._lw}return 0}X.drawMainTitle=function(L){var F=L._fullLayout.title,N=L._fullLayout,j=B(N),G=R(N),rt=I(N,G),ct=D(N,j);if(i.draw(L,"gtitle",{propContainer:N,propName:"title.text",subtitlePropName:"title.subtitle.text",placeholder:N._dfltTitle.plot,subtitlePlaceholder:N._dfltTitle.subtitle,attributes:{x:ct,y:rt,"text-anchor":j,dy:G}}),F.text&&F.automargin){var lt=V.selectAll(".gtitle"),tt=r.bBox(V.selectAll(".g-gtitle").node()).height,Z=k(L,F,tt);if(Z>0){_(L,rt,Z,tt),lt.attr({x:ct,y:rt,"text-anchor":j,dy:O(F.yanchor)}).call(A.positionText,ct,rt);var st=(F.text.match(A.BR_TAG_ALL)||[]).length;if(st){var $=a.LINE_SPACING*st+a.MID_SHIFT;F.y===0&&($=-$),lt.selectAll(".line").each(function(){var ot=+this.getAttribute("dy").slice(0,-2)-$+"em";this.setAttribute("dy",ot)})}var Q=V.selectAll(".gtitle-subtitle");if(Q.node()){var nt=lt.node().getBBox(),Y=nt.y+nt.height,q=Y+i.SUBTITLE_PADDING_EM*F.subtitle.font.size;Q.attr({x:ct,y:q,"text-anchor":j,dy:O(F.yanchor)}).call(A.positionText,ct,q)}}}};function u(L,F,N,j,G){var rt=F.yref==="paper"?L._fullLayout._size.h:L._fullLayout.height,ct=E.isTopAnchor(F)?j:j-G,lt=N==="b"?rt-ct:ct;return E.isTopAnchor(F)&&N==="t"||E.isBottomAnchor(F)&&N==="b"?!1:lt<G}function f(L,F,N,j,G){var rt=0;return N==="middle"&&(rt+=G/2),L==="t"?(N==="top"&&(rt+=G),rt+=j-F*j):(N==="bottom"&&(rt+=G),rt+=F*j),rt}function k(L,F,N){var j=F.y,G=F.yanchor,rt=j>.5?"t":"b",ct=L._fullLayout.margin[rt],lt=0;return F.yref==="paper"?lt=N+F.pad.t+F.pad.b:F.yref==="container"&&(lt=f(rt,j,G,L._fullLayout.height,N)+F.pad.t+F.pad.b),lt>ct?lt:0}function _(L,F,N,j){var G="title.automargin",rt=L._fullLayout.title,ct=rt.y>.5?"t":"b",lt={x:rt.x,y:rt.y,t:0,b:0},tt={};rt.yref==="paper"&&u(L,rt,ct,F,j)?lt[ct]=N:rt.yref==="container"&&(tt[ct]=N,L._fullLayout._reservedMargin[G]=tt),g.allowAutoMargin(L,G),g.autoMargin(L,G,lt)}function D(L,F){var N=L.title,j=L._size,G=0;switch(F===p?G=N.pad.l:F===l&&(G=-N.pad.r),N.xref){case"paper":return j.l+j.w*N.x+G;case"container":default:return L.width*N.x+G}}function I(L,F){var N=L.title,j=L._size,G=0;if(F==="0em"||!F?G=-N.pad.b:F===a.CAP_SHIFT+"em"&&(G=N.pad.t),N.y==="auto")return j.t/2;switch(N.yref){case"paper":return j.t+j.h-j.h*N.y+G;case"container":default:return L.height-L.height*N.y+G}}function O(L){return L==="top"?a.CAP_SHIFT+.3+"em":L==="bottom"?"-0.3em":a.MID_SHIFT+"em"}function B(L){var F=L.title,N=y;return E.isRightAnchor(F)?N=l:E.isLeftAnchor(F)&&(N=p),N}function R(L){var F=L.title,N="0em";return E.isTopAnchor(F)?N=a.CAP_SHIFT+"em":E.isMiddleAnchor(F)&&(N=a.MID_SHIFT+"em"),N}X.doTraceStyle=function(L){var F=L.calcdata,N=[],j;for(j=0;j<F.length;j++){var G=F[j],rt=G[0]||{},ct=rt.trace||{},lt=ct._module||{},tt=lt.arraysToCalcdata;tt&&tt(G,ct);var Z=lt.editStyle;Z&&N.push({fn:Z,cd0:rt})}if(N.length){for(j=0;j<N.length;j++){var st=N[j];st.fn(L,st.cd0)}t(L),X.redrawReglTraces(L)}return g.style(L),c.getComponentMethod("legend","draw")(L),g.previousPromises(L)},X.doColorBars=function(L){return c.getComponentMethod("colorbar","draw")(L),g.previousPromises(L)},X.layoutReplot=function(L){var F=L.layout;return L.layout=void 0,c.call("_doPlot",L,"",F)},X.doLegend=function(L){return c.getComponentMethod("legend","draw")(L),g.previousPromises(L)},X.doTicksRelayout=function(L){return o.draw(L,"redraw"),L._fullLayout._hasOnlyLargeSploms&&(c.subplotsRegistry.splom.updateGrid(L),t(L),X.redrawReglTraces(L)),X.drawMainTitle(L),g.previousPromises(L)},X.doModeBar=function(L){var F=L._fullLayout;n.manage(L);for(var N=0;N<F._basePlotModules.length;N++){var j=F._basePlotModules[N].updateFx;j&&j(L)}return g.previousPromises(L)},X.doCamera=function(L){for(var F=L._fullLayout,N=F._subplots.gl3d,j=0;j<N.length;j++){var G=F[N[j]],rt=G._scene;rt.setViewport(G)}},X.drawData=function(L){var F=L._fullLayout;t(L);for(var N=F._basePlotModules,j=0;j<N.length;j++)N[j].plot(L);return X.redrawReglTraces(L),g.style(L),c.getComponentMethod("selections","draw")(L),c.getComponentMethod("shapes","draw")(L),c.getComponentMethod("annotations","draw")(L),c.getComponentMethod("images","draw")(L),F._replotting=!1,g.previousPromises(L)},X.redrawReglTraces=function(L){var F=L._fullLayout;if(F._has("regl")){var N=L._fullData,j=[],G=[],rt,ct;for(F._hasOnlyLargeSploms&&F._splomGrid.draw(),rt=0;rt<N.length;rt++){var lt=N[rt];lt.visible===!0&<._length!==0&&(lt.type==="splom"?F._splomScenes[lt.uid].draw():lt.type==="scattergl"?E.pushUnique(j,lt.xaxis+lt.yaxis):lt.type==="scatterpolargl"&&E.pushUnique(G,lt.subplot))}for(rt=0;rt<j.length;rt++)ct=F._plots[j[rt]],ct._scene&&ct._scene.draw();for(rt=0;rt<G.length;rt++)ct=F[G[rt]]._subplot,ct._scene&&ct._scene.draw()}},X.doAutoRangeAndConstraints=function(L){for(var F=o.list(L,"",!0),N,j={},G=0;G<F.length;G++)if(N=F[G],!j[N._id]){j[N._id]=1,v(L,N),m(L,N);var rt=N._matchGroup;if(rt)for(var ct in rt){var lt=o.getFromId(L,ct);m(L,lt,N.range),j[ct]=1}}h(L)},X.finalDraw=function(L){c.getComponentMethod("rangeslider","draw")(L),c.getComponentMethod("rangeselector","draw")(L)},X.drawMarginPushers=function(L){c.getComponentMethod("legend","draw")(L),c.getComponentMethod("rangeselector","draw")(L),c.getComponentMethod("sliders","draw")(L),c.getComponentMethod("updatemenus","draw")(L),c.getComponentMethod("colorbar","draw")(L)}}),wb=Vt((X,V)=>{var c=Ed().readPaths,g=Wy(),E=kd().clearOutlineControllers,A=vi(),t=go(),e=Ns().arrayEditor,r=Pd(),i=r.getPathString;V.exports={draw:n,drawOne:a,activateLastSelection:v};function n(p){var y=p._fullLayout;E(p),y._selectionLayer.selectAll("path").remove();for(var l in y._plots){var x=y._plots[l].selectionLayer;x&&x.selectAll("path").remove()}for(var b=0;b<y.selections.length;b++)a(p,b)}function o(p){return p._context.editSelection}function a(p,y){p._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="'+y+'"]').remove();var l=r.makeSelectionsOptionsAndPlotinfo(p,y),x=l.options,b=l.plotinfo;if(!x._input)return;S(p._fullLayout._selectionLayer);function S(T){var M=i(p,x),w={"data-index":y,"fill-rule":"evenodd",d:M},u=x.opacity,f="rgba(0,0,0,0)",k=x.line.color||A.contrast(p._fullLayout.plot_bgcolor),_=x.line.width,D=x.line.dash;_||(_=5,D="solid");var I=o(p)&&p._fullLayout._activeSelectionIndex===y;I&&(f=p._fullLayout.activeselection.fillcolor,u=p._fullLayout.activeselection.opacity);for(var O=[],B=1;B>=0;B--){var R=T.append("path").attr(w).style("opacity",B?.1:u).call(A.stroke,k).call(A.fill,f).call(t.dashLine,B?"solid":D,B?4+_:_);if(s(R,p,x),I){var L=e(p.layout,"selections",x);R.style({cursor:"move"});var F={element:R.node(),plotinfo:b,gd:p,editHelpers:L,isActiveSelection:!0},N=c(M,p);g(N,R,F)}else R.style("pointer-events",B?"all":"none");O[B]=R}var j=O[0],G=O[1];G.node().addEventListener("click",function(){return h(p,j)})}}function s(p,y,l){var x=l.xref+l.yref;t.setClipUrl(p,"clip"+y._fullLayout._uid+x,y)}function h(p,y){if(o(p)){var l=y.node(),x=+l.getAttribute("data-index");if(x>=0){if(x===p._fullLayout._activeSelectionIndex){m(p);return}p._fullLayout._activeSelectionIndex=x,p._fullLayout._deactivateSelection=m,n(p)}}}function v(p){if(o(p)){var y=p._fullLayout.selections.length-1;p._fullLayout._activeSelectionIndex=y,p._fullLayout._deactivateSelection=m,n(p)}}function m(p){if(o(p)){var y=p._fullLayout._activeSelectionIndex;y>=0&&(E(p),delete p._fullLayout._activeSelectionIndex,n(p))}}}),$k=Vt((X,V)=>{function c(){var g,E=0,A=!1;function t(e,r){return g.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),g}return g={list:[],segmentId:function(){return E++},checkIntersection:function(e,r){return t("check",{seg1:e,seg2:r})},segmentChop:function(e,r){return t("div_seg",{seg:e,pt:r}),t("chop",{seg:e,pt:r})},statusRemove:function(e){return t("pop_seg",{seg:e})},segmentUpdate:function(e){return t("seg_update",{seg:e})},segmentNew:function(e,r){return t("new_seg",{seg:e,primary:r})},segmentRemove:function(e){return t("rem_seg",{seg:e})},tempStatus:function(e,r,i){return t("temp_status",{seg:e,above:r,below:i})},rewind:function(e){return t("rewind",{seg:e})},status:function(e,r,i){return t("status",{seg:e,above:r,below:i})},vert:function(e){return e===A?g:(A=e,t("vert",{x:e}))},log:function(e){return typeof e!="string"&&(e=JSON.stringify(e,!1," ")),t("log",{txt:e})},reset:function(){return t("reset")},selected:function(e){return t("selected",{segs:e})},chainStart:function(e){return t("chain_start",{seg:e})},chainRemoveHead:function(e,r){return t("chain_rem_head",{index:e,pt:r})},chainRemoveTail:function(e,r){return t("chain_rem_tail",{index:e,pt:r})},chainNew:function(e,r){return t("chain_new",{pt1:e,pt2:r})},chainMatch:function(e){return t("chain_match",{index:e})},chainClose:function(e){return t("chain_close",{index:e})},chainAddHead:function(e,r){return t("chain_add_head",{index:e,pt:r})},chainAddTail:function(e,r){return t("chain_add_tail",{index:e,pt:r})},chainConnect:function(e,r){return t("chain_con",{index1:e,index2:r})},chainReverse:function(e){return t("chain_rev",{index:e})},chainJoin:function(e,r){return t("chain_join",{index1:e,index2:r})},done:function(){return t("done")}},g}V.exports=c}),Jk=Vt((X,V)=>{function c(g){typeof g!="number"&&(g=1e-10);var E={epsilon:function(A){return typeof A=="number"&&(g=A),g},pointAboveOrOnLine:function(A,t,e){var r=t[0],i=t[1],n=e[0],o=e[1],a=A[0],s=A[1];return(n-r)*(s-i)-(o-i)*(a-r)>=-g},pointBetween:function(A,t,e){var r=A[1]-t[1],i=e[0]-t[0],n=A[0]-t[0],o=e[1]-t[1],a=n*i+r*o;if(a<g)return!1;var s=i*i+o*o;return!(a-s>-g)},pointsSameX:function(A,t){return Math.abs(A[0]-t[0])<g},pointsSameY:function(A,t){return Math.abs(A[1]-t[1])<g},pointsSame:function(A,t){return E.pointsSameX(A,t)&&E.pointsSameY(A,t)},pointsCompare:function(A,t){return E.pointsSameX(A,t)?E.pointsSameY(A,t)?0:A[1]<t[1]?-1:1:A[0]<t[0]?-1:1},pointsCollinear:function(A,t,e){var r=A[0]-t[0],i=A[1]-t[1],n=t[0]-e[0],o=t[1]-e[1];return Math.abs(r*o-n*i)<g},linesIntersect:function(A,t,e,r){var i=t[0]-A[0],n=t[1]-A[1],o=r[0]-e[0],a=r[1]-e[1],s=i*a-n*o;if(Math.abs(s)<g)return!1;var h=A[0]-e[0],v=A[1]-e[1],m=(o*v-a*h)/s,p=(i*v-n*h)/s,y={alongA:0,alongB:0,pt:[A[0]+m*i,A[1]+m*n]};return m<=-g?y.alongA=-2:m<g?y.alongA=-1:m-1<=-g?y.alongA=0:m-1<g?y.alongA=1:y.alongA=2,p<=-g?y.alongB=-2:p<g?y.alongB=-1:p-1<=-g?y.alongB=0:p-1<g?y.alongB=1:y.alongB=2,y},pointInsideRegion:function(A,t){for(var e=A[0],r=A[1],i=t[t.length-1][0],n=t[t.length-1][1],o=!1,a=0;a<t.length;a++){var s=t[a][0],h=t[a][1];h-r>g!=n-r>g&&(i-s)*(r-h)/(n-h)+s-e>g&&(o=!o),i=s,n=h}return o}};return E}V.exports=c}),Qk=Vt((X,V)=>{var c={create:function(){var g={root:{root:!0,next:null},exists:function(E){return!(E===null||E===g.root)},isEmpty:function(){return g.root.next===null},getHead:function(){return g.root.next},insertBefore:function(E,A){for(var t=g.root,e=g.root.next;e!==null;){if(A(e)){E.prev=e.prev,E.next=e,e.prev.next=E,e.prev=E;return}t=e,e=e.next}t.next=E,E.prev=t,E.next=null},findTransition:function(E){for(var A=g.root,t=g.root.next;t!==null&&!E(t);)A=t,t=t.next;return{before:A===g.root?null:A,after:t,insert:function(e){return e.prev=A,e.next=t,A.next=e,t!==null&&(t.prev=e),e}}}};return g},node:function(g){return g.prev=null,g.next=null,g.remove=function(){g.prev.next=g.next,g.next&&(g.next.prev=g.prev),g.prev=null,g.next=null},g}};V.exports=c}),Yk=Vt((X,V)=>{var c=Qk();function g(E,A,t){function e(y,l){return{id:t?t.segmentId():-1,start:y,end:l,myFill:{above:null,below:null},otherFill:null}}function r(y,l,x){return{id:t?t.segmentId():-1,start:y,end:l,myFill:{above:x.myFill.above,below:x.myFill.below},otherFill:null}}var i=c.create();function n(y,l,x,b,S,T){var M=A.pointsCompare(l,S);return M!==0?M:A.pointsSame(x,T)?0:y!==b?y?1:-1:A.pointAboveOrOnLine(x,b?S:T,b?T:S)?1:-1}function o(y,l){i.insertBefore(y,function(x){var b=n(y.isStart,y.pt,l,x.isStart,x.pt,x.other.pt);return b<0})}function a(y,l){var x=c.node({isStart:!0,pt:y.start,seg:y,primary:l,other:null,status:null});return o(x,y.end),x}function s(y,l,x){var b=c.node({isStart:!1,pt:l.end,seg:l,primary:x,other:y,status:null});y.other=b,o(b,y.pt)}function h(y,l){var x=a(y,l);return s(x,y,l),x}function v(y,l){t&&t.segmentChop(y.seg,l),y.other.remove(),y.seg.end=l,y.other.pt=l,o(y.other,y.pt)}function m(y,l){var x=r(l,y.seg.end,y.seg);return v(y,l),h(x,y.primary)}function p(y,l){var x=c.create();function b(R,L){var F=R.seg.start,N=R.seg.end,j=L.seg.start,G=L.seg.end;return A.pointsCollinear(F,j,G)?A.pointsCollinear(N,j,G)||A.pointAboveOrOnLine(N,j,G)?1:-1:A.pointAboveOrOnLine(F,j,G)?1:-1}function S(R){return x.findTransition(function(L){var F=b(R,L.ev);return F>0})}function T(R,L){var F=R.seg,N=L.seg,j=F.start,G=F.end,rt=N.start,ct=N.end;t&&t.checkIntersection(F,N);var lt=A.linesIntersect(j,G,rt,ct);if(lt===!1){if(!A.pointsCollinear(j,G,rt)||A.pointsSame(j,ct)||A.pointsSame(G,rt))return!1;var tt=A.pointsSame(j,rt),Z=A.pointsSame(G,ct);if(tt&&Z)return L;var st=!tt&&A.pointBetween(j,rt,ct),$=!Z&&A.pointBetween(G,rt,ct);if(tt)return $?m(L,G):m(R,ct),L;st&&(Z||($?m(L,G):m(R,ct)),m(L,j))}else lt.alongA===0&&(lt.alongB===-1?m(R,rt):lt.alongB===0?m(R,lt.pt):lt.alongB===1&&m(R,ct)),lt.alongB===0&&(lt.alongA===-1?m(L,j):lt.alongA===0?m(L,lt.pt):lt.alongA===1&&m(L,G));return!1}for(var M=[];!i.isEmpty();){var w=i.getHead();if(t&&t.vert(w.pt[0]),w.isStart){let R=function(){if(f){var L=T(w,f);if(L)return L}return k?T(w,k):!1};t&&t.segmentNew(w.seg,w.primary);var u=S(w),f=u.before?u.before.ev:null,k=u.after?u.after.ev:null;t&&t.tempStatus(w.seg,f?f.seg:!1,k?k.seg:!1);var _=R();if(_){if(E){var D;w.seg.myFill.below===null?D=!0:D=w.seg.myFill.above!==w.seg.myFill.below,D&&(_.seg.myFill.above=!_.seg.myFill.above)}else _.seg.otherFill=w.seg.myFill;t&&t.segmentUpdate(_.seg),w.other.remove(),w.remove()}if(i.getHead()!==w){t&&t.rewind(w.seg);continue}if(E){var D;w.seg.myFill.below===null?D=!0:D=w.seg.myFill.above!==w.seg.myFill.below,k?w.seg.myFill.below=k.seg.myFill.above:w.seg.myFill.below=y,D?w.seg.myFill.above=!w.seg.myFill.below:w.seg.myFill.above=w.seg.myFill.below}else if(w.seg.otherFill===null){var I;k?w.primary===k.primary?I=k.seg.otherFill.above:I=k.seg.myFill.above:I=w.primary?l:y,w.seg.otherFill={above:I,below:I}}t&&t.status(w.seg,f?f.seg:!1,k?k.seg:!1),w.other.status=u.insert(c.node({ev:w}))}else{var O=w.status;if(O===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(x.exists(O.prev)&&x.exists(O.next)&&T(O.prev.ev,O.next.ev),t&&t.statusRemove(O.ev.seg),O.remove(),!w.primary){var B=w.seg.myFill;w.seg.myFill=w.seg.otherFill,w.seg.otherFill=B}M.push(w.seg)}i.getHead().remove()}return t&&t.done(),M}return E?{addRegion:function(y){for(var l,x=y[y.length-1],b=0;b<y.length;b++){l=x,x=y[b];var S=A.pointsCompare(l,x);S!==0&&h(e(S<0?l:x,S<0?x:l),!0)}},calculate:function(y){return p(y,!1)}}:{calculate:function(y,l,x,b){return y.forEach(function(S){h(r(S.start,S.end,S),!0)}),x.forEach(function(S){h(r(S.start,S.end,S),!1)}),p(l,b)}}}V.exports=g}),Kk=Vt((X,V)=>{function c(g,E,A){var t=[],e=[];return g.forEach(function(r){var i=r.start,n=r.end;if(E.pointsSame(i,n)){console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");return}A&&A.chainStart(r);var o={index:0,matches_head:!1,matches_pt1:!1},a={index:0,matches_head:!1,matches_pt1:!1},s=o;function h(I,O,B){return s.index=I,s.matches_head=O,s.matches_pt1=B,s===o?(s=a,!1):(s=null,!0)}for(var v=0;v<t.length;v++){var m=t[v],p=m[0];m[1];var y=m[m.length-1];if(m[m.length-2],E.pointsSame(p,i)){if(h(v,!0,!0))break}else if(E.pointsSame(p,n)){if(h(v,!0,!1))break}else if(E.pointsSame(y,i)){if(h(v,!1,!0))break}else if(E.pointsSame(y,n)&&h(v,!1,!1))break}if(s===o){t.push([i,n]),A&&A.chainNew(i,n);return}if(s===a){A&&A.chainMatch(o.index);var l=o.index,x=o.matches_pt1?n:i,b=o.matches_head,m=t[l],S=b?m[0]:m[m.length-1],T=b?m[1]:m[m.length-2],M=b?m[m.length-1]:m[0],w=b?m[m.length-2]:m[1];if(E.pointsCollinear(T,S,x)&&(b?(A&&A.chainRemoveHead(o.index,x),m.shift()):(A&&A.chainRemoveTail(o.index,x),m.pop()),S=T),E.pointsSame(M,x)){t.splice(l,1),E.pointsCollinear(w,M,S)&&(b?(A&&A.chainRemoveTail(o.index,S),m.pop()):(A&&A.chainRemoveHead(o.index,S),m.shift())),A&&A.chainClose(o.index),e.push(m);return}b?(A&&A.chainAddHead(o.index,x),m.unshift(x)):(A&&A.chainAddTail(o.index,x),m.push(x));return}function u(I){A&&A.chainReverse(I),t[I].reverse()}function f(I,O){var B=t[I],R=t[O],L=B[B.length-1],F=B[B.length-2],N=R[0],j=R[1];E.pointsCollinear(F,L,N)&&(A&&A.chainRemoveTail(I,L),B.pop(),L=F),E.pointsCollinear(L,N,j)&&(A&&A.chainRemoveHead(O,N),R.shift()),A&&A.chainJoin(I,O),t[I]=B.concat(R),t.splice(O,1)}var k=o.index,_=a.index;A&&A.chainConnect(k,_);var D=t[k].length<t[_].length;o.matches_head?a.matches_head?D?(u(k),f(k,_)):(u(_),f(_,k)):f(_,k):a.matches_head?f(k,_):D?(u(k),f(_,k)):(u(_),f(k,_))}),e}V.exports=c}),t4=Vt((X,V)=>{function c(E,A,t){var e=[];return E.forEach(function(r){var i=(r.myFill.above?8:0)+(r.myFill.below?4:0)+(r.otherFill&&r.otherFill.above?2:0)+(r.otherFill&&r.otherFill.below?1:0);A[i]!==0&&e.push({id:t?t.segmentId():-1,start:r.start,end:r.end,myFill:{above:A[i]===1,below:A[i]===2},otherFill:null})}),t&&t.selected(e),e}var g={union:function(E,A){return c(E,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],A)},intersect:function(E,A){return c(E,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],A)},difference:function(E,A){return c(E,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],A)},differenceRev:function(E,A){return c(E,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],A)},xor:function(E,A){return c(E,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],A)}};V.exports=g}),e4=Vt((X,V)=>{var c={toPolygon:function(g,E){function A(r){if(r.length<=0)return g.segments({inverted:!1,regions:[]});function i(a){var s=a.slice(0,a.length-1);return g.segments({inverted:!1,regions:[s]})}for(var n=i(r[0]),o=1;o<r.length;o++)n=g.selectDifference(g.combine(n,i(r[o])));return n}if(E.type==="Polygon")return g.polygon(A(E.coordinates));if(E.type==="MultiPolygon"){for(var t=g.segments({inverted:!1,regions:[]}),e=0;e<E.coordinates.length;e++)t=g.selectUnion(g.combine(t,A(E.coordinates[e])));return g.polygon(t)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(g,E,A){A=g.polygon(g.segments(A));function t(m,p){return E.pointInsideRegion([(m[0][0]+m[1][0])*.5,(m[0][1]+m[1][1])*.5],p)}function e(m){return{region:m,children:[]}}var r=e(null);function i(m,p){for(var y=0;y<m.children.length;y++){var l=m.children[y];if(t(p,l.region)){i(l,p);return}}for(var x=e(p),y=0;y<m.children.length;y++){var l=m.children[y];t(l.region,p)&&(x.children.push(l),m.children.splice(y,1),y--)}m.children.push(x)}for(var n=0;n<A.regions.length;n++){var o=A.regions[n];o.length<3||i(r,o)}function a(m,p){for(var y=0,l=m[m.length-1][0],x=m[m.length-1][1],b=[],S=0;S<m.length;S++){var T=m[S][0],M=m[S][1];b.push([T,M]),y+=M*l-T*x,l=T,x=M}var w=y<0;return w!==p&&b.reverse(),b.push([b[0][0],b[0][1]]),b}var s=[];function h(m){var p=[a(m.region,!1)];s.push(p);for(var y=0;y<m.children.length;y++)p.push(v(m.children[y]))}function v(m){for(var p=0;p<m.children.length;p++)h(m.children[p]);return a(m.region,!0)}for(var n=0;n<r.children.length;n++)h(r.children[n]);return s.length<=0?{type:"Polygon",coordinates:[]}:s.length==1?{type:"Polygon",coordinates:s[0]}:{type:"MultiPolygon",coordinates:s}}};V.exports=c}),r4=Vt((X,V)=>{var c=$k(),g=Jk(),E=Yk(),A=Kk(),t=t4(),e=e4(),r=!1,i=g(),n;n={buildLog:function(a){return a===!0?r=c():a===!1&&(r=!1),r===!1?!1:r.list},epsilon:function(a){return i.epsilon(a)},segments:function(a){var s=E(!0,i,r);return a.regions.forEach(s.addRegion),{segments:s.calculate(a.inverted),inverted:a.inverted}},combine:function(a,s){var h=E(!1,i,r);return{combined:h.calculate(a.segments,a.inverted,s.segments,s.inverted),inverted1:a.inverted,inverted2:s.inverted}},selectUnion:function(a){return{segments:t.union(a.combined,r),inverted:a.inverted1||a.inverted2}},selectIntersect:function(a){return{segments:t.intersect(a.combined,r),inverted:a.inverted1&&a.inverted2}},selectDifference:function(a){return{segments:t.difference(a.combined,r),inverted:a.inverted1&&!a.inverted2}},selectDifferenceRev:function(a){return{segments:t.differenceRev(a.combined,r),inverted:!a.inverted1&&a.inverted2}},selectXor:function(a){return{segments:t.xor(a.combined,r),inverted:a.inverted1!==a.inverted2}},polygon:function(a){return{regions:A(a.segments,i,r),inverted:a.inverted}},polygonFromGeoJSON:function(a){return e.toPolygon(n,a)},polygonToGeoJSON:function(a){return e.fromPolygon(n,i,a)},union:function(a,s){return o(a,s,n.selectUnion)},intersect:function(a,s){return o(a,s,n.selectIntersect)},difference:function(a,s){return o(a,s,n.selectDifference)},differenceRev:function(a,s){return o(a,s,n.selectDifferenceRev)},xor:function(a,s){return o(a,s,n.selectXor)}};function o(a,s,h){var v=n.segments(a),m=n.segments(s),p=n.combine(v,m),y=h(p);return n.polygon(y)}typeof window=="object"&&(window.PolyBool=n),V.exports=n}),n4=Vt((X,V)=>{V.exports=function(c,g,E,A){var t=c[0],e=c[1],r=!1;E===void 0&&(E=0),A===void 0&&(A=g.length);for(var i=A-E,n=0,o=i-1;n<i;o=n++){var a=g[n+E][0],s=g[n+E][1],h=g[o+E][0],v=g[o+E][1],m=s>e!=v>e&&t<(h-a)*(e-s)/(v-s)+a;m&&(r=!r)}return r}}),Nm=Vt((X,V)=>{var c=Dy().dot,g=ts().BADNUM,E=V.exports={};E.tester=function(A){var t=A.slice(),e=t[0][0],r=e,i=t[0][1],n=i,o;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),o=1;o<t.length;o++)e=Math.min(e,t[o][0]),r=Math.max(r,t[o][0]),i=Math.min(i,t[o][1]),n=Math.max(n,t[o][1]);var a=!1,s;t.length===5&&(t[0][0]===t[1][0]?t[2][0]===t[3][0]&&t[0][1]===t[3][1]&&t[1][1]===t[2][1]&&(a=!0,s=function(y){return y[0]===t[0][0]}):t[0][1]===t[1][1]&&t[2][1]===t[3][1]&&t[0][0]===t[3][0]&&t[1][0]===t[2][0]&&(a=!0,s=function(y){return y[1]===t[0][1]}));function h(y,l){var x=y[0],b=y[1];return!(x===g||x<e||x>r||b===g||b<i||b>n||l&&s(y))}function v(y,l){var x=y[0],b=y[1];if(x===g||x<e||x>r||b===g||b<i||b>n)return!1;var S=t.length,T=t[0][0],M=t[0][1],w=0,u,f,k,_,D;for(u=1;u<S;u++)if(f=T,k=M,T=t[u][0],M=t[u][1],_=Math.min(f,T),!(x<_||x>Math.max(f,T)||b>Math.max(k,M)))if(b<Math.min(k,M))x!==_&&w++;else{if(T===f?D=b:D=k+(x-f)*(M-k)/(T-f),b===D)return!(u===1&&l);b<=D&&x!==_&&w++}return w%2===1}var m=!0,p=t[0];for(o=1;o<t.length;o++)if(p[0]!==t[o][0]||p[1]!==t[o][1]){m=!1;break}return{xmin:e,xmax:r,ymin:i,ymax:n,pts:t,contains:a?h:v,isRect:a,degenerate:m}},E.isSegmentBent=function(A,t,e,r){var i=A[t],n=[A[e][0]-i[0],A[e][1]-i[1]],o=c(n,n),a=Math.sqrt(o),s=[-n[1]/a,n[0]/a],h,v,m;for(h=t+1;h<e;h++)if(v=[A[h][0]-i[0],A[h][1]-i[1]],m=c(v,n),m<0||m>o||Math.abs(c(v,s))>r)return!0;return!1},E.filter=function(A,t){var e=[A[0]],r=0,i=0;function n(a){A.push(a);var s=e.length,h=r;e.splice(i+1);for(var v=h+1;v<A.length;v++)(v===A.length-1||E.isSegmentBent(A,h,v+1,t))&&(e.push(A[v]),e.length<s-2&&(r=v,i=e.length-1),h=v)}if(A.length>1){var o=A.pop();n(o)}return{addPt:n,raw:A,filtered:e}}}),a4=Vt((X,V)=>{V.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}),i4=Vt((X,V)=>{var c=r4(),g=n4(),E=Mi(),A=go().dashStyle,t=vi(),e=Hu(),r=vf().makeEventData,i=ep(),n=i.freeMode,o=i.rectMode,a=i.drawMode,s=i.openMode,h=i.selectMode,v=Pd(),m=Rm(),p=Wy(),y=kd().clearOutline,l=Ed(),x=l.handleEllipse,b=l.readPaths,S=Gy().newShapes,T=gb(),M=wb().activateLastSelection,w=qr(),u=w.sorterAsc,f=Nm(),k=By(),_=rc().getFromId,D=Bm(),I=jm().redrawReglTraces,O=a4(),B=O.MINSELECT,R=f.filter,L=f.tester,F=Hy(),N=F.p2r,j=F.axValue,G=F.getTransform;function rt(Dt){return Dt.subplot!==void 0}function ct(Dt,qt,zt,ut,yt){var Mt=!rt(ut),Ot=n(yt),$t=o(yt),ee=s(yt),we=a(yt),Me=h(yt),Re=yt==="drawline",Be=yt==="drawcircle",Ze=Re||Be,Ue=ut.gd,mr=Ue._fullLayout,ln=Me&&mr.newselection.mode==="immediate"&&Mt,an=mr._zoomlayer,vn=ut.element.getBoundingClientRect(),Sn=ut.plotinfo,An=G(Sn),pn=qt-vn.left,On=zt-vn.top;mr._calcInverseTransform(Ue);var Nn=w.apply3DTransform(mr._invTransform)(pn,On);pn=Nn[0],On=Nn[1];var ke=mr._invScaleX,ze=mr._invScaleY,je=pn,Ne=On,_r="M"+pn+","+On,Xr=ut.xaxes[0],rn=ut.yaxes[0],Br=Xr._length,_n=rn._length,bn=Dt.altKey&&!(a(yt)&&ee),Fn,on,Bn,ue,xe,Pr,Sr;Q(Dt,Ue,ut),Ot&&(Fn=R([[pn,On]],O.BENDPX));var gr=an.selectAll("path.select-outline-"+Sn.id).data([1]),dr=we?mr.newshape:mr.newselection;we&&(ut.hasText=dr.label.text||dr.label.texttemplate);var Er=we&&!ee?dr.fillcolor:"rgba(0,0,0,0)",Dr=dr.line.color||(Mt?t.contrast(Ue._fullLayout.plot_bgcolor):"#7f7f7f");gr.enter().append("path").attr("class","select-outline select-outline-"+Sn.id).style({opacity:we?dr.opacity/2:1,"stroke-dasharray":A(dr.line.dash,dr.line.width),"stroke-width":dr.line.width+"px","shape-rendering":"crispEdges"}).call(t.stroke,Dr).call(t.fill,Er).attr("fill-rule","evenodd").classed("cursor-move",!!we).attr("transform",An).attr("d",_r+"Z");var Ar=an.append("path").attr("class","zoombox-corners").style({fill:t.background,stroke:t.defaultLine,"stroke-width":1}).attr("transform",An).attr("d","M0,0Z");if(we&&ut.hasText){var Gr=an.select(".label-temp");Gr.empty()&&(Gr=an.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Wr=mr._uid+O.SELECTID,Jr=[],_e=it(Ue,ut.xaxes,ut.yaxes,ut.subplot);ln&&!Dt.shiftKey&&(ut._clearSubplotSelections=function(){if(Mt){var yr=Xr._id,Hr=rn._id;Zt(Ue,yr,Hr,_e);for(var hn=(Ue.layout||{}).selections||[],En=[],dn=!1,Kr=0;Kr<hn.length;Kr++){var Tn=mr.selections[Kr];!Tn||Tn.xref!==yr||Tn.yref!==Hr?En.push(hn[Kr]):dn=!0}dn&&(Ue._fullLayout._noEmitSelectedAtStart=!0,E.call("_guiRelayout",Ue,{selections:En}))}});var Je=We(ut);ut.moveFn=function(yr,Hr){ut._clearSubplotSelections&&(ut._clearSubplotSelections(),ut._clearSubplotSelections=void 0),je=Math.max(0,Math.min(Br,ke*yr+pn)),Ne=Math.max(0,Math.min(_n,ze*Hr+On));var hn=Math.abs(je-pn),En=Math.abs(Ne-On);if($t){var dn,Kr,Tn;if(Me){var ta=mr.selectdirection;switch(ta==="any"?En<Math.min(hn*.6,B)?dn="h":hn<Math.min(En*.6,B)?dn="v":dn="d":dn=ta,dn){case"h":Kr=Be?_n/2:0,Tn=_n;break;case"v":Kr=Be?Br/2:0,Tn=Br;break}}if(we)switch(mr.newshape.drawdirection){case"vertical":dn="h",Kr=Be?_n/2:0,Tn=_n;break;case"horizontal":dn="v",Kr=Be?Br/2:0,Tn=Br;break;case"ortho":hn<En?(dn="h",Kr=On,Tn=Ne):(dn="v",Kr=pn,Tn=je);break;default:dn="d"}dn==="h"?(ue=Ze?x(Be,[je,Kr],[je,Tn]):[[pn,Kr],[pn,Tn],[je,Tn],[je,Kr]],ue.xmin=Ze?je:Math.min(pn,je),ue.xmax=Ze?je:Math.max(pn,je),ue.ymin=Math.min(Kr,Tn),ue.ymax=Math.max(Kr,Tn),Ar.attr("d","M"+ue.xmin+","+(On-B)+"h-4v"+2*B+"h4ZM"+(ue.xmax-1)+","+(On-B)+"h4v"+2*B+"h-4Z")):dn==="v"?(ue=Ze?x(Be,[Kr,Ne],[Tn,Ne]):[[Kr,On],[Kr,Ne],[Tn,Ne],[Tn,On]],ue.xmin=Math.min(Kr,Tn),ue.xmax=Math.max(Kr,Tn),ue.ymin=Ze?Ne:Math.min(On,Ne),ue.ymax=Ze?Ne:Math.max(On,Ne),Ar.attr("d","M"+(pn-B)+","+ue.ymin+"v-4h"+2*B+"v4ZM"+(pn-B)+","+(ue.ymax-1)+"v4h"+2*B+"v-4Z")):dn==="d"&&(ue=Ze?x(Be,[pn,On],[je,Ne]):[[pn,On],[pn,Ne],[je,Ne],[je,On]],ue.xmin=Math.min(pn,je),ue.xmax=Math.max(pn,je),ue.ymin=Math.min(On,Ne),ue.ymax=Math.max(On,Ne),Ar.attr("d","M0,0Z"))}else Ot&&(Fn.addPt([je,Ne]),ue=Fn.filtered);if(ut.selectionDefs&&ut.selectionDefs.length?(Bn=Qt(ut.mergedPolygons,ue,bn),ue.subtract=bn,on=$(ut.selectionDefs.concat([ue]))):(Bn=[ue],on=L(ue)),p(gt(Bn,ee),gr,ut),Me){var Qn=vt(Ue,!1),Va=Qn.eventData?Qn.eventData.points.slice():[];Qn=vt(Ue,!1,on,_e,ut),on=Qn.selectionTesters,Sr=Qn.eventData;var ja;Fn?ja=Fn.filtered:ja=Oe(Bn),k.throttle(Wr,O.SELECTDELAY,function(){Jr=bt(on,_e);for(var ci=Jr.slice(),pi=0;pi<Va.length;pi++){for(var bi=Va[pi],ri=!1,Da=0;Da<ci.length;Da++)if(ci[Da].curveNumber===bi.curveNumber&&ci[Da].pointNumber===bi.pointNumber){ri=!0;break}ri||ci.push(bi)}ci.length&&(Sr||(Sr={}),Sr.points=ci),Je(Sr,ja),Lr(Ue,Sr)})}},ut.clickFn=function(yr,Hr){if(Ar.remove(),Ue._fullLayout._activeShapeIndex>=0){Ue._fullLayout._deactivateShape(Ue);return}if(!we){var hn=mr.clickmode;k.done(Wr).then(function(){if(k.clear(Wr),yr===2){for(gr.remove(),xe=0;xe<_e.length;xe++)Pr=_e[xe],Pr._module.selectPoints(Pr,!1);if(te(Ue,_e),q(ut),he(Ue),_e.length){var En=_e[0].xaxis,dn=_e[0].yaxis;if(En&&dn){for(var Kr=[],Tn=Ue._fullLayout.selections,ta=0;ta<Tn.length;ta++){var Qn=Tn[ta];Qn&&(Qn.xref!==En._id||Qn.yref!==dn._id)&&Kr.push(Qn)}Kr.length<Tn.length&&(Ue._fullLayout._noEmitSelectedAtStart=!0,E.call("_guiRelayout",Ue,{selections:Kr}))}}}else hn.indexOf("select")>-1&<(Hr,Ue,ut.xaxes,ut.yaxes,ut.subplot,ut,gr),hn==="event"&&kr(Ue,void 0);e.click(Ue,Hr,Sn.id)}).catch(w.error)}},ut.doneFn=function(){Ar.remove(),k.done(Wr).then(function(){k.clear(Wr),!ln&&ue&&ut.selectionDefs&&(ue.subtract=bn,ut.selectionDefs.push(ue),ut.mergedPolygons.length=0,[].push.apply(ut.mergedPolygons,Bn)),(ln||we)&&q(ut,ln),ut.doneFnCompleted&&ut.doneFnCompleted(Jr),Me&&kr(Ue,Sr)}).catch(w.error)}}function lt(Dt,qt,zt,ut,yt,Mt,Ot){var $t=qt._hoverdata,ee=qt._fullLayout,we=ee.clickmode,Me=we.indexOf("event")>-1,Re=[],Be,Ze,Ue,mr,ln,an,vn,Sn,An,pn;if(wt($t)){Q(Dt,qt,Mt),Be=it(qt,zt,ut,yt);var On=xt($t,Be),Nn=On.pointNumbers.length>0;if(Nn?Et(Be,On):Nt(Be)&&(vn=Ft(On))){for(Ot&&Ot.remove(),pn=0;pn<Be.length;pn++)Ze=Be[pn],Ze._module.selectPoints(Ze,!1);te(qt,Be),q(Mt),Me&&he(qt)}else{Sn=Dt.shiftKey&&(vn!==void 0?vn:Ft(On)),Ue=tt(On.pointNumber,On.searchInfo,Sn);var ke=Mt.selectionDefs.concat([Ue]);for(mr=$(ke),pn=0;pn<Be.length;pn++)if(ln=Be[pn]._module.selectPoints(Be[pn],mr),an=Wt(ln,Be[pn]),Re.length)for(var ze=0;ze<an.length;ze++)Re.push(an[ze]);else Re=an;if(An={points:Re},te(qt,Be,An),Ue&&Mt&&Mt.selectionDefs.push(Ue),Ot){var je=Mt.mergedPolygons,Ne=s(Mt.dragmode);p(gt(je,Ne),Ot,Mt)}Me&&kr(qt,An)}}}function tt(Dt,qt,zt){return{pointNumber:Dt,searchInfo:qt,subtract:!!zt}}function Z(Dt){return"pointNumber"in Dt&&"searchInfo"in Dt}function st(Dt){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(qt,zt,ut,yt){var Mt=Dt.searchInfo.cd[0].trace.index,Ot=yt.cd[0].trace.index;return Ot===Mt&&ut===Dt.pointNumber},isRect:!1,degenerate:!1,subtract:!!Dt.subtract}}function $(Dt){if(!Dt.length)return;for(var qt=[],zt=Z(Dt[0])?0:Dt[0][0][0],ut=zt,yt=Z(Dt[0])?0:Dt[0][0][1],Mt=yt,Ot=0;Ot<Dt.length;Ot++)if(Z(Dt[Ot]))qt.push(st(Dt[Ot]));else{var $t=L(Dt[Ot]);$t.subtract=!!Dt[Ot].subtract,qt.push($t),zt=Math.min(zt,$t.xmin),ut=Math.max(ut,$t.xmax),yt=Math.min(yt,$t.ymin),Mt=Math.max(Mt,$t.ymax)}function ee(we,Me,Re,Be){for(var Ze=!1,Ue=0;Ue<qt.length;Ue++)qt[Ue].contains(we,Me,Re,Be)&&(Ze=!qt[Ue].subtract);return Ze}return{xmin:zt,xmax:ut,ymin:yt,ymax:Mt,pts:[],contains:ee,isRect:!1,degenerate:!1}}function Q(Dt,qt,zt){var ut=qt._fullLayout,yt=zt.plotinfo,Mt=zt.dragmode,Ot=ut._lastSelectedSubplot&&ut._lastSelectedSubplot===yt.id,$t=(Dt.shiftKey||Dt.altKey)&&!(a(Mt)&&s(Mt));Ot&&$t&&yt.selection&&yt.selection.selectionDefs&&!zt.selectionDefs?(zt.selectionDefs=yt.selection.selectionDefs,zt.mergedPolygons=yt.selection.mergedPolygons):(!$t||!yt.selection)&&q(zt),Ot||(y(qt),ut._lastSelectedSubplot=yt.id)}function nt(Dt){return Dt._fullLayout._activeShapeIndex>=0}function Y(Dt){return Dt._fullLayout._activeSelectionIndex>=0}function q(Dt,qt){var zt=Dt.dragmode,ut=Dt.plotinfo,yt=Dt.gd;nt(yt)&&yt._fullLayout._deactivateShape(yt),Y(yt)&&yt._fullLayout._deactivateSelection(yt);var Mt=yt._fullLayout,Ot=Mt._zoomlayer,$t=a(zt),ee=h(zt);if($t||ee){var we=Ot.selectAll(".select-outline-"+ut.id);if(we&&yt._fullLayout._outlining){var Me;$t&&(Me=S(we,Dt)),Me&&E.call("_guiRelayout",yt,{shapes:Me});var Re;ee&&!rt(Dt)&&(Re=T(we,Dt)),Re&&(yt._fullLayout._noEmitSelectedAtStart=!0,E.call("_guiRelayout",yt,{selections:Re}).then(function(){qt&&M(yt)})),yt._fullLayout._outlining=!1}}ut.selection={},ut.selection.selectionDefs=Dt.selectionDefs=[],ut.selection.mergedPolygons=Dt.mergedPolygons=[]}function ot(Dt){return Dt._id}function it(Dt,qt,zt,ut){if(!Dt.calcdata)return[];var yt=[],Mt=qt.map(ot),Ot=zt.map(ot),$t,ee,we;for(we=0;we<Dt.calcdata.length;we++)if($t=Dt.calcdata[we],ee=$t[0].trace,!(ee.visible!==!0||!ee._module||!ee._module.selectPoints))if(rt({subplot:ut})&&(ee.subplot===ut||ee.geo===ut))yt.push(dt(ee._module,$t,qt[0],zt[0]));else if(ee.type==="splom"){if(ee._xaxes[Mt[0]]&&ee._yaxes[Ot[0]]){var Me=dt(ee._module,$t,qt[0],zt[0]);Me.scene=Dt._fullLayout._splomScenes[ee.uid],yt.push(Me)}}else if(ee.type==="sankey"){var Re=dt(ee._module,$t,qt[0],zt[0]);yt.push(Re)}else{if(Mt.indexOf(ee.xaxis)===-1&&(!ee._xA||!ee._xA.overlaying)||Ot.indexOf(ee.yaxis)===-1&&(!ee._yA||!ee._yA.overlaying))continue;yt.push(dt(ee._module,$t,_(Dt,ee.xaxis),_(Dt,ee.yaxis)))}return yt}function dt(Dt,qt,zt,ut){return{_module:Dt,cd:qt,xaxis:zt,yaxis:ut}}function wt(Dt){return Dt&&Array.isArray(Dt)&&Dt[0].hoverOnBox!==!0}function xt(Dt,qt){var zt=Dt[0],ut=-1,yt=[],Mt,Ot;for(Ot=0;Ot<qt.length;Ot++)if(Mt=qt[Ot],zt.fullData.index===Mt.cd[0].trace.index){if(zt.hoverOnBox===!0)break;zt.pointNumber!==void 0?ut=zt.pointNumber:zt.binNumber!==void 0&&(ut=zt.binNumber,yt=zt.pointNumbers);break}return{pointNumber:ut,pointNumbers:yt,searchInfo:Mt}}function Ft(Dt){var qt=Dt.searchInfo.cd[0].trace,zt=Dt.pointNumber,ut=Dt.pointNumbers,yt=ut.length>0,Mt=yt?ut[0]:zt;return qt.selectedpoints?qt.selectedpoints.indexOf(Mt)>-1:!1}function Et(Dt,qt){var zt=[],ut,yt,Mt,Ot;for(Ot=0;Ot<Dt.length;Ot++)ut=Dt[Ot],ut.cd[0].trace.selectedpoints&&ut.cd[0].trace.selectedpoints.length>0&&zt.push(ut);if(zt.length===1&&(Mt=zt[0]===qt.searchInfo,Mt&&(yt=qt.searchInfo.cd[0].trace,yt.selectedpoints.length===qt.pointNumbers.length))){for(Ot=0;Ot<qt.pointNumbers.length;Ot++)if(yt.selectedpoints.indexOf(qt.pointNumbers[Ot])<0)return!1;return!0}return!1}function Nt(Dt){var qt=0,zt,ut,yt;for(yt=0;yt<Dt.length;yt++)if(zt=Dt[yt],ut=zt.cd[0].trace,ut.selectedpoints&&(ut.selectedpoints.length>1||(qt+=ut.selectedpoints.length,qt>1)))return!1;return qt===1}function te(Dt,qt,zt){var ut;for(ut=0;ut<qt.length;ut++){var yt=qt[ut].cd[0].trace._fullInput,Mt=Dt._fullLayout._tracePreGUI[yt.uid]||{};Mt.selectedpoints===void 0&&(Mt.selectedpoints=yt._input.selectedpoints||null)}var Ot;if(zt){var $t=zt.points||[];for(ut=0;ut<qt.length;ut++)Ot=qt[ut].cd[0].trace,Ot._input.selectedpoints=Ot._fullInput.selectedpoints=[],Ot._fullInput!==Ot&&(Ot.selectedpoints=[]);for(var ee=0;ee<$t.length;ee++){var we=$t[ee],Me=we.data,Re=we.fullData,Be=we.pointIndex,Ze=we.pointIndices;Ze?([].push.apply(Me.selectedpoints,Ze),Ot._fullInput!==Ot&&[].push.apply(Re.selectedpoints,Ze)):(Me.selectedpoints.push(Be),Ot._fullInput!==Ot&&Re.selectedpoints.push(Be))}}else for(ut=0;ut<qt.length;ut++)Ot=qt[ut].cd[0].trace,delete Ot.selectedpoints,delete Ot._input.selectedpoints,Ot._fullInput!==Ot&&delete Ot._fullInput.selectedpoints;Jt(Dt,qt)}function Jt(Dt,qt){for(var zt=!1,ut=0;ut<qt.length;ut++){var yt=qt[ut],Mt=yt.cd;E.traceIs(Mt[0].trace,"regl")&&(zt=!0);var Ot=yt._module,$t=Ot.styleOnSelect||Ot.style;$t&&($t(Dt,Mt,Mt[0].node3),Mt[0].nodeRangePlot3&&$t(Dt,Mt,Mt[0].nodeRangePlot3))}zt&&(D(Dt),I(Dt))}function Qt(Dt,qt,zt){for(var ut=zt?c.difference:c.union,yt=ut({regions:Dt},{regions:[qt]}),Mt=yt.regions.reverse(),Ot=0;Ot<Mt.length;Ot++){var $t=Mt[Ot];$t.subtract=Se($t,Mt.slice(0,Ot))}return Mt}function Wt(Dt,qt){if(Array.isArray(Dt))for(var zt=qt.cd,ut=qt.cd[0].trace,yt=0;yt<Dt.length;yt++)Dt[yt]=r(Dt[yt],ut,zt);return Dt}function gt(Dt,qt){for(var zt=[],ut=0;ut<Dt.length;ut++){zt[ut]=[];for(var yt=0;yt<Dt[ut].length;yt++){zt[ut][yt]=[],zt[ut][yt][0]=yt?"L":"M";for(var Mt=0;Mt<Dt[ut][yt].length;Mt++)zt[ut][yt].push(Dt[ut][yt][Mt])}qt||zt[ut].push(["Z",zt[ut][0][1],zt[ut][0][2]])}return zt}function bt(Dt,qt){for(var zt=[],ut,yt=[],Mt,Ot=0;Ot<qt.length;Ot++){var $t=qt[Ot];Mt=$t._module.selectPoints($t,Dt),yt.push(Mt),ut=Wt(Mt,$t),zt=zt.concat(ut)}return zt}function vt(Dt,qt,zt,ut,yt){var Mt=!!ut,Ot,$t,ee;yt&&(Ot=yt.plotinfo,$t=yt.xaxes[0]._id,ee=yt.yaxes[0]._id);var we=[],Me=[],Re=Te(Dt),Be=Dt._fullLayout;if(Ot){var Ze=Be._zoomlayer,Ue=Be.dragmode,mr=a(Ue),ln=h(Ue);if(mr||ln){var an=_(Dt,$t,"x"),vn=_(Dt,ee,"y");if(an&&vn){var Sn=Ze.selectAll(".select-outline-"+Ot.id);if(Sn&&Dt._fullLayout._outlining&&Sn.length){for(var An=Sn[0][0],pn=An.getAttribute("d"),On=b(pn,Dt,Ot),Nn=[],ke=0;ke<On.length;ke++){for(var ze=On[ke],je=[],Ne=0;Ne<ze.length;Ne++)je.push([Fe(an,ze[Ne][1]),Fe(vn,ze[Ne][2])]);je.xref=$t,je.yref=ee,je.subtract=Se(je,Nn),Nn.push(je)}Re=Re.concat(Nn)}}}}var _r=$t&&ee?[$t+ee]:Be._subplots.cartesian;Ut(Dt);for(var Xr={},rn=0;rn<_r.length;rn++){var Br=_r[rn],_n=Br.indexOf("y"),bn=Br.slice(0,_n),Fn=Br.slice(_n),on=$t&&ee?zt:void 0;if(on=le(Re,bn,Fn,on),on){var Bn=ut;if(!Mt){var ue=_(Dt,bn,"x"),xe=_(Dt,Fn,"y");Bn=it(Dt,[ue],[xe],Br);for(var Pr=0;Pr<Bn.length;Pr++){var Sr=Bn[Pr],gr=Sr.cd[0],dr=gr.trace;if(Sr._module.name==="scattergl"&&!gr.t.xpx){var Er=dr.x,Dr=dr.y,Ar=dr._length;gr.t.xpx=[],gr.t.ypx=[];for(var Gr=0;Gr<Ar;Gr++)gr.t.xpx[Gr]=ue.c2p(Er[Gr]),gr.t.ypx[Gr]=xe.c2p(Dr[Gr])}Sr._module.name==="splom"&&(Xr[dr.uid]||(Xr[dr.uid]=!0))}}var Wr=bt(on,Bn);we=we.concat(Wr),Me=Me.concat(Bn)}}var Jr={points:we};te(Dt,Me,Jr);var _e=Be.clickmode,Je=_e.indexOf("event")>-1&&qt;if(!Ot&&qt){var yr=Te(Dt,!0);if(yr.length){var Hr=yr[0].xref,hn=yr[0].yref;if(Hr&&hn){var En=Oe(yr),dn=fr([_(Dt,Hr,"x"),_(Dt,hn,"y")]);dn(Jr,En)}}Dt._fullLayout._noEmitSelectedAtStart?Dt._fullLayout._noEmitSelectedAtStart=!1:Je&&kr(Dt,Jr),Be._reselect=!1}if(!Ot&&Be._deselect){var Kr=Be._deselect;$t=Kr.xref,ee=Kr.yref,Kt($t,ee,Me)||Zt(Dt,$t,ee,ut),Je&&(Jr.points.length?kr(Dt,Jr):he(Dt)),Be._deselect=!1}return{eventData:Jr,selectionTesters:zt}}function Ut(Dt){var qt=Dt.calcdata;if(qt)for(var zt=0;zt<qt.length;zt++){var ut=qt[zt][0],yt=ut.trace,Mt=Dt._fullLayout._splomScenes;if(Mt){var Ot=Mt[yt.uid];Ot&&(Ot.selectBatch=[])}}}function Kt(Dt,qt,zt){for(var ut=0;ut<zt.length;ut++){var yt=zt[ut];if(yt.xaxis&&yt.xaxis._id===Dt&&yt.yaxis&&yt.yaxis._id===qt)return!0}return!1}function Zt(Dt,qt,zt,ut){ut=it(Dt,[_(Dt,qt,"x")],[_(Dt,zt,"y")],qt+zt);for(var yt=0;yt<ut.length;yt++){var Mt=ut[yt];Mt._module.selectPoints(Mt,!1)}te(Dt,ut)}function le(Dt,qt,zt,ut){for(var yt,Mt=0;Mt<Dt.length;Mt++){var Ot=Dt[Mt];if(!(qt!==Ot.xref||zt!==Ot.yref))if(yt){var $t=!!Ot.subtract;yt=Qt(yt,Ot,$t),ut=$(yt)}else yt=[Ot],ut=L(Ot)}return ut}function Te(Dt,qt){for(var zt=[],ut=Dt._fullLayout,yt=ut.selections,Mt=yt.length,Ot=0;Ot<Mt;Ot++)if(!(qt&&Ot!==ut._activeSelectionIndex)){var $t=yt[Ot];if($t){var ee=$t.xref,we=$t.yref,Me=_(Dt,ee,"x"),Re=_(Dt,we,"y"),Be,Ze,Ue,mr,ln;if($t.type==="rect"){ln=[];var an=Fe(Me,$t.x0),vn=Fe(Me,$t.x1),Sn=Fe(Re,$t.y0),An=Fe(Re,$t.y1);ln=[[an,Sn],[an,An],[vn,An],[vn,Sn]],Be=Math.min(an,vn),Ze=Math.max(an,vn),Ue=Math.min(Sn,An),mr=Math.max(Sn,An),ln.xmin=Be,ln.xmax=Ze,ln.ymin=Ue,ln.ymax=mr,ln.xref=ee,ln.yref=we,ln.subtract=!1,ln.isRect=!0,zt.push(ln)}else if($t.type==="path")for(var pn=$t.path.split("Z"),On=[],Nn=0;Nn<pn.length;Nn++){var ke=pn[Nn];if(ke){ke+="Z";var ze=v.extractPathCoords(ke,m.paramIsX,"raw"),je=v.extractPathCoords(ke,m.paramIsY,"raw");Be=1/0,Ze=-1/0,Ue=1/0,mr=-1/0,ln=[];for(var Ne=0;Ne<ze.length;Ne++){var _r=Fe(Me,ze[Ne]),Xr=Fe(Re,je[Ne]);ln.push([_r,Xr]),Be=Math.min(_r,Be),Ze=Math.max(_r,Ze),Ue=Math.min(Xr,Ue),mr=Math.max(Xr,mr)}ln.xmin=Be,ln.xmax=Ze,ln.ymin=Ue,ln.ymax=mr,ln.xref=ee,ln.yref=we,ln.subtract=Se(ln,On),On.push(ln),zt.push(ln)}}}}return zt}function Se(Dt,qt){for(var zt=!1,ut=0;ut<qt.length;ut++)for(var yt=qt[ut],Mt=0;Mt<Dt.length;Mt++)if(g(Dt[Mt],yt)){zt=!zt;break}return zt}function Fe(Dt,qt){return Dt.type==="date"&&(qt=qt.replace("_"," ")),Dt.type==="log"?Dt.c2p(qt):Dt.r2p(qt,null,Dt.calendar)}function Oe(Dt){for(var qt=Dt.length,zt=[],ut=0;ut<qt;ut++){var yt=Dt[ut];zt=zt.concat(yt),zt=zt.concat([yt[0]])}return ur(zt)}function ur(Dt){return Dt.isRect=Dt.length===5&&Dt[0][0]===Dt[4][0]&&Dt[0][1]===Dt[4][1]&&Dt[0][0]===Dt[1][0]&&Dt[2][0]===Dt[3][0]&&Dt[0][1]===Dt[3][1]&&Dt[1][1]===Dt[2][1]||Dt[0][1]===Dt[1][1]&&Dt[2][1]===Dt[3][1]&&Dt[0][0]===Dt[3][0]&&Dt[1][0]===Dt[2][0],Dt.isRect&&(Dt.xmin=Math.min(Dt[0][0],Dt[2][0]),Dt.xmax=Math.max(Dt[0][0],Dt[2][0]),Dt.ymin=Math.min(Dt[0][1],Dt[2][1]),Dt.ymax=Math.max(Dt[0][1],Dt[2][1])),Dt}function fr(Dt){return function(qt,zt){for(var ut,yt,Mt=0;Mt<Dt.length;Mt++){var Ot=Dt[Mt],$t=Ot._id,ee=$t.charAt(0);if(zt.isRect){ut||(ut={});var we=zt[ee+"min"],Me=zt[ee+"max"];we!==void 0&&Me!==void 0&&(ut[$t]=[N(Ot,we),N(Ot,Me)].sort(u))}else yt||(yt={}),yt[$t]=zt.map(j(Ot))}ut&&(qt.range=ut),yt&&(qt.lassoPoints=yt)}}function We(Dt){var qt=Dt.plotinfo;return qt.fillRangeItems||fr(Dt.xaxes.concat(Dt.yaxes))}function Lr(Dt,qt){Dt.emit("plotly_selecting",qt)}function kr(Dt,qt){qt&&(qt.selections=(Dt.layout||{}).selections||[]),Dt.emit("plotly_selected",qt)}function he(Dt){Dt.emit("plotly_deselect",null)}V.exports={reselect:vt,prepSelect:ct,clearOutline:y,clearSelectionsCache:q,selectOnClick:lt}}),Tb=Vt((X,V)=>{V.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}),Um=Vt((X,V)=>{V.exports={axisRefDescription:function(c,g,E){return["If set to a",c,"axis id (e.g. *"+c+"* or","*"+c+"2*), the `"+c+"` position refers to a",c,"coordinate. If set to *paper*, the `"+c+"`","position refers to the distance from the",g,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",g,"("+E+"). If set to a",c,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",g,"of the domain of that axis: e.g.,","*"+c+"2 domain* refers to the domain of the second",c," axis and a",c,"position of 0.5 refers to the","point between the",g,"and the",E,"of the domain of the","second",c,"axis."].join(" ")}}}),h0=Vt((X,V)=>{var c=Tb(),g=Nl(),E=xh(),A=Ns().templatedArray;Um(),V.exports=A("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:g({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:c.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:c.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",E.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",E.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",E.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",E.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:g({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}),_p=Vt((X,V)=>{V.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}),rp=Vt((X,V)=>{V.exports=function(c){return{valType:"color",editType:"style",anim:!0}}}),Gu=Vt((X,V)=>{var c=qu().axisHoverFormat,g=Zo().texttemplateAttrs,E=Zo().hovertemplateAttrs,A=wl(),t=Nl(),e=Eh().dash,r=Eh().pattern,i=go(),n=_p(),o=po().extendFlat,a=rp();function s(m){return{valType:"any",dflt:0,editType:"calc"}}function h(m){return{valType:"any",editType:"calc"}}function v(m){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"}}V.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:s(),yperiod:s(),xperiod0:h(),yperiod0:h(),xperiodalignment:v(),yperiodalignment:v(),xhoverformat:c("x"),yhoverformat:c("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:g({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:E({},{keys:n.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:o({},e,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:a(!0),fillgradient:o({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:r,marker:o({symbol:{valType:"enumerated",values:i.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:o({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},A("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},A("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:t({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}),kb=Vt((X,V)=>{var c=h0(),g=Gu().line,E=Eh().dash,A=po().extendFlat,t=su().overrideAll,e=Ns().templatedArray;Um(),V.exports=t(e("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:A({},c.xref,{}),yref:A({},c.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:g.color,width:A({},g.width,{min:1,dflt:1}),dash:A({},E,{dflt:"dot"})}}),"arraydraw","from-root")}),o4=Vt((X,V)=>{var c=qr(),g=ao(),E=Gh(),A=kb(),t=Pd();V.exports=function(r,i){E(r,i,{name:"selections",handleItemDefaults:e});for(var n=i.selections,o=0;o<n.length;o++){var a=n[o];a&&a.path===void 0&&(a.x0===void 0||a.x1===void 0||a.y0===void 0||a.y1===void 0)&&(i.selections[o]=null)}};function e(r,i,n){function o(D,I){return c.coerce(r,i,A,D,I)}var a=o("path"),s=a?"path":"rect",h=o("type",s),v=h!=="path";v&&delete i.path,o("opacity"),o("line.color"),o("line.width"),o("line.dash");for(var m=["x","y"],p=0;p<2;p++){var y=m[p],l={_fullLayout:n},x,b,S,T=g.coerceRef(r,i,l,y);if(x=g.getFromId(l,T),x._selectionIndices.push(i._index),S=t.rangeToShapePosition(x),b=t.shapePositionToRange(x),v){var M=y+"0",w=y+"1",u=r[M],f=r[w];r[M]=b(r[M],!0),r[w]=b(r[w],!0),g.coercePosition(i,l,o,T,M),g.coercePosition(i,l,o,T,w);var k=i[M],_=i[w];k!==void 0&&_!==void 0&&(i[M]=S(k),i[w]=S(_),r[M]=u,r[w]=f)}}v&&c.noneOrAll(r,i,["x0","x1","y0","y1"])}}),s4=Vt((X,V)=>{V.exports=function(c,g,E){E("newselection.mode");var A=E("newselection.line.width");A&&(E("newselection.line.color"),E("newselection.line.dash")),E("activeselection.fillcolor"),E("activeselection.opacity")}}),Vm=Vt((X,V)=>{var c=Mi(),g=qr(),E=rc();V.exports=function(A){return function(t,e){var r=t[A];if(Array.isArray(r))for(var i=c.subplotsRegistry.cartesian,n=i.idRegex,o=e._subplots,a=o.xaxis,s=o.yaxis,h=o.cartesian,v=e._has("cartesian"),m=0;m<r.length;m++){var p=r[m];if(g.isPlainObject(p)){var y=E.cleanId(p.xref,"x",!1),l=E.cleanId(p.yref,"y",!1),x=n.x.test(y),b=n.y.test(l);if(x||b){v||g.pushUnique(e._basePlotModules,i);var S=!1;x&&a.indexOf(y)===-1&&(a.push(y),S=!0),b&&s.indexOf(l)===-1&&(s.push(l),S=!0),S&&x&&b&&h.push(y+l)}}}}}}),fc=Vt((X,V)=>{var c=wb(),g=i4();V.exports={moduleType:"component",name:"selections",layoutAttributes:kb(),supplyLayoutDefaults:o4(),supplyDrawNewSelectionDefaults:s4(),includeBasePlot:Vm()("selections"),draw:c.draw,drawOne:c.drawOne,reselect:g.reselect,prepSelect:g.prepSelect,clearOutline:g.clearOutline,clearSelectionsCache:g.clearSelectionsCache,selectOnClick:g.selectOnClick}}),Ab=Vt((X,V)=>{var c=Ai(),g=qr(),E=g.numberFormat,A=yh(),t=Ny(),e=Mi(),r=g.strTranslate,i=sl(),n=vi(),o=go(),a=Hu(),s=ao(),h=tp(),v=af(),m=ep(),p=m.selectingOrDrawing,y=m.freeMode,l=nh().FROM_TL,x=Bm(),b=jm().redrawReglTraces,S=fu(),T=rc().getFromId,M=fc().prepSelect,w=fc().clearOutline,u=fc().selectOnClick,f=bb(),k=xh(),_=k.MINDRAG,D=k.MINZOOM,I=!0;function O(dt,wt,xt,Ft,Et,Nt,te,Jt){var Qt=dt._fullLayout._zoomlayer,Wt=te+Jt==="nsew",gt=(te+Jt).length===1,bt,vt,Ut,Kt,Zt,le,Te,Se,Fe,Oe,ur,fr,We,Lr,kr,he,Dt,qt,zt,ut,yt,Mt,Ot;xt+=wt.yaxis._shift;function $t(){if(bt=wt.xaxis,vt=wt.yaxis,Fe=bt._length,Oe=vt._length,Te=bt._offset,Se=vt._offset,Ut={},Ut[bt._id]=bt,Kt={},Kt[vt._id]=vt,te&&Jt)for(var gr=wt.overlays,dr=0;dr<gr.length;dr++){var Er=gr[dr].xaxis;Ut[Er._id]=Er;var Dr=gr[dr].yaxis;Kt[Dr._id]=Dr}Zt=it(Ut),le=it(Kt),We=L(Zt,Jt),Lr=L(le,te),kr=!Lr&&!We,fr=q(dt,dt._fullLayout._axisMatchGroups,Ut,Kt),ur=q(dt,dt._fullLayout._axisConstraintGroups,Ut,Kt,fr);var Ar=ur.isSubplotConstrained||fr.isSubplotConstrained;he=Jt||Ar,Dt=te||Ar;var Gr=dt._fullLayout;qt=Gr._has("scattergl"),zt=Gr._has("splom"),ut=Gr._has("svg")}$t();var ee=rt(Lr+We,dt._fullLayout.dragmode,Wt),we=R(wt,te+Jt+"drag",ee,xt,Ft,Et,Nt);if(kr&&!Wt)return we.onmousedown=null,we.style.pointerEvents="none",we;var Me={element:we,gd:dt,plotinfo:wt};Me.prepFn=function(gr,dr,Er){var Dr=Me.dragmode,Ar=dt._fullLayout.dragmode;Ar!==Dr&&(Me.dragmode=Ar),$t(),Mt=dt._fullLayout._invScaleX,Ot=dt._fullLayout._invScaleY,kr||(Wt?gr.shiftKey?Ar==="pan"?Ar="zoom":p(Ar)||(Ar="pan"):gr.ctrlKey&&(Ar="pan"):Ar="pan"),y(Ar)?Me.minDrag=1:Me.minDrag=void 0,p(Ar)?(Me.xaxes=Zt,Me.yaxes=le,M(gr,dr,Er,Me,Ar)):(Me.clickFn=Be,p(Dr)&&Re(),kr||(Ar==="zoom"?(Me.moveFn=ke,Me.doneFn=je,Me.minDrag=1,Nn(gr,dr,Er)):Ar==="pan"&&(Me.moveFn=_n,Me.doneFn=Bn))),dt._fullLayout._redrag=function(){var Gr=dt._dragdata;if(Gr&&Gr.element===we){var Wr=dt._fullLayout.dragmode;p(Wr)||($t(),ue([0,0,Fe,Oe]),Me.moveFn(Gr.dx,Gr.dy))}}};function Re(){Me.plotinfo.selection=!1,w(dt)}function Be(gr,dr){var Er=Me.gd;if(Er._fullLayout._activeShapeIndex>=0){Er._fullLayout._deactivateShape(Er);return}var Dr=Er._fullLayout.clickmode;if(st(Er),gr===2&&!gt&&on(),Wt)Dr.indexOf("select")>-1&&u(dr,Er,Zt,le,wt.id,Me),Dr.indexOf("event")>-1&&a.click(Er,dr,wt.id);else if(gr===1&>){var Ar=te?vt:bt,Gr=te==="s"||Jt==="w"?0:1,Wr=Ar._name+".range["+Gr+"]",Jr=F(Ar,Gr),_e="left",Je="middle";if(Ar.fixedrange)return;te?(Je=te==="n"?"top":"bottom",Ar.side==="right"&&(_e="right")):Jt==="e"&&(_e="right"),Er._context.showAxisRangeEntryBoxes&&c.select(we).call(i.makeEditable,{gd:Er,immediate:!0,background:Er._fullLayout.paper_bgcolor,text:String(Jr),fill:Ar.tickfont?Ar.tickfont.color:"#444",horizontalAlign:_e,verticalAlign:Je}).on("edit",function(yr){var Hr=Ar.d2r(yr);Hr!==void 0&&e.call("_guiRelayout",Er,Wr,Hr)})}}v.init(Me);var Ze,Ue,mr,ln,an,vn,Sn,An,pn,On;function Nn(gr,dr,Er){var Dr=we.getBoundingClientRect();Ze=dr-Dr.left,Ue=Er-Dr.top,dt._fullLayout._calcInverseTransform(dt);var Ar=g.apply3DTransform(dt._fullLayout._invTransform)(Ze,Ue);Ze=Ar[0],Ue=Ar[1],mr={l:Ze,r:Ze,w:0,t:Ue,b:Ue,h:0},ln=dt._hmpixcount?dt._hmlumcount/dt._hmpixcount:A(dt._fullLayout.plot_bgcolor).getLuminance(),an="M0,0H"+Fe+"V"+Oe+"H0V0",vn=!1,Sn="xy",On=!1,An=ct(Qt,ln,Te,Se,an),pn=lt(Qt,Te,Se)}function ke(gr,dr){if(dt._transitioningWithDuration)return!1;var Er=Math.max(0,Math.min(Fe,Mt*gr+Ze)),Dr=Math.max(0,Math.min(Oe,Ot*dr+Ue)),Ar=Math.abs(Er-Ze),Gr=Math.abs(Dr-Ue);mr.l=Math.min(Ze,Er),mr.r=Math.max(Ze,Er),mr.t=Math.min(Ue,Dr),mr.b=Math.max(Ue,Dr);function Wr(){Sn="",mr.r=mr.l,mr.t=mr.b,pn.attr("d","M0,0Z")}if(ur.isSubplotConstrained)Ar>D||Gr>D?(Sn="xy",Ar/Fe>Gr/Oe?(Gr=Ar*Oe/Fe,Ue>Dr?mr.t=Ue-Gr:mr.b=Ue+Gr):(Ar=Gr*Fe/Oe,Ze>Er?mr.l=Ze-Ar:mr.r=Ze+Ar),pn.attr("d",Y(mr))):Wr();else if(fr.isSubplotConstrained)if(Ar>D||Gr>D){Sn="xy";var Jr=Math.min(mr.l/Fe,(Oe-mr.b)/Oe),_e=Math.max(mr.r/Fe,(Oe-mr.t)/Oe);mr.l=Jr*Fe,mr.r=_e*Fe,mr.b=(1-Jr)*Oe,mr.t=(1-_e)*Oe,pn.attr("d",Y(mr))}else Wr();else!Lr||Gr<Math.min(Math.max(Ar*.6,_),D)?Ar<_||!We?Wr():(mr.t=0,mr.b=Oe,Sn="x",pn.attr("d",Q(mr,Ue))):!We||Ar<Math.min(Gr*.6,D)?(mr.l=0,mr.r=Fe,Sn="y",pn.attr("d",nt(mr,Ze))):(Sn="xy",pn.attr("d",Y(mr)));mr.w=mr.r-mr.l,mr.h=mr.b-mr.t,Sn&&(On=!0),dt._dragged=On,tt(An,pn,mr,an,vn,ln),ze(),dt.emit("plotly_relayouting",yt),vn=!0}function ze(){yt={},(Sn==="xy"||Sn==="x")&&(N(Zt,mr.l/Fe,mr.r/Fe,yt,ur.xaxes),bn("x",yt)),(Sn==="xy"||Sn==="y")&&(N(le,(Oe-mr.b)/Oe,(Oe-mr.t)/Oe,yt,ur.yaxes),bn("y",yt))}function je(){ze(),st(dt),Bn(),$(dt)}var Ne=[0,0,Fe,Oe],_r=null,Xr=k.REDRAWDELAY,rn=wt.mainplot?dt._fullLayout._plots[wt.mainplot]:wt;function Br(gr){if(!dt._context._scrollZoom.cartesian&&!dt._fullLayout._enablescrollzoom)return;if(Re(),dt._transitioningWithDuration){gr.preventDefault(),gr.stopPropagation();return}$t(),clearTimeout(_r);var dr=-gr.deltaY;if(isFinite(dr)||(dr=gr.wheelDelta/10),!isFinite(dr)){g.log("Did not find wheel motion attributes: ",gr);return}var Er=Math.exp(-Math.min(Math.max(dr,-20),20)/200),Dr=rn.draglayer.select(".nsewdrag").node().getBoundingClientRect(),Ar=(gr.clientX-Dr.left)/Dr.width,Gr=(Dr.bottom-gr.clientY)/Dr.height,Wr;function Jr(_e,Je,yr){if(_e.fixedrange)return;var Hr=g.simpleMap(_e.range,_e.r2l),hn=Hr[0]+(Hr[1]-Hr[0])*Je;function En(dn){return _e.l2r(hn+(dn-hn)*yr)}_e.range=Hr.map(En)}if(he){for(Jt||(Ar=.5),Wr=0;Wr<Zt.length;Wr++)Jr(Zt[Wr],Ar,Er);bn("x"),Ne[2]*=Er,Ne[0]+=Ne[2]*Ar*(1/Er-1)}if(Dt){for(te||(Gr=.5),Wr=0;Wr<le.length;Wr++)Jr(le[Wr],Gr,Er);bn("y"),Ne[3]*=Er,Ne[1]+=Ne[3]*(1-Gr)*(1/Er-1)}ue(Ne),Fn(),dt.emit("plotly_relayouting",yt),_r=setTimeout(function(){dt._fullLayout&&(Ne=[0,0,Fe,Oe],Bn())},Xr),gr.preventDefault()}te.length*Jt.length!==1&&ot(we,Br);function _n(gr,dr){if(gr=gr*Mt,dr=dr*Ot,dt._transitioningWithDuration)return;if(dt._fullLayout._replotting=!0,We==="ew"||Lr==="ns"){var Er=We?-gr:0,Dr=Lr?-dr:0;if(fr.isSubplotConstrained){if(We&&Lr){var Ar=(gr/Fe-dr/Oe)/2;gr=Ar*Fe,dr=-Ar*Oe,Er=-gr,Dr=-dr}Lr?Er=-Dr*Fe/Oe:Dr=-Er*Oe/Fe}We&&(j(Zt,gr),bn("x")),Lr&&(j(le,dr),bn("y")),ue([Er,Dr,Fe,Oe]),Fn(),dt.emit("plotly_relayouting",yt);return}function Gr(En,dn,Kr){for(var Tn=1-dn,ta,Qn,Va=0;Va<En.length;Va++){var ja=En[Va];if(!ja.fixedrange){ta=ja,Qn=ja._rl[Tn]+(ja._rl[dn]-ja._rl[Tn])/G(Kr/ja._length);var ci=ja.l2r(Qn);ci!==!1&&ci!==void 0&&(ja.range[dn]=ci)}}return ta._length*(ta._rl[dn]-Qn)/(ta._rl[dn]-ta._rl[Tn])}var Wr=We==="w"==(Lr==="n")?1:-1;if(We&&Lr&&(ur.isSubplotConstrained||fr.isSubplotConstrained)){var Jr=(gr/Fe+Wr*dr/Oe)/2;gr=Jr*Fe,dr=Wr*Jr*Oe}var _e,Je;if(We==="w"?gr=Gr(Zt,0,gr):We==="e"?gr=Gr(Zt,1,-gr):We||(gr=0),Lr==="n"?dr=Gr(le,1,dr):Lr==="s"?dr=Gr(le,0,-dr):Lr||(dr=0),_e=We==="w"?gr:0,Je=Lr==="n"?dr:0,ur.isSubplotConstrained&&!fr.isSubplotConstrained||fr.isSubplotConstrained&&We&&Lr&&Wr>0){var yr;if(fr.isSubplotConstrained||!We&&Lr.length===1){for(yr=0;yr<Zt.length;yr++)Zt[yr].range=Zt[yr]._r.slice(),f(Zt[yr],1-dr/Oe);gr=dr*Fe/Oe,_e=gr/2}if(fr.isSubplotConstrained||!Lr&&We.length===1){for(yr=0;yr<le.length;yr++)le[yr].range=le[yr]._r.slice(),f(le[yr],1-gr/Fe);dr=gr*Oe/Fe,Je=dr/2}}(!fr.isSubplotConstrained||!Lr)&&bn("x"),(!fr.isSubplotConstrained||!We)&&bn("y");var Hr=Fe-gr,hn=Oe-dr;fr.isSubplotConstrained&&!(We&&Lr)&&(We?(Je=_e?0:gr*Oe/Fe,hn=Hr*Oe/Fe):(_e=Je?0:dr*Fe/Oe,Hr=hn*Fe/Oe)),ue([_e,Je,Hr,hn]),Fn(),dt.emit("plotly_relayouting",yt)}function bn(gr,dr){for(var Er=fr.isSubplotConstrained?{x:le,y:Zt}[gr]:fr[gr+"axes"],Dr=fr.isSubplotConstrained?{x:Zt,y:le}[gr]:[],Ar=0;Ar<Er.length;Ar++){var Gr=Er[Ar],Wr=Gr._id,Jr=fr.xLinks[Wr]||fr.yLinks[Wr],_e=Dr[0]||Ut[Jr]||Kt[Jr];_e&&(dr?(dr[Gr._name+".range[0]"]=dr[_e._name+".range[0]"],dr[Gr._name+".range[1]"]=dr[_e._name+".range[1]"]):Gr.range=_e.range.slice())}}function Fn(){var gr=[],dr;function Er(Wr){for(dr=0;dr<Wr.length;dr++)Wr[dr].fixedrange||gr.push(Wr[dr]._id)}function Dr(Wr,Jr){for(dr=0;dr<Wr.length;dr++){var _e=Wr[dr],Je=_e[Jr];!_e.fixedrange&&Je.tickmode==="sync"&&gr.push(Je._id)}}for(he&&(Er(Zt),Er(ur.xaxes),Er(fr.xaxes),Dr(wt.overlays,"xaxis")),Dt&&(Er(le),Er(ur.yaxes),Er(fr.yaxes),Dr(wt.overlays,"yaxis")),yt={},dr=0;dr<gr.length;dr++){var Ar=gr[dr],Gr=T(dt,Ar);s.drawOne(dt,Gr,{skipTitle:!0}),yt[Gr._name+".range[0]"]=Gr.range[0],yt[Gr._name+".range[1]"]=Gr.range[1]}s.redrawComponents(dt,gr)}function on(){if(!dt._transitioningWithDuration){var gr=dt._context.doubleClick,dr=[];We&&(dr=dr.concat(Zt)),Lr&&(dr=dr.concat(le)),fr.xaxes&&(dr=dr.concat(fr.xaxes)),fr.yaxes&&(dr=dr.concat(fr.yaxes));var Er={},Dr,Ar;if(gr==="reset+autosize")for(gr="autosize",Ar=0;Ar<dr.length;Ar++){Dr=dr[Ar];var Gr=Dr._rangeInitial0,Wr=Dr._rangeInitial1,Jr=Gr!==void 0||Wr!==void 0;if(Jr&&(Gr!==void 0&&Gr!==Dr.range[0]||Wr!==void 0&&Wr!==Dr.range[1])||!Jr&&Dr.autorange!==!0){gr="reset";break}}if(gr==="autosize")for(Ar=0;Ar<dr.length;Ar++)Dr=dr[Ar],Dr.fixedrange||(Er[Dr._name+".autorange"]=!0);else if(gr==="reset"){for((We||ur.isSubplotConstrained)&&(dr=dr.concat(ur.xaxes)),Lr&&!ur.isSubplotConstrained&&(dr=dr.concat(ur.yaxes)),ur.isSubplotConstrained&&(We?Lr||(dr=dr.concat(le)):dr=dr.concat(Zt)),Ar=0;Ar<dr.length;Ar++)if(Dr=dr[Ar],!Dr.fixedrange){var _e=Dr._name,Je=Dr._autorangeInitial;Dr._rangeInitial0===void 0&&Dr._rangeInitial1===void 0?Er[_e+".autorange"]=!0:Dr._rangeInitial0===void 0?(Er[_e+".autorange"]=Je,Er[_e+".range"]=[null,Dr._rangeInitial1]):Dr._rangeInitial1===void 0?(Er[_e+".range"]=[Dr._rangeInitial0,null],Er[_e+".autorange"]=Je):Er[_e+".range"]=[Dr._rangeInitial0,Dr._rangeInitial1]}}dt.emit("plotly_doubleclick",null),e.call("_guiRelayout",dt,Er)}}function Bn(){ue([0,0,Fe,Oe]),g.syncOrAsync([S.previousPromises,function(){dt._fullLayout._replotting=!1,e.call("_guiRelayout",dt,yt)}],dt)}function ue(gr){var dr=dt._fullLayout,Er=dr._plots,Dr=dr._subplots.cartesian,Ar,Gr,Wr,Jr;if(zt&&e.subplotsRegistry.splom.drag(dt),qt){for(Ar=0;Ar<Dr.length;Ar++)if(Gr=Er[Dr[Ar]],Wr=Gr.xaxis,Jr=Gr.yaxis,Gr._scene){Wr.limitRange&&Wr.limitRange(),Jr.limitRange&&Jr.limitRange();var _e=g.simpleMap(Wr.range,Wr.r2l),Je=g.simpleMap(Jr.range,Jr.r2l);Gr._scene.update({range:[_e[0],Je[0],_e[1],Je[1]]})}}if((zt||qt)&&(x(dt),b(dt)),ut){var yr=gr[2]/bt._length,Hr=gr[3]/vt._length;for(Ar=0;Ar<Dr.length;Ar++){Gr=Er[Dr[Ar]],Wr=Gr.xaxis,Jr=Gr.yaxis;var hn=(he||fr.isSubplotConstrained)&&!Wr.fixedrange&&Ut[Wr._id],En=(Dt||fr.isSubplotConstrained)&&!Jr.fixedrange&&Kt[Jr._id],dn,Kr,Tn,ta;if(hn?(dn=yr,Tn=Jt||fr.isSubplotConstrained?gr[0]:Sr(Wr,dn)):fr.xaHash[Wr._id]?(dn=yr,Tn=gr[0]*Wr._length/bt._length):fr.yaHash[Wr._id]?(dn=Hr,Tn=Lr==="ns"?-gr[1]*Wr._length/vt._length:Sr(Wr,dn,{n:"top",s:"bottom"}[Lr])):(dn=xe(Wr,yr,Hr),Tn=Pr(Wr,dn)),dn>1&&(Wr.maxallowed!==void 0&&he===(Wr.range[0]<Wr.range[1]?"e":"w")||Wr.minallowed!==void 0&&he===(Wr.range[0]<Wr.range[1]?"w":"e"))&&(dn=1,Tn=0),En?(Kr=Hr,ta=te||fr.isSubplotConstrained?gr[1]:Sr(Jr,Kr)):fr.yaHash[Jr._id]?(Kr=Hr,ta=gr[1]*Jr._length/vt._length):fr.xaHash[Jr._id]?(Kr=yr,ta=We==="ew"?-gr[0]*Jr._length/bt._length:Sr(Jr,Kr,{e:"right",w:"left"}[We])):(Kr=xe(Jr,yr,Hr),ta=Pr(Jr,Kr)),Kr>1&&(Jr.maxallowed!==void 0&&Dt===(Jr.range[0]<Jr.range[1]?"n":"s")||Jr.minallowed!==void 0&&Dt===(Jr.range[0]<Jr.range[1]?"s":"n"))&&(Kr=1,ta=0),!(!dn&&!Kr)){dn||(dn=1),Kr||(Kr=1);var Qn=Wr._offset-Tn/dn,Va=Jr._offset-ta/Kr;Gr.clipRect.call(o.setTranslate,Tn,ta).call(o.setScale,dn,Kr),Gr.plot.call(o.setTranslate,Qn,Va).call(o.setScale,1/dn,1/Kr),(dn!==Gr.xScaleFactor||Kr!==Gr.yScaleFactor)&&(o.setPointGroupScale(Gr.zoomScalePts,dn,Kr),o.setTextPointsScale(Gr.zoomScaleTxt,dn,Kr)),o.hideOutsideRangePoints(Gr.clipOnAxisFalseTraces,Gr),Gr.xScaleFactor=dn,Gr.yScaleFactor=Kr}}}}function xe(gr,dr,Er){return gr.fixedrange?0:he&&ur.xaHash[gr._id]?dr:Dt&&(ur.isSubplotConstrained?ur.xaHash:ur.yaHash)[gr._id]?Er:0}function Pr(gr,dr){return dr?(gr.range=gr._r.slice(),f(gr,dr),Sr(gr,dr)):0}function Sr(gr,dr,Er){return gr._length*(1-dr)*l[Er||gr.constraintoward||"middle"]}return we}function B(dt,wt,xt,Ft){var Et=g.ensureSingle(dt.draglayer,wt,xt,function(Nt){Nt.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",dt.id)});return Et.call(h,Ft),Et.node()}function R(dt,wt,xt,Ft,Et,Nt,te){var Jt=B(dt,"rect",wt,xt);return c.select(Jt).call(o.setRect,Ft,Et,Nt,te),Jt}function L(dt,wt){for(var xt=0;xt<dt.length;xt++)if(!dt[xt].fixedrange)return wt;return""}function F(dt,wt){var xt=dt.range[wt],Ft=Math.abs(xt-dt.range[1-wt]),Et;return dt.type==="date"?xt:dt.type==="log"?(Et=Math.ceil(Math.max(0,-Math.log(Ft)/Math.LN10))+3,E("."+Et+"g")(Math.pow(10,xt))):(Et=Math.floor(Math.log(Math.abs(xt))/Math.LN10)-Math.floor(Math.log(Ft)/Math.LN10)+4,E("."+String(Et)+"g")(xt))}function N(dt,wt,xt,Ft,Et){for(var Nt=0;Nt<dt.length;Nt++){var te=dt[Nt];if(!te.fixedrange)if(te.rangebreaks){var Jt=te._id.charAt(0)==="y",Qt=Jt?1-wt:wt,Wt=Jt?1-xt:xt;Ft[te._name+".range[0]"]=te.l2r(te.p2l(Qt*te._length)),Ft[te._name+".range[1]"]=te.l2r(te.p2l(Wt*te._length))}else{var gt=te._rl[0],bt=te._rl[1]-gt;Ft[te._name+".range[0]"]=te.l2r(gt+bt*wt),Ft[te._name+".range[1]"]=te.l2r(gt+bt*xt)}}if(Et&&Et.length){var vt=(wt+(1-xt))/2;N(Et,vt,1-vt,Ft,[])}}function j(dt,wt){for(var xt=0;xt<dt.length;xt++){var Ft=dt[xt];if(!Ft.fixedrange){if(Ft.rangebreaks){var Et=0,Nt=Ft._length,te=Ft.p2l(Et+wt)-Ft.p2l(Et),Jt=Ft.p2l(Nt+wt)-Ft.p2l(Nt),Qt=(te+Jt)/2;Ft.range=[Ft.l2r(Ft._rl[0]-Qt),Ft.l2r(Ft._rl[1]-Qt)]}else Ft.range=[Ft.l2r(Ft._rl[0]-wt/Ft._m),Ft.l2r(Ft._rl[1]-wt/Ft._m)];Ft.limitRange&&Ft.limitRange()}}}function G(dt){return 1-(dt>=0?Math.min(dt,.9):1/(1/Math.max(dt,-.3)+3.222))}function rt(dt,wt,xt){return dt?dt==="nsew"?xt?"":wt==="pan"?"move":"crosshair":dt.toLowerCase()+"-resize":"pointer"}function ct(dt,wt,xt,Ft,Et){return dt.append("path").attr("class","zoombox").style({fill:wt>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(xt,Ft)).attr("d",Et+"Z")}function lt(dt,wt,xt){return dt.append("path").attr("class","zoombox-corners").style({fill:n.background,stroke:n.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(wt,xt)).attr("d","M0,0Z")}function tt(dt,wt,xt,Ft,Et,Nt){dt.attr("d",Ft+"M"+xt.l+","+xt.t+"v"+xt.h+"h"+xt.w+"v-"+xt.h+"h-"+xt.w+"Z"),Z(dt,wt,Et,Nt)}function Z(dt,wt,xt,Ft){xt||(dt.transition().style("fill",Ft>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),wt.transition().style("opacity",1).duration(200))}function st(dt){c.select(dt).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function $(dt){I&&dt.data&&dt._context.showTips&&(g.notifier(g._(dt,"Double-click to zoom back out"),"long"),I=!1)}function Q(dt,wt){return"M"+(dt.l-.5)+","+(wt-D-.5)+"h-3v"+(2*D+1)+"h3ZM"+(dt.r+.5)+","+(wt-D-.5)+"h3v"+(2*D+1)+"h-3Z"}function nt(dt,wt){return"M"+(wt-D-.5)+","+(dt.t-.5)+"v-3h"+(2*D+1)+"v3ZM"+(wt-D-.5)+","+(dt.b+.5)+"v3h"+(2*D+1)+"v-3Z"}function Y(dt){var wt=Math.floor(Math.min(dt.b-dt.t,dt.r-dt.l,D)/2);return"M"+(dt.l-3.5)+","+(dt.t-.5+wt)+"h3v"+-wt+"h"+wt+"v-3h-"+(wt+3)+"ZM"+(dt.r+3.5)+","+(dt.t-.5+wt)+"h-3v"+-wt+"h"+-wt+"v-3h"+(wt+3)+"ZM"+(dt.r+3.5)+","+(dt.b+.5-wt)+"h-3v"+wt+"h"+-wt+"v3h"+(wt+3)+"ZM"+(dt.l-3.5)+","+(dt.b+.5-wt)+"h3v"+wt+"h"+wt+"v3h-"+(wt+3)+"Z"}function q(dt,wt,xt,Ft,Et){for(var Nt=!1,te={},Jt={},Qt,Wt,gt,bt,vt=(Et||{}).xaHash,Ut=(Et||{}).yaHash,Kt=0;Kt<wt.length;Kt++){var Zt=wt[Kt];for(Qt in xt)if(Zt[Qt]){for(gt in Zt)!(Et&&(vt[gt]||Ut[gt]))&&!(gt.charAt(0)==="x"?xt:Ft)[gt]&&(te[gt]=Qt);for(Wt in Ft)!(Et&&(vt[Wt]||Ut[Wt]))&&Zt[Wt]&&(Nt=!0)}for(Wt in Ft)if(Zt[Wt])for(bt in Zt)!(Et&&(vt[bt]||Ut[bt]))&&!(bt.charAt(0)==="x"?xt:Ft)[bt]&&(Jt[bt]=Wt)}Nt&&(g.extendFlat(te,Jt),Jt={});var le={},Te=[];for(gt in te){var Se=T(dt,gt);Te.push(Se),le[Se._id]=Se}var Fe={},Oe=[];for(bt in Jt){var ur=T(dt,bt);Oe.push(ur),Fe[ur._id]=ur}return{xaHash:le,yaHash:Fe,xaxes:Te,yaxes:Oe,xLinks:te,yLinks:Jt,isSubplotConstrained:Nt}}function ot(dt,wt){if(!t)dt.onwheel!==void 0?dt.onwheel=wt:dt.onmousewheel!==void 0?dt.onmousewheel=wt:dt.isAddedWheelEvent||(dt.isAddedWheelEvent=!0,dt.addEventListener("wheel",wt,{passive:!1}));else{var xt=dt.onwheel!==void 0?"wheel":"mousewheel";dt._onwheel&&dt.removeEventListener(xt,dt._onwheel),dt._onwheel=wt,dt.addEventListener(xt,wt,{passive:!1})}}function it(dt){var wt=[];for(var xt in dt)wt.push(dt[xt]);return wt}V.exports={makeDragBox:O,makeDragger:B,makeRectDragger:R,makeZoombox:ct,makeCorners:lt,updateZoombox:tt,xyCorners:Y,transitionZoombox:Z,removeZoombox:st,showDoubleClickNotifier:$,attachWheelEventHandler:ot}}),Mb=Vt(X=>{var V=Ai(),c=Hu(),g=af(),E=tp(),A=Ab().makeDragBox,t=xh().DRAGGERSIZE;X.initInteractions=function(e){var r=e._fullLayout;if(e._context.staticPlot){V.select(e).selectAll(".drag").remove();return}if(!(!r._has("cartesian")&&!r._has("splom"))){var i=Object.keys(r._plots||{}).sort(function(o,a){if((r._plots[o].mainplot&&!0)===(r._plots[a].mainplot&&!0)){var s=o.split("y"),h=a.split("y");return s[0]===h[0]?Number(s[1]||1)-Number(h[1]||1):Number(s[0]||1)-Number(h[0]||1)}return r._plots[o].mainplot?1:-1});i.forEach(function(o){var a=r._plots[o],s=a.xaxis,h=a.yaxis;if(!a.mainplot){var v=A(e,a,s._offset,h._offset,s._length,h._length,"ns","ew");v.onmousemove=function(y){e._fullLayout._rehover=function(){e._fullLayout._hoversubplot===o&&e._fullLayout._plots[o]&&c.hover(e,y,o)},c.hover(e,y,o),e._fullLayout._lasthover=v,e._fullLayout._hoversubplot=o},v.onmouseout=function(y){e._dragging||(e._fullLayout._hoversubplot=null,g.unhover(e,y))},e._context.showAxisDragHandles&&(A(e,a,s._offset-t,h._offset-t,t,t,"n","w"),A(e,a,s._offset+s._length,h._offset-t,t,t,"n","e"),A(e,a,s._offset-t,h._offset+h._length,t,t,"s","w"),A(e,a,s._offset+s._length,h._offset+h._length,t,t,"s","e"))}if(e._context.showAxisDragHandles){if(o===s._mainSubplot){var m=s._mainLinePosition;s.side==="top"&&(m-=t),A(e,a,s._offset+s._length*.1,m,s._length*.8,t,"","ew"),A(e,a,s._offset,m,s._length*.1,t,"","w"),A(e,a,s._offset+s._length*.9,m,s._length*.1,t,"","e")}if(o===h._mainSubplot){var p=h._mainLinePosition;h.side!=="right"&&(p-=t),A(e,a,p,h._offset+h._length*.1,t,h._length*.8,"ns",""),A(e,a,p,h._offset+h._length*.9,t,h._length*.1,"s",""),A(e,a,p,h._offset,t,h._length*.1,"n","")}}});var n=r._hoverlayer.node();n.onmousemove=function(o){o.target=e._fullLayout._lasthover,c.hover(e,o,r._hoversubplot)},n.onclick=function(o){o.target=e._fullLayout._lasthover,c.click(e,o)},n.onmousedown=function(o){e._fullLayout._lasthover.onmousedown(o)},X.updateFx(e)}},X.updateFx=function(e){var r=e._fullLayout,i=r.dragmode==="pan"?"move":"crosshair";E(r._draggers,i)}}),l4=Vt((X,V)=>{var c=Mi();V.exports=function(g){for(var E=c.layoutArrayContainers,A=c.layoutArrayRegexes,t=g.split("[")[0],e,r,i=0;i<A.length;i++)if(r=g.match(A[i]),r&&r.index===0){e=r[0];break}if(e||(e=E[E.indexOf(t)]),!e)return!1;var n=g.substr(e.length);return n?(r=n.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/),r?{array:e,index:Number(r[1]),property:r[3]||""}:!1):{array:e,index:"",property:""}}}),u4=Vt(X=>{var V=jp(),c=Cy(),g=wd(),E=Fy().sorterAsc,A=Mi();X.containerArrayMatch=l4();var t=X.isAddVal=function(r){return r==="add"||V(r)},e=X.isRemoveVal=function(r){return r===null||r==="remove"};X.applyContainerArrayChanges=function(r,i,n,o,a){var s=i.astr,h=A.getComponentMethod(s,"supplyLayoutDefaults"),v=A.getComponentMethod(s,"draw"),m=A.getComponentMethod(s,"drawOne"),p=o.replot||o.recalc||h===c||v===c,y=r.layout,l=r._fullLayout;if(n[""]){Object.keys(n).length>1&&g.warn("Full array edits are incompatible with other edits",s);var x=n[""][""];if(e(x))i.set(null);else if(Array.isArray(x))i.set(x);else return g.warn("Unrecognized full array edit value",s,x),!0;return p?!1:(h(y,l),v(r),!0)}var b=Object.keys(n).map(Number).sort(E),S=i.get(),T=S||[],M=a(l,s).get(),w=[],u=-1,f=T.length,k,_,D,I,O,B,R,L;for(k=0;k<b.length;k++){if(D=b[k],I=n[D],O=Object.keys(I),B=I[""],R=t(B),D<0||D>T.length-(R?0:1)){g.warn("index out of range",s,D);continue}if(B!==void 0)O.length>1&&g.warn("Insertion & removal are incompatible with edits to the same index.",s,D),e(B)?w.push(D):R?(B==="add"&&(B={}),T.splice(D,0,B),M&&M.splice(D,0,{})):g.warn("Unrecognized full object edit value",s,D,B),u===-1&&(u=D);else for(_=0;_<O.length;_++)L=s+"["+D+"].",a(T[D],O[_],L).set(I[O[_]])}for(k=w.length-1;k>=0;k--)T.splice(w[k],1),M&&M.splice(w[k],1);if(T.length?S||i.set(T):i.set(null),p)return!1;if(h(y,l),m!==c){var F;if(u===-1)F=b;else{for(f=Math.max(T.length,f),F=[],k=0;k<b.length&&(D=b[k],!(D>=u));k++)F.push(D);for(k=u;k<f;k++)F.push(k)}for(k=0;k<F.length;k++)m(r,F[k])}else v(r);return!0}}),c4=Vt(X=>{var V=vo();X_();var c=Mi(),g=qr(),E=fu(),A=rc(),t=vi(),e=A.cleanId,r=A.getFromTrace,i=c.traceIs;X.clearPromiseQueue=function(y){Array.isArray(y._promises)&&y._promises.length>0&&g.log("Clearing previous rejected promises from queue."),y._promises=[]},X.cleanLayout=function(y){var l;y||(y={}),y.xaxis1&&(y.xaxis||(y.xaxis=y.xaxis1),delete y.xaxis1),y.yaxis1&&(y.yaxis||(y.yaxis=y.yaxis1),delete y.yaxis1),y.scene1&&(y.scene||(y.scene=y.scene1),delete y.scene1);var x=(E.subplotsRegistry.cartesian||{}).attrRegex;(E.subplotsRegistry.polar||{}).attrRegex,(E.subplotsRegistry.ternary||{}).attrRegex,(E.subplotsRegistry.gl3d||{}).attrRegex;var b=Object.keys(y);for(l=0;l<b.length;l++){var S=b[l];if(x&&x.test(S)){var T=y[S];T.anchor&&T.anchor!=="free"&&(T.anchor=e(T.anchor)),T.overlaying&&(T.overlaying=e(T.overlaying)),T.type||(T.isdate?T.type="date":T.islog?T.type="log":T.isdate===!1&&T.islog===!1&&(T.type="linear")),(T.autorange==="withzero"||T.autorange==="tozero")&&(T.autorange=!0,T.rangemode="tozero"),T.insiderange&&delete T.range,delete T.islog,delete T.isdate,delete T.categories,h(T,"domain")&&delete T.domain}}var M=Array.isArray(y.annotations)?y.annotations.length:0;for(l=0;l<M;l++){var w=y.annotations[l];g.isPlainObject(w)&&(n(w,"xref"),n(w,"yref"))}var u=Array.isArray(y.shapes)?y.shapes.length:0;for(l=0;l<u;l++){var f=y.shapes[l];g.isPlainObject(f)&&(n(f,"xref"),n(f,"yref"))}var k=Array.isArray(y.images)?y.images.length:0;for(l=0;l<k;l++){var _=y.images[l];g.isPlainObject(_)&&(n(_,"xref"),n(_,"yref"))}var D=y.legend;return D&&(D.x>3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),y.dragmode==="rotate"&&(y.dragmode="orbit"),t.clean(y),y.template&&y.template.layout&&X.cleanLayout(y.template.layout),y};function n(y,l){var x=y[l],b=l.charAt(0);x&&x!=="paper"&&(y[l]=e(x,b,!0))}X.cleanData=function(y){for(var l=0;l<y.length;l++){var x=y[l],b;if(x.type==="histogramy"&&"xbins"in x&&!("ybins"in x)&&(x.ybins=x.xbins,delete x.xbins),x.type==="histogramy"&&X.swapXYData(x),(x.type==="histogramx"||x.type==="histogramy")&&(x.type="histogram"),"scl"in x&&!("colorscale"in x)&&(x.colorscale=x.scl,delete x.scl),"reversescl"in x&&!("reversescale"in x)&&(x.reversescale=x.reversescl,delete x.reversescl),x.xaxis&&(x.xaxis=e(x.xaxis,"x")),x.yaxis&&(x.yaxis=e(x.yaxis,"y")),i(x,"gl3d")&&x.scene&&(x.scene=E.subplotsRegistry.gl3d.cleanId(x.scene)),!i(x,"pie-like")&&!i(x,"bar-like"))if(Array.isArray(x.textposition))for(b=0;b<x.textposition.length;b++)x.textposition[b]=s(x.textposition[b]);else x.textposition&&(x.textposition=s(x.textposition));var S=c.getModule(x);if(S&&S.colorbar){var T=S.colorbar.container,M=T?x[T]:x;M&&M.colorscale&&(M.colorscale==="YIGnBu"&&(M.colorscale="YlGnBu"),M.colorscale==="YIOrRd"&&(M.colorscale="YlOrRd"))}if(x.type==="surface"&&g.isPlainObject(x.contours)){var w=["x","y","z"];for(b=0;b<w.length;b++){var u=x.contours[w[b]];g.isPlainObject(u)&&(u.highlightColor&&(u.highlightcolor=u.highlightColor,delete u.highlightColor),u.highlightWidth&&(u.highlightwidth=u.highlightWidth,delete u.highlightWidth))}}if(x.type==="candlestick"||x.type==="ohlc"){var f=(x.increasing||{}).showlegend!==!1,k=(x.decreasing||{}).showlegend!==!1,_=o(x.increasing),D=o(x.decreasing);if(_!==!1&&D!==!1){var I=a(_,D,f,k);I&&(x.name=I)}else(_||D)&&!x.name&&(x.name=_||D)}h(x,"line")&&delete x.line,"marker"in x&&(h(x.marker,"line")&&delete x.marker.line,h(x,"marker")&&delete x.marker),t.clean(x),x.autobinx&&(delete x.autobinx,delete x.xbins),x.autobiny&&(delete x.autobiny,delete x.ybins)}};function o(y){if(!g.isPlainObject(y))return!1;var l=y.name;return delete y.name,delete y.showlegend,(typeof l=="string"||typeof l=="number")&&String(l)}function a(y,l,x,b){if(x&&!b)return y;if(b&&!x||!y.trim())return l;if(!l.trim())return y;var S=Math.min(y.length,l.length),T;for(T=0;T<S&&y.charAt(T)===l.charAt(T);T++);var M=y.substr(0,T);return M.trim()}function s(y){var l="middle",x="center";return typeof y=="string"&&(y.indexOf("top")!==-1?l="top":y.indexOf("bottom")!==-1&&(l="bottom"),y.indexOf("left")!==-1?x="left":y.indexOf("right")!==-1&&(x="right")),l+" "+x}function h(y,l){return l in y&&typeof y[l]=="object"&&Object.keys(y[l]).length===0}X.swapXYData=function(y){var l;if(g.swapAttrs(y,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(y.z)&&Array.isArray(y.z[0])&&(y.transpose?delete y.transpose:y.transpose=!0),y.error_x&&y.error_y){var x=y.error_y,b="copy_ystyle"in x?x.copy_ystyle:!(x.color||x.thickness||x.width);g.swapAttrs(y,["error_?.copy_ystyle"]),b&&g.swapAttrs(y,["error_?.color","error_?.thickness","error_?.width"])}if(typeof y.hoverinfo=="string"){var S=y.hoverinfo.split("+");for(l=0;l<S.length;l++)S[l]==="x"?S[l]="y":S[l]==="y"&&(S[l]="x");y.hoverinfo=S.join("+")}},X.coerceTraceIndices=function(y,l){if(V(l))return[l];if(!Array.isArray(l)||!l.length)return y.data.map(function(S,T){return T});if(Array.isArray(l)){for(var x=[],b=0;b<l.length;b++)g.isIndex(l[b],y.data.length)?x.push(l[b]):g.warn("trace index (",l[b],") is not a number or is out of bounds");return x}return l},X.manageArrayContainers=function(y,l,x){var b=y.obj,S=y.parts,T=S.length,M=S[T-1],w=V(M);if(w&&l===null){var u=S.slice(0,T-1).join("."),f=g.nestedProperty(b,u).get();f.splice(M,1)}else w&&y.get()===void 0&&y.get()===void 0&&(x[y.astr]=null),y.set(l)};var v=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function m(y){var l=y.search(v);if(l>0)return y.substr(0,l)}X.hasParent=function(y,l){for(var x=m(l);x;){if(x in y)return!0;x=m(x)}return!1};var p=["x","y","z"];X.clearAxisTypes=function(y,l,x){for(var b=0;b<l.length;b++)for(var S=y._fullData[b],T=0;T<3;T++){var M=r(y,S,p[T]);if(M&&M.type!=="log"){var w=M._name,u=M._id.substr(1);if(u.substr(0,5)==="scene"){if(x[u]!==void 0)continue;w=u+"."+w}var f=w+".type";x[w]===void 0&&x[f]===void 0&&g.nestedProperty(y.layout,f).set(null)}}}}),Xy=Vt(X=>{var V=Ai(),c=vo(),g=K_(),E=qr(),A=E.nestedProperty,t=vg(),e=Ek(),r=Mi(),i=yg(),n=fu(),o=ao(),a=sb(),s=Ih(),h=go(),v=vi(),m=Mb().initInteractions,p=Cf(),y=fc().clearOutline,l=o0().dfltConfig,x=u4(),b=c4(),S=jm(),T=su(),M=xh().AX_NAME_PATTERN,w=0,u=5;function f(ut,yt,Mt,Ot){var $t;if(ut=E.getGraphDiv(ut),t.init(ut),E.isPlainObject(yt)){var ee=yt;yt=ee.data,Mt=ee.layout,Ot=ee.config,$t=ee.frames}var we=t.triggerHandler(ut,"plotly_beforeplot",[yt,Mt,Ot]);if(we===!1)return Promise.reject();!yt&&!Mt&&!E.isPlotDiv(ut)&&E.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",ut);function Me(){if($t)return X.addFrames(ut,$t)}O(ut,Ot),Mt||(Mt={}),V.select(ut).classed("js-plotly-plot",!0),h.makeTester(),Array.isArray(ut._promises)||(ut._promises=[]);var Re=(ut.data||[]).length===0&&Array.isArray(yt);Array.isArray(yt)&&(b.cleanData(yt),Re?ut.data=yt:ut.data.push.apply(ut.data,yt),ut.empty=!1),(!ut.layout||Re)&&(ut.layout=b.cleanLayout(Mt)),n.supplyDefaults(ut);var Be=ut._fullLayout,Ze=Be._has("cartesian");Be._replotting=!0,(Re||Be._shouldCreateBgLayer)&&(zt(ut),Be._shouldCreateBgLayer&&delete Be._shouldCreateBgLayer),h.initGradients(ut),h.initPatterns(ut),Re&&o.saveShowSpikeInitial(ut);var Ue=!ut.calcdata||ut.calcdata.length!==(ut._fullData||[]).length;Ue&&n.doCalcdata(ut);for(var mr=0;mr<ut.calcdata.length;mr++)ut.calcdata[mr][0].trace=ut._fullData[mr];ut._context.responsive?ut._responsiveChartHandler||(ut._responsiveChartHandler=function(){E.isHidden(ut)||n.resize(ut)},window.addEventListener("resize",ut._responsiveChartHandler)):E.clearResponsive(ut);var ln=E.extendFlat({},Be._size),an=0;function vn(){for(var je=Be._basePlotModules,Ne=0;Ne<je.length;Ne++)je[Ne].drawFramework&&je[Ne].drawFramework(ut);!Be._glcanvas&&Be._has("gl")&&(Be._glcanvas=Be._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],function(Br){return Br.key}),Be._glcanvas.enter().append("canvas").attr("class",function(Br){return"gl-canvas gl-canvas-"+Br.key.replace("Layer","")}).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"}));var _r=ut._context.plotGlPixelRatio;if(Be._glcanvas){Be._glcanvas.attr("width",Be.width*_r).attr("height",Be.height*_r).style("width",Be.width+"px").style("height",Be.height+"px");var Xr=Be._glcanvas.data()[0].regl;if(Xr&&(Math.floor(Be.width*_r)!==Xr._gl.drawingBufferWidth||Math.floor(Be.height*_r)!==Xr._gl.drawingBufferHeight)){var rn="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(an)E.error(rn);else return E.log(rn+" Clearing graph and plotting again."),n.cleanPlot([],{},ut._fullData,Be),n.supplyDefaults(ut),Be=ut._fullLayout,n.doCalcdata(ut),an++,vn()}}return Be.modebar.orientation==="h"?Be._modebardiv.style("height",null).style("width","100%"):Be._modebardiv.style("width",null).style("height",Be.height+"px"),n.previousPromises(ut)}function Sn(){if(n.clearAutoMarginIds(ut),S.drawMarginPushers(ut),o.allowAutoMargin(ut),ut._fullLayout.title.text&&ut._fullLayout.title.automargin&&n.allowAutoMargin(ut,"title.automargin"),Be._has("pie"))for(var je=ut._fullData,Ne=0;Ne<je.length;Ne++){var _r=je[Ne];_r.type==="pie"&&_r.automargin&&n.allowAutoMargin(ut,"pie."+_r.uid+".automargin")}return n.doAutoMargin(ut),n.previousPromises(ut)}function An(){if(n.didMarginChange(ln,Be._size))return E.syncOrAsync([Sn,S.layoutStyles],ut)}function pn(){if(!Ue){On();return}return E.syncOrAsync([r.getComponentMethod("shapes","calcAutorange"),r.getComponentMethod("annotations","calcAutorange"),On],ut)}function On(){ut._transitioning||(S.doAutoRangeAndConstraints(ut),Re&&o.saveRangeInitial(ut),r.getComponentMethod("rangeslider","calcAutorange")(ut))}function Nn(){return o.draw(ut,Re?"":"redraw")}var ke=[n.previousPromises,Me,vn,Sn,An];Ze&&ke.push(pn),ke.push(S.layoutStyles),Ze&&ke.push(Nn,function(je){var Ne=je._fullLayout._insideTickLabelsUpdaterange;if(Ne)return je._fullLayout._insideTickLabelsUpdaterange=void 0,wt(je,Ne).then(function(){o.saveRangeInitial(je,!0)})}),ke.push(S.drawData,S.finalDraw,m,n.addLinks,n.rehover,n.redrag,n.reselect,n.doAutoMargin,n.previousPromises);var ze=E.syncOrAsync(ke,ut);return(!ze||!ze.then)&&(ze=Promise.resolve()),ze.then(function(){return k(ut),ut})}function k(ut){var yt=ut._fullLayout;yt._redrawFromAutoMarginCount?yt._redrawFromAutoMarginCount--:ut.emit("plotly_afterplot")}function _(ut){return E.extendFlat(l,ut)}function D(ut,yt){try{ut._fullLayout._paper.style("background",yt)}catch(Mt){E.error(Mt)}}function I(ut,yt){var Mt=v.combine(yt,"white");D(ut,Mt)}function O(ut,yt){if(!ut._context){ut._context=E.extendDeep({},l);var Mt=V.select("base");ut._context._baseUrl=Mt.size()&&Mt.attr("href")?window.location.href.split("#")[0]:""}var Ot=ut._context,$t,ee,we;if(yt){for(ee=Object.keys(yt),$t=0;$t<ee.length;$t++)we=ee[$t],!(we==="editable"||we==="edits")&&we in Ot&&(we==="setBackground"&&yt[we]==="opaque"?Ot[we]=I:Ot[we]=yt[we]);var Me=yt.editable;if(Me!==void 0)for(Ot.editable=Me,ee=Object.keys(Ot.edits),$t=0;$t<ee.length;$t++)Ot.edits[ee[$t]]=Me;if(yt.edits)for(ee=Object.keys(yt.edits),$t=0;$t<ee.length;$t++)we=ee[$t],we in Ot.edits&&(Ot.edits[we]=yt.edits[we]);Ot._exportedPlot=yt._exportedPlot}Ot.staticPlot&&(Ot.editable=!1,Ot.edits={},Ot.autosizable=!1,Ot.scrollZoom=!1,Ot.doubleClick=!1,Ot.showTips=!1,Ot.showLink=!1,Ot.displayModeBar=!1),Ot.displayModeBar==="hover"&&!g&&(Ot.displayModeBar=!0),(Ot.setBackground==="transparent"||typeof Ot.setBackground!="function")&&(Ot.setBackground=D),Ot._hasZeroHeight=Ot._hasZeroHeight||ut.clientHeight===0,Ot._hasZeroWidth=Ot._hasZeroWidth||ut.clientWidth===0;var Re=Ot.scrollZoom,Be=Ot._scrollZoom={};if(Re===!0)Be.cartesian=1,Be.gl3d=1,Be.geo=1,Be.mapbox=1,Be.map=1;else if(typeof Re=="string"){var Ze=Re.split("+");for($t=0;$t<Ze.length;$t++)Be[Ze[$t]]=1}else Re!==!1&&(Be.gl3d=1,Be.geo=1,Be.mapbox=1,Be.map=1)}function B(ut){if(ut=E.getGraphDiv(ut),!E.isPlotDiv(ut))throw new Error("This element is not a Plotly plot: "+ut);return b.cleanData(ut.data),b.cleanLayout(ut.layout),ut.calcdata=void 0,X._doPlot(ut).then(function(){return ut.emit("plotly_redraw"),ut})}function R(ut,yt,Mt,Ot){return ut=E.getGraphDiv(ut),n.cleanPlot([],{},ut._fullData||[],ut._fullLayout||{}),n.purge(ut),X._doPlot(ut,yt,Mt,Ot)}function L(ut,yt){var Mt=yt+1,Ot=[],$t,ee;for($t=0;$t<ut.length;$t++)ee=ut[$t],ee<0?Ot.push(Mt+ee):Ot.push(ee);return Ot}function F(ut,yt,Mt){var Ot,$t;for(Ot=0;Ot<yt.length;Ot++){if($t=yt[Ot],$t!==parseInt($t,10))throw new Error("all values in "+Mt+" must be integers");if($t>=ut.data.length||$t<-ut.data.length)throw new Error(Mt+" must be valid indices for gd.data.");if(yt.indexOf($t,Ot+1)>-1||$t>=0&&yt.indexOf(-ut.data.length+$t)>-1||$t<0&&yt.indexOf(ut.data.length+$t)>-1)throw new Error("each index in "+Mt+" must be unique.")}}function N(ut,yt,Mt){if(!Array.isArray(ut.data))throw new Error("gd.data must be an array.");if(typeof yt>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(yt)||(yt=[yt]),F(ut,yt,"currentIndices"),typeof Mt<"u"&&!Array.isArray(Mt)&&(Mt=[Mt]),typeof Mt<"u"&&F(ut,Mt,"newIndices"),typeof Mt<"u"&&yt.length!==Mt.length)throw new Error("current and new indices must be of equal length.")}function j(ut,yt,Mt){var Ot,$t;if(!Array.isArray(ut.data))throw new Error("gd.data must be an array.");if(typeof yt>"u")throw new Error("traces must be defined.");for(Array.isArray(yt)||(yt=[yt]),Ot=0;Ot<yt.length;Ot++)if($t=yt[Ot],typeof $t!="object"||Array.isArray($t)||$t===null)throw new Error("all values in traces array must be non-array objects");if(typeof Mt<"u"&&!Array.isArray(Mt)&&(Mt=[Mt]),typeof Mt<"u"&&Mt.length!==yt.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function G(ut,yt,Mt,Ot){var $t=E.isPlainObject(Ot);if(!Array.isArray(ut.data))throw new Error("gd.data must be an array");if(!E.isPlainObject(yt))throw new Error("update must be a key:value object");if(typeof Mt>"u")throw new Error("indices must be an integer or array of integers");F(ut,Mt,"indices");for(var ee in yt){if(!Array.isArray(yt[ee])||yt[ee].length!==Mt.length)throw new Error("attribute "+ee+" must be an array of length equal to indices array length");if($t&&(!(ee in Ot)||!Array.isArray(Ot[ee])||Ot[ee].length!==yt[ee].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}function rt(ut,yt,Mt,Ot){var $t=E.isPlainObject(Ot),ee=[],we,Me,Re,Be,Ze;Array.isArray(Mt)||(Mt=[Mt]),Mt=L(Mt,ut.data.length-1);for(var Ue in yt)for(var mr=0;mr<Mt.length;mr++){if(we=ut.data[Mt[mr]],Re=A(we,Ue),Me=Re.get(),Be=yt[Ue][mr],!E.isArrayOrTypedArray(Be))throw new Error("attribute: "+Ue+" index: "+mr+" must be an array");if(!E.isArrayOrTypedArray(Me))throw new Error("cannot extend missing or non-array attribute: "+Ue);if(Me.constructor!==Be.constructor)throw new Error("cannot extend array with an array of a different type: "+Ue);Ze=$t?Ot[Ue][mr]:Ot,c(Ze)||(Ze=-1),ee.push({prop:Re,target:Me,insert:Be,maxp:Math.floor(Ze)})}return ee}function ct(ut,yt,Mt,Ot,$t){G(ut,yt,Mt,Ot);for(var ee=rt(ut,yt,Mt,Ot),we={},Me={},Re=0;Re<ee.length;Re++){var Be=ee[Re].prop,Ze=ee[Re].maxp,Ue=$t(ee[Re].target,ee[Re].insert,Ze);Be.set(Ue[0]),Array.isArray(we[Be.astr])||(we[Be.astr]=[]),we[Be.astr].push(Ue[1]),Array.isArray(Me[Be.astr])||(Me[Be.astr]=[]),Me[Be.astr].push(ee[Re].target.length)}return{update:we,maxPoints:Me}}function lt(ut,yt){var Mt=new ut.constructor(ut.length+yt.length);return Mt.set(ut),Mt.set(yt,ut.length),Mt}function tt(ut,yt,Mt,Ot){ut=E.getGraphDiv(ut);function $t(Re,Be,Ze){var Ue,mr;if(E.isTypedArray(Re))if(Ze<0){var ln=new Re.constructor(0),an=lt(Re,Be);Ze<0?(Ue=an,mr=ln):(Ue=ln,mr=an)}else if(Ue=new Re.constructor(Ze),mr=new Re.constructor(Re.length+Be.length-Ze),Ze===Be.length)Ue.set(Be),mr.set(Re);else if(Ze<Be.length){var vn=Be.length-Ze;Ue.set(Be.subarray(vn)),mr.set(Re),mr.set(Be.subarray(0,vn),Re.length)}else{var Sn=Ze-Be.length,An=Re.length-Sn;Ue.set(Re.subarray(An)),Ue.set(Be,Sn),mr.set(Re.subarray(0,An))}else Ue=Re.concat(Be),mr=Ze>=0&&Ze<Ue.length?Ue.splice(0,Ue.length-Ze):[];return[Ue,mr]}var ee=ct(ut,yt,Mt,Ot,$t),we=X.redraw(ut),Me=[ut,ee.update,Mt,ee.maxPoints];return e.add(ut,X.prependTraces,Me,tt,arguments),we}function Z(ut,yt,Mt,Ot){ut=E.getGraphDiv(ut);function $t(Re,Be,Ze){var Ue,mr;if(E.isTypedArray(Re))if(Ze<=0){var ln=new Re.constructor(0),an=lt(Be,Re);Ze<0?(Ue=an,mr=ln):(Ue=ln,mr=an)}else if(Ue=new Re.constructor(Ze),mr=new Re.constructor(Re.length+Be.length-Ze),Ze===Be.length)Ue.set(Be),mr.set(Re);else if(Ze<Be.length){var vn=Be.length-Ze;Ue.set(Be.subarray(0,vn)),mr.set(Be.subarray(vn)),mr.set(Re,vn)}else{var Sn=Ze-Be.length;Ue.set(Be),Ue.set(Re.subarray(0,Sn),Be.length),mr.set(Re.subarray(Sn))}else Ue=Be.concat(Re),mr=Ze>=0&&Ze<Ue.length?Ue.splice(Ze,Ue.length):[];return[Ue,mr]}var ee=ct(ut,yt,Mt,Ot,$t),we=X.redraw(ut),Me=[ut,ee.update,Mt,ee.maxPoints];return e.add(ut,X.extendTraces,Me,Z,arguments),we}function st(ut,yt,Mt){ut=E.getGraphDiv(ut);var Ot=[],$t=X.deleteTraces,ee=st,we=[ut,Ot],Me=[ut,yt],Re,Be;for(j(ut,yt,Mt),Array.isArray(yt)||(yt=[yt]),yt=yt.map(function(Ze){return E.extendFlat({},Ze)}),b.cleanData(yt),Re=0;Re<yt.length;Re++)ut.data.push(yt[Re]);for(Re=0;Re<yt.length;Re++)Ot.push(-yt.length+Re);if(typeof Mt>"u")return Be=X.redraw(ut),e.add(ut,$t,we,ee,Me),Be;Array.isArray(Mt)||(Mt=[Mt]);try{N(ut,Ot,Mt)}catch(Ze){throw ut.data.splice(ut.data.length-yt.length,yt.length),Ze}return e.startSequence(ut),e.add(ut,$t,we,ee,Me),Be=X.moveTraces(ut,Ot,Mt),e.stopSequence(ut),Be}function $(ut,yt){ut=E.getGraphDiv(ut);var Mt=[],Ot=X.addTraces,$t=$,ee=[ut,Mt,yt],we=[ut,yt],Me,Re;if(typeof yt>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(yt)||(yt=[yt]),F(ut,yt,"indices"),yt=L(yt,ut.data.length-1),yt.sort(E.sorterDes),Me=0;Me<yt.length;Me+=1)Re=ut.data.splice(yt[Me],1)[0],Mt.push(Re);var Be=X.redraw(ut);return e.add(ut,Ot,ee,$t,we),Be}function Q(ut,yt,Mt){ut=E.getGraphDiv(ut);var Ot=[],$t=[],ee=Q,we=Q,Me=[ut,Mt,yt],Re=[ut,yt,Mt],Be;if(N(ut,yt,Mt),yt=Array.isArray(yt)?yt:[yt],typeof Mt>"u")for(Mt=[],Be=0;Be<yt.length;Be++)Mt.push(-yt.length+Be);for(Mt=Array.isArray(Mt)?Mt:[Mt],yt=L(yt,ut.data.length-1),Mt=L(Mt,ut.data.length-1),Be=0;Be<ut.data.length;Be++)yt.indexOf(Be)===-1&&Ot.push(ut.data[Be]);for(Be=0;Be<yt.length;Be++)$t.push({newIndex:Mt[Be],trace:ut.data[yt[Be]]});for($t.sort(function(Ue,mr){return Ue.newIndex-mr.newIndex}),Be=0;Be<$t.length;Be+=1)Ot.splice($t[Be].newIndex,0,$t[Be].trace);ut.data=Ot;var Ze=X.redraw(ut);return e.add(ut,ee,Me,we,Re),Ze}function nt(ut,yt,Mt,Ot){ut=E.getGraphDiv(ut),b.clearPromiseQueue(ut);var $t={};if(typeof yt=="string")$t[yt]=Mt;else if(E.isPlainObject(yt))$t=E.extendFlat({},yt),Ot===void 0&&(Ot=Mt);else return E.warn("Restyle fail.",yt,Mt,Ot),Promise.reject();Object.keys($t).length&&(ut.changed=!0);var ee=b.coerceTraceIndices(ut,Ot),we=dt(ut,$t,ee),Me=we.flags;Me.calc&&(ut.calcdata=void 0),Me.clearAxisTypes&&b.clearAxisTypes(ut,ee,{});var Re=[];Me.fullReplot?Re.push(X._doPlot):(Re.push(n.previousPromises),n.supplyDefaults(ut),Me.markerSize&&(n.doCalcdata(ut),Ft(Re)),Me.style&&Re.push(S.doTraceStyle),Me.colorbars&&Re.push(S.doColorBars),Re.push(k)),Re.push(n.rehover,n.redrag,n.reselect),e.add(ut,nt,[ut,we.undoit,we.traces],nt,[ut,we.redoit,we.traces]);var Be=E.syncOrAsync(Re,ut);return(!Be||!Be.then)&&(Be=Promise.resolve()),Be.then(function(){return ut.emit("plotly_restyle",we.eventData),ut})}function Y(ut){return ut===void 0?null:ut}function q(ut,yt){return yt?function(Mt,Ot,$t){var ee=A(Mt,Ot),we=ee.set;return ee.set=function(Me){var Re=($t||"")+Ot;ot(Re,ee.get(),Me,ut),we(Me)},ee}:A}function ot(ut,yt,Mt,Ot){if(Array.isArray(yt)||Array.isArray(Mt))for(var $t=Array.isArray(yt)?yt:[],ee=Array.isArray(Mt)?Mt:[],we=Math.max($t.length,ee.length),Me=0;Me<we;Me++)ot(ut+"["+Me+"]",$t[Me],ee[Me],Ot);else if(E.isPlainObject(yt)||E.isPlainObject(Mt)){var Re=E.isPlainObject(yt)?yt:{},Be=E.isPlainObject(Mt)?Mt:{},Ze=E.extendFlat({},Re,Be);for(var Ue in Ze)ot(ut+"."+Ue,Re[Ue],Be[Ue],Ot)}else Ot[ut]===void 0&&(Ot[ut]=Y(yt))}function it(ut,yt,Mt){for(var Ot in Mt){var $t=A(ut,Ot);ot(Ot,$t.get(),Mt[Ot],yt)}}function dt(ut,yt,Mt){var Ot=ut._fullLayout,$t=ut._fullData,ee=ut.data,we=Ot._guiEditing,Me=q(Ot._preGUI,we),Re=E.extendDeepAll({},yt),Be,Ze=T.traceFlags(),Ue={},mr={},ln;function an(){return Mt.map(function(){})}function vn(yr){var Hr=o.id2name(yr);ln.indexOf(Hr)===-1&&ln.push(Hr)}function Sn(yr){return"LAYOUT"+yr+".autorange"}function An(yr){return"LAYOUT"+yr+".range"}function pn(yr){for(var Hr=yr;Hr<$t.length;Hr++)if($t[Hr]._input===ee[yr])return $t[Hr]}function On(yr,Hr,hn){if(Array.isArray(yr)){yr.forEach(function(Tn){On(Tn,Hr,hn)});return}if(!(yr in yt||b.hasParent(yt,yr))){var En;if(yr.substr(0,6)==="LAYOUT")En=Me(ut.layout,yr.replace("LAYOUT",""));else{var dn=Mt[hn],Kr=Ot._tracePreGUI[pn(dn)._fullInput.uid];En=q(Kr,we)(ee[dn],yr)}yr in mr||(mr[yr]=an()),mr[yr][hn]===void 0&&(mr[yr][hn]=Y(En.get())),Hr!==void 0&&En.set(Hr)}}function Nn(yr){return function(Hr){return $t[Hr][yr]}}function ke(yr){return function(Hr,hn){return Hr===!1?$t[Mt[hn]][yr]:null}}for(var ze in yt){if(b.hasParent(yt,ze))throw new Error("cannot set "+ze+" and a parent attribute simultaneously");var je=yt[ze],Ne,_r,Xr,rn,Br,_n;if((ze==="autobinx"||ze==="autobiny")&&(ze=ze.charAt(ze.length-1)+"bins",Array.isArray(je)?je=je.map(ke(ze)):je===!1?je=Mt.map(Nn(ze)):je=null),Ue[ze]=je,ze.substr(0,6)==="LAYOUT"){Xr=Me(ut.layout,ze.replace("LAYOUT","")),mr[ze]=[Y(Xr.get())],Xr.set(Array.isArray(je)?je[0]:je),Ze.calc=!0;continue}for(mr[ze]=an(),Be=0;Be<Mt.length;Be++){Ne=ee[Mt[Be]],_r=pn(Mt[Be]);var bn=Ot._tracePreGUI[_r._fullInput.uid];if(Xr=q(bn,we)(Ne,ze),rn=Xr.get(),Br=Array.isArray(je)?je[Be%je.length]:je,Br!==void 0){var Fn=Xr.parts[Xr.parts.length-1],on=ze.substr(0,ze.length-Fn.length-1),Bn=on?on+".":"",ue=on?A(_r,on).get():_r;if(_n=i.getTraceValObject(_r,Xr.parts),_n&&_n.impliedEdits&&Br!==null)for(var xe in _n.impliedEdits)On(E.relativeAttr(ze,xe),_n.impliedEdits[xe],Be);else if((Fn==="thicknessmode"||Fn==="lenmode")&&rn!==Br&&(Br==="fraction"||Br==="pixels")&&ue){var Pr=Ot._size,Sr=ue.orient,gr=Sr==="top"||Sr==="bottom";if(Fn==="thicknessmode"){var dr=gr?Pr.h:Pr.w;On(Bn+"thickness",ue.thickness*(Br==="fraction"?1/dr:dr),Be)}else{var Er=gr?Pr.w:Pr.h;On(Bn+"len",ue.len*(Br==="fraction"?1/Er:Er),Be)}}else if(ze==="type"&&(Br==="pie"!=(rn==="pie")||Br==="funnelarea"!=(rn==="funnelarea"))){var Dr="x",Ar="y";(Br==="bar"||rn==="bar")&&Ne.orientation==="h"&&(Dr="y",Ar="x"),E.swapAttrs(Ne,["?","?src"],"labels",Dr),E.swapAttrs(Ne,["d?","?0"],"label",Dr),E.swapAttrs(Ne,["?","?src"],"values",Ar),rn==="pie"||rn==="funnelarea"?(A(Ne,"marker.color").set(A(Ne,"marker.colors").get()),Ot._pielayer.selectAll("g.trace").remove()):r.traceIs(Ne,"cartesian")&&A(Ne,"marker.colors").set(A(Ne,"marker.color").get())}mr[ze][Be]=Y(rn);var Gr=["swapxy","swapxyaxes","orientation","orientationaxes"];if(Gr.indexOf(ze)!==-1){if(ze==="orientation"){Xr.set(Br);var Wr=Ne.x&&!Ne.y?"h":"v";if((Xr.get()||Wr)===_r.orientation)continue}else ze==="orientationaxes"&&(Ne.orientation={v:"h",h:"v"}[_r.orientation]);b.swapXYData(Ne),Ze.calc=Ze.clearAxisTypes=!0}else n.dataArrayContainers.indexOf(Xr.parts[0])!==-1?(b.manageArrayContainers(Xr,Br,mr),Ze.calc=!0):(_n?_n.arrayOk&&!r.traceIs(_r,"regl")&&(E.isArrayOrTypedArray(Br)||E.isArrayOrTypedArray(rn))?Ze.calc=!0:T.update(Ze,_n):Ze.calc=!0,Xr.set(Br))}}if(["swapxyaxes","orientationaxes"].indexOf(ze)!==-1&&o.swap(ut,Mt),ze==="orientationaxes"){var Jr=A(ut.layout,"hovermode"),_e=Jr.get();_e==="x"?Jr.set("y"):_e==="y"?Jr.set("x"):_e==="x unified"?Jr.set("y unified"):_e==="y unified"&&Jr.set("x unified")}if(["orientation","type"].indexOf(ze)!==-1){for(ln=[],Be=0;Be<Mt.length;Be++){var Je=ee[Mt[Be]];r.traceIs(Je,"cartesian")&&(vn(Je.xaxis||"x"),vn(Je.yaxis||"y"))}On(ln.map(Sn),!0,0),On(ln.map(An),[0,1],0)}}return(Ze.calc||Ze.plot)&&(Ze.fullReplot=!0),{flags:Ze,undoit:mr,redoit:Ue,traces:Mt,eventData:E.extendDeepNoArrays([],[Re,Mt])}}function wt(ut,yt,Mt){ut=E.getGraphDiv(ut),b.clearPromiseQueue(ut);var Ot={};if(typeof yt=="string")Ot[yt]=Mt;else if(E.isPlainObject(yt))Ot=E.extendFlat({},yt);else return E.warn("Relayout fail.",yt,Mt),Promise.reject();Object.keys(Ot).length&&(ut.changed=!0);var $t=Jt(ut,Ot),ee=$t.flags;ee.calc&&(ut.calcdata=void 0);var we=[n.previousPromises];ee.layoutReplot?we.push(S.layoutReplot):Object.keys(Ot).length&&(xt(ut,ee,$t)||n.supplyDefaults(ut),ee.legend&&we.push(S.doLegend),ee.layoutstyle&&we.push(S.layoutStyles),ee.axrange&&Ft(we,$t.rangesAltered),ee.ticks&&we.push(S.doTicksRelayout),ee.modebar&&we.push(S.doModeBar),ee.camera&&we.push(S.doCamera),ee.colorbars&&we.push(S.doColorBars),we.push(k)),we.push(n.rehover,n.redrag,n.reselect),e.add(ut,wt,[ut,$t.undoit],wt,[ut,$t.redoit]);var Me=E.syncOrAsync(we,ut);return(!Me||!Me.then)&&(Me=Promise.resolve(ut)),Me.then(function(){return ut.emit("plotly_relayout",$t.eventData),ut})}function xt(ut,yt,Mt){var Ot=ut._fullLayout;if(!yt.axrange)return!1;for(var $t in yt)if($t!=="axrange"&&yt[$t])return!1;var ee,we,Me=function(ln,an){return E.coerce(ee,we,s,ln,an)},Re={};for(var Be in Mt.rangesAltered){var Ze=o.id2name(Be);if(ee=ut.layout[Ze],we=Ot[Ze],a(ee,we,Me,Re),we._matchGroup){for(var Ue in we._matchGroup)if(Ue!==Be){var mr=Ot[o.id2name(Ue)];mr.autorange=we.autorange,mr.range=we.range.slice(),mr._input.range=we.range.slice()}}}return!0}function Ft(ut,yt){var Mt=yt?function(Ot){var $t=[],ee=!0;for(var we in yt){var Me=o.getFromId(Ot,we);if($t.push(we),(Me.ticklabelposition||"").indexOf("inside")!==-1&&Me._anchorAxis&&$t.push(Me._anchorAxis._id),Me._matchGroup)for(var Re in Me._matchGroup)yt[Re]||$t.push(Re)}return o.draw(Ot,$t,{skipTitle:ee})}:function(Ot){return o.draw(Ot,"redraw")};ut.push(y,S.doAutoRangeAndConstraints,Mt,S.drawData,S.finalDraw)}var Et=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Nt=/^[xyz]axis[0-9]*\.autorange$/,te=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Jt(ut,yt){var Mt=ut.layout,Ot=ut._fullLayout,$t=Ot._guiEditing,ee=q(Ot._preGUI,$t),we=Object.keys(yt),Me=o.list(ut),Re=E.extendDeepAll({},yt),Be={},Ze,Ue,mr;for(we=Object.keys(yt),Ue=0;Ue<we.length;Ue++)if(we[Ue].indexOf("allaxes")===0){for(mr=0;mr<Me.length;mr++){var ln=Me[mr]._id.substr(1),an=ln.indexOf("scene")!==-1?ln+".":"",vn=we[Ue].replace("allaxes",an+Me[mr]._name);yt[vn]||(yt[vn]=yt[we[Ue]])}delete yt[we[Ue]]}var Sn=T.layoutFlags(),An={},pn={};function On(Kr,Tn){if(Array.isArray(Kr)){Kr.forEach(function(Qn){On(Qn,Tn)});return}if(!(Kr in yt||b.hasParent(yt,Kr))){var ta=ee(Mt,Kr);Kr in pn||(pn[Kr]=Y(ta.get())),Tn!==void 0&&ta.set(Tn)}}var Nn={},ke;function ze(Kr){var Tn=o.name2id(Kr.split(".")[0]);return Nn[Tn]=1,Tn}for(var je in yt){if(b.hasParent(yt,je))throw new Error("cannot set "+je+" and a parent attribute simultaneously");for(var Ne=ee(Mt,je),_r=yt[je],Xr=Ne.parts.length,rn=Xr-1;rn>0&&typeof Ne.parts[rn]!="string";)rn--;var Br=Ne.parts[rn],_n=Ne.parts[rn-1]+"."+Br,bn=Ne.parts.slice(0,rn).join("."),Fn=A(ut.layout,bn).get(),on=A(Ot,bn).get(),Bn=Ne.get();if(_r!==void 0){An[je]=_r,pn[je]=Br==="reverse"?_r:Y(Bn);var ue=i.getLayoutValObject(Ot,Ne.parts);if(ue&&ue.impliedEdits&&_r!==null)for(var xe in ue.impliedEdits)On(E.relativeAttr(je,xe),ue.impliedEdits[xe]);if(["width","height"].indexOf(je)!==-1)if(_r){On("autosize",null);var Pr=je==="height"?"width":"height";On(Pr,Ot[Pr])}else Ot[je]=ut._initialAutoSize[je];else if(je==="autosize")On("width",_r?null:Ot.width),On("height",_r?null:Ot.height);else if(_n.match(Et))ze(_n),A(Ot,bn+"._inputRange").set(null);else if(_n.match(Nt)){ze(_n),A(Ot,bn+"._inputRange").set(null);var Sr=A(Ot,bn).get();Sr._inputDomain&&(Sr._input.domain=Sr._inputDomain.slice())}else _n.match(te)&&A(Ot,bn+"._inputDomain").set(null);if(Br==="type"){ke=Fn;var gr=on.type==="linear"&&_r==="log",dr=on.type==="log"&&_r==="linear";if(gr||dr){if(!ke||!ke.range)On(bn+".autorange",!0);else if(on.autorange)gr&&(ke.range=ke.range[1]>ke.range[0]?[1,2]:[2,1]);else{var Er=ke.range[0],Dr=ke.range[1];gr?(Er<=0&&Dr<=0&&On(bn+".autorange",!0),Er<=0?Er=Dr/1e6:Dr<=0&&(Dr=Er/1e6),On(bn+".range[0]",Math.log(Er)/Math.LN10),On(bn+".range[1]",Math.log(Dr)/Math.LN10)):(On(bn+".range[0]",Math.pow(10,Er)),On(bn+".range[1]",Math.pow(10,Dr)))}Array.isArray(Ot._subplots.polar)&&Ot._subplots.polar.length&&Ot[Ne.parts[0]]&&Ne.parts[1]==="radialaxis"&&delete Ot[Ne.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(ut,on,_r,On),r.getComponentMethod("images","convertCoords")(ut,on,_r,On)}else On(bn+".autorange",!0),On(bn+".range",null);A(Ot,bn+"._inputRange").set(null)}else if(Br.match(M)){var Ar=A(Ot,je).get(),Gr=(_r||{}).type;(!Gr||Gr==="-")&&(Gr="linear"),r.getComponentMethod("annotations","convertCoords")(ut,Ar,Gr,On),r.getComponentMethod("images","convertCoords")(ut,Ar,Gr,On)}var Wr=x.containerArrayMatch(je);if(Wr){Ze=Wr.array,Ue=Wr.index;var Jr=Wr.property,_e=ue||{editType:"calc"};Ue!==""&&Jr===""&&(x.isAddVal(_r)?pn[je]=null:x.isRemoveVal(_r)?pn[je]=(A(Mt,Ze).get()||[])[Ue]:E.warn("unrecognized full object value",yt)),T.update(Sn,_e),Be[Ze]||(Be[Ze]={});var Je=Be[Ze][Ue];Je||(Je=Be[Ze][Ue]={}),Je[Jr]=_r,delete yt[je]}else Br==="reverse"?(Fn.range?Fn.range.reverse():(On(bn+".autorange",!0),Fn.range=[1,0]),on.autorange?Sn.calc=!0:Sn.plot=!0):(je==="dragmode"&&(_r===!1&&Bn!==!1||_r!==!1&&Bn===!1)||Ot._has("scatter-like")&&Ot._has("regl")&&je==="dragmode"&&(_r==="lasso"||_r==="select")&&!(Bn==="lasso"||Bn==="select")?Sn.plot=!0:ue?T.update(Sn,ue):Sn.calc=!0,Ne.set(_r))}}for(Ze in Be){var yr=x.applyContainerArrayChanges(ut,ee(Mt,Ze),Be[Ze],Sn,ee);yr||(Sn.plot=!0)}for(var Hr in Nn){ke=o.getFromId(ut,Hr);var hn=ke&&ke._constraintGroup;if(hn){Sn.calc=!0;for(var En in hn)Nn[En]||(o.getFromId(ut,En)._constraintShrinkable=!0)}}(Qt(ut)||yt.height||yt.width)&&(Sn.plot=!0);var dn=Ot.shapes;for(Ue=0;Ue<dn.length;Ue++)if(dn[Ue].showlegend){Sn.calc=!0;break}return(Sn.plot||Sn.calc)&&(Sn.layoutReplot=!0),{flags:Sn,rangesAltered:Nn,undoit:pn,redoit:An,eventData:Re}}function Qt(ut){var yt=ut._fullLayout,Mt=yt.width,Ot=yt.height;return ut.layout.autosize&&n.plotAutoSize(ut,ut.layout,yt),yt.width!==Mt||yt.height!==Ot}function Wt(ut,yt,Mt,Ot){ut=E.getGraphDiv(ut),b.clearPromiseQueue(ut),E.isPlainObject(yt)||(yt={}),E.isPlainObject(Mt)||(Mt={}),Object.keys(yt).length&&(ut.changed=!0),Object.keys(Mt).length&&(ut.changed=!0);var $t=b.coerceTraceIndices(ut,Ot),ee=dt(ut,E.extendFlat({},yt),$t),we=ee.flags,Me=Jt(ut,E.extendFlat({},Mt)),Re=Me.flags;(we.calc||Re.calc)&&(ut.calcdata=void 0),we.clearAxisTypes&&b.clearAxisTypes(ut,$t,Mt);var Be=[];Re.layoutReplot?Be.push(S.layoutReplot):we.fullReplot?Be.push(X._doPlot):(Be.push(n.previousPromises),xt(ut,Re,Me)||n.supplyDefaults(ut),we.style&&Be.push(S.doTraceStyle),(we.colorbars||Re.colorbars)&&Be.push(S.doColorBars),Re.legend&&Be.push(S.doLegend),Re.layoutstyle&&Be.push(S.layoutStyles),Re.axrange&&Ft(Be,Me.rangesAltered),Re.ticks&&Be.push(S.doTicksRelayout),Re.modebar&&Be.push(S.doModeBar),Re.camera&&Be.push(S.doCamera),Be.push(k)),Be.push(n.rehover,n.redrag,n.reselect),e.add(ut,Wt,[ut,ee.undoit,Me.undoit,ee.traces],Wt,[ut,ee.redoit,Me.redoit,ee.traces]);var Ze=E.syncOrAsync(Be,ut);return(!Ze||!Ze.then)&&(Ze=Promise.resolve(ut)),Ze.then(function(){return ut.emit("plotly_update",{data:ee.eventData,layout:Me.eventData}),ut})}function gt(ut){return function(yt){yt._fullLayout._guiEditing=!0;var Mt=ut.apply(null,arguments);return yt._fullLayout._guiEditing=!1,Mt}}var bt=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^(map\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],vt=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function Ut(ut,yt){for(var Mt=0;Mt<yt.length;Mt++){var Ot=yt[Mt],$t=ut.match(Ot.pattern);if($t){var ee=$t[1]||"";return{head:ee,tail:ut.substr(ee.length+1),attr:Ot.attr}}}}function Kt(ut,yt){var Mt=A(yt,ut).get();if(Mt!==void 0)return Mt;var Ot=ut.split(".");for(Ot.pop();Ot.length>1;)if(Ot.pop(),Mt=A(yt,Ot.join(".")+".uirevision").get(),Mt!==void 0)return Mt;return yt.uirevision}function Zt(ut,yt){for(var Mt=0;Mt<yt.length;Mt++)if(yt[Mt]._fullInput.uid===ut)return Mt;return-1}function le(ut,yt,Mt){for(var Ot=0;Ot<yt.length;Ot++)if(yt[Ot].uid===ut)return Ot;return!yt[Mt]||yt[Mt].uid?-1:Mt}function Te(ut,yt){var Mt=E.isPlainObject(ut),Ot=Array.isArray(ut);return Mt||Ot?(Mt&&E.isPlainObject(yt)||Ot&&Array.isArray(yt))&&JSON.stringify(ut)===JSON.stringify(yt):ut===yt}function Se(ut,yt,Mt,Ot){var $t=Ot._preGUI,ee,we,Me,Re,Be,Ze,Ue,mr,ln,an,vn=[],Sn={},An={};for(ee in $t){if(Be=Ut(ee,bt),Be){if(ln=Be.head,an=Be.tail,we=Be.attr||ln+".uirevision",Me=A(Ot,we).get(),Re=Me&&Kt(we,yt),Re&&Re===Me){if(Ze=$t[ee],Ze===null&&(Ze=void 0),Ue=A(yt,ee),mr=Ue.get(),Te(mr,Ze)){mr===void 0&&an==="autorange"&&vn.push(ln),Ue.set(Y(A(Ot,ee).get()));continue}else if(an==="autorange"||an.substr(0,6)==="range["){var pn=$t[ln+".range[0]"],On=$t[ln+".range[1]"],Nn=$t[ln+".autorange"];if(Nn||Nn===null&&pn===null&&On===null){if(!(ln in Sn)){var ke=A(yt,ln).get();Sn[ln]=ke&&(ke.autorange||ke.autorange!==!1&&(!ke.range||ke.range.length!==2))}if(Sn[ln]){Ue.set(Y(A(Ot,ee).get()));continue}}}}}else E.warn("unrecognized GUI edit: "+ee);delete $t[ee],Be&&Be.tail.substr(0,6)==="range["&&(An[Be.head]=1)}for(var ze=0;ze<vn.length;ze++){var je=vn[ze];if(An[je]){var Ne=A(yt,je).get();Ne&&delete Ne.autorange}}var _r=Ot._tracePreGUI;for(var Xr in _r){var rn=_r[Xr],Br=null,_n;for(ee in rn){if(!Br){var bn=Zt(Xr,Mt);if(bn<0){delete _r[Xr];break}var Fn=Mt[bn];_n=Fn._fullInput;var on=le(Xr,ut,_n.index);if(on<0){delete _r[Xr];break}Br=ut[on]}if(Be=Ut(ee,vt),Be){if(Be.attr?(Me=A(Ot,Be.attr).get(),Re=Me&&Kt(Be.attr,yt)):(Me=_n.uirevision,Re=Br.uirevision,Re===void 0&&(Re=yt.uirevision)),Re&&Re===Me&&(Ze=rn[ee],Ze===null&&(Ze=void 0),Ue=A(Br,ee),mr=Ue.get(),Te(mr,Ze))){Ue.set(Y(A(_n,ee).get()));continue}}else E.warn("unrecognized GUI edit: "+ee+" in trace uid "+Xr);delete rn[ee]}}}function Fe(ut,yt,Mt,Ot){var $t,ee;function we(){return X.addFrames(ut,$t)}ut=E.getGraphDiv(ut),b.clearPromiseQueue(ut);var Me=ut._fullData,Re=ut._fullLayout;if(!E.isPlotDiv(ut)||!Me||!Re)ee=X.newPlot(ut,yt,Mt,Ot);else{if(E.isPlainObject(yt)){var Be=yt;yt=Be.data,Mt=Be.layout,Ot=Be.config,$t=Be.frames}var Ze=!1;if(Ot){var Ue=E.extendDeep({},ut._context);ut._context=void 0,O(ut,Ot),Ze=We(Ue,ut._context)}ut.data=yt||[],b.cleanData(ut.data),ut.layout=Mt||{},b.cleanLayout(ut.layout),Se(ut.data,ut.layout,Me,Re),n.supplyDefaults(ut,{skipUpdateCalc:!0});var mr=ut._fullData,ln=ut._fullLayout,an=ln.datarevision===void 0,vn=ln.transition,Sn=ur(ut,Re,ln,an,vn),An=Sn.newDataRevision,pn=Oe(ut,Me,mr,an,vn,An);if(Qt(ut)&&(Sn.layoutReplot=!0),pn.calc||Sn.calc){ut.calcdata=void 0;for(var On=Object.getOwnPropertyNames(ln),Nn=0;Nn<On.length;Nn++){var ke=On[Nn],ze=ke.substring(0,5);if(ze==="xaxis"||ze==="yaxis"){var je=ln[ke]._emptyCategories;je&&je()}}}else n.supplyDefaultsUpdateCalc(ut.calcdata,mr);var Ne=[];if($t&&(ut._transitionData={},n.createTransitionData(ut),Ne.push(we)),ln.transition&&!Ze&&(pn.anim||Sn.anim))Sn.ticks&&Ne.push(S.doTicksRelayout),n.doCalcdata(ut),S.doAutoRangeAndConstraints(ut),Ne.push(function(){return n.transitionFromReact(ut,pn,Sn,Re)});else if(pn.fullReplot||Sn.layoutReplot||Ze)ut._fullLayout._skipDefaults=!0,Ne.push(X._doPlot);else{for(var _r in Sn.arrays){var Xr=Sn.arrays[_r];if(Xr.length){var rn=r.getComponentMethod(_r,"drawOne");if(rn!==E.noop)for(var Br=0;Br<Xr.length;Br++)rn(ut,Xr[Br]);else{var _n=r.getComponentMethod(_r,"draw");if(_n===E.noop)throw new Error("cannot draw components: "+_r);_n(ut)}}}Ne.push(n.previousPromises),pn.style&&Ne.push(S.doTraceStyle),(pn.colorbars||Sn.colorbars)&&Ne.push(S.doColorBars),Sn.legend&&Ne.push(S.doLegend),Sn.layoutstyle&&Ne.push(S.layoutStyles),Sn.axrange&&Ft(Ne),Sn.ticks&&Ne.push(S.doTicksRelayout),Sn.modebar&&Ne.push(S.doModeBar),Sn.camera&&Ne.push(S.doCamera),Ne.push(k)}Ne.push(n.rehover,n.redrag,n.reselect),ee=E.syncOrAsync(Ne,ut),(!ee||!ee.then)&&(ee=Promise.resolve(ut))}return ee.then(function(){return ut.emit("plotly_react",{data:yt,layout:Mt}),ut})}function Oe(ut,yt,Mt,Ot,$t,ee){var we=yt.length===Mt.length;if(!$t&&!we)return{fullReplot:!0,calc:!0};var Me=T.traceFlags();Me.arrays={},Me.nChanges=0,Me.nChangesAnim=0;var Re,Be;function Ze(ln){var an=i.getTraceValObject(Be,ln);return!Be._module.animatable&&an.anim&&(an.anim=!1),an}var Ue={getValObject:Ze,flags:Me,immutable:Ot,transition:$t,newDataRevision:ee,gd:ut},mr={};for(Re=0;Re<yt.length;Re++)if(Mt[Re]){if(Be=Mt[Re]._fullInput,mr[Be.uid])continue;mr[Be.uid]=1,fr(yt[Re]._fullInput,Be,[],Ue)}return(Me.calc||Me.plot)&&(Me.fullReplot=!0),$t&&Me.nChanges&&Me.nChangesAnim&&(Me.anim=Me.nChanges===Me.nChangesAnim&&we?"all":"some"),Me}function ur(ut,yt,Mt,Ot,$t){var ee=T.layoutFlags();ee.arrays={},ee.rangesAltered={},ee.nChanges=0,ee.nChangesAnim=0;function we(mr){return i.getLayoutValObject(Mt,mr)}for(var Me in Mt)if(!(!Me.startsWith("xaxis")&&!Me.startsWith("yaxis"))&&yt[Me]){var Re=Mt[Me].domain,Be=yt[Me].domain,Ze=yt[Me]._inputDomain;yt[Me]._inputDomain&&(Re[0]===Ze[0]&&Re[1]===Ze[1]?Mt[Me].domain=yt[Me].domain:(Re[0]!==Be[0]||Re[1]!==Be[1])&&(Mt[Me]._inputDomain=null))}var Ue={getValObject:we,flags:ee,immutable:Ot,transition:$t,gd:ut};return fr(yt,Mt,[],Ue),(ee.plot||ee.calc)&&(ee.layoutReplot=!0),$t&&ee.nChanges&&ee.nChangesAnim&&(ee.anim=ee.nChanges===ee.nChangesAnim?"all":"some"),ee}function fr(ut,yt,Mt,Ot){var $t,ee,we,Me=Ot.getValObject,Re=Ot.flags,Be=Ot.immutable,Ze=Ot.inArray,Ue=Ot.arrayIndex;function mr(){var bn=$t.editType;if(Ze&&bn.indexOf("arraydraw")!==-1){E.pushUnique(Re.arrays[Ze],Ue);return}T.update(Re,$t),bn!=="none"&&Re.nChanges++,Ot.transition&&$t.anim&&Re.nChangesAnim++,(Et.test(we)||Nt.test(we))&&(Re.rangesAltered[Mt[0]]=1),ee==="datarevision"&&(Re.newDataRevision=1)}function ln(bn){return bn.valType==="data_array"||bn.arrayOk}for(ee in ut){if(Re.calc&&!Ot.transition)return;var an=ut[ee],vn=yt[ee],Sn=Mt.concat(ee);if(we=Sn.join("."),!(ee.charAt(0)==="_"||typeof an=="function"||an===vn)){if((ee==="tick0"||ee==="dtick")&&Mt[0]!=="geo"){var An=yt.tickmode;if(An==="auto"||An==="array"||!An)continue}if(!(ee==="range"&&yt.autorange)&&!((ee==="zmin"||ee==="zmax")&&yt.type==="contourcarpet")&&($t=Me(Sn),!!$t&&!($t._compareAsJSON&&JSON.stringify(an)===JSON.stringify(vn)))){var pn=$t.valType,On,Nn=ln($t),ke=Array.isArray(an),ze=Array.isArray(vn);if(ke&&ze){var je="_input_"+ee,Ne=ut[je],_r=yt[je];if(Array.isArray(Ne)&&Ne===_r)continue}if(vn===void 0)Nn&&ke?Re.calc=!0:mr();else if($t._isLinkedToArray){var Xr=[],rn=!1;Ze||(Re.arrays[ee]=Xr);var Br=Math.min(an.length,vn.length),_n=Math.max(an.length,vn.length);if(Br!==_n)if($t.editType==="arraydraw")rn=!0;else{mr();continue}for(On=0;On<Br;On++)fr(an[On],vn[On],Sn.concat(On),E.extendFlat({inArray:ee,arrayIndex:On},Ot));if(rn)for(On=Br;On<_n;On++)Xr.push(On)}else!pn&&E.isPlainObject(an)?fr(an,vn,Sn,Ot):Nn?ke&&ze?(Be&&(Re.calc=!0),(Be||Ot.newDataRevision)&&mr()):ke!==ze?Re.calc=!0:mr():ke&&ze?(an.length!==vn.length||String(an)!==String(vn))&&mr():mr()}}}for(ee in yt)if(!(ee in ut||ee.charAt(0)==="_"||typeof yt[ee]=="function"))if($t=Me(Mt.concat(ee)),ln($t)&&Array.isArray(yt[ee])){Re.calc=!0;return}else mr()}function We(ut,yt){var Mt;for(Mt in ut)if(Mt.charAt(0)!=="_"){var Ot=ut[Mt],$t=yt[Mt];if(Ot!==$t)if(E.isPlainObject(Ot)&&E.isPlainObject($t)){if(We(Ot,$t))return!0}else if(Array.isArray(Ot)&&Array.isArray($t)){if(Ot.length!==$t.length)return!0;for(var ee=0;ee<Ot.length;ee++)if(Ot[ee]!==$t[ee])if(E.isPlainObject(Ot[ee])&&E.isPlainObject($t[ee])){if(We(Ot[ee],$t[ee]))return!0}else return!0}else return!0}}function Lr(ut,yt,Mt){if(ut=E.getGraphDiv(ut),!E.isPlotDiv(ut))throw new Error("This element is not a Plotly plot: "+ut+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var Ot=ut._transitionData;Ot._frameQueue||(Ot._frameQueue=[]),Mt=n.supplyAnimationDefaults(Mt);var $t=Mt.transition,ee=Mt.frame;Ot._frameWaitingCnt===void 0&&(Ot._frameWaitingCnt=0);function we(Be){return Array.isArray($t)?Be>=$t.length?$t[0]:$t[Be]:$t}function Me(Be){return Array.isArray(ee)?Be>=ee.length?ee[0]:ee[Be]:ee}function Re(Be,Ze){var Ue=0;return function(){if(Be&&++Ue===Ze)return Be()}}return new Promise(function(Be,Ze){function Ue(){if(Ot._frameQueue.length!==0){for(;Ot._frameQueue.length;){var Br=Ot._frameQueue.pop();Br.onInterrupt&&Br.onInterrupt()}ut.emit("plotly_animationinterrupted",[])}}function mr(Br){if(Br.length!==0){for(var _n=0;_n<Br.length;_n++){var bn;Br[_n].type==="byname"?bn=n.computeFrame(ut,Br[_n].name):bn=Br[_n].data;var Fn=Me(_n),on=we(_n);on.duration=Math.min(on.duration,Fn.duration);var Bn={frame:bn,name:Br[_n].name,frameOpts:Fn,transitionOpts:on};_n===Br.length-1&&(Bn.onComplete=Re(Be,2),Bn.onInterrupt=Ze),Ot._frameQueue.push(Bn)}Mt.mode==="immediate"&&(Ot._lastFrameAt=-1/0),Ot._animationRaf||vn()}}function ln(){ut.emit("plotly_animated"),window.cancelAnimationFrame(Ot._animationRaf),Ot._animationRaf=null}function an(){Ot._currentFrame&&Ot._currentFrame.onComplete&&Ot._currentFrame.onComplete();var Br=Ot._currentFrame=Ot._frameQueue.shift();if(Br){var _n=Br.name?Br.name.toString():null;ut._fullLayout._currentFrame=_n,Ot._lastFrameAt=Date.now(),Ot._timeToNext=Br.frameOpts.duration,n.transition(ut,Br.frame.data,Br.frame.layout,b.coerceTraceIndices(ut,Br.frame.traces),Br.frameOpts,Br.transitionOpts).then(function(){Br.onComplete&&Br.onComplete()}),ut.emit("plotly_animatingframe",{name:_n,frame:Br.frame,animation:{frame:Br.frameOpts,transition:Br.transitionOpts}})}else ln()}function vn(){ut.emit("plotly_animating"),Ot._lastFrameAt=-1/0,Ot._timeToNext=0,Ot._runningTransitions=0,Ot._currentFrame=null;var Br=function(){Ot._animationRaf=window.requestAnimationFrame(Br),Date.now()-Ot._lastFrameAt>Ot._timeToNext&&an()};Br()}var Sn=0;function An(Br){return Array.isArray($t)?Sn>=$t.length?Br.transitionOpts=$t[Sn]:Br.transitionOpts=$t[0]:Br.transitionOpts=$t,Sn++,Br}var pn,On,Nn=[],ke=yt==null,ze=Array.isArray(yt),je=!ke&&!ze&&E.isPlainObject(yt);if(je)Nn.push({type:"object",data:An(E.extendFlat({},yt))});else if(ke||["string","number"].indexOf(typeof yt)!==-1)for(pn=0;pn<Ot._frames.length;pn++)On=Ot._frames[pn],On&&(ke||String(On.group)===String(yt))&&Nn.push({type:"byname",name:String(On.name),data:An({name:On.name})});else if(ze)for(pn=0;pn<yt.length;pn++){var Ne=yt[pn];["number","string"].indexOf(typeof Ne)!==-1?(Ne=String(Ne),Nn.push({type:"byname",name:Ne,data:An({name:Ne})})):E.isPlainObject(Ne)&&Nn.push({type:"object",data:An(E.extendFlat({},Ne))})}for(pn=0;pn<Nn.length;pn++)if(On=Nn[pn],On.type==="byname"&&!Ot._frameHash[On.data.name]){E.warn('animate failure: frame not found: "'+On.data.name+'"'),Ze();return}["next","immediate"].indexOf(Mt.mode)!==-1&&Ue(),Mt.direction==="reverse"&&Nn.reverse();var _r=ut._fullLayout._currentFrame;if(_r&&Mt.fromcurrent){var Xr=-1;for(pn=0;pn<Nn.length;pn++)if(On=Nn[pn],On.type==="byname"&&On.name===_r){Xr=pn;break}if(Xr>0&&Xr<Nn.length-1){var rn=[];for(pn=0;pn<Nn.length;pn++)On=Nn[pn],(Nn[pn].type!=="byname"||pn>Xr)&&rn.push(On);Nn=rn}}Nn.length>0?mr(Nn):(ut.emit("plotly_animated"),Be())})}function kr(ut,yt,Mt){if(ut=E.getGraphDiv(ut),yt==null)return Promise.resolve();if(!E.isPlotDiv(ut))throw new Error("This element is not a Plotly plot: "+ut+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Ot,$t,ee,we,Me=ut._transitionData._frames,Re=ut._transitionData._frameHash;if(!Array.isArray(yt))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+yt);var Be=Me.length+yt.length*2,Ze=[],Ue={};for(Ot=yt.length-1;Ot>=0;Ot--)if(E.isPlainObject(yt[Ot])){var mr=yt[Ot].name,ln=(Re[mr]||Ue[mr]||{}).name,an=yt[Ot].name,vn=Re[ln]||Ue[ln];ln&&an&&typeof an=="number"&&vn&&w<u&&(w++,E.warn('addFrames: overwriting frame "'+(Re[ln]||Ue[ln]).name+'" with a frame whose name of type "number" also equates to "'+ln+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),w===u&&E.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),Ue[mr]={name:mr},Ze.push({frame:n.supplyFrameDefaults(yt[Ot]),index:Mt&&Mt[Ot]!==void 0&&Mt[Ot]!==null?Mt[Ot]:Be+Ot})}Ze.sort(function(je,Ne){return je.index>Ne.index?-1:je.index<Ne.index?1:0});var Sn=[],An=[],pn=Me.length;for(Ot=Ze.length-1;Ot>=0;Ot--){if($t=Ze[Ot].frame,typeof $t.name=="number"&&E.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!$t.name)for(;Re[$t.name="frame "+ut._transitionData._counter++];);if(Re[$t.name]){for(ee=0;ee<Me.length&&(Me[ee]||{}).name!==$t.name;ee++);Sn.push({type:"replace",index:ee,value:$t}),An.unshift({type:"replace",index:ee,value:Me[ee]})}else we=Math.max(0,Math.min(Ze[Ot].index,pn)),Sn.push({type:"insert",index:we,value:$t}),An.unshift({type:"delete",index:we}),pn++}var On=n.modifyFrames,Nn=n.modifyFrames,ke=[ut,An],ze=[ut,Sn];return e&&e.add(ut,On,ke,Nn,ze),n.modifyFrames(ut,Sn)}function he(ut,yt){if(ut=E.getGraphDiv(ut),!E.isPlotDiv(ut))throw new Error("This element is not a Plotly plot: "+ut);var Mt,Ot,$t=ut._transitionData._frames,ee=[],we=[];if(!yt)for(yt=[],Mt=0;Mt<$t.length;Mt++)yt.push(Mt);for(yt=yt.slice(),yt.sort(),Mt=yt.length-1;Mt>=0;Mt--)Ot=yt[Mt],ee.push({type:"delete",index:Ot}),we.unshift({type:"insert",index:Ot,value:$t[Ot]});var Me=n.modifyFrames,Re=n.modifyFrames,Be=[ut,we],Ze=[ut,ee];return e&&e.add(ut,Me,Be,Re,Ze),n.modifyFrames(ut,ee)}function Dt(ut){ut=E.getGraphDiv(ut);var yt=ut._fullLayout||{},Mt=ut._fullData||[];return n.cleanPlot([],{},Mt,yt),n.purge(ut),t.purge(ut),yt._container&&yt._container.remove(),delete ut._context,ut}function qt(ut){var yt=ut._fullLayout,Mt=ut.getBoundingClientRect();if(!E.equalDomRects(Mt,yt._lastBBox)){var Ot=yt._invTransform=E.inverseTransformMatrix(E.getFullTransformMatrix(ut));yt._invScaleX=Math.sqrt(Ot[0][0]*Ot[0][0]+Ot[0][1]*Ot[0][1]+Ot[0][2]*Ot[0][2]),yt._invScaleY=Math.sqrt(Ot[1][0]*Ot[1][0]+Ot[1][1]*Ot[1][1]+Ot[1][2]*Ot[1][2]),yt._lastBBox=Mt}}function zt(ut){var yt=V.select(ut),Mt=ut._fullLayout;if(Mt._calcInverseTransform=qt,Mt._calcInverseTransform(ut),Mt._container=yt.selectAll(".plot-container").data([0]),Mt._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),Mt._paperdiv=Mt._container.selectAll(".svg-container").data([0]),Mt._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),Mt._glcontainer=Mt._paperdiv.selectAll(".gl-container").data([{}]),Mt._glcontainer.enter().append("div").classed("gl-container",!0),Mt._paperdiv.selectAll(".main-svg").remove(),Mt._paperdiv.select(".modebar-container").remove(),Mt._paper=Mt._paperdiv.insert("svg",":first-child").classed("main-svg",!0),Mt._toppaper=Mt._paperdiv.append("svg").classed("main-svg",!0),Mt._modebardiv=Mt._paperdiv.append("div"),delete Mt._modeBar,Mt._hoverpaper=Mt._paperdiv.append("svg").classed("main-svg",!0),!Mt._uid){var Ot={};V.selectAll("defs").each(function(){this.id&&(Ot[this.id.split("-")[1]]=1)}),Mt._uid=E.randstr(Ot)}Mt._paperdiv.selectAll(".main-svg").attr(p.svgAttrs),Mt._defs=Mt._paper.append("defs").attr("id","defs-"+Mt._uid),Mt._clips=Mt._defs.append("g").classed("clips",!0),Mt._topdefs=Mt._toppaper.append("defs").attr("id","topdefs-"+Mt._uid),Mt._topclips=Mt._topdefs.append("g").classed("clips",!0),Mt._bgLayer=Mt._paper.append("g").classed("bglayer",!0),Mt._draggers=Mt._paper.append("g").classed("draglayer",!0);var $t=Mt._paper.append("g").classed("layer-below",!0);Mt._imageLowerLayer=$t.append("g").classed("imagelayer",!0),Mt._shapeLowerLayer=$t.append("g").classed("shapelayer",!0),Mt._cartesianlayer=Mt._paper.append("g").classed("cartesianlayer",!0),Mt._polarlayer=Mt._paper.append("g").classed("polarlayer",!0),Mt._smithlayer=Mt._paper.append("g").classed("smithlayer",!0),Mt._ternarylayer=Mt._paper.append("g").classed("ternarylayer",!0),Mt._geolayer=Mt._paper.append("g").classed("geolayer",!0),Mt._funnelarealayer=Mt._paper.append("g").classed("funnelarealayer",!0),Mt._pielayer=Mt._paper.append("g").classed("pielayer",!0),Mt._iciclelayer=Mt._paper.append("g").classed("iciclelayer",!0),Mt._treemaplayer=Mt._paper.append("g").classed("treemaplayer",!0),Mt._sunburstlayer=Mt._paper.append("g").classed("sunburstlayer",!0),Mt._indicatorlayer=Mt._toppaper.append("g").classed("indicatorlayer",!0),Mt._glimages=Mt._paper.append("g").classed("glimages",!0);var ee=Mt._toppaper.append("g").classed("layer-above",!0);Mt._imageUpperLayer=ee.append("g").classed("imagelayer",!0),Mt._shapeUpperLayer=ee.append("g").classed("shapelayer",!0),Mt._selectionLayer=Mt._toppaper.append("g").classed("selectionlayer",!0),Mt._infolayer=Mt._toppaper.append("g").classed("infolayer",!0),Mt._menulayer=Mt._toppaper.append("g").classed("menulayer",!0),Mt._zoomlayer=Mt._toppaper.append("g").classed("zoomlayer",!0),Mt._hoverlayer=Mt._hoverpaper.append("g").classed("hoverlayer",!0),Mt._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),ut.emit("plotly_framework")}X.animate=Lr,X.addFrames=kr,X.deleteFrames=he,X.addTraces=st,X.deleteTraces=$,X.extendTraces=tt,X.moveTraces=Q,X.prependTraces=Z,X.newPlot=R,X._doPlot=f,X.purge=Dt,X.react=Fe,X.redraw=B,X.relayout=wt,X.restyle=nt,X.setPlotConfig=_,X.update=Wt,X._guiRelayout=gt(wt),X._guiRestyle=gt(nt),X._guiUpdate=gt(Wt),X._storeDirectGUIEdit=it}),Np=Vt(X=>{var V=Mi();X.getDelay=function(E){return E._has&&(E._has("gl3d")||E._has("mapbox")||E._has("map"))?500:0},X.getRedrawFunc=function(E){return function(){V.getComponentMethod("colorbar","draw")(E)}},X.encodeSVG=function(E){return"data:image/svg+xml,"+encodeURIComponent(E)},X.encodeJSON=function(E){return"data:application/json,"+encodeURIComponent(E)};var c=window.URL||window.webkitURL;X.createObjectURL=function(E){return c.createObjectURL(E)},X.revokeObjectURL=function(E){return c.revokeObjectURL(E)},X.createBlob=function(E,A){if(A==="svg")return new window.Blob([E],{type:"image/svg+xml;charset=utf-8"});if(A==="full-json")return new window.Blob([E],{type:"application/json;charset=utf-8"});var t=g(window.atob(E));return new window.Blob([t],{type:"image/"+A})},X.octetStream=function(E){document.location.href="data:application/octet-stream"+E};function g(E){for(var A=E.length,t=new ArrayBuffer(A),e=new Uint8Array(t),r=0;r<A;r++)e[r]=E.charCodeAt(r);return t}X.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/}),$y=Vt((X,V)=>{var c=Ai();qr();var g=go(),E=vi();Cf();var A=/"/g,t="TOBESTRIPPED",e=new RegExp('("'+t+")|("+t+'")',"g");function r(n){var o=c.select("body").append("div").style({display:"none"}).html(""),a=n.replace(/(&[^;]*;)/gi,function(s){return s==="<"?"<":s==="&rt;"?">":s.indexOf("<")!==-1||s.indexOf(">")!==-1?"":o.html(s).text()});return o.remove(),a}function i(n){return n.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}V.exports=function(n,o,a){var s=n._fullLayout,h=s._paper,v=s._toppaper,m=s.width,p=s.height,y;h.insert("rect",":first-child").call(g.setRect,0,0,m,p).call(E.fill,s.paper_bgcolor);var l=s._basePlotModules||[];for(y=0;y<l.length;y++){var x=l[y];x.toSVG&&x.toSVG(n)}if(v){var b=v.node().childNodes,S=Array.prototype.slice.call(b);for(y=0;y<S.length;y++){var T=S[y];T.childNodes.length&&h.node().appendChild(T)}}s._draggers&&s._draggers.remove(),h.node().style.background="",h.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var w=c.select(this);if(this.style.visibility==="hidden"||this.style.display==="none"){w.remove();return}else w.style({visibility:null,display:null});var u=this.style.fontFamily;u&&u.indexOf('"')!==-1&&w.style("font-family",u.replace(A,t));var f=this.style.fontWeight;f&&(f==="normal"||f==="400")&&w.style("font-weight",void 0);var k=this.style.fontStyle;k&&k==="normal"&&w.style("font-style",void 0);var _=this.style.fontVariant;_&&_==="normal"&&w.style("font-variant",void 0)}),h.selectAll(".gradient_filled,.pattern_filled").each(function(){var w=c.select(this),u=this.style.fill;u&&u.indexOf("url(")!==-1&&w.style("fill",u.replace(A,t));var f=this.style.stroke;f&&f.indexOf("url(")!==-1&&w.style("stroke",f.replace(A,t))}),(o==="pdf"||o==="eps")&&h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),o==="svg"&&a&&(h.attr("width",a*m),h.attr("height",a*p),h.attr("viewBox","0 0 "+m+" "+p));var M=new window.XMLSerializer().serializeToString(h.node());return M=r(M),M=i(M),M=M.replace(e,"'"),M}}),Jy=Vt((X,V)=>{var c=qr(),g=s0().EventEmitter,E=Np();function A(t){var e=t.emitter||new g,r=new Promise(function(i,n){var o=window.Image,a=t.svg,s=t.format||"png",h=t.canvas,v=t.scale||1,m=t.width||300,p=t.height||150,y=v*m,l=v*p,x=h.getContext("2d",{willReadFrequently:!0}),b=new o,S,T;s==="svg"||c.isSafari()?T=E.encodeSVG(a):(S=E.createBlob(a,"svg"),T=E.createObjectURL(S)),h.width=y,h.height=l,b.onload=function(){var M;switch(S=null,E.revokeObjectURL(T),s!=="svg"&&x.drawImage(b,0,0,y,l),s){case"jpeg":M=h.toDataURL("image/jpeg");break;case"png":M=h.toDataURL("image/png");break;case"webp":M=h.toDataURL("image/webp");break;case"svg":M=T;break;default:var w="Image format is not jpeg, png, svg or webp.";if(n(new Error(w)),!t.promise)return e.emit("error",w)}i(M),t.promise||e.emit("success",M)},b.onerror=function(M){if(S=null,E.revokeObjectURL(T),n(M),!t.promise)return e.emit("error",M)},b.src=T});return t.promise?r:e}V.exports=A}),Sb=Vt((X,V)=>{var c=vo(),g=Xy(),E=fu(),A=qr(),t=Np(),e=$y(),r=Jy(),i=Iy().version,n={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};function o(a,s){s=s||{};var h,v,m,p;A.isPlainObject(a)?(h=a.data||[],v=a.layout||{},m=a.config||{},p={}):(a=A.getGraphDiv(a),h=A.extendDeep([],a.data),v=A.extendDeep({},a.layout),m=a._context,p=a._fullLayout||{});function y(R){return!(R in s)||A.validate(s[R],n[R])}if(!y("width")&&s.width!==null||!y("height")&&s.height!==null)throw new Error("Height and width should be pixel values.");if(!y("format"))throw new Error("Export format is not "+A.join2(n.format.values,", "," or ")+".");var l={};function x(R,L){return A.coerce(s,l,n,R,L)}var b=x("format"),S=x("width"),T=x("height"),M=x("scale"),w=x("setBackground"),u=x("imageDataOnly"),f=document.createElement("div");f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var k=A.extendFlat({},v);S?k.width=S:s.width===null&&c(p.width)&&(k.width=p.width),T?k.height=T:s.height===null&&c(p.height)&&(k.height=p.height);var _=A.extendFlat({},m,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),D=t.getRedrawFunc(f);function I(){return new Promise(function(R){setTimeout(R,t.getDelay(f._fullLayout))})}function O(){return new Promise(function(R,L){var F=e(f,b,M),N=f._fullLayout.width,j=f._fullLayout.height;function G(){g.purge(f),document.body.removeChild(f)}if(b==="full-json"){var rt=E.graphJson(f,!1,"keepdata","object",!0,!0);return rt.version=i,rt=JSON.stringify(rt),G(),R(u?rt:t.encodeJSON(rt))}if(G(),b==="svg")return R(u?F:t.encodeSVG(F));var ct=document.createElement("canvas");ct.id=A.randstr(),r({format:b,width:N,height:j,scale:M,canvas:ct,svg:F,promise:!0}).then(R).catch(L)})}function B(R){return u?R.replace(t.IMAGE_URL_PREFIX,""):R}return new Promise(function(R,L){g.newPlot(f,h,k,_).then(D).then(I).then(O).then(function(F){R(B(F))}).catch(function(F){L(F)})})}V.exports=o}),h4=Vt((X,V)=>{var c=qr(),g=fu(),E=yg(),A=o0().dfltConfig,t=c.isPlainObject,e=Array.isArray,r=c.isArrayOrTypedArray;V.exports=function(l,x){l===void 0&&(l=[]),x===void 0&&(x={});var b=E.get(),S=[],T={_context:c.extendFlat({},A)},M,w;e(l)?(T.data=c.extendDeep([],l),M=l):(T.data=[],M=[],S.push(s("array","data"))),t(x)?(T.layout=c.extendDeep({},x),w=x):(T.layout={},w={},arguments.length>1&&S.push(s("object","layout"))),g.supplyDefaults(T);for(var u=T._fullData,f=M.length,k=0;k<f;k++){var _=M[k],D=["data",k];if(!t(_)){S.push(s("object",D));continue}var I=u[k],O=I.type,B=b.traces[O].attributes;B.type={valType:"enumerated",values:[O]},I.visible===!1&&_.visible!==!1&&S.push(s("invisible",D)),i(_,I,B,S,D)}var R=T._fullLayout,L=n(b,u);return i(w,R,L,S,"layout"),S.length===0?void 0:S};function i(l,x,b,S,T,M){M=M||[];for(var w=Object.keys(l),u=0;u<w.length;u++){var f=w[u],k=M.slice();k.push(f);var _=l[f],D=x[f],I=v(b,f),O=(I||{}).valType,B=O==="info_array",R=O==="colorscale",L=(I||{}).items;if(!h(b,f))S.push(s("schema",T,k));else if(t(_)&&t(D)&&O!=="any")i(_,D,I,S,T,k);else if(B&&e(_)){_.length>D.length&&S.push(s("unused",T,k.concat(D.length)));var F=D.length,N=Array.isArray(L);N&&(F=Math.min(F,L.length));var j,G,rt,ct,lt;if(I.dimensions===2)for(G=0;G<F;G++)if(e(_[G])){_[G].length>D[G].length&&S.push(s("unused",T,k.concat(G,D[G].length)));var tt=D[G].length;for(j=0;j<(N?Math.min(tt,L[G].length):tt);j++)rt=N?L[G][j]:L,ct=_[G][j],lt=D[G][j],c.validate(ct,rt)?lt!==ct&<!==+ct&&S.push(s("dynamic",T,k.concat(G,j),ct,lt)):S.push(s("value",T,k.concat(G,j),ct))}else S.push(s("array",T,k.concat(G),_[G]));else for(G=0;G<F;G++)rt=N?L[G]:L,ct=_[G],lt=D[G],c.validate(ct,rt)?lt!==ct&<!==+ct&&S.push(s("dynamic",T,k.concat(G),ct,lt)):S.push(s("value",T,k.concat(G),ct))}else if(I.items&&!B&&e(_)){var Z=L[Object.keys(L)[0]],st=[],$,Q;for($=0;$<D.length;$++){var nt=D[$]._index||$;if(Q=k.slice(),Q.push(nt),t(_[nt])&&t(D[$])){st.push(nt);var Y=_[nt],q=D[$];t(Y)&&Y.visible!==!1&&q.visible===!1?S.push(s("invisible",T,Q)):i(Y,q,Z,S,T,Q)}}for($=0;$<_.length;$++)Q=k.slice(),Q.push($),t(_[$])?st.indexOf($)===-1&&S.push(s("unused",T,Q)):S.push(s("object",T,Q,_[$]))}else!t(_)&&t(D)?S.push(s("object",T,k,_)):!r(_)&&r(D)&&!B&&!R?S.push(s("array",T,k,_)):f in x?c.validate(_,I)?I.valType==="enumerated"&&(I.coerceNumber&&_!==+D||_!==D)&&S.push(s("dynamic",T,k,_,D)):S.push(s("value",T,k,_)):S.push(s("unused",T,k,_))}return S}function n(l,x){for(var b=l.layout.layoutAttributes,S=0;S<x.length;S++){var T=x[S],M=l.traces[T.type],w=M.layoutAttributes;w&&(T.subplot?c.extendFlat(b[M.attributes.subplot.dflt],w):c.extendFlat(b,w))}return b}var o={object:function(l,x){var b;return l==="layout"&&x===""?b="The layout argument":l[0]==="data"&&x===""?b="Trace "+l[1]+" in the data argument":b=a(l)+"key "+x,b+" must be linked to an object container"},array:function(l,x){var b;return l==="data"?b="The data argument":b=a(l)+"key "+x,b+" must be linked to an array container"},schema:function(l,x){return a(l)+"key "+x+" is not part of the schema"},unused:function(l,x,b){var S=t(b)?"container":"key";return a(l)+S+" "+x+" did not get coerced"},dynamic:function(l,x,b,S){return[a(l)+"key",x,"(set to '"+b+"')","got reset to","'"+S+"'","during defaults."].join(" ")},invisible:function(l,x){return(x?a(l)+"item "+x:"Trace "+l[1])+" got defaulted to be not visible"},value:function(l,x,b){return[a(l)+"key "+x,"is set to an invalid value ("+b+")"].join(" ")}};function a(l){return e(l)?"In data trace "+l[1]+", ":"In "+l+", "}function s(l,x,b,S,T){b=b||"";var M,w;e(x)?(M=x[0],w=x[1]):(M=x,w=null);var u=y(b),f=o[l](x,u,S,T);return c.log(f),{code:l,container:M,trace:w,path:b,astr:u,msg:f}}function h(l,x){var b=p(x),S=b.keyMinusId,T=b.id;return S in l&&l[S]._isSubplotObj&&T?!0:x in l}function v(l,x){if(x in l)return l[x];var b=p(x);return l[b.keyMinusId]}var m=c.counterRegex("([a-z]+)");function p(l){var x=l.match(m);return{keyMinusId:x&&x[1],id:x&&x[2]}}function y(l){if(!e(l))return String(l);for(var x="",b=0;b<l.length;b++){var S=l[b];typeof S=="number"?x=x.substr(0,x.length-1)+"["+S+"]":x+=S,b<l.length-1&&(x+=".")}return x}}),f4=Vt((X,V)=>{var c=qr(),g=Np();function E(A,t,e){var r=document.createElement("a"),i="download"in r,n=new Promise(function(o,a){var s,h;if(i)return s=g.createBlob(A,e),h=g.createObjectURL(s),r.href=h,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),g.revokeObjectURL(h),s=null,o(t);if(c.isSafari()){var v=e==="svg"?",":";base64,";return g.octetStream(v+encodeURIComponent(A)),o(t)}a(new Error("download error"))});return n}V.exports=E}),Eb=Vt((X,V)=>{var c=qr(),g=Sb(),E=f4();Np();function A(t,e){var r;return c.isPlainObject(t)||(r=c.getGraphDiv(t)),e=e||{},e.format=e.format||"png",e.width=e.width||null,e.height=e.height||null,e.imageDataOnly=!0,new Promise(function(i,n){r&&r._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),r&&(r._snapshotInProgress=!0);var o=g(t,e),a=e.filename||t.fn||"newplot";a+="."+e.format.replace("-","."),o.then(function(s){return r&&(r._snapshotInProgress=!1),E(s,a,e.format)}).then(function(s){i(s)}).catch(function(s){r&&(r._snapshotInProgress=!1),n(s)})})}V.exports=A}),p4=Vt(X=>{var V=qr(),c=V.isPlainObject,g=yg(),E=fu(),A=Ks(),t=Ns(),e=o0().dfltConfig;X.makeTemplate=function(m){m=V.isPlainObject(m)?m:V.getGraphDiv(m),m=V.extendDeep({_context:e},{data:m.data,layout:m.layout}),E.supplyDefaults(m);var p=m.data||[],y=m.layout||{};y._basePlotModules=m._fullLayout._basePlotModules,y._modules=m._fullLayout._modules;var l={data:{},layout:{}};p.forEach(function(_){var D={};n(_,D,a.bind(null,_));var I=V.coerce(_,{},A,"type"),O=l.data[I];O||(O=l.data[I]=[]),O.push(D)}),n(y,l.layout,o.bind(null,y)),delete l.layout.template;var x=y.template;if(c(x)){var b=x.layout,S,T,M,w,u,f;c(b)&&r(b,l.layout);var k=x.data;if(c(k)){for(T in l.data)if(M=k[T],Array.isArray(M)){for(u=l.data[T],f=u.length,w=M.length,S=0;S<f;S++)r(M[S%w],u[S]);for(S=f;S<w;S++)u.push(V.extendDeep({},M[S]))}for(T in k)T in l.data||(l.data[T]=V.extendDeep([],k[T]))}}return l};function r(m,p){m=V.extendDeep({},m);var y=Object.keys(m).sort(),l,x;function b(u,f,k){if(c(f)&&c(u))r(u,f);else if(Array.isArray(f)&&Array.isArray(u)){var _=t.arrayTemplater({_template:m},k);for(x=0;x<f.length;x++){var D=f[x],I=_.newItem(D)._template;I&&r(I,D)}var O=_.defaultItems();for(x=0;x<O.length;x++)f.push(O[x]._template);for(x=0;x<f.length;x++)delete f[x].templateitemname}}for(l=0;l<y.length;l++){var S=y[l],T=m[S];if(S in p?b(T,p[S],S):p[S]=T,i(S)===S)for(var M in p){var w=i(M);M!==w&&w===S&&!(M in m)&&b(T,p[M],S)}}}function i(m){return m.replace(/[0-9]+$/,"")}function n(m,p,y,l,x){var b=x&&y(x);for(var S in m){var T=m[S],M=s(m,S,l),w=s(m,S,x),u=y(w);if(!u){var f=i(S);f!==S&&(w=s(m,f,x),u=y(w))}if(!(b&&b===u)&&!(!u||u._noTemplating||u.valType==="data_array"||u.arrayOk&&Array.isArray(T)))if(!u.valType&&c(T))n(T,p,y,M,w);else if(u._isLinkedToArray&&Array.isArray(T))for(var k=!1,_=0,D={},I=0;I<T.length;I++){var O=T[I];if(c(O)){var B=O.name;if(B)D[B]||(n(O,p,y,s(T,_,M),s(T,_,w)),_++,D[B]=1);else if(!k){var R=t.arrayDefaultKey(S),L=s(m,R,l),F=s(T,_,M);n(O,p,y,F,s(T,_,w));var N=V.nestedProperty(p,F),j=V.nestedProperty(p,L);j.set(N.get()),N.set(null),k=!0}}}else{var G=V.nestedProperty(p,M);G.set(T)}}}function o(m,p){return g.getLayoutValObject(m,V.nestedProperty({},p).parts)}function a(m,p){return g.getTraceValObject(m,V.nestedProperty({},p).parts)}function s(m,p,y){var l;return y?Array.isArray(m)?l=y+"["+p+"]":l=y+"."+p:l=p,l}X.validateTemplate=function(m,p){var y=V.extendDeep({},{_context:e,data:m.data,layout:m.layout}),l=y.layout||{};c(p)||(p=l.template||{});var x=p.layout,b=p.data,S=[];y.layout=l,y.layout.template=p,E.supplyDefaults(y);var T=y._fullLayout,M=y._fullData,w={};function u(L,F){for(var N in L)if(N.charAt(0)!=="_"&&c(L[N])){var j=i(N),G=[],rt;for(rt=0;rt<F.length;rt++)G.push(s(L,N,F[rt])),j!==N&&G.push(s(L,j,F[rt]));for(rt=0;rt<G.length;rt++)w[G[rt]]=1;u(L[N],G)}}function f(L,F){for(var N in L)if(N.indexOf("defaults")===-1&&c(L[N])){var j=s(L,N,F);w[j]?f(L[N],j):S.push({code:"unused",path:j})}}if(c(x)?(u(T,["layout"]),f(x,"layout")):S.push({code:"layout"}),!c(b))S.push({code:"data"});else{for(var k={},_,D=0;D<M.length;D++){var I=M[D];_=I.type,k[_]=(k[_]||0)+1,I._fullInput._template||S.push({code:"missing",index:I.index,traceType:_})}for(_ in b){var O=b[_].length,B=k[_]||0;O>B?S.push({code:"unused",traceType:_,templateCount:O,dataCount:B}):B>O&&S.push({code:"reused",traceType:_,templateCount:O,dataCount:B})}}function R(L,F){for(var N in L)if(N.charAt(0)!=="_"){var j=L[N],G=s(L,N,F);c(j)?(Array.isArray(L)&&j._template===!1&&j.templateitemname&&S.push({code:"missing",path:G,templateitemname:j.templateitemname}),R(j,G)):Array.isArray(j)&&h(j)&&R(j,G)}}if(R({data:M,layout:T},""),S.length)return S.map(v)};function h(m){for(var p=0;p<m.length;p++)if(c(m[p]))return!0}function v(m){var p;switch(m.code){case"data":p="The template has no key data.";break;case"layout":p="The template has no key layout.";break;case"missing":m.path?p="There are no templates for item "+m.path+" with name "+m.templateitemname:p="There are no templates for trace "+m.index+", of type "+m.traceType+".";break;case"unused":m.path?p="The template item at "+m.path+" was not used in constructing the plot.":m.dataCount?p="Some of the templates of type "+m.traceType+" were not used. The template has "+m.templateCount+" traces, the data only has "+m.dataCount+" of this type.":p="The template has "+m.templateCount+" traces of type "+m.traceType+" but there are none in the data.";break;case"reused":p="Some of the templates of type "+m.traceType+" were used more than once. The template has "+m.templateCount+" traces, the data has "+m.dataCount+" of this type.";break}return m.msg=p,m}}),d4=Vt(X=>{var V=Xy();X._doPlot=V._doPlot,X.newPlot=V.newPlot,X.restyle=V.restyle,X.relayout=V.relayout,X.redraw=V.redraw,X.update=V.update,X._guiRestyle=V._guiRestyle,X._guiRelayout=V._guiRelayout,X._guiUpdate=V._guiUpdate,X._storeDirectGUIEdit=V._storeDirectGUIEdit,X.react=V.react,X.extendTraces=V.extendTraces,X.prependTraces=V.prependTraces,X.addTraces=V.addTraces,X.deleteTraces=V.deleteTraces,X.moveTraces=V.moveTraces,X.purge=V.purge,X.addFrames=V.addFrames,X.deleteFrames=V.deleteFrames,X.animate=V.animate,X.setPlotConfig=V.setPlotConfig;var c=Cm().getGraphDiv,g=Zy().eraseActiveShape;X.deleteActiveShape=function(A){return g(c(A))},X.toImage=Sb(),X.validate=h4(),X.downloadImage=Eb();var E=p4();X.makeTemplate=E.makeTemplate,X.validateTemplate=E.validateTemplate}),Tg=Vt((X,V)=>{var c=qr(),g=Mi();V.exports=function(E,A,t,e){var r=e("x"),i=e("y"),n,o=g.getComponentMethod("calendars","handleTraceDefaults");if(o(E,A,["x","y"],t),r){var a=c.minRowLength(r);i?n=Math.min(a,c.minRowLength(i)):(n=a,e("y0"),e("dy"))}else{if(!i)return 0;n=c.minRowLength(i),e("x0"),e("dx")}return A._length=n,n}}),np=Vt((X,V)=>{var c=qr().dateTick0,g=ts(),E=g.ONEWEEK;function A(t,e){return t%E===0?c(e,1):c(e,0)}V.exports=function(t,e,r,i,n){if(n||(n={x:!0,y:!0}),n.x){var o=i("xperiod");o&&(i("xperiod0",A(o,e.xcalendar)),i("xperiodalignment"))}if(n.y){var a=i("yperiod");a&&(i("yperiod0",A(a,e.ycalendar)),i("yperiodalignment"))}}}),g4=Vt((X,V)=>{var c=["orientation","groupnorm","stackgaps"];V.exports=function(g,E,A,t){var e=A._scatterStackOpts,r=t("stackgroup");if(r){var i=E.xaxis+E.yaxis,n=e[i];n||(n=e[i]={});var o=n[r],a=!1;o?o.traces.push(E):(o=n[r]={traceIndices:[],traces:[E]},a=!0);for(var s={orientation:E.x&&!E.y?"h":"v"},h=0;h<c.length;h++){var v=c[h],m=v+"Found";if(!o[m]){var p=g[v]!==void 0,y=v==="orientation";if((p||a)&&(o[v]=t(v,s[v]),y&&(o.fillDflt=o[v]==="h"?"tonextx":"tonexty"),p&&(o[m]=!0,!a&&(delete o.traces[0][v],y))))for(var l=0;l<o.traces.length-1;l++){var x=o.traces[l];x._input.fill!==x.fill&&(x.fill=o.fillDflt)}}}return o}}}),Df=Vt((X,V)=>{var c=vi(),g=pf().hasColorscale,E=ah(),A=Sl();V.exports=function(t,e,r,i,n,o){var a=A.isBubble(t),s=(t.line||{}).color,h;if(o=o||{},s&&(r=s),n("marker.symbol"),n("marker.opacity",a?.7:1),n("marker.size"),o.noAngle||(n("marker.angle"),o.noAngleRef||n("marker.angleref"),o.noStandOff||n("marker.standoff")),n("marker.color",r),g(t,"marker")&&E(t,e,i,n,{prefix:"marker.",cLetter:"c"}),o.noSelect||(n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size")),o.noLine||(s&&!Array.isArray(s)&&e.marker.color!==s?h=s:a?h=c.background:h=c.defaultLine,n("marker.line.color",h),g(t,"marker.line")&&E(t,e,i,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width",a?1:0)),a&&(n("marker.sizeref"),n("marker.sizemin"),n("marker.sizemode")),o.gradient){var v=n("marker.gradient.type");v!=="none"&&n("marker.gradient.color")}}}),Nf=Vt((X,V)=>{var c=qr().isArrayOrTypedArray,g=pf().hasColorscale,E=ah();V.exports=function(A,t,e,r,i,n){n||(n={});var o=(A.marker||{}).color;if(o&&o._inputArray&&(o=o._inputArray),i("line.color",e),g(A,"line"))E(A,t,r,i,{prefix:"line.",cLetter:"c"});else{var a=(c(o)?!1:o)||e;i("line.color",a)}i("line.width"),n.noDash||i("line.dash"),n.backoff&&i("line.backoff")}}),kg=Vt((X,V)=>{V.exports=function(c,g,E){var A=E("line.shape");A==="spline"&&E("line.smoothing")}}),Uf=Vt((X,V)=>{var c=qr();V.exports=function(g,E,A,t,e){e=e||{},t("textposition"),c.coerceFont(t,"textfont",e.font||A.font,e),e.noSelect||(t("selected.textfont.color"),t("unselected.textfont.color"))}}),ap=Vt((X,V)=>{var c=vi(),g=qr().isArrayOrTypedArray;function E(A){for(var t=c.interpolate(A[0][1],A[1][1],.5),e=2;e<A.length;e++){var r=c.interpolate(A[e-1][1],A[e][1],.5);t=c.interpolate(t,r,A[e-1][0]/A[e][0])}return t}V.exports=function(A,t,e,r,i){i||(i={});var n=!1;if(t.marker){var o=t.marker.color,a=(t.marker.line||{}).color;o&&!g(o)?n=o:a&&!g(a)&&(n=a)}var s;if(i.moduleHasFillgradient){var h=r("fillgradient.type");if(h!=="none"){r("fillgradient.start"),r("fillgradient.stop");var v=r("fillgradient.colorscale");v&&(s=E(v))}}r("fillcolor",c.addOpacity((t.line||{}).color||n||s||e,.5))}}),m4=Vt((X,V)=>{var c=qr(),g=Mi(),E=Gu(),A=_p(),t=Sl(),e=Tg(),r=np(),i=g4(),n=Df(),o=Nf(),a=kg(),s=Uf(),h=ap(),v=qr().coercePattern;V.exports=function(m,p,y,l){function x(k,_){return c.coerce(m,p,E,k,_)}var b=e(m,p,l,x);if(b||(p.visible=!1),!!p.visible){r(m,p,l,x),x("xhoverformat"),x("yhoverformat"),x("zorder");var S=i(m,p,l,x);l.scattermode==="group"&&p.orientation===void 0&&x("orientation","v");var T=!S&&b<A.PTS_LINESONLY?"lines+markers":"lines";x("text"),x("hovertext"),x("mode",T),t.hasMarkers(p)&&n(m,p,y,l,x,{gradient:!0}),t.hasLines(p)&&(o(m,p,y,l,x,{backoff:!0}),a(m,p,x),x("connectgaps"),x("line.simplify")),t.hasText(p)&&(x("texttemplate"),s(m,p,l,x));var M=[];(t.hasMarkers(p)||t.hasText(p))&&(x("cliponaxis"),x("marker.maxdisplayed"),M.push("points")),x("fill",S?S.fillDflt:"none"),p.fill!=="none"&&(h(m,p,y,x,{moduleHasFillgradient:!0}),t.hasLines(p)||a(m,p,x),v(x,"fillpattern",p.fillcolor,!1));var w=(p.line||{}).color,u=(p.marker||{}).color;(p.fill==="tonext"||p.fill==="toself")&&M.push("fills"),x("hoveron",M.join("+")||"points"),p.hoveron!=="fills"&&x("hovertemplate");var f=g.getComponentMethod("errorbars","supplyDefaults");f(m,p,w||u||y,{axis:"y"}),f(m,p,w||u||y,{axis:"x",inherit:"y"}),c.coerceSelectionMarkerOpacity(p,x)}}}),f0=Vt((X,V)=>{var c=c0().getAxisGroup;V.exports=function(g,E,A,t,e){var r=E.orientation,i=E[{v:"x",h:"y"}[r]+"axis"],n=c(A,i)+r,o=A._alignmentOpts||{},a=t("alignmentgroup"),s=o[n];s||(s=o[n]={});var h=s[a];h?h.traces.push(E):h=s[a]={traces:[E],alignmentIndex:Object.keys(s).length,offsetGroups:{}};var v=t("offsetgroup")||"",m=h.offsetGroups,p=m[v];E._offsetIndex=0,(e!=="group"||v)&&(p||(p=m[v]={offsetIndex:Object.keys(m).length}),E._offsetIndex=p.offsetIndex)}}),Pb=Vt((X,V)=>{var c=qr(),g=f0(),E=Gu();V.exports=function(A,t){var e,r,i,n=t.scattermode;function o(m){return c.coerce(r._input,r,E,m)}if(t.scattermode==="group")for(i=0;i<A.length;i++)r=A[i],r.type==="scatter"&&(e=r._input,g(e,r,t,o,n));for(i=0;i<A.length;i++){var a=A[i];if(a.type==="scatter"){var s=a.fill;if(!(s==="none"||s==="toself")&&(a.opacity=void 0,s==="tonexty"||s==="tonextx"))for(var h=i-1;h>=0;h--){var v=A[h];if(v.type==="scatter"&&v.xaxis===a.xaxis&&v.yaxis===a.yaxis){v.opacity=void 0;break}}}}}}),v4=Vt((X,V)=>{var c=qr(),g=Ry();V.exports=function(E,A){function t(r,i){return c.coerce(E,A,g,r,i)}var e=A.barmode==="group";A.scattermode==="group"&&t("scattergap",e?A.bargap:.2)}}),ip=Vt((X,V)=>{var c=vo(),g=qr(),E=g.dateTime2ms,A=g.incrementMonth,t=ts(),e=t.ONEAVGMONTH;V.exports=function(r,i,n,o){if(i.type!=="date")return{vals:o};var a=r[n+"periodalignment"];if(!a)return{vals:o};var s=r[n+"period"],h;if(c(s)){if(s=+s,s<=0)return{vals:o}}else if(typeof s=="string"&&s.charAt(0)==="M"){var v=+s.substring(1);if(v>0&&Math.round(v)===v)h=v;else return{vals:o}}for(var m=i.calendar,p=a==="start",y=a==="end",l=r[n+"period0"],x=E(l,m)||0,b=[],S=[],T=[],M=o.length,w=0;w<M;w++){var u=o[w],f,k,_;if(h){for(f=Math.round((u-x)/(h*e)),_=A(x,h*f,m);_>u;)_=A(_,-h,m);for(;_<=u;)_=A(_,h,m);k=A(_,-h,m)}else{for(f=Math.round((u-x)/s),_=x+f*s;_>u;)_-=s;for(;_<=u;)_+=s;k=_-s}b[w]=p?k:y?_:(k+_)/2,S[w]=k,T[w]=_}return{vals:b,starts:S,ends:T}}}),Vf=Vt((X,V)=>{var c=pf().hasColorscale,g=df(),E=Sl();V.exports=function(A,t){E.hasLines(t)&&c(t,"line")&&g(A,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),E.hasMarkers(t)&&(c(t,"marker")&&g(A,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),c(t,"marker.line")&&g(A,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}),bp=Vt((X,V)=>{var c=qr();V.exports=function(g,E){for(var A=0;A<g.length;A++)g[A].i=A;c.mergeArray(E.text,g,"tx"),c.mergeArray(E.texttemplate,g,"txt"),c.mergeArray(E.hovertext,g,"htx"),c.mergeArray(E.customdata,g,"data"),c.mergeArray(E.textposition,g,"tp"),E.textfont&&(c.mergeArrayCastPositive(E.textfont.size,g,"ts"),c.mergeArray(E.textfont.color,g,"tc"),c.mergeArray(E.textfont.family,g,"tf"),c.mergeArray(E.textfont.weight,g,"tw"),c.mergeArray(E.textfont.style,g,"ty"),c.mergeArray(E.textfont.variant,g,"tv"),c.mergeArray(E.textfont.textcase,g,"tC"),c.mergeArray(E.textfont.lineposition,g,"tE"),c.mergeArray(E.textfont.shadow,g,"tS"));var t=E.marker;if(t){c.mergeArrayCastPositive(t.size,g,"ms"),c.mergeArrayCastPositive(t.opacity,g,"mo"),c.mergeArray(t.symbol,g,"mx"),c.mergeArray(t.angle,g,"ma"),c.mergeArray(t.standoff,g,"mf"),c.mergeArray(t.color,g,"mc");var e=t.line;t.line&&(c.mergeArray(e.color,g,"mlc"),c.mergeArrayCastPositive(e.width,g,"mlw"));var r=t.gradient;r&&r.type!=="none"&&(c.mergeArray(r.type,g,"mgt"),c.mergeArray(r.color,g,"mgc"))}}}),qf=Vt((X,V)=>{var c=qr();V.exports=function(g,E){c.isArrayOrTypedArray(E.selectedpoints)&&c.tagSelected(g,E)}}),Hf=Vt((X,V)=>{var c=vo(),g=qr(),E=ao(),A=ip(),t=ts().BADNUM,e=Sl(),r=Vf(),i=bp(),n=qf();function o(p,y){var l=p._fullLayout,x=y._xA=E.getFromId(p,y.xaxis||"x","x"),b=y._yA=E.getFromId(p,y.yaxis||"y","y"),S=x.makeCalcdata(y,"x"),T=b.makeCalcdata(y,"y"),M=A(y,x,"x",S),w=A(y,b,"y",T),u=M.vals,f=w.vals,k=y._length,_=new Array(k),D=y.ids,I=m(y,l,x,b),O=!1,B,R,L,F,N,j;h(l,y);var G="x",rt="y",ct;if(I)g.pushUnique(I.traceIndices,y.index),B=I.orientation==="v",B?(rt="s",ct="x"):(G="s",ct="y"),N=I.stackgaps==="interpolate";else{var lt=s(y,k);a(p,y,x,b,u,f,lt)}var tt=!!y.xperiodalignment,Z=!!y.yperiodalignment;for(R=0;R<k;R++){var st=_[R]={},$=c(u[R]),Q=c(f[R]);$&&Q?(st[G]=u[R],st[rt]=f[R],tt&&(st.orig_x=S[R],st.xEnd=M.ends[R],st.xStart=M.starts[R]),Z&&(st.orig_y=T[R],st.yEnd=w.ends[R],st.yStart=w.starts[R])):I&&(B?$:Q)?(st[ct]=B?u[R]:f[R],st.gap=!0,N?(st.s=t,O=!0):st.s=0):st[G]=st[rt]=t,D&&(st.id=String(D[R]))}if(i(_,y),r(p,y),n(_,y),I){for(R=0;R<_.length;)_[R][ct]===t?_.splice(R,1):R++;if(g.sort(_,function(ot,it){return ot[ct]-it[ct]||ot.i-it.i}),O){for(R=0;R<_.length-1&&_[R].gap;)R++;for(j=_[R].s,j||(j=_[R].s=0),L=0;L<R;L++)_[L].s=j;for(F=_.length-1;F>R&&_[F].gap;)F--;for(j=_[F].s,L=_.length-1;L>F;L--)_[L].s=j;for(;R<F;)if(R++,_[R].gap){for(L=R+1;_[L].gap;)L++;for(var nt=_[R-1][ct],Y=_[R-1].s,q=(_[L].s-Y)/(_[L][ct]-nt);R<L;)_[R].s=Y+(_[R][ct]-nt)*q,R++}}}return _}function a(p,y,l,x,b,S,T){var M=y._length,w=p._fullLayout,u=l._id,f=x._id,k=w._firstScatter[v(y)]===y.uid,_=(m(y,w,l,x)||{}).orientation,D=y.fill;l._minDtick=0,x._minDtick=0;var I={padded:!0},O={padded:!0};T&&(I.ppad=O.ppad=T);var B=M<2||b[0]!==b[M-1]||S[0]!==S[M-1];B&&(D==="tozerox"||D==="tonextx"&&(k||_==="h"))?I.tozero=!0:!(y.error_y||{}).visible&&(D==="tonexty"||D==="tozeroy"||!e.hasMarkers(y)&&!e.hasText(y))&&(I.padded=!1,I.ppad=0),B&&(D==="tozeroy"||D==="tonexty"&&(k||_==="v"))?O.tozero=!0:(D==="tonextx"||D==="tozerox")&&(O.padded=!1),u&&(y._extremes[u]=E.findExtremes(l,b,I)),f&&(y._extremes[f]=E.findExtremes(x,S,O))}function s(p,y){if(e.hasMarkers(p)){var l=p.marker,x=1.6*(p.marker.sizeref||1),b;if(p.marker.sizemode==="area"?b=function(u){return Math.max(Math.sqrt((u||0)/x),3)}:b=function(u){return Math.max((u||0)/x,3)},g.isArrayOrTypedArray(l.size)){var S={type:"linear"};E.setConvert(S);for(var T=S.makeCalcdata(p.marker,"size"),M=new Array(y),w=0;w<y;w++)M[w]=b(T[w]);return M}else return b(l.size)}}function h(p,y){var l=v(y),x=p._firstScatter;x[l]||(x[l]=y.uid)}function v(p){var y=p.stackgroup;return p.xaxis+p.yaxis+p.type+(y?"-"+y:"")}function m(p,y,l,x){var b=p.stackgroup;if(b){var S=y._scatterStackOpts[l._id+x._id][b],T=S.orientation==="v"?x:l;if(T.type==="linear"||T.type==="log")return S}}V.exports={calc:o,calcMarkerSize:s,calcAxisExpansion:a,setFirstScatter:h,getStackOpts:m}}),y4=Vt((X,V)=>{V.exports=g;var c=qr().distinctVals;function g(E,A){this.traces=E,this.sepNegVal=A.sepNegVal,this.overlapNoMerge=A.overlapNoMerge;for(var t=1/0,e=A.posAxis._id.charAt(0),r=[],i=0;i<E.length;i++){for(var n=E[i],o=0;o<n.length;o++){var a=n[o],s=a.p;s===void 0&&(s=a[e]),s!==void 0&&r.push(s)}n[0]&&n[0].width1&&(t=Math.min(n[0].width1,t))}this.positions=r;var h=c(r);this.distinctPositions=h.vals,h.vals.length===1&&t!==1/0?this.minDiff=t:this.minDiff=Math.min(h.minDiff,t);var v=(A.posAxis||{}).type;(v==="category"||v==="multicategory")&&(this.minDiff=1),this.binWidth=this.minDiff,this.bins={}}g.prototype.put=function(E,A,t){var e=this.getLabel(E,A,t),r=this.bins[e]||0;return this.bins[e]=r+t,r},g.prototype.get=function(E,A,t){var e=this.getLabel(E,A,t);return this.bins[e]||0},g.prototype.getLabel=function(E,A,t){var e=t<0&&this.sepNegVal?"v":"^",r=this.overlapNoMerge?E:Math.round(E/this.binWidth);return e+r+"g"+A}}),p0=Vt((X,V)=>{var c=vo(),g=qr().isArrayOrTypedArray,E=ts().BADNUM,A=Mi(),t=ao(),e=c0().getAxisGroup,r=y4();function i(_,D){for(var I=D.xaxis,O=D.yaxis,B=_._fullLayout,R=_._fullData,L=_.calcdata,F=[],N=[],j=0;j<R.length;j++){var G=R[j];if(G.visible===!0&&A.traceIs(G,"bar")&&G.xaxis===I._id&&G.yaxis===O._id&&(G.orientation==="h"?F.push(L[j]):N.push(L[j]),G._computePh))for(var rt=_.calcdata[j],ct=0;ct<rt.length;ct++)typeof rt[ct].ph0=="function"&&(rt[ct].ph0=rt[ct].ph0()),typeof rt[ct].ph1=="function"&&(rt[ct].ph1=rt[ct].ph1())}var lt={xCat:I.type==="category"||I.type==="multicategory",yCat:O.type==="category"||O.type==="multicategory",mode:B.barmode,norm:B.barnorm,gap:B.bargap,groupgap:B.bargroupgap};n(_,I,O,N,lt),n(_,O,I,F,lt)}function n(_,D,I,O,B){if(O.length){var R,L,F,N,j;switch(s(I,O),B.mode){case"overlay":h(_,D,I,O,B);break;case"group":for(R=[],L=[],F=0;F<O.length;F++)N=O[F],j=N[0].trace,j.offset===void 0?L.push(N):R.push(N);L.length&&v(_,D,I,L,B),R.length&&h(_,D,I,R,B);break;case"stack":case"relative":for(R=[],L=[],F=0;F<O.length;F++)N=O[F],j=N[0].trace,j.base===void 0?L.push(N):R.push(N);a(L),L.length&&m(_,D,I,L,B),R.length&&h(_,D,I,R,B);break}o(O),f(O,D)}}function o(_){var D,I,O,B,R,L,F;for(D=0;D<_.length;D++)I=_[D],O=I[0].trace,B=I[0].t,B.cornerradiusvalue===void 0&&(R=O.marker?O.marker.cornerradius:void 0,R!==void 0&&(L=c(R)?+R:+R.slice(0,-1),F=c(R)?"px":"%",B.cornerradiusvalue=L,B.cornerradiusform=F))}function a(_){if(!(_.length<2)){var D,I,O,B,R,L,F;for(D=0;D<_.length&&(I=_[D],O=I[0].trace,R=O.marker?O.marker.cornerradius:void 0,R===void 0);D++);if(R!==void 0)for(L=c(R)?+R:+R.slice(0,-1),F=c(R)?"px":"%",D=0;D<_.length;D++)I=_[D],B=I[0].t,B.cornerradiusvalue=L,B.cornerradiusform=F}}function s(_,D){var I,O;for(I=0;I<D.length;I++){var B=D[I],R=B[0].trace,L=R.type==="funnel"?R._base:R.base,F,N=R.orientation==="h"?R.xcalendar:R.ycalendar,j=_.type==="category"||_.type==="multicategory"?function(){return null}:_.d2c;if(g(L)){for(O=0;O<Math.min(L.length,B.length);O++)F=j(L[O],0,N),c(F)?(B[O].b=+F,B[O].hasB=1):B[O].b=0;for(;O<B.length;O++)B[O].b=0}else{F=j(L,0,N);var G=c(F);for(F=G?F:0,O=0;O<B.length;O++)B[O].b=F,G&&(B[O].hasB=1)}}}function h(_,D,I,O,B){for(var R=0;R<O.length;R++){var L=O[R],F=new r([L],{posAxis:D,sepNegVal:!1,overlapNoMerge:!B.norm});p(_,D,F,B),B.norm?(T(F),w(I,F,B)):b(I,F)}}function v(_,D,I,O,B){var R=new r(O,{posAxis:D,sepNegVal:!1,overlapNoMerge:!B.norm});p(_,D,R,B),M(R,D),B.norm?(T(R),w(I,R,B)):b(I,R)}function m(_,D,I,O,B){var R=new r(O,{posAxis:D,sepNegVal:B.mode==="relative",overlapNoMerge:!(B.norm||B.mode==="stack"||B.mode==="relative")});p(_,D,R,B),S(I,R,B);for(var L=0;L<O.length;L++)for(var F=O[L],N=F[0].t.offsetindex,j=0;j<F.length;j++){var G=F[j];if(G.s!==E){var rt=G.b+G.s===R.get(G.p,N,G.s);rt&&(G._outmost=!0)}}B.norm&&w(I,R,B)}function p(_,D,I,O){var B=_._fullLayout,R=I.positions,L=I.distinctPositions,F=I.minDiff,N=I.traces,j=N.length,G=R.length!==L.length,rt=F*(1-O.gap),ct,lt,tt,Z;if(D._id==="angularaxis")ct=rt,lt=ct*(1-(O.groupgap||0)),tt=-lt/2;else{var st=e(B,D._id)+N[0][0].trace.orientation;Z=B._alignmentOpts[st]||{}}for(var $=0;$<j;$++){var Q=N[$],nt=Q[0].trace;if(D._id!=="angularaxis"){var Y=Z[nt.alignmentgroup]||{},q=Object.keys(Y.offsetGroups||{}).length;q?ct=rt/q:ct=G?rt/j:rt,lt=ct*(1-(O.groupgap||0)),q?tt=((2*nt._offsetIndex+1-q)*ct-lt)/2:tt=G?((2*$+1-j)*ct-lt)/2:-lt/2}var ot=Q[0].t;ot.barwidth=lt,ot.offsetindex=nt._offsetIndex||0,ot.poffset=tt,ot.bargroupwidth=rt,ot.bardelta=F}I.binWidth=N[0][0].t.barwidth/100,y(I),l(D,I),D._id==="angularaxis"?x(D,I):x(D,I,G)}function y(_){var D=_.traces,I,O;for(I=0;I<D.length;I++){var B=D[I],R=B[0],L=R.trace,F=R.t,N=L._offset||L.offset,j=F.poffset,G;if(g(N)){for(G=Array.prototype.slice.call(N,0,B.length),O=0;O<G.length;O++)c(G[O])||(G[O]=j);for(O=G.length;O<B.length;O++)G.push(j);F.poffset=G}else N!==void 0&&(F.poffset=N);var rt=L._width||L.width,ct=F.barwidth;if(g(rt)){var lt=Array.prototype.slice.call(rt,0,B.length);for(O=0;O<lt.length;O++)c(lt[O])||(lt[O]=ct);for(O=lt.length;O<B.length;O++)lt.push(ct);if(F.barwidth=lt,N===void 0){for(G=[],O=0;O<B.length;O++)G.push(j+(ct-lt[O])/2);F.poffset=G}}else rt!==void 0&&(F.barwidth=rt,N===void 0&&(F.poffset=j+(ct-rt)/2))}}function l(_,D){for(var I=D.traces,O=k(_),B=0;B<I.length;B++)for(var R=I[B],L=R[0].t,F=L.poffset,N=g(F),j=L.barwidth,G=g(j),rt=0;rt<R.length;rt++){var ct=R[rt],lt=ct.w=G?j[rt]:j;ct.p===void 0&&(ct.p=ct[O],ct["orig_"+O]=ct[O]);var tt=(N?F[rt]:F)+lt/2;ct[O]=ct.p+tt}}function x(_,D,I){var O=D.traces,B=D.minDiff,R=B/2;t.minDtick(_,D.minDiff,D.distinctPositions[0],I);for(var L=0;L<O.length;L++){var F=O[L],N=F[0],j=N.trace,G=[],rt,ct,lt,tt;for(tt=0;tt<F.length;tt++)rt=F[tt],ct=rt.p-R,lt=rt.p+R,G.push(ct,lt);if(j.width||j.offset){var Z=N.t,st=Z.poffset,$=Z.barwidth,Q=g(st),nt=g($);for(tt=0;tt<F.length;tt++){rt=F[tt];var Y=Q?st[tt]:st,q=nt?$[tt]:$;ct=rt.p+Y,lt=ct+q,G.push(ct,lt)}}j._extremes[_._id]=t.findExtremes(_,G,{padded:!1})}}function b(_,D){for(var I=D.traces,O=k(_),B=0;B<I.length;B++){for(var R=I[B],L=R[0].trace,F=L.type==="scatter",N=L.orientation==="v",j=[],G=!1,rt=0;rt<R.length;rt++){var ct=R[rt],lt=F?0:ct.b,tt=F?N?ct.y:ct.x:lt+ct.s;ct[O]=tt,j.push(tt),ct.hasB&&j.push(lt),(!ct.hasB||!ct.b)&&(G=!0)}L._extremes[_._id]=t.findExtremes(_,j,{tozero:G,padded:!0})}}function S(_,D,I){var O=k(_),B=D.traces,R,L,F,N,j,G,rt;for(N=0;N<B.length;N++)if(R=B[N],L=R[0].trace,L.type==="funnel")for(rt=R[0].t.offsetindex,j=0;j<R.length;j++)G=R[j],G.s!==E&&D.put(G.p,rt,-.5*G.s);for(N=0;N<B.length;N++){R=B[N],L=R[0].trace,F=L.type==="funnel",rt=L.type==="barpolar"?0:R[0].t.offsetindex;var ct=[];for(j=0;j<R.length;j++)if(G=R[j],G.s!==E){var lt;F?lt=G.s:lt=G.s+G.b;var tt=D.put(G.p,rt,lt),Z=tt+lt;G.b=tt,G[O]=Z,I.norm||(ct.push(Z),G.hasB&&ct.push(tt))}I.norm||(L._extremes[_._id]=t.findExtremes(_,ct,{tozero:!0,padded:!0}))}}function T(_){for(var D=_.traces,I=0;I<D.length;I++)for(var O=D[I],B=O[0].t.offsetindex,R=0;R<O.length;R++){var L=O[R];L.s!==E&&_.put(L.p,B,L.b+L.s)}}function M(_,D){for(var I=_.traces,O=0;O<I.length;O++){var B=I[O],R=B[0].trace,L=B[0].t.offsetindex;if(R.base===void 0)for(var F=new r([B],{posAxis:D,sepNegVal:!0,overlapNoMerge:!0}),N=0;N<B.length;N++){var j=B[N];if(j.p!==E){var G=F.put(j.p,L,j.b+j.s);G&&(j.b=G)}}}}function w(_,D,I){var O=D.traces,B=k(_),R=I.norm==="fraction"?1:100,L=R/1e9,F=_.l2c(_.c2l(0)),N=I.mode==="stack"?R:F;function j(ot){return c(_.c2l(ot))&&(ot<F-L||ot>N+L||!c(F))}for(var G=0;G<O.length;G++){for(var rt=O[G],ct=rt[0].t.offsetindex,lt=rt[0].trace,tt=[],Z=!1,st=!1,$=0;$<rt.length;$++){var Q=rt[$];if(Q.s!==E){var nt=Math.abs(R/D.get(Q.p,ct,Q.s));Q.b*=nt,Q.s*=nt;var Y=Q.b,q=Y+Q.s;Q[B]=q,tt.push(q),st=st||j(q),Q.hasB&&(tt.push(Y),st=st||j(Y)),(!Q.hasB||!Q.b)&&(Z=!0)}}lt._extremes[_._id]=t.findExtremes(_,tt,{tozero:Z,padded:st})}}function u(_,D,I,O){for(var B=k(O),R=0;R<_.length;R++)for(var L=_[R],F=0;F<L.length;F++){var N=L[F],j=N[B];N._sMin=D[j],N._sMax=I[j]}}function f(_,D){var I=k(D),O={},B,R,L,F=1/0,N=-1/0;for(B=0;B<_.length;B++)for(L=_[B],R=0;R<L.length;R++){var j=L[R].p;c(j)&&(F=Math.min(F,j),N=Math.max(N,j))}var G=1e4/(N-F),rt=O.round=function(dt){return String(Math.round(G*(dt-F)))},ct={},lt={},tt=_.some(function(dt){var wt=dt[0].trace;return"marker"in wt&&wt.marker.cornerradius});for(B=0;B<_.length;B++){L=_[B],L[0].t.extents=O;var Z=L[0].t.poffset,st=g(Z);for(R=0;R<L.length;R++){var $=L[R],Q=$[I]-$.w/2;if(c(Q)){var nt=$[I]+$.w/2,Y=rt($.p);O[Y]?O[Y]=[Math.min(Q,O[Y][0]),Math.max(nt,O[Y][1])]:O[Y]=[Q,nt]}if($.p0=$.p+(st?Z[R]:Z),$.p1=$.p0+$.w,$.s0=$.b,$.s1=$.s0+$.s,tt){var q=Math.min($.s0,$.s1)||0,ot=Math.max($.s0,$.s1)||0,it=$[I];ct[it]=it in ct?Math.min(ct[it],q):q,lt[it]=it in lt?Math.max(lt[it],ot):ot}}}tt&&u(_,ct,lt,D)}function k(_){return _._id.charAt(0)}V.exports={crossTraceCalc:i,setGroupPositions:n}}),x4=Vt((X,V)=>{var c=Hf(),g=p0().setGroupPositions;function E(e,r){for(var i=r.xaxis,n=r.yaxis,o=e._fullLayout,a=e._fullData,s=e.calcdata,h=[],v=[],m=0;m<a.length;m++){var p=a[m];p.visible===!0&&p.type==="scatter"&&p.xaxis===i._id&&p.yaxis===n._id&&(p.orientation==="h"?h.push(s[m]):p.orientation==="v"&&v.push(s[m]))}var y={mode:o.scattermode,gap:o.scattergap};g(e,i,n,v,y),g(e,n,i,h,y)}V.exports=function(e,r){e._fullLayout.scattermode==="group"&&E(e,r);var i=r.xaxis,n=r.yaxis,o=i._id+n._id,a=e._fullLayout._scatterStackOpts[o];if(a){var s=e.calcdata,h,v,m,p,y,l,x,b,S,T,M,w,u,f,k;for(var _ in a){T=a[_];var D=T.traceIndices;if(D.length){for(M=T.stackgaps==="interpolate",w=T.groupnorm,T.orientation==="v"?(u="x",f="y"):(u="y",f="x"),k=new Array(D.length),h=0;h<k.length;h++)k[h]=!1;l=s[D[0]];var I=new Array(l.length);for(h=0;h<l.length;h++)I[h]=l[h][u];for(h=1;h<D.length;h++){for(y=s[D[h]],v=m=0;v<y.length;v++){for(x=y[v][u];x>I[m]&&m<I.length;m++)A(y,v,I[m],h,k,M,u),v++;if(x!==I[m]){for(p=0;p<h;p++)A(s[D[p]],m,x,p,k,M,u);I.splice(m,0,x)}m++}for(;m<I.length;m++)A(y,v,I[m],h,k,M,u),v++}var O=I.length;for(v=0;v<l.length;v++){for(b=l[v][f]=l[v].s,h=1;h<D.length;h++)y=s[D[h]],y[0].trace._rawLength=y[0].trace._length,y[0].trace._length=O,b+=y[v].s,y[v][f]=b;if(w)for(S=(w==="fraction"?b:b/100)||1,h=0;h<D.length;h++){var B=s[D[h]][v];B[f]/=S,B.sNorm=B.s/S}}for(h=0;h<D.length;h++){y=s[D[h]];var R=y[0].trace,L=c.calcMarkerSize(R,R._rawLength),F=Array.isArray(L);if(L&&k[h]||F){var N=L;for(L=new Array(O),v=0;v<O;v++)L[v]=y[v].gap?0:F?N[y[v].i]:N}var j=new Array(O),G=new Array(O);for(v=0;v<O;v++)j[v]=y[v].x,G[v]=y[v].y;c.calcAxisExpansion(e,R,i,n,j,G,L),y[0].t.orientation=T.orientation}}}}};function A(e,r,i,n,o,a,s){o[n]=!0;var h={i:null,gap:!0,s:0};if(h[s]=i,e.splice(r,0,h),r&&i===e[r-1][s]){var v=e[r-1];h.s=v.s,h.i=v.i,h.gap=v.gap}else a&&(h.s=t(e,r,i,s));r||(e[0].t=e[1].t,e[0].trace=e[1].trace,delete e[1].t,delete e[1].trace)}function t(e,r,i,n){var o=e[r-1],a=e[r+1];return a?o?o.s+(a.s-o.s)*(i-o[n])/(a[n]-o[n]):a.s:o.s}}),Ib=Vt((X,V)=>{var c=go(),g=ts(),E=g.BADNUM,A=g.LOG_CLIP,t=A+.5,e=A-.5,r=qr(),i=r.segmentsIntersect,n=r.constrain,o=_p();V.exports=function(a,s){var h=s.trace||{},v=s.xaxis,m=s.yaxis,p=v.type==="log",y=m.type==="log",l=v._length,x=m._length,b=s.backoff,S=h.marker,T=s.connectGaps,M=s.baseTolerance,w=s.shape,u=w==="linear",f=h.fill&&h.fill!=="none",k=[],_=o.minTolerance,D=a.length,I=new Array(D),O=0,B,R,L,F,N,j,G,rt,ct,lt,tt,Z,st,$,Q,nt;function Y(ee){var we=a[ee];if(!we)return!1;var Me=s.linearized?v.l2p(we.x):v.c2p(we.x),Re=s.linearized?m.l2p(we.y):m.c2p(we.y);if(Me===E){if(p&&(Me=v.c2p(we.x,!0)),Me===E)return!1;y&&Re===E&&(Me*=Math.abs(v._m*x*(v._m>0?t:e)/(m._m*l*(m._m>0?t:e)))),Me*=1e3}if(Re===E){if(y&&(Re=m.c2p(we.y,!0)),Re===E)return!1;Re*=1e3}return[Me,Re]}function q(ee,we,Me,Re){var Be=Me-ee,Ze=Re-we,Ue=.5-ee,mr=.5-we,ln=Be*Be+Ze*Ze,an=Be*Ue+Ze*mr;if(an>0&&an<ln){var vn=Ue*Ze-mr*Be;if(vn*vn<ln)return!0}}var ot,it;function dt(ee,we){var Me=ee[0]/l,Re=ee[1]/x,Be=Math.max(0,-Me,Me-1,-Re,Re-1);return Be&&ot!==void 0&&q(Me,Re,ot,it)&&(Be=0),Be&&we&&q(Me,Re,we[0]/l,we[1]/x)&&(Be=0),(1+o.toleranceGrowth*Be)*M}function wt(ee,we){var Me=ee[0]-we[0],Re=ee[1]-we[1];return Math.sqrt(Me*Me+Re*Re)}var xt=o.maxScreensAway,Ft=-l*xt,Et=l*(1+xt),Nt=-x*xt,te=x*(1+xt),Jt=[[Ft,Nt,Et,Nt],[Et,Nt,Et,te],[Et,te,Ft,te],[Ft,te,Ft,Nt]],Qt,Wt,gt,bt,vt,Ut;function Kt(ee,we){for(var Me=[],Re=0,Be=0;Be<4;Be++){var Ze=Jt[Be],Ue=i(ee[0],ee[1],we[0],we[1],Ze[0],Ze[1],Ze[2],Ze[3]);Ue&&(!Re||Math.abs(Ue.x-Me[0][0])>1||Math.abs(Ue.y-Me[0][1])>1)&&(Ue=[Ue.x,Ue.y],Re&&wt(Ue,ee)<wt(Me[0],ee)?Me.unshift(Ue):Me.push(Ue),Re++)}return Me}function Zt(ee){if(ee[0]<Ft||ee[0]>Et||ee[1]<Nt||ee[1]>te)return[n(ee[0],Ft,Et),n(ee[1],Nt,te)]}function le(ee,we){if(ee[0]===we[0]&&(ee[0]===Ft||ee[0]===Et)||ee[1]===we[1]&&(ee[1]===Nt||ee[1]===te))return!0}function Te(ee,we){var Me=[],Re=Zt(ee),Be=Zt(we);return Re&&Be&&le(Re,Be)||(Re&&Me.push(Re),Be&&Me.push(Be)),Me}function Se(ee,we,Me){return function(Re,Be){var Ze=Zt(Re),Ue=Zt(Be),mr=[];if(Ze&&Ue&&le(Ze,Ue))return mr;Ze&&mr.push(Ze),Ue&&mr.push(Ue);var ln=2*r.constrain((Re[ee]+Be[ee])/2,we,Me)-((Ze||Re)[ee]+(Ue||Be)[ee]);if(ln){var an;Ze&&Ue?an=ln>0==Ze[ee]>Ue[ee]?Ze:Ue:an=Ze||Ue,an[ee]+=ln}return mr}}var Fe;w==="linear"||w==="spline"?Fe=Kt:w==="hv"||w==="vh"?Fe=Te:w==="hvh"?Fe=Se(0,Ft,Et):w==="vhv"&&(Fe=Se(1,Nt,te));function Oe(ee,we){var Me=we[0]-ee[0],Re=(we[1]-ee[1])/Me,Be=(ee[1]*we[0]-we[1]*ee[0])/Me;return Be>0?[Re>0?Ft:Et,te]:[Re>0?Et:Ft,Nt]}function ur(ee){var we=ee[0],Me=ee[1],Re=we===I[O-1][0],Be=Me===I[O-1][1];if(!(Re&&Be))if(O>1){var Ze=we===I[O-2][0],Ue=Me===I[O-2][1];Re&&(we===Ft||we===Et)&&Ze?Ue?O--:I[O-1]=ee:Be&&(Me===Nt||Me===te)&&Ue?Ze?O--:I[O-1]=ee:I[O++]=ee}else I[O++]=ee}function fr(ee){I[O-1][0]!==ee[0]&&I[O-1][1]!==ee[1]&&ur([gt,bt]),ur(ee),vt=null,gt=bt=0}var We=r.isArrayOrTypedArray(S);function Lr(ee){if(ee&&b&&(ee.i=B,ee.d=a,ee.trace=h,ee.marker=We?S[ee.i]:S,ee.backoff=b),ot=ee[0]/l,it=ee[1]/x,Qt=ee[0]<Ft?Ft:ee[0]>Et?Et:0,Wt=ee[1]<Nt?Nt:ee[1]>te?te:0,Qt||Wt){if(!O)I[O++]=[Qt||ee[0],Wt||ee[1]];else if(vt){var we=Fe(vt,ee);we.length>1&&(fr(we[0]),I[O++]=we[1])}else Ut=Fe(I[O-1],ee)[0],I[O++]=Ut;var Me=I[O-1];Qt&&Wt&&(Me[0]!==Qt||Me[1]!==Wt)?(vt&&(gt!==Qt&&bt!==Wt?ur(gt&&bt?Oe(vt,ee):[gt||Qt,bt||Wt]):gt&&bt&&ur([gt,bt])),ur([Qt,Wt])):gt-Qt&&bt-Wt&&ur([Qt||gt,Wt||bt]),vt=ee,gt=Qt,bt=Wt}else vt&&fr(Fe(vt,ee)[0]),I[O++]=ee}for(B=0;B<D;B++)if(R=Y(B),!!R){for(O=0,vt=null,Lr(R),B++;B<D;B++){if(F=Y(B),!F){if(T)continue;break}if(!u||!s.simplify){Lr(F);continue}var kr=Y(B+1);if(lt=wt(F,R),!(!(f&&(O===0||O===D-1))&<<dt(F,kr)*_)){for(rt=[(F[0]-R[0])/lt,(F[1]-R[1])/lt],N=R,tt=lt,Z=$=Q=0,G=!1,L=F,B++;B<a.length;B++){if(j=kr,kr=Y(B+1),!j){if(T)continue;break}if(ct=[j[0]-R[0],j[1]-R[1]],nt=ct[0]*rt[1]-ct[1]*rt[0],$=Math.min($,nt),Q=Math.max(Q,nt),Q-$>dt(j,kr))break;L=j,st=ct[0]*rt[0]+ct[1]*rt[1],st>tt?(tt=st,F=j,G=!1):st<Z&&(Z=st,N=j,G=!0)}if(G?(Lr(F),L!==N&&Lr(N)):(N!==R&&Lr(N),L!==F&&Lr(F)),Lr(L),B>=a.length||!j)break;Lr(j),R=j}}vt&&ur([gt||vt[0],bt||vt[1]]),k.push(I.slice(0,O))}var he=w.slice(w.length-1);if(b&&he!=="h"&&he!=="v"){for(var Dt=!1,qt=-1,zt=[],ut=0;ut<k.length;ut++)for(var yt=0;yt<k[ut].length-1;yt++){var Mt=k[ut][yt],Ot=k[ut][yt+1],$t=c.applyBackoff(Ot,Mt);($t[0]!==Ot[0]||$t[1]!==Ot[1])&&(Dt=!0),zt[qt+1]||(qt++,zt[qt]=[Mt,[$t[0],$t[1]]])}return Dt?zt:k}return k}}),Lb=Vt((X,V)=>{var c={tonextx:1,tonexty:1,tonext:1};V.exports=function(g,E,A){var t,e,r,i,n,o={},a=!1,s=-1,h=0,v=-1;for(e=0;e<A.length;e++)t=A[e][0].trace,r=t.stackgroup||"",r?r in o?n=o[r]:(n=o[r]=h,h++):t.fill in c&&v>=0?n=v:(n=v=h,h++),n<s&&(a=!0),t._groupIndex=s=n;var m=A.slice();a&&m.sort(function(y,l){var x=y[0].trace,b=l[0].trace;return x._groupIndex-b._groupIndex||x.index-b.index});var p={};for(e=0;e<m.length;e++)t=m[e][0].trace,r=t.stackgroup||"",t.visible===!0?(t._nexttrace=null,t.fill in c&&(i=p[r],t._prevtrace=i||null,i&&(i._nexttrace=t)),t._ownfill=t.fill&&(t.fill.substr(0,6)==="tozero"||t.fill==="toself"||t.fill.substr(0,2)==="to"&&!t._prevtrace),p[r]=t):t._prevtrace=t._nexttrace=t._ownfill=null;return m}}),Ag=Vt((X,V)=>{var c=Ai(),g=Mi(),E=qr(),A=E.ensureSingle,t=E.identity,e=go(),r=Sl(),i=Ib(),n=Lb(),o=Nm().tester;V.exports=function(v,m,p,y,l,x){var b,S,T=!l,M=!!l&&l.duration>0,w=n(v,m,p);if(b=y.selectAll("g.trace").data(w,function(f){return f[0].trace.uid}),b.enter().append("g").attr("class",function(f){return"trace scatter trace"+f[0].trace.uid}).style("stroke-miterlimit",2),b.order(),a(v,b,m),M){x&&(S=x());var u=c.transition().duration(l.duration).ease(l.easing).each("end",function(){S&&S()}).each("interrupt",function(){S&&S()});u.each(function(){y.selectAll("g.trace").each(function(f,k){s(v,k,m,f,w,this,l)})})}else b.each(function(f,k){s(v,k,m,f,w,this,l)});T&&b.exit().remove(),y.selectAll("path:not([d])").remove()};function a(v,m,p){m.each(function(y){var l=A(c.select(this),"g","fills");e.setClipUrl(l,p.layerClipId,v);var x=y[0].trace,b=[];x._ownfill&&b.push("_ownFill"),x._nexttrace&&b.push("_nextFill");var S=l.selectAll("g").data(b,t);S.enter().append("g"),S.exit().each(function(T){x[T]=null}).remove(),S.order().each(function(T){x[T]=A(c.select(this),"path","js-fill")})})}function s(v,m,p,y,l,x,b){var S=v._context.staticPlot,T;h(v,m,p,y,l);var M=!!b&&b.duration>0;function w(fr){return M?fr.transition():fr}var u=p.xaxis,f=p.yaxis,k=y[0].trace,_=k.line,D=c.select(x),I=A(D,"g","errorbars"),O=A(D,"g","lines"),B=A(D,"g","points"),R=A(D,"g","text");if(g.getComponentMethod("errorbars","plot")(v,I,p,b),k.visible!==!0)return;w(D).style("opacity",k.opacity);var L,F,N=k.fill.charAt(k.fill.length-1);N!=="x"&&N!=="y"&&(N="");var j,G;N==="y"?(j=1,G=f.c2p(0,!0)):N==="x"&&(j=0,G=u.c2p(0,!0)),y[0][p.isRangePlot?"nodeRangePlot3":"node3"]=D;var rt="",ct=[],lt=k._prevtrace,tt=null,Z=null;lt&&(rt=lt._prevRevpath||"",F=lt._nextFill,ct=lt._ownPolygons,tt=lt._fillsegments,Z=lt._fillElement);var st,$,Q="",nt="",Y,q,ot,it,dt,wt,xt=[];k._polygons=[];var Ft=[],Et=[],Nt=E.noop;if(L=k._ownFill,r.hasLines(k)||k.fill!=="none"){F&&F.datum(y),["hv","vh","hvh","vhv"].indexOf(_.shape)!==-1?(Y=e.steps(_.shape),q=e.steps(_.shape.split("").reverse().join(""))):_.shape==="spline"?Y=q=function(fr){var We=fr[fr.length-1];return fr.length>1&&fr[0][0]===We[0]&&fr[0][1]===We[1]?e.smoothclosed(fr.slice(1),_.smoothing):e.smoothopen(fr,_.smoothing)}:Y=q=function(fr){return"M"+fr.join("L")},ot=function(fr){return q(fr.reverse())},Et=i(y,{xaxis:u,yaxis:f,trace:k,connectGaps:k.connectgaps,baseTolerance:Math.max(_.width||1,3)/4,shape:_.shape,backoff:_.backoff,simplify:_.simplify,fill:k.fill}),Ft=new Array(Et.length);var te=0;for(T=0;T<Et.length;T++){var Jt,Qt=Et[T];!Jt||!N?(Jt=Qt.slice(),Ft[te]=Jt,te++):Jt.push.apply(Jt,Qt)}k._fillElement=null,k._fillExclusionElement=Z,k._fillsegments=Ft.slice(0,te),Ft=k._fillsegments,Et.length&&(it=Et[0][0].slice(),dt=Et[Et.length-1],wt=dt[dt.length-1].slice()),Nt=function(fr){return function(We){if(st=Y(We),$=ot(We),Q?N?(Q+="L"+st.substr(1),nt=$+("L"+nt.substr(1))):(Q+="Z"+st,nt=$+"Z"+nt):(Q=st,nt=$),r.hasLines(k)){var Lr=c.select(this);if(Lr.datum(y),fr)w(Lr.style("opacity",0).attr("d",st).call(e.lineGroupStyle)).style("opacity",1);else{var kr=w(Lr);kr.attr("d",st),e.singleLineStyle(y,kr)}}}}}var Wt=O.selectAll(".js-line").data(Et);w(Wt.exit()).style("opacity",0).remove(),Wt.each(Nt(!1)),Wt.enter().append("path").classed("js-line",!0).style("vector-effect",S?"none":"non-scaling-stroke").call(e.lineGroupStyle).each(Nt(!0)),e.setClipUrl(Wt,p.layerClipId,v);function gt(fr){w(fr).attr("d","M0,0Z")}var bt=function(){var fr=new Array(Ft.length);for(T=0;T<Ft.length;T++)fr[T]=o(Ft[T]);return fr},vt=function(fr){var We,Lr;if(!fr||fr.length===0)for(We=new Array(Ft.length),Lr=0;Lr<Ft.length;Lr++){var kr=Ft[Lr][0].slice(),he=Ft[Lr][Ft[Lr].length-1].slice();kr[j]=he[j]=G;var Dt=[he,kr],qt=Dt.concat(Ft[Lr]);We[Lr]=o(qt)}else{for(We=new Array(fr.length-1+Ft.length),Lr=0;Lr<fr.length-1;Lr++)We[Lr]=o(fr[Lr]);var zt=fr[fr.length-1].slice();for(zt.reverse(),Lr=0;Lr<Ft.length;Lr++)We[fr.length-1+Lr]=o(Ft[Lr].concat(zt))}return We};Et.length?(L?(L.datum(y),it&&wt&&(N?(it[j]=wt[j]=G,w(L).attr("d","M"+wt+"L"+it+"L"+Q.substr(1)).call(e.singleFillStyle,v),xt=vt(null)):(w(L).attr("d",Q+"Z").call(e.singleFillStyle,v),xt=bt())),k._polygons=xt,k._fillElement=L):F&&(k.fill.substr(0,6)==="tonext"&&Q&&rt?(k.fill==="tonext"?(w(F).attr("d",Q+"Z"+rt+"Z").call(e.singleFillStyle,v),xt=bt(),k._polygons=xt.concat(ct)):(w(F).attr("d",Q+"L"+rt.substr(1)+"Z").call(e.singleFillStyle,v),xt=vt(tt),k._polygons=xt),k._fillElement=F):gt(F)),k._prevRevpath=nt):(L?gt(L):F&>(F),k._prevRevpath=null),k._ownPolygons=xt;function Ut(fr){return fr.filter(function(We){return!We.gap&&We.vis})}function Kt(fr){return fr.filter(function(We){return We.vis})}function Zt(fr){return fr.filter(function(We){return!We.gap})}function le(fr){return fr.id}function Te(fr){if(fr.ids)return le}function Se(){return!1}function Fe(fr,We,Lr){var kr,he,Dt,qt=Lr[0].trace,zt=r.hasMarkers(qt),ut=r.hasText(qt),yt=Te(qt),Mt=Se,Ot=Se;if(zt||ut){var $t=t,ee=qt.stackgroup,we=ee&&v._fullLayout._scatterStackOpts[u._id+f._id][ee].stackgaps==="infer zero";qt.marker.maxdisplayed||qt._needsCull?$t=we?Kt:Ut:ee&&!we&&($t=Zt),zt&&(Mt=$t),ut&&(Ot=$t)}he=fr.selectAll("path.point"),kr=he.data(Mt,yt);var Me=kr.enter().append("path").classed("point",!0);M&&Me.call(e.pointStyle,qt,v).call(e.translatePoints,u,f).style("opacity",0).transition().style("opacity",1),kr.order();var Re;zt&&(Re=e.makePointStyleFns(qt)),kr.each(function(Be){var Ze=c.select(this),Ue=w(Ze);Dt=e.translatePoint(Be,Ue,u,f),Dt?(e.singlePointStyle(Be,Ue,qt,Re,v),p.layerClipId&&e.hideOutsideRangePoint(Be,Ue,u,f,qt.xcalendar,qt.ycalendar),qt.customdata&&Ze.classed("plotly-customdata",Be.data!==null&&Be.data!==void 0)):Ue.remove()}),M?kr.exit().transition().style("opacity",0).remove():kr.exit().remove(),he=We.selectAll("g"),kr=he.data(Ot,yt),kr.enter().append("g").classed("textpoint",!0).append("text"),kr.order(),kr.each(function(Be){var Ze=c.select(this),Ue=w(Ze.select("text"));Dt=e.translatePoint(Be,Ue,u,f),Dt?p.layerClipId&&e.hideOutsideRangePoint(Be,Ze,u,f,qt.xcalendar,qt.ycalendar):Ze.remove()}),kr.selectAll("text").call(e.textPointStyle,qt,v).each(function(Be){var Ze=u.c2p(Be.x),Ue=f.c2p(Be.y);c.select(this).selectAll("tspan.line").each(function(){w(c.select(this)).attr({x:Ze,y:Ue})})}),kr.exit().remove()}B.datum(y),R.datum(y),Fe(B,R,y);var Oe=k.cliponaxis===!1,ur=Oe?null:p.layerClipId;e.setClipUrl(B,ur,v),e.setClipUrl(R,ur,v)}function h(v,m,p,y,l){var x=p.xaxis,b=p.yaxis,S=c.extent(E.simpleMap(x.range,x.r2c)),T=c.extent(E.simpleMap(b.range,b.r2c)),M=y[0].trace;if(r.hasMarkers(M)){var w=M.marker.maxdisplayed;if(w!==0){var u=y.filter(function(D){return D.x>=S[0]&&D.x<=S[1]&&D.y>=T[0]&&D.y<=T[1]}),f=Math.ceil(u.length/w),k=0;l.forEach(function(D,I){var O=D[0].trace;r.hasMarkers(O)&&O.marker.maxdisplayed>0&&I<m&&k++});var _=Math.round(k*f/3+Math.floor(k/3)*f/7.1);y.forEach(function(D){delete D.vis}),u.forEach(function(D,I){Math.round((I+_)%f)===0&&(D.vis=!0)})}}}}),Wh=Vt((X,V)=>{V.exports={container:"marker",min:"cmin",max:"cmax"}}),Qy=Vt((X,V)=>{var c=ao();V.exports=function(g,E,A){var t={},e={_fullLayout:A},r=c.getFromTrace(e,E,"x"),i=c.getFromTrace(e,E,"y"),n=g.orig_x;n===void 0&&(n=g.x);var o=g.orig_y;return o===void 0&&(o=g.y),t.xLabel=c.tickText(r,r.c2l(n),!0).text,t.yLabel=c.tickText(i,i.c2l(o),!0).text,t}}),yf=Vt((X,V)=>{var c=Ai(),g=go(),E=Mi();function A(i){var n=c.select(i).selectAll("g.trace.scatter");n.style("opacity",function(o){return o[0].trace.opacity}),n.selectAll("g.points").each(function(o){var a=c.select(this),s=o.trace||o[0].trace;t(a,s,i)}),n.selectAll("g.text").each(function(o){var a=c.select(this),s=o.trace||o[0].trace;e(a,s,i)}),n.selectAll("g.trace path.js-line").call(g.lineGroupStyle),n.selectAll("g.trace path.js-fill").call(g.fillGroupStyle,i,!1),E.getComponentMethod("errorbars","style")(n)}function t(i,n,o){g.pointStyle(i.selectAll("path.point"),n,o)}function e(i,n,o){g.textPointStyle(i.selectAll("text"),n,o)}function r(i,n,o){var a=n[0].trace;a.selectedpoints?(g.selectedPointStyle(o.selectAll("path.point"),a),g.selectedTextStyle(o.selectAll("text"),a)):(t(o,a,i),e(o,a,i))}V.exports={style:A,stylePoints:t,styleText:e,styleOnSelect:r}}),Mg=Vt((X,V)=>{var c=vi(),g=Sl();V.exports=function(E,A){var t,e;if(E.mode==="lines")return t=E.line.color,t&&c.opacity(t)?t:E.fillcolor;if(E.mode==="none")return E.fill?E.fillcolor:"";var r=A.mcc||(E.marker||{}).color,i=A.mlcc||((E.marker||{}).line||{}).color;return e=r&&c.opacity(r)?r:i&&c.opacity(i)&&(A.mlw||((E.marker||{}).line||{}).width)?i:"",e?c.opacity(e)<.3?c.addOpacity(e,.3):e:(t=(E.line||{}).color,t&&c.opacity(t)&&g.hasLines(E)&&E.line.width?t:E.fillcolor)}}),Sg=Vt((X,V)=>{var c=qr(),g=Hu(),E=Mi(),A=Mg(),t=vi(),e=c.fillText;V.exports=function(r,i,n,o){var a=r.cd,s=a[0].trace,h=r.xa,v=r.ya,m=h.c2p(i),p=v.c2p(n),y=[m,p],l=s.hoveron||"",x=s.mode.indexOf("markers")!==-1?3:.5,b=!!s.xperiodalignment,S=!!s.yperiodalignment;if(l.indexOf("points")!==-1){var T=function(rt){if(b){var ct=h.c2p(rt.xStart),lt=h.c2p(rt.xEnd);return m>=Math.min(ct,lt)&&m<=Math.max(ct,lt)?0:1/0}var tt=Math.max(3,rt.mrc||0),Z=1-1/tt,st=Math.abs(h.c2p(rt.x)-m);return st<tt?Z*st/tt:st-tt+Z},M=function(rt){if(S){var ct=v.c2p(rt.yStart),lt=v.c2p(rt.yEnd);return p>=Math.min(ct,lt)&&p<=Math.max(ct,lt)?0:1/0}var tt=Math.max(3,rt.mrc||0),Z=1-1/tt,st=Math.abs(v.c2p(rt.y)-p);return st<tt?Z*st/tt:st-tt+Z},w=function(rt){var ct=Math.max(x,rt.mrc||0),lt=h.c2p(rt.x)-m,tt=v.c2p(rt.y)-p;return Math.max(Math.sqrt(lt*lt+tt*tt)-ct,1-x/ct)},u=g.getDistanceFunction(o,T,M,w);if(g.getClosest(a,u,r),r.index!==!1){var f=a[r.index],k=h.c2p(f.x,!0),_=v.c2p(f.y,!0),D=f.mrc||1;r.index=f.i;var I=a[0].t.orientation,O=I&&(f.sNorm||f.s),B=I==="h"?O:f.orig_x!==void 0?f.orig_x:f.x,R=I==="v"?O:f.orig_y!==void 0?f.orig_y:f.y;return c.extendFlat(r,{color:A(s,f),x0:k-D,x1:k+D,xLabelVal:B,y0:_-D,y1:_+D,yLabelVal:R,spikeDistance:w(f),hovertemplate:s.hovertemplate}),e(f,s,r),E.getComponentMethod("errorbars","hoverInfo")(f,s,r),[r]}}function L(rt){if(!rt)return!1;var ct=rt.node();try{var lt=new DOMPoint(y[0],y[1]);return ct.isPointInFill(lt)}catch{var tt=ct.ownerSVGElement.createSVGPoint();return tt.x=y[0],tt.y=y[1],ct.isPointInFill(tt)}}function F(rt){var ct,lt=[],tt=1/0,Z=-1/0,st=1/0,$=-1/0,Q;for(ct=0;ct<rt.length;ct++){var nt=rt[ct];nt.contains(y)&&(lt.push(nt),st=Math.min(st,nt.ymin),$=Math.max($,nt.ymax))}if(lt.length===0)return null;st=Math.max(st,0),$=Math.min($,v._length),Q=(st+$)/2;var Y,q,ot,it,dt,wt,xt;for(ct=0;ct<lt.length;ct++)for(q=lt[ct].pts,Y=1;Y<q.length;Y++)wt=q[Y-1][1],xt=q[Y][1],wt>Q!=xt>=Q&&(it=q[Y-1][0],dt=q[Y][0],xt-wt&&(ot=it+(dt-it)*(Q-wt)/(xt-wt),tt=Math.min(tt,ot),Z=Math.max(Z,ot)));return tt=Math.max(tt,0),Z=Math.min(Z,h._length),{x0:tt,x1:Z,y0:Q,y1:Q}}if(l.indexOf("fills")!==-1&&s._fillElement){var N=L(s._fillElement)&&!L(s._fillExclusionElement);if(N){var j=F(s._polygons);j===null&&(j={x0:y[0],x1:y[0],y0:y[1],y1:y[1]});var G=t.defaultLine;return t.opacity(s.fillcolor)?G=s.fillcolor:t.opacity((s.line||{}).color)&&(G=s.line.color),c.extendFlat(r,{distance:r.maxHoverDistance,x0:j.x0,x1:j.x1,y0:j.y0,y1:j.y1,color:G,hovertemplate:!1}),delete r.index,s.text&&!c.isArrayOrTypedArray(s.text)?r.text=String(s.text):r.text=s.name,[r]}}}}),Eg=Vt((X,V)=>{var c=Sl();V.exports=function(g,E){var A=g.cd,t=g.xaxis,e=g.yaxis,r=[],i=A[0].trace,n,o,a,s,h=!c.hasMarkers(i)&&!c.hasText(i);if(h)return[];if(E===!1)for(n=0;n<A.length;n++)A[n].selected=0;else for(n=0;n<A.length;n++)o=A[n],a=t.c2p(o.x),s=e.c2p(o.y),o.i!==null&&E.contains([a,s],!1,n,g)?(r.push({pointNumber:o.i,x:t.c2d(o.x),y:e.c2d(o.y)}),o.selected=1):o.selected=0;return r}}),_4=Vt((X,V)=>{V.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}),Cb=Vt((X,V)=>{var c=Mi().traceIs,g=bg();V.exports=function(r,i,n,o){n("autotypenumbers",o.autotypenumbersDflt);var a=n("type",(o.splomStash||{}).type);a==="-"&&(E(i,o.data),i.type==="-"?i.type="linear":r.type=i.type)};function E(r,i){if(r.type==="-"){var n=r._id,o=n.charAt(0),a;n.indexOf("scene")!==-1&&(n=o);var s=A(i,n,o);if(s){if(s.type==="histogram"&&o==={v:"y",h:"x"}[s.orientation||"v"]){r.type="linear";return}var h=o+"calendar",v=s[h],m={noMultiCategory:!c(s,"cartesian")||c(s,"noMultiCategory")};if(s.type==="box"&&s._hasPreCompStats&&o==={h:"x",v:"y"}[s.orientation||"v"]&&(m.noMultiCategory=!0),m.autotypenumbers=r.autotypenumbers,e(s,o)){var p=t(s),y=[];for(a=0;a<i.length;a++){var l=i[a];!c(l,"box-violin")||(l[o+"axis"]||o)!==n||(l[p]!==void 0?y.push(l[p][0]):l.name!==void 0?y.push(l.name):y.push("text"),l[h]!==v&&(v=void 0))}r.type=g(y,v,m)}else if(s.type==="splom"){var x=s.dimensions,b=x[s._axesDim[n]];b.visible&&(r.type=g(b.values,v,m))}else r.type=g(s[o]||[s[o+"0"]],v,m)}}}function A(r,i,n){for(var o=0;o<r.length;o++){var a=r[o];if(a.type==="splom"&&a._length>0&&(a["_"+n+"axes"]||{})[i]||(a[n+"axis"]||n)===i&&(e(a,n)||(a[n]||[]).length||a[n+"0"]))return a}}function t(r){return{v:"x",h:"y"}[r.orientation||"v"]}function e(r,i){var n=t(r),o=c(r,"box-violin"),a=c(r._fullInput||{},"candlestick");return o&&!a&&i===n&&r[n]===void 0&&r[n+"0"]===void 0}}),Yy=Vt((X,V)=>{var c=nf().isTypedArraySpec;function g(E,A){var t=A.dataAttr||E._id.charAt(0),e={},r,i,n;if(A.axData)r=A.axData;else for(r=[],i=0;i<A.data.length;i++){var o=A.data[i];o[t+"axis"]===E._id&&r.push(o)}for(i=0;i<r.length;i++){var a=r[i][t];for(n=0;n<a.length;n++){var s=a[n];s!=null&&(e[s]=1)}}return Object.keys(e)}V.exports=function(E,A,t,e){if(A.type==="category"){var r=E.categoryarray,i=Array.isArray(r)&&r.length>0||c(r),n;i&&(n="array");var o=t("categoryorder",n),a;o==="array"&&(a=t("categoryarray")),!i&&o==="array"&&(o=A.categoryorder="trace"),o==="trace"?A._initialCategories=[]:o==="array"?A._initialCategories=a.slice():(a=g(A,e).sort(),o==="category ascending"?A._initialCategories=a:o==="category descending"&&(A._initialCategories=a.reverse()))}}}),qm=Vt((X,V)=>{var c=yh().mix,g=Hc(),E=qr();V.exports=function(A,t,e,r){r=r||{};var i=r.dfltColor;function n(f,k){return E.coerce2(A,t,r.attributes,f,k)}var o=n("linecolor",i),a=n("linewidth"),s=e("showline",r.showLine||!!o||!!a);s||(delete t.linecolor,delete t.linewidth);var h=c(i,r.bgColor,r.blend||g.lightFraction).toRgbString(),v=n("gridcolor",h),m=n("gridwidth"),p=n("griddash"),y=e("showgrid",r.showGrid||!!v||!!m||!!p);if(y||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),r.hasMinor){var l=c(t.gridcolor,r.bgColor,67).toRgbString(),x=n("minor.gridcolor",l),b=n("minor.gridwidth",t.gridwidth||1),S=n("minor.griddash",t.griddash||"solid"),T=e("minor.showgrid",!!x||!!b||!!S);T||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!r.noZeroLine){var M=n("zerolinecolor",i),w=n("zerolinewidth"),u=e("zeroline",r.showGrid||!!M||!!w);u||(delete t.zerolinecolor,delete t.zerolinewidth)}}}),Hm=Vt((X,V)=>{var c=vo(),g=Mi(),E=qr(),A=Ns(),t=Gh(),e=Ih(),r=l0(),i=xg(),n=Ad(),o=Md(),a=Yy(),s=qm(),h=sb(),v=xp(),m=xh().WEEKDAY_PATTERN,p=xh().HOUR_PATTERN;V.exports=function(b,S,T,M,w){var u=M.letter,f=M.font||{},k=M.splomStash||{},_=T("visible",!M.visibleDflt),D=S._template||{},I=S.type||D.type||"-",O;if(I==="date"){var B=g.getComponentMethod("calendars","handleDefaults");B(b,S,"calendar",M.calendar),M.noTicklabelmode||(O=T("ticklabelmode"))}!M.noTicklabelindex&&(I==="date"||I==="linear")&&T("ticklabelindex");var R="";(!M.noTicklabelposition||I==="multicategory")&&(R=E.coerce(b,S,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:O==="period"?["outside","inside"]:u==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),M.noTicklabeloverflow||T("ticklabeloverflow",R.indexOf("inside")!==-1?"hide past domain":I==="category"||I==="multicategory"?"allow":"hide past div"),v(S,w),h(b,S,T,M),a(b,S,T,M),I!=="category"&&!M.noHover&&T("hoverformat");var L=T("color"),F=L!==e.color.dflt?L:f.color,N=k.label||w._dfltTitle[u];if(o(b,S,T,I,M),!_)return S;T("title.text",N),E.coerceFont(T,"title.font",f,{overrideDflt:{size:E.bigFont(f.size),color:F}}),r(b,S,T,I);var j=M.hasMinor;if(j&&(A.newContainer(S,"minor"),r(b,S,T,I,{isMinor:!0})),n(b,S,T,I,M),i(b,S,T,M),j){var G=M.isMinor;M.isMinor=!0,i(b,S,T,M),M.isMinor=G}s(b,S,T,{dfltColor:L,bgColor:M.bgColor,showGrid:M.showGrid,hasMinor:j,attributes:e}),j&&!S.minor.ticks&&!S.minor.showgrid&&delete S.minor,(S.showline||S.ticks)&&T("mirror");var rt=I==="multicategory";if(!M.noTickson&&(I==="category"||rt)&&(S.ticks||S.showgrid)){var ct;rt&&(ct="boundaries");var lt=T("tickson",ct);lt==="boundaries"&&delete S.ticklabelposition}if(rt){var tt=T("showdividers");tt&&(T("dividercolor"),T("dividerwidth"))}if(I==="date")if(t(b,S,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:y}),!S.rangebreaks.length)delete S.rangebreaks;else{for(var Z=0;Z<S.rangebreaks.length;Z++)if(S.rangebreaks[Z].pattern===m){S._hasDayOfWeekBreaks=!0;break}if(v(S,w),w._has("scattergl")||w._has("splom"))for(var st=0;st<M.data.length;st++){var $=M.data[st];($.type==="scattergl"||$.type==="splom")&&($.visible=!1,E.warn($.type+" traces do not work on axes with rangebreaks. Setting trace "+$.index+" to `visible: false`."))}}return S};function y(b,S,T){function M(B,R){return E.coerce(b,S,e.rangebreaks,B,R)}var w=M("enabled");if(w){var u=M("bounds");if(u&&u.length>=2){var f="",k,_;if(u.length===2){for(k=0;k<2;k++)if(_=x(u[k]),_){f=m;break}}var D=M("pattern",f);if(D===m)for(k=0;k<2;k++)_=x(u[k]),_&&(S.bounds[k]=u[k]=_-1);if(D)for(k=0;k<2;k++)switch(_=u[k],D){case m:if(!c(_)){S.enabled=!1;return}if(_=+_,_!==Math.floor(_)||_<0||_>=7){S.enabled=!1;return}S.bounds[k]=u[k]=_;break;case p:if(!c(_)){S.enabled=!1;return}if(_=+_,_<0||_>24){S.enabled=!1;return}S.bounds[k]=u[k]=_;break}if(T.autorange===!1){var I=T.range;if(I[0]<I[1]){if(u[0]<I[0]&&u[1]>I[1]){S.enabled=!1;return}}else if(u[0]>I[0]&&u[1]<I[1]){S.enabled=!1;return}}}else{var O=M("values");if(O&&O.length)M("dvalue");else{S.enabled=!1;return}}}}var l={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function x(b){if(typeof b=="string")return l[b.substr(0,3).toLowerCase()]}}),Ky=Vt((X,V)=>{var c=vo(),g=qr();V.exports=function(E,A,t,e){var r=e.counterAxes||[],i=e.overlayableAxes||[],n=e.letter,o=e.grid,a=e.overlayingDomain,s,h,v,m,p,y;o&&(h=o._domains[n][o._axisMap[A._id]],s=o._anchors[A._id],h&&(v=o[n+"side"].split(" ")[0],m=o.domain[n][v==="right"||v==="top"?1:0])),h=h||[0,1],s=s||(c(E.position)?"free":r[0]||"free"),v=v||(n==="x"?"bottom":"left"),m=m||0,p=0,y=!1;var l=g.coerce(E,A,{anchor:{valType:"enumerated",values:["free"].concat(r),dflt:s}},"anchor"),x=g.coerce(E,A,{side:{valType:"enumerated",values:n==="x"?["bottom","top"]:["left","right"],dflt:v}},"side");if(l==="free"){if(n==="y"){var b=t("autoshift");b&&(m=x==="left"?a[0]:a[1],y=A.automargin?A.automargin:!0,p=x==="left"?-3:3),t("shift",p)}t("position",m)}t("automargin",y);var S=!1;if(i.length&&(S=g.coerce(E,A,{overlaying:{valType:"enumerated",values:[!1].concat(i),dflt:!1}},"overlaying")),!S){var T=t("domain",h);T[0]>T[1]-1/4096&&(A.domain=h),g.noneOrAll(E.domain,A.domain,h),A.tickmode==="sync"&&(A.tickmode="auto")}return t("layer"),A}}),b4=Vt((X,V)=>{var c=qr(),g=vi(),E=vf().isUnifiedHover,A=db(),t=Ns(),e=mg(),r=Ih(),i=Cb(),n=Hm(),o=c0(),a=Ky(),s=rc(),h=s.id2name,v=s.name2id,m=xh().AX_ID_PATTERN,p=Mi(),y=p.traceIs,l=p.getComponentMethod;function x(b,S,T){Array.isArray(b[S])?b[S].push(T):b[S]=[T]}V.exports=function(b,S,T){var M=S.autotypenumbers,w={},u={},f={},k={},_={},D={},I={},O={},B={},R={},L,F;for(L=0;L<T.length;L++){var N=T[L];if(y(N,"cartesian")){var j;if(N.xaxis)j=h(N.xaxis),x(w,j,N);else if(N.xaxes)for(F=0;F<N.xaxes.length;F++)x(w,h(N.xaxes[F]),N);var G;if(N.yaxis)G=h(N.yaxis),x(w,G,N);else if(N.yaxes)for(F=0;F<N.yaxes.length;F++)x(w,h(N.yaxes[F]),N);if(N.type==="funnel"?N.orientation==="h"?(j&&(u[j]=!0),G&&(I[G]=!0)):G&&(f[G]=!0):N.type==="image"?(G&&(O[G]=!0),j&&(O[j]=!0)):(G&&(_[G]=!0,D[G]=!0),(!y(N,"carpet")||N.type==="carpet"&&!N._cheater)&&j&&(k[j]=!0)),N.type==="carpet"&&N._cheater&&j&&(u[j]=!0),y(N,"2dMap")&&(B[j]=!0,B[G]=!0),y(N,"oriented")){var rt=N.orientation==="h"?G:j;R[rt]=!0}}}var ct=S._subplots,lt=ct.xaxis,tt=ct.yaxis,Z=c.simpleMap(lt,h),st=c.simpleMap(tt,h),$=Z.concat(st),Q=g.background;lt.length&&tt.length&&(Q=c.coerce(b,S,e,"plot_bgcolor"));var nt=g.combine(Q,S.paper_bgcolor),Y,q,ot,it,dt;function wt(){var yt=w[Y]||[];dt._traceIndices=yt.map(function(Mt){return Mt.index}),dt._annIndices=[],dt._shapeIndices=[],dt._selectionIndices=[],dt._imgIndices=[],dt._subplotsWith=[],dt._counterAxes=[],dt._name=dt._attr=Y,dt._id=q}function xt(yt,Mt){return c.coerce(it,dt,r,yt,Mt)}function Ft(yt,Mt){return c.coerce2(it,dt,r,yt,Mt)}function Et(yt){return yt==="x"?tt:lt}function Nt(yt,Mt){for(var Ot=yt==="x"?Z:st,$t=[],ee=0;ee<Ot.length;ee++){var we=Ot[ee];we!==Mt&&!(b[we]||{}).overlaying&&$t.push(v(we))}return $t}var te={x:Et("x"),y:Et("y")},Jt=te.x.concat(te.y),Qt={},Wt=[];function gt(){var yt=it.matches;m.test(yt)&&Jt.indexOf(yt)===-1&&(Qt[yt]=it.type,Wt=Object.keys(Qt))}var bt=A(b,S),vt=E(bt);for(L=0;L<$.length;L++){Y=$[L],q=v(Y),ot=Y.charAt(0),c.isPlainObject(b[Y])||(b[Y]={}),it=b[Y],dt=t.newContainer(S,Y,ot+"axis"),wt();var Ut=ot==="x"&&!k[Y]&&u[Y]||ot==="y"&&!_[Y]&&f[Y],Kt=ot==="y"&&(!D[Y]&&I[Y]||O[Y]),Zt={hasMinor:!0,letter:ot,font:S.font,outerTicks:B[Y],showGrid:!R[Y],data:w[Y]||[],bgColor:nt,calendar:S.calendar,automargin:!0,visibleDflt:Ut,reverseDflt:Kt,autotypenumbersDflt:M,splomStash:((S._splomAxes||{})[ot]||{})[q],noAutotickangles:ot==="y"};xt("uirevision",S.uirevision),i(it,dt,xt,Zt),n(it,dt,xt,Zt,S);var le=vt&&ot===bt.charAt(0),Te=Ft("spikecolor",vt?dt.color:void 0),Se=Ft("spikethickness",vt?1.5:void 0),Fe=Ft("spikedash",vt?"dot":void 0),Oe=Ft("spikemode",vt?"across":void 0),ur=Ft("spikesnap"),fr=xt("showspikes",!!le||!!Te||!!Se||!!Fe||!!Oe||!!ur);fr||(delete dt.spikecolor,delete dt.spikethickness,delete dt.spikedash,delete dt.spikemode,delete dt.spikesnap);var We=h(it.overlaying),Lr=[0,1];if(S[We]!==void 0){var kr=h(S[We].anchor);S[kr]!==void 0&&(Lr=S[kr].domain)}a(it,dt,xt,{letter:ot,counterAxes:te[ot],overlayableAxes:Nt(ot,Y),grid:S.grid,overlayingDomain:Lr}),xt("title.standoff"),gt(),dt._input=it}for(L=0;L<Wt.length;){q=Wt[L++],Y=h(q),ot=Y.charAt(0),c.isPlainObject(b[Y])||(b[Y]={}),it=b[Y],dt=t.newContainer(S,Y,ot+"axis"),wt();var he={letter:ot,font:S.font,outerTicks:B[Y],showGrid:!R[Y],data:[],bgColor:nt,calendar:S.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:M,splomStash:((S._splomAxes||{})[ot]||{})[q]};xt("uirevision",S.uirevision),dt.type=Qt[q]||"linear",n(it,dt,xt,he,S),a(it,dt,xt,{letter:ot,counterAxes:te[ot],overlayableAxes:Nt(ot,Y),grid:S.grid}),xt("fixedrange"),gt(),dt._input=it}var Dt=l("rangeslider","handleDefaults"),qt=l("rangeselector","handleDefaults");for(L=0;L<Z.length;L++)Y=Z[L],it=b[Y],dt=S[Y],Dt(b,S,Y),dt.type==="date"&&qt(it,dt,S,st,dt.calendar),xt("fixedrange");for(L=0;L<st.length;L++){Y=st[L],it=b[Y],dt=S[Y];var zt=S[h(dt.anchor)],ut=l("rangeslider","isVisible")(zt);xt("fixedrange",ut)}o.handleDefaults(b,S,{axIds:Jt.concat(Wt).sort(s.idSort),axHasImage:O})}}),w4=Vt((X,V)=>{var c=Ai(),g=Mi(),E=qr(),A=go(),t=ao();V.exports=function(e,r,i,n){var o=e._fullLayout;if(r.length===0){t.redrawComponents(e);return}function a(S){var T=S.xaxis,M=S.yaxis;o._defs.select("#"+S.clipId+"> rect").call(A.setTranslate,0,0).call(A.setScale,1,1),S.plot.call(A.setTranslate,T._offset,M._offset).call(A.setScale,1,1);var w=S.plot.selectAll(".scatterlayer .trace");w.selectAll(".point").call(A.setPointGroupScale,1,1),w.selectAll(".textpoint").call(A.setTextPointsScale,1,1),w.call(A.hideOutsideRangePoints,S)}function s(S,T){var M=S.plotinfo,w=M.xaxis,u=M.yaxis,f=w._length,k=u._length,_=!!S.xr1,D=!!S.yr1,I=[];if(_){var O=E.simpleMap(S.xr0,w.r2l),B=E.simpleMap(S.xr1,w.r2l),R=O[1]-O[0],L=B[1]-B[0];I[0]=(O[0]*(1-T)+T*B[0]-O[0])/(O[1]-O[0])*f,I[2]=f*(1-T+T*L/R),w.range[0]=w.l2r(O[0]*(1-T)+T*B[0]),w.range[1]=w.l2r(O[1]*(1-T)+T*B[1])}else I[0]=0,I[2]=f;if(D){var F=E.simpleMap(S.yr0,u.r2l),N=E.simpleMap(S.yr1,u.r2l),j=F[1]-F[0],G=N[1]-N[0];I[1]=(F[1]*(1-T)+T*N[1]-F[1])/(F[0]-F[1])*k,I[3]=k*(1-T+T*G/j),u.range[0]=w.l2r(F[0]*(1-T)+T*N[0]),u.range[1]=u.l2r(F[1]*(1-T)+T*N[1])}else I[1]=0,I[3]=k;t.drawOne(e,w,{skipTitle:!0}),t.drawOne(e,u,{skipTitle:!0}),t.redrawComponents(e,[w._id,u._id]);var rt=_?f/I[2]:1,ct=D?k/I[3]:1,lt=_?I[0]:0,tt=D?I[1]:0,Z=_?I[0]/I[2]*f:0,st=D?I[1]/I[3]*k:0,$=w._offset-Z,Q=u._offset-st;M.clipRect.call(A.setTranslate,lt,tt).call(A.setScale,1/rt,1/ct),M.plot.call(A.setTranslate,$,Q).call(A.setScale,rt,ct),A.setPointGroupScale(M.zoomScalePts,1/rt,1/ct),A.setTextPointsScale(M.zoomScaleTxt,1/rt,1/ct)}var h;n&&(h=n());function v(){for(var S={},T=0;T<r.length;T++){var M=r[T],w=M.plotinfo.xaxis,u=M.plotinfo.yaxis;M.xr1&&(S[w._name+".range"]=M.xr1.slice()),M.yr1&&(S[u._name+".range"]=M.yr1.slice())}return h&&h(),g.call("relayout",e,S).then(function(){for(var f=0;f<r.length;f++)a(r[f].plotinfo)})}function m(){for(var S={},T=0;T<r.length;T++){var M=r[T],w=M.plotinfo.xaxis,u=M.plotinfo.yaxis;M.xr0&&(S[w._name+".range"]=M.xr0.slice()),M.yr0&&(S[u._name+".range"]=M.yr0.slice())}return g.call("relayout",e,S).then(function(){for(var f=0;f<r.length;f++)a(r[f].plotinfo)})}var p,y,l,x=c.ease(i.easing);e._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(l),l=null,m()});function b(){y=Date.now();for(var S=Math.min(1,(y-p)/i.duration),T=x(S),M=0;M<r.length;M++)s(r[M],T);y-p>i.duration?(v(),l=window.cancelAnimationFrame(b)):l=window.requestAnimationFrame(b)}return p=Date.now(),l=window.requestAnimationFrame(b),Promise.resolve()}}),Pc=Vt(X=>{var V=Ai(),c=Mi(),g=qr(),E=fu(),A=go(),t=Ph().getModuleCalcData,e=rc(),r=xh(),i=Cf(),n=g.ensureSingle;function o(y,l,x){return g.ensureSingle(y,l,x,function(b){b.datum(x)})}var a=r.zindexSeparator;X.name="cartesian",X.attr=["xaxis","yaxis"],X.idRoot=["x","y"],X.idRegex=r.idRegex,X.attrRegex=r.attrRegex,X.attributes=_4(),X.layoutAttributes=Ih(),X.supplyLayoutDefaults=b4(),X.transitionAxes=w4(),X.finalizeSubplots=function(y,l){var x=l._subplots,b=x.xaxis,S=x.yaxis,T=x.cartesian,M=T,w={},u={},f,k,_;for(f=0;f<M.length;f++){var D=M[f].split("y");w[D[0]]=1,u["y"+D[1]]=1}for(f=0;f<b.length;f++)k=b[f],w[k]||(_=(y[e.id2name(k)]||{}).anchor,r.idRegex.y.test(_)||(_="y"),T.push(k+_),M.push(k+_),u[_]||(u[_]=1,g.pushUnique(S,_)));for(f=0;f<S.length;f++)_=S[f],u[_]||(k=(y[e.id2name(_)]||{}).anchor,r.idRegex.x.test(k)||(k="x"),T.push(k+_),M.push(k+_),w[k]||(w[k]=1,g.pushUnique(b,k)));if(!M.length){k="",_="";for(var I in y)if(r.attrRegex.test(I)){var O=I.charAt(0);O==="x"?(!k||+I.substr(5)<+k.substr(5))&&(k=I):(!_||+I.substr(5)<+_.substr(5))&&(_=I)}k=k?e.name2id(k):"x",_=_?e.name2id(_):"y",b.push(k),S.push(_),T.push(k+_)}},X.plot=function(y,l,x,b){var S=y._fullLayout,T=S._subplots.cartesian,M=y.calcdata,w;if(!Array.isArray(l))for(l=[],w=0;w<M.length;w++)l.push(w);for(var u=S._zindices,f=0;f<u.length;f++){var k=u[f];for(w=0;w<T.length;w++){var _=T[w],D=S._plots[_];if(f>0){var I=D.id;if(I.indexOf(a)!==-1)continue;I+=a+(f+1),D=g.extendFlat({},D,{id:I,plot:S._cartesianlayer.selectAll(".subplot").select("."+I)})}for(var O=[],B,R=0;R<M.length;R++){var L=M[R],F=L[0].trace;k===(F.zorder||0)&&F.xaxis+F.yaxis===_&&((l.indexOf(F.index)!==-1||F.carpet)&&(B&&B[0].trace.xaxis+B[0].trace.yaxis===_&&["tonextx","tonexty","tonext"].indexOf(F.fill)!==-1&&O.indexOf(B)===-1&&O.push(B),O.push(L)),B=L)}s(y,D,O,x,b)}}};function s(y,l,x,b,S){for(var T=r.traceLayerClasses,M=y._fullLayout,w=M._zindices,u=M._modules,f,k,_,D=[],I=[],O=0;O<w.length;O++)for(var B=w[O],R=0;R<u.length;R++){f=u[R];var L=f.name,F=c.modules[L].categories;if(F.svg){var N=f.layerName||L+"layer",j=N+(O?Number(O)+1:""),G=f.plot;k=t(x,G,B),_=k[0],x=k[1],_.length&&D.push({i:T.indexOf(N),zindex:O,className:j,plotMethod:G,cdModule:_}),F.zoomScale&&I.push("."+j)}}D.sort(function(lt,tt){return(lt.zindex||0)-(tt.zindex||0)||lt.i-tt.i});var rt=l.plot.selectAll("g.mlayer").data(D,function(lt){return lt.className});if(rt.enter().append("g").attr("class",function(lt){return lt.className}).classed("mlayer",!0).classed("rangeplot",l.isRangePlot),rt.exit().remove(),rt.order(),rt.each(function(lt){var tt=V.select(this),Z=lt.className;lt.plotMethod(y,l,lt.cdModule,tt,b,S),r.clipOnAxisFalseQuery.indexOf("."+Z)===-1&&A.setClipUrl(tt,l.layerClipId,y)}),M._has("scattergl")&&(f=c.getModule("scattergl"),_=t(x,f)[0],f.plot(y,l,_)),!y._context.staticPlot&&(l._hasClipOnAxisFalse&&(l.clipOnAxisFalseTraces=l.plot.selectAll(r.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),I.length)){var ct=l.plot.selectAll(I.join(",")).selectAll(".trace");l.zoomScalePts=ct.selectAll("path.point"),l.zoomScaleTxt=ct.selectAll(".textpoint")}}X.clean=function(y,l,x,b){var S=b._plots||{},T=l._plots||{},M=b._subplots||{},w,u,f;if(b._hasOnlyLargeSploms&&!l._hasOnlyLargeSploms)for(f in S)w=S[f],w.plotgroup&&w.plotgroup.remove();var k=b._has&&b._has("gl"),_=l._has&&l._has("gl");if(k&&!_)for(f in S)w=S[f],w._scene&&w._scene.destroy();if(M.xaxis&&M.yaxis){var D=e.listIds({_fullLayout:b});for(u=0;u<D.length;u++){var I=D[u];l[e.id2name(I)]||b._infolayer.selectAll(".g-"+I+"title").remove()}}var O=b._has&&b._has("cartesian"),B=l._has&&l._has("cartesian");if(O&&!B)m(b._cartesianlayer.selectAll(".subplot"),b),b._defs.selectAll(".axesclip").remove(),delete b._axisConstraintGroups,delete b._axisMatchGroups;else if(M.cartesian)for(u=0;u<M.cartesian.length;u++){var R=M.cartesian[u];if(R.indexOf(a)===-1&&!T[R]){var L="."+R+",."+R+"-x,."+R+"-y";b._cartesianlayer.selectAll(L).remove(),p(R,b)}}},X.drawFramework=function(y){var l=y._fullLayout,x=y.calcdata,b,S={};for(b=0;b<x.length;b++){var T=x[b][0],M=T.trace,w=M.zorder||0;S[w]||(S[w]=[]),S[w].push(T)}var u=Object.keys(S).map(Number).sort(g.sorterAsc);u.length||(u=[0]),l._zindices=u;var f=h(y),k=f.length,_=[];for(b=0;b<k;b++)_[b]=f[b].slice();for(var D=1;D<u.length;D++){var I=[];for(b=0;b<k;b++)I[b]=f[b].slice(),I[b][0]+=a+(D+1);_=_.concat(I)}var O=l._cartesianlayer.selectAll(".subplot").data(_,String);O.enter().append("g").attr("class",function(B){return"subplot "+B[0]}),O.order(),O.exit().call(m,l),O.each(function(B){var R=B[0],L=R.indexOf(a),F=L!==-1,N=F?R.slice(0,L):R,j=l._plots[R];j||(j=g.extendFlat({},l._plots[N]),j&&(j.id=R,l._plots[R]=j,l._subplots.cartesian.push(R))),j&&(j.plotgroup=V.select(this),v(y,j),F||(j.draglayer=n(l._draggers,"g",R)))})},X.rangePlot=function(y,l,x){v(y,l),s(y,l,x),E.style(y)};function h(y){var l=y._fullLayout,x=l._zindices.length,b=l._subplots.cartesian,S=b.length,T,M,w,u,f,k,_=[],D=[];for(T=0;T<S;T++){w=b[T],u=l._plots[w],f=u.xaxis,k=u.yaxis;var I=f._mainAxis,O=k._mainAxis,B=I._id+O._id,R=l._plots[B];u.overlays=[],B!==w&&R?(u.mainplot=B,u.mainplotinfo=R,D.push(w)):(u.mainplot=void 0,u.mainplotinfo=void 0,_.push(w))}for(T=0;T<D.length;T++)w=D[T],u=l._plots[w],u.mainplotinfo.overlays.push(u);var L=_.concat(D),F=[];for(T=0;T<S;T++){w=L[T],u=l._plots[w],f=u.xaxis,k=u.yaxis;for(var N=[],j=1;j<=x;j++){var G="";for(j>1&&(G+=a+j),N.push(w+G),M=0;M<u.overlays.length;M++)N.push(u.overlays[M].id+G)}N=N.concat([f.layer,k.layer,f.overlaying||"",k.overlaying||""]),F.push(N)}return F}function v(y,l){var x=y._fullLayout,b=l.plotgroup,S=l.id,T=S.indexOf(a),M=T!==-1,w=r.layerValue2layerClass[l.xaxis.layer],u=r.layerValue2layerClass[l.yaxis.layer],f=x._hasOnlyLargeSploms,k=x._zindices.length>1,_=l.mainplotinfo;if(!l.mainplot||k)if(f)l.xlines=n(b,"path","xlines-above"),l.ylines=n(b,"path","ylines-above"),l.xaxislayer=n(b,"g","xaxislayer-above"),l.yaxislayer=n(b,"g","yaxislayer-above");else{if(!M){var D=n(b,"g","layer-subplot");l.shapelayer=n(D,"g","shapelayer"),l.imagelayer=n(D,"g","imagelayer"),_&&k?(l.minorGridlayer=_.minorGridlayer,l.gridlayer=_.gridlayer,l.zerolinelayer=_.zerolinelayer):(l.minorGridlayer=n(b,"g","minor-gridlayer"),l.gridlayer=n(b,"g","gridlayer"),l.zerolinelayer=n(b,"g","zerolinelayer"));var I=n(b,"g","layer-between");l.shapelayerBetween=n(I,"g","shapelayer"),l.imagelayerBetween=n(I,"g","imagelayer"),n(b,"path","xlines-below"),n(b,"path","ylines-below"),l.overlinesBelow=n(b,"g","overlines-below"),n(b,"g","xaxislayer-below"),n(b,"g","yaxislayer-below"),l.overaxesBelow=n(b,"g","overaxes-below")}l.overplot=n(b,"g","overplot"),l.plot=n(l.overplot,"g",S),M||(l.xlines=n(b,"path","xlines-above"),l.ylines=n(b,"path","ylines-above"),l.overlinesAbove=n(b,"g","overlines-above"),n(b,"g","xaxislayer-above"),n(b,"g","yaxislayer-above"),l.overaxesAbove=n(b,"g","overaxes-above"),l.xlines=b.select(".xlines-"+w),l.ylines=b.select(".ylines-"+u),l.xaxislayer=b.select(".xaxislayer-"+w),l.yaxislayer=b.select(".yaxislayer-"+u))}else{var O=_.plotgroup,B=S+"-x",R=S+"-y";l.minorGridlayer=_.minorGridlayer,l.gridlayer=_.gridlayer,l.zerolinelayer=_.zerolinelayer,n(_.overlinesBelow,"path",B),n(_.overlinesBelow,"path",R),n(_.overaxesBelow,"g",B),n(_.overaxesBelow,"g",R),l.plot=n(_.overplot,"g",S),n(_.overlinesAbove,"path",B),n(_.overlinesAbove,"path",R),n(_.overaxesAbove,"g",B),n(_.overaxesAbove,"g",R),l.xlines=O.select(".overlines-"+w).select("."+B),l.ylines=O.select(".overlines-"+u).select("."+R),l.xaxislayer=O.select(".overaxes-"+w).select("."+B),l.yaxislayer=O.select(".overaxes-"+u).select("."+R)}M||(f||(o(l.minorGridlayer,"g",l.xaxis._id),o(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(L){return L[0]}).sort(e.idSort),o(l.gridlayer,"g",l.xaxis._id),o(l.gridlayer,"g",l.yaxis._id),l.gridlayer.selectAll("g").map(function(L){return L[0]}).sort(e.idSort)),l.xlines.style("fill","none").classed("crisp",!0),l.ylines.style("fill","none").classed("crisp",!0))}function m(y,l){if(y){var x={};y.each(function(u){var f=u[0],k=V.select(this);k.remove(),p(f,l),x[f]=!0});for(var b in l._plots)for(var S=l._plots[b],T=S.overlays||[],M=0;M<T.length;M++){var w=T[M];x[w.id]&&w.plot.selectAll(".trace").remove()}}}function p(y,l){l._draggers.selectAll("g."+y).remove(),l._defs.select("#clip"+l._uid+y+"plot").remove()}X.toSVG=function(y){var l=y._fullLayout._glimages,x=V.select(y).selectAll(".svg-container"),b=x.filter(function(T,M){return M===x.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function S(){var T=this,M=T.toDataURL("image/png"),w=l.append("svg:image");w.attr({xmlns:i.svg,"xlink:href":M,preserveAspectRatio:"none",x:0,y:0,width:T.style.width,height:T.style.height})}b.each(S)},X.updateFx=Mb().updateFx}),T4=Vt((X,V)=>{var c=Sl();V.exports={hasLines:c.hasLines,hasMarkers:c.hasMarkers,hasText:c.hasText,isBubble:c.isBubble,attributes:Gu(),layoutAttributes:Ry(),supplyDefaults:m4(),crossTraceDefaults:Pb(),supplyLayoutDefaults:v4(),calc:Hf().calc,crossTraceCalc:x4(),arraysToCalcdata:bp(),plot:Ag(),colorbar:Wh(),formatLabels:Qy(),style:yf().style,styleOnSelect:yf().styleOnSelect,hoverPoints:Sg(),selectPoints:Eg(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Pc(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}),k4=Vt((X,V)=>{var c=Ai(),g=vi(),E=Tb(),A=qr(),t=A.strScale,e=A.strRotate,r=A.strTranslate;V.exports=function(i,n,o){var a=i.node(),s=E[o.arrowhead||0],h=E[o.startarrowhead||0],v=(o.arrowwidth||1)*(o.arrowsize||1),m=(o.arrowwidth||1)*(o.startarrowsize||1),p=n.indexOf("start")>=0,y=n.indexOf("end")>=0,l=s.backoff*v+o.standoff,x=h.backoff*m+o.startstandoff,b,S,T,M;if(a.nodeName==="line"){b={x:+i.attr("x1"),y:+i.attr("y1")},S={x:+i.attr("x2"),y:+i.attr("y2")};var w=b.x-S.x,u=b.y-S.y;if(T=Math.atan2(u,w),M=T+Math.PI,l&&x&&l+x>Math.sqrt(w*w+u*u)){j();return}if(l){if(l*l>w*w+u*u){j();return}var f=l*Math.cos(T),k=l*Math.sin(T);S.x+=f,S.y+=k,i.attr({x2:S.x,y2:S.y})}if(x){if(x*x>w*w+u*u){j();return}var _=x*Math.cos(T),D=x*Math.sin(T);b.x-=_,b.y-=D,i.attr({x1:b.x,y1:b.y})}}else if(a.nodeName==="path"){var I=a.getTotalLength(),O="";if(I<l+x){j();return}var B=a.getPointAtLength(0),R=a.getPointAtLength(.1);T=Math.atan2(B.y-R.y,B.x-R.x),b=a.getPointAtLength(Math.min(x,I)),O="0px,"+x+"px,";var L=a.getPointAtLength(I),F=a.getPointAtLength(I-.1);M=Math.atan2(L.y-F.y,L.x-F.x),S=a.getPointAtLength(Math.max(0,I-l));var N=O?x+l:l;O+=I-N+"px,"+I+"px",i.style("stroke-dasharray",O)}function j(){i.style("stroke-dasharray","0px,100px")}function G(rt,ct,lt,tt){rt.path&&(rt.noRotate&&(lt=0),c.select(a.parentNode).append("path").attr({class:i.attr("class"),d:rt.path,transform:r(ct.x,ct.y)+e(lt*180/Math.PI)+t(tt)}).style({fill:g.rgb(o.arrowcolor),"stroke-width":0}))}p&&G(h,b,T,m),y&&G(s,S,M,v)}}),t1=Vt((X,V)=>{var c=Ai(),g=Mi(),E=fu(),A=qr(),t=A.strTranslate,e=ao(),r=vi(),i=go(),n=Hu(),o=sl(),a=tp(),s=af(),h=Ns().arrayEditor,v=k4();V.exports={draw:m,drawOne:p,drawRaw:l};function m(x){var b=x._fullLayout;b._infolayer.selectAll(".annotation").remove();for(var S=0;S<b.annotations.length;S++)b.annotations[S].visible&&p(x,S);return E.previousPromises(x)}function p(x,b){var S=x._fullLayout,T=S.annotations[b]||{},M=e.getFromId(x,T.xref),w=e.getFromId(x,T.yref);M&&M.setScale(),w&&w.setScale(),l(x,T,b,!1,M,w)}function y(x,b,S,T,M){var w=M[S],u=M[S+"ref"],f=S.indexOf("y")!==-1,k=e.getRefType(u)==="domain",_=f?T.h:T.w;return x?k?w+(f?-b:b)/x._length:x.p2r(x.r2p(w)+b):w+(f?-b:b)/_}function l(x,b,S,T,M,w){var u=x._fullLayout,f=x._fullLayout._size,k=x._context.edits,_,D;T?(_="annotation-"+T,D=T+".annotations"):(_="annotation",D="annotations");var I=h(x.layout,D,b),O=I.modifyBase,B=I.modifyItem,R=I.getUpdateObj;u._infolayer.selectAll("."+_+'[data-index="'+S+'"]').remove();var L="clip"+u._uid+"_ann"+S;if(!b._input||b.visible===!1){c.selectAll("#"+L).remove();return}var F={x:{},y:{}},N=+b.textangle||0,j=u._infolayer.append("g").classed(_,!0).attr("data-index",String(S)).style("opacity",b.opacity),G=j.append("g").classed("annotation-text-g",!0),rt=k[b.showarrow?"annotationTail":"annotationPosition"],ct=b.captureevents||k.annotationText||rt;function lt(xt){var Ft={index:S,annotation:b._input,fullAnnotation:b,event:xt};return T&&(Ft.subplotId=T),Ft}var tt=G.append("g").style("pointer-events",ct?"all":null).call(a,"pointer").on("click",function(){x._dragging=!1,x.emit("plotly_clickannotation",lt(c.event))});b.hovertext&&tt.on("mouseover",function(){var xt=b.hoverlabel,Ft=xt.font,Et=this.getBoundingClientRect(),Nt=x.getBoundingClientRect();n.loneHover({x0:Et.left-Nt.left,x1:Et.right-Nt.left,y:(Et.top+Et.bottom)/2-Nt.top,text:b.hovertext,color:xt.bgcolor,borderColor:xt.bordercolor,fontFamily:Ft.family,fontSize:Ft.size,fontColor:Ft.color,fontWeight:Ft.weight,fontStyle:Ft.style,fontVariant:Ft.variant,fontShadow:Ft.fontShadow,fontLineposition:Ft.fontLineposition,fontTextcase:Ft.fontTextcase},{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:x})}).on("mouseout",function(){n.loneUnhover(u._hoverlayer.node())});var Z=b.borderwidth,st=b.borderpad,$=Z+st,Q=tt.append("rect").attr("class","bg").style("stroke-width",Z+"px").call(r.stroke,b.bordercolor).call(r.fill,b.bgcolor),nt=b.width||b.height,Y=u._topclips.selectAll("#"+L).data(nt?[0]:[]);Y.enter().append("clipPath").classed("annclip",!0).attr("id",L).append("rect"),Y.exit().remove();var q=b.font,ot=u._meta?A.templateString(b.text,u._meta):b.text,it=tt.append("text").classed("annotation-text",!0).text(ot);function dt(xt){return xt.call(i.font,q).attr({"text-anchor":{left:"start",right:"end"}[b.align]||"middle"}),o.convertToTspans(xt,x,wt),xt}function wt(){var xt=it.selectAll("a");if(xt.size()===1&&xt.text()===it.text()){var Ft=tt.insert("a",":first-child").attr({"xlink:xlink:href":xt.attr("xlink:href"),"xlink:xlink:show":xt.attr("xlink:show")}).style({cursor:"pointer"});Ft.node().appendChild(Q.node())}var Et=tt.select(".annotation-text-math-group"),Nt=!Et.empty(),te=i.bBox((Nt?Et:it).node()),Jt=te.width,Qt=te.height,Wt=b.width||Jt,gt=b.height||Qt,bt=Math.round(Wt+2*$),vt=Math.round(gt+2*$);function Ut(An,pn){return pn==="auto"&&(An<1/3?pn="left":An>2/3?pn="right":pn="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[pn]}for(var Kt=!1,Zt=["x","y"],le=0;le<Zt.length;le++){var Te=Zt[le],Se=b[Te+"ref"]||Te,Fe=b["a"+Te+"ref"],Oe={x:M,y:w}[Te],ur=(N+(Te==="x"?0:-90))*Math.PI/180,fr=bt*Math.cos(ur),We=vt*Math.sin(ur),Lr=Math.abs(fr)+Math.abs(We),kr=b[Te+"anchor"],he=b[Te+"shift"]*(Te==="x"?1:-1),Dt=F[Te],qt,zt,ut,yt,Mt,Ot=e.getRefType(Se);if(Oe&&Ot!=="domain"){var $t=Oe.r2fraction(b[Te]);($t<0||$t>1)&&(Fe===Se?($t=Oe.r2fraction(b["a"+Te]),($t<0||$t>1)&&(Kt=!0)):Kt=!0),qt=Oe._offset+Oe.r2p(b[Te]),yt=.5}else{var ee=Ot==="domain";Te==="x"?(ut=b[Te],qt=ee?Oe._offset+Oe._length*ut:qt=f.l+f.w*ut):(ut=1-b[Te],qt=ee?Oe._offset+Oe._length*ut:qt=f.t+f.h*ut),yt=b.showarrow?.5:ut}if(b.showarrow){Dt.head=qt;var we=b["a"+Te];if(Mt=fr*Ut(.5,b.xanchor)-We*Ut(.5,b.yanchor),Fe===Se){var Me=e.getRefType(Fe);Me==="domain"?(Te==="y"&&(we=1-we),Dt.tail=Oe._offset+Oe._length*we):Me==="paper"?Te==="y"?(we=1-we,Dt.tail=f.t+f.h*we):Dt.tail=f.l+f.w*we:Dt.tail=Oe._offset+Oe.r2p(we),zt=Mt}else Dt.tail=qt+we,zt=Mt+we;Dt.text=Dt.tail+Mt;var Re=u[Te==="x"?"width":"height"];if(Se==="paper"&&(Dt.head=A.constrain(Dt.head,1,Re-1)),Fe==="pixel"){var Be=-Math.max(Dt.tail-3,Dt.text),Ze=Math.min(Dt.tail+3,Dt.text)-Re;Be>0?(Dt.tail+=Be,Dt.text+=Be):Ze>0&&(Dt.tail-=Ze,Dt.text-=Ze)}Dt.tail+=he,Dt.head+=he}else Mt=Lr*Ut(yt,kr),zt=Mt,Dt.text=qt+Mt;Dt.text+=he,Mt+=he,zt+=he,b["_"+Te+"padplus"]=Lr/2+zt,b["_"+Te+"padminus"]=Lr/2-zt,b["_"+Te+"size"]=Lr,b["_"+Te+"shift"]=Mt}if(Kt){tt.remove();return}var Ue=0,mr=0;if(b.align!=="left"&&(Ue=(Wt-Jt)*(b.align==="center"?.5:1)),b.valign!=="top"&&(mr=(gt-Qt)*(b.valign==="middle"?.5:1)),Nt)Et.select("svg").attr({x:$+Ue-1,y:$+mr}).call(i.setClipUrl,nt?L:null,x);else{var ln=$+mr-te.top,an=$+Ue-te.left;it.call(o.positionText,an,ln).call(i.setClipUrl,nt?L:null,x)}Y.select("rect").call(i.setRect,$,$,Wt,gt),Q.call(i.setRect,Z/2,Z/2,bt-Z,vt-Z),tt.call(i.setTranslate,Math.round(F.x.text-bt/2),Math.round(F.y.text-vt/2)),G.attr({transform:"rotate("+N+","+F.x.text+","+F.y.text+")"});var vn=function(An,pn){j.selectAll(".annotation-arrow-g").remove();var On=F.x.head,Nn=F.y.head,ke=F.x.tail+An,ze=F.y.tail+pn,je=F.x.text+An,Ne=F.y.text+pn,_r=A.rotationXYMatrix(N,je,Ne),Xr=A.apply2DTransform(_r),rn=A.apply2DTransform2(_r),Br=+Q.attr("width"),_n=+Q.attr("height"),bn=je-.5*Br,Fn=bn+Br,on=Ne-.5*_n,Bn=on+_n,ue=[[bn,on,bn,Bn],[bn,Bn,Fn,Bn],[Fn,Bn,Fn,on],[Fn,on,bn,on]].map(rn);if(!ue.reduce(function(_e,Je){return _e^!!A.segmentsIntersect(On,Nn,On+1e6,Nn+1e6,Je[0],Je[1],Je[2],Je[3])},!1)){ue.forEach(function(_e){var Je=A.segmentsIntersect(ke,ze,On,Nn,_e[0],_e[1],_e[2],_e[3]);Je&&(ke=Je.x,ze=Je.y)});var xe=b.arrowwidth,Pr=b.arrowcolor,Sr=b.arrowside,gr=j.append("g").style({opacity:r.opacity(Pr)}).classed("annotation-arrow-g",!0),dr=gr.append("path").attr("d","M"+ke+","+ze+"L"+On+","+Nn).style("stroke-width",xe+"px").call(r.stroke,r.rgb(Pr));if(v(dr,Sr,b),k.annotationPosition&&dr.node().parentNode&&!T){var Er=On,Dr=Nn;if(b.standoff){var Ar=Math.sqrt(Math.pow(On-ke,2)+Math.pow(Nn-ze,2));Er+=b.standoff*(ke-On)/Ar,Dr+=b.standoff*(ze-Nn)/Ar}var Gr=gr.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(ke-Er)+","+(ze-Dr),transform:t(Er,Dr)}).style("stroke-width",xe+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),Wr,Jr;s.init({element:Gr.node(),gd:x,prepFn:function(){var _e=i.getTranslate(tt);Wr=_e.x,Jr=_e.y,M&&M.autorange&&O(M._name+".autorange",!0),w&&w.autorange&&O(w._name+".autorange",!0)},moveFn:function(_e,Je){var yr=Xr(Wr,Jr),Hr=yr[0]+_e,hn=yr[1]+Je;tt.call(i.setTranslate,Hr,hn),B("x",y(M,_e,"x",f,b)),B("y",y(w,Je,"y",f,b)),b.axref===b.xref&&B("ax",y(M,_e,"ax",f,b)),b.ayref===b.yref&&B("ay",y(w,Je,"ay",f,b)),gr.attr("transform",t(_e,Je)),G.attr({transform:"rotate("+N+","+Hr+","+hn+")"})},doneFn:function(){g.call("_guiRelayout",x,R());var _e=document.querySelector(".js-notes-box-panel");_e&&_e.redraw(_e.selectedObj)}})}}};if(b.showarrow&&vn(0,0),rt){var Sn;s.init({element:tt.node(),gd:x,prepFn:function(){Sn=G.attr("transform")},moveFn:function(An,pn){var On="pointer";if(b.showarrow)b.axref===b.xref?B("ax",y(M,An,"ax",f,b)):B("ax",b.ax+An),b.ayref===b.yref?B("ay",y(w,pn,"ay",f.w,b)):B("ay",b.ay+pn),vn(An,pn);else{if(T)return;var Nn,ke;if(M)Nn=y(M,An,"x",f,b);else{var ze=b._xsize/f.w,je=b.x+(b._xshift-b.xshift)/f.w-ze/2;Nn=s.align(je+An/f.w,ze,0,1,b.xanchor)}if(w)ke=y(w,pn,"y",f,b);else{var Ne=b._ysize/f.h,_r=b.y-(b._yshift+b.yshift)/f.h-Ne/2;ke=s.align(_r-pn/f.h,Ne,0,1,b.yanchor)}B("x",Nn),B("y",ke),(!M||!w)&&(On=s.getCursor(M?.5:Nn,w?.5:ke,b.xanchor,b.yanchor))}G.attr({transform:t(An,pn)+Sn}),a(tt,On)},clickFn:function(An,pn){b.captureevents&&x.emit("plotly_clickannotation",lt(pn))},doneFn:function(){a(tt),g.call("_guiRelayout",x,R());var An=document.querySelector(".js-notes-box-panel");An&&An.redraw(An.selectedObj)}})}}k.annotationText?it.call(o.makeEditable,{delegate:tt,gd:x}).call(dt).on("edit",function(xt){b.text=xt,this.call(dt),B("text",xt),M&&M.autorange&&O(M._name+".autorange",!0),w&&w.autorange&&O(w._name+".autorange",!0),g.call("_guiRelayout",x,R())}):it.call(dt)}}),A4=Vt((X,V)=>{var c=qr(),g=Mi(),E=Ns().arrayEditor;V.exports={hasClickToShow:A,onClick:t};function A(i,n){var o=e(i,n);return o.on.length>0||o.explicitOff.length>0}function t(i,n){var o=e(i,n),a=o.on,s=o.off.concat(o.explicitOff),h={},v=i._fullLayout.annotations,m,p;if(a.length||s.length){for(m=0;m<a.length;m++)p=E(i.layout,"annotations",v[a[m]]),p.modifyItem("visible",!0),c.extendFlat(h,p.getUpdateObj());for(m=0;m<s.length;m++)p=E(i.layout,"annotations",v[s[m]]),p.modifyItem("visible",!1),c.extendFlat(h,p.getUpdateObj());return g.call("update",i,{},h)}}function e(i,n){var o=i._fullLayout.annotations,a=[],s=[],h=[],v=(n||[]).length,m,p,y,l,x,b,S,T;for(m=0;m<o.length;m++)if(y=o[m],l=y.clicktoshow,l){for(p=0;p<v;p++)if(x=n[p],b=x.xaxis,S=x.yaxis,b._id===y.xref&&S._id===y.yref&&b.d2r(x.x)===r(y._xclick,b)&&S.d2r(x.y)===r(y._yclick,S)){y.visible?l==="onout"?T=s:T=h:T=a,T.push(m);break}p===v&&y.visible&&l==="onout"&&s.push(m)}return{on:a,off:s,explicitOff:h}}function r(i,n){return n.type==="log"?n.l2r(i):n.d2r(i)}}),Db=Vt((X,V)=>{var c=qr(),g=vi();V.exports=function(E,A,t,e){e("opacity");var r=e("bgcolor"),i=e("bordercolor"),n=g.opacity(i);e("borderpad");var o=e("borderwidth"),a=e("showarrow");e("text",a?" ":t._dfltTitle.annotation),e("textangle"),c.coerceFont(e,"font",t.font),e("width"),e("align");var s=e("height");if(s&&e("valign"),a){var h=e("arrowside"),v,m;h.indexOf("end")!==-1&&(v=e("arrowhead"),m=e("arrowsize")),h.indexOf("start")!==-1&&(e("startarrowhead",v),e("startarrowsize",m)),e("arrowcolor",n?A.bordercolor:g.defaultLine),e("arrowwidth",(n&&o||1)*2),e("standoff"),e("startstandoff")}var p=e("hovertext"),y=t.hoverlabel||{};if(p){var l=e("hoverlabel.bgcolor",y.bgcolor||(g.opacity(r)?g.rgb(r):g.defaultLine)),x=e("hoverlabel.bordercolor",y.bordercolor||g.contrast(l)),b=c.extendFlat({},y.font);b.color||(b.color=x),c.coerceFont(e,"hoverlabel.font",b)}e("captureevents",!!p)}}),M4=Vt((X,V)=>{var c=qr(),g=ao(),E=Gh(),A=Db(),t=h0();V.exports=function(r,i){E(r,i,{name:"annotations",handleItemDefaults:e})};function e(r,i,n){function o(f,k){return c.coerce(r,i,t,f,k)}var a=o("visible"),s=o("clicktoshow");if(a||s){A(r,i,n,o);for(var h=i.showarrow,v=["x","y"],m=[-10,-30],p={_fullLayout:n},y=0;y<2;y++){var l=v[y],x=g.coerceRef(r,i,p,l,"","paper");if(x!=="paper"){var b=g.getFromId(p,x);b._annIndices.push(i._index)}if(g.coercePosition(i,p,o,x,l,.5),h){var S="a"+l,T=g.coerceRef(r,i,p,S,"pixel",["pixel","paper"]);T!=="pixel"&&T!==x&&(T=i[S]="pixel");var M=T==="pixel"?m[y]:.4;g.coercePosition(i,p,o,T,S,M)}o(l+"anchor"),o(l+"shift")}if(c.noneOrAll(r,i,["x","y"]),h&&c.noneOrAll(r,i,["ax","ay"]),s){var w=o("xclick"),u=o("yclick");i._xclick=w===void 0?i.x:g.cleanPosition(w,p,i.xref),i._yclick=u===void 0?i.y:g.cleanPosition(u,p,i.yref)}}}}),S4=Vt((X,V)=>{var c=qr(),g=ao(),E=t1().draw;V.exports=function(e){var r=e._fullLayout,i=c.filterVisible(r.annotations);if(i.length&&e._fullData.length)return c.syncOrAsync([E,A],e)};function A(e){var r=e._fullLayout;c.filterVisible(r.annotations).forEach(function(i){var n=g.getFromId(e,i.xref),o=g.getFromId(e,i.yref),a=g.getRefType(i.xref),s=g.getRefType(i.yref);i._extremes={},a==="range"&&t(i,n),s==="range"&&t(i,o)})}function t(e,r){var i=r._id,n=i.charAt(0),o=e[n],a=e["a"+n],s=e[n+"ref"],h=e["a"+n+"ref"],v=e["_"+n+"padplus"],m=e["_"+n+"padminus"],p={x:1,y:-1}[n]*e[n+"shift"],y=3*e.arrowsize*e.arrowwidth||0,l=y+p,x=y-p,b=3*e.startarrowsize*e.arrowwidth||0,S=b+p,T=b-p,M;if(h===s){var w=g.findExtremes(r,[r.r2c(o)],{ppadplus:l,ppadminus:x}),u=g.findExtremes(r,[r.r2c(a)],{ppadplus:Math.max(v,S),ppadminus:Math.max(m,T)});M={min:[w.min[0],u.min[0]],max:[w.max[0],u.max[0]]}}else S=a?S+a:S,T=a?T-a:T,M=g.findExtremes(r,[r.r2c(o)],{ppadplus:Math.max(v,l,S),ppadminus:Math.max(m,x,T)});e._extremes[i]=M}}),E4=Vt((X,V)=>{var c=vo(),g=Ly();V.exports=function(E,A,t,e){A=A||{};var r=t==="log"&&A.type==="linear",i=t==="linear"&&A.type==="log";if(!(r||i))return;var n=E._fullLayout.annotations,o=A._id.charAt(0),a,s;function h(m){var p=a[m],y=null;r?y=g(p,A.range):y=Math.pow(10,p),c(y)||(y=null),e(s+m,y)}for(var v=0;v<n.length;v++)a=n[v],s="annotations["+v+"].",a[o+"ref"]===A._id&&h(o),a["a"+o+"ref"]===A._id&&h("a"+o)}}),P4=Vt((X,V)=>{var c=t1(),g=A4();V.exports={moduleType:"component",name:"annotations",layoutAttributes:h0(),supplyLayoutDefaults:M4(),includeBasePlot:Vm()("annotations"),calcAutorange:S4(),draw:c.draw,drawOne:c.drawOne,drawRaw:c.drawRaw,hasClickToShow:g.hasClickToShow,onClick:g.onClick,convertCoords:E4()}}),e1=Vt((X,V)=>{var c=h0(),g=su().overrideAll,E=Ns().templatedArray;V.exports=g(E("annotation",{visible:c.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:c.xanchor,xshift:c.xshift,yanchor:c.yanchor,yshift:c.yshift,text:c.text,textangle:c.textangle,font:c.font,width:c.width,height:c.height,opacity:c.opacity,align:c.align,valign:c.valign,bgcolor:c.bgcolor,bordercolor:c.bordercolor,borderpad:c.borderpad,borderwidth:c.borderwidth,showarrow:c.showarrow,arrowcolor:c.arrowcolor,arrowhead:c.arrowhead,startarrowhead:c.startarrowhead,arrowside:c.arrowside,arrowsize:c.arrowsize,startarrowsize:c.startarrowsize,arrowwidth:c.arrowwidth,standoff:c.standoff,startstandoff:c.startstandoff,hovertext:c.hovertext,hoverlabel:c.hoverlabel,captureevents:c.captureevents}),"calc","from-root")}),I4=Vt((X,V)=>{var c=qr(),g=ao(),E=Gh(),A=Db(),t=e1();V.exports=function(r,i,n){E(r,i,{name:"annotations",handleItemDefaults:e,fullLayout:n.fullLayout})};function e(r,i,n,o){function a(v,m){return c.coerce(r,i,t,v,m)}function s(v){var m=v+"axis",p={_fullLayout:{}};return p._fullLayout[m]=n[m],g.coercePosition(i,p,a,v,v,.5)}var h=a("visible");h&&(A(r,i,o.fullLayout,a),s("x"),s("y"),s("z"),c.noneOrAll(r,i,["x","y","z"]),i.xref="x",i.yref="y",i.zref="z",a("xanchor"),a("yanchor"),a("xshift"),a("yshift"),i.showarrow&&(i.axref="pixel",i.ayref="pixel",a("ax",-10),a("ay",-30),c.noneOrAll(r,i,["ax","ay"])))}}),L4=Vt((X,V)=>{var c=qr(),g=ao();V.exports=function(A){for(var t=A.fullSceneLayout,e=t.annotations,r=0;r<e.length;r++)E(e[r],A);A.fullLayout._infolayer.selectAll(".annotation-"+A.id).remove()};function E(A,t){var e=t.fullSceneLayout,r=e.domain,i=t.fullLayout._size,n={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};A._xa={},c.extendFlat(A._xa,n),g.setConvert(A._xa),A._xa._offset=i.l+r.x[0]*i.w,A._xa.l2p=function(){return .5*(1+A._pdata[0]/A._pdata[3])*i.w*(r.x[1]-r.x[0])},A._ya={},c.extendFlat(A._ya,n),g.setConvert(A._ya),A._ya._offset=i.t+(1-r.y[1])*i.h,A._ya.l2p=function(){return .5*(1-A._pdata[1]/A._pdata[3])*i.h*(r.y[1]-r.y[0])}}}),zb=Vt((X,V)=>{function c(E,A){var t=[0,0,0,0],e,r;for(e=0;e<4;++e)for(r=0;r<4;++r)t[r]+=E[4*e+r]*A[e];return t}function g(E,A){var t=c(E.projection,c(E.view,c(E.model,[A[0],A[1],A[2],1])));return t}V.exports=g}),C4=Vt((X,V)=>{var c=t1().drawRaw,g=zb(),E=["x","y","z"];V.exports=function(A){for(var t=A.fullSceneLayout,e=A.dataScale,r=t.annotations,i=0;i<r.length;i++){for(var n=r[i],o=!1,a=0;a<3;a++){var s=E[a],h=n[s],v=t[s+"axis"],m=v.r2fraction(h);if(m<0||m>1){o=!0;break}}o?A.fullLayout._infolayer.select(".annotation-"+A.id+'[data-index="'+i+'"]').remove():(n._pdata=g(A.glplot.cameraParams,[t.xaxis.r2l(n.x)*e[0],t.yaxis.r2l(n.y)*e[1],t.zaxis.r2l(n.z)*e[2]]),c(A.graphDiv,n,i,A.id,n._xa,n._ya))}}}),D4=Vt((X,V)=>{var c=Mi(),g=qr();V.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e1()}}},layoutAttributes:e1(),handleDefaults:I4(),includeBasePlot:E,convert:L4(),draw:C4()};function E(A,t){var e=c.subplotsRegistry.gl3d;if(e)for(var r=e.attrRegex,i=Object.keys(A),n=0;n<i.length;n++){var o=i[n];r.test(o)&&(A[o].annotations||[]).length&&(g.pushUnique(t._basePlotModules,e),g.pushUnique(t._subplots.gl3d,o))}}}),Ob=Vt((X,V)=>{var c=h0(),g=Nl(),E=Gu().line,A=Eh().dash,t=po().extendFlat,e=Ns().templatedArray;Um();var r=Ks(),i=Zo().shapeTexttemplateAttrs,n=zy();V.exports=e("shape",{visible:t({},r.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:t({},r.legend,{editType:"calc+arraydraw"}),legendgroup:t({},r.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:t({},r.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:g({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:t({},r.legendrank,{editType:"calc+arraydraw"}),legendwidth:t({},r.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:t({},c.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:t({},c.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:t({},E.color,{editType:"arraydraw"}),width:t({},E.width,{editType:"calc+arraydraw"}),dash:t({},A,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:i({},{keys:Object.keys(n)}),font:g({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})}),z4=Vt((X,V)=>{var c=qr(),g=ao(),E=Gh(),A=Ob(),t=Pd();V.exports=function(i,n){E(i,n,{name:"shapes",handleItemDefaults:r})};function e(i,n){return i?"bottom":n.indexOf("top")!==-1?"top":n.indexOf("bottom")!==-1?"bottom":"middle"}function r(i,n,o){function a(Z,st){return c.coerce(i,n,A,Z,st)}n._isShape=!0;var s=a("visible");if(s){var h=a("showlegend");h&&(a("legend"),a("legendwidth"),a("legendgroup"),a("legendgrouptitle.text"),c.coerceFont(a,"legendgrouptitle.font"),a("legendrank"));var v=a("path"),m=v?"path":"rect",p=a("type",m),y=p!=="path";y&&delete n.path,a("editable"),a("layer"),a("opacity"),a("fillcolor"),a("fillrule");var l=a("line.width");l&&(a("line.color"),a("line.dash"));for(var x=a("xsizemode"),b=a("ysizemode"),S=["x","y"],T=0;T<2;T++){var M=S[T],w=M+"anchor",u=M==="x"?x:b,f={_fullLayout:o},k,_,D,I=g.coerceRef(i,n,f,M,void 0,"paper"),O=g.getRefType(I);if(O==="range"?(k=g.getFromId(f,I),k._shapeIndices.push(n._index),D=t.rangeToShapePosition(k),_=t.shapePositionToRange(k),(k.type==="category"||k.type==="multicategory")&&(a(M+"0shift"),a(M+"1shift"))):_=D=c.identity,y){var B=.25,R=.75,L=M+"0",F=M+"1",N=i[L],j=i[F];i[L]=_(i[L],!0),i[F]=_(i[F],!0),u==="pixel"?(a(L,0),a(F,10)):(g.coercePosition(n,f,a,I,L,B),g.coercePosition(n,f,a,I,F,R)),n[L]=D(n[L]),n[F]=D(n[F]),i[L]=N,i[F]=j}if(u==="pixel"){var G=i[w];i[w]=_(i[w],!0),g.coercePosition(n,f,a,I,w,.25),n[w]=D(n[w]),i[w]=G}}y&&c.noneOrAll(i,n,["x0","x1","y0","y1"]);var rt=p==="line",ct,lt;if(y&&(ct=a("label.texttemplate")),ct||(lt=a("label.text")),lt||ct){a("label.textangle");var tt=a("label.textposition",rt?"middle":"middle center");a("label.xanchor"),a("label.yanchor",e(rt,tt)),a("label.padding"),c.coerceFont(a,"label.font",o.font)}}}}),O4=Vt((X,V)=>{var c=vi(),g=qr();function E(A,t){return A?"bottom":t.indexOf("top")!==-1?"top":t.indexOf("bottom")!==-1?"bottom":"middle"}V.exports=function(A,t,e){e("newshape.visible"),e("newshape.name"),e("newshape.showlegend"),e("newshape.legend"),e("newshape.legendwidth"),e("newshape.legendgroup"),e("newshape.legendgrouptitle.text"),g.coerceFont(e,"newshape.legendgrouptitle.font"),e("newshape.legendrank"),e("newshape.drawdirection"),e("newshape.layer"),e("newshape.fillcolor"),e("newshape.fillrule"),e("newshape.opacity");var r=e("newshape.line.width");if(r){var i=(A||{}).plot_bgcolor||"#FFF";e("newshape.line.color",c.contrast(i)),e("newshape.line.dash")}var n=A.dragmode==="drawline",o=e("newshape.label.text"),a=e("newshape.label.texttemplate");if(o||a){e("newshape.label.textangle");var s=e("newshape.label.textposition",n?"middle":"middle center");e("newshape.label.xanchor"),e("newshape.label.yanchor",E(n,s)),e("newshape.label.padding"),g.coerceFont(e,"newshape.label.font",t.font)}e("activeshape.fillcolor"),e("activeshape.opacity")}}),F4=Vt((X,V)=>{var c=qr(),g=ao(),E=Rm(),A=Pd();V.exports=function(n){var o=n._fullLayout,a=c.filterVisible(o.shapes);if(!(!a.length||!n._fullData.length))for(var s=0;s<a.length;s++){var h=a[s];h._extremes={};var v,m,p=g.getRefType(h.xref),y=g.getRefType(h.yref);h.xref!=="paper"&&p!=="domain"&&(v=g.getFromId(n,h.xref),m=i(v,h,E.paramIsX),m&&(h._extremes[v._id]=g.findExtremes(v,m,t(h)))),h.yref!=="paper"&&y!=="domain"&&(v=g.getFromId(n,h.yref),m=i(v,h,E.paramIsY),m&&(h._extremes[v._id]=g.findExtremes(v,m,e(h))))}};function t(n){return r(n.line.width,n.xsizemode,n.x0,n.x1,n.path,!1)}function e(n){return r(n.line.width,n.ysizemode,n.y0,n.y1,n.path,!0)}function r(n,o,a,s,h,v){var m=n/2,p=v;if(o==="pixel"){var y=h?A.extractPathCoords(h,v?E.paramIsY:E.paramIsX):[a,s],l=c.aggNums(Math.max,null,y),x=c.aggNums(Math.min,null,y),b=x<0?Math.abs(x)+m:m,S=l>0?l+m:m;return{ppad:m,ppadplus:p?b:S,ppadminus:p?S:b}}else return{ppad:m}}function i(n,o,a){var s=n._id.charAt(0)==="x"?"x":"y",h=n.type==="category"||n.type==="multicategory",v,m,p=0,y=0,l=h?n.r2c:n.d2c,x=o[s+"sizemode"]==="scaled";if(x?(v=o[s+"0"],m=o[s+"1"],h&&(p=o[s+"0shift"],y=o[s+"1shift"])):(v=o[s+"anchor"],m=o[s+"anchor"]),v!==void 0)return[l(v)+p,l(m)+y];if(o.path){var b=1/0,S=-1/0,T=o.path.match(E.segmentRE),M,w,u,f,k;for(n.type==="date"&&(l=A.decodeDate(l)),M=0;M<T.length;M++)w=T[M],u=a[w.charAt(0)].drawn,u!==void 0&&(f=T[M].substr(1).match(E.paramRE),!(!f||f.length<u)&&(k=l(f[u]),k<b&&(b=k),k>S&&(S=k)));if(S>=b)return[b,S]}}}),B4=Vt((X,V)=>{var c=Zy();V.exports={moduleType:"component",name:"shapes",layoutAttributes:Ob(),supplyLayoutDefaults:z4(),supplyDrawNewShapeDefaults:O4(),includeBasePlot:Vm()("shapes"),calcAutorange:F4(),draw:c.draw,drawOne:c.drawOne}}),Fb=Vt((X,V)=>{var c=xh(),g=Ns().templatedArray;Um(),V.exports=g("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",c.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",c.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}),R4=Vt((X,V)=>{var c=qr(),g=ao(),E=Gh(),A=Fb(),t="images";V.exports=function(r,i){var n={name:t,handleItemDefaults:e};E(r,i,n)};function e(r,i,n){function o(x,b){return c.coerce(r,i,A,x,b)}var a=o("source"),s=o("visible",!!a);if(!s)return i;o("layer"),o("xanchor"),o("yanchor"),o("sizex"),o("sizey"),o("sizing"),o("opacity");for(var h={_fullLayout:n},v=["x","y"],m=0;m<2;m++){var p=v[m],y=g.coerceRef(r,i,h,p,"paper",void 0);if(y!=="paper"){var l=g.getFromId(h,y);l._imgIndices.push(i._index)}g.coercePosition(i,h,o,y,p,0)}return i}}),j4=Vt((X,V)=>{var c=Ai(),g=go(),E=ao(),A=rc(),t=Cf();V.exports=function(e){var r=e._fullLayout,i=[],n={},o=[],a,s;for(s=0;s<r.images.length;s++){var h=r.images[s];if(h.visible)if(h.layer==="below"&&h.xref!=="paper"&&h.yref!=="paper"){a=A.ref2id(h.xref)+A.ref2id(h.yref);var v=r._plots[a];if(!v){o.push(h);continue}v.mainplot&&(a=v.mainplot.id),n[a]||(n[a]=[]),n[a].push(h)}else h.layer==="above"?i.push(h):o.push(h)}var m={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-1/2},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-1/2},bottom:{sizing:"YMax",offset:-1}}};function p(u){var f=c.select(this);if(this._imgSrc!==u.source)if(f.attr("xmlns",t.svg),!e._context.staticPlot||u.source&&u.source.slice(0,5)==="data:")f.attr("xlink:href",u.source),this._imgSrc=u.source;else{var k=new Promise(function(_){var D=new Image;this.img=D,D.setAttribute("crossOrigin","anonymous"),D.onerror=I,D.onload=function(){var O=document.createElement("canvas");O.width=this.width,O.height=this.height;var B=O.getContext("2d",{willReadFrequently:!0});B.drawImage(this,0,0);var R=O.toDataURL("image/png");f.attr("xlink:href",R),_()},f.on("error",I),D.src=u.source,this._imgSrc=u.source;function I(){f.remove(),_()}}.bind(this));e._promises.push(k)}}function y(u){var f=c.select(this),k=E.getFromId(e,u.xref),_=E.getFromId(e,u.yref),D=E.getRefType(u.xref)==="domain",I=E.getRefType(u.yref)==="domain",O=r._size,B,R;k!==void 0?B=typeof u.xref=="string"&&D?k._length*u.sizex:Math.abs(k.l2p(u.sizex)-k.l2p(0)):B=u.sizex*O.w,_!==void 0?R=typeof u.yref=="string"&&I?_._length*u.sizey:Math.abs(_.l2p(u.sizey)-_.l2p(0)):R=u.sizey*O.h;var L=B*m.x[u.xanchor].offset,F=R*m.y[u.yanchor].offset,N=m.x[u.xanchor].sizing+m.y[u.yanchor].sizing,j,G;switch(k!==void 0?j=typeof u.xref=="string"&&D?k._length*u.x+k._offset:k.r2p(u.x)+k._offset:j=u.x*O.w+O.l,j+=L,_!==void 0?G=typeof u.yref=="string"&&I?_._length*(1-u.y)+_._offset:_.r2p(u.y)+_._offset:G=O.h-u.y*O.h+O.t,G+=F,u.sizing){case"fill":N+=" slice";break;case"stretch":N="none";break}f.attr({x:j,y:G,width:B,height:R,preserveAspectRatio:N,opacity:u.opacity});var rt=k&&E.getRefType(u.xref)!=="domain"?k._id:"",ct=_&&E.getRefType(u.yref)!=="domain"?_._id:"",lt=rt+ct;g.setClipUrl(f,lt?"clip"+r._uid+lt:null,e)}function l(u){return[u.xref,u.x,u.sizex,u.yref,u.y,u.sizey].join("_")}function x(u,f){return u._index-f._index}var b=r._imageLowerLayer.selectAll("image").data(o,l),S=r._imageUpperLayer.selectAll("image").data(i,l);b.enter().append("image"),S.enter().append("image"),b.exit().remove(),S.exit().remove(),b.each(function(u){p.bind(this)(u),y.bind(this)(u)}),S.each(function(u){p.bind(this)(u),y.bind(this)(u)}),b.sort(x),S.sort(x);var T=Object.keys(r._plots);for(s=0;s<T.length;s++){a=T[s];var M=r._plots[a];if(M.imagelayer){var w=M.imagelayer.selectAll("image").data(n[a]||[],l);w.enter().append("image"),w.exit().remove(),w.each(function(u){p.bind(this)(u),y.bind(this)(u)}),w.sort(x)}}}}),N4=Vt((X,V)=>{var c=vo(),g=Ly();V.exports=function(E,A,t,e){A=A||{};var r=t==="log"&&A.type==="linear",i=t==="linear"&&A.type==="log";if(r||i){for(var n=E._fullLayout.images,o=A._id.charAt(0),a,s,h=0;h<n.length;h++)if(a=n[h],s="images["+h+"].",a[o+"ref"]===A._id){var v=a[o],m=a["size"+o],p=null,y=null;if(r){p=g(v,A.range);var l=m/Math.pow(10,p)/2;y=2*Math.log(l+Math.sqrt(1+l*l))/Math.LN10}else p=Math.pow(10,v),y=p*(Math.pow(10,m/2)-Math.pow(10,-m/2));c(p)?c(y)||(y=null):(p=null,y=null),e(s+o,p),e(s+"size"+o,y)}}}}),U4=Vt((X,V)=>{V.exports={moduleType:"component",name:"images",layoutAttributes:Fb(),supplyLayoutDefaults:R4(),includeBasePlot:Vm()("images"),draw:j4(),convertCoords:N4()}}),r1=Vt((X,V)=>{V.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}}),Bb=Vt((X,V)=>{var c=Nl(),g=Hc(),E=po().extendFlat,A=su().overrideAll,t=Oy(),e=Ns().templatedArray,r=e("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});V.exports=A(e("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:r,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:E(t({editType:"arraydraw"}),{}),font:c({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:g.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}),V4=Vt((X,V)=>{var c=qr(),g=Gh(),E=Bb(),A=r1(),t=A.name,e=E.buttons;V.exports=function(n,o){var a={name:t,handleItemDefaults:r};g(n,o,a)};function r(n,o,a){function s(m,p){return c.coerce(n,o,E,m,p)}var h=g(n,o,{name:"buttons",handleItemDefaults:i}),v=s("visible",h.length>0);v&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),c.noneOrAll(n,o,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),c.coerceFont(s,"font",a.font),s("bgcolor",a.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function i(n,o){function a(h,v){return c.coerce(n,o,e,h,v)}var s=a("visible",n.method==="skip"||Array.isArray(n.args));s&&(a("method"),a("args"),a("args2"),a("label"),a("execute"))}}),q4=Vt((X,V)=>{V.exports=t;var c=Ai(),g=vi(),E=go(),A=qr();function t(e,r,i){this.gd=e,this.container=r,this.id=i,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}t.barWidth=2,t.barLength=20,t.barRadius=2,t.barPad=1,t.barColor="#808BA4",t.prototype.enable=function(e,r,i){var n=this.gd._fullLayout,o=n.width,a=n.height;this.position=e;var s=this.position.l,h=this.position.w,v=this.position.t,m=this.position.h,p=this.position.direction,y=p==="down",l=p==="left",x=p==="right",b=p==="up",S=h,T=m,M,w,u,f;!y&&!l&&!x&&!b&&(this.position.direction="down",y=!0);var k=y||b;k?(M=s,w=M+S,y?(u=v,f=Math.min(u+T,a),T=f-u):(f=v+T,u=Math.max(f-T,0),T=f-u)):(u=v,f=u+T,l?(w=s+S,M=Math.max(w-S,0),S=w-M):(M=s,w=Math.min(M+S,o),S=w-M)),this._box={l:M,t:u,w:S,h:T};var _=h>S,D=t.barLength+2*t.barPad,I=t.barWidth+2*t.barPad,O=s,B=v+m;B+I>a&&(B=a-I);var R=this.container.selectAll("rect.scrollbar-horizontal").data(_?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-horizontal",!0).call(g.fill,t.barColor),_?(this.hbar=R.attr({rx:t.barRadius,ry:t.barRadius,x:O,y:B,width:D,height:I}),this._hbarXMin=O+D/2,this._hbarTranslateMax=S-D):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=m>T,F=t.barWidth+2*t.barPad,N=t.barLength+2*t.barPad,j=s+h,G=v;j+F>o&&(j=o-F);var rt=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);rt.exit().on(".drag",null).remove(),rt.enter().append("rect").classed("scrollbar-vertical",!0).call(g.fill,t.barColor),L?(this.vbar=rt.attr({rx:t.barRadius,ry:t.barRadius,x:j,y:G,width:F,height:N}),this._vbarYMin=G+N/2,this._vbarTranslateMax=T-N):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var ct=this.id,lt=M-.5,tt=L?w+F+.5:w+.5,Z=u-.5,st=_?f+I+.5:f+.5,$=n._topdefs.selectAll("#"+ct).data(_||L?[0]:[]);if($.exit().remove(),$.enter().append("clipPath").attr("id",ct).append("rect"),_||L?(this._clipRect=$.select("rect").attr({x:Math.floor(lt),y:Math.floor(Z),width:Math.ceil(tt)-Math.floor(lt),height:Math.ceil(st)-Math.floor(Z)}),this.container.call(E.setClipUrl,ct,this.gd),this.bg.attr({x:s,y:v,width:h,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(E.setClipUrl,null),delete this._clipRect),_||L){var Q=c.behavior.drag().on("dragstart",function(){c.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(Q);var nt=c.behavior.drag().on("dragstart",function(){c.event.sourceEvent.preventDefault(),c.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));_&&this.hbar.on(".drag",null).call(nt),L&&this.vbar.on(".drag",null).call(nt)}this.setTranslate(r,i)},t.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(E.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},t.prototype._onBoxDrag=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e-=c.event.dx),this.vbar&&(r-=c.event.dy),this.setTranslate(e,r)},t.prototype._onBoxWheel=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e+=c.event.deltaY),this.vbar&&(r+=c.event.deltaY),this.setTranslate(e,r)},t.prototype._onBarDrag=function(){var e=this.translateX,r=this.translateY;if(this.hbar){var i=e+this._hbarXMin,n=i+this._hbarTranslateMax,o=A.constrain(c.event.x,i,n),a=(o-i)/(n-i),s=this.position.w-this._box.w;e=a*s}if(this.vbar){var h=r+this._vbarYMin,v=h+this._vbarTranslateMax,m=A.constrain(c.event.y,h,v),p=(m-h)/(v-h),y=this.position.h-this._box.h;r=p*y}this.setTranslate(e,r)},t.prototype.setTranslate=function(e,r){var i=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=A.constrain(e||0,0,i),r=A.constrain(r||0,0,n),this.translateX=e,this.translateY=r,this.container.call(E.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-r),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+r-.5)}),this.hbar){var o=e/i;this.hbar.call(E.setTranslate,e+o*this._hbarTranslateMax,r)}if(this.vbar){var a=r/n;this.vbar.call(E.setTranslate,e,r+a*this._vbarTranslateMax)}}}),H4=Vt((X,V)=>{var c=Ai(),g=fu(),E=vi(),A=go(),t=qr(),e=sl(),r=Ns().arrayEditor,i=nh().LINE_SPACING,n=r1(),o=q4();V.exports=function(D){var I=D._fullLayout,O=t.filterVisible(I[n.name]);function B(ct){g.autoMargin(D,f(ct))}var R=I._menulayer.selectAll("g."+n.containerClassName).data(O.length>0?[0]:[]);if(R.enter().append("g").classed(n.containerClassName,!0).style("cursor","pointer"),R.exit().each(function(){c.select(this).selectAll("g."+n.headerGroupClassName).each(B)}).remove(),O.length!==0){var L=R.selectAll("g."+n.headerGroupClassName).data(O,a);L.enter().append("g").classed(n.headerGroupClassName,!0);for(var F=t.ensureSingle(R,"g",n.dropdownButtonGroupClassName,function(ct){ct.style("pointer-events","all")}),N=0;N<O.length;N++){var j=O[N];u(D,j)}var G="updatemenus"+I._uid,rt=new o(D,F,G);L.enter().size()&&(F.node().parentNode.appendChild(F.node()),F.call(_)),L.exit().each(function(ct){F.call(_),B(ct)}).remove(),L.each(function(ct){var lt=c.select(this),tt=ct.type==="dropdown"?F:null;g.manageCommandObserver(D,ct,ct.buttons,function(Z){v(D,ct,ct.buttons[Z.index],lt,tt,rt,Z.index,!0)}),ct.type==="dropdown"?(m(D,lt,F,rt,ct),h(F,ct)&&p(D,lt,F,rt,ct)):p(D,lt,null,null,ct)})}};function a(D){return D._index}function s(D){return+D.attr(n.menuIndexAttrName)==-1}function h(D,I){return+D.attr(n.menuIndexAttrName)===I._index}function v(D,I,O,B,R,L,F,N){I.active=F,r(D.layout,n.name,I).applyUpdate("active",F),I.type==="buttons"?p(D,B,null,null,I):I.type==="dropdown"&&(R.attr(n.menuIndexAttrName,"-1"),m(D,B,R,L,I),N||p(D,B,R,L,I))}function m(D,I,O,B,R){var L=t.ensureSingle(I,"g",n.headerClassName,function(lt){lt.style("pointer-events","all")}),F=R._dims,N=R.active,j=R.buttons[N]||n.blankHeaderOpts,G={y:R.pad.t,yPad:0,x:R.pad.l,xPad:0,index:0},rt={width:F.headerWidth,height:F.headerHeight};L.call(x,R,j,D).call(k,R,G,rt);var ct=t.ensureSingle(I,"text",n.headerArrowClassName,function(lt){lt.attr("text-anchor","end").call(A.font,R.font).text(n.arrowSymbol[R.direction])});ct.attr({x:F.headerWidth-n.arrowOffsetX+R.pad.l,y:F.headerHeight/2+n.textOffsetY+R.pad.t}),L.on("click",function(){O.call(_,String(h(O,R)?-1:R._index)),p(D,I,O,B,R)}),L.on("mouseover",function(){L.call(M)}),L.on("mouseout",function(){L.call(w,R)}),A.setTranslate(I,F.lx,F.ly)}function p(D,I,O,B,R){O||(O=I,O.attr("pointer-events","all"));var L=!s(O)||R.type==="buttons"?R.buttons:[],F=R.type==="dropdown"?n.dropdownButtonClassName:n.buttonClassName,N=O.selectAll("g."+F).data(t.filterVisible(L)),j=N.enter().append("g").classed(F,!0),G=N.exit();R.type==="dropdown"?(j.attr("opacity","0").transition().attr("opacity","1"),G.transition().attr("opacity","0").remove()):G.remove();var rt=0,ct=0,lt=R._dims,tt=["up","down"].indexOf(R.direction)!==-1;R.type==="dropdown"&&(tt?ct=lt.headerHeight+n.gapButtonHeader:rt=lt.headerWidth+n.gapButtonHeader),R.type==="dropdown"&&R.direction==="up"&&(ct=-n.gapButtonHeader+n.gapButton-lt.openHeight),R.type==="dropdown"&&R.direction==="left"&&(rt=-n.gapButtonHeader+n.gapButton-lt.openWidth);var Z={x:lt.lx+rt+R.pad.l,y:lt.ly+ct+R.pad.t,yPad:n.gapButton,xPad:n.gapButton,index:0},st={l:Z.x+R.borderwidth,t:Z.y+R.borderwidth};N.each(function($,Q){var nt=c.select(this);nt.call(x,R,$,D).call(k,R,Z),nt.on("click",function(){c.event.defaultPrevented||($.execute&&($.args2&&R.active===Q?(v(D,R,$,I,O,B,-1),g.executeAPICommand(D,$.method,$.args2)):(v(D,R,$,I,O,B,Q),g.executeAPICommand(D,$.method,$.args))),D.emit("plotly_buttonclicked",{menu:R,button:$,active:R.active}))}),nt.on("mouseover",function(){nt.call(M)}),nt.on("mouseout",function(){nt.call(w,R),N.call(T,R)})}),N.call(T,R),tt?(st.w=Math.max(lt.openWidth,lt.headerWidth),st.h=Z.y-st.t):(st.w=Z.x-st.l,st.h=Math.max(lt.openHeight,lt.headerHeight)),st.direction=R.direction,B&&(N.size()?y(D,I,O,B,R,st):l(B))}function y(D,I,O,B,R,L){var F=R.direction,N=F==="up"||F==="down",j=R._dims,G=R.active,rt,ct,lt;if(N)for(ct=0,lt=0;lt<G;lt++)ct+=j.heights[lt]+n.gapButton;else for(rt=0,lt=0;lt<G;lt++)rt+=j.widths[lt]+n.gapButton;B.enable(L,rt,ct),B.hbar&&B.hbar.attr("opacity","0").transition().attr("opacity","1"),B.vbar&&B.vbar.attr("opacity","0").transition().attr("opacity","1")}function l(D){var I=!!D.hbar,O=!!D.vbar;I&&D.hbar.transition().attr("opacity","0").each("end",function(){I=!1,O||D.disable()}),O&&D.vbar.transition().attr("opacity","0").each("end",function(){O=!1,I||D.disable()})}function x(D,I,O,B){D.call(b,I).call(S,I,O,B)}function b(D,I){var O=t.ensureSingle(D,"rect",n.itemRectClassName,function(B){B.attr({rx:n.rx,ry:n.ry,"shape-rendering":"crispEdges"})});O.call(E.stroke,I.bordercolor).call(E.fill,I.bgcolor).style("stroke-width",I.borderwidth+"px")}function S(D,I,O,B){var R=t.ensureSingle(D,"text",n.itemTextClassName,function(N){N.attr({"text-anchor":"start","data-notex":1})}),L=O.label,F=B._fullLayout._meta;F&&(L=t.templateString(L,F)),R.call(A.font,I.font).text(L).call(e.convertToTspans,B)}function T(D,I){var O=I.active;D.each(function(B,R){var L=c.select(this);R===O&&I.showactive&&L.select("rect."+n.itemRectClassName).call(E.fill,n.activeColor)})}function M(D){D.select("rect."+n.itemRectClassName).call(E.fill,n.hoverColor)}function w(D,I){D.select("rect."+n.itemRectClassName).call(E.fill,I.bgcolor)}function u(D,I){var O=I._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},B=A.tester.selectAll("g."+n.dropdownButtonClassName).data(t.filterVisible(I.buttons));B.enter().append("g").classed(n.dropdownButtonClassName,!0);var R=["up","down"].indexOf(I.direction)!==-1;B.each(function(rt,ct){var lt=c.select(this);lt.call(x,I,rt,D);var tt=lt.select("."+n.itemTextClassName),Z=tt.node()&&A.bBox(tt.node()).width,st=Math.max(Z+n.textPadX,n.minWidth),$=I.font.size*i,Q=e.lineCount(tt),nt=Math.max($*Q,n.minHeight)+n.textOffsetY;nt=Math.ceil(nt),st=Math.ceil(st),O.widths[ct]=st,O.heights[ct]=nt,O.height1=Math.max(O.height1,nt),O.width1=Math.max(O.width1,st),R?(O.totalWidth=Math.max(O.totalWidth,st),O.openWidth=O.totalWidth,O.totalHeight+=nt+n.gapButton,O.openHeight+=nt+n.gapButton):(O.totalWidth+=st+n.gapButton,O.openWidth+=st+n.gapButton,O.totalHeight=Math.max(O.totalHeight,nt),O.openHeight=O.totalHeight)}),R?O.totalHeight-=n.gapButton:O.totalWidth-=n.gapButton,O.headerWidth=O.width1+n.arrowPadX,O.headerHeight=O.height1,I.type==="dropdown"&&(R?(O.width1+=n.arrowPadX,O.totalHeight=O.height1):O.totalWidth=O.width1,O.totalWidth+=n.arrowPadX),B.remove();var L=O.totalWidth+I.pad.l+I.pad.r,F=O.totalHeight+I.pad.t+I.pad.b,N=D._fullLayout._size;O.lx=N.l+N.w*I.x,O.ly=N.t+N.h*(1-I.y);var j="left";t.isRightAnchor(I)&&(O.lx-=L,j="right"),t.isCenterAnchor(I)&&(O.lx-=L/2,j="center");var G="top";t.isBottomAnchor(I)&&(O.ly-=F,G="bottom"),t.isMiddleAnchor(I)&&(O.ly-=F/2,G="middle"),O.totalWidth=Math.ceil(O.totalWidth),O.totalHeight=Math.ceil(O.totalHeight),O.lx=Math.round(O.lx),O.ly=Math.round(O.ly),g.autoMargin(D,f(I),{x:I.x,y:I.y,l:L*({right:1,center:.5}[j]||0),r:L*({left:1,center:.5}[j]||0),b:F*({top:1,middle:.5}[G]||0),t:F*({bottom:1,middle:.5}[G]||0)})}function f(D){return n.autoMarginIdRoot+D._index}function k(D,I,O,B){B=B||{};var R=D.select("."+n.itemRectClassName),L=D.select("."+n.itemTextClassName),F=I.borderwidth,N=O.index,j=I._dims;A.setTranslate(D,F+O.x,F+O.y);var G=["up","down"].indexOf(I.direction)!==-1,rt=B.height||(G?j.heights[N]:j.height1);R.attr({x:0,y:0,width:B.width||(G?j.width1:j.widths[N]),height:rt});var ct=I.font.size*i,lt=e.lineCount(L),tt=(lt-1)*ct/2;e.positionText(L,n.textOffsetX,rt/2-tt+n.textOffsetY),G?O.y+=j.heights[N]+O.yPad:O.x+=j.widths[N]+O.xPad,O.index++}function _(D,I){D.attr(n.menuIndexAttrName,I||"-1").selectAll("g."+n.dropdownButtonClassName).remove()}}),G4=Vt((X,V)=>{var c=r1();V.exports={moduleType:"component",name:c.name,layoutAttributes:Bb(),supplyLayoutDefaults:V4(),draw:H4()}}),Gm=Vt((X,V)=>{V.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}}),Rb=Vt((X,V)=>{var c=Nl(),g=Oy(),E=po().extendDeepAll,A=su().overrideAll,t=Dm(),e=Ns().templatedArray,r=Gm(),i=e("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});V.exports=A(e("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:i,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:E(g({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:t.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:c({})},font:c({}),activebgcolor:{valType:"color",dflt:r.gripBgActiveColor},bgcolor:{valType:"color",dflt:r.railBgColor},bordercolor:{valType:"color",dflt:r.railBorderColor},borderwidth:{valType:"number",min:0,dflt:r.railBorderWidth},ticklen:{valType:"number",min:0,dflt:r.tickLength},tickcolor:{valType:"color",dflt:r.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:r.minorTickLength}}),"arraydraw","from-root")}),W4=Vt((X,V)=>{var c=qr(),g=Gh(),E=Rb(),A=Gm(),t=A.name,e=E.steps;V.exports=function(n,o){g(n,o,{name:t,handleItemDefaults:r})};function r(n,o,a){function s(b,S){return c.coerce(n,o,E,b,S)}for(var h=g(n,o,{name:"steps",handleItemDefaults:i}),v=0,m=0;m<h.length;m++)h[m].visible&&v++;var p;if(v<2?p=o.visible=!1:p=s("visible"),!!p){o._stepCount=v;var y=o._visibleSteps=c.filterVisible(h),l=s("active");(h[l]||{}).visible||(o.active=y[0]._index),s("x"),s("y"),c.noneOrAll(n,o,["x","y"]),s("xanchor"),s("yanchor"),s("len"),s("lenmode"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),c.coerceFont(s,"font",a.font);var x=s("currentvalue.visible");x&&(s("currentvalue.xanchor"),s("currentvalue.prefix"),s("currentvalue.suffix"),s("currentvalue.offset"),c.coerceFont(s,"currentvalue.font",o.font)),s("transition.duration"),s("transition.easing"),s("bgcolor"),s("activebgcolor"),s("bordercolor"),s("borderwidth"),s("ticklen"),s("tickwidth"),s("tickcolor"),s("minorticklen")}}function i(n,o){function a(v,m){return c.coerce(n,o,e,v,m)}var s;if(n.method!=="skip"&&!Array.isArray(n.args)?s=o.visible=!1:s=a("visible"),s){a("method"),a("args");var h=a("label","step-"+o._index);a("value",h),a("execute")}}}),Z4=Vt((X,V)=>{var c=Ai(),g=fu(),E=vi(),A=go(),t=qr(),e=t.strTranslate,r=sl(),i=Ns().arrayEditor,n=Gm(),o=nh(),a=o.LINE_SPACING,s=o.FROM_TL,h=o.FROM_BR;V.exports=function(R){var L=R._context.staticPlot,F=R._fullLayout,N=m(F,R),j=F._infolayer.selectAll("g."+n.containerClassName).data(N.length>0?[0]:[]);j.enter().append("g").classed(n.containerClassName,!0).style("cursor",L?null:"ew-resize");function G(tt){tt._commandObserver&&(tt._commandObserver.remove(),delete tt._commandObserver),g.autoMargin(R,v(tt))}if(j.exit().each(function(){c.select(this).selectAll("g."+n.groupClassName).each(G)}).remove(),N.length!==0){var rt=j.selectAll("g."+n.groupClassName).data(N,p);rt.enter().append("g").classed(n.groupClassName,!0),rt.exit().each(G).remove();for(var ct=0;ct<N.length;ct++){var lt=N[ct];y(R,lt)}rt.each(function(tt){var Z=c.select(this);k(tt),g.manageCommandObserver(R,tt,tt._visibleSteps,function(st){var $=Z.data()[0];$.active!==st.index&&($._dragging||w(R,Z,$,st.index,!1,!0))}),l(R,c.select(this),tt)})}};function v(R){return n.autoMarginIdRoot+R._index}function m(R,L){for(var F=R[n.name],N=[],j=0;j<F.length;j++){var G=F[j];G.visible&&(G._gd=L,N.push(G))}return N}function p(R){return R._index}function y(R,L){var F=A.tester.selectAll("g."+n.labelGroupClass).data(L._visibleSteps);F.enter().append("g").classed(n.labelGroupClass,!0);var N=0,j=0;F.each(function(nt){var Y=c.select(this),q=S(Y,{step:nt},L),ot=q.node();if(ot){var it=A.bBox(ot);j=Math.max(j,it.height),N=Math.max(N,it.width)}}),F.remove();var G=L._dims={};G.inputAreaWidth=Math.max(n.railWidth,n.gripHeight);var rt=R._fullLayout._size;G.lx=rt.l+rt.w*L.x,G.ly=rt.t+rt.h*(1-L.y),L.lenmode==="fraction"?G.outerLength=Math.round(rt.w*L.len):G.outerLength=L.len,G.inputAreaStart=0,G.inputAreaLength=Math.round(G.outerLength-L.pad.l-L.pad.r);var ct=G.inputAreaLength-2*n.stepInset,lt=ct/(L._stepCount-1),tt=N+n.labelPadding;if(G.labelStride=Math.max(1,Math.ceil(tt/lt)),G.labelHeight=j,G.currentValueMaxWidth=0,G.currentValueHeight=0,G.currentValueTotalHeight=0,G.currentValueMaxLines=1,L.currentvalue.visible){var Z=A.tester.append("g");F.each(function(nt){var Y=x(Z,L,nt.label),q=Y.node()&&A.bBox(Y.node())||{width:0,height:0},ot=r.lineCount(Y);G.currentValueMaxWidth=Math.max(G.currentValueMaxWidth,Math.ceil(q.width)),G.currentValueHeight=Math.max(G.currentValueHeight,Math.ceil(q.height)),G.currentValueMaxLines=Math.max(G.currentValueMaxLines,ot)}),G.currentValueTotalHeight=G.currentValueHeight+L.currentvalue.offset,Z.remove()}G.height=G.currentValueTotalHeight+n.tickOffset+L.ticklen+n.labelOffset+G.labelHeight+L.pad.t+L.pad.b;var st="left";t.isRightAnchor(L)&&(G.lx-=G.outerLength,st="right"),t.isCenterAnchor(L)&&(G.lx-=G.outerLength/2,st="center");var $="top";t.isBottomAnchor(L)&&(G.ly-=G.height,$="bottom"),t.isMiddleAnchor(L)&&(G.ly-=G.height/2,$="middle"),G.outerLength=Math.ceil(G.outerLength),G.height=Math.ceil(G.height),G.lx=Math.round(G.lx),G.ly=Math.round(G.ly);var Q={y:L.y,b:G.height*h[$],t:G.height*s[$]};L.lenmode==="fraction"?(Q.l=0,Q.xl=L.x-L.len*s[st],Q.r=0,Q.xr=L.x+L.len*h[st]):(Q.x=L.x,Q.l=G.outerLength*s[st],Q.r=G.outerLength*h[st]),g.autoMargin(R,v(L),Q)}function l(R,L,F){(F.steps[F.active]||{}).visible||(F.active=F._visibleSteps[0]._index),L.call(x,F).call(B,F).call(T,F).call(f,F).call(O,R,F).call(b,R,F);var N=F._dims;A.setTranslate(L,N.lx+F.pad.l,N.ly+F.pad.t),L.call(_,F,!1),L.call(x,F)}function x(R,L,F){if(L.currentvalue.visible){var N=L._dims,j,G;switch(L.currentvalue.xanchor){case"right":j=N.inputAreaLength-n.currentValueInset-N.currentValueMaxWidth,G="left";break;case"center":j=N.inputAreaLength*.5,G="middle";break;default:j=n.currentValueInset,G="left"}var rt=t.ensureSingle(R,"text",n.labelClass,function($){$.attr({"text-anchor":G,"data-notex":1})}),ct=L.currentvalue.prefix?L.currentvalue.prefix:"";if(typeof F=="string")ct+=F;else{var lt=L.steps[L.active].label,tt=L._gd._fullLayout._meta;tt&&(lt=t.templateString(lt,tt)),ct+=lt}L.currentvalue.suffix&&(ct+=L.currentvalue.suffix),rt.call(A.font,L.currentvalue.font).text(ct).call(r.convertToTspans,L._gd);var Z=r.lineCount(rt),st=(N.currentValueMaxLines+1-Z)*L.currentvalue.font.size*a;return r.positionText(rt,j,st),rt}}function b(R,L,F){var N=t.ensureSingle(R,"rect",n.gripRectClass,function(j){j.call(u,L,R,F).style("pointer-events","all")});N.attr({width:n.gripWidth,height:n.gripHeight,rx:n.gripRadius,ry:n.gripRadius}).call(E.stroke,F.bordercolor).call(E.fill,F.bgcolor).style("stroke-width",F.borderwidth+"px")}function S(R,L,F){var N=t.ensureSingle(R,"text",n.labelClass,function(rt){rt.attr({"text-anchor":"middle","data-notex":1})}),j=L.step.label,G=F._gd._fullLayout._meta;return G&&(j=t.templateString(j,G)),N.call(A.font,F.font).text(j).call(r.convertToTspans,F._gd),N}function T(R,L){var F=t.ensureSingle(R,"g",n.labelsClass),N=L._dims,j=F.selectAll("g."+n.labelGroupClass).data(N.labelSteps);j.enter().append("g").classed(n.labelGroupClass,!0),j.exit().remove(),j.each(function(G){var rt=c.select(this);rt.call(S,G,L),A.setTranslate(rt,D(L,G.fraction),n.tickOffset+L.ticklen+L.font.size*a+n.labelOffset+N.currentValueTotalHeight)})}function M(R,L,F,N,j){var G=Math.round(N*(F._stepCount-1)),rt=F._visibleSteps[G]._index;rt!==F.active&&w(R,L,F,rt,!0,j)}function w(R,L,F,N,j,G){var rt=F.active;F.active=N,i(R.layout,n.name,F).applyUpdate("active",N);var ct=F.steps[F.active];L.call(_,F,G),L.call(x,F),R.emit("plotly_sliderchange",{slider:F,step:F.steps[F.active],interaction:j,previousActive:rt}),ct&&ct.method&&j&&(L._nextMethod?(L._nextMethod.step=ct,L._nextMethod.doCallback=j,L._nextMethod.doTransition=G):(L._nextMethod={step:ct,doCallback:j,doTransition:G},L._nextMethodRaf=window.requestAnimationFrame(function(){var lt=L._nextMethod.step;lt.method&&(lt.execute&&g.executeAPICommand(R,lt.method,lt.args),L._nextMethod=null,L._nextMethodRaf=null)})))}function u(R,L,F){if(L._context.staticPlot)return;var N=F.node(),j=c.select(L);function G(){return F.data()[0]}function rt(){var ct=G();L.emit("plotly_sliderstart",{slider:ct});var lt=F.select("."+n.gripRectClass);c.event.stopPropagation(),c.event.preventDefault(),lt.call(E.fill,ct.activebgcolor);var tt=I(ct,c.mouse(N)[0]);M(L,F,ct,tt,!0),ct._dragging=!0;function Z(){var $=G(),Q=I($,c.mouse(N)[0]);M(L,F,$,Q,!1)}j.on("mousemove",Z),j.on("touchmove",Z);function st(){var $=G();$._dragging=!1,lt.call(E.fill,$.bgcolor),j.on("mouseup",null),j.on("mousemove",null),j.on("touchend",null),j.on("touchmove",null),L.emit("plotly_sliderend",{slider:$,step:$.steps[$.active]})}j.on("mouseup",st),j.on("touchend",st)}R.on("mousedown",rt),R.on("touchstart",rt)}function f(R,L){var F=R.selectAll("rect."+n.tickRectClass).data(L._visibleSteps),N=L._dims;F.enter().append("rect").classed(n.tickRectClass,!0),F.exit().remove(),F.attr({width:L.tickwidth+"px","shape-rendering":"crispEdges"}),F.each(function(j,G){var rt=G%N.labelStride===0,ct=c.select(this);ct.attr({height:rt?L.ticklen:L.minorticklen}).call(E.fill,L.tickcolor),A.setTranslate(ct,D(L,G/(L._stepCount-1))-.5*L.tickwidth,(rt?n.tickOffset:n.minorTickOffset)+N.currentValueTotalHeight)})}function k(R){var L=R._dims;L.labelSteps=[];for(var F=R._stepCount,N=0;N<F;N+=L.labelStride)L.labelSteps.push({fraction:N/(F-1),step:R._visibleSteps[N]})}function _(R,L,F){for(var N=R.select("rect."+n.gripRectClass),j=0,G=0;G<L._stepCount;G++)if(L._visibleSteps[G]._index===L.active){j=G;break}var rt=D(L,j/(L._stepCount-1));if(!L._invokingCommand){var ct=N;F&&L.transition.duration>0&&(ct=ct.transition().duration(L.transition.duration).ease(L.transition.easing)),ct.attr("transform",e(rt-n.gripWidth*.5,L._dims.currentValueTotalHeight))}}function D(R,L){var F=R._dims;return F.inputAreaStart+n.stepInset+(F.inputAreaLength-2*n.stepInset)*Math.min(1,Math.max(0,L))}function I(R,L){var F=R._dims;return Math.min(1,Math.max(0,(L-n.stepInset-F.inputAreaStart)/(F.inputAreaLength-2*n.stepInset-2*F.inputAreaStart)))}function O(R,L,F){var N=F._dims,j=t.ensureSingle(R,"rect",n.railTouchRectClass,function(G){G.call(u,L,R,F).style("pointer-events","all")});j.attr({width:N.inputAreaLength,height:Math.max(N.inputAreaWidth,n.tickOffset+F.ticklen+N.labelHeight)}).call(E.fill,F.bgcolor).attr("opacity",0),A.setTranslate(j,0,N.currentValueTotalHeight)}function B(R,L){var F=L._dims,N=F.inputAreaLength-n.railInset*2,j=t.ensureSingle(R,"rect",n.railRectClass);j.attr({width:N,height:n.railWidth,rx:n.railRadius,ry:n.railRadius,"shape-rendering":"crispEdges"}).call(E.stroke,L.bordercolor).call(E.fill,L.bgcolor).style("stroke-width",L.borderwidth+"px"),A.setTranslate(j,n.railInset,(F.inputAreaWidth-n.railWidth)*.5+F.currentValueTotalHeight)}}),X4=Vt((X,V)=>{var c=Gm();V.exports={moduleType:"component",name:c.name,layoutAttributes:Rb(),supplyLayoutDefaults:W4(),draw:Z4()}}),n1=Vt((X,V)=>{var c=Hc();V.exports={bgcolor:{valType:"color",dflt:c.background,editType:"plot"},bordercolor:{valType:"color",dflt:c.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}),jb=Vt((X,V)=>{V.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}),a1=Vt((X,V)=>{V.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}),$4=Vt(X=>{var V=rc(),c=sl(),g=a1(),E=nh().LINE_SPACING,A=g.name;function t(e){var r=e&&e[A];return r&&r.visible}X.isVisible=t,X.makeData=function(e){for(var r=V.list({_fullLayout:e},"x",!0),i=e.margin,n=[],o=0;o<r.length;o++){var a=r[o];if(t(a)){n.push(a);var s=a[A];s._id=A+a._id,s._height=(e.height-i.b-i.t)*s.thickness,s._offsetShift=Math.floor(s.borderwidth/2)}}e._rangeSliderData=n},X.autoMarginOpts=function(e,r){var i=e._fullLayout,n=r[A],o=r._id.charAt(0),a=0,s=0;if(r.side==="bottom"&&(a=r._depth,r.title.text!==i._dfltTitle[o])){s=1.5*r.title.font.size+10+n._offsetShift;var h=(r.title.text.match(c.BR_TAG_ALL)||[]).length;s+=h*r.title.font.size*E}return{x:0,y:r._counterDomainMin,l:0,r:0,t:0,b:n._height+a+Math.max(i.margin.b,s),pad:g.extraPad+n._offsetShift*2}}}),J4=Vt((X,V)=>{var c=qr(),g=Ns(),E=rc(),A=n1(),t=jb();V.exports=function(e,r,i){var n=e[i],o=r[i];if(!(n.rangeslider||r._requestRangeslider[o._id]))return;c.isPlainObject(n.rangeslider)||(n.rangeslider={});var a=n.rangeslider,s=g.newContainer(o,"rangeslider");function h(f,k){return c.coerce(a,s,A,f,k)}var v,m;function p(f,k){return c.coerce(v,m,t,f,k)}var y=h("visible");if(y){h("bgcolor",r.plot_bgcolor),h("bordercolor"),h("borderwidth"),h("thickness"),h("autorange",!o.isValidRange(a.range)),h("range");var l=r._subplots;if(l)for(var x=l.cartesian.filter(function(f){return f.substr(0,f.indexOf("y"))===E.name2id(i)}).map(function(f){return f.substr(f.indexOf("y"),f.length)}),b=c.simpleMap(x,E.id2name),S=0;S<b.length;S++){var T=b[S];v=a[T]||{},m=g.newContainer(s,T,"yaxis");var M=r[T],w;v.range&&M.isValidRange(v.range)&&(w="fixed");var u=p("rangemode",w);u!=="match"&&p("range",M.range.slice())}s._input=a}}}),Q4=Vt((X,V)=>{var c=rc().list,g=Kf().getAutoRange,E=a1();V.exports=function(A){for(var t=c(A,"x",!0),e=0;e<t.length;e++){var r=t[e],i=r[E.name];i&&i.visible&&i.autorange&&(i._input.autorange=!0,i._input.range=i.range=g(A,r))}}}),Y4=Vt((X,V)=>{var c=Ai(),g=Mi(),E=fu(),A=qr(),t=A.strTranslate,e=go(),r=vi(),i=u0(),n=Pc(),o=rc(),a=af(),s=tp(),h=a1();V.exports=function(u){for(var f=u._fullLayout,k=f._rangeSliderData,_=0;_<k.length;_++){var D=k[_][h.name];D._clipId=D._id+"-"+f._uid}function I(B){return B._name}var O=f._infolayer.selectAll("g."+h.containerClassName).data(k,I);O.exit().each(function(B){var R=B[h.name];f._topdefs.select("#"+R._clipId).remove()}).remove(),k.length!==0&&(O.enter().append("g").classed(h.containerClassName,!0).attr("pointer-events","all"),O.each(function(B){var R=c.select(this),L=B[h.name],F=f[o.id2name(B.anchor)],N=L[o.id2name(B.anchor)];if(L.range){var j=A.simpleMap(L.range,B.r2l),G=A.simpleMap(B.range,B.r2l),rt;G[0]<G[1]?rt=[Math.min(j[0],G[0]),Math.max(j[1],G[1])]:rt=[Math.max(j[0],G[0]),Math.min(j[1],G[1])],L.range=L._input.range=A.simpleMap(rt,B.l2r)}B.cleanRange("rangeslider.range");var ct=f._size,lt=B.domain;L._width=ct.w*(lt[1]-lt[0]);var tt=Math.round(ct.l+ct.w*lt[0]),Z=Math.round(ct.t+ct.h*(1-B._counterDomainMin)+(B.side==="bottom"?B._depth:0)+L._offsetShift+h.extraPad);R.attr("transform",t(tt,Z)),L._rl=A.simpleMap(L.range,B.r2l);var st=L._rl[0],$=L._rl[1],Q=$-st;if(L.p2d=function(Et){return Et/L._width*Q+st},L.d2p=function(Et){return(Et-st)/Q*L._width},B.rangebreaks){var nt=B.locateBreaks(st,$);if(nt.length){var Y,q,ot=0;for(Y=0;Y<nt.length;Y++)q=nt[Y],ot+=q.max-q.min;var it=L._width/($-st-ot),dt=[-it*st];for(Y=0;Y<nt.length;Y++)q=nt[Y],dt.push(dt[dt.length-1]-it*(q.max-q.min));for(L.d2p=function(Et){for(var Nt=dt[0],te=0;te<nt.length;te++){var Jt=nt[te];if(Et>=Jt.max)Nt=dt[te+1];else if(Et<Jt.min)break}return Nt+it*Et},Y=0;Y<nt.length;Y++)q=nt[Y],q.pmin=L.d2p(q.min),q.pmax=L.d2p(q.max);L.p2d=function(Et){for(var Nt=dt[0],te=0;te<nt.length;te++){var Jt=nt[te];if(Et>=Jt.pmax)Nt=dt[te+1];else if(Et<Jt.pmin)break}return(Et-Nt)/it}}}if(N.rangemode!=="match"){var wt=F.r2l(N.range[0]),xt=F.r2l(N.range[1]),Ft=xt-wt;L.d2pOppAxis=function(Et){return(Et-wt)/Ft*L._height}}R.call(l,u,B,L).call(x,u,B,L).call(b,u,B,L).call(T,u,B,L,N).call(M,u,B,L).call(w,u,B,L),m(R,u,B,L),y(R,u,B,L,F,N),B.side==="bottom"&&i.draw(u,B._id+"title",{propContainer:B,propName:B._name+".title",placeholder:f._dfltTitle.x,attributes:{x:B._offset+B._length/2,y:Z+L._height+L._offsetShift+10+1.5*B.title.font.size,"text-anchor":"middle"}})}))};function v(u){return typeof u.clientX=="number"?u.clientX:u.touches&&u.touches.length>0?u.touches[0].clientX:0}function m(u,f,k,_){if(f._context.staticPlot)return;var D=u.select("rect."+h.slideBoxClassName).node(),I=u.select("rect."+h.grabAreaMinClassName).node(),O=u.select("rect."+h.grabAreaMaxClassName).node();function B(){var R=c.event,L=R.target,F=v(R),N=F-u.node().getBoundingClientRect().left,j=_.d2p(k._rl[0]),G=_.d2p(k._rl[1]),rt=a.coverSlip();this.addEventListener("touchmove",ct),this.addEventListener("touchend",lt),rt.addEventListener("mousemove",ct),rt.addEventListener("mouseup",lt);function ct(tt){var Z=v(tt),st=+Z-F,$,Q,nt;switch(L){case D:if(nt="ew-resize",j+st>k._length||G+st<0)return;$=j+st,Q=G+st;break;case I:if(nt="col-resize",j+st>k._length)return;$=j+st,Q=G;break;case O:if(nt="col-resize",G+st<0)return;$=j,Q=G+st;break;default:nt="ew-resize",$=N,Q=N+st;break}if(Q<$){var Y=Q;Q=$,$=Y}_._pixelMin=$,_._pixelMax=Q,s(c.select(rt),nt),p(u,f,k,_)}function lt(){rt.removeEventListener("mousemove",ct),rt.removeEventListener("mouseup",lt),this.removeEventListener("touchmove",ct),this.removeEventListener("touchend",lt),A.removeElement(rt)}}u.on("mousedown",B),u.on("touchstart",B)}function p(u,f,k,_){function D(B){return k.l2r(A.constrain(B,_._rl[0],_._rl[1]))}var I=D(_.p2d(_._pixelMin)),O=D(_.p2d(_._pixelMax));window.requestAnimationFrame(function(){g.call("_guiRelayout",f,k._name+".range",[I,O])})}function y(u,f,k,_,D,I){var O=h.handleWidth/2;function B(tt){return A.constrain(tt,0,_._width)}function R(tt){return A.constrain(tt,0,_._height)}function L(tt){return A.constrain(tt,-O,_._width+O)}var F=B(_.d2p(k._rl[0])),N=B(_.d2p(k._rl[1]));if(u.select("rect."+h.slideBoxClassName).attr("x",F).attr("width",N-F),u.select("rect."+h.maskMinClassName).attr("width",F),u.select("rect."+h.maskMaxClassName).attr("x",N).attr("width",_._width-N),I.rangemode!=="match"){var j=_._height-R(_.d2pOppAxis(D._rl[1])),G=_._height-R(_.d2pOppAxis(D._rl[0]));u.select("rect."+h.maskMinOppAxisClassName).attr("x",F).attr("height",j).attr("width",N-F),u.select("rect."+h.maskMaxOppAxisClassName).attr("x",F).attr("y",G).attr("height",_._height-G).attr("width",N-F),u.select("rect."+h.slideBoxClassName).attr("y",j).attr("height",G-j)}var rt=.5,ct=Math.round(L(F-O))-rt,lt=Math.round(L(N-O))+rt;u.select("g."+h.grabberMinClassName).attr("transform",t(ct,rt)),u.select("g."+h.grabberMaxClassName).attr("transform",t(lt,rt))}function l(u,f,k,_){var D=A.ensureSingle(u,"rect",h.bgClassName,function(R){R.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),I=_.borderwidth%2===0?_.borderwidth:_.borderwidth-1,O=-_._offsetShift,B=e.crispRound(f,_.borderwidth);D.attr({width:_._width+I,height:_._height+I,transform:t(O,O),"stroke-width":B}).call(r.stroke,_.bordercolor).call(r.fill,_.bgcolor)}function x(u,f,k,_){var D=f._fullLayout,I=A.ensureSingleById(D._topdefs,"clipPath",_._clipId,function(O){O.append("rect").attr({x:0,y:0})});I.select("rect").attr({width:_._width,height:_._height})}function b(u,f,k,_){var D=f.calcdata,I=u.selectAll("g."+h.rangePlotClassName).data(k._subplotsWith,A.identity);I.enter().append("g").attr("class",function(B){return h.rangePlotClassName+" "+B}).call(e.setClipUrl,_._clipId,f),I.order(),I.exit().remove();var O;I.each(function(B,R){var L=c.select(this),F=R===0,N=o.getFromId(f,B,"y"),j=N._name,G=_[j],rt={data:[],layout:{xaxis:{type:k.type,domain:[0,1],range:_.range.slice(),calendar:k.calendar},width:_._width,height:_._height,margin:{t:0,b:0,l:0,r:0}},_context:f._context};k.rangebreaks&&(rt.layout.xaxis.rangebreaks=k.rangebreaks),rt.layout[j]={type:N.type,domain:[0,1],range:G.rangemode!=="match"?G.range.slice():N.range.slice(),calendar:N.calendar},N.rangebreaks&&(rt.layout[j].rangebreaks=N.rangebreaks),E.supplyDefaults(rt);var ct=rt._fullLayout.xaxis,lt=rt._fullLayout[j];ct.clearCalc(),ct.setScale(),lt.clearCalc(),lt.setScale();var tt={id:B,plotgroup:L,xaxis:ct,yaxis:lt,isRangePlot:!0};F?O=tt:(tt.mainplot="xy",tt.mainplotinfo=O),n.rangePlot(f,tt,S(D,B))})}function S(u,f){for(var k=[],_=0;_<u.length;_++){var D=u[_],I=D[0].trace;I.xaxis+I.yaxis===f&&k.push(D)}return k}function T(u,f,k,_,D){var I=A.ensureSingle(u,"rect",h.maskMinClassName,function(L){L.attr({x:0,y:0,"shape-rendering":"crispEdges"})});I.attr("height",_._height).call(r.fill,h.maskColor);var O=A.ensureSingle(u,"rect",h.maskMaxClassName,function(L){L.attr({y:0,"shape-rendering":"crispEdges"})});if(O.attr("height",_._height).call(r.fill,h.maskColor),D.rangemode!=="match"){var B=A.ensureSingle(u,"rect",h.maskMinOppAxisClassName,function(L){L.attr({y:0,"shape-rendering":"crispEdges"})});B.attr("width",_._width).call(r.fill,h.maskOppAxisColor);var R=A.ensureSingle(u,"rect",h.maskMaxOppAxisClassName,function(L){L.attr({y:0,"shape-rendering":"crispEdges"})});R.attr("width",_._width).style("border-top",h.maskOppBorder).call(r.fill,h.maskOppAxisColor)}}function M(u,f,k,_){if(!f._context.staticPlot){var D=A.ensureSingle(u,"rect",h.slideBoxClassName,function(I){I.attr({y:0,cursor:h.slideBoxCursor,"shape-rendering":"crispEdges"})});D.attr({height:_._height,fill:h.slideBoxFill})}}function w(u,f,k,_){var D=A.ensureSingle(u,"g",h.grabberMinClassName),I=A.ensureSingle(u,"g",h.grabberMaxClassName),O={x:0,width:h.handleWidth,rx:h.handleRadius,fill:r.background,stroke:r.defaultLine,"stroke-width":h.handleStrokeWidth,"shape-rendering":"crispEdges"},B={y:Math.round(_._height/4),height:Math.round(_._height/2)},R=A.ensureSingle(D,"rect",h.handleMinClassName,function(G){G.attr(O)});R.attr(B);var L=A.ensureSingle(I,"rect",h.handleMaxClassName,function(G){G.attr(O)});L.attr(B);var F={width:h.grabAreaWidth,x:0,y:0,fill:h.grabAreaFill,cursor:f._context.staticPlot?void 0:h.grabAreaCursor},N=A.ensureSingle(D,"rect",h.grabAreaMinClassName,function(G){G.attr(F)});N.attr("height",_._height);var j=A.ensureSingle(I,"rect",h.grabAreaMaxClassName,function(G){G.attr(F)});j.attr("height",_._height)}}),K4=Vt((X,V)=>{var c=qr(),g=n1(),E=jb(),A=$4();V.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:c.extendFlat({},g,{yaxis:E})}}},layoutAttributes:n1(),handleDefaults:J4(),calcAutorange:Q4(),draw:Y4(),isVisible:A.isVisible,makeData:A.makeData,autoMarginOpts:A.autoMarginOpts}}),i1=Vt((X,V)=>{var c=Nl(),g=Hc(),E=Ns().templatedArray,A=E("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});V.exports={visible:{valType:"boolean",editType:"plot"},buttons:A,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:c({editType:"plot"}),bgcolor:{valType:"color",dflt:g.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:g.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}),Nb=Vt((X,V)=>{V.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}),tA=Vt((X,V)=>{var c=qr(),g=vi(),E=Ns(),A=Gh(),t=i1(),e=Nb();V.exports=function(n,o,a,s,h){var v=n.rangeselector||{},m=E.newContainer(o,"rangeselector");function p(S,T){return c.coerce(v,m,t,S,T)}var y=A(v,m,{name:"buttons",handleItemDefaults:r,calendar:h}),l=p("visible",y.length>0);if(l){var x=i(o,a,s);p("x",x[0]),p("y",x[1]),c.noneOrAll(n,o,["x","y"]),p("xanchor"),p("yanchor"),c.coerceFont(p,"font",a.font);var b=p("bgcolor");p("activecolor",g.contrast(b,e.lightAmount,e.darkAmount)),p("bordercolor"),p("borderwidth")}};function r(n,o,a,s){var h=s.calendar;function v(y,l){return c.coerce(n,o,t.buttons,y,l)}var m=v("visible");if(m){var p=v("step");p!=="all"&&(h&&h!=="gregorian"&&(p==="month"||p==="year")?o.stepmode="backward":v("stepmode"),v("count")),v("label")}}function i(n,o,a){for(var s=a.filter(function(p){return o[p].anchor===n._id}),h=0,v=0;v<s.length;v++){var m=o[s[v]].domain;m&&(h=Math.max(m[1],h))}return[n.domain[0],h+e.yPad]}}),eA=Vt((X,V)=>{var c=V_(),g=qr().titleCase;V.exports=function(A,t){var e=A._name,r={};if(t.step==="all")r[e+".autorange"]=!0;else{var i=E(A,t);r[e+".range[0]"]=i[0],r[e+".range[1]"]=i[1]}return r};function E(A,t){var e=A.range,r=new Date(A.r2l(e[1])),i=t.step,n=c["utc"+g(i)],o=t.count,a;switch(t.stepmode){case"backward":a=A.l2r(+n.offset(r,-o));break;case"todate":var s=n.offset(r,-o);a=A.l2r(+n.ceil(s));break}var h=e[1];return[a,h]}}),rA=Vt((X,V)=>{var c=Ai(),g=Mi(),E=fu(),A=vi(),t=go(),e=qr(),r=e.strTranslate,i=sl(),n=rc(),o=nh(),a=o.LINE_SPACING,s=o.FROM_TL,h=o.FROM_BR,v=Nb(),m=eA();V.exports=function(w){var u=w._fullLayout,f=u._infolayer.selectAll(".rangeselector").data(p(w),y);f.enter().append("g").classed("rangeselector",!0),f.exit().remove(),f.style({cursor:"pointer","pointer-events":"all"}),f.each(function(k){var _=c.select(this),D=k,I=D.rangeselector,O=_.selectAll("g.button").data(e.filterVisible(I.buttons));O.enter().append("g").classed("button",!0),O.exit().remove(),O.each(function(B){var R=c.select(this),L=m(D,B);B._isActive=l(D,B,L),R.call(x,I,B),R.call(S,I,B,w),R.on("click",function(){w._dragged||g.call("_guiRelayout",w,L)}),R.on("mouseover",function(){B._isHovered=!0,R.call(x,I,B)}),R.on("mouseout",function(){B._isHovered=!1,R.call(x,I,B)})}),M(w,O,I,D._name,_)})};function p(w){for(var u=n.list(w,"x",!0),f=[],k=0;k<u.length;k++){var _=u[k];_.rangeselector&&_.rangeselector.visible&&f.push(_)}return f}function y(w){return w._id}function l(w,u,f){if(u.step==="all")return w.autorange===!0;var k=Object.keys(f);return w.range[0]===f[k[0]]&&w.range[1]===f[k[1]]}function x(w,u,f){var k=e.ensureSingle(w,"rect","selector-rect",function(_){_.attr("shape-rendering","crispEdges")});k.attr({rx:v.rx,ry:v.ry}),k.call(A.stroke,u.bordercolor).call(A.fill,b(u,f)).style("stroke-width",u.borderwidth+"px")}function b(w,u){return u._isActive||u._isHovered?w.activecolor:w.bgcolor}function S(w,u,f,k){function _(I){i.convertToTspans(I,k)}var D=e.ensureSingle(w,"text","selector-text",function(I){I.attr("text-anchor","middle")});D.call(t.font,u.font).text(T(f,k._fullLayout._meta)).call(_)}function T(w,u){return w.label?u?e.templateString(w.label,u):w.label:w.step==="all"?"all":w.count+w.step.charAt(0)}function M(w,u,f,k,_){var D=0,I=0,O=f.borderwidth;u.each(function(){var j=c.select(this),G=j.select(".selector-text"),rt=f.font.size*a,ct=Math.max(rt*i.lineCount(G),16)+3;I=Math.max(I,ct)}),u.each(function(){var j=c.select(this),G=j.select(".selector-rect"),rt=j.select(".selector-text"),ct=rt.node()&&t.bBox(rt.node()).width,lt=f.font.size*a,tt=i.lineCount(rt),Z=Math.max(ct+10,v.minButtonWidth);j.attr("transform",r(O+D,O)),G.attr({x:0,y:0,width:Z,height:I}),i.positionText(rt,Z/2,I/2-(tt-1)*lt/2+3),D+=Z+5});var B=w._fullLayout._size,R=B.l+B.w*f.x,L=B.t+B.h*(1-f.y),F="left";e.isRightAnchor(f)&&(R-=D,F="right"),e.isCenterAnchor(f)&&(R-=D/2,F="center");var N="top";e.isBottomAnchor(f)&&(L-=I,N="bottom"),e.isMiddleAnchor(f)&&(L-=I/2,N="middle"),D=Math.ceil(D),I=Math.ceil(I),R=Math.round(R),L=Math.round(L),E.autoMargin(w,k+"-range-selector",{x:f.x,y:f.y,l:D*s[F],r:D*h[F],b:I*h[N],t:I*s[N]}),_.attr("transform",r(R,L))}}),nA=Vt((X,V)=>{V.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:i1()}}},layoutAttributes:i1(),handleDefaults:tA(),draw:rA()}}),pu=Vt(X=>{var V=po().extendFlat;X.attributes=function(c,g){c=c||{},g=g||{};var E={valType:"info_array",editType:c.editType,items:[{valType:"number",min:0,max:1,editType:c.editType},{valType:"number",min:0,max:1,editType:c.editType}],dflt:[0,1]};c.name&&c.name+"",c.trace,g.description&&""+g.description;var A={x:V({},E,{}),y:V({},E,{}),editType:c.editType};return c.noGridCell||(A.row={valType:"integer",min:0,dflt:0,editType:c.editType},A.column={valType:"integer",min:0,dflt:0,editType:c.editType}),A},X.defaults=function(c,g,E,A){var t=A&&A.x||[0,1],e=A&&A.y||[0,1],r=g.grid;if(r){var i=E("domain.column");i!==void 0&&(i<r.columns?t=r._domains.x[i]:delete c.domain.column);var n=E("domain.row");n!==void 0&&(n<r.rows?e=r._domains.y[n]:delete c.domain.row)}var o=E("domain.x",t),a=E("domain.y",e);o[0]<o[1]||(c.domain.x=t.slice()),a[0]<a[1]||(c.domain.y=e.slice())}}),Ub=Vt((X,V)=>{var c=qr(),g=gg().counter,E=pu().attributes,A=xh().idRegex,t=Ns(),e={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[g("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[A.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[A.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:E({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function r(s,h,v){var m=h[v+"axes"],p=Object.keys((s._splomAxes||{})[v]||{});if(Array.isArray(m))return m;if(p.length)return p}function i(s,h){var v=s.grid||{},m=r(h,v,"x"),p=r(h,v,"y");if(!s.grid&&!m&&!p)return;var y=Array.isArray(v.subplots)&&Array.isArray(v.subplots[0]),l=Array.isArray(m),x=Array.isArray(p),b=l&&m!==v.xaxes&&x&&p!==v.yaxes,S,T;y?(S=v.subplots.length,T=v.subplots[0].length):(x&&(S=p.length),l&&(T=m.length));var M=t.newContainer(h,"grid");function w(L,F){return c.coerce(v,M,e,L,F)}var u=w("rows",S),f=w("columns",T);if(!(u*f>1)){delete h.grid;return}if(!y&&!l&&!x){var k=w("pattern")==="independent";k&&(y=!0)}M._hasSubplotGrid=y;var _=w("roworder"),D=_==="top to bottom",I=y?.2:.1,O=y?.3:.1,B,R;b&&h._splomGridDflt&&(B=h._splomGridDflt.xside,R=h._splomGridDflt.yside),M._domains={x:n("x",w,I,B,f),y:n("y",w,O,R,u,D)}}function n(s,h,v,m,p,y){var l=h(s+"gap",v),x=h("domain."+s);h(s+"side",m);for(var b=new Array(p),S=x[0],T=(x[1]-S)/(p-l),M=T*(1-l),w=0;w<p;w++){var u=S+T*w;b[y?p-1-w:w]=[u,u+M]}return b}function o(s,h){var v=h.grid;if(!(!v||!v._domains)){var m=s.grid||{},p=h._subplots,y=v._hasSubplotGrid,l=v.rows,x=v.columns,b=v.pattern==="independent",S,T,M,w,u,f,k,_=v._axisMap={};if(y){var D=m.subplots||[];f=v.subplots=new Array(l);var I=1;for(S=0;S<l;S++){var O=f[S]=new Array(x),B=D[S]||[];for(T=0;T<x;T++)if(b?(u=I===1?"xy":"x"+I+"y"+I,I++):u=B[T],O[T]="",p.cartesian.indexOf(u)!==-1){if(k=u.indexOf("y"),M=u.slice(0,k),w=u.slice(k),_[M]!==void 0&&_[M]!==T||_[w]!==void 0&&_[w]!==S)continue;O[T]=u,_[M]=T,_[w]=S}}}else{var R=r(h,m,"x"),L=r(h,m,"y");v.xaxes=a(R,p.xaxis,x,_,"x"),v.yaxes=a(L,p.yaxis,l,_,"y")}var F=v._anchors={},N=v.roworder==="top to bottom";for(var j in _){var G=j.charAt(0),rt=v[G+"side"],ct,lt,tt;if(rt.length<8)F[j]="free";else if(G==="x"){if(rt.charAt(0)==="t"===N?(ct=0,lt=1,tt=l):(ct=l-1,lt=-1,tt=-1),y){var Z=_[j];for(S=ct;S!==tt;S+=lt)if(u=f[S][Z],!!u&&(k=u.indexOf("y"),u.slice(0,k)===j)){F[j]=u.slice(k);break}}else for(S=ct;S!==tt;S+=lt)if(w=v.yaxes[S],p.cartesian.indexOf(j+w)!==-1){F[j]=w;break}}else if(rt.charAt(0)==="l"?(ct=0,lt=1,tt=x):(ct=x-1,lt=-1,tt=-1),y){var st=_[j];for(S=ct;S!==tt;S+=lt)if(u=f[st][S],!!u&&(k=u.indexOf("y"),u.slice(k)===j)){F[j]=u.slice(0,k);break}}else for(S=ct;S!==tt;S+=lt)if(M=v.xaxes[S],p.cartesian.indexOf(M+j)!==-1){F[j]=M;break}}}}function a(s,h,v,m,p){var y=new Array(v),l;function x(b,S){h.indexOf(S)!==-1&&m[S]===void 0?(y[b]=S,m[S]=b):y[b]=""}if(Array.isArray(s))for(l=0;l<v;l++)x(l,s[l]);else for(x(0,p),l=1;l<v;l++)x(l,p+(l+1));return y}V.exports={moduleType:"component",name:"grid",schema:{layout:{grid:e}},layoutAttributes:e,sizeDefaults:i,contentDefaults:o}}),Vb=Vt((X,V)=>{V.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc"}}),aA=Vt((X,V)=>{var c=vo(),g=Mi(),E=qr(),A=Ns(),t=Vb();V.exports=function(e,r,i,n){var o="error_"+n.axis,a=A.newContainer(r,o),s=e[o]||{};function h(b,S){return E.coerce(s,a,t,b,S)}var v=s.array!==void 0||s.value!==void 0||s.type==="sqrt",m=h("visible",v);if(m!==!1){var p=h("type","array"in s?"data":"percent"),y=!0;p!=="sqrt"&&(y=h("symmetric",!((p==="data"?"arrayminus":"valueminus")in s))),p==="data"?(h("array"),h("traceref"),y||(h("arrayminus"),h("tracerefminus"))):(p==="percent"||p==="constant")&&(h("value"),y||h("valueminus"));var l="copy_"+n.inherit+"style";if(n.inherit){var x=r["error_"+n.inherit];(x||{}).visible&&h(l,!(s.color||c(s.thickness)||c(s.width)))}(!n.inherit||!a[l])&&(h("color",i),h("thickness"),h("width",g.traceIs(r,"gl3d")?0:4))}}}),qb=Vt((X,V)=>{V.exports=function(g){var E=g.type,A=g.symmetric;if(E==="data"){var t=g.array||[];if(A)return function(n,o){var a=+t[o];return[a,a]};var e=g.arrayminus||[];return function(n,o){var a=+t[o],s=+e[o];return!isNaN(a)||!isNaN(s)?[s||0,a||0]:[NaN,NaN]}}else{var r=c(E,g.value),i=c(E,g.valueminus);return A||g.valueminus===void 0?function(n){var o=r(n);return[o,o]}:function(n){return[i(n),r(n)]}}};function c(g,E){if(g==="percent")return function(A){return Math.abs(A*E/100)};if(g==="constant")return function(){return Math.abs(E)};if(g==="sqrt")return function(A){return Math.sqrt(Math.abs(A))}}}),iA=Vt((X,V)=>{var c=vo(),g=Mi(),E=ao(),A=qr(),t=qb();V.exports=function(r){for(var i=r.calcdata,n=0;n<i.length;n++){var o=i[n],a=o[0].trace;if(a.visible===!0&&g.traceIs(a,"errorBarsOK")){var s=E.getFromId(r,a.xaxis),h=E.getFromId(r,a.yaxis);e(o,a,s,"x"),e(o,a,h,"y")}}};function e(r,i,n,o){var a=i["error_"+o]||{},s=a.visible&&["linear","log"].indexOf(n.type)!==-1,h=[];if(s){for(var v=t(a),m=0;m<r.length;m++){var p=r[m],y=p.i;if(y===void 0)y=m;else if(y===null)continue;var l=p[o];if(c(n.c2l(l))){var x=v(l,y);if(c(x[0])&&c(x[1])){var b=p[o+"s"]=l-x[0],S=p[o+"h"]=l+x[1];h.push(b,S)}}}var T=n._id,M=i._extremes[T],w=E.findExtremes(n,h,A.extendFlat({tozero:M.opts.tozero},{padded:!0}));M.min=M.min.concat(w.min),M.max=M.max.concat(w.max)}}}),oA=Vt((X,V)=>{var c=Ai(),g=vo(),E=go(),A=Sl();V.exports=function(e,r,i,n){var o,a=i.xaxis,s=i.yaxis,h=n&&n.duration>0,v=e._context.staticPlot;r.each(function(m){var p=m[0].trace,y=p.error_x||{},l=p.error_y||{},x;p.ids&&(x=function(M){return M.id});var b=A.hasMarkers(p)&&p.marker.maxdisplayed>0;!l.visible&&!y.visible&&(m=[]);var S=c.select(this).selectAll("g.errorbar").data(m,x);if(S.exit().remove(),!!m.length){y.visible||S.selectAll("path.xerror").remove(),l.visible||S.selectAll("path.yerror").remove(),S.style("opacity",1);var T=S.enter().append("g").classed("errorbar",!0);h&&T.style("opacity",0).transition().duration(n.duration).style("opacity",1),E.setClipUrl(S,i.layerClipId,e),S.each(function(M){var w=c.select(this),u=t(M,a,s);if(!(b&&!M.vis)){var f,k=w.select("path.yerror");if(l.visible&&g(u.x)&&g(u.yh)&&g(u.ys)){var _=l.width;f="M"+(u.x-_)+","+u.yh+"h"+2*_+"m-"+_+",0V"+u.ys,u.noYS||(f+="m-"+_+",0h"+2*_),o=!k.size(),o?k=w.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("yerror",!0):h&&(k=k.transition().duration(n.duration).ease(n.easing)),k.attr("d",f)}else k.remove();var D=w.select("path.xerror");if(y.visible&&g(u.y)&&g(u.xh)&&g(u.xs)){var I=(y.copy_ystyle?l:y).width;f="M"+u.xh+","+(u.y-I)+"v"+2*I+"m0,-"+I+"H"+u.xs,u.noXS||(f+="m0,-"+I+"v"+2*I),o=!D.size(),o?D=w.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("xerror",!0):h&&(D=D.transition().duration(n.duration).ease(n.easing)),D.attr("d",f)}else D.remove()}})}})};function t(e,r,i){var n={x:r.c2p(e.x),y:i.c2p(e.y)};return e.yh!==void 0&&(n.yh=i.c2p(e.yh),n.ys=i.c2p(e.ys),g(n.ys)||(n.noYS=!0,n.ys=i.c2p(e.ys,!0))),e.xh!==void 0&&(n.xh=r.c2p(e.xh),n.xs=r.c2p(e.xs),g(n.xs)||(n.noXS=!0,n.xs=r.c2p(e.xs,!0))),n}}),sA=Vt((X,V)=>{var c=Ai(),g=vi();V.exports=function(E){E.each(function(A){var t=A[0].trace,e=t.error_y||{},r=t.error_x||{},i=c.select(this);i.selectAll("path.yerror").style("stroke-width",e.thickness+"px").call(g.stroke,e.color),r.copy_ystyle&&(r=e),i.selectAll("path.xerror").style("stroke-width",r.thickness+"px").call(g.stroke,r.color)})}}),lA=Vt((X,V)=>{var c=qr(),g=su().overrideAll,E=Vb(),A={error_x:c.extendFlat({},E),error_y:c.extendFlat({},E)};delete A.error_x.copy_zstyle,delete A.error_y.copy_zstyle,delete A.error_y.copy_ystyle;var t={error_x:c.extendFlat({},E),error_y:c.extendFlat({},E),error_z:c.extendFlat({},E)};delete t.error_x.copy_ystyle,delete t.error_y.copy_ystyle,delete t.error_z.copy_ystyle,delete t.error_z.copy_zstyle,V.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:A,bar:A,histogram:A,scatter3d:g(t,"calc","nested"),scattergl:g(A,"calc","nested")}},supplyDefaults:aA(),calc:iA(),makeComputeError:qb(),plot:oA(),style:sA(),hoverInfo:e};function e(r,i,n){(i.error_y||{}).visible&&(n.yerr=r.yh-r.y,i.error_y.symmetric||(n.yerrneg=r.y-r.ys)),(i.error_x||{}).visible&&(n.xerr=r.xh-r.x,i.error_x.symmetric||(n.xerrneg=r.x-r.xs))}}),uA=Vt((X,V)=>{V.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}),cA=Vt((X,V)=>{var c=Ai(),g=yh(),E=fu(),A=Mi(),t=ao(),e=af(),r=qr(),i=r.strTranslate,n=po().extendFlat,o=tp(),a=go(),s=vi(),h=u0(),v=sl(),m=pf().flipScale,p=Hm(),y=Ky(),l=Ih(),x=nh(),b=x.LINE_SPACING,S=x.FROM_TL,T=x.FROM_BR,M=uA().cn;function w(I){var O=I._fullLayout,B=O._infolayer.selectAll("g."+M.colorbar).data(u(I),function(R){return R._id});B.enter().append("g").attr("class",function(R){return R._id}).classed(M.colorbar,!0),B.each(function(R){var L=c.select(this);r.ensureSingle(L,"rect",M.cbbg),r.ensureSingle(L,"g",M.cbfills),r.ensureSingle(L,"g",M.cblines),r.ensureSingle(L,"g",M.cbaxis,function(N){N.classed(M.crisp,!0)}),r.ensureSingle(L,"g",M.cbtitleunshift,function(N){N.append("g").classed(M.cbtitle,!0)}),r.ensureSingle(L,"rect",M.cboutline);var F=f(L,R,I);F&&F.then&&(I._promises||[]).push(F),I._context.edits.colorbarPosition&&k(L,R,I)}),B.exit().each(function(R){E.autoMargin(I,R._id)}).remove(),B.order()}function u(I){var O=I._fullLayout,B=I.calcdata,R=[],L,F,N,j;function G(q){return n(q,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function rt(){typeof j.calc=="function"?j.calc(I,N,L):(L._fillgradient=F.reversescale?m(F.colorscale):F.colorscale,L._zrange=[F[j.min],F[j.max]])}for(var ct=0;ct<B.length;ct++){var lt=B[ct];if(N=lt[0].trace,!!N._module){var tt=N._module.colorbar;if(N.visible===!0&&tt)for(var Z=Array.isArray(tt),st=Z?tt:[tt],$=0;$<st.length;$++){j=st[$];var Q=j.container;F=Q?N[Q]:N,F&&F.showscale&&(L=G(F.colorbar),L._id="cb"+N.uid+(Z&&Q?"-"+Q:""),L._traceIndex=N.index,L._propPrefix=(Q?Q+".":"")+"colorbar.",L._meta=N._meta,rt(),R.push(L))}}}for(var nt in O._colorAxes)if(F=O[nt],F.showscale){var Y=O._colorAxes[nt];L=G(F.colorbar),L._id="cb"+nt,L._propPrefix=nt+".colorbar.",L._meta=O._meta,j={min:"cmin",max:"cmax"},Y[0]!=="heatmap"&&(N=Y[1],j.calc=N._module.colorbar.calc),rt(),R.push(L)}return R}function f(I,O,B){var R=O.orientation==="v",L=O.len,F=O.lenmode,N=O.thickness,j=O.thicknessmode,G=O.outlinewidth,rt=O.borderwidth,ct=O.bgcolor,lt=O.xanchor,tt=O.yanchor,Z=O.xpad,st=O.ypad,$=O.x,Q=R?O.y:1-O.y,nt=O.yref==="paper",Y=O.xref==="paper",q=B._fullLayout,ot=q._size,it=O._fillcolor,dt=O._line,wt=O.title,xt=wt.side,Ft=O._zrange||c.extent((typeof it=="function"?it:dt.color).domain()),Et=typeof dt.color=="function"?dt.color:function(){return dt.color},Nt=typeof it=="function"?it:function(){return it},te=O._levels,Jt=_(B,O,Ft),Qt=Jt.fill,Wt=Jt.line,gt=Math.round(N*(j==="fraction"?R?ot.w:ot.h:1)),bt=gt/(R?ot.w:ot.h),vt=Math.round(L*(F==="fraction"?R?ot.h:ot.w:1)),Ut=vt/(R?ot.h:ot.w),Kt=Y?ot.w:B._fullLayout.width,Zt=nt?ot.h:B._fullLayout.height,le=Math.round(R?$*Kt+Z:Q*Zt+st),Te={center:.5,right:1}[lt]||0,Se={top:1,middle:.5}[tt]||0,Fe=R?$-Te*bt:Q-Se*bt,Oe=R?Q-Se*Ut:$-Te*Ut,ur=Math.round(R?Zt*(1-Oe):Kt*Oe);O._lenFrac=Ut,O._thickFrac=bt,O._uFrac=Fe,O._vFrac=Oe;var fr=O._axis=D(B,O,Ft);fr.position=bt+(R?$+Z/ot.w:Q+st/ot.h);var We=["top","bottom"].indexOf(xt)!==-1;if(R&&We&&(fr.title.side=xt,fr.titlex=$+Z/ot.w,fr.titley=Oe+(wt.side==="top"?Ut-st/ot.h:st/ot.h)),!R&&!We&&(fr.title.side=xt,fr.titley=Q+st/ot.h,fr.titlex=Oe+Z/ot.w),dt.color&&O.tickmode==="auto"){fr.tickmode="linear",fr.tick0=te.start;var Lr=te.size,kr=r.constrain(vt/50,4,15)+1,he=(Ft[1]-Ft[0])/((O.nticks||kr)*Lr);if(he>1){var Dt=Math.pow(10,Math.floor(Math.log(he)/Math.LN10));Lr*=Dt*r.roundUp(he/Dt,[2,5,10]),(Math.abs(te.start)/te.size+1e-6)%1<2e-6&&(fr.tick0=0)}fr.dtick=Lr}fr.domain=R?[Oe+st/ot.h,Oe+Ut-st/ot.h]:[Oe+Z/ot.w,Oe+Ut-Z/ot.w],fr.setScale(),I.attr("transform",i(Math.round(ot.l),Math.round(ot.t)));var qt=I.select("."+M.cbtitleunshift).attr("transform",i(-Math.round(ot.l),-Math.round(ot.t))),zt=fr.ticklabelposition,ut=fr.title.font.size,yt=I.select("."+M.cbaxis),Mt,Ot=0,$t=0;function ee(Ze,Ue){var mr={propContainer:fr,propName:O._propPrefix+"title",traceIndex:O._traceIndex,_meta:O._meta,placeholder:q._dfltTitle.colorbar,containerGroup:I.select("."+M.cbtitle)},ln=Ze.charAt(0)==="h"?Ze.substr(1):"h"+Ze;I.selectAll("."+ln+",."+ln+"-math-group").remove(),h.draw(B,Ze,n(mr,Ue||{}))}function we(){if(R&&We||!R&&!We){var Ze,Ue;xt==="top"&&(Ze=Z+ot.l+Kt*$,Ue=st+ot.t+Zt*(1-Oe-Ut)+3+ut*.75),xt==="bottom"&&(Ze=Z+ot.l+Kt*$,Ue=st+ot.t+Zt*(1-Oe)-3-ut*.25),xt==="right"&&(Ue=st+ot.t+Zt*Q+3+ut*.75,Ze=Z+ot.l+Kt*Oe),ee(fr._id+"title",{attributes:{x:Ze,y:Ue,"text-anchor":R?"start":"middle"}})}}function Me(){if(R&&!We||!R&&We){var Ze=fr.position||0,Ue=fr._offset+fr._length/2,mr,ln;if(xt==="right")ln=Ue,mr=ot.l+Kt*Ze+10+ut*(fr.showticklabels?1:.5);else if(mr=Ue,xt==="bottom"&&(ln=ot.t+Zt*Ze+10+(zt.indexOf("inside")===-1?fr.tickfont.size:0)+(fr.ticks!=="intside"&&O.ticklen||0)),xt==="top"){var an=wt.text.split("<br>").length;ln=ot.t+Zt*Ze+10-gt-b*ut*an}ee((R?"h":"v")+fr._id+"title",{avoid:{selection:c.select(B).selectAll("g."+fr._id+"tick"),side:xt,offsetTop:R?0:ot.t,offsetLeft:R?ot.l:0,maxShift:R?q.width:q.height},attributes:{x:mr,y:ln,"text-anchor":"middle"},transform:{rotate:R?-90:0,offset:0}})}}function Re(){if(!R&&!We||R&&We){var Ze=I.select("."+M.cbtitle),Ue=Ze.select("text"),mr=[-G/2,G/2],ln=Ze.select(".h"+fr._id+"title-math-group").node(),an=15.6;Ue.node()&&(an=parseInt(Ue.node().style.fontSize,10)*b);var vn;if(ln?(vn=a.bBox(ln),$t=vn.width,Ot=vn.height,Ot>an&&(mr[1]-=(Ot-an)/2)):Ue.node()&&!Ue.classed(M.jsPlaceholder)&&(vn=a.bBox(Ue.node()),$t=vn.width,Ot=vn.height),R){if(Ot){if(Ot+=5,xt==="top")fr.domain[1]-=Ot/ot.h,mr[1]*=-1;else{fr.domain[0]+=Ot/ot.h;var Sn=v.lineCount(Ue);mr[1]+=(1-Sn)*an}Ze.attr("transform",i(mr[0],mr[1])),fr.setScale()}}else $t&&(xt==="right"&&(fr.domain[0]+=($t+ut/2)/ot.w),Ze.attr("transform",i(mr[0],mr[1])),fr.setScale())}I.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",R?i(0,Math.round(ot.h*(1-fr.domain[1]))):i(Math.round(ot.w*fr.domain[0]),0)),yt.attr("transform",R?i(0,Math.round(-ot.t)):i(Math.round(-ot.l),0));var An=I.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(Qt);An.enter().append("rect").classed(M.cbfill,!0).attr("style",""),An.exit().remove();var pn=Ft.map(fr.c2p).map(Math.round).sort(function(je,Ne){return je-Ne});An.each(function(je,Ne){var _r=[Ne===0?Ft[0]:(Qt[Ne]+Qt[Ne-1])/2,Ne===Qt.length-1?Ft[1]:(Qt[Ne]+Qt[Ne+1])/2].map(fr.c2p).map(Math.round);R&&(_r[1]=r.constrain(_r[1]+(_r[1]>_r[0])?1:-1,pn[0],pn[1]));var Xr=c.select(this).attr(R?"x":"y",le).attr(R?"y":"x",c.min(_r)).attr(R?"width":"height",Math.max(gt,2)).attr(R?"height":"width",Math.max(c.max(_r)-c.min(_r),2));if(O._fillgradient)a.gradient(Xr,B,O._id,R?"vertical":"horizontalreversed",O._fillgradient,"fill");else{var rn=Nt(je).replace("e-","");Xr.attr("fill",g(rn).toHexString())}});var On=I.select("."+M.cblines).selectAll("path."+M.cbline).data(dt.color&&dt.width?Wt:[]);On.enter().append("path").classed(M.cbline,!0),On.exit().remove(),On.each(function(je){var Ne=le,_r=Math.round(fr.c2p(je))+dt.width/2%1;c.select(this).attr("d","M"+(R?Ne+","+_r:_r+","+Ne)+(R?"h":"v")+gt).call(a.lineGroupStyle,dt.width,Et(je),dt.dash)}),yt.selectAll("g."+fr._id+"tick,path").remove();var Nn=le+gt+(G||0)/2-(O.ticks==="outside"?1:0),ke=t.calcTicks(fr),ze=t.getTickSigns(fr)[2];return t.drawTicks(B,fr,{vals:fr.ticks==="inside"?t.clipEnds(fr,ke):ke,layer:yt,path:t.makeTickPath(fr,Nn,ze),transFn:t.makeTransTickFn(fr)}),t.drawLabels(B,fr,{vals:ke,layer:yt,transFn:t.makeTransTickLabelFn(fr),labelFns:t.makeLabelFns(fr,Nn)})}function Be(){var Ze,Ue=gt+G/2;zt.indexOf("inside")===-1&&(Ze=a.bBox(yt.node()),Ue+=R?Ze.width:Ze.height),Mt=qt.select("text");var mr=0,ln=R&&xt==="top",an=!R&&xt==="right",vn=0;if(Mt.node()&&!Mt.classed(M.jsPlaceholder)){var Sn,An=qt.select(".h"+fr._id+"title-math-group").node();An&&(R&&We||!R&&!We)?(Ze=a.bBox(An),mr=Ze.width,Sn=Ze.height):(Ze=a.bBox(qt.node()),mr=Ze.right-ot.l-(R?le:ur),Sn=Ze.bottom-ot.t-(R?ur:le),!R&&xt==="top"&&(Ue+=Ze.height,vn=Ze.height)),an&&(Mt.attr("transform",i(mr/2+ut/2,0)),mr*=2),Ue=Math.max(Ue,R?mr:Sn)}var pn=(R?Z:st)*2+Ue+rt+G/2,On=0;!R&&wt.text&&tt==="bottom"&&Q<=0&&(On=pn/2,pn+=On,vn+=On),q._hColorbarMoveTitle=On,q._hColorbarMoveCBTitle=vn;var Nn=rt+G,ke=(R?le:ur)-Nn/2-(R?Z:0),ze=(R?ur:le)-(R?vt:st+vn-On);I.select("."+M.cbbg).attr("x",ke).attr("y",ze).attr(R?"width":"height",Math.max(pn-On,2)).attr(R?"height":"width",Math.max(vt+Nn,2)).call(s.fill,ct).call(s.stroke,O.bordercolor).style("stroke-width",rt);var je=an?Math.max(mr-10,0):0;I.selectAll("."+M.cboutline).attr("x",(R?le:ur+Z)+je).attr("y",(R?ur+st-vt:le)+(ln?Ot:0)).attr(R?"width":"height",Math.max(gt,2)).attr(R?"height":"width",Math.max(vt-(R?2*st+Ot:2*Z+je),2)).call(s.stroke,O.outlinecolor).style({fill:"none","stroke-width":G});var Ne=R?Te*pn:0,_r=R?0:(1-Se)*pn-vn;if(Ne=Y?ot.l-Ne:-Ne,_r=nt?ot.t-_r:-_r,I.attr("transform",i(Ne,_r)),!R&&(rt||g(ct).getAlpha()&&!g.equals(q.paper_bgcolor,ct))){var Xr=yt.selectAll("text"),rn=Xr[0].length,Br=I.select("."+M.cbbg).node(),_n=a.bBox(Br),bn=a.getTranslate(I),Fn=2;Xr.each(function(Dr,Ar){var Gr=0,Wr=rn-1;if(Ar===Gr||Ar===Wr){var Jr=a.bBox(this),_e=a.getTranslate(this),Je;if(Ar===Wr){var yr=Jr.right+_e.x,Hr=_n.right+bn.x+ur-rt-Fn+$;Je=Hr-yr,Je>0&&(Je=0)}else if(Ar===Gr){var hn=Jr.left+_e.x,En=_n.left+bn.x+ur+rt+Fn;Je=En-hn,Je<0&&(Je=0)}Je&&(rn<3?this.setAttribute("transform","translate("+Je+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var on={},Bn=S[lt],ue=T[lt],xe=S[tt],Pr=T[tt],Sr=pn-gt;R?(F==="pixels"?(on.y=Q,on.t=vt*xe,on.b=vt*Pr):(on.t=on.b=0,on.yt=Q+L*xe,on.yb=Q-L*Pr),j==="pixels"?(on.x=$,on.l=pn*Bn,on.r=pn*ue):(on.l=Sr*Bn,on.r=Sr*ue,on.xl=$-N*Bn,on.xr=$+N*ue)):(F==="pixels"?(on.x=$,on.l=vt*Bn,on.r=vt*ue):(on.l=on.r=0,on.xl=$+L*Bn,on.xr=$-L*ue),j==="pixels"?(on.y=1-Q,on.t=pn*xe,on.b=pn*Pr):(on.t=Sr*xe,on.b=Sr*Pr,on.yt=Q-N*xe,on.yb=Q+N*Pr));var gr=O.y<.5?"b":"t",dr=O.x<.5?"l":"r";B._fullLayout._reservedMargin[O._id]={};var Er={r:q.width-ke-Ne,l:ke+on.r,b:q.height-ze-_r,t:ze+on.b};Y&&nt?E.autoMargin(B,O._id,on):Y?B._fullLayout._reservedMargin[O._id][gr]=Er[gr]:nt||R?B._fullLayout._reservedMargin[O._id][dr]=Er[dr]:B._fullLayout._reservedMargin[O._id][gr]=Er[gr]}return r.syncOrAsync([E.previousPromises,we,Re,Me,E.previousPromises,Be],B)}function k(I,O,B){var R=O.orientation==="v",L=B._fullLayout,F=L._size,N,j,G;e.init({element:I.node(),gd:B,prepFn:function(){N=I.attr("transform"),o(I)},moveFn:function(rt,ct){I.attr("transform",N+i(rt,ct)),j=e.align((R?O._uFrac:O._vFrac)+rt/F.w,R?O._thickFrac:O._lenFrac,0,1,O.xanchor),G=e.align((R?O._vFrac:1-O._uFrac)-ct/F.h,R?O._lenFrac:O._thickFrac,0,1,O.yanchor);var lt=e.getCursor(j,G,O.xanchor,O.yanchor);o(I,lt)},doneFn:function(){if(o(I),j!==void 0&&G!==void 0){var rt={};rt[O._propPrefix+"x"]=j,rt[O._propPrefix+"y"]=G,O._traceIndex!==void 0?A.call("_guiRestyle",B,rt,O._traceIndex):A.call("_guiRelayout",B,rt)}}})}function _(I,O,B){var R=O._levels,L=[],F=[],N,j,G=R.end+R.size/100,rt=R.size,ct=1.001*B[0]-.001*B[1],lt=1.001*B[1]-.001*B[0];for(j=0;j<1e5&&(N=R.start+j*rt,!(rt>0?N>=G:N<=G));j++)N>ct&&N<lt&&L.push(N);if(O._fillgradient)F=[0];else if(typeof O._fillcolor=="function"){var tt=O._filllevels;if(tt)for(G=tt.end+tt.size/100,rt=tt.size,j=0;j<1e5&&(N=tt.start+j*rt,!(rt>0?N>=G:N<=G));j++)N>B[0]&&N<B[1]&&F.push(N);else F=L.map(function(Z){return Z-R.size/2}),F.push(F[F.length-1]+R.size)}else O._fillcolor&&typeof O._fillcolor=="string"&&(F=[0]);return R.size<0&&(L.reverse(),F.reverse()),{line:L,fill:F}}function D(I,O,B){var R=I._fullLayout,L=O.orientation==="v",F={type:"linear",range:B,tickmode:O.tickmode,nticks:O.nticks,tick0:O.tick0,dtick:O.dtick,tickvals:O.tickvals,ticktext:O.ticktext,ticks:O.ticks,ticklen:O.ticklen,tickwidth:O.tickwidth,tickcolor:O.tickcolor,showticklabels:O.showticklabels,labelalias:O.labelalias,ticklabelposition:O.ticklabelposition,ticklabeloverflow:O.ticklabeloverflow,ticklabelstep:O.ticklabelstep,tickfont:O.tickfont,tickangle:O.tickangle,tickformat:O.tickformat,exponentformat:O.exponentformat,minexponent:O.minexponent,separatethousands:O.separatethousands,showexponent:O.showexponent,showtickprefix:O.showtickprefix,tickprefix:O.tickprefix,showticksuffix:O.showticksuffix,ticksuffix:O.ticksuffix,title:O.title,showline:!0,anchor:"free",side:L?"right":"bottom",position:1},N=L?"y":"x",j={type:"linear",_id:N+O._id},G={letter:N,font:R.font,noAutotickangles:N==="y",noHover:!0,noTickson:!0,noTicklabelmode:!0,noInsideRange:!0,calendar:R.calendar};function rt(ct,lt){return r.coerce(F,j,l,ct,lt)}return p(F,j,rt,G,R),y(F,j,rt,G),j}V.exports={draw:w}}),hA=Vt((X,V)=>{V.exports={moduleType:"component",name:"colorbar",attributes:jy(),supplyDefaults:ib(),draw:cA().draw,hasColorbar:rb()}}),fA=Vt((X,V)=>{V.exports={moduleType:"component",name:"legend",layoutAttributes:lb(),supplyLayoutDefaults:ub(),draw:fb(),style:hb()}}),pA=Vt((X,V)=>{V.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}),dA=Vt((X,V)=>{V.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}),Hb=Vt((X,V)=>{var c=Mi(),g=qr(),E=g.extendFlat,A=g.extendDeep;function t(r){var i;switch(r){case"themes__thumb":i={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":i={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:i={}}return i}function e(r){var i=["xaxis","yaxis","zaxis"];return i.indexOf(r.slice(0,5))>-1}V.exports=function(r,i){var n,o=r.data,a=r.layout,s=A([],o),h=A({},a,t(i.tileClass)),v=r._context||{};if(i.width&&(h.width=i.width),i.height&&(h.height=i.height),i.tileClass==="thumbnail"||i.tileClass==="themes__thumb"){h.annotations=[];var m=Object.keys(h);for(n=0;n<m.length;n++)e(m[n])&&(h[m[n]].title={text:""});for(n=0;n<s.length;n++){var p=s[n];p.showscale=!1,p.marker&&(p.marker.showscale=!1),c.traceIs(p,"pie-like")&&(p.textposition="none")}}if(Array.isArray(i.annotations))for(n=0;n<i.annotations.length;n++)h.annotations.push(i.annotations[n]);var y=Object.keys(h).filter(function(T){return T.match(/^scene\d*$/)});if(y.length){var l={};for(i.tileClass==="thumbnail"&&(l={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),n=0;n<y.length;n++){var x=h[y[n]];x.xaxis||(x.xaxis={}),x.yaxis||(x.yaxis={}),x.zaxis||(x.zaxis={}),E(x.xaxis,l),E(x.yaxis,l),E(x.zaxis,l),x._scene=null}}var b=document.createElement("div");i.tileClass&&(b.className=i.tileClass);var S={gd:b,td:b,layout:h,data:s,config:{staticPlot:i.staticPlot===void 0?!0:i.staticPlot,plotGlPixelRatio:i.plotGlPixelRatio===void 0?2:i.plotGlPixelRatio,displaylogo:i.displaylogo||!1,showLink:i.showLink||!1,showTips:i.showTips||!1,mapboxAccessToken:v.mapboxAccessToken}};return i.setBackground!=="transparent"&&(S.config.setBackground=i.setBackground||"opaque"),S.gd.defaultLayout=t(i.tileClass),S}}),gA=Vt((X,V)=>{var c=s0().EventEmitter,g=Mi(),E=qr(),A=Np(),t=Hb(),e=$y(),r=Jy();function i(n,o){var a=new c,s=t(n,{format:"png"}),h=s.gd;h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);function v(){var p=A.getDelay(h._fullLayout);setTimeout(function(){var y=e(h),l=document.createElement("canvas");l.id=E.randstr(),a=r({format:o.format,width:h._fullLayout.width,height:h._fullLayout.height,canvas:l,emitter:a,svg:y}),a.clean=function(){h&&document.body.removeChild(h)}},p)}var m=A.getRedrawFunc(h);return g.call("_doPlot",h,s.data,s.layout,s.config).then(m).then(v).catch(function(p){a.emit("error",p)}),a}V.exports=i}),mA=Vt((X,V)=>{var c=Np(),g={getDelay:c.getDelay,getRedrawFunc:c.getRedrawFunc,clone:Hb(),toSVG:$y(),svgToImg:Jy(),toImage:gA(),downloadImage:Eb()};V.exports=g}),vA=Vt(X=>{X.version=Iy().version,IT(),Sk();var V=Mi(),c=X.register=V.register,g=d4(),E=Object.keys(g);for(t=0;t<E.length;t++)A=E[t],A.charAt(0)!=="_"&&(X[A]=g[A]),c({moduleType:"apiMethod",name:A,fn:g[A]});var A,t;c(T4()),c([P4(),D4(),fc(),B4(),U4(),G4(),X4(),K4(),nA(),Ub(),lA(),Ul(),hA(),fA(),Hu(),_b()]),c([pA(),dA()]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(c(window.PlotlyLocales),delete window.PlotlyLocales),X.Icons=Vy();var e=Hu(),r=fu();X.Plots={resize:r.resize,graphJson:r.graphJson,sendDataToCloud:r.sendDataToCloud},X.Fx={hover:e.hover,unhover:e.unhover,loneHover:e.loneHover,loneUnhover:e.loneUnhover},X.Snapshot=mA(),X.PlotSchema=yg()}),yA=Vt((X,V)=>{V.exports=vA()}),d0=Vt((X,V)=>{V.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}),wp=Vt((X,V)=>{var c=Gu(),g=qu().axisHoverFormat,E=Zo().hovertemplateAttrs,A=Zo().texttemplateAttrs,t=wl(),e=Nl(),r=d0(),i=Eh().pattern,n=po().extendFlat,o=e({editType:"calc",arrayOk:!0,colorEditType:"style"}),a=c.marker,s=a.line,h=n({},s.width,{dflt:0}),v=n({width:h,editType:"calc"},t("marker.line")),m=n({line:v,editType:"calc"},t("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:i,cornerradius:{valType:"any",editType:"calc"}});V.exports={x:c.x,x0:c.x0,dx:c.dx,y:c.y,y0:c.y0,dy:c.dy,xperiod:c.xperiod,yperiod:c.yperiod,xperiod0:c.xperiod0,yperiod0:c.yperiod0,xperiodalignment:c.xperiodalignment,yperiodalignment:c.yperiodalignment,xhoverformat:g("x"),yhoverformat:g("y"),text:c.text,texttemplate:A({editType:"plot"},{keys:r.eventDataKeys}),hovertext:c.hovertext,hovertemplate:E({},{keys:r.eventDataKeys}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:n({},o,{}),insidetextfont:n({},o,{}),outsidetextfont:n({},o,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:n({},c.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:m,offsetgroup:c.offsetgroup,alignmentgroup:c.alignmentgroup,selected:{marker:{opacity:c.selected.marker.opacity,color:c.selected.marker.color,editType:"style"},textfont:c.selected.textfont,editType:"style"},unselected:{marker:{opacity:c.unselected.marker.opacity,color:c.unselected.marker.color,editType:"style"},textfont:c.unselected.textfont,editType:"style"},zorder:c.zorder}}),o1=Vt((X,V)=>{V.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}}),s1=Vt((X,V)=>{var c=vi(),g=pf().hasColorscale,E=ah(),A=qr().coercePattern;V.exports=function(t,e,r,i,n){var o=r("marker.color",i),a=g(t,"marker");a&&E(t,e,n,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",c.defaultLine),g(t,"marker.line")&&E(t,e,n,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),A(r,"marker.pattern",o,a),r("selected.marker.color"),r("unselected.marker.color")}}),zf=Vt((X,V)=>{var c=vo(),g=qr(),E=vi(),A=Mi(),t=Tg(),e=np(),r=s1(),i=f0(),n=wp(),o=g.coerceFont;function a(m,p,y,l){function x(w,u){return g.coerce(m,p,n,w,u)}var b=t(m,p,l,x);if(!b){p.visible=!1;return}e(m,p,l,x),x("xhoverformat"),x("yhoverformat"),x("zorder"),x("orientation",p.x&&!p.y?"h":"v"),x("base"),x("offset"),x("width"),x("text"),x("hovertext"),x("hovertemplate");var S=x("textposition");v(m,p,l,x,S,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),r(m,p,x,y,l);var T=(p.marker.line||{}).color,M=A.getComponentMethod("errorbars","supplyDefaults");M(m,p,T||E.defaultLine,{axis:"y"}),M(m,p,T||E.defaultLine,{axis:"x",inherit:"y"}),g.coerceSelectionMarkerOpacity(p,x)}function s(m,p){var y,l;function x(T,M){return g.coerce(l._input,l,n,T,M)}for(var b=0;b<m.length;b++)if(l=m[b],l.type==="bar"){y=l._input;var S=x("marker.cornerradius",p.barcornerradius);l.marker&&(l.marker.cornerradius=h(S)),i(y,l,p,x,p.barmode)}}function h(m){if(c(m)){if(m=+m,m>=0)return m}else if(typeof m=="string"&&(m=m.trim(),m.slice(-1)==="%"&&c(m.slice(0,-1))&&(m=+m.slice(0,-1),m>=0)))return m+"%"}function v(m,p,y,l,x,b){b=b||{};var S=b.moduleHasSelected!==!1,T=b.moduleHasUnselected!==!1,M=b.moduleHasConstrain!==!1,w=b.moduleHasCliponaxis!==!1,u=b.moduleHasTextangle!==!1,f=b.moduleHasInsideanchor!==!1,k=!!b.hasPathbar,_=Array.isArray(x)||x==="auto",D=_||x==="inside",I=_||x==="outside";if(D||I){var O=o(l,"textfont",y.font),B=g.extendFlat({},O),R=m.textfont&&m.textfont.color,L=!R;if(L&&delete B.color,o(l,"insidetextfont",B),k){var F=g.extendFlat({},O);L&&delete F.color,o(l,"pathbar.textfont",F)}I&&o(l,"outsidetextfont",O),S&&l("selected.textfont.color"),T&&l("unselected.textfont.color"),M&&l("constraintext"),w&&l("cliponaxis"),u&&l("textangle"),l("texttemplate")}D&&f&&l("insidetextanchor")}V.exports={supplyDefaults:a,crossTraceDefaults:s,handleText:v,validateCornerradius:h}}),Gb=Vt((X,V)=>{var c=Mi(),g=ao(),E=qr(),A=o1(),t=zf().validateCornerradius;V.exports=function(e,r,i){function n(S,T){return E.coerce(e,r,A,S,T)}for(var o=!1,a=!1,s=!1,h={},v=n("barmode"),m=v==="group",p=0;p<i.length;p++){var y=i[p];if(c.traceIs(y,"bar")&&y.visible)o=!0;else continue;var l=y.xaxis+y.yaxis;if(m?(h[l]&&(s=!0),h[l]=!0):(l+=y._input.offsetgroup,h.length>0&&!h[l]&&(s=!0),h[l]=!0),y.visible&&y.type==="histogram"){var x=g.getFromId({_fullLayout:r},y[y.orientation==="v"?"xaxis":"yaxis"]);x.type!=="category"&&(a=!0)}}if(!o){delete r.barmode;return}v!=="overlay"&&n("barnorm"),n("bargap",a&&!s?0:.2),n("bargroupgap");var b=n("barcornerradius");r.barcornerradius=t(b)}}),Wm=Vt((X,V)=>{var c=qr();V.exports=function(g,E){for(var A=0;A<g.length;A++)g[A].i=A;c.mergeArray(E.text,g,"tx"),c.mergeArray(E.hovertext,g,"htx");var t=E.marker;if(t){c.mergeArray(t.opacity,g,"mo",!0),c.mergeArray(t.color,g,"mc");var e=t.line;e&&(c.mergeArray(e.color,g,"mlc"),c.mergeArrayCastPositive(e.width,g,"mlw"))}}}),xA=Vt((X,V)=>{var c=ao(),g=ip(),E=pf().hasColorscale,A=df(),t=Wm(),e=qf();V.exports=function(r,i){var n=c.getFromId(r,i.xaxis||"x"),o=c.getFromId(r,i.yaxis||"y"),a,s,h,v,m,p,y={msUTC:!!(i.base||i.base===0)};i.orientation==="h"?(a=n.makeCalcdata(i,"x",y),h=o.makeCalcdata(i,"y"),v=g(i,o,"y",h),m=!!i.yperiodalignment,p="y"):(a=o.makeCalcdata(i,"y",y),h=n.makeCalcdata(i,"x"),v=g(i,n,"x",h),m=!!i.xperiodalignment,p="x"),s=v.vals;for(var l=Math.min(s.length,a.length),x=new Array(l),b=0;b<l;b++)x[b]={p:s[b],s:a[b]},m&&(x[b].orig_p=h[b],x[b][p+"End"]=v.ends[b],x[b][p+"Start"]=v.starts[b]),i.ids&&(x[b].id=String(i.ids[b]));return E(i,"marker")&&A(r,i,{vals:i.marker.color,containerStr:"marker",cLetter:"c"}),E(i,"marker.line")&&A(r,i,{vals:i.marker.line.color,containerStr:"marker.line",cLetter:"c"}),t(x,i),e(x,i),x}}),of=Vt((X,V)=>{var c=Ai(),g=qr();function E(r,i,n){var o=r._fullLayout,a=o["_"+n+"Text_minsize"];if(a){var s=o.uniformtext.mode==="hide",h;switch(n){case"funnelarea":case"pie":case"sunburst":h="g.slice";break;case"treemap":case"icicle":h="g.slice, g.pathbar";break;default:h="g.points > g.point"}i.selectAll(h).each(function(v){var m=v.transform;if(m){m.scale=s&&m.hide?0:a/m.fontSize;var p=c.select(this).select("text");g.setTransormAndDisplay(p,m)}})}}function A(r,i,n){if(n.uniformtext.mode){var o=e(r),a=n.uniformtext.minsize,s=i.scale*i.fontSize;i.hide=s<a,n[o]=n[o]||1/0,i.hide||(n[o]=Math.min(n[o],Math.max(s,a)))}}function t(r,i){var n=e(r);i[n]=void 0}function e(r){return"_"+r+"Text_minsize"}V.exports={recordMinTextSize:A,clearMinTextSize:t,resizeText:E}}),l1=Vt(X=>{var V=vo(),c=yh(),g=qr().isArrayOrTypedArray;X.coerceString=function(E,A,t){if(typeof A=="string"){if(A||!E.noBlank)return A}else if((typeof A=="number"||A===!0)&&!E.strict)return String(A);return t!==void 0?t:E.dflt},X.coerceNumber=function(E,A,t){if(V(A)){A=+A;var e=E.min,r=E.max,i=e!==void 0&&A<e||r!==void 0&&A>r;if(!i)return A}return t!==void 0?t:E.dflt},X.coerceColor=function(E,A,t){return c(A).isValid()?A:t!==void 0?t:E.dflt},X.coerceEnumerated=function(E,A,t){return E.coerceNumber&&(A=+A),E.values.indexOf(A)!==-1?A:t!==void 0?t:E.dflt},X.getValue=function(E,A){var t;return g(E)?A<E.length&&(t=E[A]):t=E,t},X.getLineWidth=function(E,A){var t=0<A.mlw?A.mlw:g(E.marker.line.width)?0:E.marker.line.width;return t}}),Gf=Vt((X,V)=>{var c=Ai(),g=vi(),E=go(),A=qr(),t=Mi(),e=of().resizeText,r=wp(),i=r.textfont,n=r.insidetextfont,o=r.outsidetextfont,a=l1();function s(w){var u=c.select(w).selectAll('g[class^="barlayer"]').selectAll("g.trace");e(w,u,"bar");var f=u.size(),k=w._fullLayout;u.style("opacity",function(_){return _[0].trace.opacity}).each(function(_){(k.barmode==="stack"&&f>1||k.bargap===0&&k.bargroupgap===0&&!_[0].trace.marker.line.width)&&c.select(this).attr("shape-rendering","crispEdges")}),u.selectAll("g.points").each(function(_){var D=c.select(this),I=_[0].trace;h(D,I,w)}),t.getComponentMethod("errorbars","style")(u)}function h(w,u,f){E.pointStyle(w.selectAll("path"),u,f),v(w,u,f)}function v(w,u,f){w.selectAll("text").each(function(k){var _=c.select(this),D=A.ensureUniformFontSize(f,l(_,k,u,f));E.font(_,D)})}function m(w,u,f){var k=u[0].trace;k.selectedpoints?p(f,k,w):(h(f,k,w),t.getComponentMethod("errorbars","style")(f))}function p(w,u,f){E.selectedPointStyle(w.selectAll("path"),u),y(w.selectAll("text"),u,f)}function y(w,u,f){w.each(function(k){var _=c.select(this),D;if(k.selected){D=A.ensureUniformFontSize(f,l(_,k,u,f));var I=u.selected.textfont&&u.selected.textfont.color;I&&(D.color=I),E.font(_,D)}else E.selectedTextStyle(_,u)})}function l(w,u,f,k){var _=k._fullLayout.font,D=f.textfont;if(w.classed("bartext-inside")){var I=M(u,f);D=b(f,u.i,_,I)}else w.classed("bartext-outside")&&(D=S(f,u.i,_));return D}function x(w,u,f){return T(i,w.textfont,u,f)}function b(w,u,f,k){var _=x(w,u,f),D=w._input.textfont===void 0||w._input.textfont.color===void 0||Array.isArray(w.textfont.color)&&w.textfont.color[u]===void 0;return D&&(_={color:g.contrast(k),family:_.family,size:_.size,weight:_.weight,style:_.style,variant:_.variant,textcase:_.textcase,lineposition:_.lineposition,shadow:_.shadow}),T(n,w.insidetextfont,u,_)}function S(w,u,f){var k=x(w,u,f);return T(o,w.outsidetextfont,u,k)}function T(w,u,f,k){u=u||{};var _=a.getValue(u.family,f),D=a.getValue(u.size,f),I=a.getValue(u.color,f),O=a.getValue(u.weight,f),B=a.getValue(u.style,f),R=a.getValue(u.variant,f),L=a.getValue(u.textcase,f),F=a.getValue(u.lineposition,f),N=a.getValue(u.shadow,f);return{family:a.coerceString(w.family,_,k.family),size:a.coerceNumber(w.size,D,k.size),color:a.coerceColor(w.color,I,k.color),weight:a.coerceString(w.weight,O,k.weight),style:a.coerceString(w.style,B,k.style),variant:a.coerceString(w.variant,R,k.variant),textcase:a.coerceString(w.variant,L,k.textcase),lineposition:a.coerceString(w.variant,F,k.lineposition),shadow:a.coerceString(w.variant,N,k.shadow)}}function M(w,u){return u.type==="waterfall"?u[w.dir].marker.color:w.mcc||w.mc||u.marker.color}V.exports={style:s,styleTextPoints:v,styleOnSelect:m,getInsideTextFont:b,getOutsideTextFont:S,getBarColor:M,resizeText:e}}),g0=Vt((X,V)=>{var c=Ai(),g=vo(),E=qr(),A=sl(),t=vi(),e=go(),r=Mi(),i=ao().tickText,n=of(),o=n.recordMinTextSize,a=n.clearMinTextSize,s=Gf(),h=l1(),v=d0(),m=wp(),p=m.text,y=m.textposition,l=vf().appendArrayPointValue,x=v.TEXTPAD;function b(rt){return rt.id}function S(rt){if(rt.ids)return b}function T(rt){return(rt>0)-(rt<0)}function M(rt,ct){return rt<ct?1:-1}function w(rt,ct,lt,tt){var Z=[],st=[],$=tt?ct:lt,Q=tt?lt:ct;return Z[0]=$.c2p(rt.s0,!0),st[0]=Q.c2p(rt.p0,!0),Z[1]=$.c2p(rt.s1,!0),st[1]=Q.c2p(rt.p1,!0),tt?[Z,st]:[st,Z]}function u(rt,ct,lt,tt){if(!ct.uniformtext.mode&&f(lt)){var Z;return tt&&(Z=tt()),rt.transition().duration(lt.duration).ease(lt.easing).each("end",function(){Z&&Z()}).each("interrupt",function(){Z&&Z()})}else return rt}function f(rt){return rt&&rt.duration>0}function k(rt,ct,lt,tt,Z,st){var $=ct.xaxis,Q=ct.yaxis,nt=rt._fullLayout,Y=rt._context.staticPlot;Z||(Z={mode:nt.barmode,norm:nt.barmode,gap:nt.bargap,groupgap:nt.bargroupgap},a("bar",nt));var q=E.makeTraceGroups(tt,lt,"trace bars").each(function(ot){var it=c.select(this),dt=ot[0].trace,wt=ot[0].t,xt=dt.type==="waterfall",Ft=dt.type==="funnel",Et=dt.type==="histogram",Nt=dt.type==="bar",te=Nt||Ft,Jt=0;xt&&dt.connector.visible&&dt.connector.mode==="between"&&(Jt=dt.connector.line.width/2);var Qt=dt.orientation==="h",Wt=f(Z),gt=E.ensureSingle(it,"g","points"),bt=S(dt),vt=gt.selectAll("g.point").data(E.identity,bt);vt.enter().append("g").classed("point",!0),vt.exit().remove(),vt.each(function(Kt,Zt){var le=c.select(this),Te=w(Kt,$,Q,Qt),Se=Te[0][0],Fe=Te[0][1],Oe=Te[1][0],ur=Te[1][1],fr=(Qt?Fe-Se:ur-Oe)===0;fr&&te&&h.getLineWidth(dt,Kt)&&(fr=!1),fr||(fr=!g(Se)||!g(Fe)||!g(Oe)||!g(ur)),Kt.isBlank=fr,fr&&(Qt?Fe=Se:ur=Oe),Jt&&!fr&&(Qt?(Se-=M(Se,Fe)*Jt,Fe+=M(Se,Fe)*Jt):(Oe-=M(Oe,ur)*Jt,ur+=M(Oe,ur)*Jt));var We,Lr;if(dt.type==="waterfall"){if(!fr){var kr=dt[Kt.dir].marker;We=kr.line.width,Lr=kr.color}}else We=h.getLineWidth(dt,Kt),Lr=Kt.mc||dt.marker.color;function he(Nn){var ke=c.round(We/2%1,2);return Z.gap===0&&Z.groupgap===0?c.round(Math.round(Nn)-ke,2):Nn}function Dt(Nn,ke,ze){return ze&&Nn===ke?Nn:Math.abs(Nn-ke)>=2?he(Nn):Nn>ke?Math.ceil(Nn):Math.floor(Nn)}var qt=t.opacity(Lr),zt=qt<1||We>.01?he:Dt;rt._context.staticPlot||(Se=zt(Se,Fe,Qt),Fe=zt(Fe,Se,Qt),Oe=zt(Oe,ur,!Qt),ur=zt(ur,Oe,!Qt));var ut=Qt?$.c2p:Q.c2p,yt;Kt.s0>0?yt=Kt._sMax:Kt.s0<0?yt=Kt._sMin:yt=Kt.s1>0?Kt._sMax:Kt._sMin;function Mt(Nn,ke){if(!Nn)return 0;var ze=Math.abs(Qt?ur-Oe:Fe-Se),je=Math.abs(Qt?Fe-Se:ur-Oe),Ne=zt(Math.abs(ut(yt,!0)-ut(0,!0))),_r=Kt.hasB?Math.min(ze/2,je/2):Math.min(ze/2,Ne),Xr;if(ke==="%"){var rn=Math.min(50,Nn);Xr=ze*(rn/100)}else Xr=Nn;return zt(Math.max(Math.min(Xr,_r),0))}var Ot=Nt||Et?Mt(wt.cornerradiusvalue,wt.cornerradiusform):0,$t,ee,we="M"+Se+","+Oe+"V"+ur+"H"+Fe+"V"+Oe+"Z",Me=0;if(Ot&&Kt.s){var Re=T(Kt.s0)===0||T(Kt.s)===T(Kt.s0)?Kt.s1:Kt.s0;if(Me=zt(Kt.hasB?0:Math.abs(ut(yt,!0)-ut(Re,!0))),Me<Ot){var Be=M(Se,Fe),Ze=M(Oe,ur),Ue=Be===-Ze?1:0;if(Qt)if(Kt.hasB)$t="M"+(Se+Ot*Be)+","+Oe+"A "+Ot+","+Ot+" 0 0 "+Ue+" "+Se+","+(Oe+Ot*Ze)+"V"+(ur-Ot*Ze)+"A "+Ot+","+Ot+" 0 0 "+Ue+" "+(Se+Ot*Be)+","+ur+"H"+(Fe-Ot*Be)+"A "+Ot+","+Ot+" 0 0 "+Ue+" "+Fe+","+(ur-Ot*Ze)+"V"+(Oe+Ot*Ze)+"A "+Ot+","+Ot+" 0 0 "+Ue+" "+(Fe-Ot*Be)+","+Oe+"Z";else{ee=Math.abs(Fe-Se)+Me;var mr=ee<Ot?Ot-Math.sqrt(ee*(2*Ot-ee)):0,ln=Me>0?Math.sqrt(Me*(2*Ot-Me)):0,an=Be>0?Math.max:Math.min;$t="M"+Se+","+Oe+"V"+(ur-mr*Ze)+"H"+an(Fe-(Ot-Me)*Be,Se)+"A "+Ot+","+Ot+" 0 0 "+Ue+" "+Fe+","+(ur-Ot*Ze-ln)+"V"+(Oe+Ot*Ze+ln)+"A "+Ot+","+Ot+" 0 0 "+Ue+" "+an(Fe-(Ot-Me)*Be,Se)+","+(Oe+mr*Ze)+"Z"}else if(Kt.hasB)$t="M"+(Se+Ot*Be)+","+Oe+"A "+Ot+","+Ot+" 0 0 "+Ue+" "+Se+","+(Oe+Ot*Ze)+"V"+(ur-Ot*Ze)+"A "+Ot+","+Ot+" 0 0 "+Ue+" "+(Se+Ot*Be)+","+ur+"H"+(Fe-Ot*Be)+"A "+Ot+","+Ot+" 0 0 "+Ue+" "+Fe+","+(ur-Ot*Ze)+"V"+(Oe+Ot*Ze)+"A "+Ot+","+Ot+" 0 0 "+Ue+" "+(Fe-Ot*Be)+","+Oe+"Z";else{ee=Math.abs(ur-Oe)+Me;var vn=ee<Ot?Ot-Math.sqrt(ee*(2*Ot-ee)):0,Sn=Me>0?Math.sqrt(Me*(2*Ot-Me)):0,An=Ze>0?Math.max:Math.min;$t="M"+(Se+vn*Be)+","+Oe+"V"+An(ur-(Ot-Me)*Ze,Oe)+"A "+Ot+","+Ot+" 0 0 "+Ue+" "+(Se+Ot*Be-Sn)+","+ur+"H"+(Fe-Ot*Be+Sn)+"A "+Ot+","+Ot+" 0 0 "+Ue+" "+(Fe-vn*Be)+","+An(ur-(Ot-Me)*Ze,Oe)+"V"+Oe+"Z"}}else $t=we}else $t=we;var pn=u(E.ensureSingle(le,"path"),nt,Z,st);if(pn.style("vector-effect",Y?"none":"non-scaling-stroke").attr("d",isNaN((Fe-Se)*(ur-Oe))||fr&&rt._context.staticPlot?"M0,0Z":$t).call(e.setClipUrl,ct.layerClipId,rt),!nt.uniformtext.mode&&Wt){var On=e.makePointStyleFns(dt);e.singlePointStyle(Kt,pn,dt,On,rt)}_(rt,ct,le,ot,Zt,Se,Fe,Oe,ur,Ot,Me,Z,st),ct.layerClipId&&e.hideOutsideRangePoint(Kt,le.select("text"),$,Q,dt.xcalendar,dt.ycalendar)});var Ut=dt.cliponaxis===!1;e.setClipUrl(it,Ut?null:ct.layerClipId,rt)});r.getComponentMethod("errorbars","plot")(rt,q,ct,Z)}function _(rt,ct,lt,tt,Z,st,$,Q,nt,Y,q,ot,it){var dt=ct.xaxis,wt=ct.yaxis,xt=rt._fullLayout,Ft;function Et(ee,we,Me){var Re=E.ensureSingle(ee,"text").text(we).attr({class:"bartext bartext-"+Ft,"text-anchor":"middle","data-notex":1}).call(e.font,Me).call(A.convertToTspans,rt);return Re}var Nt=tt[0].trace,te=Nt.orientation==="h",Jt=F(xt,tt,Z,dt,wt);Ft=N(Nt,Z);var Qt=ot.mode==="stack"||ot.mode==="relative",Wt=tt[Z],gt=!Qt||Wt._outmost,bt=Wt.hasB,vt=Y&&Y-q>x;if(!Jt||Ft==="none"||(Wt.isBlank||st===$||Q===nt)&&(Ft==="auto"||Ft==="inside")){lt.select("text").remove();return}var Ut=xt.font,Kt=s.getBarColor(tt[Z],Nt),Zt=s.getInsideTextFont(Nt,Z,Ut,Kt),le=s.getOutsideTextFont(Nt,Z,Ut),Te=Nt.insidetextanchor||"end",Se=lt.datum();te?dt.type==="log"&&Se.s0<=0&&(dt.range[0]<dt.range[1]?st=0:st=dt._length):wt.type==="log"&&Se.s0<=0&&(wt.range[0]<wt.range[1]?Q=wt._length:Q=0);var Fe=Math.abs($-st),Oe=Math.abs(nt-Q),ur=Fe-2*x,fr=Oe-2*x,We,Lr,kr,he,Dt;if(Ft==="outside"&&!gt&&!Wt.hasB&&(Ft="inside"),Ft==="auto")if(gt){Ft="inside",Dt=E.ensureUniformFontSize(rt,Zt),We=Et(lt,Jt,Dt),Lr=e.bBox(We.node()),kr=Lr.width,he=Lr.height;var qt=kr>0&&he>0,zt;vt?bt?zt=D(ur-2*Y,fr,kr,he,te)||D(ur,fr-2*Y,kr,he,te):te?zt=D(ur-(Y-q),fr,kr,he,te)||D(ur,fr-2*(Y-q),kr,he,te):zt=D(ur,fr-(Y-q),kr,he,te)||D(ur-2*(Y-q),fr,kr,he,te):zt=D(ur,fr,kr,he,te),qt&&zt?Ft="inside":(Ft="outside",We.remove(),We=null)}else Ft="inside";if(!We){Dt=E.ensureUniformFontSize(rt,Ft==="outside"?le:Zt),We=Et(lt,Jt,Dt);var ut=We.attr("transform");if(We.attr("transform",""),Lr=e.bBox(We.node()),kr=Lr.width,he=Lr.height,We.attr("transform",ut),kr<=0||he<=0){We.remove();return}}var yt=Nt.textangle,Mt,Ot;Ft==="outside"?(Ot=Nt.constraintext==="both"||Nt.constraintext==="outside",Mt=L(st,$,Q,nt,Lr,{isHorizontal:te,constrained:Ot,angle:yt})):(Ot=Nt.constraintext==="both"||Nt.constraintext==="inside",Mt=B(st,$,Q,nt,Lr,{isHorizontal:te,constrained:Ot,angle:yt,anchor:Te,hasB:bt,r:Y,overhead:q})),Mt.fontSize=Dt.size,o(Nt.type==="histogram"?"bar":Nt.type,Mt,xt),Wt.transform=Mt;var $t=u(We,xt,ot,it);E.setTransormAndDisplay($t,Mt)}function D(rt,ct,lt,tt,Z){if(rt<0||ct<0)return!1;var st=lt<=rt&&tt<=ct,$=lt<=ct&&tt<=rt,Q=Z?rt>=lt*(ct/tt):ct>=tt*(rt/lt);return st||$||Q}function I(rt){return rt==="auto"?0:rt}function O(rt,ct){var lt=Math.PI/180*ct,tt=Math.abs(Math.sin(lt)),Z=Math.abs(Math.cos(lt));return{x:rt.width*Z+rt.height*tt,y:rt.width*tt+rt.height*Z}}function B(rt,ct,lt,tt,Z,st){var $=!!st.isHorizontal,Q=!!st.constrained,nt=st.angle||0,Y=st.anchor,q=Y==="end",ot=Y==="start",it=st.leftToRight||0,dt=(it+1)/2,wt=1-dt,xt=st.hasB,Ft=st.r,Et=st.overhead,Nt=Z.width,te=Z.height,Jt=Math.abs(ct-rt),Qt=Math.abs(tt-lt),Wt=Jt>2*x&&Qt>2*x?x:0;Jt-=2*Wt,Qt-=2*Wt;var gt=I(nt);nt==="auto"&&!(Nt<=Jt&&te<=Qt)&&(Nt>Jt||te>Qt)&&(!(Nt>Qt||te>Jt)||Nt<te!=Jt<Qt)&&(gt+=90);var bt=O(Z,gt),vt,Ut;if(Ft&&Ft-Et>x){var Kt=R(rt,ct,lt,tt,bt,Ft,Et,$,xt);vt=Kt.scale,Ut=Kt.pad}else vt=1,Q&&(vt=Math.min(1,Jt/bt.x,Qt/bt.y)),Ut=0;var Zt=Z.left*wt+Z.right*dt,le=(Z.top+Z.bottom)/2,Te=(rt+x)*wt+(ct-x)*dt,Se=(lt+tt)/2,Fe=0,Oe=0;if(ot||q){var ur=($?bt.x:bt.y)/2;Ft&&(q||xt)&&(Wt+=Ut);var fr=$?M(rt,ct):M(lt,tt);$?ot?(Te=rt+fr*Wt,Fe=-fr*ur):(Te=ct-fr*Wt,Fe=fr*ur):ot?(Se=lt+fr*Wt,Oe=-fr*ur):(Se=tt-fr*Wt,Oe=fr*ur)}return{textX:Zt,textY:le,targetX:Te,targetY:Se,anchorX:Fe,anchorY:Oe,scale:vt,rotate:gt}}function R(rt,ct,lt,tt,Z,st,$,Q,nt){var Y=Math.max(0,Math.abs(ct-rt)-2*x),q=Math.max(0,Math.abs(tt-lt)-2*x),ot=st-x,it=$?ot-Math.sqrt(ot*ot-(ot-$)*(ot-$)):ot,dt=nt?ot*2:Q?ot-$:2*it,wt=nt?ot*2:Q?2*it:ot-$,xt,Ft,Et,Nt,te;return Z.y/Z.x>=q/(Y-dt)?Nt=q/Z.y:Z.y/Z.x<=(q-wt)/Y?Nt=Y/Z.x:!nt&&Q?(xt=Z.x*Z.x+Z.y*Z.y/4,Ft=-2*Z.x*(Y-ot)-Z.y*(q/2-ot),Et=(Y-ot)*(Y-ot)+(q/2-ot)*(q/2-ot)-ot*ot,Nt=(-Ft+Math.sqrt(Ft*Ft-4*xt*Et))/(2*xt)):nt?(xt=(Z.x*Z.x+Z.y*Z.y)/4,Ft=-Z.x*(Y/2-ot)-Z.y*(q/2-ot),Et=(Y/2-ot)*(Y/2-ot)+(q/2-ot)*(q/2-ot)-ot*ot,Nt=(-Ft+Math.sqrt(Ft*Ft-4*xt*Et))/(2*xt)):(xt=Z.x*Z.x/4+Z.y*Z.y,Ft=-Z.x*(Y/2-ot)-2*Z.y*(q-ot),Et=(Y/2-ot)*(Y/2-ot)+(q-ot)*(q-ot)-ot*ot,Nt=(-Ft+Math.sqrt(Ft*Ft-4*xt*Et))/(2*xt)),Nt=Math.min(1,Nt),Q?te=Math.max(0,ot-Math.sqrt(Math.max(0,ot*ot-(ot-(q-Z.y*Nt)/2)*(ot-(q-Z.y*Nt)/2)))-$):te=Math.max(0,ot-Math.sqrt(Math.max(0,ot*ot-(ot-(Y-Z.x*Nt)/2)*(ot-(Y-Z.x*Nt)/2)))-$),{scale:Nt,pad:te}}function L(rt,ct,lt,tt,Z,st){var $=!!st.isHorizontal,Q=!!st.constrained,nt=st.angle||0,Y=Z.width,q=Z.height,ot=Math.abs(ct-rt),it=Math.abs(tt-lt),dt;$?dt=it>2*x?x:0:dt=ot>2*x?x:0;var wt=1;Q&&(wt=$?Math.min(1,it/q):Math.min(1,ot/Y));var xt=I(nt),Ft=O(Z,xt),Et=($?Ft.x:Ft.y)/2,Nt=(Z.left+Z.right)/2,te=(Z.top+Z.bottom)/2,Jt=(rt+ct)/2,Qt=(lt+tt)/2,Wt=0,gt=0,bt=$?M(ct,rt):M(lt,tt);return $?(Jt=ct-bt*dt,Wt=bt*Et):(Qt=tt+bt*dt,gt=-bt*Et),{textX:Nt,textY:te,targetX:Jt,targetY:Qt,anchorX:Wt,anchorY:gt,scale:wt,rotate:xt}}function F(rt,ct,lt,tt,Z){var st=ct[0].trace,$=st.texttemplate,Q;return $?Q=j(rt,ct,lt,tt,Z):st.textinfo?Q=G(ct,lt,tt,Z):Q=h.getValue(st.text,lt),h.coerceString(p,Q)}function N(rt,ct){var lt=h.getValue(rt.textposition,ct);return h.coerceEnumerated(y,lt)}function j(rt,ct,lt,tt,Z){var st=ct[0].trace,$=E.castOption(st,lt,"texttemplate");if(!$)return"";var Q=st.type==="histogram",nt=st.type==="waterfall",Y=st.type==="funnel",q=st.orientation==="h",ot,it,dt,wt;q?(ot="y",it=Z,dt="x",wt=tt):(ot="x",it=tt,dt="y",wt=Z);function xt(Wt){return i(it,it.c2l(Wt),!0).text}function Ft(Wt){return i(wt,wt.c2l(Wt),!0).text}var Et=ct[lt],Nt={};Nt.label=Et.p,Nt.labelLabel=Nt[ot+"Label"]=xt(Et.p);var te=E.castOption(st,Et.i,"text");(te===0||te)&&(Nt.text=te),Nt.value=Et.s,Nt.valueLabel=Nt[dt+"Label"]=Ft(Et.s);var Jt={};l(Jt,st,Et.i),(Q||Jt.x===void 0)&&(Jt.x=q?Nt.value:Nt.label),(Q||Jt.y===void 0)&&(Jt.y=q?Nt.label:Nt.value),(Q||Jt.xLabel===void 0)&&(Jt.xLabel=q?Nt.valueLabel:Nt.labelLabel),(Q||Jt.yLabel===void 0)&&(Jt.yLabel=q?Nt.labelLabel:Nt.valueLabel),nt&&(Nt.delta=+Et.rawS||Et.s,Nt.deltaLabel=Ft(Nt.delta),Nt.final=Et.v,Nt.finalLabel=Ft(Nt.final),Nt.initial=Nt.final-Nt.delta,Nt.initialLabel=Ft(Nt.initial)),Y&&(Nt.value=Et.s,Nt.valueLabel=Ft(Nt.value),Nt.percentInitial=Et.begR,Nt.percentInitialLabel=E.formatPercent(Et.begR),Nt.percentPrevious=Et.difR,Nt.percentPreviousLabel=E.formatPercent(Et.difR),Nt.percentTotal=Et.sumR,Nt.percenTotalLabel=E.formatPercent(Et.sumR));var Qt=E.castOption(st,Et.i,"customdata");return Qt&&(Nt.customdata=Qt),E.texttemplateString($,Nt,rt._d3locale,Jt,Nt,st._meta||{})}function G(rt,ct,lt,tt){var Z=rt[0].trace,st=Z.orientation==="h",$=Z.type==="waterfall",Q=Z.type==="funnel";function nt(Qt){var Wt=st?tt:lt;return i(Wt,Qt,!0).text}function Y(Qt){var Wt=st?lt:tt;return i(Wt,+Qt,!0).text}var q=Z.textinfo,ot=rt[ct],it=q.split("+"),dt=[],wt,xt=function(Qt){return it.indexOf(Qt)!==-1};if(xt("label")&&dt.push(nt(rt[ct].p)),xt("text")&&(wt=E.castOption(Z,ot.i,"text"),(wt===0||wt)&&dt.push(wt)),$){var Ft=+ot.rawS||ot.s,Et=ot.v,Nt=Et-Ft;xt("initial")&&dt.push(Y(Nt)),xt("delta")&&dt.push(Y(Ft)),xt("final")&&dt.push(Y(Et))}if(Q){xt("value")&&dt.push(Y(ot.s));var te=0;xt("percent initial")&&te++,xt("percent previous")&&te++,xt("percent total")&&te++;var Jt=te>1;xt("percent initial")&&(wt=E.formatPercent(ot.begR),Jt&&(wt+=" of initial"),dt.push(wt)),xt("percent previous")&&(wt=E.formatPercent(ot.difR),Jt&&(wt+=" of previous"),dt.push(wt)),xt("percent total")&&(wt=E.formatPercent(ot.sumR),Jt&&(wt+=" of total"),dt.push(wt))}return dt.join("<br>")}V.exports={plot:k,toMoveInsideBar:B}}),Pg=Vt((X,V)=>{var c=Hu(),g=Mi(),E=vi(),A=qr().fillText,t=l1().getLineWidth,e=ao().hoverLabelText,r=ts().BADNUM;function i(a,s,h,v,m){var p=n(a,s,h,v,m);if(p){var y=p.cd,l=y[0].trace,x=y[p.index];return p.color=o(l,x),g.getComponentMethod("errorbars","hoverInfo")(x,l,p),[p]}}function n(a,s,h,v,m){var p=a.cd,y=p[0].trace,l=p[0].t,x=v==="closest",b=y.type==="waterfall",S=a.maxHoverDistance,T=a.maxSpikeDistance,M,w,u,f,k,_,D;y.orientation==="h"?(M=h,w=s,u="y",f="x",k=tt,_=rt):(M=s,w=h,u="x",f="y",_=tt,k=rt);var I=y[u+"period"],O=x||I;function B(wt){return L(wt,-1)}function R(wt){return L(wt,1)}function L(wt,xt){var Ft=wt.w;return wt[u]+xt*Ft/2}function F(wt){return wt[u+"End"]-wt[u+"Start"]}var N=x?B:I?function(wt){return wt.p-F(wt)/2}:function(wt){return Math.min(B(wt),wt.p-l.bardelta/2)},j=x?R:I?function(wt){return wt.p+F(wt)/2}:function(wt){return Math.max(R(wt),wt.p+l.bardelta/2)};function G(wt,xt,Ft){return m.finiteRange&&(Ft=0),c.inbox(wt-M,xt-M,Ft+Math.min(1,Math.abs(xt-wt)/D)-1)}function rt(wt){return G(N(wt),j(wt),S)}function ct(wt){return G(B(wt),R(wt),T)}function lt(wt){var xt=wt[f];if(b){var Ft=Math.abs(wt.rawS)||0;w>0?xt+=Ft:w<0&&(xt-=Ft)}return xt}function tt(wt){var xt=w,Ft=wt.b,Et=lt(wt);return c.inbox(Ft-xt,Et-xt,S+(Et-xt)/(Et-Ft)-1)}function Z(wt){var xt=w,Ft=wt.b,Et=lt(wt);return c.inbox(Ft-xt,Et-xt,T+(Et-xt)/(Et-Ft)-1)}var st=a[u+"a"],$=a[f+"a"];D=Math.abs(st.r2c(st.range[1])-st.r2c(st.range[0]));function Q(wt){return(k(wt)+_(wt))/2}var nt=c.getDistanceFunction(v,k,_,Q);if(c.getClosest(p,nt,a),a.index!==!1&&p[a.index].p!==r){O||(N=function(wt){return Math.min(B(wt),wt.p-l.bargroupwidth/2)},j=function(wt){return Math.max(R(wt),wt.p+l.bargroupwidth/2)});var Y=a.index,q=p[Y],ot=y.base?q.b+q.s:q.s;a[f+"0"]=a[f+"1"]=$.c2p(q[f],!0),a[f+"LabelVal"]=ot;var it=l.extents[l.extents.round(q.p)];a[u+"0"]=st.c2p(x?N(q):it[0],!0),a[u+"1"]=st.c2p(x?j(q):it[1],!0);var dt=q.orig_p!==void 0;return a[u+"LabelVal"]=dt?q.orig_p:q.p,a.labelLabel=e(st,a[u+"LabelVal"],y[u+"hoverformat"]),a.valueLabel=e($,a[f+"LabelVal"],y[f+"hoverformat"]),a.baseLabel=e($,q.b,y[f+"hoverformat"]),a.spikeDistance=(Z(q)+ct(q))/2,a[u+"Spike"]=st.c2p(q.p,!0),A(q,y,a),a.hovertemplate=y.hovertemplate,a}}function o(a,s){var h=s.mcc||a.marker.color,v=s.mlcc||a.marker.line.color,m=t(a,s);if(E.opacity(h))return h;if(E.opacity(v)&&m)return v}V.exports={hoverPoints:i,hoverOnBars:n,getTraceColor:o}}),_A=Vt((X,V)=>{V.exports=function(c,g,E){return c.x="xVal"in g?g.xVal:g.x,c.y="yVal"in g?g.yVal:g.y,g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),E.orientation==="h"?(c.label=c.y,c.value=c.x):(c.label=c.x,c.value=c.y),c}}),Ig=Vt((X,V)=>{V.exports=function(g,E){var A=g.cd,t=g.xaxis,e=g.yaxis,r=A[0].trace,i=r.type==="funnel",n=r.orientation==="h",o=[],a;if(E===!1)for(a=0;a<A.length;a++)A[a].selected=0;else for(a=0;a<A.length;a++){var s=A[a],h="ct"in s?s.ct:c(s,t,e,n,i);E.contains(h,!1,a,g)?(o.push({pointNumber:a,x:t.c2d(s.x),y:e.c2d(s.y)}),s.selected=1):s.selected=0}return o};function c(g,E,A,t,e){var r=E.c2p(t?g.s0:g.p0,!0),i=E.c2p(t?g.s1:g.p1,!0),n=A.c2p(t?g.p0:g.s0,!0),o=A.c2p(t?g.p1:g.s1,!0);return e?[(r+i)/2,(n+o)/2]:t?[i,(n+o)/2]:[(r+i)/2,o]}}),bA=Vt((X,V)=>{V.exports={attributes:wp(),layoutAttributes:o1(),supplyDefaults:zf().supplyDefaults,crossTraceDefaults:zf().crossTraceDefaults,supplyLayoutDefaults:Gb(),calc:xA(),crossTraceCalc:p0().crossTraceCalc,colorbar:Wh(),arraysToCalcdata:Wm(),plot:g0().plot,style:Gf().style,styleOnSelect:Gf().styleOnSelect,hoverPoints:Pg().hoverPoints,eventData:_A(),selectPoints:Ig(),moduleType:"trace",name:"bar",basePlotModule:Pc(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}),wA=Vt((X,V)=>{V.exports=bA()}),Zm=Vt((X,V)=>{var c=rp(),g=Gu(),E=wp(),A=Hc(),t=qu().axisHoverFormat,e=Zo().hovertemplateAttrs,r=po().extendFlat,i=g.marker,n=i.line;V.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:g.xperiod,yperiod:g.yperiod,xperiod0:g.xperiod0,yperiod0:g.yperiod0,xperiodalignment:g.xperiodalignment,yperiodalignment:g.yperiodalignment,xhoverformat:t("x"),yhoverformat:t("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:r({},i.symbol,{arrayOk:!1,editType:"plot"}),opacity:r({},i.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:r({},i.angle,{arrayOk:!1,editType:"calc"}),size:r({},i.size,{arrayOk:!1,editType:"calc"}),color:r({},i.color,{arrayOk:!1,editType:"style"}),line:{color:r({},n.color,{arrayOk:!1,dflt:A.defaultLine,editType:"style"}),width:r({},n.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:c(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:E.offsetgroup,alignmentgroup:E.alignmentgroup,selected:{marker:g.selected.marker,editType:"style"},unselected:{marker:g.unselected.marker,editType:"style"},text:r({},g.text,{}),hovertext:r({},g.hovertext,{}),hovertemplate:e({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:g.zorder}}),Xm=Vt((X,V)=>{V.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}}),$m=Vt((X,V)=>{var c=qr(),g=Mi(),E=vi(),A=np(),t=f0(),e=bg(),r=Zm();function i(s,h,v,m){function p(f,k){return c.coerce(s,h,r,f,k)}if(n(s,h,p,m),h.visible!==!1){A(s,h,m,p),p("xhoverformat"),p("yhoverformat");var y=h._hasPreCompStats;y&&(p("lowerfence"),p("upperfence")),p("line.color",(s.marker||{}).color||v),p("line.width"),p("fillcolor",E.addOpacity(h.line.color,.5));var l=!1;if(y){var x=p("mean"),b=p("sd");x&&x.length&&(l=!0,b&&b.length&&(l="sd"))}p("whiskerwidth");var S=p("sizemode"),T;S==="quartiles"&&(T=p("boxmean",l)),p("showwhiskers",S==="quartiles"),(S==="sd"||T==="sd")&&p("sdmultiple"),p("width"),p("quartilemethod");var M=!1;if(y){var w=p("notchspan");w&&w.length&&(M=!0)}else c.validate(s.notchwidth,r.notchwidth)&&(M=!0);var u=p("notched",M);u&&p("notchwidth"),o(s,h,p,{prefix:"box"}),p("zorder")}}function n(s,h,v,m){function p(G){var rt=0;return G&&G.length&&(rt+=1,c.isArrayOrTypedArray(G[0])&&G[0].length&&(rt+=1)),rt}function y(G){return c.validate(s[G],r[G])}var l=v("y"),x=v("x"),b;if(h.type==="box"){var S=v("q1"),T=v("median"),M=v("q3");h._hasPreCompStats=S&&S.length&&T&&T.length&&M&&M.length,b=Math.min(c.minRowLength(S),c.minRowLength(T),c.minRowLength(M))}var w=p(l),u=p(x),f=w&&c.minRowLength(l),k=u&&c.minRowLength(x),_=m.calendar,D={autotypenumbers:m.autotypenumbers},I,O;if(h._hasPreCompStats)switch(String(u)+String(w)){case"00":var B=y("x0")||y("dx"),R=y("y0")||y("dy");R&&!B?I="h":I="v",O=b;break;case"10":I="v",O=Math.min(b,k);break;case"20":I="h",O=Math.min(b,x.length);break;case"01":I="h",O=Math.min(b,f);break;case"02":I="v",O=Math.min(b,l.length);break;case"12":I="v",O=Math.min(b,k,l.length);break;case"21":I="h",O=Math.min(b,x.length,f);break;case"11":O=0;break;case"22":var L=!1,F;for(F=0;F<x.length;F++)if(e(x[F],_,D)==="category"){L=!0;break}if(L)I="v",O=Math.min(b,k,l.length);else{for(F=0;F<l.length;F++)if(e(l[F],_,D)==="category"){L=!0;break}L?(I="h",O=Math.min(b,x.length,f)):(I="v",O=Math.min(b,k,l.length))}break}else w>0?(I="v",u>0?O=Math.min(k,f):O=Math.min(f)):u>0?(I="h",O=Math.min(k)):O=0;if(!O){h.visible=!1;return}h._length=O;var N=v("orientation",I);h._hasPreCompStats?N==="v"&&u===0?(v("x0",0),v("dx",1)):N==="h"&&w===0&&(v("y0",0),v("dy",1)):N==="v"&&u===0?v("x0"):N==="h"&&w===0&&v("y0");var j=g.getComponentMethod("calendars","handleTraceDefaults");j(s,h,["x","y"],m)}function o(s,h,v,m){var p=m.prefix,y=c.coerce2(s,h,r,"marker.outliercolor"),l=v("marker.line.outliercolor"),x="outliers";h._hasPreCompStats?x="all":(y||l)&&(x="suspectedoutliers");var b=v(p+"points",x);b?(v("jitter",b==="all"?.3:0),v("pointpos",b==="all"?-1.5:0),v("marker.symbol"),v("marker.opacity"),v("marker.size"),v("marker.angle"),v("marker.color",h.line.color),v("marker.line.color"),v("marker.line.width"),b==="suspectedoutliers"&&(v("marker.line.outliercolor",h.marker.color),v("marker.line.outlierwidth")),v("selected.marker.color"),v("unselected.marker.color"),v("selected.marker.size"),v("unselected.marker.size"),v("text"),v("hovertext")):delete h.marker;var S=v("hoveron");(S==="all"||S.indexOf("points")!==-1)&&v("hovertemplate"),c.coerceSelectionMarkerOpacity(h,v)}function a(s,h){var v,m;function p(b){return c.coerce(m._input,m,r,b)}for(var y=0;y<s.length;y++){m=s[y];var l=m.type;if(l==="box"||l==="violin"){v=m._input;var x=h[l+"mode"];x==="group"&&t(v,m,h,p,x)}}}V.exports={supplyDefaults:i,crossTraceDefaults:a,handleSampleDefaults:n,handlePointsDefaults:o}}),u1=Vt((X,V)=>{var c=Mi(),g=qr(),E=Xm();function A(e,r,i,n,o){for(var a=o+"Layout",s=!1,h=0;h<i.length;h++){var v=i[h];if(c.traceIs(v,a)){s=!0;break}}s&&(n(o+"mode"),n(o+"gap"),n(o+"groupgap"))}function t(e,r,i){function n(o,a){return g.coerce(e,r,E,o,a)}A(e,r,i,n,"box")}V.exports={supplyLayoutDefaults:t,_supply:A}}),Wb=Vt((X,V)=>{var c=vo(),g=ao(),E=ip(),A=qr(),t=ts().BADNUM,e=A._;V.exports=function(b,S){var T=b._fullLayout,M=g.getFromId(b,S.xaxis||"x"),w=g.getFromId(b,S.yaxis||"y"),u=[],f=S.type==="violin"?"_numViolins":"_numBoxes",k,_,D,I,O,B,R;S.orientation==="h"?(D=M,I="x",O=w,B="y",R=!!S.yperiodalignment):(D=w,I="y",O=M,B="x",R=!!S.xperiodalignment);var L=r(S,B,O,T[f]),F=L[0],N=L[1],j=A.distinctVals(F,O),G=j.vals,rt=j.minDiff/2,ct,lt,tt,Z,st,$,Q=(S.boxpoints||S.points)==="all"?A.identity:function(ur){return ur.v<ct.lf||ur.v>ct.uf};if(S._hasPreCompStats){var nt=S[I],Y=function(ur){return D.d2c((S[ur]||[])[k])},q=1/0,ot=-1/0;for(k=0;k<S._length;k++){var it=F[k];if(c(it)){if(ct={},ct.pos=ct[B]=it,R&&N&&(ct.orig_p=N[k]),ct.q1=Y("q1"),ct.med=Y("median"),ct.q3=Y("q3"),lt=[],nt&&A.isArrayOrTypedArray(nt[k]))for(_=0;_<nt[k].length;_++)$=D.d2c(nt[k][_]),$!==t&&(st={v:$,i:[k,_]},a(st,S,[k,_]),lt.push(st));if(ct.pts=lt.sort(h),tt=ct[I]=lt.map(v),Z=tt.length,ct.med!==t&&ct.q1!==t&&ct.q3!==t&&ct.med>=ct.q1&&ct.q3>=ct.med){var dt=Y("lowerfence");ct.lf=dt!==t&&dt<=ct.q1?dt:m(ct,tt,Z);var wt=Y("upperfence");ct.uf=wt!==t&&wt>=ct.q3?wt:p(ct,tt,Z);var xt=Y("mean");ct.mean=xt!==t?xt:Z?A.mean(tt,Z):(ct.q1+ct.q3)/2;var Ft=Y("sd");ct.sd=xt!==t&&Ft>=0?Ft:Z?A.stdev(tt,Z,ct.mean):ct.q3-ct.q1,ct.lo=y(ct),ct.uo=l(ct);var Et=Y("notchspan");Et=Et!==t&&Et>0?Et:x(ct,Z),ct.ln=ct.med-Et,ct.un=ct.med+Et;var Nt=ct.lf,te=ct.uf;S.boxpoints&&tt.length&&(Nt=Math.min(Nt,tt[0]),te=Math.max(te,tt[Z-1])),S.notched&&(Nt=Math.min(Nt,ct.ln),te=Math.max(te,ct.un)),ct.min=Nt,ct.max=te}else{A.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+ct.q1,"median = "+ct.med,"q3 = "+ct.q3].join(`
|
||
`));var Jt;ct.med!==t?Jt=ct.med:ct.q1!==t?ct.q3!==t?Jt=(ct.q1+ct.q3)/2:Jt=ct.q1:ct.q3!==t?Jt=ct.q3:Jt=0,ct.med=Jt,ct.q1=ct.q3=Jt,ct.lf=ct.uf=Jt,ct.mean=ct.sd=Jt,ct.ln=ct.un=Jt,ct.min=ct.max=Jt}q=Math.min(q,ct.min),ot=Math.max(ot,ct.max),ct.pts2=lt.filter(Q),u.push(ct)}}S._extremes[D._id]=g.findExtremes(D,[q,ot],{padded:!0})}else{var Qt=D.makeCalcdata(S,I),Wt=i(G,rt),gt=G.length,bt=n(gt);for(k=0;k<S._length;k++)if($=Qt[k],!!c($)){var vt=A.findBin(F[k],Wt);vt>=0&&vt<gt&&(st={v:$,i:k},a(st,S,k),bt[vt].push(st))}var Ut=1/0,Kt=-1/0,Zt=S.quartilemethod,le=Zt==="exclusive",Te=Zt==="inclusive";for(k=0;k<gt;k++)if(bt[k].length>0){if(ct={},ct.pos=ct[B]=G[k],lt=ct.pts=bt[k].sort(h),tt=ct[I]=lt.map(v),Z=tt.length,ct.min=tt[0],ct.max=tt[Z-1],ct.mean=A.mean(tt,Z),ct.sd=A.stdev(tt,Z,ct.mean)*S.sdmultiple,ct.med=A.interp(tt,.5),Z%2&&(le||Te)){var Se,Fe;le?(Se=tt.slice(0,Z/2),Fe=tt.slice(Z/2+1)):Te&&(Se=tt.slice(0,Z/2+1),Fe=tt.slice(Z/2)),ct.q1=A.interp(Se,.5),ct.q3=A.interp(Fe,.5)}else ct.q1=A.interp(tt,.25),ct.q3=A.interp(tt,.75);ct.lf=m(ct,tt,Z),ct.uf=p(ct,tt,Z),ct.lo=y(ct),ct.uo=l(ct);var Oe=x(ct,Z);ct.ln=ct.med-Oe,ct.un=ct.med+Oe,Ut=Math.min(Ut,ct.ln),Kt=Math.max(Kt,ct.un),ct.pts2=lt.filter(Q),u.push(ct)}S.notched&&A.isTypedArray(Qt)&&(Qt=Array.from(Qt)),S._extremes[D._id]=g.findExtremes(D,S.notched?Qt.concat([Ut,Kt]):Qt,{padded:!0})}return s(u,S),u.length>0?(u[0].t={num:T[f],dPos:rt,posLetter:B,valLetter:I,labels:{med:e(b,"median:"),min:e(b,"min:"),q1:e(b,"q1:"),q3:e(b,"q3:"),max:e(b,"max:"),mean:S.boxmean==="sd"||S.sizemode==="sd"?e(b,"mean ± σ:").replace("σ",S.sdmultiple===1?"σ":S.sdmultiple+"σ"):e(b,"mean:"),lf:e(b,"lower fence:"),uf:e(b,"upper fence:")}},T[f]++,u):[{t:{empty:!0}}]};function r(b,S,T,M){var w=S in b,u=S+"0"in b,f="d"+S in b;if(w||u&&f){var k=T.makeCalcdata(b,S),_=E(b,T,S,k).vals;return[_,k]}var D;u?D=b[S+"0"]:"name"in b&&(T.type==="category"||c(b.name)&&["linear","log"].indexOf(T.type)!==-1||A.isDateTime(b.name)&&T.type==="date")?D=b.name:D=M;for(var I=T.type==="multicategory"?T.r2c_just_indices(D):T.d2c(D,0,b[S+"calendar"]),O=b._length,B=new Array(O),R=0;R<O;R++)B[R]=I;return[B]}function i(b,S){for(var T=b.length,M=new Array(T+1),w=0;w<T;w++)M[w]=b[w]-S;return M[T]=b[T-1]+S,M}function n(b){for(var S=new Array(b),T=0;T<b;T++)S[T]=[];return S}var o={text:"tx",hovertext:"htx"};function a(b,S,T){for(var M in o)A.isArrayOrTypedArray(S[M])&&(Array.isArray(T)?A.isArrayOrTypedArray(S[M][T[0]])&&(b[o[M]]=S[M][T[0]][T[1]]):b[o[M]]=S[M][T])}function s(b,S){if(A.isArrayOrTypedArray(S.selectedpoints))for(var T=0;T<b.length;T++){for(var M=b[T].pts||[],w={},u=0;u<M.length;u++)w[M[u].i]=u;A.tagSelected(M,S,w)}}function h(b,S){return b.v-S.v}function v(b){return b.v}function m(b,S,T){return T===0?b.q1:Math.min(b.q1,S[Math.min(A.findBin(2.5*b.q1-1.5*b.q3,S,!0)+1,T-1)])}function p(b,S,T){return T===0?b.q3:Math.max(b.q3,S[Math.max(A.findBin(2.5*b.q3-1.5*b.q1,S),0)])}function y(b){return 4*b.q1-3*b.q3}function l(b){return 4*b.q3-3*b.q1}function x(b,S){return S===0?0:1.57*(b.q3-b.q1)/Math.sqrt(S)}}),c1=Vt((X,V)=>{var c=ao(),g=qr(),E=c0().getAxisGroup,A=["v","h"];function t(r,i){for(var n=r.calcdata,o=i.xaxis,a=i.yaxis,s=0;s<A.length;s++){for(var h=A[s],v=h==="h"?a:o,m=[],p=0;p<n.length;p++){var y=n[p],l=y[0].t,x=y[0].trace;x.visible===!0&&(x.type==="box"||x.type==="candlestick")&&!l.empty&&(x.orientation||"v")===h&&x.xaxis===o._id&&x.yaxis===a._id&&m.push(p)}e("box",r,m,v)}}function e(r,i,n,o){var a=i.calcdata,s=i._fullLayout,h=o._id,v=h.charAt(0),m,p,y,l=[],x=0;for(m=0;m<n.length;m++)for(y=a[n[m]],p=0;p<y.length;p++)l.push(o.c2l(y[p].pos,!0)),x+=(y[p].pts2||[]).length;if(l.length){var b=g.distinctVals(l);(o.type==="category"||o.type==="multicategory")&&(b.minDiff=1);var S=b.minDiff/2;c.minDtick(o,b.minDiff,b.vals[0],!0);var T=r==="violin"?"_numViolins":"_numBoxes",M=s[T],w=s[r+"mode"]==="group"&&M>1,u=1-s[r+"gap"],f=1-s[r+"groupgap"];for(m=0;m<n.length;m++){y=a[n[m]];var k=y[0].trace,_=y[0].t,D=k.width,I=k.side,O,B,R,L;if(D)O=B=L=D/2,R=0;else if(O=S,w){var F=E(s,o._id)+k.orientation,N=s._alignmentOpts[F]||{},j=N[k.alignmentgroup]||{},G=Object.keys(j.offsetGroups||{}).length,rt=G||M,ct=G?k._offsetIndex:_.num;B=O*u*f/rt,R=2*O*(-.5+(ct+.5)/rt)*u,L=O*u/rt}else B=O*u*f,R=0,L=O;_.dPos=O,_.bPos=R,_.bdPos=B,_.wHover=L;var lt,tt,Z=R+B,st,$,Q,nt,Y,q,ot=!!D,it=(k.boxpoints||k.points)&&x>0;if(I==="positive"?(lt=O*(D?1:.5),st=Z,tt=st=R):I==="negative"?(lt=st=R,tt=O*(D?1:.5),$=Z):(lt=tt=O,st=$=Z),it){var dt=k.pointpos,wt=k.jitter,xt=k.marker.size/2,Ft=0;dt+wt>=0&&(Ft=Z*(dt+wt),Ft>lt?(ot=!0,Y=xt,Q=Ft):Ft>st&&(Y=xt,Q=lt)),Ft<=lt&&(Q=lt);var Et=0;dt-wt<=0&&(Et=-Z*(dt-wt),Et>tt?(ot=!0,q=xt,nt=Et):Et>$&&(q=xt,nt=tt)),Et<=tt&&(nt=tt)}else Q=lt,nt=tt;var Nt=new Array(y.length);for(p=0;p<y.length;p++)Nt[p]=y[p].pos;k._extremes[h]=c.findExtremes(o,Nt,{padded:ot,vpadminus:nt,vpadplus:Q,vpadLinearized:!0,ppadminus:{x:q,y:Y}[v],ppadplus:{x:Y,y:q}[v]})}}}V.exports={crossTraceCalc:t,setPositionOffset:e}}),h1=Vt((X,V)=>{var c=Ai(),g=qr(),E=go(),A=5,t=.01;function e(o,a,s,h){var v=o._context.staticPlot,m=a.xaxis,p=a.yaxis;g.makeTraceGroups(h,s,"trace boxes").each(function(y){var l=c.select(this),x=y[0],b=x.t,S=x.trace;if(b.wdPos=b.bdPos*S.whiskerwidth,S.visible!==!0||b.empty){l.remove();return}var T,M;S.orientation==="h"?(T=p,M=m):(T=m,M=p),r(l,{pos:T,val:M},S,b,v),i(l,{x:m,y:p},S,b),n(l,{pos:T,val:M},S,b)})}function r(o,a,s,h,v){var m=s.orientation==="h",p=a.val,y=a.pos,l=!!y.rangebreaks,x=h.bPos,b=h.wdPos||0,S=h.bPosPxOffset||0,T=s.whiskerwidth||0,M=s.showwhiskers!==!1,w=s.notched||!1,u=w?1-2*s.notchwidth:1,f,k;Array.isArray(h.bdPos)?(f=h.bdPos[0],k=h.bdPos[1]):(f=h.bdPos,k=h.bdPos);var _=o.selectAll("path.box").data(s.type!=="violin"||s.box.visible?g.identity:[]);_.enter().append("path").style("vector-effect",v?"none":"non-scaling-stroke").attr("class","box"),_.exit().remove(),_.each(function(D){if(D.empty)return c.select(this).attr("d","M0,0Z");var I=y.c2l(D.pos+x,!0),O=y.l2p(I-f)+S,B=y.l2p(I+k)+S,R=l?(O+B)/2:y.l2p(I)+S,L=s.whiskerwidth,F=l?O*L+(1-L)*R:y.l2p(I-b)+S,N=l?B*L+(1-L)*R:y.l2p(I+b)+S,j=y.l2p(I-f*u)+S,G=y.l2p(I+k*u)+S,rt=s.sizemode==="sd",ct=p.c2p(rt?D.mean-D.sd:D.q1,!0),lt=rt?p.c2p(D.mean+D.sd,!0):p.c2p(D.q3,!0),tt=g.constrain(rt?p.c2p(D.mean,!0):p.c2p(D.med,!0),Math.min(ct,lt)+1,Math.max(ct,lt)-1),Z=D.lf===void 0||s.boxpoints===!1||rt,st=p.c2p(Z?D.min:D.lf,!0),$=p.c2p(Z?D.max:D.uf,!0),Q=p.c2p(D.ln,!0),nt=p.c2p(D.un,!0);m?c.select(this).attr("d","M"+tt+","+j+"V"+G+"M"+ct+","+O+"V"+B+(w?"H"+Q+"L"+tt+","+G+"L"+nt+","+B:"")+"H"+lt+"V"+O+(w?"H"+nt+"L"+tt+","+j+"L"+Q+","+O:"")+"Z"+(M?"M"+ct+","+R+"H"+st+"M"+lt+","+R+"H"+$+(T===0?"":"M"+st+","+F+"V"+N+"M"+$+","+F+"V"+N):"")):c.select(this).attr("d","M"+j+","+tt+"H"+G+"M"+O+","+ct+"H"+B+(w?"V"+Q+"L"+G+","+tt+"L"+B+","+nt:"")+"V"+lt+"H"+O+(w?"V"+nt+"L"+j+","+tt+"L"+O+","+Q:"")+"Z"+(M?"M"+R+","+ct+"V"+st+"M"+R+","+lt+"V"+$+(T===0?"":"M"+F+","+st+"H"+N+"M"+F+","+$+"H"+N):""))})}function i(o,a,s,h){var v=a.x,m=a.y,p=h.bdPos,y=h.bPos,l=s.boxpoints||s.points;g.seedPseudoRandom();var x=function(T){return T.forEach(function(M){M.t=h,M.trace=s}),T},b=o.selectAll("g.points").data(l?x:[]);b.enter().append("g").attr("class","points"),b.exit().remove();var S=b.selectAll("path").data(function(T){var M,w=T.pts2,u=Math.max((T.max-T.min)/10,T.q3-T.q1),f=u*1e-9,k=u*t,_=[],D=0,I;if(s.jitter){if(u===0)for(D=1,_=new Array(w.length),M=0;M<w.length;M++)_[M]=1;else for(M=0;M<w.length;M++){var O=Math.max(0,M-A),B=w[O].v,R=Math.min(w.length-1,M+A),L=w[R].v;l!=="all"&&(w[M].v<T.lf?L=Math.min(L,T.lf):B=Math.max(B,T.uf));var F=Math.sqrt(k*(R-O)/(L-B+f))||0;F=g.constrain(Math.abs(F),0,1),_.push(F),D=Math.max(F,D)}I=s.jitter*2/(D||1)}for(M=0;M<w.length;M++){var N=w[M],j=N.v,G=s.jitter?I*_[M]*(g.pseudoRandom()-.5):0,rt=T.pos+y+p*(s.pointpos+G);s.orientation==="h"?(N.y=rt,N.x=j):(N.x=rt,N.y=j),l==="suspectedoutliers"&&j<T.uo&&j>T.lo&&(N.so=!0)}return w});S.enter().append("path").classed("point",!0),S.exit().remove(),S.call(E.translatePoints,v,m)}function n(o,a,s,h){var v=a.val,m=a.pos,p=!!m.rangebreaks,y=h.bPos,l=h.bPosPxOffset||0,x=s.boxmean||(s.meanline||{}).visible,b,S;Array.isArray(h.bdPos)?(b=h.bdPos[0],S=h.bdPos[1]):(b=h.bdPos,S=h.bdPos);var T=o.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?g.identity:[]);T.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),T.exit().remove(),T.each(function(M){var w=m.c2l(M.pos+y,!0),u=m.l2p(w-b)+l,f=m.l2p(w+S)+l,k=p?(u+f)/2:m.l2p(w)+l,_=v.c2p(M.mean,!0),D=v.c2p(M.mean-M.sd,!0),I=v.c2p(M.mean+M.sd,!0);s.orientation==="h"?c.select(this).attr("d","M"+_+","+u+"V"+f+(x==="sd"?"m0,0L"+D+","+k+"L"+_+","+u+"L"+I+","+k+"Z":"")):c.select(this).attr("d","M"+u+","+_+"H"+f+(x==="sd"?"m0,0L"+k+","+D+"L"+u+","+_+"L"+k+","+I+"Z":""))})}V.exports={plot:e,plotBoxAndWhiskers:r,plotPoints:i,plotBoxMean:n}}),f1=Vt((X,V)=>{var c=Ai(),g=vi(),E=go();function A(e,r,i){var n=i||c.select(e).selectAll("g.trace.boxes");n.style("opacity",function(o){return o[0].trace.opacity}),n.each(function(o){var a=c.select(this),s=o[0].trace,h=s.line.width;function v(y,l,x,b){y.style("stroke-width",l+"px").call(g.stroke,x).call(g.fill,b)}var m=a.selectAll("path.box");if(s.type==="candlestick")m.each(function(y){if(!y.empty){var l=c.select(this),x=s[y.dir];v(l,x.line.width,x.line.color,x.fillcolor),l.style("opacity",s.selectedpoints&&!y.selected?.3:1)}});else{v(m,h,s.line.color,s.fillcolor),a.selectAll("path.mean").style({"stroke-width":h,"stroke-dasharray":2*h+"px,"+h+"px"}).call(g.stroke,s.line.color);var p=a.selectAll("path.point");E.pointStyle(p,s,e)}})}function t(e,r,i){var n=r[0].trace,o=i.selectAll("path.point");n.selectedpoints?E.selectedPointStyle(o,n):E.pointStyle(o,n,e)}V.exports={style:A,styleOnSelect:t}}),Zb=Vt((X,V)=>{var c=ao(),g=qr(),E=Hu(),A=vi(),t=g.fillText;function e(n,o,a,s){var h=n.cd,v=h[0].trace,m=v.hoveron,p=[],y;return m.indexOf("boxes")!==-1&&(p=p.concat(r(n,o,a,s))),m.indexOf("points")!==-1&&(y=i(n,o,a)),s==="closest"?y?[y]:p:(y&&p.push(y),p)}function r(n,o,a,s){var h=n.cd,v=n.xa,m=n.ya,p=h[0].trace,y=h[0].t,l=p.type==="violin",x,b,S,T,M,w,u,f,k,_,D,I=y.bdPos,O,B,R=y.wHover,L=function(Et){return S.c2l(Et.pos)+y.bPos-S.c2l(w)};l&&p.side!=="both"?(p.side==="positive"&&(k=function(Et){var Nt=L(Et);return E.inbox(Nt,Nt+R,_)},O=I,B=0),p.side==="negative"&&(k=function(Et){var Nt=L(Et);return E.inbox(Nt-R,Nt,_)},O=0,B=I)):(k=function(Et){var Nt=L(Et);return E.inbox(Nt-R,Nt+R,_)},O=B=I);var F;l?F=function(Et){return E.inbox(Et.span[0]-M,Et.span[1]-M,_)}:F=function(Et){return E.inbox(Et.min-M,Et.max-M,_)},p.orientation==="h"?(M=o,w=a,u=F,f=k,x="y",S=m,b="x",T=v):(M=a,w=o,u=k,f=F,x="x",S=v,b="y",T=m);var N=Math.min(1,I/Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0])));_=n.maxHoverDistance-N,D=n.maxSpikeDistance-N;function j(Et){return(u(Et)+f(Et))/2}var G=E.getDistanceFunction(s,u,f,j);if(E.getClosest(h,G,n),n.index===!1)return[];var rt=h[n.index],ct=p.line.color,lt=(p.marker||{}).color;A.opacity(ct)&&p.line.width?n.color=ct:A.opacity(lt)&&p.boxpoints?n.color=lt:n.color=p.fillcolor,n[x+"0"]=S.c2p(rt.pos+y.bPos-B,!0),n[x+"1"]=S.c2p(rt.pos+y.bPos+O,!0),n[x+"LabelVal"]=rt.orig_p!==void 0?rt.orig_p:rt.pos;var tt=x+"Spike";n.spikeDistance=j(rt)*D/_,n[tt]=S.c2p(rt.pos,!0);var Z=p.boxmean||p.sizemode==="sd"||(p.meanline||{}).visible,st=p.boxpoints||p.points,$=st&&Z?["max","uf","q3","med","mean","q1","lf","min"]:st&&!Z?["max","uf","q3","med","q1","lf","min"]:!st&&Z?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],Q=T.range[1]<T.range[0];p.orientation===(Q?"v":"h")&&$.reverse();for(var nt=n.spikeDistance,Y=n[tt],q=[],ot=0;ot<$.length;ot++){var it=$[ot];if(it in rt){var dt=rt[it],wt=T.c2p(dt,!0),xt=g.extendFlat({},n);xt.attr=it,xt[b+"0"]=xt[b+"1"]=wt,xt[b+"LabelVal"]=dt,xt[b+"Label"]=(y.labels?y.labels[it]+" ":"")+c.hoverLabelText(T,dt,p[b+"hoverformat"]),xt.hoverOnBox=!0,it==="mean"&&"sd"in rt&&(p.boxmean==="sd"||p.sizemode==="sd")&&(xt[b+"err"]=rt.sd),xt.hovertemplate=!1,q.push(xt)}}n.name="",n.spikeDistance=void 0,n[tt]=void 0;for(var Ft=0;Ft<q.length;Ft++)q[Ft].attr!=="med"?(q[Ft].name="",q[Ft].spikeDistance=void 0,q[Ft][tt]=void 0):(q[Ft].spikeDistance=nt,q[Ft][tt]=Y);return q}function i(n,o,a){for(var s=n.cd,h=n.xa,v=n.ya,m=s[0].trace,p=h.c2p(o),y=v.c2p(a),l,x=function(F){var N=Math.max(3,F.mrc||0);return Math.max(Math.abs(h.c2p(F.x)-p)-N,1-3/N)},b=function(F){var N=Math.max(3,F.mrc||0);return Math.max(Math.abs(v.c2p(F.y)-y)-N,1-3/N)},S=E.quadrature(x,b),T=!1,M,w,u=0;u<s.length;u++){M=s[u];for(var f=0;f<(M.pts||[]).length;f++){w=M.pts[f];var k=S(w);k<=n.distance&&(n.distance=k,T=[u,f])}}if(!T)return!1;M=s[T[0]],w=M.pts[T[1]];var _=h.c2p(w.x,!0),D=v.c2p(w.y,!0),I=w.mrc||1;l=g.extendFlat({},n,{index:w.i,color:(m.marker||{}).color,name:m.name,x0:_-I,x1:_+I,y0:D-I,y1:D+I,spikeDistance:n.distance,hovertemplate:m.hovertemplate});var O=M.orig_p,B=O!==void 0?O:M.pos,R;m.orientation==="h"?(R=v,l.xLabelVal=w.x,l.yLabelVal=B):(R=h,l.xLabelVal=B,l.yLabelVal=w.y);var L=R._id.charAt(0);return l[L+"Spike"]=R.c2p(M.pos,!0),t(w,m,l),l}V.exports={hoverPoints:e,hoverOnBoxes:r,hoverOnPoints:i}}),TA=Vt((X,V)=>{V.exports=function(c,g){return g.hoverOnBox&&(c.hoverOnBox=g.hoverOnBox),"xVal"in g&&(c.x=g.xVal),"yVal"in g&&(c.y=g.yVal),g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),c}}),Xb=Vt((X,V)=>{V.exports=function(c,g){var E=c.cd,A=c.xaxis,t=c.yaxis,e=[],r,i;if(g===!1)for(r=0;r<E.length;r++)for(i=0;i<(E[r].pts||[]).length;i++)E[r].pts[i].selected=0;else for(r=0;r<E.length;r++)for(i=0;i<(E[r].pts||[]).length;i++){var n=E[r].pts[i],o=A.c2p(n.x),a=t.c2p(n.y);g.contains([o,a],null,n.i,c)?(e.push({pointNumber:n.i,x:A.c2d(n.x),y:t.c2d(n.y)}),n.selected=1):n.selected=0}return e}}),kA=Vt((X,V)=>{V.exports={attributes:Zm(),layoutAttributes:Xm(),supplyDefaults:$m().supplyDefaults,crossTraceDefaults:$m().crossTraceDefaults,supplyLayoutDefaults:u1().supplyLayoutDefaults,calc:Wb(),crossTraceCalc:c1().crossTraceCalc,plot:h1().plot,style:f1().style,styleOnSelect:f1().styleOnSelect,hoverPoints:Zb().hoverPoints,eventData:TA(),selectPoints:Xb(),moduleType:"trace",name:"box",basePlotModule:Pc(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}),AA=Vt((X,V)=>{V.exports=kA()}),Lg=Vt((X,V)=>{var c=Gu(),g=Ks(),E=Nl(),A=qu().axisHoverFormat,t=Zo().hovertemplateAttrs,e=Zo().texttemplateAttrs,r=wl(),i=po().extendFlat;V.exports=i({z:{valType:"data_array",editType:"calc"},x:i({},c.x,{impliedEdits:{xtype:"array"}}),x0:i({},c.x0,{impliedEdits:{xtype:"scaled"}}),dx:i({},c.dx,{impliedEdits:{xtype:"scaled"}}),y:i({},c.y,{impliedEdits:{ytype:"array"}}),y0:i({},c.y0,{impliedEdits:{ytype:"scaled"}}),dy:i({},c.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:i({},c.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:i({},c.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:i({},c.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:i({},c.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:i({},c.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:i({},c.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:A("x"),yhoverformat:A("y"),zhoverformat:A("z",1),hovertemplate:t(),texttemplate:e({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:E({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:i({},g.showlegend,{dflt:!1}),zorder:c.zorder},r("",{cLetter:"z",autoColorDflt:!1}))}),p1=Vt((X,V)=>{var c=vo(),g=qr(),E=Mi();V.exports=function(e,r,i,n,o,a){var s=i("z");o=o||"x",a=a||"y";var h,v;if(s===void 0||!s.length)return 0;if(g.isArray1D(s)){h=i(o),v=i(a);var m=g.minRowLength(h),p=g.minRowLength(v);if(m===0||p===0)return 0;r._length=Math.min(m,p,s.length)}else{if(h=A(o,i),v=A(a,i),!t(s))return 0;i("transpose"),r._length=null}var y=E.getComponentMethod("calendars","handleTraceDefaults");return y(e,r,[o,a],n),!0};function A(e,r){var i=r(e),n=i?r(e+"type","array"):"scaled";return n==="scaled"&&(r(e+"0"),r("d"+e)),i}function t(e){for(var r=!0,i=!1,n=!1,o,a=0;a<e.length;a++){if(o=e[a],!g.isArrayOrTypedArray(o)){r=!1;break}o.length>0&&(i=!0);for(var s=0;s<o.length;s++)if(c(o[s])){n=!0;break}}return r&&i&&n}}),Jm=Vt((X,V)=>{var c=qr();V.exports=function(g,E){g("texttemplate");var A=c.extendFlat({},E.font,{color:"auto",size:"auto"});c.coerceFont(g,"textfont",A)}}),$b=Vt((X,V)=>{V.exports=function(c,g,E){var A=E("zsmooth");A===!1&&(E("xgap"),E("ygap")),E("zhoverformat")}}),MA=Vt((X,V)=>{var c=qr(),g=p1(),E=Jm(),A=np(),t=$b(),e=ah(),r=Lg();V.exports=function(i,n,o,a){function s(v,m){return c.coerce(i,n,r,v,m)}var h=g(i,n,s,a);if(!h){n.visible=!1;return}A(i,n,a,s),s("xhoverformat"),s("yhoverformat"),s("text"),s("hovertext"),s("hovertemplate"),E(s,a),t(i,n,s,a),s("hoverongaps"),s("connectgaps",c.isArray1D(n.z)&&n.zsmooth!==!1),e(i,n,a,s,{prefix:"",cLetter:"z"}),s("zorder")}}),Jb=Vt((X,V)=>{var c=vo();V.exports={count:function(g,E,A){return A[g]++,1},sum:function(g,E,A,t){var e=t[E];return c(e)?(e=Number(e),A[g]+=e,e):0},avg:function(g,E,A,t,e){var r=t[E];return c(r)&&(r=Number(r),A[g]+=r,e[g]++),0},min:function(g,E,A,t){var e=t[E];if(c(e))if(e=Number(e),c(A[g])){if(A[g]>e){var r=e-A[g];return A[g]=e,r}}else return A[g]=e,e;return 0},max:function(g,E,A,t){var e=t[E];if(c(e))if(e=Number(e),c(A[g])){if(A[g]<e){var r=e-A[g];return A[g]=e,r}}else return A[g]=e,e;return 0}}}),Qb=Vt((X,V)=>{V.exports={percent:function(c,g){for(var E=c.length,A=100/g,t=0;t<E;t++)c[t]*=A},probability:function(c,g){for(var E=c.length,A=0;A<E;A++)c[A]/=g},density:function(c,g,E,A){var t=c.length;A=A||1;for(var e=0;e<t;e++)c[e]*=E[e]*A},"probability density":function(c,g,E,A){var t=c.length;A&&(g/=A);for(var e=0;e<t;e++)c[e]*=E[e]/g}}}),Yb=Vt((X,V)=>{V.exports=function(c,g){for(var E=c.length,A=0,t=0;t<E;t++)g[t]?(c[t]/=g[t],A+=c[t]):c[t]=null;return A}}),Kb=Vt((X,V)=>{var c=ts(),g=c.ONEAVGYEAR,E=c.ONEAVGMONTH,A=c.ONEDAY,t=c.ONEHOUR,e=c.ONEMIN,r=c.ONESEC,i=ao().tickIncrement;V.exports=function(h,v,m,p,y){var l=-1.1*v,x=-.1*v,b=h-x,S=m[0],T=m[1],M=Math.min(n(S+x,S+b,p,y),n(T+x,T+b,p,y)),w=Math.min(n(S+l,S+x,p,y),n(T+l,T+x,p,y)),u,f;if(M>w&&w<Math.abs(T-S)/4e3?(u=M,f=!1):(u=Math.min(M,w),f=!0),p.type==="date"&&u>A){var k=u===g?1:6,_=u===g?"M12":"M1";return function(D,I){var O=p.c2d(D,g,y),B=O.indexOf("-",k);B>0&&(O=O.substr(0,B));var R=p.d2c(O,0,y);if(R<D){var L=i(R,_,!1,y);(R+L)/2<D+h&&(R=L)}return I&&f?i(R,_,!0,y):R}}return function(D,I){var O=u*Math.round(D/u);return O+u/10<D&&O+u*.9<D+h&&(O+=u),I&&f&&(O-=u),O}};function n(h,v,m,p){if(h*v<=0)return 1/0;for(var y=Math.abs(v-h),l=m.type==="date",x=o(y,l),b=0;b<10;b++){var S=o(x*80,l);if(x===S)break;if(a(S,h,v,l,m,p))x=S;else break}return x}function o(h,v){return v&&h>r?h>A?h>g*1.1?g:h>E*1.1?E:A:h>t?t:h>e?e:r:Math.pow(10,Math.floor(Math.log(h)/Math.LN10))}function a(h,v,m,p,y,l){if(p&&h>A){var x=s(v,y,l),b=s(m,y,l),S=h===g?0:1;return x[S]!==b[S]}return Math.floor(m/h)-Math.floor(v/h)>.1}function s(h,v,m){var p=v.c2d(h,g,m).split("-");return p[0]===""&&(p.unshift(),p[0]="-"+p[0]),p}}),t2=Vt((X,V)=>{var c=vo(),g=qr(),E=Mi(),A=ao(),t=Wm(),e=Jb(),r=Qb(),i=Yb(),n=Kb();function o(m,p){var y=[],l=[],x=p.orientation==="h",b=A.getFromId(m,x?p.yaxis:p.xaxis),S=x?"y":"x",T={x:"y",y:"x"}[S],M=p[S+"calendar"],w=p.cumulative,u,f=a(m,p,b,S),k=f[0],_=f[1],D=typeof k.size=="string",I=[],O=D?I:k,B=[],R=[],L=[],F=0,N=p.histnorm,j=p.histfunc,G=N.indexOf("density")!==-1,rt,ct,lt;w.enabled&&G&&(N=N.replace(/ ?density$/,""),G=!1);var tt=j==="max"||j==="min",Z=tt?null:0,st=e.count,$=r[N],Q=!1,nt=function(bt){return b.r2c(bt,0,M)},Y;for(g.isArrayOrTypedArray(p[T])&&j!=="count"&&(Y=p[T],Q=j==="avg",st=e[j]),u=nt(k.start),ct=nt(k.end)+(u-A.tickIncrement(u,k.size,!1,M))/1e6;u<ct&&y.length<1e6&&(rt=A.tickIncrement(u,k.size,!1,M),y.push((u+rt)/2),l.push(Z),L.push([]),I.push(u),G&&B.push(1/(rt-u)),Q&&R.push(0),!(rt<=u));)u=rt;I.push(u),!D&&b.type==="date"&&(O={start:nt(O.start),end:nt(O.end),size:O.size}),m._fullLayout._roundFnOpts||(m._fullLayout._roundFnOpts={});var q=p["_"+S+"bingroup"],ot={leftGap:1/0,rightGap:1/0};q&&(m._fullLayout._roundFnOpts[q]||(m._fullLayout._roundFnOpts[q]=ot),ot=m._fullLayout._roundFnOpts[q]);var it=l.length,dt=!0,wt=ot.leftGap,xt=ot.rightGap,Ft={};for(u=0;u<_.length;u++){var Et=_[u];lt=g.findBin(Et,O),lt>=0&<<it&&(F+=st(lt,u,l,Y,R),dt&&L[lt].length&&Et!==_[L[lt][0]]&&(dt=!1),L[lt].push(u),Ft[u]=lt,wt=Math.min(wt,Et-I[lt]),xt=Math.min(xt,I[lt+1]-Et))}ot.leftGap=wt,ot.rightGap=xt;var Nt;dt||(Nt=function(bt,vt){return function(){var Ut=m._fullLayout._roundFnOpts[q];return n(Ut.leftGap,Ut.rightGap,I,b,M)(bt,vt)}}),Q&&(F=i(l,R)),$&&$(l,F,B),w.enabled&&v(l,w.direction,w.currentbin);var te=Math.min(y.length,l.length),Jt=[],Qt=0,Wt=te-1;for(u=0;u<te;u++)if(l[u]){Qt=u;break}for(u=te-1;u>=Qt;u--)if(l[u]){Wt=u;break}for(u=Qt;u<=Wt;u++)if(c(y[u])&&c(l[u])){var gt={p:y[u],s:l[u],b:0};w.enabled||(gt.pts=L[u],dt?gt.ph0=gt.ph1=L[u].length?_[L[u][0]]:y[u]:(p._computePh=!0,gt.ph0=Nt(I[u]),gt.ph1=Nt(I[u+1],!0))),Jt.push(gt)}return Jt.length===1&&(Jt[0].width1=A.tickIncrement(Jt[0].p,k.size,!1,M)-Jt[0].p),t(Jt,p),g.isArrayOrTypedArray(p.selectedpoints)&&g.tagSelected(Jt,p,Ft),Jt}function a(m,p,y,l,x){var b=l+"bins",S=m._fullLayout,T=p["_"+l+"bingroup"],M=S._histogramBinOpts[T],w=S.barmode==="overlay",u,f,k,_,D,I,O,B=function(Et){return y.r2c(Et,0,_)},R=function(Et){return y.c2r(Et,0,_)},L=y.type==="date"?function(Et){return Et||Et===0?g.cleanDate(Et,null,_):null}:function(Et){return c(Et)?Number(Et):null};function F(Et,Nt,te){Nt[Et+"Found"]?(Nt[Et]=L(Nt[Et]),Nt[Et]===null&&(Nt[Et]=te[Et])):(I[Et]=Nt[Et]=te[Et],g.nestedProperty(f[0],b+"."+Et).set(te[Et]))}if(p["_"+l+"autoBinFinished"])delete p["_"+l+"autoBinFinished"];else{f=M.traces;var N=[],j=!0,G=!1,rt=!1;for(u=0;u<f.length;u++)if(k=f[u],k.visible){var ct=M.dirs[u];D=k["_"+ct+"pos0"]=y.makeCalcdata(k,ct),N=g.concat(N,D),delete k["_"+l+"autoBinFinished"],p.visible===!0&&(j?j=!1:(delete k._autoBin,k["_"+l+"autoBinFinished"]=1),E.traceIs(k,"2dMap")&&(G=!0),k.type==="histogram2dcontour"&&(rt=!0))}_=f[0][l+"calendar"];var lt=A.autoBin(N,y,M.nbins,G,_,M.sizeFound&&M.size),tt=f[0]._autoBin={};if(I=tt[M.dirs[0]]={},rt&&(M.size||(lt.start=R(A.tickIncrement(B(lt.start),lt.size,!0,_))),M.end===void 0&&(lt.end=R(A.tickIncrement(B(lt.end),lt.size,!1,_)))),w&&!E.traceIs(p,"2dMap")&<._dataSpan===0&&y.type!=="category"&&y.type!=="multicategory"&&p.bingroup===""&&typeof p.xbins>"u"){if(x)return[lt,D,!0];lt=s(m,p,y,l,b)}O=k.cumulative||{},O.enabled&&O.currentbin!=="include"&&(O.direction==="decreasing"?lt.start=R(A.tickIncrement(B(lt.start),lt.size,!0,_)):lt.end=R(A.tickIncrement(B(lt.end),lt.size,!1,_))),M.size=lt.size,M.sizeFound||(I.size=lt.size,g.nestedProperty(f[0],b+".size").set(lt.size)),F("start",M,lt),F("end",M,lt)}D=p["_"+l+"pos0"],delete p["_"+l+"pos0"];var Z=p._input[b]||{},st=g.extendFlat({},M),$=M.start,Q=y.r2l(Z.start),nt=Q!==void 0;if((M.startFound||nt)&&Q!==y.r2l($)){var Y=nt?Q:g.aggNums(Math.min,null,D),q={type:y.type==="category"||y.type==="multicategory"?"linear":y.type,r2l:y.r2l,dtick:M.size,tick0:$,calendar:_,range:[Y,A.tickIncrement(Y,M.size,!1,_)].map(y.l2r)},ot=A.tickFirst(q);ot>y.r2l(Y)&&(ot=A.tickIncrement(ot,M.size,!0,_)),st.start=y.l2r(ot),nt||g.nestedProperty(p,b+".start").set(st.start)}var it=M.end,dt=y.r2l(Z.end),wt=dt!==void 0;if((M.endFound||wt)&&dt!==y.r2l(it)){var xt=wt?dt:g.aggNums(Math.max,null,D);st.end=y.l2r(xt),wt||g.nestedProperty(p,b+".start").set(st.end)}var Ft="autobin"+l;return p._input[Ft]===!1&&(p._input[b]=g.extendFlat({},p[b]||{}),delete p._input[Ft],delete p[Ft]),[st,D]}function s(m,p,y,l,x){var b=m._fullLayout,S=h(m,p),T=!1,M=1/0,w=[p],u,f,k;for(u=0;u<S.length;u++)if(f=S[u],f===p)T=!0;else if(!T)k=b._histogramBinOpts[f["_"+l+"bingroup"]],M=Math.min(M,k.size||f[x].size);else{var _=a(m,f,y,l,!0),D=_[0],I=_[2];f["_"+l+"autoBinFinished"]=1,f["_"+l+"pos0"]=_[1],I?w.push(f):M=Math.min(M,D.size)}var O=new Array(w.length);for(u=0;u<w.length;u++)for(var B=w[u]["_"+l+"pos0"],R=0;R<B.length;R++)if(B[R]!==void 0){O[u]=B[R];break}for(isFinite(M)||(M=g.distinctVals(O).minDiff),u=0;u<w.length;u++){f=w[u];var L=f[l+"calendar"],F={start:y.c2r(O[u]-M/2,0,L),end:y.c2r(O[u]+M/2,0,L),size:M};f._input[x]=f[x]=F,k=b._histogramBinOpts[f["_"+l+"bingroup"]],k&&g.extendFlat(k,F)}return p[x]}function h(m,p){for(var y=p.xaxis,l=p.yaxis,x=p.orientation,b=[],S=m._fullData,T=0;T<S.length;T++){var M=S[T];M.type==="histogram"&&M.visible===!0&&M.orientation===x&&M.xaxis===y&&M.yaxis===l&&b.push(M)}return b}function v(m,p,y){var l,x,b;function S(M){b=m[M],m[M]/=2}function T(M){x=m[M],m[M]=b+x/2,b+=x}if(y==="half")if(p==="increasing")for(S(0),l=1;l<m.length;l++)T(l);else for(S(m.length-1),l=m.length-2;l>=0;l--)T(l);else if(p==="increasing"){for(l=1;l<m.length;l++)m[l]+=m[l-1];y==="exclude"&&(m.unshift(0),m.pop())}else{for(l=m.length-2;l>=0;l--)m[l]+=m[l+1];y==="exclude"&&(m.push(0),m.shift())}}V.exports={calc:o,calcAllAutoBins:a}}),SA=Vt((X,V)=>{var c=qr(),g=ao(),E=Jb(),A=Qb(),t=Yb(),e=Kb(),r=t2().calcAllAutoBins;V.exports=function(a,s){var h=g.getFromId(a,s.xaxis),v=g.getFromId(a,s.yaxis),m=s.xcalendar,p=s.ycalendar,y=function(he){return h.r2c(he,0,m)},l=function(he){return v.r2c(he,0,p)},x=function(he){return h.c2r(he,0,m)},b=function(he){return v.c2r(he,0,p)},S,T,M,w,u=r(a,s,h,"x"),f=u[0],k=u[1],_=r(a,s,v,"y"),D=_[0],I=_[1],O=s._length;k.length>O&&k.splice(O,k.length-O),I.length>O&&I.splice(O,I.length-O);var B=[],R=[],L=[],F=typeof f.size=="string",N=typeof D.size=="string",j=[],G=[],rt=F?j:f,ct=N?G:D,lt=0,tt=[],Z=[],st=s.histnorm,$=s.histfunc,Q=st.indexOf("density")!==-1,nt=$==="max"||$==="min",Y=nt?null:0,q=E.count,ot=A[st],it=!1,dt=[],wt=[],xt="z"in s?s.z:"marker"in s&&Array.isArray(s.marker.color)?s.marker.color:"";xt&&$!=="count"&&(it=$==="avg",q=E[$]);var Ft=f.size,Et=y(f.start),Nt=y(f.end)+(Et-g.tickIncrement(Et,Ft,!1,m))/1e6;for(S=Et;S<Nt;S=g.tickIncrement(S,Ft,!1,m))R.push(Y),j.push(S),it&&L.push(0);j.push(S);var te=R.length,Jt=(S-Et)/te,Qt=x(Et+Jt/2),Wt=D.size,gt=l(D.start),bt=l(D.end)+(gt-g.tickIncrement(gt,Wt,!1,p))/1e6;for(S=gt;S<bt;S=g.tickIncrement(S,Wt,!1,p)){B.push(R.slice()),G.push(S);var vt=new Array(te);for(T=0;T<te;T++)vt[T]=[];Z.push(vt),it&&tt.push(L.slice())}G.push(S);var Ut=B.length,Kt=(S-gt)/Ut,Zt=b(gt+Kt/2);Q&&(dt=i(R.length,rt,Jt,F),wt=i(B.length,ct,Kt,N)),!F&&h.type==="date"&&(rt=n(y,rt)),!N&&v.type==="date"&&(ct=n(l,ct));var le=!0,Te=!0,Se=new Array(te),Fe=new Array(Ut),Oe=1/0,ur=1/0,fr=1/0,We=1/0;for(S=0;S<O;S++){var Lr=k[S],kr=I[S];M=c.findBin(Lr,rt),w=c.findBin(kr,ct),M>=0&&M<te&&w>=0&&w<Ut&&(lt+=q(M,S,B[w],xt,tt[w]),Z[w][M].push(S),le&&(Se[M]===void 0?Se[M]=Lr:Se[M]!==Lr&&(le=!1)),Te&&(Fe[w]===void 0?Fe[w]=kr:Fe[w]!==kr&&(Te=!1)),Oe=Math.min(Oe,Lr-j[M]),ur=Math.min(ur,j[M+1]-Lr),fr=Math.min(fr,kr-G[w]),We=Math.min(We,G[w+1]-kr))}if(it)for(w=0;w<Ut;w++)lt+=t(B[w],tt[w]);if(ot)for(w=0;w<Ut;w++)ot(B[w],lt,dt,wt[w]);return{x:k,xRanges:o(j,le&&Se,Oe,ur,h,m),x0:Qt,dx:Jt,y:I,yRanges:o(G,Te&&Fe,fr,We,v,p),y0:Zt,dy:Kt,z:B,pts:Z}};function i(a,s,h,v){var m=new Array(a),p;if(v)for(p=0;p<a;p++)m[p]=1/(s[p+1]-s[p]);else{var y=1/h;for(p=0;p<a;p++)m[p]=y}return m}function n(a,s){return{start:a(s.start),end:a(s.end),size:s.size}}function o(a,s,h,v,m,p){var y,l=a.length-1,x=new Array(l),b=e(h,v,a,m,p);for(y=0;y<l;y++){var S=(s||[])[y];x[y]=S===void 0?[b(a[y]),b(a[y+1],!0)]:[S,S]}return x}}),d1=Vt((X,V)=>{var c=qr(),g=ts().BADNUM,E=ip();V.exports=function(A,t,e,r,i,n){var o=A._length,a=t.makeCalcdata(A,r),s=e.makeCalcdata(A,i);a=E(A,t,r,a).vals,s=E(A,e,i,s).vals;var h=A.text,v=h!==void 0&&c.isArray1D(h),m=A.hovertext,p=m!==void 0&&c.isArray1D(m),y,l,x=c.distinctVals(a),b=x.vals,S=c.distinctVals(s),T=S.vals,M=[],w,u,f=T.length,k=b.length;for(y=0;y<n.length;y++)M[y]=c.init2dArray(f,k);v&&(w=c.init2dArray(f,k)),p&&(u=c.init2dArray(f,k));var _=c.init2dArray(f,k);for(y=0;y<o;y++)if(a[y]!==g&&s[y]!==g){var D=c.findBin(a[y]+x.minDiff/2,b),I=c.findBin(s[y]+S.minDiff/2,T);for(l=0;l<n.length;l++){var O=n[l],B=A[O],R=M[l];R[I][D]=B[y],_[I][D]=y}v&&(w[I][D]=h[y]),p&&(u[I][D]=m[y])}for(A["_"+r]=b,A["_"+i]=T,l=0;l<n.length;l++)A["_"+n[l]]=M[l];v&&(A._text=w),p&&(A._hovertext=u),t&&t.type==="category"&&(A["_"+r+"CategoryMap"]=b.map(function(L){return t._categories[L]})),e&&e.type==="category"&&(A["_"+i+"CategoryMap"]=T.map(function(L){return e._categories[L]})),A._after2before=_}}),g1=Vt((X,V)=>{var c=vo(),g=qr(),E=ts().BADNUM;V.exports=function(A,t,e,r){var i,n,o,a,s,h;function v(b){if(c(b))return+b}if(t&&t.transpose){for(i=0,s=0;s<A.length;s++)i=Math.max(i,A[s].length);if(i===0)return!1;o=function(b){return b.length},a=function(b,S,T){return(b[T]||[])[S]}}else i=A.length,o=function(b,S){return b[S].length},a=function(b,S,T){return(b[S]||[])[T]};var m=function(b,S,T){return S===E||T===E?E:a(b,S,T)};function p(b){if(t&&t.type!=="carpet"&&t.type!=="contourcarpet"&&b&&b.type==="category"&&t["_"+b._id.charAt(0)].length){var S=b._id.charAt(0),T={},M=t["_"+S+"CategoryMap"]||t[S];for(s=0;s<M.length;s++)T[M[s]]=s;return function(w){var u=T[b._categories[w]];return u+1?u:E}}else return g.identity}var y=p(e),l=p(r);r&&r.type==="category"&&(i=r._categories.length);var x=new Array(i);for(s=0;s<i;s++)for(e&&e.type==="category"?n=e._categories.length:n=o(A,s),x[s]=new Array(n),h=0;h<n;h++)x[s][h]=v(m(A,l(s),y(h)));return x}}),m1=Vt((X,V)=>{var c=qr(),g=.01,E=[[-1,0],[1,0],[0,-1],[0,1]];function A(e){return .5-.25*Math.min(1,e*.5)}V.exports=function(e,r){var i=1,n;for(t(e,r),n=0;n<r.length&&!(r[n][2]<4);n++);for(r=r.slice(n),n=0;n<100&&i>g;n++)i=t(e,r,A(i));return i>g&&c.log("interp2d didn't converge quickly",i),e};function t(e,r,i){var n=0,o,a,s,h,v,m,p,y,l,x,b,S,T;for(h=0;h<r.length;h++){for(o=r[h],a=o[0],s=o[1],b=e[a][s],x=0,l=0,v=0;v<4;v++)m=E[v],p=e[a+m[0]],p&&(y=p[s+m[1]],y!==void 0&&(x===0?S=T=y:(S=Math.min(S,y),T=Math.max(T,y)),l++,x+=y));if(l===0)throw"iterateInterp2d order is wrong: no defined neighbors";e[a][s]=x/l,b===void 0?l<4&&(n=1):(e[a][s]=(1+i)*e[a][s]-i*b,T>S&&(n=Math.max(n,Math.abs(e[a][s]-b)/(T-S))))}return n}}),v1=Vt((X,V)=>{var c=qr().maxRowLength;V.exports=function(g){var E=[],A={},t=[],e=g[0],r=[],i=[0,0,0],n=c(g),o,a,s,h,v,m,p,y;for(a=0;a<g.length;a++)for(o=r,r=e,e=g[a+1]||[],s=0;s<n;s++)r[s]===void 0&&(m=(r[s-1]!==void 0?1:0)+(r[s+1]!==void 0?1:0)+(o[s]!==void 0?1:0)+(e[s]!==void 0?1:0),m?(a===0&&m++,s===0&&m++,a===g.length-1&&m++,s===r.length-1&&m++,m<4&&(A[[a,s]]=[a,s,m]),E.push([a,s,m])):t.push([a,s]));for(;t.length;){for(p={},y=!1,v=t.length-1;v>=0;v--)h=t[v],a=h[0],s=h[1],m=((A[[a-1,s]]||i)[2]+(A[[a+1,s]]||i)[2]+(A[[a,s-1]]||i)[2]+(A[[a,s+1]]||i)[2])/20,m&&(p[h]=[a,s,m],t.splice(v,1),y=!0);if(!y)throw"findEmpties iterated with no new neighbors";for(h in p)A[h]=p[h],E.push(p[h])}return E.sort(function(l,x){return x[2]-l[2]})}}),e2=Vt((X,V)=>{var c=Mi(),g=qr().isArrayOrTypedArray;V.exports=function(E,A,t,e,r,i){var n=[],o=c.traceIs(E,"contour"),a=c.traceIs(E,"histogram"),s,h,v,m=g(A)&&A.length>1;if(m&&!a&&i.type!=="category"){var p=A.length;if(p<=r){if(o)n=Array.from(A).slice(0,r);else if(r===1)i.type==="log"?n=[.5*A[0],2*A[0]]:n=[A[0]-.5,A[0]+.5];else if(i.type==="log"){for(n=[Math.pow(A[0],1.5)/Math.pow(A[1],.5)],v=1;v<p;v++)n.push(Math.sqrt(A[v-1]*A[v]));n.push(Math.pow(A[p-1],1.5)/Math.pow(A[p-2],.5))}else{for(n=[1.5*A[0]-.5*A[1]],v=1;v<p;v++)n.push((A[v-1]+A[v])*.5);n.push(1.5*A[p-1]-.5*A[p-2])}if(p<r){var y=n[n.length-1],l;if(i.type==="log")for(l=y/n[n.length-2],v=p;v<r;v++)y*=l,n.push(y);else for(l=y-n[n.length-2],v=p;v<r;v++)y+=l,n.push(y)}}else return o?A.slice(0,r):A.slice(0,r+1)}else{var x=E[i._id.charAt(0)+"calendar"];if(a)s=i.r2c(t,0,x);else if(g(A)&&A.length===1)s=A[0];else if(t===void 0)s=0;else{var b=i.type==="log"?i.d2c:i.r2c;s=b(t,0,x)}for(h=e||1,v=o?0:-.5;v<r;v++)n.push(s+h*v)}return n}}),y1=Vt((X,V)=>{var c=Mi(),g=qr(),E=ao(),A=ip(),t=SA(),e=df(),r=d1(),i=g1(),n=m1(),o=v1(),a=e2(),s=ts().BADNUM;V.exports=function(m,p){var y=E.getFromId(m,p.xaxis||"x"),l=E.getFromId(m,p.yaxis||"y"),x=c.traceIs(p,"contour"),b=c.traceIs(p,"histogram"),S=x?"best":p.zsmooth,T,M,w,u,f,k,_,D,I,O,B;if(y._minDtick=0,l._minDtick=0,b)B=t(m,p),u=B.orig_x,T=B.x,M=B.x0,w=B.dx,D=B.orig_y,f=B.y,k=B.y0,_=B.dy,I=B.z;else{var R=p.z;g.isArray1D(R)?(r(p,y,l,"x","y",["z"]),T=p._x,f=p._y,R=p._z):(u=p.x?y.makeCalcdata(p,"x"):[],D=p.y?l.makeCalcdata(p,"y"):[],T=A(p,y,"x",u).vals,f=A(p,l,"y",D).vals,p._x=T,p._y=f),M=p.x0,w=p.dx,k=p.y0,_=p.dy,I=i(R,p,y,l)}(y.rangebreaks||l.rangebreaks)&&(I=v(T,f,I),b||(T=h(T),f=h(f),p._x=T,p._y=f)),!b&&(x||p.connectgaps)&&(p._emptypoints=o(I),n(I,p._emptypoints));function L(Z){S=p._input.zsmooth=p.zsmooth=!1,g.warn('cannot use zsmooth: "fast": '+Z)}function F(Z){if(Z.length>1){var st=(Z[Z.length-1]-Z[0])/(Z.length-1),$=Math.abs(st/100);for(O=0;O<Z.length-1;O++)if(Math.abs(Z[O+1]-Z[O]-st)>$)return!1}return!0}p._islinear=!1,y.type==="log"||l.type==="log"?S==="fast"&&L("log axis found"):F(T)?F(f)?p._islinear=!0:S==="fast"&&L("y scale is not linear"):S==="fast"&&L("x scale is not linear");var N=g.maxRowLength(I),j=p.xtype==="scaled"?"":T,G=a(p,j,M,w,N,y),rt=p.ytype==="scaled"?"":f,ct=a(p,rt,k,_,I.length,l);p._extremes[y._id]=E.findExtremes(y,G),p._extremes[l._id]=E.findExtremes(l,ct);var lt={x:G,y:ct,z:I,text:p._text||p.text,hovertext:p._hovertext||p.hovertext};if(p.xperiodalignment&&u&&(lt.orig_x=u),p.yperiodalignment&&D&&(lt.orig_y=D),j&&j.length===G.length-1&&(lt.xCenter=j),rt&&rt.length===ct.length-1&&(lt.yCenter=rt),b&&(lt.xRanges=B.xRanges,lt.yRanges=B.yRanges,lt.pts=B.pts),x||e(m,p,{vals:I,cLetter:"z"}),x&&p.contours&&p.contours.coloring==="heatmap"){var tt={type:p.type==="contour"?"heatmap":"histogram2d",xcalendar:p.xcalendar,ycalendar:p.ycalendar};lt.xfill=a(tt,j,M,w,N,y),lt.yfill=a(tt,rt,k,_,I.length,l)}return[lt]};function h(m){for(var p=[],y=m.length,l=0;l<y;l++){var x=m[l];x!==s&&p.push(x)}return p}function v(m,p,y){for(var l=[],x=-1,b=0;b<y.length;b++)if(p[b]!==s){x++,l[x]=[];for(var S=0;S<y[b].length;S++)m[S]!==s&&l[x].push(y[b][S])}return l}}),x1=Vt(X=>{X.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],X.STYLE=X.CSS_DECLARATIONS.map(function(V){return V.join(": ")+"; "}).join("")}),r2=Vt((X,V)=>{var c=x1(),g=go(),E=qr(),A=null;function t(){if(A!==null)return A;A=!1;var e=E.isSafari()||E.isIOS();if(window.navigator.userAgent&&!e){var r=Array.from(c.CSS_DECLARATIONS).reverse(),i=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof i=="function")A=r.some(function(s){return i.apply(null,s)});else{var n=g.tester.append("image").attr("style",c.STYLE),o=window.getComputedStyle(n.node()),a=o.imageRendering;A=r.some(function(s){var h=s[1];return a===h||a===h.toLowerCase()}),n.remove()}}return A}V.exports=t}),_1=Vt((X,V)=>{var c=Ai(),g=yh(),E=Mi(),A=go(),t=ao(),e=qr(),r=sl(),i=Qy(),n=vi(),o=Ul().extractOpts,a=Ul().makeColorScaleFuncFromTrace,s=Cf(),h=nh(),v=h.LINE_SPACING,m=r2(),p=x1().STYLE,y="heatmap-label";function l(M){return M.selectAll("g."+y)}function x(M){l(M).remove()}V.exports=function(M,w,u,f){var k=w.xaxis,_=w.yaxis;e.makeTraceGroups(f,u,"hm").each(function(D){var I=c.select(this),O=D[0],B=O.trace,R=B.xgap||0,L=B.ygap||0,F=O.z,N=O.x,j=O.y,G=O.xCenter,rt=O.yCenter,ct=E.traceIs(B,"contour"),lt=ct?"best":B.zsmooth,tt=F.length,Z=e.maxRowLength(F),st=!1,$=!1,Q,nt,Y,q,ot,it,dt,wt;for(it=0;Q===void 0&&it<N.length-1;)Q=k.c2p(N[it]),it++;for(it=N.length-1;nt===void 0&&it>0;)nt=k.c2p(N[it]),it--;for(nt<Q&&(Y=nt,nt=Q,Q=Y,st=!0),it=0;q===void 0&&it<j.length-1;)q=_.c2p(j[it]),it++;for(it=j.length-1;ot===void 0&&it>0;)ot=_.c2p(j[it]),it--;ot<q&&(Y=q,q=ot,ot=Y,$=!0),ct&&(G=N,rt=j,N=O.xfill,j=O.yfill);var xt="default";if(lt?xt=lt==="best"?"smooth":"fast":B._islinear&&R===0&&L===0&&m()&&(xt="fast"),xt!=="fast"){var Ft=lt==="best"?0:.5;Q=Math.max(-Ft*k._length,Q),nt=Math.min((1+Ft)*k._length,nt),q=Math.max(-Ft*_._length,q),ot=Math.min((1+Ft)*_._length,ot)}var Et=Math.round(nt-Q),Nt=Math.round(ot-q),te=Q>=k._length||nt<=0||q>=_._length||ot<=0;if(te){var Jt=I.selectAll("image").data([]);Jt.exit().remove(),x(I);return}var Qt,Wt;xt==="fast"?(Qt=Z,Wt=tt):(Qt=Et,Wt=Nt);var gt=document.createElement("canvas");gt.width=Qt,gt.height=Wt;var bt=gt.getContext("2d",{willReadFrequently:!0}),vt=a(B,{noNumericCheck:!0,returnArray:!0}),Ut,Kt;xt==="fast"?(Ut=st?function(Tn){return Z-1-Tn}:e.identity,Kt=$?function(Tn){return tt-1-Tn}:e.identity):(Ut=function(Tn){return e.constrain(Math.round(k.c2p(N[Tn])-Q),0,Et)},Kt=function(Tn){return e.constrain(Math.round(_.c2p(j[Tn])-q),0,Nt)});var Zt=Kt(0),le=[Zt,Zt],Te=st?0:1,Se=$?0:1,Fe=0,Oe=0,ur=0,fr=0,We,Lr,kr,he,Dt;function qt(Tn,ta){if(Tn!==void 0){var Qn=vt(Tn);return Qn[0]=Math.round(Qn[0]),Qn[1]=Math.round(Qn[1]),Qn[2]=Math.round(Qn[2]),Fe+=ta,Oe+=Qn[0]*ta,ur+=Qn[1]*ta,fr+=Qn[2]*ta,Qn}return[0,0,0,0]}function zt(Tn,ta,Qn,Va){var ja=Tn[Qn.bin0];if(ja===void 0)return qt(void 0,1);var ci=Tn[Qn.bin1],pi=ta[Qn.bin0],bi=ta[Qn.bin1],ri=ci-ja||0,Da=pi-ja||0,Ui;return ci===void 0?bi===void 0?Ui=0:pi===void 0?Ui=2*(bi-ja):Ui=(2*bi-pi-ja)*2/3:bi===void 0?pi===void 0?Ui=0:Ui=(2*ja-ci-pi)*2/3:pi===void 0?Ui=(2*bi-ci-ja)*2/3:Ui=bi+ja-ci-pi,qt(ja+Qn.frac*ri+Va.frac*(Da+Qn.frac*Ui))}if(xt!=="default"){var ut=0,yt;try{yt=new Uint8Array(Qt*Wt*4)}catch{yt=new Array(Qt*Wt*4)}if(xt==="smooth"){var Mt=G||N,Ot=rt||j,$t=new Array(Mt.length),ee=new Array(Ot.length),we=new Array(Et),Me=G?S:b,Re=rt?S:b,Be,Ze,Ue;for(it=0;it<Mt.length;it++)$t[it]=Math.round(k.c2p(Mt[it])-Q);for(it=0;it<Ot.length;it++)ee[it]=Math.round(_.c2p(Ot[it])-q);for(it=0;it<Et;it++)we[it]=Me(it,$t);for(dt=0;dt<Nt;dt++)for(Be=Re(dt,ee),Ze=F[Be.bin0],Ue=F[Be.bin1],it=0;it<Et;it++,ut+=4)Dt=zt(Ze,Ue,we[it],Be),T(yt,ut,Dt)}else for(dt=0;dt<tt;dt++)for(he=F[dt],le=Kt(dt),it=0;it<Z;it++)Dt=qt(he[it],1),ut=(le*Z+Ut(it))*4,T(yt,ut,Dt);var mr=bt.createImageData(Qt,Wt);try{mr.data.set(yt)}catch{var ln=mr.data,an=ln.length;for(dt=0;dt<an;dt++)ln[dt]=yt[dt]}bt.putImageData(mr,0,0)}else{var vn=Math.floor(R/2),Sn=Math.floor(L/2);for(dt=0;dt<tt;dt++)if(he=F[dt],le.reverse(),le[Se]=Kt(dt+1),!(le[0]===le[1]||le[0]===void 0||le[1]===void 0))for(Lr=Ut(0),We=[Lr,Lr],it=0;it<Z;it++)We.reverse(),We[Te]=Ut(it+1),!(We[0]===We[1]||We[0]===void 0||We[1]===void 0)&&(kr=he[it],Dt=qt(kr,(We[1]-We[0])*(le[1]-le[0])),bt.fillStyle="rgba("+Dt.join(",")+")",bt.fillRect(We[0]+vn,le[0]+Sn,We[1]-We[0]-R,le[1]-le[0]-L))}Oe=Math.round(Oe/Fe),ur=Math.round(ur/Fe),fr=Math.round(fr/Fe);var An=g("rgb("+Oe+","+ur+","+fr+")");M._hmpixcount=(M._hmpixcount||0)+Fe,M._hmlumcount=(M._hmlumcount||0)+Fe*An.getLuminance();var pn=I.selectAll("image").data(D);pn.enter().append("svg:image").attr({xmlns:s.svg,preserveAspectRatio:"none"}),pn.attr({height:Nt,width:Et,x:Q,y:q,"xlink:href":gt.toDataURL("image/png")}),xt==="fast"&&!lt&&pn.attr("style",p),x(I);var On=B.texttemplate;if(On){var Nn=o(B),ke={type:"linear",range:[Nn.min,Nn.max],_separators:k._separators,_numFormat:k._numFormat},ze=B.type==="histogram2dcontour",je=B.type==="contour",Ne=je?1:0,_r=je?tt-1:tt,Xr=je?1:0,rn=je?Z-1:Z,Br=[];for(it=Ne;it<_r;it++){var _n;if(je)_n=O.y[it];else if(ze){if(it===0||it===tt-1)continue;_n=O.y[it]}else if(O.yCenter)_n=O.yCenter[it];else{if(it+1===tt&&O.y[it+1]===void 0)continue;_n=(O.y[it]+O.y[it+1])/2}var bn=Math.round(_.c2p(_n));if(!(0>bn||bn>_._length))for(dt=Xr;dt<rn;dt++){var Fn;if(je)Fn=O.x[dt];else if(ze){if(dt===0||dt===Z-1)continue;Fn=O.x[dt]}else if(O.xCenter)Fn=O.xCenter[dt];else{if(dt+1===Z&&O.x[dt+1]===void 0)continue;Fn=(O.x[dt]+O.x[dt+1])/2}var on=Math.round(k.c2p(Fn));if(!(0>on||on>k._length)){var Bn=i({x:Fn,y:_n},B,M._fullLayout);Bn.x=Fn,Bn.y=_n;var ue=O.z[it][dt];ue===void 0?(Bn.z="",Bn.zLabel=""):(Bn.z=ue,Bn.zLabel=t.tickText(ke,ue,"hover").text);var xe=O.text&&O.text[it]&&O.text[it][dt];(xe===void 0||xe===!1)&&(xe=""),Bn.text=xe;var Pr=e.texttemplateString(On,Bn,M._fullLayout._d3locale,Bn,B._meta||{});if(Pr){var Sr=Pr.split("<br>"),gr=Sr.length,dr=0;for(wt=0;wt<gr;wt++)dr=Math.max(dr,Sr[wt].length);Br.push({l:gr,c:dr,t:Pr,x:on,y:bn,z:ue})}}}}var Er=B.textfont,Dr=Er.size,Ar=M._fullLayout.font.size;if(!Dr||Dr==="auto"){var Gr=1/0,Wr=1/0,Jr=0,_e=0;for(wt=0;wt<Br.length;wt++){var Je=Br[wt];if(Jr=Math.max(Jr,Je.l),_e=Math.max(_e,Je.c),wt<Br.length-1){var yr=Br[wt+1],Hr=Math.abs(yr.x-Je.x),hn=Math.abs(yr.y-Je.y);Hr&&(Gr=Math.min(Gr,Hr)),hn&&(Wr=Math.min(Wr,hn))}}!isFinite(Gr)||!isFinite(Wr)?Dr=Ar:(Gr-=R,Wr-=L,Gr/=_e,Wr/=Jr,Gr/=v/2,Wr/=v,Dr=Math.min(Math.floor(Gr),Math.floor(Wr),Ar))}if(Dr<=0||!isFinite(Dr))return;var En=function(Tn){return Tn.x},dn=function(Tn){return Tn.y-Dr*(Tn.l*v/2-1)},Kr=l(I).data(Br);Kr.enter().append("g").classed(y,1).append("text").attr("text-anchor","middle").each(function(Tn){var ta=c.select(this),Qn=Er.color;(!Qn||Qn==="auto")&&(Qn=n.contrast(Tn.z===void 0?M._fullLayout.plot_bgcolor:"rgba("+vt(Tn.z).join()+")")),ta.attr("data-notex",1).call(r.positionText,En(Tn),dn(Tn)).call(A.font,{family:Er.family,size:Dr,color:Qn,weight:Er.weight,style:Er.style,variant:Er.variant,textcase:Er.textcase,lineposition:Er.lineposition,shadow:Er.shadow}).text(Tn.t).call(r.convertToTspans,M)})}})};function b(M,w){var u=w.length-2,f=e.constrain(e.findBin(M,w),0,u),k=w[f],_=w[f+1],D=e.constrain(f+(M-k)/(_-k)-.5,0,u),I=Math.round(D),O=Math.abs(D-I);return!D||D===u||!O?{bin0:I,bin1:I,frac:0}:{bin0:I,frac:O,bin1:Math.round(I+O/(D-I))}}function S(M,w){var u=w.length-1,f=e.constrain(e.findBin(M,w),0,u),k=w[f],_=w[f+1],D=(M-k)/(_-k)||0;return D<=0?{bin0:f,bin1:f,frac:0}:D<.5?{bin0:f,bin1:f+1,frac:D}:{bin0:f+1,bin1:f,frac:1-D}}function T(M,w,u){M[w]=u[0],M[w+1]=u[1],M[w+2]=u[2],M[w+3]=Math.round(u[3]*255)}}),Id=Vt((X,V)=>{V.exports={min:"zmin",max:"zmax"}}),b1=Vt((X,V)=>{var c=Ai();V.exports=function(g){c.select(g).selectAll(".hm image").style("opacity",function(E){return E.trace.opacity})}}),w1=Vt((X,V)=>{var c=Hu(),g=qr(),E=g.isArrayOrTypedArray,A=ao(),t=Ul().extractOpts;V.exports=function(e,r,i,n,o){o||(o={});var a=o.isContour,s=e.cd[0],h=s.trace,v=e.xa,m=e.ya,p=s.x,y=s.y,l=s.z,x=s.xCenter,b=s.yCenter,S=s.zmask,T=h.zhoverformat,M=p,w=y,u,f,k,_;if(e.index!==!1){try{k=Math.round(e.index[1]),_=Math.round(e.index[0])}catch{g.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index);return}if(k<0||k>=l[0].length||_<0||_>l.length)return}else{if(c.inbox(r-p[0],r-p[p.length-1],0)>0||c.inbox(i-y[0],i-y[y.length-1],0)>0)return;if(a){var D;for(M=[2*p[0]-p[1]],D=1;D<p.length;D++)M.push((p[D]+p[D-1])/2);for(M.push([2*p[p.length-1]-p[p.length-2]]),w=[2*y[0]-y[1]],D=1;D<y.length;D++)w.push((y[D]+y[D-1])/2);w.push([2*y[y.length-1]-y[y.length-2]])}k=Math.max(0,Math.min(M.length-2,g.findBin(r,M))),_=Math.max(0,Math.min(w.length-2,g.findBin(i,w)))}var I=v.c2p(p[k]),O=v.c2p(p[k+1]),B=m.c2p(y[_]),R=m.c2p(y[_+1]),L,F;a?(L=s.orig_x||p,F=s.orig_y||y,O=I,u=L[k],R=B,f=F[_]):(L=s.orig_x||x||p,F=s.orig_y||b||y,u=x?L[k]:(L[k]+L[k+1])/2,f=b?F[_]:(F[_]+F[_+1])/2,v&&v.type==="category"&&(u=p[k]),m&&m.type==="category"&&(f=y[_]),h.zsmooth&&(I=O=v.c2p(u),B=R=m.c2p(f)));var N=l[_][k];if(S&&!S[_][k]&&(N=void 0),!(N===void 0&&!h.hoverongaps)){var j;E(s.hovertext)&&E(s.hovertext[_])?j=s.hovertext[_][k]:E(s.text)&&E(s.text[_])&&(j=s.text[_][k]);var G=t(h),rt={type:"linear",range:[G.min,G.max],hoverformat:T,_separators:v._separators,_numFormat:v._numFormat},ct=A.tickText(rt,N,"hover").text;return[g.extendFlat(e,{index:h._after2before?h._after2before[_][k]:[_,k],distance:e.maxHoverDistance,spikeDistance:e.maxSpikeDistance,x0:I,x1:O,y0:B,y1:R,xLabelVal:u,yLabelVal:f,zLabelVal:N,zLabel:ct,text:j})]}}}),EA=Vt((X,V)=>{V.exports={attributes:Lg(),supplyDefaults:MA(),calc:y1(),plot:_1(),colorbar:Id(),style:b1(),hoverPoints:w1(),moduleType:"trace",name:"heatmap",basePlotModule:Pc(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}),PA=Vt((X,V)=>{V.exports=EA()}),n2=Vt((X,V)=>{V.exports=function(c,g){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}}),IA=Vt((X,V)=>{V.exports={eventDataKeys:["binNumber"]}}),T1=Vt((X,V)=>{var c=wp(),g=qu().axisHoverFormat,E=Zo().hovertemplateAttrs,A=Zo().texttemplateAttrs,t=Nl(),e=n2(),r=IA(),i=po().extendFlat;V.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:g("x"),yhoverformat:g("y"),text:i({},c.text,{}),hovertext:i({},c.hovertext,{}),orientation:c.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:e("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:e("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:E({},{keys:r.eventDataKeys}),texttemplate:A({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),textposition:i({},c.textposition,{arrayOk:!1}),textfont:t({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:t({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:t({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:c.insidetextanchor,textangle:c.textangle,cliponaxis:c.cliponaxis,constraintext:c.constraintext,marker:c.marker,offsetgroup:c.offsetgroup,alignmentgroup:c.alignmentgroup,selected:c.selected,unselected:c.unselected,zorder:c.zorder}}),LA=Vt((X,V)=>{var c=Mi(),g=qr(),E=vi(),A=zf().handleText,t=s1(),e=T1();V.exports=function(r,i,n,o){function a(w,u){return g.coerce(r,i,e,w,u)}var s=a("x"),h=a("y"),v=a("cumulative.enabled");v&&(a("cumulative.direction"),a("cumulative.currentbin")),a("text");var m=a("textposition");A(r,i,o,a,m,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),a("hovertext"),a("hovertemplate"),a("xhoverformat"),a("yhoverformat");var p=a("orientation",h&&!s?"h":"v"),y=p==="v"?"x":"y",l=p==="v"?"y":"x",x=s&&h?Math.min(g.minRowLength(s)&&g.minRowLength(h)):g.minRowLength(i[y]||[]);if(!x){i.visible=!1;return}i._length=x;var b=c.getComponentMethod("calendars","handleTraceDefaults");b(r,i,["x","y"],o);var S=i[l];S&&a("histfunc"),a("histnorm"),a("autobin"+y),t(r,i,a,n,o),g.coerceSelectionMarkerOpacity(i,a);var T=(i.marker.line||{}).color,M=c.getComponentMethod("errorbars","supplyDefaults");M(r,i,T||E.defaultLine,{axis:"y"}),M(r,i,T||E.defaultLine,{axis:"x",inherit:"y"}),a("zorder")}}),k1=Vt((X,V)=>{var c=qr(),g=rc(),E=Mi().traceIs,A=f0(),t=zf().validateCornerradius,e=c.nestedProperty,r=c0().getAxisGroup,i=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],n=["x","y"];V.exports=function(o,a){var s=a._histogramBinOpts={},h=[],v={},m=[],p,y,l,x,b,S,T;function M(ct,lt){return c.coerce(p._input,p,p._module.attributes,ct,lt)}function w(ct){return ct.orientation==="v"?"x":"y"}function u(ct,lt){var tt=g.getFromTrace({_fullLayout:a},ct,lt);return tt.type}function f(ct,lt,tt){var Z=ct.uid+"__"+tt;lt||(lt=Z);var st=u(ct,tt),$=ct[tt+"calendar"]||"",Q=s[lt],nt=!0;Q&&(st===Q.axType&&$===Q.calendar?(nt=!1,Q.traces.push(ct),Q.dirs.push(tt)):(lt=Z,st!==Q.axType&&c.warn(["Attempted to group the bins of trace",ct.index,"set on a","type:"+st,"axis","with bins on","type:"+Q.axType,"axis."].join(" ")),$!==Q.calendar&&c.warn(["Attempted to group the bins of trace",ct.index,"set with a",$,"calendar","with bins",Q.calendar?"on a "+Q.calendar+" calendar":"w/o a set calendar"].join(" ")))),nt&&(s[lt]={traces:[ct],dirs:[tt],axType:st,calendar:ct[tt+"calendar"]||""}),ct["_"+tt+"bingroup"]=lt}for(b=0;b<o.length;b++)if(p=o[b],E(p,"histogram")){if(h.push(p),delete p._xautoBinFinished,delete p._yautoBinFinished,p.type==="histogram"){var k=M("marker.cornerradius",a.barcornerradius);p.marker&&(p.marker.cornerradius=t(k))}E(p,"2dMap")||A(p._input,p,a,M,a.barmode)}var _=a._alignmentOpts||{};for(b=0;b<h.length;b++){if(p=h[b],l="",!E(p,"2dMap")){if(x=w(p),a.barmode==="group"&&p.alignmentgroup){var D=p[x+"axis"],I=r(a,D)+p.orientation;(_[I]||{})[p.alignmentgroup]&&(l=I)}!l&&a.barmode!=="overlay"&&(l=r(a,p.xaxis)+r(a,p.yaxis)+w(p))}l?(v[l]||(v[l]=[]),v[l].push(p)):m.push(p)}for(l in v){if(y=v[l],y.length===1){m.push(y[0]);continue}var O=!1;for(y.length&&(p=y[0],O=M("bingroup")),l=O||l,b=0;b<y.length;b++){p=y[b];var B=p._input.bingroup;B&&B!==l&&c.warn(["Trace",p.index,"must match","within bingroup",l+".","Ignoring its bingroup:",B,"setting."].join(" ")),p.bingroup=l,f(p,l,w(p))}}for(b=0;b<m.length;b++){p=m[b];var R=M("bingroup");if(E(p,"2dMap"))for(T=0;T<2;T++){x=n[T];var L=M(x+"bingroup",R?R+"__"+x:null);f(p,L,x)}else f(p,R,w(p))}for(l in s){var F=s[l];for(y=F.traces,S=0;S<i.length;S++){var N=i[S],j=N.name,G,rt;if(!(j==="nbins"&&F.sizeFound)){for(b=0;b<y.length;b++){if(p=y[b],x=F.dirs[b],G=N.aStr[x],e(p._input,G).get()!==void 0){F[j]=M(G),F[j+"Found"]=!0;break}rt=(p._autoBin||{})[x]||{},rt[j]&&e(p,G).set(rt[j])}if(j==="start"||j==="end")for(;b<y.length;b++)p=y[b],p["_"+x+"bingroup"]&&(rt=(p._autoBin||{})[x]||{},M(G,rt[j]));j==="nbins"&&!F.sizeFound&&!F.nbinsFound&&(p=y[0],F[j]=M(G))}}}}}),CA=Vt((X,V)=>{var c=Pg().hoverPoints,g=ao().hoverLabelText;V.exports=function(E,A,t,e,r){var i=c(E,A,t,e,r);if(i){E=i[0];var n=E.cd[E.index],o=E.cd[0].trace;if(!o.cumulative.enabled){var a=o.orientation==="h"?"y":"x";E[a+"Label"]=g(E[a+"a"],[n.ph0,n.ph1],o[a+"hoverformat"])}return i}}}),a2=Vt((X,V)=>{V.exports=function(c,g,E,A,t){if(c.x="xVal"in g?g.xVal:g.x,c.y="yVal"in g?g.yVal:g.y,"zLabelVal"in g&&(c.z=g.zLabelVal),g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),!(E.cumulative||{}).enabled){var e=Array.isArray(t)?A[0].pts[t[0]][t[1]]:A[t].pts;c.pointNumbers=e,c.binNumber=c.pointNumber,delete c.pointNumber,delete c.pointIndex;var r;if(E._indexToPoints){r=[];for(var i=0;i<e.length;i++)r=r.concat(E._indexToPoints[e[i]])}else r=e;c.pointIndices=r}return c}}),DA=Vt((X,V)=>{V.exports={attributes:T1(),layoutAttributes:o1(),supplyDefaults:LA(),crossTraceDefaults:k1(),supplyLayoutDefaults:Gb(),calc:t2().calc,crossTraceCalc:p0().crossTraceCalc,plot:g0().plot,layerName:"barlayer",style:Gf().style,styleOnSelect:Gf().styleOnSelect,colorbar:Wh(),hoverPoints:CA(),selectPoints:Ig(),eventData:a2(),moduleType:"trace",name:"histogram",basePlotModule:Pc(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}),zA=Vt((X,V)=>{V.exports=DA()}),A1=Vt((X,V)=>{var c=T1(),g=n2(),E=Lg(),A=Ks(),t=qu().axisHoverFormat,e=Zo().hovertemplateAttrs,r=Zo().texttemplateAttrs,i=wl(),n=po().extendFlat;V.exports=n({x:c.x,y:c.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:c.histnorm,histfunc:c.histfunc,nbinsx:c.nbinsx,xbins:g("x"),nbinsy:c.nbinsy,ybins:g("y"),autobinx:c.autobinx,autobiny:c.autobiny,bingroup:n({},c.bingroup,{}),xbingroup:n({},c.bingroup,{}),ybingroup:n({},c.bingroup,{}),xgap:E.xgap,ygap:E.ygap,zsmooth:E.zsmooth,xhoverformat:t("x"),yhoverformat:t("y"),zhoverformat:t("z",1),hovertemplate:e({},{keys:"z"}),texttemplate:r({arrayOk:!1,editType:"plot"},{keys:"z"}),textfont:E.textfont,showlegend:n({},A.showlegend,{dflt:!1})},i("",{cLetter:"z",autoColorDflt:!1}))}),i2=Vt((X,V)=>{var c=Mi(),g=qr();V.exports=function(E,A,t,e){var r=t("x"),i=t("y"),n=g.minRowLength(r),o=g.minRowLength(i);if(!n||!o){A.visible=!1;return}A._length=Math.min(n,o);var a=c.getComponentMethod("calendars","handleTraceDefaults");a(E,A,["x","y"],e);var s=t("z")||t("marker.color");s&&t("histfunc"),t("histnorm"),t("autobinx"),t("autobiny")}}),OA=Vt((X,V)=>{var c=qr(),g=i2(),E=$b(),A=ah(),t=Jm(),e=A1();V.exports=function(r,i,n,o){function a(s,h){return c.coerce(r,i,e,s,h)}g(r,i,a,o),i.visible!==!1&&(E(r,i,a,o),A(r,i,o,a,{prefix:"",cLetter:"z"}),a("hovertemplate"),t(a,o),a("xhoverformat"),a("yhoverformat"))}}),FA=Vt((X,V)=>{var c=w1(),g=ao().hoverLabelText;V.exports=function(E,A,t,e,r){var i=c(E,A,t,e,r);if(i){E=i[0];var n=E.index,o=n[0],a=n[1],s=E.cd[0],h=s.trace,v=s.xRanges[a],m=s.yRanges[o];return E.xLabel=g(E.xa,[v[0],v[1]],h.xhoverformat),E.yLabel=g(E.ya,[m[0],m[1]],h.yhoverformat),i}}}),BA=Vt((X,V)=>{V.exports={attributes:A1(),supplyDefaults:OA(),crossTraceDefaults:k1(),calc:y1(),plot:_1(),layerName:"heatmaplayer",colorbar:Id(),style:b1(),hoverPoints:FA(),eventData:a2(),moduleType:"trace",name:"histogram2d",basePlotModule:Pc(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}),RA=Vt((X,V)=>{V.exports=BA()}),M1=Vt((X,V)=>{V.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}),Qm=Vt((X,V)=>{var c=Lg(),g=Gu(),E=qu(),A=E.axisHoverFormat,t=E.descriptionOnlyNumbers,e=wl(),r=Eh().dash,i=Nl(),n=po().extendFlat,o=M1(),a=o.COMPARISON_OPS2,s=o.INTERVAL_OPS,h=g.line;V.exports=n({z:c.z,x:c.x,x0:c.x0,dx:c.dx,y:c.y,y0:c.y0,dy:c.dy,xperiod:c.xperiod,yperiod:c.yperiod,xperiod0:g.xperiod0,yperiod0:g.yperiod0,xperiodalignment:c.xperiodalignment,yperiodalignment:c.yperiodalignment,text:c.text,hovertext:c.hovertext,transpose:c.transpose,xtype:c.xtype,ytype:c.ytype,xhoverformat:A("x"),yhoverformat:A("y"),zhoverformat:A("z",1),hovertemplate:c.hovertemplate,texttemplate:n({},c.texttemplate,{}),textfont:n({},c.textfont,{}),hoverongaps:c.hoverongaps,connectgaps:n({},c.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:i({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:t("contour label")},operation:{valType:"enumerated",values:[].concat(a).concat(s),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n({},h.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:r,smoothing:n({},h.smoothing,{}),editType:"plot"},zorder:g.zorder},e("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}),o2=Vt((X,V)=>{var c=A1(),g=Qm(),E=wl(),A=qu().axisHoverFormat,t=po().extendFlat;V.exports=t({x:c.x,y:c.y,z:c.z,marker:c.marker,histnorm:c.histnorm,histfunc:c.histfunc,nbinsx:c.nbinsx,xbins:c.xbins,nbinsy:c.nbinsy,ybins:c.ybins,autobinx:c.autobinx,autobiny:c.autobiny,bingroup:c.bingroup,xbingroup:c.xbingroup,ybingroup:c.ybingroup,autocontour:g.autocontour,ncontours:g.ncontours,contours:g.contours,line:{color:g.line.color,width:t({},g.line.width,{dflt:.5}),dash:g.line.dash,smoothing:g.line.smoothing,editType:"plot"},xhoverformat:A("x"),yhoverformat:A("y"),zhoverformat:A("z",1),hovertemplate:c.hovertemplate,texttemplate:g.texttemplate,textfont:g.textfont},E("",{cLetter:"z",editTypeOverride:"calc"}))}),S1=Vt((X,V)=>{V.exports=function(c,g,E,A){var t=A("contours.start"),e=A("contours.end"),r=t===!1||e===!1,i=E("contours.size"),n;r?n=g.autocontour=!0:n=E("autocontour",!1),(n||!i)&&E("ncontours")}}),s2=Vt((X,V)=>{var c=qr();V.exports=function(g,E,A,t){t||(t={});var e=g("contours.showlabels");if(e){var r=E.font;c.coerceFont(g,"contours.labelfont",r,{overrideDflt:{color:A}}),g("contours.labelformat")}t.hasHover!==!1&&g("zhoverformat")}}),E1=Vt((X,V)=>{var c=ah(),g=s2();V.exports=function(E,A,t,e,r){var i=t("contours.coloring"),n,o="";i==="fill"&&(n=t("contours.showlines")),n!==!1&&(i!=="lines"&&(o=t("line.color","#000")),t("line.width",.5),t("line.dash")),i!=="none"&&(E.showlegend!==!0&&(A.showlegend=!1),A._dfltShowLegend=!1,c(E,A,e,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),g(t,e,o,r)}}),jA=Vt((X,V)=>{var c=qr(),g=i2(),E=S1(),A=E1(),t=Jm(),e=o2();V.exports=function(r,i,n,o){function a(h,v){return c.coerce(r,i,e,h,v)}function s(h){return c.coerce2(r,i,e,h)}g(r,i,a,o),i.visible!==!1&&(E(r,i,a,s),A(r,i,a,o),a("xhoverformat"),a("yhoverformat"),a("hovertemplate"),i.contours&&i.contours.coloring==="heatmap"&&t(a,o))}}),l2=Vt((X,V)=>{var c=ao(),g=qr();V.exports=function(A,t){var e=A.contours;if(A.autocontour){var r=A.zmin,i=A.zmax;(A.zauto||r===void 0)&&(r=g.aggNums(Math.min,null,t)),(A.zauto||i===void 0)&&(i=g.aggNums(Math.max,null,t));var n=E(r,i,A.ncontours);e.size=n.dtick,e.start=c.tickFirst(n),n.range.reverse(),e.end=c.tickFirst(n),e.start===r&&(e.start+=e.size),e.end===i&&(e.end-=e.size),e.start>e.end&&(e.start=e.end=(e.start+e.end)/2),A._input.contours||(A._input.contours={}),g.extendFlat(A._input.contours,{start:e.start,end:e.end,size:e.size}),A._input.autocontour=!0}else if(e.type!=="constraint"){var o=e.start,a=e.end,s=A._input.contours;if(o>a&&(e.start=s.start=a,a=e.end=s.end=o,o=e.start),!(e.size>0)){var h;o===a?h=1:h=E(o,a,A.ncontours).dtick,s.size=e.size=h}}};function E(A,t,e){var r={type:"linear",range:[A,t]};return c.autoTicks(r,(t-A)/(e||15)),r}}),Ym=Vt((X,V)=>{V.exports=function(c){return c.end+c.size/1e6}}),u2=Vt((X,V)=>{var c=Ul(),g=y1(),E=l2(),A=Ym();V.exports=function(t,e){var r=g(t,e),i=r[0].z;E(e,i);var n=e.contours,o=c.extractOpts(e),a;if(n.coloring==="heatmap"&&o.auto&&e.autocontour===!1){var s=n.start,h=A(n),v=n.size||1,m=Math.floor((h-s)/v)+1;isFinite(v)||(v=1,m=1);var p=s-v/2,y=p+m*v;a=[p,y]}else a=i;return c.calc(t,e,{vals:a,cLetter:"z"}),r}}),Km=Vt((X,V)=>{V.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}),c2=Vt((X,V)=>{var c=Km();V.exports=function(E){var A=E[0].z,t=A.length,e=A[0].length,r=t===2||e===2,i,n,o,a,s,h,v,m,p;for(n=0;n<t-1;n++)for(a=[],n===0&&(a=a.concat(c.BOTTOMSTART)),n===t-2&&(a=a.concat(c.TOPSTART)),i=0;i<e-1;i++)for(o=a.slice(),i===0&&(o=o.concat(c.LEFTSTART)),i===e-2&&(o=o.concat(c.RIGHTSTART)),s=i+","+n,h=[[A[n][i],A[n][i+1]],[A[n+1][i],A[n+1][i+1]]],p=0;p<E.length;p++)m=E[p],v=g(m.level,h),v&&(m.crossings[s]=v,o.indexOf(v)!==-1&&(m.starts.push([i,n]),r&&o.indexOf(v,o.indexOf(v)+1)!==-1&&m.starts.push([i,n])))};function g(E,A){var t=(A[0][0]>E?0:1)+(A[0][1]>E?0:2)+(A[1][1]>E?0:4)+(A[1][0]>E?0:8);if(t===5||t===10){var e=(A[0][0]+A[0][1]+A[1][0]+A[1][1])/4;return E>e?t===5?713:1114:t===5?104:208}return t===15?0:t}}),h2=Vt((X,V)=>{var c=qr(),g=Km();V.exports=function(i,n,o){var a,s,h,v,m;for(n=n||.01,o=o||.01,h=0;h<i.length;h++){for(v=i[h],m=0;m<v.starts.length;m++)s=v.starts[m],t(v,s,"edge",n,o);for(a=0;Object.keys(v.crossings).length&&a<1e4;)a++,s=Object.keys(v.crossings)[0].split(",").map(Number),t(v,s,void 0,n,o);a===1e4&&c.log("Infinite loop in contour?")}};function E(i,n,o,a){return Math.abs(i[0]-n[0])<o&&Math.abs(i[1]-n[1])<a}function A(i,n){var o=i[2]-n[2],a=i[3]-n[3];return Math.sqrt(o*o+a*a)}function t(i,n,o,a,s){var h=n.join(","),v=i.crossings[h],m=e(v,o,n),p=[r(i,n,[-m[0],-m[1]])],y=i.z.length,l=i.z[0].length,x=n.slice(),b=m.slice(),S;for(S=0;S<1e4;S++){if(v>20?(v=g.CHOOSESADDLE[v][(m[0]||m[1])<0?0:1],i.crossings[h]=g.SADDLEREMAINDER[v]):delete i.crossings[h],m=g.NEWDELTA[v],!m){c.log("Found bad marching index:",v,n,i.level);break}p.push(r(i,n,m)),n[0]+=m[0],n[1]+=m[1],h=n.join(","),E(p[p.length-1],p[p.length-2],a,s)&&p.pop();var T=m[0]&&(n[0]<0||n[0]>l-2)||m[1]&&(n[1]<0||n[1]>y-2),M=n[0]===x[0]&&n[1]===x[1]&&m[0]===b[0]&&m[1]===b[1];if(M||o&&T)break;v=i.crossings[h]}S===1e4&&c.log("Infinite loop in contour?");var w=E(p[0],p[p.length-1],a,s),u=0,f=.2*i.smoothing,k=[],_=0,D,I,O,B,R,L,F,N,j,G,rt;for(S=1;S<p.length;S++)F=A(p[S],p[S-1]),u+=F,k.push(F);var ct=u/k.length*f;function lt(st){return p[st%p.length]}for(S=p.length-2;S>=_;S--)if(D=k[S],D<ct){for(O=0,I=S-1;I>=_&&D+k[I]<ct;I--)D+=k[I];if(w&&S===p.length-2)for(O=0;O<I&&D+k[O]<ct;O++)D+=k[O];R=S-I+O+1,L=Math.floor((S+I+O+2)/2),!w&&S===p.length-2?B=p[p.length-1]:!w&&I===-1?B=p[0]:R%2?B=lt(L):B=[(lt(L)[0]+lt(L+1)[0])/2,(lt(L)[1]+lt(L+1)[1])/2],p.splice(I+1,S-I+1,B),S=I+1,O&&(_=O),w&&(S===p.length-2?p[O]=p[p.length-1]:S===0&&(p[p.length-1]=p[0]))}for(p.splice(0,_),S=0;S<p.length;S++)p[S].length=2;if(!(p.length<2))if(w)p.pop(),i.paths.push(p);else{o||c.log("Unclosed interior contour?",i.level,x.join(","),p.join("L"));var tt=!1;for(N=0;N<i.edgepaths.length;N++)if(G=i.edgepaths[N],!tt&&E(G[0],p[p.length-1],a,s)){p.pop(),tt=!0;var Z=!1;for(j=0;j<i.edgepaths.length;j++)if(rt=i.edgepaths[j],E(rt[rt.length-1],p[0],a,s)){Z=!0,p.shift(),i.edgepaths.splice(N,1),j===N?i.paths.push(p.concat(rt)):(j>N&&j--,i.edgepaths[j]=rt.concat(p,G));break}Z||(i.edgepaths[N]=p.concat(G))}for(N=0;N<i.edgepaths.length&&!tt;N++)G=i.edgepaths[N],E(G[G.length-1],p[0],a,s)&&(p.shift(),i.edgepaths[N]=G.concat(p),tt=!0);tt||i.edgepaths.push(p)}}function e(i,n,o){var a=0,s=0;return i>20&&n?i===208||i===1114?a=o[0]===0?1:-1:s=o[1]===0?1:-1:g.BOTTOMSTART.indexOf(i)!==-1?s=1:g.LEFTSTART.indexOf(i)!==-1?a=1:g.TOPSTART.indexOf(i)!==-1?s=-1:a=-1,[a,s]}function r(i,n,o){var a=n[0]+Math.max(o[0],0),s=n[1]+Math.max(o[1],0),h=i.z[s][a],v=i.xaxis,m=i.yaxis;if(o[1]){var p=(i.level-h)/(i.z[s][a+1]-h),y=(p!==1?(1-p)*v.c2l(i.x[a]):0)+(p!==0?p*v.c2l(i.x[a+1]):0);return[v.c2p(v.l2c(y),!0),m.c2p(i.y[s],!0),a+p,s]}else{var l=(i.level-h)/(i.z[s+1][a]-h),x=(l!==1?(1-l)*m.c2l(i.y[s]):0)+(l!==0?l*m.c2l(i.y[s+1]):0);return[v.c2p(i.x[a],!0),m.c2p(m.l2c(x),!0),a,s+l]}}}),NA=Vt((X,V)=>{var c=M1(),g=vo();V.exports={"[]":A("[]"),"][":A("]["),">":t(">"),"<":t("<"),"=":t("=")};function E(e,r){var i=Array.isArray(r),n;function o(a){return g(a)?+a:null}return c.COMPARISON_OPS2.indexOf(e)!==-1?n=o(i?r[0]:r):c.INTERVAL_OPS.indexOf(e)!==-1?n=i?[o(r[0]),o(r[1])]:[o(r),o(r)]:c.SET_OPS.indexOf(e)!==-1&&(n=i?r.map(o):[o(r)]),n}function A(e){return function(r){r=E(e,r);var i=Math.min(r[0],r[1]),n=Math.max(r[0],r[1]);return{start:i,end:n,size:n-i}}}function t(e){return function(r){return r=E(e,r),{start:r,end:1/0,size:1/0}}}}),f2=Vt((X,V)=>{var c=qr(),g=NA(),E=Ym();V.exports=function(A,t,e){for(var r=A.type==="constraint"?g[A._operation](A.value):A,i=r.size,n=[],o=E(r),a=e.trace._carpetTrace,s=a?{xaxis:a.aaxis,yaxis:a.baxis,x:e.a,y:e.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:e.x,y:e.y},h=r.start;h<o;h+=i)if(n.push(c.extendFlat({level:h,crossings:{},starts:[],edgepaths:[],paths:[],z:e.z,smoothing:e.trace.line.smoothing},s)),n.length>1e3){c.warn("Too many contours, clipping at 1000",A);break}return n}}),p2=Vt((X,V)=>{var c=qr();V.exports=function(E,A){var t,e,r,i=function(a){return a.reverse()},n=function(a){return a};switch(A){case"=":case"<":return E;case">":for(E.length!==1&&c.warn("Contour data invalid for the specified inequality operation."),e=E[0],t=0;t<e.edgepaths.length;t++)e.edgepaths[t]=i(e.edgepaths[t]);for(t=0;t<e.paths.length;t++)e.paths[t]=i(e.paths[t]);for(t=0;t<e.starts.length;t++)e.starts[t]=i(e.starts[t]);return E;case"][":var o=i;i=n,n=o;case"[]":for(E.length!==2&&c.warn("Contour data invalid for the specified inequality range operation."),e=g(E[0]),r=g(E[1]),t=0;t<e.edgepaths.length;t++)e.edgepaths[t]=i(e.edgepaths[t]);for(t=0;t<e.paths.length;t++)e.paths[t]=i(e.paths[t]);for(t=0;t<e.starts.length;t++)e.starts[t]=i(e.starts[t]);for(;r.edgepaths.length;)e.edgepaths.push(n(r.edgepaths.shift()));for(;r.paths.length;)e.paths.push(n(r.paths.shift()));for(;r.starts.length;)e.starts.push(n(r.starts.shift()));return[e]}};function g(E){return c.extendFlat({},E,{edgepaths:c.extendDeep([],E.edgepaths),paths:c.extendDeep([],E.paths),starts:c.extendDeep([],E.starts)})}}),d2=Vt((X,V)=>{V.exports=function(c,g){var E=c[0],A=E.z,t;switch(g.type){case"levels":var e=Math.min(A[0][0],A[0][1]);for(t=0;t<c.length;t++){var r=c[t];r.prefixBoundary=!r.edgepaths.length&&(e>r.level||r.starts.length&&e===r.level)}break;case"constraint":if(E.prefixBoundary=!1,E.edgepaths.length)return;var i=E.x.length,n=E.y.length,o=-1/0,a=1/0;for(t=0;t<n;t++)a=Math.min(a,A[t][0]),a=Math.min(a,A[t][i-1]),o=Math.max(o,A[t][0]),o=Math.max(o,A[t][i-1]);for(t=1;t<i-1;t++)a=Math.min(a,A[0][t]),a=Math.min(a,A[n-1][t]),o=Math.max(o,A[0][t]),o=Math.max(o,A[n-1][t]);var s=g.value,h,v;switch(g._operation){case">":s>o&&(E.prefixBoundary=!0);break;case"<":(s<a||E.starts.length&&s===a)&&(E.prefixBoundary=!0);break;case"[]":h=Math.min(s[0],s[1]),v=Math.max(s[0],s[1]),(v<a||h>o||E.starts.length&&v===a)&&(E.prefixBoundary=!0);break;case"][":h=Math.min(s[0],s[1]),v=Math.max(s[0],s[1]),h<a&&v>o&&(E.prefixBoundary=!0);break}break}}}),P1=Vt(X=>{var V=Ai(),c=qr(),g=go(),E=Ul(),A=sl(),t=ao(),e=xp(),r=_1(),i=c2(),n=h2(),o=f2(),a=p2(),s=d2(),h=Km(),v=h.LABELOPTIMIZER;X.plot=function(T,M,w,u){var f=M.xaxis,k=M.yaxis;c.makeTraceGroups(u,w,"contour").each(function(_){var D=V.select(this),I=_[0],O=I.trace,B=I.x,R=I.y,L=O.contours,F=o(L,M,I),N=c.ensureSingle(D,"g","heatmapcoloring"),j=[];L.coloring==="heatmap"&&(j=[_]),r(T,M,j,N),i(F),n(F);var G=f.c2p(B[0],!0),rt=f.c2p(B[B.length-1],!0),ct=k.c2p(R[0],!0),lt=k.c2p(R[R.length-1],!0),tt=[[G,lt],[rt,lt],[rt,ct],[G,ct]],Z=F;L.type==="constraint"&&(Z=a(F,L._operation)),m(D,tt,L),p(D,Z,tt,L),l(D,F,T,I,L),b(D,M,T,I,tt)})};function m(T,M,w){var u=c.ensureSingle(T,"g","contourbg"),f=u.selectAll("path").data(w.coloring==="fill"?[0]:[]);f.enter().append("path"),f.exit().remove(),f.attr("d","M"+M.join("L")+"Z").style("stroke","none")}function p(T,M,w,u){var f=u.coloring==="fill"||u.type==="constraint"&&u._operation!=="=",k="M"+w.join("L")+"Z";f&&s(M,u);var _=c.ensureSingle(T,"g","contourfill"),D=_.selectAll("path").data(f?M:[]);D.enter().append("path"),D.exit().remove(),D.each(function(I){var O=(I.prefixBoundary?k:"")+y(I,w);O?V.select(this).attr("d",O).style("stroke","none"):V.select(this).remove()})}function y(T,M){var w="",u=0,f=T.edgepaths.map(function(rt,ct){return ct}),k=!0,_,D,I,O,B,R;function L(rt){return Math.abs(rt[1]-M[0][1])<.01}function F(rt){return Math.abs(rt[1]-M[2][1])<.01}function N(rt){return Math.abs(rt[0]-M[0][0])<.01}function j(rt){return Math.abs(rt[0]-M[2][0])<.01}for(;f.length;){for(R=g.smoothopen(T.edgepaths[u],T.smoothing),w+=k?R:R.replace(/^M/,"L"),f.splice(f.indexOf(u),1),_=T.edgepaths[u][T.edgepaths[u].length-1],O=-1,I=0;I<4;I++){if(!_){c.log("Missing end?",u,T);break}for(L(_)&&!j(_)?D=M[1]:N(_)?D=M[0]:F(_)?D=M[3]:j(_)&&(D=M[2]),B=0;B<T.edgepaths.length;B++){var G=T.edgepaths[B][0];Math.abs(_[0]-D[0])<.01?Math.abs(_[0]-G[0])<.01&&(G[1]-_[1])*(D[1]-G[1])>=0&&(D=G,O=B):Math.abs(_[1]-D[1])<.01?Math.abs(_[1]-G[1])<.01&&(G[0]-_[0])*(D[0]-G[0])>=0&&(D=G,O=B):c.log("endpt to newendpt is not vert. or horz.",_,D,G)}if(_=D,O>=0)break;w+="L"+D}if(O===T.edgepaths.length){c.log("unclosed perimeter path");break}u=O,k=f.indexOf(u)===-1,k&&(u=f[0],w+="Z")}for(u=0;u<T.paths.length;u++)w+=g.smoothclosed(T.paths[u],T.smoothing);return w}function l(T,M,w,u,f){var k=w._context.staticPlot,_=c.ensureSingle(T,"g","contourlines"),D=f.showlines!==!1,I=f.showlabels,O=D&&I,B=X.createLines(_,D||I,M,k),R=X.createLineClip(_,O,w,u.trace.uid),L=T.selectAll("g.contourlabels").data(I?[0]:[]);if(L.exit().remove(),L.enter().append("g").classed("contourlabels",!0),I){var F=[],N=[];c.clearLocationCache();var j=X.labelFormatter(w,u),G=g.tester.append("text").attr("data-notex",1).call(g.font,f.labelfont),rt=M[0].xaxis,ct=M[0].yaxis,lt=rt._length,tt=ct._length,Z=rt.range,st=ct.range,$=c.aggNums(Math.min,null,u.x),Q=c.aggNums(Math.max,null,u.x),nt=c.aggNums(Math.min,null,u.y),Y=c.aggNums(Math.max,null,u.y),q=Math.max(rt.c2p($,!0),0),ot=Math.min(rt.c2p(Q,!0),lt),it=Math.max(ct.c2p(Y,!0),0),dt=Math.min(ct.c2p(nt,!0),tt),wt={};Z[0]<Z[1]?(wt.left=q,wt.right=ot):(wt.left=ot,wt.right=q),st[0]<st[1]?(wt.top=it,wt.bottom=dt):(wt.top=dt,wt.bottom=it),wt.middle=(wt.top+wt.bottom)/2,wt.center=(wt.left+wt.right)/2,F.push([[wt.left,wt.top],[wt.right,wt.top],[wt.right,wt.bottom],[wt.left,wt.bottom]]);var xt=Math.sqrt(lt*lt+tt*tt),Ft=h.LABELDISTANCE*xt/Math.max(1,M.length/h.LABELINCREASE);B.each(function(Et){var Nt=X.calcTextOpts(Et.level,j,G,w);V.select(this).selectAll("path").each(function(){var te=this,Jt=c.getVisibleSegment(te,wt,Nt.height/2);if(Jt&&!(Jt.len<(Nt.width+Nt.height)*h.LABELMIN))for(var Qt=Math.min(Math.ceil(Jt.len/Ft),h.LABELMAX),Wt=0;Wt<Qt;Wt++){var gt=X.findBestTextLocation(te,Jt,Nt,N,wt);if(!gt)break;X.addLabelData(gt,Nt,N,F)}})}),G.remove(),X.drawLabels(L,N,w,R,O?F:null)}I&&!D&&B.remove()}X.createLines=function(T,M,w,u){var f=w[0].smoothing,k=T.selectAll("g.contourlevel").data(M?w:[]);if(k.exit().remove(),k.enter().append("g").classed("contourlevel",!0),M){var _=k.selectAll("path.openline").data(function(I){return I.pedgepaths||I.edgepaths});_.exit().remove(),_.enter().append("path").classed("openline",!0),_.attr("d",function(I){return g.smoothopen(I,f)}).style("stroke-miterlimit",1).style("vector-effect",u?"none":"non-scaling-stroke");var D=k.selectAll("path.closedline").data(function(I){return I.ppaths||I.paths});D.exit().remove(),D.enter().append("path").classed("closedline",!0),D.attr("d",function(I){return g.smoothclosed(I,f)}).style("stroke-miterlimit",1).style("vector-effect",u?"none":"non-scaling-stroke")}return k},X.createLineClip=function(T,M,w,u){var f=w._fullLayout._clips,k=M?"clipline"+u:null,_=f.selectAll("#"+k).data(M?[0]:[]);return _.exit().remove(),_.enter().append("clipPath").classed("contourlineclip",!0).attr("id",k),g.setClipUrl(T,k,w),_},X.labelFormatter=function(T,M){var w=T._fullLayout,u=M.trace,f=u.contours,k={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"};if(f.labelformat)k.tickformat=f.labelformat,e(k,w);else{var _=E.extractOpts(u);if(_&&_.colorbar&&_.colorbar._axis)k=_.colorbar._axis;else{if(f.type==="constraint"){var D=f.value;c.isArrayOrTypedArray(D)?k.range=[D[0],D[D.length-1]]:k.range=[D,D]}else k.range=[f.start,f.end],k.nticks=(f.end-f.start)/f.size;k.range[0]===k.range[1]&&(k.range[1]+=k.range[0]||1),k.nticks||(k.nticks=1e3),e(k,w),t.prepTicks(k),k._tmin=null,k._tmax=null}}return function(I){return t.tickText(k,I).text}},X.calcTextOpts=function(T,M,w,u){var f=M(T);w.text(f).call(A.convertToTspans,u);var k=w.node(),_=g.bBox(k,!0);return{text:f,width:_.width,height:_.height,fontSize:+k.style["font-size"].replace("px",""),level:T,dy:(_.top+_.bottom)/2}},X.findBestTextLocation=function(T,M,w,u,f){var k=w.width,_,D,I,O,B;M.isClosed?(D=M.len/v.INITIALSEARCHPOINTS,_=M.min+D/2,I=M.max):(D=(M.len-k)/(v.INITIALSEARCHPOINTS+1),_=M.min+D+k/2,I=M.max-(D+k)/2);for(var R=1/0,L=0;L<v.ITERATIONS;L++){for(var F=_;F<I;F+=D){var N=c.getTextLocation(T,M.total,F,k),j=x(N,w,u,f);j<R&&(R=j,B=N,O=F)}if(R>v.MAXCOST*2)break;L&&(D/=2),_=O-D/2,I=_+D*1.5}if(R<=v.MAXCOST)return B};function x(T,M,w,u){var f=M.width/2,k=M.height/2,_=T.x,D=T.y,I=T.theta,O=Math.cos(I)*f,B=Math.sin(I)*f,R=(_>u.center?u.right-_:_-u.left)/(O+Math.abs(Math.sin(I)*k)),L=(D>u.middle?u.bottom-D:D-u.top)/(Math.abs(B)+Math.cos(I)*k);if(R<1||L<1)return 1/0;var F=v.EDGECOST*(1/(R-1)+1/(L-1));F+=v.ANGLECOST*I*I;for(var N=_-O,j=D-B,G=_+O,rt=D+B,ct=0;ct<w.length;ct++){var lt=w[ct],tt=Math.cos(lt.theta)*lt.width/2,Z=Math.sin(lt.theta)*lt.width/2,st=c.segmentDistance(N,j,G,rt,lt.x-tt,lt.y-Z,lt.x+tt,lt.y+Z)*2/(M.height+lt.height),$=lt.level===M.level,Q=$?v.SAMELEVELDISTANCE:1;if(st<=Q)return 1/0;var nt=v.NEIGHBORCOST*($?v.SAMELEVELFACTOR:1);F+=nt/(st-Q)}return F}X.addLabelData=function(T,M,w,u){var f=M.fontSize,k=M.width+f/3,_=Math.max(0,M.height-f/3),D=T.x,I=T.y,O=T.theta,B=Math.sin(O),R=Math.cos(O),L=function(N,j){return[D+N*R-j*B,I+N*B+j*R]},F=[L(-k/2,-_/2),L(-k/2,_/2),L(k/2,_/2),L(k/2,-_/2)];w.push({text:M.text,x:D,y:I,dy:M.dy,theta:O,level:M.level,width:k,height:_}),u.push(F)},X.drawLabels=function(T,M,w,u,f){var k=T.selectAll("text").data(M,function(O){return O.text+","+O.x+","+O.y+","+O.theta});if(k.exit().remove(),k.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(O){var B=O.x+Math.sin(O.theta)*O.dy,R=O.y-Math.cos(O.theta)*O.dy;V.select(this).text(O.text).attr({x:B,y:R,transform:"rotate("+180*O.theta/Math.PI+" "+B+" "+R+")"}).call(A.convertToTspans,w)}),f){for(var _="",D=0;D<f.length;D++)_+="M"+f[D].join("L")+"Z";var I=c.ensureSingle(u,"path","");I.attr("d",_)}};function b(T,M,w,u,f){var k=u.trace,_=w._fullLayout._clips,D="clip"+k.uid,I=_.selectAll("#"+D).data(k.connectgaps?[]:[0]);if(I.enter().append("clipPath").classed("contourclip",!0).attr("id",D),I.exit().remove(),k.connectgaps===!1){var O={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:M.xaxis,yaxis:M.yaxis,x:u.x,y:u.y,z:S(u),smoothing:0};i([O]),n([O]),s([O],{type:"levels"});var B=c.ensureSingle(I,"path","");B.attr("d",(O.prefixBoundary?"M"+f.join("L")+"Z":"")+y(O,f))}else D=null;g.setClipUrl(T,D,w)}function S(T){var M=T.trace._emptypoints,w=[],u=T.z.length,f=T.z[0].length,k,_=[],D;for(k=0;k<f;k++)_.push(1);for(k=0;k<u;k++)w.push(_.slice());for(k=0;k<M.length;k++)D=M[k],w[D[0]][D[1]]=0;return T.zmask=w,w}}),g2=Vt((X,V)=>{var c=Ai(),g=Ul(),E=Ym();V.exports=function(A){var t=A.contours,e=t.start,r=E(t),i=t.size||1,n=Math.floor((r-e)/i)+1,o=t.coloring==="lines"?0:1,a=g.extractOpts(A);isFinite(i)||(i=1,n=1);var s=a.reversescale?g.flipScale(a.colorscale):a.colorscale,h=s.length,v=new Array(h),m=new Array(h),p,y,l=a.min,x=a.max;if(t.coloring==="heatmap"){for(y=0;y<h;y++)p=s[y],v[y]=p[0]*(x-l)+l,m[y]=p[1];var b=c.extent([l,x,t.start,t.start+i*(n-1)]),S=b[l<x?0:1],T=b[l<x?1:0];S!==l&&(v.splice(0,0,S),m.splice(0,0,m[0])),T!==x&&(v.push(T),m.push(m[m.length-1]))}else{var M=A._input&&typeof A._input.zmin=="number"&&typeof A._input.zmax=="number";for(M&&(e<=l||r>=x)&&(e<=l&&(e=l),r>=x&&(r=x),n=Math.floor((r-e)/i)+1,o=0),y=0;y<h;y++)p=s[y],v[y]=(p[0]*(n+o-1)-o/2)*i+e,m[y]=p[1];(M||A.autocontour)&&(v[0]>l&&(v.unshift(l),m.unshift(m[0])),v[v.length-1]<x&&(v.push(x),m.push(m[m.length-1])))}return g.makeColorScaleFunc({domain:v,range:m},{noNumericCheck:!0})}}),I1=Vt((X,V)=>{var c=Ai(),g=go(),E=b1(),A=g2();V.exports=function(t){var e=c.select(t).selectAll("g.contour");e.style("opacity",function(r){return r[0].trace.opacity}),e.each(function(r){var i=c.select(this),n=r[0].trace,o=n.contours,a=n.line,s=o.size||1,h=o.start,v=o.type==="constraint",m=!v&&o.coloring==="lines",p=!v&&o.coloring==="fill",y=m||p?A(n):null;i.selectAll("g.contourlevel").each(function(b){c.select(this).selectAll("path").call(g.lineGroupStyle,a.width,m?y(b.level):a.color,a.dash)});var l=o.labelfont;if(i.selectAll("g.contourlabels text").each(function(b){g.font(c.select(this),{weight:l.weight,style:l.style,variant:l.variant,textcase:l.textcase,lineposition:l.lineposition,shadow:l.shadow,family:l.family,size:l.size,color:l.color||(m?y(b.level):a.color)})}),v)i.selectAll("g.contourfill path").style("fill",n.fillcolor);else if(p){var x;i.selectAll("g.contourfill path").style("fill",function(b){return x===void 0&&(x=b.level),y(b.level+.5*s)}),x===void 0&&(x=h),i.selectAll("g.contourbg path").style("fill",y(x-.5*s))}}),E(t)}}),L1=Vt((X,V)=>{var c=Ul(),g=g2(),E=Ym();function A(t,e,r){var i=e.contours,n=e.line,o=i.size||1,a=i.coloring,s=g(e,{isColorbar:!0});if(a==="heatmap"){var h=c.extractOpts(e);r._fillgradient=h.reversescale?c.flipScale(h.colorscale):h.colorscale,r._zrange=[h.min,h.max]}else a==="fill"&&(r._fillcolor=s);r._line={color:a==="lines"?s:n.color,width:i.showlines!==!1?n.width:0,dash:n.dash},r._levels={start:i.start,end:E(i),size:o}}V.exports={min:"zmin",max:"zmax",calc:A}}),m2=Vt((X,V)=>{var c=vi(),g=w1();V.exports=function(E,A,t,e,r){r||(r={}),r.isContour=!0;var i=g(E,A,t,e,r);return i&&i.forEach(function(n){var o=n.trace;o.contours.type==="constraint"&&(o.fillcolor&&c.opacity(o.fillcolor)?n.color=c.addOpacity(o.fillcolor,1):o.contours.showlines&&c.opacity(o.line.color)&&(n.color=c.addOpacity(o.line.color,1)))}),i}}),UA=Vt((X,V)=>{V.exports={attributes:o2(),supplyDefaults:jA(),crossTraceDefaults:k1(),calc:u2(),plot:P1().plot,layerName:"contourlayer",style:I1(),colorbar:L1(),hoverPoints:m2(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Pc(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}),VA=Vt((X,V)=>{V.exports=UA()}),v2=Vt((X,V)=>{var c=vo(),g=s2(),E=vi(),A=E.addOpacity,t=E.opacity,e=M1(),r=qr().isArrayOrTypedArray,i=e.CONSTRAINT_REDUCTION,n=e.COMPARISON_OPS2;V.exports=function(a,s,h,v,m,p){var y=s.contours,l,x,b,S=h("contours.operation");if(y._operation=i[S],o(h,y),S==="="?l=y.showlines=!0:(l=h("contours.showlines"),b=h("fillcolor",A((a.line||{}).color||m,.5))),l){var T=b&&t(b)?A(s.fillcolor,1):m;x=h("line.color",T),h("line.width",2),h("line.dash")}h("line.smoothing"),g(h,v,x,p)};function o(a,s){var h;n.indexOf(s.operation)===-1?(a("contours.value",[0,1]),r(s.value)?s.value.length>2?s.value=s.value.slice(2):s.length===0?s.value=[0,1]:s.length<2?(h=parseFloat(s.value[0]),s.value=[h,h+1]):s.value=[parseFloat(s.value[0]),parseFloat(s.value[1])]:c(s.value)&&(h=parseFloat(s.value),s.value=[h,h+1])):(a("contours.value",0),c(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}),qA=Vt((X,V)=>{var c=qr(),g=p1(),E=np(),A=v2(),t=S1(),e=E1(),r=Jm(),i=Qm();V.exports=function(n,o,a,s){function h(y,l){return c.coerce(n,o,i,y,l)}function v(y){return c.coerce2(n,o,i,y)}var m=g(n,o,h,s);if(!m){o.visible=!1;return}E(n,o,s,h),h("xhoverformat"),h("yhoverformat"),h("text"),h("hovertext"),h("hoverongaps"),h("hovertemplate");var p=h("contours.type")==="constraint";h("connectgaps",c.isArray1D(o.z)),p?A(n,o,h,s,a):(t(n,o,h,v),e(n,o,h,s)),o.contours&&o.contours.coloring==="heatmap"&&r(h,s),h("zorder")}}),HA=Vt((X,V)=>{V.exports={attributes:Qm(),supplyDefaults:qA(),calc:u2(),plot:P1().plot,style:I1(),colorbar:L1(),hoverPoints:m2(),moduleType:"trace",name:"contour",basePlotModule:Pc(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}),GA=Vt((X,V)=>{V.exports=HA()}),y2=Vt((X,V)=>{var c=Zo().hovertemplateAttrs,g=Zo().texttemplateAttrs,E=rp(),A=Gu(),t=Ks(),e=wl(),r=Eh().dash,i=po().extendFlat,n=A.marker,o=A.line,a=n.line;V.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:i({},A.mode,{dflt:"markers"}),text:i({},A.text,{}),texttemplate:g({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:i({},A.hovertext,{}),line:{color:o.color,width:o.width,dash:r,backoff:o.backoff,shape:i({},o.shape,{values:["linear","spline"]}),smoothing:o.smoothing,editType:"calc"},connectgaps:A.connectgaps,cliponaxis:A.cliponaxis,fill:i({},A.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:E(),marker:i({symbol:n.symbol,opacity:n.opacity,angle:n.angle,angleref:n.angleref,standoff:n.standoff,maxdisplayed:n.maxdisplayed,size:n.size,sizeref:n.sizeref,sizemin:n.sizemin,sizemode:n.sizemode,line:i({width:a.width,editType:"calc"},e("marker.line")),gradient:n.gradient,editType:"calc"},e("marker")),textfont:A.textfont,textposition:A.textposition,selected:A.selected,unselected:A.unselected,hoverinfo:i({},t.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:A.hoveron,hovertemplate:c()}}),WA=Vt((X,V)=>{var c=qr(),g=_p(),E=Sl(),A=Df(),t=Nf(),e=kg(),r=Uf(),i=ap(),n=y2();V.exports=function(o,a,s,h){function v(S,T){return c.coerce(o,a,n,S,T)}var m=v("a"),p=v("b"),y=v("c"),l;if(m?(l=m.length,p?(l=Math.min(l,p.length),y&&(l=Math.min(l,y.length))):y?l=Math.min(l,y.length):l=0):p&&y&&(l=Math.min(p.length,y.length)),!l){a.visible=!1;return}a._length=l,v("sum"),v("text"),v("hovertext"),a.hoveron!=="fills"&&v("hovertemplate");var x=l<g.PTS_LINESONLY?"lines+markers":"lines";v("mode",x),E.hasMarkers(a)&&A(o,a,s,h,v,{gradient:!0}),E.hasLines(a)&&(t(o,a,s,h,v,{backoff:!0}),e(o,a,v),v("connectgaps")),E.hasText(a)&&(v("texttemplate"),r(o,a,h,v));var b=[];(E.hasMarkers(a)||E.hasText(a))&&(v("cliponaxis"),v("marker.maxdisplayed"),b.push("points")),v("fill"),a.fill!=="none"&&(i(o,a,s,v),E.hasLines(a)||e(o,a,v)),(a.fill==="tonext"||a.fill==="toself")&&b.push("fills"),v("hoveron",b.join("+")||"points"),c.coerceSelectionMarkerOpacity(a,v)}}),ZA=Vt((X,V)=>{var c=ao();V.exports=function(g,E,A){var t={},e=A[E.subplot]._subplot;return t.aLabel=c.tickText(e.aaxis,g.a,!0).text,t.bLabel=c.tickText(e.baxis,g.b,!0).text,t.cLabel=c.tickText(e.caxis,g.c,!0).text,t}}),XA=Vt((X,V)=>{var c=vo(),g=Vf(),E=bp(),A=qf(),t=Hf().calcMarkerSize,e=["a","b","c"],r={a:["b","c"],b:["a","c"],c:["a","b"]};V.exports=function(i,n){var o=i._fullLayout[n.subplot],a=o.sum,s=n.sum||a,h={a:n.a,b:n.b,c:n.c},v=n.ids,m,p,y,l,x,b;for(m=0;m<e.length;m++)if(y=e[m],!h[y]){for(x=h[r[y][0]],b=h[r[y][1]],l=new Array(x.length),p=0;p<x.length;p++)l[p]=s-x[p]-b[p];h[y]=l}var S=n._length,T=new Array(S),M,w,u,f,k,_;for(m=0;m<S;m++)M=h.a[m],w=h.b[m],u=h.c[m],c(M)&&c(w)&&c(u)?(M=+M,w=+w,u=+u,f=a/(M+w+u),f!==1&&(M*=f,w*=f,u*=f),_=M,k=u-w,T[m]={x:k,y:_,a:M,b:w,c:u},v&&(T[m].id=v[m])):T[m]={x:!1,y:!1};return t(n,S),g(i,n),E(T,n),A(T,n),T}}),$A=Vt((X,V)=>{var c=Ag();V.exports=function(g,E,A){var t=E.plotContainer;t.select(".scatterlayer").selectAll("*").remove();for(var e=E.xaxis,r=E.yaxis,i={xaxis:e,yaxis:r,plot:t,layerClipId:E._hasClipOnAxisFalse?E.clipIdRelative:null},n=E.layers.frontplot.select("g.scatterlayer"),o=0;o<A.length;o++){var a=A[o];a.length&&(a[0].trace._xA=e,a[0].trace._yA=r)}c(g,i,A,n)}}),JA=Vt((X,V)=>{var c=Sg();V.exports=function(g,E,A,t){var e=c(g,E,A,t);if(!e||e[0].index===!1)return;var r=e[0];if(r.index===void 0){var i=1-r.y0/g.ya._length,n=g.xa._length,o=n*i/2,a=n-o;return r.x0=Math.max(Math.min(r.x0,a),o),r.x1=Math.max(Math.min(r.x1,a),o),e}var s=r.cd[r.index],h=r.trace,v=r.subplot;r.a=s.a,r.b=s.b,r.c=s.c,r.xLabelVal=void 0,r.yLabelVal=void 0;var m={};m[h.subplot]={_subplot:v};var p=h._module.formatLabels(s,h,m);r.aLabel=p.aLabel,r.bLabel=p.bLabel,r.cLabel=p.cLabel;var y=s.hi||h.hoverinfo,l=[];function x(S,T){l.push(S._hovertitle+": "+T)}if(!h.hovertemplate){var b=y.split("+");b.indexOf("all")!==-1&&(b=["a","b","c"]),b.indexOf("a")!==-1&&x(v.aaxis,r.aLabel),b.indexOf("b")!==-1&&x(v.baxis,r.bLabel),b.indexOf("c")!==-1&&x(v.caxis,r.cLabel)}return r.extraText=l.join("<br>"),r.hovertemplate=h.hovertemplate,e}}),QA=Vt((X,V)=>{V.exports=function(c,g,E,A,t){if(g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),A[t]){var e=A[t];c.a=e.a,c.b=e.b,c.c=e.c}else c.a=g.a,c.b=g.b,c.c=g.c;return c}}),YA=Vt((X,V)=>{var c=Ai(),g=yh(),E=Mi(),A=qr(),t=A.strTranslate,e=A._,r=vi(),i=go(),n=xp(),o=po().extendFlat,a=fu(),s=ao(),h=af(),v=Hu(),m=ep(),p=m.freeMode,y=m.rectMode,l=u0(),x=fc().prepSelect,b=fc().selectOnClick,S=fc().clearOutline,T=fc().clearSelectionsCache,M=xh();function w(F,N){this.id=F.id,this.graphDiv=F.graphDiv,this.init(N),this.makeFramework(N),this.updateFx(N),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}V.exports=w;var u=w.prototype;u.init=function(F){this.container=F._ternarylayer,this.defs=F._defs,this.layoutId=F._uid,this.traceHash={},this.layers={}},u.plot=function(F,N){var j=this,G=N[j.id],rt=N._size;j._hasClipOnAxisFalse=!1;for(var ct=0;ct<F.length;ct++){var lt=F[ct][0].trace;if(lt.cliponaxis===!1){j._hasClipOnAxisFalse=!0;break}}j.updateLayers(G),j.adjustLayout(G,rt),a.generalUpdatePerTraceModule(j.graphDiv,j,F,G),j.layers.plotbg.select("path").call(r.fill,G.bgcolor)},u.makeFramework=function(F){var N=this,j=N.graphDiv,G=F[N.id],rt=N.clipId="clip"+N.layoutId+N.id,ct=N.clipIdRelative="clip-relative"+N.layoutId+N.id;N.clipDef=A.ensureSingleById(F._clips,"clipPath",rt,function(lt){lt.append("path").attr("d","M0,0Z")}),N.clipDefRelative=A.ensureSingleById(F._clips,"clipPath",ct,function(lt){lt.append("path").attr("d","M0,0Z")}),N.plotContainer=A.ensureSingle(N.container,"g",N.id),N.updateLayers(G),i.setClipUrl(N.layers.backplot,rt,j),i.setClipUrl(N.layers.grids,rt,j)},u.updateFx=function(F){F._ternarylayer.selectAll("g.toplevel").style("cursor",F.dragmode==="pan"?"move":"crosshair")},u.updateLayers=function(F){var N=this,j=N.layers,G=["draglayer","plotbg","backplot","grids"];F.aaxis.layer==="below traces"&&G.push("aaxis","aline"),F.baxis.layer==="below traces"&&G.push("baxis","bline"),F.caxis.layer==="below traces"&&G.push("caxis","cline"),G.push("frontplot"),F.aaxis.layer==="above traces"&&G.push("aaxis","aline"),F.baxis.layer==="above traces"&&G.push("baxis","bline"),F.caxis.layer==="above traces"&&G.push("caxis","cline");var rt=N.plotContainer.selectAll("g.toplevel").data(G,String),ct=["agrid","bgrid","cgrid"];rt.enter().append("g").attr("class",function(lt){return"toplevel "+lt}).each(function(lt){var tt=c.select(this);j[lt]=tt,lt==="frontplot"?tt.append("g").classed("scatterlayer",!0):lt==="backplot"?tt.append("g").classed("maplayer",!0):lt==="plotbg"?tt.append("path").attr("d","M0,0Z"):lt==="aline"||lt==="bline"||lt==="cline"?tt.append("path"):lt==="grids"&&ct.forEach(function(Z){j[Z]=tt.append("g").classed("grid "+Z,!0)})}),rt.order()};var f=Math.sqrt(4/3);u.adjustLayout=function(F,N){var j=this,G=F.domain,rt=(G.x[0]+G.x[1])/2,ct=(G.y[0]+G.y[1])/2,lt=G.x[1]-G.x[0],tt=G.y[1]-G.y[0],Z=lt*N.w,st=tt*N.h,$=F.sum,Q=F.aaxis.min,nt=F.baxis.min,Y=F.caxis.min,q,ot,it,dt,wt,xt;Z>f*st?(dt=st,it=dt*f):(it=Z,dt=it/f),wt=lt*it/Z,xt=tt*dt/st,q=N.l+N.w*rt-it/2,ot=N.t+N.h*(1-ct)-dt/2,j.x0=q,j.y0=ot,j.w=it,j.h=dt,j.sum=$,j.xaxis={type:"linear",range:[Q+2*Y-$,$-Q-2*nt],domain:[rt-wt/2,rt+wt/2],_id:"x"},n(j.xaxis,j.graphDiv._fullLayout),j.xaxis.setScale(),j.xaxis.isPtWithinRange=function(Ut){return Ut.a>=j.aaxis.range[0]&&Ut.a<=j.aaxis.range[1]&&Ut.b>=j.baxis.range[1]&&Ut.b<=j.baxis.range[0]&&Ut.c>=j.caxis.range[1]&&Ut.c<=j.caxis.range[0]},j.yaxis={type:"linear",range:[Q,$-nt-Y],domain:[ct-xt/2,ct+xt/2],_id:"y"},n(j.yaxis,j.graphDiv._fullLayout),j.yaxis.setScale(),j.yaxis.isPtWithinRange=function(){return!0};var Ft=j.yaxis.domain[0],Et=j.aaxis=o({},F.aaxis,{range:[Q,$-nt-Y],side:"left",tickangle:(+F.aaxis.tickangle||0)-30,domain:[Ft,Ft+xt*f],anchor:"free",position:0,_id:"y",_length:it});n(Et,j.graphDiv._fullLayout),Et.setScale();var Nt=j.baxis=o({},F.baxis,{range:[$-Q-Y,nt],side:"bottom",domain:j.xaxis.domain,anchor:"free",position:0,_id:"x",_length:it});n(Nt,j.graphDiv._fullLayout),Nt.setScale();var te=j.caxis=o({},F.caxis,{range:[$-Q-nt,Y],side:"right",tickangle:(+F.caxis.tickangle||0)+30,domain:[Ft,Ft+xt*f],anchor:"free",position:0,_id:"y",_length:it});n(te,j.graphDiv._fullLayout),te.setScale();var Jt="M"+q+","+(ot+dt)+"h"+it+"l-"+it/2+",-"+dt+"Z";j.clipDef.select("path").attr("d",Jt),j.layers.plotbg.select("path").attr("d",Jt);var Qt="M0,"+dt+"h"+it+"l-"+it/2+",-"+dt+"Z";j.clipDefRelative.select("path").attr("d",Qt);var Wt=t(q,ot);j.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Wt),j.clipDefRelative.select("path").attr("transform",null);var gt=t(q-Nt._offset,ot+dt);j.layers.baxis.attr("transform",gt),j.layers.bgrid.attr("transform",gt);var bt=t(q+it/2,ot)+"rotate(30)"+t(0,-Et._offset);j.layers.aaxis.attr("transform",bt),j.layers.agrid.attr("transform",bt);var vt=t(q+it/2,ot)+"rotate(-30)"+t(0,-te._offset);j.layers.caxis.attr("transform",vt),j.layers.cgrid.attr("transform",vt),j.drawAxes(!0),j.layers.aline.select("path").attr("d",Et.showline?"M"+q+","+(ot+dt)+"l"+it/2+",-"+dt:"M0,0").call(r.stroke,Et.linecolor||"#000").style("stroke-width",(Et.linewidth||0)+"px"),j.layers.bline.select("path").attr("d",Nt.showline?"M"+q+","+(ot+dt)+"h"+it:"M0,0").call(r.stroke,Nt.linecolor||"#000").style("stroke-width",(Nt.linewidth||0)+"px"),j.layers.cline.select("path").attr("d",te.showline?"M"+(q+it/2)+","+ot+"l"+it/2+","+dt:"M0,0").call(r.stroke,te.linecolor||"#000").style("stroke-width",(te.linewidth||0)+"px"),j.graphDiv._context.staticPlot||j.initInteractions(),i.setClipUrl(j.layers.frontplot,j._hasClipOnAxisFalse?null:j.clipId,j.graphDiv)},u.drawAxes=function(F){var N=this,j=N.graphDiv,G=N.id.substr(7)+"title",rt=N.layers,ct=N.aaxis,lt=N.baxis,tt=N.caxis;if(N.drawAx(ct),N.drawAx(lt),N.drawAx(tt),F){var Z=Math.max(ct.showticklabels?ct.tickfont.size/2:0,(tt.showticklabels?tt.tickfont.size*.75:0)+(tt.ticks==="outside"?tt.ticklen*.87:0)),st=(lt.showticklabels?lt.tickfont.size:0)+(lt.ticks==="outside"?lt.ticklen:0)+3;rt["a-title"]=l.draw(j,"a"+G,{propContainer:ct,propName:N.id+".aaxis.title",placeholder:e(j,"Click to enter Component A title"),attributes:{x:N.x0+N.w/2,y:N.y0-ct.title.font.size/3-Z,"text-anchor":"middle"}}),rt["b-title"]=l.draw(j,"b"+G,{propContainer:lt,propName:N.id+".baxis.title",placeholder:e(j,"Click to enter Component B title"),attributes:{x:N.x0-st,y:N.y0+N.h+lt.title.font.size*.83+st,"text-anchor":"middle"}}),rt["c-title"]=l.draw(j,"c"+G,{propContainer:tt,propName:N.id+".caxis.title",placeholder:e(j,"Click to enter Component C title"),attributes:{x:N.x0+N.w+st,y:N.y0+N.h+tt.title.font.size*.83+st,"text-anchor":"middle"}})}},u.drawAx=function(F){var N=this,j=N.graphDiv,G=F._name,rt=G.charAt(0),ct=F._id,lt=N.layers[G],tt=30,Z=rt+"tickLayout",st=k(F);N[Z]!==st&&(lt.selectAll("."+ct+"tick").remove(),N[Z]=st),F.setScale();var $=s.calcTicks(F),Q=s.clipEnds(F,$),nt=s.makeTransTickFn(F),Y=s.getTickSigns(F)[2],q=A.deg2rad(tt),ot=Y*(F.linewidth||1)/2,it=Y*F.ticklen,dt=N.w,wt=N.h,xt=rt==="b"?"M0,"+ot+"l"+Math.sin(q)*it+","+Math.cos(q)*it:"M"+ot+",0l"+Math.cos(q)*it+","+-Math.sin(q)*it,Ft={a:"M0,0l"+wt+",-"+dt/2,b:"M0,0l-"+dt/2+",-"+wt,c:"M0,0l-"+wt+","+dt/2}[rt];s.drawTicks(j,F,{vals:F.ticks==="inside"?Q:$,layer:lt,path:xt,transFn:nt,crisp:!1}),s.drawGrid(j,F,{vals:Q,layer:N.layers[rt+"grid"],path:Ft,transFn:nt,crisp:!1}),s.drawLabels(j,F,{vals:$,layer:lt,transFn:nt,labelFns:s.makeLabelFns(F,0,tt)})};function k(F){return F.ticks+String(F.ticklen)+String(F.showticklabels)}var _=M.MINZOOM/2+.87,D="m-0.87,.5h"+_+"v3h-"+(_+5.2)+"l"+(_/2+2.6)+",-"+(_*.87+4.5)+"l2.6,1.5l-"+_/2+","+_*.87+"Z",I="m0.87,.5h-"+_+"v3h"+(_+5.2)+"l-"+(_/2+2.6)+",-"+(_*.87+4.5)+"l-2.6,1.5l"+_/2+","+_*.87+"Z",O="m0,1l"+_/2+","+_*.87+"l2.6,-1.5l-"+(_/2+2.6)+",-"+(_*.87+4.5)+"l-"+(_/2+2.6)+","+(_*.87+4.5)+"l2.6,1.5l"+_/2+",-"+_*.87+"Z",B="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",R=!0;u.clearOutline=function(){T(this.dragOptions),S(this.dragOptions.gd)},u.initInteractions=function(){var F=this,N=F.layers.plotbg.select("path").node(),j=F.graphDiv,G=j._fullLayout._zoomlayer,rt,ct;this.dragOptions={element:N,gd:j,plotinfo:{id:F.id,domain:j._fullLayout[F.id].domain,xaxis:F.xaxis,yaxis:F.yaxis},subplot:F.id,prepFn:function(gt,bt,vt){F.dragOptions.xaxes=[F.xaxis],F.dragOptions.yaxes=[F.yaxis],rt=j._fullLayout._invScaleX,ct=j._fullLayout._invScaleY;var Ut=F.dragOptions.dragmode=j._fullLayout.dragmode;p(Ut)?F.dragOptions.minDrag=1:F.dragOptions.minDrag=void 0,Ut==="zoom"?(F.dragOptions.moveFn=Nt,F.dragOptions.clickFn=dt,F.dragOptions.doneFn=te,wt(gt,bt,vt)):Ut==="pan"?(F.dragOptions.moveFn=Qt,F.dragOptions.clickFn=dt,F.dragOptions.doneFn=Wt,Jt(),F.clearOutline(j)):(y(Ut)||p(Ut))&&x(gt,bt,vt,F.dragOptions,Ut)}};var lt,tt,Z,st,$,Q,nt,Y,q,ot;function it(gt){var bt={};return bt[F.id+".aaxis.min"]=gt.a,bt[F.id+".baxis.min"]=gt.b,bt[F.id+".caxis.min"]=gt.c,bt}function dt(gt,bt){var vt=j._fullLayout.clickmode;L(j),gt===2&&(j.emit("plotly_doubleclick",null),E.call("_guiRelayout",j,it({a:0,b:0,c:0}))),vt.indexOf("select")>-1&>===1&&b(bt,j,[F.xaxis],[F.yaxis],F.id,F.dragOptions),vt.indexOf("event")>-1&&v.click(j,bt,F.id)}function wt(gt,bt,vt){var Ut=N.getBoundingClientRect();lt=bt-Ut.left,tt=vt-Ut.top,j._fullLayout._calcInverseTransform(j);var Kt=j._fullLayout._invTransform,Zt=A.apply3DTransform(Kt)(lt,tt);lt=Zt[0],tt=Zt[1],Z={a:F.aaxis.range[0],b:F.baxis.range[1],c:F.caxis.range[1]},$=Z,st=F.aaxis.range[1]-Z.a,Q=g(F.graphDiv._fullLayout[F.id].bgcolor).getLuminance(),nt="M0,"+F.h+"L"+F.w/2+", 0L"+F.w+","+F.h+"Z",Y=!1,q=G.append("path").attr("class","zoombox").attr("transform",t(F.x0,F.y0)).style({fill:Q>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",nt),ot=G.append("path").attr("class","zoombox-corners").attr("transform",t(F.x0,F.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),F.clearOutline(j)}function xt(gt,bt){return 1-bt/F.h}function Ft(gt,bt){return 1-(gt+(F.h-bt)/Math.sqrt(3))/F.w}function Et(gt,bt){return(gt-(F.h-bt)/Math.sqrt(3))/F.w}function Nt(gt,bt){var vt=lt+gt*rt,Ut=tt+bt*ct,Kt=Math.max(0,Math.min(1,xt(lt,tt),xt(vt,Ut))),Zt=Math.max(0,Math.min(1,Ft(lt,tt),Ft(vt,Ut))),le=Math.max(0,Math.min(1,Et(lt,tt),Et(vt,Ut))),Te=(Kt/2+le)*F.w,Se=(1-Kt/2-Zt)*F.w,Fe=(Te+Se)/2,Oe=Se-Te,ur=(1-Kt)*F.h,fr=ur-Oe/f;Oe<M.MINZOOM?($=Z,q.attr("d",nt),ot.attr("d","M0,0Z")):($={a:Z.a+Kt*st,b:Z.b+Zt*st,c:Z.c+le*st},q.attr("d",nt+"M"+Te+","+ur+"H"+Se+"L"+Fe+","+fr+"L"+Te+","+ur+"Z"),ot.attr("d","M"+lt+","+tt+B+"M"+Te+","+ur+D+"M"+Se+","+ur+I+"M"+Fe+","+fr+O)),Y||(q.transition().style("fill",Q>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ot.transition().style("opacity",1).duration(200),Y=!0),j.emit("plotly_relayouting",it($))}function te(){L(j),$!==Z&&(E.call("_guiRelayout",j,it($)),R&&j.data&&j._context.showTips&&(A.notifier(e(j,"Double-click to zoom back out"),"long"),R=!1))}function Jt(){Z={a:F.aaxis.range[0],b:F.baxis.range[1],c:F.caxis.range[1]},$=Z}function Qt(gt,bt){var vt=gt/F.xaxis._m,Ut=bt/F.yaxis._m;$={a:Z.a-Ut,b:Z.b+(vt+Ut)/2,c:Z.c-(vt-Ut)/2};var Kt=[$.a,$.b,$.c].sort(A.sorterAsc),Zt={a:Kt.indexOf($.a),b:Kt.indexOf($.b),c:Kt.indexOf($.c)};Kt[0]<0&&(Kt[1]+Kt[0]/2<0?(Kt[2]+=Kt[0]+Kt[1],Kt[0]=Kt[1]=0):(Kt[2]+=Kt[0]/2,Kt[1]+=Kt[0]/2,Kt[0]=0),$={a:Kt[Zt.a],b:Kt[Zt.b],c:Kt[Zt.c]},bt=(Z.a-$.a)*F.yaxis._m,gt=(Z.c-$.c-Z.b+$.b)*F.xaxis._m);var le=t(F.x0+gt,F.y0+bt);F.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",le);var Te=t(-gt,-bt);F.clipDefRelative.select("path").attr("transform",Te),F.aaxis.range=[$.a,F.sum-$.b-$.c],F.baxis.range=[F.sum-$.a-$.c,$.b],F.caxis.range=[F.sum-$.a-$.b,$.c],F.drawAxes(!1),F._hasClipOnAxisFalse&&F.plotContainer.select(".scatterlayer").selectAll(".trace").call(i.hideOutsideRangePoints,F),j.emit("plotly_relayouting",it($))}function Wt(){E.call("_guiRelayout",j,it($))}N.onmousemove=function(gt){v.hover(j,gt,F.id),j._fullLayout._lasthover=N,j._fullLayout._hoversubplot=F.id},N.onmouseout=function(gt){j._dragging||h.unhover(j,gt)},h.init(this.dragOptions)};function L(F){c.select(F).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}),x2=Vt((X,V)=>{var c=Hc(),g=pu().attributes,E=Ih(),A=su().overrideAll,t=po().extendFlat,e={title:{text:E.title.text,font:E.title.font},color:E.color,tickmode:E.minor.tickmode,nticks:t({},E.nticks,{dflt:6,min:1}),tick0:E.tick0,dtick:E.dtick,tickvals:E.tickvals,ticktext:E.ticktext,ticks:E.ticks,ticklen:E.ticklen,tickwidth:E.tickwidth,tickcolor:E.tickcolor,ticklabelstep:E.ticklabelstep,showticklabels:E.showticklabels,labelalias:E.labelalias,showtickprefix:E.showtickprefix,tickprefix:E.tickprefix,showticksuffix:E.showticksuffix,ticksuffix:E.ticksuffix,showexponent:E.showexponent,exponentformat:E.exponentformat,minexponent:E.minexponent,separatethousands:E.separatethousands,tickfont:E.tickfont,tickangle:E.tickangle,tickformat:E.tickformat,tickformatstops:E.tickformatstops,hoverformat:E.hoverformat,showline:t({},E.showline,{dflt:!0}),linecolor:E.linecolor,linewidth:E.linewidth,showgrid:t({},E.showgrid,{dflt:!0}),gridcolor:E.gridcolor,gridwidth:E.gridwidth,griddash:E.griddash,layer:E.layer,min:{valType:"number",dflt:0,min:0}},r=V.exports=A({domain:g({name:"ternary"}),bgcolor:{valType:"color",dflt:c.background},sum:{valType:"number",dflt:1,min:0},aaxis:e,baxis:e,caxis:e},"plot","from-root");r.uirevision={valType:"any",editType:"none"},r.aaxis.uirevision=r.baxis.uirevision=r.caxis.uirevision={valType:"any",editType:"none"}}),Ld=Vt((X,V)=>{var c=qr(),g=Ns(),E=pu().defaults;V.exports=function(A,t,e,r){var i=r.type,n=r.attributes,o=r.handleDefaults,a=r.partition||"x",s=t._subplots[i],h=s.length,v=h&&s[0].replace(/\d+$/,""),m,p;function y(S,T){return c.coerce(m,p,n,S,T)}for(var l=0;l<h;l++){var x=s[l];A[x]?m=A[x]:m=A[x]={},p=g.newContainer(t,x,v),r.noUirevision||y("uirevision",t.uirevision);var b={};b[a]=[l/h,(l+1)/h],E(p,t,y,b),r.id=x,o(m,p,y,r)}}}),KA=Vt((X,V)=>{var c=vi(),g=Ns(),E=qr(),A=Ld(),t=Ad(),e=Md(),r=xg(),i=l0(),n=qm(),o=x2(),a=["aaxis","baxis","caxis"];V.exports=function(v,m,p){A(v,m,p,{type:"ternary",attributes:o,handleDefaults:s,font:m.font,paper_bgcolor:m.paper_bgcolor})};function s(v,m,p,y){var l=p("bgcolor"),x=p("sum");y.bgColor=c.combine(l,y.paper_bgcolor);for(var b,S,T,M=0;M<a.length;M++)b=a[M],S=v[b]||{},T=g.newContainer(m,b),T._name=b,h(S,T,y,m);var w=m.aaxis,u=m.baxis,f=m.caxis;w.min+u.min+f.min>=x&&(w.min=0,u.min=0,f.min=0,v.aaxis&&delete v.aaxis.min,v.baxis&&delete v.baxis.min,v.caxis&&delete v.caxis.min)}function h(v,m,p,y){var l=o[m._name];function x(k,_){return E.coerce(v,m,l,k,_)}x("uirevision",y.uirevision),m.type="linear";var b=x("color"),S=b!==l.color.dflt?b:p.font.color,T=m._name,M=T.charAt(0).toUpperCase(),w="Component "+M,u=x("title.text",w);m._hovertitle=u===w?u:M,E.coerceFont(x,"title.font",p.font,{overrideDflt:{size:E.bigFont(p.font.size),color:S}}),x("min"),i(v,m,x,"linear"),e(v,m,x,"linear"),t(v,m,x,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(v,m,x,{outerTicks:!0});var f=x("showticklabels");f&&(E.coerceFont(x,"tickfont",p.font,{overrideDflt:{color:S}}),x("tickangle"),x("tickformat")),n(v,m,x,{dfltColor:b,bgColor:p.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),x("hoverformat"),x("layer")}}),tM=Vt(X=>{var V=YA(),c=Ph().getSubplotCalcData,g=qr().counterRegex,E="ternary";X.name=E;var A=X.attr="subplot";X.idRoot=E,X.idRegex=X.attrRegex=g(E);var t=X.attributes={};t[A]={valType:"subplotid",dflt:"ternary",editType:"calc"},X.layoutAttributes=x2(),X.supplyLayoutDefaults=KA(),X.plot=function(e){for(var r=e._fullLayout,i=e.calcdata,n=r._subplots[E],o=0;o<n.length;o++){var a=n[o],s=c(i,E,a),h=r[a]._subplot;h||(h=new V({id:a,graphDiv:e,container:r._ternarylayer.node()},r),r[a]._subplot=h),h.plot(s,r,e._promises)}},X.clean=function(e,r,i,n){for(var o=n._subplots[E]||[],a=0;a<o.length;a++){var s=o[a],h=n[s]._subplot;!r[s]&&h&&(h.plotContainer.remove(),h.clipDef.remove(),h.clipDefRelative.remove(),h.layers["a-title"].remove(),h.layers["b-title"].remove(),h.layers["c-title"].remove())}},X.updateFx=function(e){var r=e._fullLayout;r._ternarylayer.selectAll("g.toplevel").style("cursor",r.dragmode==="pan"?"move":"crosshair")}}),eM=Vt((X,V)=>{V.exports={attributes:y2(),supplyDefaults:WA(),colorbar:Wh(),formatLabels:ZA(),calc:XA(),plot:$A(),style:yf().style,styleOnSelect:yf().styleOnSelect,hoverPoints:JA(),selectPoints:Eg(),eventData:QA(),moduleType:"trace",name:"scatterternary",basePlotModule:tM(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}),rM=Vt((X,V)=>{V.exports=eM()}),_2=Vt((X,V)=>{var c=Zm(),g=po().extendFlat,E=qu().axisHoverFormat;V.exports={y:c.y,x:c.x,x0:c.x0,y0:c.y0,xhoverformat:E("x"),yhoverformat:E("y"),name:g({},c.name,{}),orientation:g({},c.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:c.fillcolor,points:g({},c.boxpoints,{}),jitter:g({},c.jitter,{}),pointpos:g({},c.pointpos,{}),width:g({},c.width,{}),marker:c.marker,text:c.text,hovertext:c.hovertext,hovertemplate:c.hovertemplate,quartilemethod:c.quartilemethod,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:c.offsetgroup,alignmentgroup:c.alignmentgroup,selected:c.selected,unselected:c.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:c.zorder}}),b2=Vt((X,V)=>{var c=Xm(),g=qr().extendFlat;V.exports={violinmode:g({},c.boxmode,{}),violingap:g({},c.boxgap,{}),violingroupgap:g({},c.boxgroupgap,{})}}),nM=Vt((X,V)=>{var c=qr(),g=vi(),E=$m(),A=_2();V.exports=function(t,e,r,i){function n(u,f){return c.coerce(t,e,A,u,f)}function o(u,f){return c.coerce2(t,e,A,u,f)}if(E.handleSampleDefaults(t,e,n,i),e.visible!==!1){n("bandwidth"),n("side");var a=n("width");a||(n("scalegroup",e.name),n("scalemode"));var s=n("span"),h;Array.isArray(s)&&(h="manual"),n("spanmode",h);var v=n("line.color",(t.marker||{}).color||r),m=n("line.width"),p=n("fillcolor",g.addOpacity(e.line.color,.5));E.handlePointsDefaults(t,e,n,{prefix:""});var y=o("box.width"),l=o("box.fillcolor",p),x=o("box.line.color",v),b=o("box.line.width",m),S=n("box.visible",!!(y||l||x||b));S||(e.box={visible:!1});var T=o("meanline.color",v),M=o("meanline.width",m),w=n("meanline.visible",!!(T||M));w||(e.meanline={visible:!1}),n("quartilemethod"),n("zorder")}}}),aM=Vt((X,V)=>{var c=qr(),g=b2(),E=u1();V.exports=function(A,t,e){function r(i,n){return c.coerce(A,t,g,i,n)}E._supply(A,t,e,r,"violin")}}),C1=Vt(X=>{var V=qr(),c={gaussian:function(g){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*g*g)}};X.makeKDE=function(g,E,A){var t=A.length,e=c.gaussian,r=g.bandwidth,i=1/(t*r);return function(n){for(var o=0,a=0;a<t;a++)o+=e((n-A[a])/r);return i*o}},X.getPositionOnKdePath=function(g,E,A){var t,e;E.orientation==="h"?(t="y",e="x"):(t="x",e="y");var r=V.findPointOnPath(g.path,A,e,{pathLength:g.pathLength}),i=g.posCenterPx,n=r[t],o=E.side==="both"?2*i-n:i;return[n,o]},X.getKdeValue=function(g,E,A){var t=g.pts.map(X.extractVal),e=X.makeKDE(g,E,t);return e(A)/g.posDensityScale},X.extractVal=function(g){return g.v}}),iM=Vt((X,V)=>{var c=qr(),g=ao(),E=Wb(),A=C1(),t=ts().BADNUM;V.exports=function(n,o){var a=E(n,o);if(a[0].t.empty)return a;for(var s=n._fullLayout,h=g.getFromId(n,o[o.orientation==="h"?"xaxis":"yaxis"]),v=1/0,m=-1/0,p=0,y=0,l=0;l<a.length;l++){var x=a[l],b=x.pts.map(A.extractVal),S=x.bandwidth=r(o,x,b),T=x.span=i(o,x,h,S);if(x.min===x.max&&S===0)T=x.span=[x.min,x.max],x.density=[{v:1,t:T[0]}],x.bandwidth=S,p=Math.max(p,1);else{var M=T[1]-T[0],w=Math.ceil(M/(S/3)),u=M/w;if(!isFinite(u)||!isFinite(w))return c.error("Something went wrong with computing the violin span"),a[0].t.empty=!0,a;var f=A.makeKDE(x,o,b);x.density=new Array(w);for(var k=0,_=T[0];_<T[1]+u/2;k++,_+=u){var D=f(_);x.density[k]={v:D,t:_},p=Math.max(p,D)}}y=Math.max(y,b.length),v=Math.min(v,T[0]),m=Math.max(m,T[1])}var I=g.findExtremes(h,[v,m],{padded:!0});if(o._extremes[h._id]=I,o.width)a[0].t.maxKDE=p;else{var O=s._violinScaleGroupStats,B=o.scalegroup,R=O[B];R?(R.maxKDE=Math.max(R.maxKDE,p),R.maxCount=Math.max(R.maxCount,y)):O[B]={maxKDE:p,maxCount:y}}return a[0].t.labels.kde=c._(n,"kde:"),a};function e(n,o,a){var s=Math.min(o,a/1.349);return 1.059*s*Math.pow(n,-.2)}function r(n,o,a){var s=o.max-o.min;if(!s)return n.bandwidth?n.bandwidth:0;if(n.bandwidth)return Math.max(n.bandwidth,s/1e4);var h=a.length,v=c.stdev(a,h-1,o.mean);return Math.max(e(h,v,o.q3-o.q1),s/100)}function i(n,o,a,s){var h=n.spanmode,v=n.span||[],m=[o.min,o.max],p=[o.min-2*s,o.max+2*s],y;function l(b){var S=v[b],T=a.type==="multicategory"?a.r2c(S):a.d2c(S,0,n[o.valLetter+"calendar"]);return T===t?p[b]:T}h==="soft"?y=p:h==="hard"?y=m:y=[l(0),l(1)];var x={type:"linear",range:y};return g.setConvert(x),x.cleanRange(),y}}),oM=Vt((X,V)=>{var c=c1().setPositionOffset,g=["v","h"];V.exports=function(E,A){for(var t=E.calcdata,e=A.xaxis,r=A.yaxis,i=0;i<g.length;i++){for(var n=g[i],o=n==="h"?r:e,a=[],s=0;s<t.length;s++){var h=t[s],v=h[0].t,m=h[0].trace;m.visible===!0&&m.type==="violin"&&!v.empty&&m.orientation===n&&m.xaxis===e._id&&m.yaxis===r._id&&a.push(s)}c("violin",E,a,o)}}}),sM=Vt((X,V)=>{var c=Ai(),g=qr(),E=go(),A=h1(),t=Ib(),e=C1();V.exports=function(r,i,n,o){var a=r._context.staticPlot,s=r._fullLayout,h=i.xaxis,v=i.yaxis;function m(p,y){var l=t(p,{xaxis:h,yaxis:v,trace:y,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return E.smoothopen(l[0],1)}g.makeTraceGroups(o,n,"trace violins").each(function(p){var y=c.select(this),l=p[0],x=l.t,b=l.trace;if(b.visible!==!0||x.empty){y.remove();return}var S=x.bPos,T=x.bdPos,M=i[x.valLetter+"axis"],w=i[x.posLetter+"axis"],u=b.side==="both",f=u||b.side==="positive",k=u||b.side==="negative",_=y.selectAll("path.violin").data(g.identity);_.enter().append("path").style("vector-effect",a?"none":"non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each(function(N){var j=c.select(this),G=N.density,rt=G.length,ct=w.c2l(N.pos+S,!0),lt=w.l2p(ct),tt;if(b.width)tt=x.maxKDE/T;else{var Z=s._violinScaleGroupStats[b.scalegroup];tt=b.scalemode==="count"?Z.maxKDE/T*(Z.maxCount/N.pts.length):Z.maxKDE/T}var st,$,Q,nt,Y,q,ot;if(f){for(q=new Array(rt),nt=0;nt<rt;nt++)ot=q[nt]={},ot[x.posLetter]=ct+G[nt].v/tt,ot[x.valLetter]=M.c2l(G[nt].t,!0);st=m(q,b)}if(k){for(q=new Array(rt),Y=0,nt=rt-1;Y<rt;Y++,nt--)ot=q[Y]={},ot[x.posLetter]=ct-G[nt].v/tt,ot[x.valLetter]=M.c2l(G[nt].t,!0);$=m(q,b)}if(u)Q=st+"L"+$.substr(1)+"Z";else{var it=[lt,M.c2p(G[0].t)],dt=[lt,M.c2p(G[rt-1].t)];b.orientation==="h"&&(it.reverse(),dt.reverse()),f?Q="M"+it+"L"+st.substr(1)+"L"+dt:Q="M"+dt+"L"+$.substr(1)+"L"+it}j.attr("d",Q),N.posCenterPx=lt,N.posDensityScale=tt*T,N.path=j.node(),N.pathLength=N.path.getTotalLength()/(u?2:1)});var D=b.box,I=D.width,O=(D.line||{}).width,B,R;u?(B=T*I,R=0):f?(B=[0,T*I/2],R=O*{x:1,y:-1}[x.posLetter]):(B=[T*I/2,0],R=O*{x:-1,y:1}[x.posLetter]),A.plotBoxAndWhiskers(y,{pos:w,val:M},b,{bPos:S,bdPos:B,bPosPxOffset:R}),A.plotBoxMean(y,{pos:w,val:M},b,{bPos:S,bdPos:B,bPosPxOffset:R});var L;!b.box.visible&&b.meanline.visible&&(L=g.identity);var F=y.selectAll("path.meanline").data(L||[]);F.enter().append("path").attr("class","meanline").style("fill","none").style("vector-effect",a?"none":"non-scaling-stroke"),F.exit().remove(),F.each(function(N){var j=M.c2p(N.mean,!0),G=e.getPositionOnKdePath(N,b,j);c.select(this).attr("d",b.orientation==="h"?"M"+j+","+G[0]+"V"+G[1]:"M"+G[0]+","+j+"H"+G[1])}),A.plotPoints(y,{x:h,y:v},b,x)})}}),lM=Vt((X,V)=>{var c=Ai(),g=vi(),E=yf().stylePoints;V.exports=function(A){var t=c.select(A).selectAll("g.trace.violins");t.style("opacity",function(e){return e[0].trace.opacity}),t.each(function(e){var r=e[0].trace,i=c.select(this),n=r.box||{},o=n.line||{},a=r.meanline||{},s=a.width;i.selectAll("path.violin").style("stroke-width",r.line.width+"px").call(g.stroke,r.line.color).call(g.fill,r.fillcolor),i.selectAll("path.box").style("stroke-width",o.width+"px").call(g.stroke,o.color).call(g.fill,n.fillcolor);var h={"stroke-width":s+"px","stroke-dasharray":2*s+"px,"+s+"px"};i.selectAll("path.mean").style(h).call(g.stroke,a.color),i.selectAll("path.meanline").style(h).call(g.stroke,a.color),E(i,r,A)})}}),uM=Vt((X,V)=>{var c=vi(),g=qr(),E=ao(),A=Zb(),t=C1();V.exports=function(e,r,i,n,o){o||(o={});var a=o.hoverLayer,s=e.cd,h=s[0].trace,v=h.hoveron,m=v.indexOf("violins")!==-1,p=v.indexOf("kde")!==-1,y=[],l,x;if(m||p){var b=A.hoverOnBoxes(e,r,i,n);if(p&&b.length>0){var S=e.xa,T=e.ya,M,w,u,f,k;h.orientation==="h"?(k=r,M="y",u=T,w="x",f=S):(k=i,M="x",u=S,w="y",f=T);var _=s[e.index];if(k>=_.span[0]&&k<=_.span[1]){var D=g.extendFlat({},e),I=f.c2p(k,!0),O=t.getKdeValue(_,h,k),B=t.getPositionOnKdePath(_,h,I),R=u._offset,L=u._length;D[M+"0"]=B[0],D[M+"1"]=B[1],D[w+"0"]=D[w+"1"]=I,D[w+"Label"]=w+": "+E.hoverLabelText(f,k,h[w+"hoverformat"])+", "+s[0].t.labels.kde+" "+O.toFixed(3);for(var F=0,N=0;N<b.length;N++)if(b[N].attr==="med"){F=N;break}D.spikeDistance=b[F].spikeDistance;var j=M+"Spike";D[j]=b[F][j],b[F].spikeDistance=void 0,b[F][j]=void 0,D.hovertemplate=!1,y.push(D),x={},x[M+"1"]=g.constrain(R+B[0],R,R+L),x[M+"2"]=g.constrain(R+B[1],R,R+L),x[w+"1"]=x[w+"2"]=f._offset+I}}m&&(y=y.concat(b))}v.indexOf("points")!==-1&&(l=A.hoverOnPoints(e,r,i));var G=a.selectAll(".violinline-"+h.uid).data(x?[0]:[]);return G.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),G.exit().remove(),G.attr(x).call(c.stroke,e.color),n==="closest"?l?[l]:y:(l&&y.push(l),y)}}),cM=Vt((X,V)=>{V.exports={attributes:_2(),layoutAttributes:b2(),supplyDefaults:nM(),crossTraceDefaults:$m().crossTraceDefaults,supplyLayoutDefaults:aM(),calc:iM(),crossTraceCalc:oM(),plot:sM(),style:lM(),styleOnSelect:yf().styleOnSelect,hoverPoints:uM(),selectPoints:Xb(),moduleType:"trace",name:"violin",basePlotModule:Pc(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}),hM=Vt((X,V)=>{V.exports=cM()}),fM=Vt((X,V)=>{V.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}),w2=Vt((X,V)=>{var c=wp(),g=Gu().line,E=Ks(),A=qu().axisHoverFormat,t=Zo().hovertemplateAttrs,e=Zo().texttemplateAttrs,r=fM(),i=po().extendFlat,n=vi();V.exports={x:c.x,x0:c.x0,dx:c.dx,y:c.y,y0:c.y0,dy:c.dy,xperiod:c.xperiod,yperiod:c.yperiod,xperiod0:c.xperiod0,yperiod0:c.yperiod0,xperiodalignment:c.xperiodalignment,yperiodalignment:c.yperiodalignment,xhoverformat:A("x"),yhoverformat:A("y"),hovertext:c.hovertext,hovertemplate:t({},{keys:r.eventDataKeys}),hoverinfo:i({},E.hoverinfo,{flags:["name","x","y","text","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:e({editType:"plot"},{keys:r.eventDataKeys.concat(["label","value"])}),text:c.text,textposition:c.textposition,insidetextanchor:i({},c.insidetextanchor,{dflt:"middle"}),textangle:i({},c.textangle,{dflt:0}),textfont:c.textfont,insidetextfont:c.insidetextfont,outsidetextfont:c.outsidetextfont,constraintext:c.constraintext,cliponaxis:c.cliponaxis,orientation:i({},c.orientation,{}),offset:i({},c.offset,{arrayOk:!1}),width:i({},c.width,{arrayOk:!1}),marker:o(),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:i({},g.color,{dflt:n.defaultLine}),width:i({},g.width,{dflt:0,editType:"plot"}),dash:g.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:c.offsetgroup,alignmentgroup:c.alignmentgroup,zorder:c.zorder};function o(){var a=i({},c.marker);return delete a.pattern,delete a.cornerradius,a}}),T2=Vt((X,V)=>{V.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),k2=Vt((X,V)=>{var c=qr(),g=f0(),E=zf().handleText,A=Tg(),t=np(),e=w2(),r=vi();function i(a,s,h,v){function m(T,M){return c.coerce(a,s,e,T,M)}var p=A(a,s,v,m);if(!p){s.visible=!1;return}t(a,s,v,m),m("xhoverformat"),m("yhoverformat"),m("orientation",s.y&&!s.x?"v":"h"),m("offset"),m("width");var y=m("text");m("hovertext"),m("hovertemplate");var l=m("textposition");E(a,s,v,m,l,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s.textposition!=="none"&&!s.texttemplate&&m("textinfo",c.isArrayOrTypedArray(y)?"text+value":"value");var x=m("marker.color",h);m("marker.line.color",r.defaultLine),m("marker.line.width");var b=m("connector.visible");if(b){m("connector.fillcolor",n(x));var S=m("connector.line.width");S&&(m("connector.line.color"),m("connector.line.dash"))}m("zorder")}function n(a){var s=c.isArrayOrTypedArray(a)?"#000":a;return r.addOpacity(s,.5*r.opacity(s))}function o(a,s){var h,v;function m(y){return c.coerce(v._input,v,e,y)}for(var p=0;p<a.length;p++)v=a[p],v.type==="funnel"&&(h=v._input,g(h,v,s,m,s.funnelmode))}V.exports={supplyDefaults:i,crossTraceDefaults:o}}),pM=Vt((X,V)=>{var c=qr(),g=T2();V.exports=function(E,A,t){var e=!1;function r(o,a){return c.coerce(E,A,g,o,a)}for(var i=0;i<t.length;i++){var n=t[i];if(n.visible&&n.type==="funnel"){e=!0;break}}e&&(r("funnelmode"),r("funnelgap",.2),r("funnelgroupgap"))}}),dM=Vt((X,V)=>{var c=qr();V.exports=function(g,E){for(var A=0;A<g.length;A++)g[A].i=A;c.mergeArray(E.text,g,"tx"),c.mergeArray(E.hovertext,g,"htx");var t=E.marker;if(t){c.mergeArray(t.opacity,g,"mo"),c.mergeArray(t.color,g,"mc");var e=t.line;e&&(c.mergeArray(e.color,g,"mlc"),c.mergeArrayCastPositive(e.width,g,"mlw"))}}}),gM=Vt((X,V)=>{var c=ao(),g=ip(),E=dM(),A=qf(),t=ts().BADNUM;V.exports=function(r,i){var n=c.getFromId(r,i.xaxis||"x"),o=c.getFromId(r,i.yaxis||"y"),a,s,h,v,m,p,y,l;i.orientation==="h"?(a=n.makeCalcdata(i,"x"),h=o.makeCalcdata(i,"y"),v=g(i,o,"y",h),m=!!i.yperiodalignment,p="y"):(a=o.makeCalcdata(i,"y"),h=n.makeCalcdata(i,"x"),v=g(i,n,"x",h),m=!!i.xperiodalignment,p="x"),s=v.vals;var x=Math.min(s.length,a.length),b=new Array(x);for(i._base=[],y=0;y<x;y++){a[y]<0&&(a[y]=t);var S=!1;a[y]!==t&&y+1<x&&a[y+1]!==t&&(S=!0),l=b[y]={p:s[y],s:a[y],cNext:S},i._base[y]=-.5*l.s,m&&(b[y].orig_p=h[y],b[y][p+"End"]=v.ends[y],b[y][p+"Start"]=v.starts[y]),i.ids&&(l.id=String(i.ids[y])),y===0&&(b[0].vTotal=0),b[0].vTotal+=e(l.s),l.begR=e(l.s)/e(b[0].s)}var T;for(y=0;y<x;y++)l=b[y],l.s!==t&&(l.sumR=l.s/b[0].vTotal,l.difR=T!==void 0?l.s/T:1,T=l.s);return E(b,i),A(b,i),b};function e(r){return r===t?0:r}}),mM=Vt((X,V)=>{var c=p0().setGroupPositions;V.exports=function(g,E){var A=g._fullLayout,t=g._fullData,e=g.calcdata,r=E.xaxis,i=E.yaxis,n=[],o=[],a=[],s,h;for(h=0;h<t.length;h++){var v=t[h],m=v.orientation==="h";v.visible===!0&&v.xaxis===r._id&&v.yaxis===i._id&&v.type==="funnel"&&(s=e[h],m?a.push(s):o.push(s),n.push(s))}var p={mode:A.funnelmode,norm:A.funnelnorm,gap:A.funnelgap,groupgap:A.funnelgroupgap};for(c(g,r,i,o,p),c(g,i,r,a,p),h=0;h<n.length;h++){s=n[h];for(var y=0;y<s.length;y++)y+1<s.length&&(s[y].nextP0=s[y+1].p0,s[y].nextS0=s[y+1].s0,s[y].nextP1=s[y+1].p1,s[y].nextS1=s[y+1].s1)}}}),vM=Vt((X,V)=>{var c=Ai(),g=qr(),E=go(),A=ts().BADNUM,t=g0(),e=of().clearMinTextSize;V.exports=function(o,a,s,h){var v=o._fullLayout;e("funnel",v),r(o,a,s,h),i(o,a,s,h),t.plot(o,a,s,h,{mode:v.funnelmode,norm:v.funnelmode,gap:v.funnelgap,groupgap:v.funnelgroupgap})};function r(o,a,s,h){var v=a.xaxis,m=a.yaxis;g.makeTraceGroups(h,s,"trace bars").each(function(p){var y=c.select(this),l=p[0].trace,x=g.ensureSingle(y,"g","regions");if(!l.connector||!l.connector.visible){x.remove();return}var b=l.orientation==="h",S=x.selectAll("g.region").data(g.identity);S.enter().append("g").classed("region",!0),S.exit().remove();var T=S.size();S.each(function(M,w){if(!(w!==T-1&&!M.cNext)){var u=n(M,v,m,b),f=u[0],k=u[1],_="";f[0]!==A&&k[0]!==A&&f[1]!==A&&k[1]!==A&&f[2]!==A&&k[2]!==A&&f[3]!==A&&k[3]!==A&&(b?_+="M"+f[0]+","+k[1]+"L"+f[2]+","+k[2]+"H"+f[3]+"L"+f[1]+","+k[1]+"Z":_+="M"+f[1]+","+k[1]+"L"+f[2]+","+k[3]+"V"+k[2]+"L"+f[1]+","+k[0]+"Z"),_===""&&(_="M0,0Z"),g.ensureSingle(c.select(this),"path").attr("d",_).call(E.setClipUrl,a.layerClipId,o)}})})}function i(o,a,s,h){var v=a.xaxis,m=a.yaxis;g.makeTraceGroups(h,s,"trace bars").each(function(p){var y=c.select(this),l=p[0].trace,x=g.ensureSingle(y,"g","lines");if(!l.connector||!l.connector.visible||!l.connector.line.width){x.remove();return}var b=l.orientation==="h",S=x.selectAll("g.line").data(g.identity);S.enter().append("g").classed("line",!0),S.exit().remove();var T=S.size();S.each(function(M,w){if(!(w!==T-1&&!M.cNext)){var u=n(M,v,m,b),f=u[0],k=u[1],_="";f[3]!==void 0&&k[3]!==void 0&&(b?(_+="M"+f[0]+","+k[1]+"L"+f[2]+","+k[2],_+="M"+f[1]+","+k[1]+"L"+f[3]+","+k[2]):(_+="M"+f[1]+","+k[1]+"L"+f[2]+","+k[3],_+="M"+f[1]+","+k[0]+"L"+f[2]+","+k[2])),_===""&&(_="M0,0Z"),g.ensureSingle(c.select(this),"path").attr("d",_).call(E.setClipUrl,a.layerClipId,o)}})})}function n(o,a,s,h){var v=[],m=[],p=h?a:s,y=h?s:a;return v[0]=p.c2p(o.s0,!0),m[0]=y.c2p(o.p0,!0),v[1]=p.c2p(o.s1,!0),m[1]=y.c2p(o.p1,!0),v[2]=p.c2p(o.nextS0,!0),m[2]=y.c2p(o.nextP0,!0),v[3]=p.c2p(o.nextS1,!0),m[3]=y.c2p(o.nextP1,!0),h?[v,m]:[m,v]}}),yM=Vt((X,V)=>{var c=Ai(),g=go(),E=vi(),A=bd().DESELECTDIM,t=Gf(),e=of().resizeText,r=t.styleTextPoints;function i(n,o,a){var s=a||c.select(n).selectAll('g[class^="funnellayer"]').selectAll("g.trace");e(n,s,"funnel"),s.style("opacity",function(h){return h[0].trace.opacity}),s.each(function(h){var v=c.select(this),m=h[0].trace;v.selectAll(".point > path").each(function(p){if(!p.isBlank){var y=m.marker;c.select(this).call(E.fill,p.mc||y.color).call(E.stroke,p.mlc||y.line.color).call(g.dashLine,y.line.dash,p.mlw||y.line.width).style("opacity",m.selectedpoints&&!p.selected?A:1)}}),r(v,m,n),v.selectAll(".regions").each(function(){c.select(this).selectAll("path").style("stroke-width",0).call(E.fill,m.connector.fillcolor)}),v.selectAll(".lines").each(function(){var p=m.connector.line;g.lineGroupStyle(c.select(this).selectAll("path"),p.width,p.color,p.dash)})})}V.exports={style:i}}),xM=Vt((X,V)=>{var c=vi().opacity,g=Pg().hoverOnBars,E=qr().formatPercent;V.exports=function(t,e,r,i,n){var o=g(t,e,r,i,n);if(o){var a=o.cd,s=a[0].trace,h=s.orientation==="h",v=o.index,m=a[v],p=h?"x":"y";o[p+"LabelVal"]=m.s,o.percentInitial=m.begR,o.percentInitialLabel=E(m.begR,1),o.percentPrevious=m.difR,o.percentPreviousLabel=E(m.difR,1),o.percentTotal=m.sumR,o.percentTotalLabel=E(m.sumR,1);var y=m.hi||s.hoverinfo,l=[];if(y&&y!=="none"&&y!=="skip"){var x=y==="all",b=y.split("+"),S=function(T){return x||b.indexOf(T)!==-1};S("percent initial")&&l.push(o.percentInitialLabel+" of initial"),S("percent previous")&&l.push(o.percentPreviousLabel+" of previous"),S("percent total")&&l.push(o.percentTotalLabel+" of total")}return o.extraText=l.join("<br>"),o.color=A(s,m),[o]}};function A(t,e){var r=t.marker,i=e.mc||r.color,n=e.mlc||r.line.color,o=e.mlw||r.line.width;if(c(i))return i;if(c(n)&&o)return n}}),_M=Vt((X,V)=>{V.exports=function(c,g){return c.x="xVal"in g?g.xVal:g.x,c.y="yVal"in g?g.yVal:g.y,"percentInitial"in g&&(c.percentInitial=g.percentInitial),"percentPrevious"in g&&(c.percentPrevious=g.percentPrevious),"percentTotal"in g&&(c.percentTotal=g.percentTotal),g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),c}}),bM=Vt((X,V)=>{V.exports={attributes:w2(),layoutAttributes:T2(),supplyDefaults:k2().supplyDefaults,crossTraceDefaults:k2().crossTraceDefaults,supplyLayoutDefaults:pM(),calc:gM(),crossTraceCalc:mM(),plot:vM(),style:yM().style,hoverPoints:xM(),eventData:_M(),selectPoints:Ig(),moduleType:"trace",name:"funnel",basePlotModule:Pc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),wM=Vt((X,V)=>{V.exports=bM()}),TM=Vt((X,V)=>{V.exports={eventDataKeys:["initial","delta","final"]}}),A2=Vt((X,V)=>{var c=wp(),g=Gu().line,E=Ks(),A=qu().axisHoverFormat,t=Zo().hovertemplateAttrs,e=Zo().texttemplateAttrs,r=TM(),i=po().extendFlat,n=vi();function o(a){return{marker:{color:i({},c.marker.color,{arrayOk:!1,editType:"style"}),line:{color:i({},c.marker.line.color,{arrayOk:!1,editType:"style"}),width:i({},c.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}V.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:c.x,x0:c.x0,dx:c.dx,y:c.y,y0:c.y0,dy:c.dy,xperiod:c.xperiod,yperiod:c.yperiod,xperiod0:c.xperiod0,yperiod0:c.yperiod0,xperiodalignment:c.xperiodalignment,yperiodalignment:c.yperiodalignment,xhoverformat:A("x"),yhoverformat:A("y"),hovertext:c.hovertext,hovertemplate:t({},{keys:r.eventDataKeys}),hoverinfo:i({},E.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:e({editType:"plot"},{keys:r.eventDataKeys.concat(["label"])}),text:c.text,textposition:c.textposition,insidetextanchor:c.insidetextanchor,textangle:c.textangle,textfont:c.textfont,insidetextfont:c.insidetextfont,outsidetextfont:c.outsidetextfont,constraintext:c.constraintext,cliponaxis:c.cliponaxis,orientation:c.orientation,offset:c.offset,width:c.width,increasing:o(),decreasing:o(),totals:o(),connector:{line:{color:i({},g.color,{dflt:n.defaultLine}),width:i({},g.width,{editType:"plot"}),dash:g.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:c.offsetgroup,alignmentgroup:c.alignmentgroup,zorder:c.zorder}}),M2=Vt((X,V)=>{V.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),Cg=Vt((X,V)=>{V.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}),S2=Vt((X,V)=>{var c=qr(),g=f0(),E=zf().handleText,A=Tg(),t=np(),e=A2(),r=vi(),i=Cg(),n=i.INCREASING.COLOR,o=i.DECREASING.COLOR,a="#4499FF";function s(m,p,y){m(p+".marker.color",y),m(p+".marker.line.color",r.defaultLine),m(p+".marker.line.width")}function h(m,p,y,l){function x(w,u){return c.coerce(m,p,e,w,u)}var b=A(m,p,l,x);if(!b){p.visible=!1;return}t(m,p,l,x),x("xhoverformat"),x("yhoverformat"),x("measure"),x("orientation",p.x&&!p.y?"h":"v"),x("base"),x("offset"),x("width"),x("text"),x("hovertext"),x("hovertemplate");var S=x("textposition");E(m,p,l,x,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),p.textposition!=="none"&&(x("texttemplate"),p.texttemplate||x("textinfo")),s(x,"increasing",n),s(x,"decreasing",o),s(x,"totals",a);var T=x("connector.visible");if(T){x("connector.mode");var M=x("connector.line.width");M&&(x("connector.line.color"),x("connector.line.dash"))}x("zorder")}function v(m,p){var y,l;function x(S){return c.coerce(l._input,l,e,S)}if(p.waterfallmode==="group")for(var b=0;b<m.length;b++)l=m[b],y=l._input,g(y,l,p,x,p.waterfallmode)}V.exports={supplyDefaults:h,crossTraceDefaults:v}}),kM=Vt((X,V)=>{var c=qr(),g=M2();V.exports=function(E,A,t){var e=!1;function r(o,a){return c.coerce(E,A,g,o,a)}for(var i=0;i<t.length;i++){var n=t[i];if(n.visible&&n.type==="waterfall"){e=!0;break}}e&&(r("waterfallmode"),r("waterfallgap",.2),r("waterfallgroupgap"))}}),AM=Vt((X,V)=>{var c=ao(),g=ip(),E=qr().mergeArray,A=qf(),t=ts().BADNUM;function e(i){return i==="a"||i==="absolute"}function r(i){return i==="t"||i==="total"}V.exports=function(i,n){var o=c.getFromId(i,n.xaxis||"x"),a=c.getFromId(i,n.yaxis||"y"),s,h,v,m,p,y;n.orientation==="h"?(s=o.makeCalcdata(n,"x"),v=a.makeCalcdata(n,"y"),m=g(n,a,"y",v),p=!!n.yperiodalignment,y="y"):(s=a.makeCalcdata(n,"y"),v=o.makeCalcdata(n,"x"),m=g(n,o,"x",v),p=!!n.xperiodalignment,y="x"),h=m.vals;for(var l=Math.min(h.length,s.length),x=new Array(l),b=0,S,T=!1,M=0;M<l;M++){var w=s[M]||0,u=!1;(s[M]!==t||r(n.measure[M])||e(n.measure[M]))&&M+1<l&&(s[M+1]!==t||r(n.measure[M+1])||e(n.measure[M+1]))&&(u=!0);var f=x[M]={i:M,p:h[M],s:w,rawS:w,cNext:u};e(n.measure[M])?(b=f.s,f.isSum=!0,f.dir="totals",f.s=b):r(n.measure[M])?(f.isSum=!0,f.dir="totals",f.s=b):(f.isSum=!1,f.dir=f.rawS<0?"decreasing":"increasing",S=f.s,f.s=b+S,b+=S),f.dir==="totals"&&(T=!0),p&&(x[M].orig_p=v[M],x[M][y+"End"]=m.ends[M],x[M][y+"Start"]=m.starts[M]),n.ids&&(f.id=String(n.ids[M])),f.v=(n.base||0)+b}return x.length&&(x[0].hasTotals=T),E(n.text,x,"tx"),E(n.hovertext,x,"htx"),A(x,n),x}}),MM=Vt((X,V)=>{var c=p0().setGroupPositions;V.exports=function(g,E){var A=g._fullLayout,t=g._fullData,e=g.calcdata,r=E.xaxis,i=E.yaxis,n=[],o=[],a=[],s,h;for(h=0;h<t.length;h++){var v=t[h];v.visible===!0&&v.xaxis===r._id&&v.yaxis===i._id&&v.type==="waterfall"&&(s=e[h],v.orientation==="h"?a.push(s):o.push(s),n.push(s))}var m={mode:A.waterfallmode,norm:A.waterfallnorm,gap:A.waterfallgap,groupgap:A.waterfallgroupgap};for(c(g,r,i,o,m),c(g,i,r,a,m),h=0;h<n.length;h++){s=n[h];for(var p=0;p<s.length;p++){var y=s[p];y.isSum===!1&&(y.s0+=p===0?0:s[p-1].s),p+1<s.length&&(s[p].nextP0=s[p+1].p0,s[p].nextS0=s[p+1].s0)}}}}),SM=Vt((X,V)=>{var c=Ai(),g=qr(),E=go(),A=ts().BADNUM,t=g0(),e=of().clearMinTextSize;V.exports=function(n,o,a,s){var h=n._fullLayout;e("waterfall",h),t.plot(n,o,a,s,{mode:h.waterfallmode,norm:h.waterfallmode,gap:h.waterfallgap,groupgap:h.waterfallgroupgap}),r(n,o,a,s)};function r(n,o,a,s){var h=o.xaxis,v=o.yaxis;g.makeTraceGroups(s,a,"trace bars").each(function(m){var p=c.select(this),y=m[0].trace,l=g.ensureSingle(p,"g","lines");if(!y.connector||!y.connector.visible){l.remove();return}var x=y.orientation==="h",b=y.connector.mode,S=l.selectAll("g.line").data(g.identity);S.enter().append("g").classed("line",!0),S.exit().remove();var T=S.size();S.each(function(M,w){if(!(w!==T-1&&!M.cNext)){var u=i(M,h,v,x),f=u[0],k=u[1],_="";f[0]!==A&&k[0]!==A&&f[1]!==A&&k[1]!==A&&(b==="spanning"&&!M.isSum&&w>0&&(x?_+="M"+f[0]+","+k[1]+"V"+k[0]:_+="M"+f[1]+","+k[0]+"H"+f[0]),b!=="between"&&(M.isSum||w<T-1)&&(x?_+="M"+f[1]+","+k[0]+"V"+k[1]:_+="M"+f[0]+","+k[1]+"H"+f[1]),f[2]!==A&&k[2]!==A&&(x?_+="M"+f[1]+","+k[1]+"V"+k[2]:_+="M"+f[1]+","+k[1]+"H"+f[2])),_===""&&(_="M0,0Z"),g.ensureSingle(c.select(this),"path").attr("d",_).call(E.setClipUrl,o.layerClipId,n)}})})}function i(n,o,a,s){var h=[],v=[],m=s?o:a,p=s?a:o;return h[0]=m.c2p(n.s0,!0),v[0]=p.c2p(n.p0,!0),h[1]=m.c2p(n.s1,!0),v[1]=p.c2p(n.p1,!0),h[2]=m.c2p(n.nextS0,!0),v[2]=p.c2p(n.nextP0,!0),s?[h,v]:[v,h]}}),EM=Vt((X,V)=>{var c=Ai(),g=go(),E=vi(),A=bd().DESELECTDIM,t=Gf(),e=of().resizeText,r=t.styleTextPoints;function i(n,o,a){var s=a||c.select(n).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");e(n,s,"waterfall"),s.style("opacity",function(h){return h[0].trace.opacity}),s.each(function(h){var v=c.select(this),m=h[0].trace;v.selectAll(".point > path").each(function(p){if(!p.isBlank){var y=m[p.dir].marker;c.select(this).call(E.fill,y.color).call(E.stroke,y.line.color).call(g.dashLine,y.line.dash,y.line.width).style("opacity",m.selectedpoints&&!p.selected?A:1)}}),r(v,m,n),v.selectAll(".lines").each(function(){var p=m.connector.line;g.lineGroupStyle(c.select(this).selectAll("path"),p.width,p.color,p.dash)})})}V.exports={style:i}}),PM=Vt((X,V)=>{var c=ao().hoverLabelText,g=vi().opacity,E=Pg().hoverOnBars,A=Cg(),t={increasing:A.INCREASING.SYMBOL,decreasing:A.DECREASING.SYMBOL};V.exports=function(r,i,n,o,a){var s=E(r,i,n,o,a);if(!s)return;var h=s.cd,v=h[0].trace,m=v.orientation==="h",p=m?"x":"y",y=m?r.xa:r.ya;function l(_){return c(y,_,v[p+"hoverformat"])}var x=s.index,b=h[x],S=b.isSum?b.b+b.s:b.rawS;s.initial=b.b+b.s-S,s.delta=S,s.final=s.initial+s.delta;var T=l(Math.abs(s.delta));s.deltaLabel=S<0?"("+T+")":T,s.finalLabel=l(s.final),s.initialLabel=l(s.initial);var M=b.hi||v.hoverinfo,w=[];if(M&&M!=="none"&&M!=="skip"){var u=M==="all",f=M.split("+"),k=function(_){return u||f.indexOf(_)!==-1};b.isSum||(k("final")&&(m?!k("x"):!k("y"))&&w.push(s.finalLabel),k("delta")&&(S<0?w.push(s.deltaLabel+" "+t.decreasing):w.push(s.deltaLabel+" "+t.increasing)),k("initial")&&w.push("Initial: "+s.initialLabel))}return w.length&&(s.extraText=w.join("<br>")),s.color=e(v,b),[s]};function e(r,i){var n=r[i.dir].marker,o=n.color,a=n.line.color,s=n.line.width;if(g(o))return o;if(g(a)&&s)return a}}),IM=Vt((X,V)=>{V.exports=function(c,g){return c.x="xVal"in g?g.xVal:g.x,c.y="yVal"in g?g.yVal:g.y,"initial"in g&&(c.initial=g.initial),"delta"in g&&(c.delta=g.delta),"final"in g&&(c.final=g.final),g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),c}}),LM=Vt((X,V)=>{V.exports={attributes:A2(),layoutAttributes:M2(),supplyDefaults:S2().supplyDefaults,crossTraceDefaults:S2().crossTraceDefaults,supplyLayoutDefaults:kM(),calc:AM(),crossTraceCalc:MM(),plot:SM(),style:EM().style,hoverPoints:PM(),eventData:IM(),selectPoints:Ig(),moduleType:"trace",name:"waterfall",basePlotModule:Pc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),CM=Vt((X,V)=>{V.exports=LM()}),Dg=Vt((X,V)=>{V.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(c){return c.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(c){return c.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(c){return c.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(c){var g=c.slice(0,3);return g[1]=g[1]+"%",g[2]=g[2]+"%",g},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(c){var g=c.slice(0,4);return g[1]=g[1]+"%",g[2]=g[2]+"%",g},suffix:["°","%","%",""]}}}}),E2=Vt((X,V)=>{var c=Ks(),g=Gu().zorder,E=Zo().hovertemplateAttrs,A=po().extendFlat,t=Dg().colormodel,e=["rgb","rgba","rgba256","hsl","hsla"],r=[],i=[];for(o=0;o<e.length;o++)n=t[e[o]],r.push("For the `"+e[o]+"` colormodel, it is ["+(n.zminDflt||n.min).join(", ")+"]."),i.push("For the `"+e[o]+"` colormodel, it is ["+(n.zmaxDflt||n.max).join(", ")+"].");var n,o;V.exports=A({source:{valType:"string",editType:"calc"},z:{valType:"data_array",editType:"calc"},colormodel:{valType:"enumerated",values:e,editType:"calc"},zsmooth:{valType:"enumerated",values:["fast",!1],dflt:!1,editType:"plot"},zmin:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},zmax:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dx:{valType:"number",dflt:1,editType:"calc"},dy:{valType:"number",dflt:1,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"data_array",editType:"plot"},hoverinfo:A({},c.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:E({},{keys:["z","color","colormodel"]}),zorder:g})}),DM=Vt((X,V)=>{var c=qr(),g=E2(),E=Dg(),A=Np().IMAGE_URL_PREFIX;V.exports=function(t,e){function r(o,a){return c.coerce(t,e,g,o,a)}r("source"),e.source&&!e.source.match(A)&&delete e.source,e._hasSource=!!e.source;var i=r("z");if(e._hasZ=!(i===void 0||!i.length||!i[0]||!i[0].length),!e._hasZ&&!e._hasSource){e.visible=!1;return}r("x0"),r("y0"),r("dx"),r("dy");var n;e._hasZ?(r("colormodel","rgb"),n=E.colormodel[e.colormodel],r("zmin",n.zminDflt||n.min),r("zmax",n.zmaxDflt||n.max)):e._hasSource&&(e.colormodel="rgba256",n=E.colormodel[e.colormodel],e.zmin=n.zminDflt,e.zmax=n.zmaxDflt),r("zsmooth"),r("text"),r("hovertext"),r("hovertemplate"),e._length=null,r("zorder")}}),Up=Vt((X,V)=>{typeof Object.create=="function"?V.exports=function(c,g){g&&(c.super_=g,c.prototype=Object.create(g.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}))}:V.exports=function(c,g){if(g){c.super_=g;var E=function(){};E.prototype=g.prototype,c.prototype=new E,c.prototype.constructor=c}}}),P2=Vt((X,V)=>{V.exports=s0().EventEmitter}),zM=Vt(X=>{X.byteLength=r,X.toByteArray=n,X.fromByteArray=s;var V=[],c=[],g=typeof Uint8Array<"u"?Uint8Array:Array,E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(A=0,t=E.length;A<t;++A)V[A]=E[A],c[E.charCodeAt(A)]=A;var A,t;c[45]=62,c[95]=63;function e(h){var v=h.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var m=h.indexOf("=");m===-1&&(m=v);var p=m===v?0:4-m%4;return[m,p]}function r(h){var v=e(h),m=v[0],p=v[1];return(m+p)*3/4-p}function i(h,v,m){return(v+m)*3/4-m}function n(h){var v,m=e(h),p=m[0],y=m[1],l=new g(i(h,p,y)),x=0,b=y>0?p-4:p,S;for(S=0;S<b;S+=4)v=c[h.charCodeAt(S)]<<18|c[h.charCodeAt(S+1)]<<12|c[h.charCodeAt(S+2)]<<6|c[h.charCodeAt(S+3)],l[x++]=v>>16&255,l[x++]=v>>8&255,l[x++]=v&255;return y===2&&(v=c[h.charCodeAt(S)]<<2|c[h.charCodeAt(S+1)]>>4,l[x++]=v&255),y===1&&(v=c[h.charCodeAt(S)]<<10|c[h.charCodeAt(S+1)]<<4|c[h.charCodeAt(S+2)]>>2,l[x++]=v>>8&255,l[x++]=v&255),l}function o(h){return V[h>>18&63]+V[h>>12&63]+V[h>>6&63]+V[h&63]}function a(h,v,m){for(var p,y=[],l=v;l<m;l+=3)p=(h[l]<<16&16711680)+(h[l+1]<<8&65280)+(h[l+2]&255),y.push(o(p));return y.join("")}function s(h){for(var v,m=h.length,p=m%3,y=[],l=16383,x=0,b=m-p;x<b;x+=l)y.push(a(h,x,x+l>b?b:x+l));return p===1?(v=h[m-1],y.push(V[v>>2]+V[v<<4&63]+"==")):p===2&&(v=(h[m-2]<<8)+h[m-1],y.push(V[v>>10]+V[v>>4&63]+V[v<<2&63]+"=")),y.join("")}}),OM=Vt(X=>{X.read=function(V,c,g,E,A){var t,e,r=A*8-E-1,i=(1<<r)-1,n=i>>1,o=-7,a=g?A-1:0,s=g?-1:1,h=V[c+a];for(a+=s,t=h&(1<<-o)-1,h>>=-o,o+=r;o>0;t=t*256+V[c+a],a+=s,o-=8);for(e=t&(1<<-o)-1,t>>=-o,o+=E;o>0;e=e*256+V[c+a],a+=s,o-=8);if(t===0)t=1-n;else{if(t===i)return e?NaN:(h?-1:1)*(1/0);e=e+Math.pow(2,E),t=t-n}return(h?-1:1)*e*Math.pow(2,t-E)},X.write=function(V,c,g,E,A,t){var e,r,i,n=t*8-A-1,o=(1<<n)-1,a=o>>1,s=A===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=E?0:t-1,v=E?1:-1,m=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(r=isNaN(c)?1:0,e=o):(e=Math.floor(Math.log(c)/Math.LN2),c*(i=Math.pow(2,-e))<1&&(e--,i*=2),e+a>=1?c+=s/i:c+=s*Math.pow(2,1-a),c*i>=2&&(e++,i/=2),e+a>=o?(r=0,e=o):e+a>=1?(r=(c*i-1)*Math.pow(2,A),e=e+a):(r=c*Math.pow(2,a-1)*Math.pow(2,A),e=0));A>=8;V[g+h]=r&255,h+=v,r/=256,A-=8);for(e=e<<A|r,n+=A;n>0;V[g+h]=e&255,h+=v,e/=256,n-=8);V[g+h-v]|=m*128}}),m0=Vt(X=>{var V=zM(),c=OM(),g=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;X.Buffer=e,X.SlowBuffer=y,X.INSPECT_MAX_BYTES=50;var E=2147483647;X.kMaxLength=E,e.TYPED_ARRAY_SUPPORT=A(),!e.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function A(){try{let gt=new Uint8Array(1),bt={foo:function(){return 42}};return Object.setPrototypeOf(bt,Uint8Array.prototype),Object.setPrototypeOf(gt,bt),gt.foo()===42}catch{return!1}}Object.defineProperty(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}}),Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}});function t(gt){if(gt>E)throw new RangeError('The value "'+gt+'" is invalid for option "size"');let bt=new Uint8Array(gt);return Object.setPrototypeOf(bt,e.prototype),bt}function e(gt,bt,vt){if(typeof gt=="number"){if(typeof bt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return o(gt)}return r(gt,bt,vt)}e.poolSize=8192;function r(gt,bt,vt){if(typeof gt=="string")return a(gt,bt);if(ArrayBuffer.isView(gt))return h(gt);if(gt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof gt);if(Nt(gt,ArrayBuffer)||gt&&Nt(gt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Nt(gt,SharedArrayBuffer)||gt&&Nt(gt.buffer,SharedArrayBuffer)))return v(gt,bt,vt);if(typeof gt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let Ut=gt.valueOf&>.valueOf();if(Ut!=null&&Ut!==gt)return e.from(Ut,bt,vt);let Kt=m(gt);if(Kt)return Kt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof gt[Symbol.toPrimitive]=="function")return e.from(gt[Symbol.toPrimitive]("string"),bt,vt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof gt)}e.from=function(gt,bt,vt){return r(gt,bt,vt)},Object.setPrototypeOf(e.prototype,Uint8Array.prototype),Object.setPrototypeOf(e,Uint8Array);function i(gt){if(typeof gt!="number")throw new TypeError('"size" argument must be of type number');if(gt<0)throw new RangeError('The value "'+gt+'" is invalid for option "size"')}function n(gt,bt,vt){return i(gt),gt<=0?t(gt):bt!==void 0?typeof vt=="string"?t(gt).fill(bt,vt):t(gt).fill(bt):t(gt)}e.alloc=function(gt,bt,vt){return n(gt,bt,vt)};function o(gt){return i(gt),t(gt<0?0:p(gt)|0)}e.allocUnsafe=function(gt){return o(gt)},e.allocUnsafeSlow=function(gt){return o(gt)};function a(gt,bt){if((typeof bt!="string"||bt==="")&&(bt="utf8"),!e.isEncoding(bt))throw new TypeError("Unknown encoding: "+bt);let vt=l(gt,bt)|0,Ut=t(vt),Kt=Ut.write(gt,bt);return Kt!==vt&&(Ut=Ut.slice(0,Kt)),Ut}function s(gt){let bt=gt.length<0?0:p(gt.length)|0,vt=t(bt);for(let Ut=0;Ut<bt;Ut+=1)vt[Ut]=gt[Ut]&255;return vt}function h(gt){if(Nt(gt,Uint8Array)){let bt=new Uint8Array(gt);return v(bt.buffer,bt.byteOffset,bt.byteLength)}return s(gt)}function v(gt,bt,vt){if(bt<0||gt.byteLength<bt)throw new RangeError('"offset" is outside of buffer bounds');if(gt.byteLength<bt+(vt||0))throw new RangeError('"length" is outside of buffer bounds');let Ut;return bt===void 0&&vt===void 0?Ut=new Uint8Array(gt):vt===void 0?Ut=new Uint8Array(gt,bt):Ut=new Uint8Array(gt,bt,vt),Object.setPrototypeOf(Ut,e.prototype),Ut}function m(gt){if(e.isBuffer(gt)){let bt=p(gt.length)|0,vt=t(bt);return vt.length===0||gt.copy(vt,0,0,bt),vt}if(gt.length!==void 0)return typeof gt.length!="number"||te(gt.length)?t(0):s(gt);if(gt.type==="Buffer"&&Array.isArray(gt.data))return s(gt.data)}function p(gt){if(gt>=E)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+E.toString(16)+" bytes");return gt|0}function y(gt){return+gt!=gt&&(gt=0),e.alloc(+gt)}e.isBuffer=function(gt){return gt!=null&>._isBuffer===!0&>!==e.prototype},e.compare=function(gt,bt){if(Nt(gt,Uint8Array)&&(gt=e.from(gt,gt.offset,gt.byteLength)),Nt(bt,Uint8Array)&&(bt=e.from(bt,bt.offset,bt.byteLength)),!e.isBuffer(gt)||!e.isBuffer(bt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(gt===bt)return 0;let vt=gt.length,Ut=bt.length;for(let Kt=0,Zt=Math.min(vt,Ut);Kt<Zt;++Kt)if(gt[Kt]!==bt[Kt]){vt=gt[Kt],Ut=bt[Kt];break}return vt<Ut?-1:Ut<vt?1:0},e.isEncoding=function(gt){switch(String(gt).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},e.concat=function(gt,bt){if(!Array.isArray(gt))throw new TypeError('"list" argument must be an Array of Buffers');if(gt.length===0)return e.alloc(0);let vt;if(bt===void 0)for(bt=0,vt=0;vt<gt.length;++vt)bt+=gt[vt].length;let Ut=e.allocUnsafe(bt),Kt=0;for(vt=0;vt<gt.length;++vt){let Zt=gt[vt];if(Nt(Zt,Uint8Array))Kt+Zt.length>Ut.length?(e.isBuffer(Zt)||(Zt=e.from(Zt)),Zt.copy(Ut,Kt)):Uint8Array.prototype.set.call(Ut,Zt,Kt);else if(e.isBuffer(Zt))Zt.copy(Ut,Kt);else throw new TypeError('"list" argument must be an Array of Buffers');Kt+=Zt.length}return Ut};function l(gt,bt){if(e.isBuffer(gt))return gt.length;if(ArrayBuffer.isView(gt)||Nt(gt,ArrayBuffer))return gt.byteLength;if(typeof gt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof gt);let vt=gt.length,Ut=arguments.length>2&&arguments[2]===!0;if(!Ut&&vt===0)return 0;let Kt=!1;for(;;)switch(bt){case"ascii":case"latin1":case"binary":return vt;case"utf8":case"utf-8":return dt(gt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vt*2;case"hex":return vt>>>1;case"base64":return Ft(gt).length;default:if(Kt)return Ut?-1:dt(gt).length;bt=(""+bt).toLowerCase(),Kt=!0}}e.byteLength=l;function x(gt,bt,vt){let Ut=!1;if((bt===void 0||bt<0)&&(bt=0),bt>this.length||((vt===void 0||vt>this.length)&&(vt=this.length),vt<=0)||(vt>>>=0,bt>>>=0,vt<=bt))return"";for(gt||(gt="utf8");;)switch(gt){case"hex":return L(this,bt,vt);case"utf8":case"utf-8":return D(this,bt,vt);case"ascii":return B(this,bt,vt);case"latin1":case"binary":return R(this,bt,vt);case"base64":return _(this,bt,vt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,bt,vt);default:if(Ut)throw new TypeError("Unknown encoding: "+gt);gt=(gt+"").toLowerCase(),Ut=!0}}e.prototype._isBuffer=!0;function b(gt,bt,vt){let Ut=gt[bt];gt[bt]=gt[vt],gt[vt]=Ut}e.prototype.swap16=function(){let gt=this.length;if(gt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let bt=0;bt<gt;bt+=2)b(this,bt,bt+1);return this},e.prototype.swap32=function(){let gt=this.length;if(gt%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let bt=0;bt<gt;bt+=4)b(this,bt,bt+3),b(this,bt+1,bt+2);return this},e.prototype.swap64=function(){let gt=this.length;if(gt%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let bt=0;bt<gt;bt+=8)b(this,bt,bt+7),b(this,bt+1,bt+6),b(this,bt+2,bt+5),b(this,bt+3,bt+4);return this},e.prototype.toString=function(){let gt=this.length;return gt===0?"":arguments.length===0?D(this,0,gt):x.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(gt){if(!e.isBuffer(gt))throw new TypeError("Argument must be a Buffer");return this===gt?!0:e.compare(this,gt)===0},e.prototype.inspect=function(){let gt="",bt=X.INSPECT_MAX_BYTES;return gt=this.toString("hex",0,bt).replace(/(.{2})/g,"$1 ").trim(),this.length>bt&&(gt+=" ... "),"<Buffer "+gt+">"},g&&(e.prototype[g]=e.prototype.inspect),e.prototype.compare=function(gt,bt,vt,Ut,Kt){if(Nt(gt,Uint8Array)&&(gt=e.from(gt,gt.offset,gt.byteLength)),!e.isBuffer(gt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof gt);if(bt===void 0&&(bt=0),vt===void 0&&(vt=gt?gt.length:0),Ut===void 0&&(Ut=0),Kt===void 0&&(Kt=this.length),bt<0||vt>gt.length||Ut<0||Kt>this.length)throw new RangeError("out of range index");if(Ut>=Kt&&bt>=vt)return 0;if(Ut>=Kt)return-1;if(bt>=vt)return 1;if(bt>>>=0,vt>>>=0,Ut>>>=0,Kt>>>=0,this===gt)return 0;let Zt=Kt-Ut,le=vt-bt,Te=Math.min(Zt,le),Se=this.slice(Ut,Kt),Fe=gt.slice(bt,vt);for(let Oe=0;Oe<Te;++Oe)if(Se[Oe]!==Fe[Oe]){Zt=Se[Oe],le=Fe[Oe];break}return Zt<le?-1:le<Zt?1:0};function S(gt,bt,vt,Ut,Kt){if(gt.length===0)return-1;if(typeof vt=="string"?(Ut=vt,vt=0):vt>2147483647?vt=2147483647:vt<-2147483648&&(vt=-2147483648),vt=+vt,te(vt)&&(vt=Kt?0:gt.length-1),vt<0&&(vt=gt.length+vt),vt>=gt.length){if(Kt)return-1;vt=gt.length-1}else if(vt<0)if(Kt)vt=0;else return-1;if(typeof bt=="string"&&(bt=e.from(bt,Ut)),e.isBuffer(bt))return bt.length===0?-1:T(gt,bt,vt,Ut,Kt);if(typeof bt=="number")return bt=bt&255,typeof Uint8Array.prototype.indexOf=="function"?Kt?Uint8Array.prototype.indexOf.call(gt,bt,vt):Uint8Array.prototype.lastIndexOf.call(gt,bt,vt):T(gt,[bt],vt,Ut,Kt);throw new TypeError("val must be string, number or Buffer")}function T(gt,bt,vt,Ut,Kt){let Zt=1,le=gt.length,Te=bt.length;if(Ut!==void 0&&(Ut=String(Ut).toLowerCase(),Ut==="ucs2"||Ut==="ucs-2"||Ut==="utf16le"||Ut==="utf-16le")){if(gt.length<2||bt.length<2)return-1;Zt=2,le/=2,Te/=2,vt/=2}function Se(Oe,ur){return Zt===1?Oe[ur]:Oe.readUInt16BE(ur*Zt)}let Fe;if(Kt){let Oe=-1;for(Fe=vt;Fe<le;Fe++)if(Se(gt,Fe)===Se(bt,Oe===-1?0:Fe-Oe)){if(Oe===-1&&(Oe=Fe),Fe-Oe+1===Te)return Oe*Zt}else Oe!==-1&&(Fe-=Fe-Oe),Oe=-1}else for(vt+Te>le&&(vt=le-Te),Fe=vt;Fe>=0;Fe--){let Oe=!0;for(let ur=0;ur<Te;ur++)if(Se(gt,Fe+ur)!==Se(bt,ur)){Oe=!1;break}if(Oe)return Fe}return-1}e.prototype.includes=function(gt,bt,vt){return this.indexOf(gt,bt,vt)!==-1},e.prototype.indexOf=function(gt,bt,vt){return S(this,gt,bt,vt,!0)},e.prototype.lastIndexOf=function(gt,bt,vt){return S(this,gt,bt,vt,!1)};function M(gt,bt,vt,Ut){vt=Number(vt)||0;let Kt=gt.length-vt;Ut?(Ut=Number(Ut),Ut>Kt&&(Ut=Kt)):Ut=Kt;let Zt=bt.length;Ut>Zt/2&&(Ut=Zt/2);let le;for(le=0;le<Ut;++le){let Te=parseInt(bt.substr(le*2,2),16);if(te(Te))return le;gt[vt+le]=Te}return le}function w(gt,bt,vt,Ut){return Et(dt(bt,gt.length-vt),gt,vt,Ut)}function u(gt,bt,vt,Ut){return Et(wt(bt),gt,vt,Ut)}function f(gt,bt,vt,Ut){return Et(Ft(bt),gt,vt,Ut)}function k(gt,bt,vt,Ut){return Et(xt(bt,gt.length-vt),gt,vt,Ut)}e.prototype.write=function(gt,bt,vt,Ut){if(bt===void 0)Ut="utf8",vt=this.length,bt=0;else if(vt===void 0&&typeof bt=="string")Ut=bt,vt=this.length,bt=0;else if(isFinite(bt))bt=bt>>>0,isFinite(vt)?(vt=vt>>>0,Ut===void 0&&(Ut="utf8")):(Ut=vt,vt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Kt=this.length-bt;if((vt===void 0||vt>Kt)&&(vt=Kt),gt.length>0&&(vt<0||bt<0)||bt>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ut||(Ut="utf8");let Zt=!1;for(;;)switch(Ut){case"hex":return M(this,gt,bt,vt);case"utf8":case"utf-8":return w(this,gt,bt,vt);case"ascii":case"latin1":case"binary":return u(this,gt,bt,vt);case"base64":return f(this,gt,bt,vt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,gt,bt,vt);default:if(Zt)throw new TypeError("Unknown encoding: "+Ut);Ut=(""+Ut).toLowerCase(),Zt=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _(gt,bt,vt){return bt===0&&vt===gt.length?V.fromByteArray(gt):V.fromByteArray(gt.slice(bt,vt))}function D(gt,bt,vt){vt=Math.min(gt.length,vt);let Ut=[],Kt=bt;for(;Kt<vt;){let Zt=gt[Kt],le=null,Te=Zt>239?4:Zt>223?3:Zt>191?2:1;if(Kt+Te<=vt){let Se,Fe,Oe,ur;switch(Te){case 1:Zt<128&&(le=Zt);break;case 2:Se=gt[Kt+1],(Se&192)===128&&(ur=(Zt&31)<<6|Se&63,ur>127&&(le=ur));break;case 3:Se=gt[Kt+1],Fe=gt[Kt+2],(Se&192)===128&&(Fe&192)===128&&(ur=(Zt&15)<<12|(Se&63)<<6|Fe&63,ur>2047&&(ur<55296||ur>57343)&&(le=ur));break;case 4:Se=gt[Kt+1],Fe=gt[Kt+2],Oe=gt[Kt+3],(Se&192)===128&&(Fe&192)===128&&(Oe&192)===128&&(ur=(Zt&15)<<18|(Se&63)<<12|(Fe&63)<<6|Oe&63,ur>65535&&ur<1114112&&(le=ur))}}le===null?(le=65533,Te=1):le>65535&&(le-=65536,Ut.push(le>>>10&1023|55296),le=56320|le&1023),Ut.push(le),Kt+=Te}return O(Ut)}var I=4096;function O(gt){let bt=gt.length;if(bt<=I)return String.fromCharCode.apply(String,gt);let vt="",Ut=0;for(;Ut<bt;)vt+=String.fromCharCode.apply(String,gt.slice(Ut,Ut+=I));return vt}function B(gt,bt,vt){let Ut="";vt=Math.min(gt.length,vt);for(let Kt=bt;Kt<vt;++Kt)Ut+=String.fromCharCode(gt[Kt]&127);return Ut}function R(gt,bt,vt){let Ut="";vt=Math.min(gt.length,vt);for(let Kt=bt;Kt<vt;++Kt)Ut+=String.fromCharCode(gt[Kt]);return Ut}function L(gt,bt,vt){let Ut=gt.length;(!bt||bt<0)&&(bt=0),(!vt||vt<0||vt>Ut)&&(vt=Ut);let Kt="";for(let Zt=bt;Zt<vt;++Zt)Kt+=Jt[gt[Zt]];return Kt}function F(gt,bt,vt){let Ut=gt.slice(bt,vt),Kt="";for(let Zt=0;Zt<Ut.length-1;Zt+=2)Kt+=String.fromCharCode(Ut[Zt]+Ut[Zt+1]*256);return Kt}e.prototype.slice=function(gt,bt){let vt=this.length;gt=~~gt,bt=bt===void 0?vt:~~bt,gt<0?(gt+=vt,gt<0&&(gt=0)):gt>vt&&(gt=vt),bt<0?(bt+=vt,bt<0&&(bt=0)):bt>vt&&(bt=vt),bt<gt&&(bt=gt);let Ut=this.subarray(gt,bt);return Object.setPrototypeOf(Ut,e.prototype),Ut};function N(gt,bt,vt){if(gt%1!==0||gt<0)throw new RangeError("offset is not uint");if(gt+bt>vt)throw new RangeError("Trying to access beyond buffer length")}e.prototype.readUintLE=e.prototype.readUIntLE=function(gt,bt,vt){gt=gt>>>0,bt=bt>>>0,vt||N(gt,bt,this.length);let Ut=this[gt],Kt=1,Zt=0;for(;++Zt<bt&&(Kt*=256);)Ut+=this[gt+Zt]*Kt;return Ut},e.prototype.readUintBE=e.prototype.readUIntBE=function(gt,bt,vt){gt=gt>>>0,bt=bt>>>0,vt||N(gt,bt,this.length);let Ut=this[gt+--bt],Kt=1;for(;bt>0&&(Kt*=256);)Ut+=this[gt+--bt]*Kt;return Ut},e.prototype.readUint8=e.prototype.readUInt8=function(gt,bt){return gt=gt>>>0,bt||N(gt,1,this.length),this[gt]},e.prototype.readUint16LE=e.prototype.readUInt16LE=function(gt,bt){return gt=gt>>>0,bt||N(gt,2,this.length),this[gt]|this[gt+1]<<8},e.prototype.readUint16BE=e.prototype.readUInt16BE=function(gt,bt){return gt=gt>>>0,bt||N(gt,2,this.length),this[gt]<<8|this[gt+1]},e.prototype.readUint32LE=e.prototype.readUInt32LE=function(gt,bt){return gt=gt>>>0,bt||N(gt,4,this.length),(this[gt]|this[gt+1]<<8|this[gt+2]<<16)+this[gt+3]*16777216},e.prototype.readUint32BE=e.prototype.readUInt32BE=function(gt,bt){return gt=gt>>>0,bt||N(gt,4,this.length),this[gt]*16777216+(this[gt+1]<<16|this[gt+2]<<8|this[gt+3])},e.prototype.readBigUInt64LE=Qt(function(gt){gt=gt>>>0,Y(gt,"offset");let bt=this[gt],vt=this[gt+7];(bt===void 0||vt===void 0)&&q(gt,this.length-8);let Ut=bt+this[++gt]*2**8+this[++gt]*2**16+this[++gt]*2**24,Kt=this[++gt]+this[++gt]*2**8+this[++gt]*2**16+vt*2**24;return BigInt(Ut)+(BigInt(Kt)<<BigInt(32))}),e.prototype.readBigUInt64BE=Qt(function(gt){gt=gt>>>0,Y(gt,"offset");let bt=this[gt],vt=this[gt+7];(bt===void 0||vt===void 0)&&q(gt,this.length-8);let Ut=bt*2**24+this[++gt]*2**16+this[++gt]*2**8+this[++gt],Kt=this[++gt]*2**24+this[++gt]*2**16+this[++gt]*2**8+vt;return(BigInt(Ut)<<BigInt(32))+BigInt(Kt)}),e.prototype.readIntLE=function(gt,bt,vt){gt=gt>>>0,bt=bt>>>0,vt||N(gt,bt,this.length);let Ut=this[gt],Kt=1,Zt=0;for(;++Zt<bt&&(Kt*=256);)Ut+=this[gt+Zt]*Kt;return Kt*=128,Ut>=Kt&&(Ut-=Math.pow(2,8*bt)),Ut},e.prototype.readIntBE=function(gt,bt,vt){gt=gt>>>0,bt=bt>>>0,vt||N(gt,bt,this.length);let Ut=bt,Kt=1,Zt=this[gt+--Ut];for(;Ut>0&&(Kt*=256);)Zt+=this[gt+--Ut]*Kt;return Kt*=128,Zt>=Kt&&(Zt-=Math.pow(2,8*bt)),Zt},e.prototype.readInt8=function(gt,bt){return gt=gt>>>0,bt||N(gt,1,this.length),this[gt]&128?(255-this[gt]+1)*-1:this[gt]},e.prototype.readInt16LE=function(gt,bt){gt=gt>>>0,bt||N(gt,2,this.length);let vt=this[gt]|this[gt+1]<<8;return vt&32768?vt|4294901760:vt},e.prototype.readInt16BE=function(gt,bt){gt=gt>>>0,bt||N(gt,2,this.length);let vt=this[gt+1]|this[gt]<<8;return vt&32768?vt|4294901760:vt},e.prototype.readInt32LE=function(gt,bt){return gt=gt>>>0,bt||N(gt,4,this.length),this[gt]|this[gt+1]<<8|this[gt+2]<<16|this[gt+3]<<24},e.prototype.readInt32BE=function(gt,bt){return gt=gt>>>0,bt||N(gt,4,this.length),this[gt]<<24|this[gt+1]<<16|this[gt+2]<<8|this[gt+3]},e.prototype.readBigInt64LE=Qt(function(gt){gt=gt>>>0,Y(gt,"offset");let bt=this[gt],vt=this[gt+7];(bt===void 0||vt===void 0)&&q(gt,this.length-8);let Ut=this[gt+4]+this[gt+5]*2**8+this[gt+6]*2**16+(vt<<24);return(BigInt(Ut)<<BigInt(32))+BigInt(bt+this[++gt]*2**8+this[++gt]*2**16+this[++gt]*2**24)}),e.prototype.readBigInt64BE=Qt(function(gt){gt=gt>>>0,Y(gt,"offset");let bt=this[gt],vt=this[gt+7];(bt===void 0||vt===void 0)&&q(gt,this.length-8);let Ut=(bt<<24)+this[++gt]*2**16+this[++gt]*2**8+this[++gt];return(BigInt(Ut)<<BigInt(32))+BigInt(this[++gt]*2**24+this[++gt]*2**16+this[++gt]*2**8+vt)}),e.prototype.readFloatLE=function(gt,bt){return gt=gt>>>0,bt||N(gt,4,this.length),c.read(this,gt,!0,23,4)},e.prototype.readFloatBE=function(gt,bt){return gt=gt>>>0,bt||N(gt,4,this.length),c.read(this,gt,!1,23,4)},e.prototype.readDoubleLE=function(gt,bt){return gt=gt>>>0,bt||N(gt,8,this.length),c.read(this,gt,!0,52,8)},e.prototype.readDoubleBE=function(gt,bt){return gt=gt>>>0,bt||N(gt,8,this.length),c.read(this,gt,!1,52,8)};function j(gt,bt,vt,Ut,Kt,Zt){if(!e.isBuffer(gt))throw new TypeError('"buffer" argument must be a Buffer instance');if(bt>Kt||bt<Zt)throw new RangeError('"value" argument is out of bounds');if(vt+Ut>gt.length)throw new RangeError("Index out of range")}e.prototype.writeUintLE=e.prototype.writeUIntLE=function(gt,bt,vt,Ut){if(gt=+gt,bt=bt>>>0,vt=vt>>>0,!Ut){let le=Math.pow(2,8*vt)-1;j(this,gt,bt,vt,le,0)}let Kt=1,Zt=0;for(this[bt]=gt&255;++Zt<vt&&(Kt*=256);)this[bt+Zt]=gt/Kt&255;return bt+vt},e.prototype.writeUintBE=e.prototype.writeUIntBE=function(gt,bt,vt,Ut){if(gt=+gt,bt=bt>>>0,vt=vt>>>0,!Ut){let le=Math.pow(2,8*vt)-1;j(this,gt,bt,vt,le,0)}let Kt=vt-1,Zt=1;for(this[bt+Kt]=gt&255;--Kt>=0&&(Zt*=256);)this[bt+Kt]=gt/Zt&255;return bt+vt},e.prototype.writeUint8=e.prototype.writeUInt8=function(gt,bt,vt){return gt=+gt,bt=bt>>>0,vt||j(this,gt,bt,1,255,0),this[bt]=gt&255,bt+1},e.prototype.writeUint16LE=e.prototype.writeUInt16LE=function(gt,bt,vt){return gt=+gt,bt=bt>>>0,vt||j(this,gt,bt,2,65535,0),this[bt]=gt&255,this[bt+1]=gt>>>8,bt+2},e.prototype.writeUint16BE=e.prototype.writeUInt16BE=function(gt,bt,vt){return gt=+gt,bt=bt>>>0,vt||j(this,gt,bt,2,65535,0),this[bt]=gt>>>8,this[bt+1]=gt&255,bt+2},e.prototype.writeUint32LE=e.prototype.writeUInt32LE=function(gt,bt,vt){return gt=+gt,bt=bt>>>0,vt||j(this,gt,bt,4,4294967295,0),this[bt+3]=gt>>>24,this[bt+2]=gt>>>16,this[bt+1]=gt>>>8,this[bt]=gt&255,bt+4},e.prototype.writeUint32BE=e.prototype.writeUInt32BE=function(gt,bt,vt){return gt=+gt,bt=bt>>>0,vt||j(this,gt,bt,4,4294967295,0),this[bt]=gt>>>24,this[bt+1]=gt>>>16,this[bt+2]=gt>>>8,this[bt+3]=gt&255,bt+4};function G(gt,bt,vt,Ut,Kt){nt(bt,Ut,Kt,gt,vt,7);let Zt=Number(bt&BigInt(4294967295));gt[vt++]=Zt,Zt=Zt>>8,gt[vt++]=Zt,Zt=Zt>>8,gt[vt++]=Zt,Zt=Zt>>8,gt[vt++]=Zt;let le=Number(bt>>BigInt(32)&BigInt(4294967295));return gt[vt++]=le,le=le>>8,gt[vt++]=le,le=le>>8,gt[vt++]=le,le=le>>8,gt[vt++]=le,vt}function rt(gt,bt,vt,Ut,Kt){nt(bt,Ut,Kt,gt,vt,7);let Zt=Number(bt&BigInt(4294967295));gt[vt+7]=Zt,Zt=Zt>>8,gt[vt+6]=Zt,Zt=Zt>>8,gt[vt+5]=Zt,Zt=Zt>>8,gt[vt+4]=Zt;let le=Number(bt>>BigInt(32)&BigInt(4294967295));return gt[vt+3]=le,le=le>>8,gt[vt+2]=le,le=le>>8,gt[vt+1]=le,le=le>>8,gt[vt]=le,vt+8}e.prototype.writeBigUInt64LE=Qt(function(gt,bt=0){return G(this,gt,bt,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeBigUInt64BE=Qt(function(gt,bt=0){return rt(this,gt,bt,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeIntLE=function(gt,bt,vt,Ut){if(gt=+gt,bt=bt>>>0,!Ut){let Te=Math.pow(2,8*vt-1);j(this,gt,bt,vt,Te-1,-Te)}let Kt=0,Zt=1,le=0;for(this[bt]=gt&255;++Kt<vt&&(Zt*=256);)gt<0&&le===0&&this[bt+Kt-1]!==0&&(le=1),this[bt+Kt]=(gt/Zt>>0)-le&255;return bt+vt},e.prototype.writeIntBE=function(gt,bt,vt,Ut){if(gt=+gt,bt=bt>>>0,!Ut){let Te=Math.pow(2,8*vt-1);j(this,gt,bt,vt,Te-1,-Te)}let Kt=vt-1,Zt=1,le=0;for(this[bt+Kt]=gt&255;--Kt>=0&&(Zt*=256);)gt<0&&le===0&&this[bt+Kt+1]!==0&&(le=1),this[bt+Kt]=(gt/Zt>>0)-le&255;return bt+vt},e.prototype.writeInt8=function(gt,bt,vt){return gt=+gt,bt=bt>>>0,vt||j(this,gt,bt,1,127,-128),gt<0&&(gt=255+gt+1),this[bt]=gt&255,bt+1},e.prototype.writeInt16LE=function(gt,bt,vt){return gt=+gt,bt=bt>>>0,vt||j(this,gt,bt,2,32767,-32768),this[bt]=gt&255,this[bt+1]=gt>>>8,bt+2},e.prototype.writeInt16BE=function(gt,bt,vt){return gt=+gt,bt=bt>>>0,vt||j(this,gt,bt,2,32767,-32768),this[bt]=gt>>>8,this[bt+1]=gt&255,bt+2},e.prototype.writeInt32LE=function(gt,bt,vt){return gt=+gt,bt=bt>>>0,vt||j(this,gt,bt,4,2147483647,-2147483648),this[bt]=gt&255,this[bt+1]=gt>>>8,this[bt+2]=gt>>>16,this[bt+3]=gt>>>24,bt+4},e.prototype.writeInt32BE=function(gt,bt,vt){return gt=+gt,bt=bt>>>0,vt||j(this,gt,bt,4,2147483647,-2147483648),gt<0&&(gt=4294967295+gt+1),this[bt]=gt>>>24,this[bt+1]=gt>>>16,this[bt+2]=gt>>>8,this[bt+3]=gt&255,bt+4},e.prototype.writeBigInt64LE=Qt(function(gt,bt=0){return G(this,gt,bt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),e.prototype.writeBigInt64BE=Qt(function(gt,bt=0){return rt(this,gt,bt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ct(gt,bt,vt,Ut,Kt,Zt){if(vt+Ut>gt.length)throw new RangeError("Index out of range");if(vt<0)throw new RangeError("Index out of range")}function lt(gt,bt,vt,Ut,Kt){return bt=+bt,vt=vt>>>0,Kt||ct(gt,bt,vt,4),c.write(gt,bt,vt,Ut,23,4),vt+4}e.prototype.writeFloatLE=function(gt,bt,vt){return lt(this,gt,bt,!0,vt)},e.prototype.writeFloatBE=function(gt,bt,vt){return lt(this,gt,bt,!1,vt)};function tt(gt,bt,vt,Ut,Kt){return bt=+bt,vt=vt>>>0,Kt||ct(gt,bt,vt,8),c.write(gt,bt,vt,Ut,52,8),vt+8}e.prototype.writeDoubleLE=function(gt,bt,vt){return tt(this,gt,bt,!0,vt)},e.prototype.writeDoubleBE=function(gt,bt,vt){return tt(this,gt,bt,!1,vt)},e.prototype.copy=function(gt,bt,vt,Ut){if(!e.isBuffer(gt))throw new TypeError("argument should be a Buffer");if(vt||(vt=0),!Ut&&Ut!==0&&(Ut=this.length),bt>=gt.length&&(bt=gt.length),bt||(bt=0),Ut>0&&Ut<vt&&(Ut=vt),Ut===vt||gt.length===0||this.length===0)return 0;if(bt<0)throw new RangeError("targetStart out of bounds");if(vt<0||vt>=this.length)throw new RangeError("Index out of range");if(Ut<0)throw new RangeError("sourceEnd out of bounds");Ut>this.length&&(Ut=this.length),gt.length-bt<Ut-vt&&(Ut=gt.length-bt+vt);let Kt=Ut-vt;return this===gt&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(bt,vt,Ut):Uint8Array.prototype.set.call(gt,this.subarray(vt,Ut),bt),Kt},e.prototype.fill=function(gt,bt,vt,Ut){if(typeof gt=="string"){if(typeof bt=="string"?(Ut=bt,bt=0,vt=this.length):typeof vt=="string"&&(Ut=vt,vt=this.length),Ut!==void 0&&typeof Ut!="string")throw new TypeError("encoding must be a string");if(typeof Ut=="string"&&!e.isEncoding(Ut))throw new TypeError("Unknown encoding: "+Ut);if(gt.length===1){let Zt=gt.charCodeAt(0);(Ut==="utf8"&&Zt<128||Ut==="latin1")&&(gt=Zt)}}else typeof gt=="number"?gt=gt&255:typeof gt=="boolean"&&(gt=Number(gt));if(bt<0||this.length<bt||this.length<vt)throw new RangeError("Out of range index");if(vt<=bt)return this;bt=bt>>>0,vt=vt===void 0?this.length:vt>>>0,gt||(gt=0);let Kt;if(typeof gt=="number")for(Kt=bt;Kt<vt;++Kt)this[Kt]=gt;else{let Zt=e.isBuffer(gt)?gt:e.from(gt,Ut),le=Zt.length;if(le===0)throw new TypeError('The value "'+gt+'" is invalid for argument "value"');for(Kt=0;Kt<vt-bt;++Kt)this[Kt+bt]=Zt[Kt%le]}return this};var Z={};function st(gt,bt,vt){Z[gt]=class extends vt{constructor(){super(),Object.defineProperty(this,"message",{value:bt.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${gt}]`,this.stack,delete this.name}get code(){return gt}set code(Ut){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ut,writable:!0})}toString(){return`${this.name} [${gt}]: ${this.message}`}}}st("ERR_BUFFER_OUT_OF_BOUNDS",function(gt){return gt?`${gt} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),st("ERR_INVALID_ARG_TYPE",function(gt,bt){return`The "${gt}" argument must be of type number. Received type ${typeof bt}`},TypeError),st("ERR_OUT_OF_RANGE",function(gt,bt,vt){let Ut=`The value of "${gt}" is out of range.`,Kt=vt;return Number.isInteger(vt)&&Math.abs(vt)>2**32?Kt=$(String(vt)):typeof vt=="bigint"&&(Kt=String(vt),(vt>BigInt(2)**BigInt(32)||vt<-(BigInt(2)**BigInt(32)))&&(Kt=$(Kt)),Kt+="n"),Ut+=` It must be ${bt}. Received ${Kt}`,Ut},RangeError);function $(gt){let bt="",vt=gt.length,Ut=gt[0]==="-"?1:0;for(;vt>=Ut+4;vt-=3)bt=`_${gt.slice(vt-3,vt)}${bt}`;return`${gt.slice(0,vt)}${bt}`}function Q(gt,bt,vt){Y(bt,"offset"),(gt[bt]===void 0||gt[bt+vt]===void 0)&&q(bt,gt.length-(vt+1))}function nt(gt,bt,vt,Ut,Kt,Zt){if(gt>vt||gt<bt){let le=typeof bt=="bigint"?"n":"",Te;throw bt===0||bt===BigInt(0)?Te=`>= 0${le} and < 2${le} ** ${(Zt+1)*8}${le}`:Te=`>= -(2${le} ** ${(Zt+1)*8-1}${le}) and < 2 ** ${(Zt+1)*8-1}${le}`,new Z.ERR_OUT_OF_RANGE("value",Te,gt)}Q(Ut,Kt,Zt)}function Y(gt,bt){if(typeof gt!="number")throw new Z.ERR_INVALID_ARG_TYPE(bt,"number",gt)}function q(gt,bt,vt){throw Math.floor(gt)!==gt?(Y(gt,vt),new Z.ERR_OUT_OF_RANGE("offset","an integer",gt)):bt<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${bt}`,gt)}var ot=/[^+/0-9A-Za-z-_]/g;function it(gt){if(gt=gt.split("=")[0],gt=gt.trim().replace(ot,""),gt.length<2)return"";for(;gt.length%4!==0;)gt=gt+"=";return gt}function dt(gt,bt){bt=bt||1/0;let vt,Ut=gt.length,Kt=null,Zt=[];for(let le=0;le<Ut;++le){if(vt=gt.charCodeAt(le),vt>55295&&vt<57344){if(!Kt){if(vt>56319){(bt-=3)>-1&&Zt.push(239,191,189);continue}else if(le+1===Ut){(bt-=3)>-1&&Zt.push(239,191,189);continue}Kt=vt;continue}if(vt<56320){(bt-=3)>-1&&Zt.push(239,191,189),Kt=vt;continue}vt=(Kt-55296<<10|vt-56320)+65536}else Kt&&(bt-=3)>-1&&Zt.push(239,191,189);if(Kt=null,vt<128){if((bt-=1)<0)break;Zt.push(vt)}else if(vt<2048){if((bt-=2)<0)break;Zt.push(vt>>6|192,vt&63|128)}else if(vt<65536){if((bt-=3)<0)break;Zt.push(vt>>12|224,vt>>6&63|128,vt&63|128)}else if(vt<1114112){if((bt-=4)<0)break;Zt.push(vt>>18|240,vt>>12&63|128,vt>>6&63|128,vt&63|128)}else throw new Error("Invalid code point")}return Zt}function wt(gt){let bt=[];for(let vt=0;vt<gt.length;++vt)bt.push(gt.charCodeAt(vt)&255);return bt}function xt(gt,bt){let vt,Ut,Kt,Zt=[];for(let le=0;le<gt.length&&!((bt-=2)<0);++le)vt=gt.charCodeAt(le),Ut=vt>>8,Kt=vt%256,Zt.push(Kt),Zt.push(Ut);return Zt}function Ft(gt){return V.toByteArray(it(gt))}function Et(gt,bt,vt,Ut){let Kt;for(Kt=0;Kt<Ut&&!(Kt+vt>=bt.length||Kt>=gt.length);++Kt)bt[Kt+vt]=gt[Kt];return Kt}function Nt(gt,bt){return gt instanceof bt||gt!=null&>.constructor!=null&>.constructor.name!=null&>.constructor.name===bt.name}function te(gt){return gt!==gt}var Jt=function(){let gt="0123456789abcdef",bt=new Array(256);for(let vt=0;vt<16;++vt){let Ut=vt*16;for(let Kt=0;Kt<16;++Kt)bt[Ut+Kt]=gt[vt]+gt[Kt]}return bt}();function Qt(gt){return typeof BigInt>"u"?Wt:gt}function Wt(){throw new Error("BigInt not supported")}}),D1=Vt((X,V)=>{V.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var c={},g=Symbol("test"),E=Object(g);if(typeof g=="string"||Object.prototype.toString.call(g)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var A=42;c[g]=A;for(g in c)return!1;if(typeof Object.keys=="function"&&Object.keys(c).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(c).length!==0)return!1;var t=Object.getOwnPropertySymbols(c);if(t.length!==1||t[0]!==g||!Object.prototype.propertyIsEnumerable.call(c,g))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var e=Object.getOwnPropertyDescriptor(c,g);if(e.value!==A||e.enumerable!==!0)return!1}return!0}}),tv=Vt((X,V)=>{var c=D1();V.exports=function(){return c()&&!!Symbol.toStringTag}}),FM=Vt((X,V)=>{V.exports=Error}),BM=Vt((X,V)=>{V.exports=EvalError}),RM=Vt((X,V)=>{V.exports=RangeError}),jM=Vt((X,V)=>{V.exports=ReferenceError}),I2=Vt((X,V)=>{V.exports=SyntaxError}),ev=Vt((X,V)=>{V.exports=TypeError}),NM=Vt((X,V)=>{V.exports=URIError}),UM=Vt((X,V)=>{var c=typeof Symbol<"u"&&Symbol,g=D1();V.exports=function(){return typeof c!="function"||typeof Symbol!="function"||typeof c("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:g()}}),VM=Vt((X,V)=>{var c={foo:{}},g=Object;V.exports=function(){return{__proto__:c}.foo===c.foo&&!({__proto__:null}instanceof g)}}),qM=Vt((X,V)=>{var c="Function.prototype.bind called on incompatible ",g=Object.prototype.toString,E=Math.max,A="[object Function]",t=function(i,n){for(var o=[],a=0;a<i.length;a+=1)o[a]=i[a];for(var s=0;s<n.length;s+=1)o[s+i.length]=n[s];return o},e=function(i,n){for(var o=[],a=n,s=0;a<i.length;a+=1,s+=1)o[s]=i[a];return o},r=function(i,n){for(var o="",a=0;a<i.length;a+=1)o+=i[a],a+1<i.length&&(o+=n);return o};V.exports=function(i){var n=this;if(typeof n!="function"||g.apply(n)!==A)throw new TypeError(c+n);for(var o=e(arguments,1),a,s=function(){if(this instanceof a){var y=n.apply(this,t(o,arguments));return Object(y)===y?y:this}return n.apply(i,t(o,arguments))},h=E(0,n.length-o.length),v=[],m=0;m<h;m++)v[m]="$"+m;if(a=Function("binder","return function ("+r(v,",")+"){ return binder.apply(this,arguments); }")(s),n.prototype){var p=function(){};p.prototype=n.prototype,a.prototype=new p,p.prototype=null}return a}}),z1=Vt((X,V)=>{var c=qM();V.exports=Function.prototype.bind||c}),HM=Vt((X,V)=>{var c=Function.prototype.call,g=Object.prototype.hasOwnProperty,E=z1();V.exports=E.call(c,g)}),zg=Vt((X,V)=>{var c,g=FM(),E=BM(),A=RM(),t=jM(),e=I2(),r=ev(),i=NM(),n=Function,o=function(L){try{return n('"use strict"; return ('+L+").constructor;")()}catch{}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch{a=null}var s=function(){throw new r},h=a?function(){try{return arguments.callee,s}catch{try{return a(arguments,"callee").get}catch{return s}}}():s,v=UM()(),m=VM()(),p=Object.getPrototypeOf||(m?function(L){return L.__proto__}:null),y={},l=typeof Uint8Array>"u"||!p?c:p(Uint8Array),x={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?c:ArrayBuffer,"%ArrayIteratorPrototype%":v&&p?p([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":typeof Atomics>"u"?c:Atomics,"%BigInt%":typeof BigInt>"u"?c:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?c:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?c:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":g,"%eval%":eval,"%EvalError%":E,"%Float32Array%":typeof Float32Array>"u"?c:Float32Array,"%Float64Array%":typeof Float64Array>"u"?c:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?c:FinalizationRegistry,"%Function%":n,"%GeneratorFunction%":y,"%Int8Array%":typeof Int8Array>"u"?c:Int8Array,"%Int16Array%":typeof Int16Array>"u"?c:Int16Array,"%Int32Array%":typeof Int32Array>"u"?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":v&&p?p(p([][Symbol.iterator]())):c,"%JSON%":typeof JSON=="object"?JSON:c,"%Map%":typeof Map>"u"?c:Map,"%MapIteratorPrototype%":typeof Map>"u"||!v||!p?c:p(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?c:Promise,"%Proxy%":typeof Proxy>"u"?c:Proxy,"%RangeError%":A,"%ReferenceError%":t,"%Reflect%":typeof Reflect>"u"?c:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?c:Set,"%SetIteratorPrototype%":typeof Set>"u"||!v||!p?c:p(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":v&&p?p(""[Symbol.iterator]()):c,"%Symbol%":v?Symbol:c,"%SyntaxError%":e,"%ThrowTypeError%":h,"%TypedArray%":l,"%TypeError%":r,"%Uint8Array%":typeof Uint8Array>"u"?c:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?c:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?c:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?c:Uint32Array,"%URIError%":i,"%WeakMap%":typeof WeakMap>"u"?c:WeakMap,"%WeakRef%":typeof WeakRef>"u"?c:WeakRef,"%WeakSet%":typeof WeakSet>"u"?c:WeakSet};if(p)try{null.error}catch(L){b=p(p(L)),x["%Error.prototype%"]=b}var b,S=function L(F){var N;if(F==="%AsyncFunction%")N=o("async function () {}");else if(F==="%GeneratorFunction%")N=o("function* () {}");else if(F==="%AsyncGeneratorFunction%")N=o("async function* () {}");else if(F==="%AsyncGenerator%"){var j=L("%AsyncGeneratorFunction%");j&&(N=j.prototype)}else if(F==="%AsyncIteratorPrototype%"){var G=L("%AsyncGenerator%");G&&p&&(N=p(G.prototype))}return x[F]=N,N},T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},M=z1(),w=HM(),u=M.call(Function.call,Array.prototype.concat),f=M.call(Function.apply,Array.prototype.splice),k=M.call(Function.call,String.prototype.replace),_=M.call(Function.call,String.prototype.slice),D=M.call(Function.call,RegExp.prototype.exec),I=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,B=function(L){var F=_(L,0,1),N=_(L,-1);if(F==="%"&&N!=="%")throw new e("invalid intrinsic syntax, expected closing `%`");if(N==="%"&&F!=="%")throw new e("invalid intrinsic syntax, expected opening `%`");var j=[];return k(L,I,function(G,rt,ct,lt){j[j.length]=ct?k(lt,O,"$1"):rt||G}),j},R=function(L,F){var N=L,j;if(w(T,N)&&(j=T[N],N="%"+j[0]+"%"),w(x,N)){var G=x[N];if(G===y&&(G=S(N)),typeof G>"u"&&!F)throw new r("intrinsic "+L+" exists, but is not available. Please file an issue!");return{alias:j,name:N,value:G}}throw new e("intrinsic "+L+" does not exist!")};V.exports=function(L,F){if(typeof L!="string"||L.length===0)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof F!="boolean")throw new r('"allowMissing" argument must be a boolean');if(D(/^%?[^%]*%?$/,L)===null)throw new e("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var N=B(L),j=N.length>0?N[0]:"",G=R("%"+j+"%",F),rt=G.name,ct=G.value,lt=!1,tt=G.alias;tt&&(j=tt[0],f(N,u([0,1],tt)));for(var Z=1,st=!0;Z<N.length;Z+=1){var $=N[Z],Q=_($,0,1),nt=_($,-1);if((Q==='"'||Q==="'"||Q==="`"||nt==='"'||nt==="'"||nt==="`")&&Q!==nt)throw new e("property names with quotes must have matching quotes");if(($==="constructor"||!st)&&(lt=!0),j+="."+$,rt="%"+j+"%",w(x,rt))ct=x[rt];else if(ct!=null){if(!($ in ct)){if(!F)throw new r("base intrinsic for "+L+" exists, but the property is not available.");return}if(a&&Z+1>=N.length){var Y=a(ct,$);st=!!Y,st&&"get"in Y&&!("originalValue"in Y.get)?ct=Y.get:ct=ct[$]}else st=w(ct,$),ct=ct[$];st&&!lt&&(x[rt]=ct)}}return ct}}),O1=Vt((X,V)=>{var c=zg(),g=c("%Object.defineProperty%",!0)||!1;if(g)try{g({},"a",{value:1})}catch{g=!1}V.exports=g}),rv=Vt((X,V)=>{var c=zg(),g=c("%Object.getOwnPropertyDescriptor%",!0);if(g)try{g([],"length")}catch{g=null}V.exports=g}),GM=Vt((X,V)=>{var c=O1(),g=I2(),E=ev(),A=rv();V.exports=function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new E("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new E("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new E("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new E("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new E("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new E("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,s=!!A&&A(t,e);if(c)c(t,e,{configurable:o===null&&s?s.configurable:!o,enumerable:i===null&&s?s.enumerable:!i,value:r,writable:n===null&&s?s.writable:!n});else if(a||!i&&!n&&!o)t[e]=r;else throw new g("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),L2=Vt((X,V)=>{var c=O1(),g=function(){return!!c};g.hasArrayLengthDefineBug=function(){if(!c)return null;try{return c([],"length",{value:1}).length!==1}catch{return!0}},V.exports=g}),WM=Vt((X,V)=>{var c=zg(),g=GM(),E=L2()(),A=rv(),t=ev(),e=c("%Math.floor%");V.exports=function(r,i){if(typeof r!="function")throw new t("`fn` is not a function");if(typeof i!="number"||i<0||i>4294967295||e(i)!==i)throw new t("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,a=!0;if("length"in r&&A){var s=A(r,"length");s&&!s.configurable&&(o=!1),s&&!s.writable&&(a=!1)}return(o||a||!n)&&(E?g(r,"length",i,!0,!0):g(r,"length",i)),r}}),nv=Vt((X,V)=>{var c=z1(),g=zg(),E=WM(),A=ev(),t=g("%Function.prototype.apply%"),e=g("%Function.prototype.call%"),r=g("%Reflect.apply%",!0)||c.call(e,t),i=O1(),n=g("%Math.max%");V.exports=function(a){if(typeof a!="function")throw new A("a function is required");var s=r(c,e,arguments);return E(s,1+n(0,a.length-(arguments.length-1)),!0)};var o=function(){return r(c,t,arguments)};i?i(V.exports,"apply",{value:o}):V.exports.apply=o}),Og=Vt((X,V)=>{var c=zg(),g=nv(),E=g(c("String.prototype.indexOf"));V.exports=function(A,t){var e=c(A,!!t);return typeof e=="function"&&E(A,".prototype.")>-1?g(e):e}}),ZM=Vt((X,V)=>{var c=tv()(),g=Og(),E=g("Object.prototype.toString"),A=function(r){return c&&r&&typeof r=="object"&&Symbol.toStringTag in r?!1:E(r)==="[object Arguments]"},t=function(r){return A(r)?!0:r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&E(r)!=="[object Array]"&&E(r.callee)==="[object Function]"},e=function(){return A(arguments)}();A.isLegacyArguments=t,V.exports=e?A:t}),XM=Vt((X,V)=>{var c=Object.prototype.toString,g=Function.prototype.toString,E=/^\s*(?:function)?\*/,A=tv()(),t=Object.getPrototypeOf,e=function(){if(!A)return!1;try{return Function("return function*() {}")()}catch{}},r;V.exports=function(i){if(typeof i!="function")return!1;if(E.test(g.call(i)))return!0;if(!A){var n=c.call(i);return n==="[object GeneratorFunction]"}if(!t)return!1;if(typeof r>"u"){var o=e();r=o?t(o):!1}return t(i)===r}}),$M=Vt((X,V)=>{var c=Function.prototype.toString,g=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,E,A;if(typeof g=="function"&&typeof Object.defineProperty=="function")try{E=Object.defineProperty({},"length",{get:function(){throw A}}),A={},g(function(){throw 42},null,E)}catch(x){x!==A&&(g=null)}else g=null;var t=/^\s*class\b/,e=function(x){try{var b=c.call(x);return t.test(b)}catch{return!1}},r=function(x){try{return e(x)?!1:(c.call(x),!0)}catch{return!1}},i=Object.prototype.toString,n="[object Object]",o="[object Function]",a="[object GeneratorFunction]",s="[object HTMLAllCollection]",h="[object HTML document.all class]",v="[object HTMLCollection]",m=typeof Symbol=="function"&&!!Symbol.toStringTag,p=!(0 in[,]),y=function(){return!1};typeof document=="object"&&(l=document.all,i.call(l)===i.call(document.all)&&(y=function(x){if((p||!x)&&(typeof x>"u"||typeof x=="object"))try{var b=i.call(x);return(b===s||b===h||b===v||b===n)&&x("")==null}catch{}return!1}));var l;V.exports=g?function(x){if(y(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;try{g(x,null,E)}catch(b){if(b!==A)return!1}return!e(x)&&r(x)}:function(x){if(y(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;if(m)return r(x);if(e(x))return!1;var b=i.call(x);return b!==o&&b!==a&&!/^\[object HTML/.test(b)?!1:r(x)}}),C2=Vt((X,V)=>{var c=$M(),g=Object.prototype.toString,E=Object.prototype.hasOwnProperty,A=function(i,n,o){for(var a=0,s=i.length;a<s;a++)E.call(i,a)&&(o==null?n(i[a],a,i):n.call(o,i[a],a,i))},t=function(i,n,o){for(var a=0,s=i.length;a<s;a++)o==null?n(i.charAt(a),a,i):n.call(o,i.charAt(a),a,i)},e=function(i,n,o){for(var a in i)E.call(i,a)&&(o==null?n(i[a],a,i):n.call(o,i[a],a,i))},r=function(i,n,o){if(!c(n))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=o),g.call(i)==="[object Array]"?A(i,n,a):typeof i=="string"?t(i,n,a):e(i,n,a)};V.exports=r}),D2=Vt((X,V)=>{var c=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],g=typeof globalThis>"u"?window:globalThis;V.exports=function(){for(var E=[],A=0;A<c.length;A++)typeof g[c[A]]=="function"&&(E[E.length]=c[A]);return E}}),JM=Vt((X,V)=>{var c=C2(),g=D2(),E=nv(),A=Og(),t=rv(),e=A("Object.prototype.toString"),r=tv()(),i=typeof globalThis>"u"?window:globalThis,n=g(),o=A("String.prototype.slice"),a=Object.getPrototypeOf,s=A("Array.prototype.indexOf",!0)||function(p,y){for(var l=0;l<p.length;l+=1)if(p[l]===y)return l;return-1},h={__proto__:null};r&&t&&a?c(n,function(p){var y=new i[p];if(Symbol.toStringTag in y){var l=a(y),x=t(l,Symbol.toStringTag);if(!x){var b=a(l);x=t(b,Symbol.toStringTag)}h["$"+p]=E(x.get)}}):c(n,function(p){var y=new i[p],l=y.slice||y.set;l&&(h["$"+p]=E(l))});var v=function(p){var y=!1;return c(h,function(l,x){if(!y)try{"$"+l(p)===x&&(y=o(x,1))}catch{}}),y},m=function(p){var y=!1;return c(h,function(l,x){if(!y)try{l(p),y=o(x,1)}catch{}}),y};V.exports=function(p){if(!p||typeof p!="object")return!1;if(!r){var y=o(e(p),8,-1);return s(n,y)>-1?y:y!=="Object"?!1:m(p)}return t?v(p):null}}),QM=Vt((X,V)=>{var c=C2(),g=D2(),E=Og(),A=E("Object.prototype.toString"),t=tv()(),e=rv(),r=typeof globalThis>"u"?window:globalThis,i=g(),n=E("Array.prototype.indexOf",!0)||function(v,m){for(var p=0;p<v.length;p+=1)if(v[p]===m)return p;return-1},o=E("String.prototype.slice"),a={},s=Object.getPrototypeOf;t&&e&&s&&c(i,function(v){var m=new r[v];if(Symbol.toStringTag in m){var p=s(m),y=e(p,Symbol.toStringTag);if(!y){var l=s(p);y=e(l,Symbol.toStringTag)}a[v]=y.get}});var h=function(v){var m=!1;return c(a,function(p,y){if(!m)try{m=p.call(v)===y}catch{}}),m};V.exports=function(v){if(!v||typeof v!="object")return!1;if(!t||!(Symbol.toStringTag in v)){var m=o(A(v),8,-1);return n(i,m)>-1}return e?h(v):!1}}),z2=Vt(X=>{var V=ZM(),c=XM(),g=JM(),E=QM();function A(xt){return xt.call.bind(xt)}var t=typeof BigInt<"u",e=typeof Symbol<"u",r=A(Object.prototype.toString),i=A(Number.prototype.valueOf),n=A(String.prototype.valueOf),o=A(Boolean.prototype.valueOf);t&&(a=A(BigInt.prototype.valueOf));var a;e&&(s=A(Symbol.prototype.valueOf));var s;function h(xt,Ft){if(typeof xt!="object")return!1;try{return Ft(xt),!0}catch{return!1}}X.isArgumentsObject=V,X.isGeneratorFunction=c,X.isTypedArray=E;function v(xt){return typeof Promise<"u"&&xt instanceof Promise||xt!==null&&typeof xt=="object"&&typeof xt.then=="function"&&typeof xt.catch=="function"}X.isPromise=v;function m(xt){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(xt):E(xt)||G(xt)}X.isArrayBufferView=m;function p(xt){return g(xt)==="Uint8Array"}X.isUint8Array=p;function y(xt){return g(xt)==="Uint8ClampedArray"}X.isUint8ClampedArray=y;function l(xt){return g(xt)==="Uint16Array"}X.isUint16Array=l;function x(xt){return g(xt)==="Uint32Array"}X.isUint32Array=x;function b(xt){return g(xt)==="Int8Array"}X.isInt8Array=b;function S(xt){return g(xt)==="Int16Array"}X.isInt16Array=S;function T(xt){return g(xt)==="Int32Array"}X.isInt32Array=T;function M(xt){return g(xt)==="Float32Array"}X.isFloat32Array=M;function w(xt){return g(xt)==="Float64Array"}X.isFloat64Array=w;function u(xt){return g(xt)==="BigInt64Array"}X.isBigInt64Array=u;function f(xt){return g(xt)==="BigUint64Array"}X.isBigUint64Array=f;function k(xt){return r(xt)==="[object Map]"}k.working=typeof Map<"u"&&k(new Map);function _(xt){return typeof Map>"u"?!1:k.working?k(xt):xt instanceof Map}X.isMap=_;function D(xt){return r(xt)==="[object Set]"}D.working=typeof Set<"u"&&D(new Set);function I(xt){return typeof Set>"u"?!1:D.working?D(xt):xt instanceof Set}X.isSet=I;function O(xt){return r(xt)==="[object WeakMap]"}O.working=typeof WeakMap<"u"&&O(new WeakMap);function B(xt){return typeof WeakMap>"u"?!1:O.working?O(xt):xt instanceof WeakMap}X.isWeakMap=B;function R(xt){return r(xt)==="[object WeakSet]"}R.working=typeof WeakSet<"u"&&R(new WeakSet);function L(xt){return R(xt)}X.isWeakSet=L;function F(xt){return r(xt)==="[object ArrayBuffer]"}F.working=typeof ArrayBuffer<"u"&&F(new ArrayBuffer);function N(xt){return typeof ArrayBuffer>"u"?!1:F.working?F(xt):xt instanceof ArrayBuffer}X.isArrayBuffer=N;function j(xt){return r(xt)==="[object DataView]"}j.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&j(new DataView(new ArrayBuffer(1),0,1));function G(xt){return typeof DataView>"u"?!1:j.working?j(xt):xt instanceof DataView}X.isDataView=G;var rt=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ct(xt){return r(xt)==="[object SharedArrayBuffer]"}function lt(xt){return typeof rt>"u"?!1:(typeof ct.working>"u"&&(ct.working=ct(new rt)),ct.working?ct(xt):xt instanceof rt)}X.isSharedArrayBuffer=lt;function tt(xt){return r(xt)==="[object AsyncFunction]"}X.isAsyncFunction=tt;function Z(xt){return r(xt)==="[object Map Iterator]"}X.isMapIterator=Z;function st(xt){return r(xt)==="[object Set Iterator]"}X.isSetIterator=st;function $(xt){return r(xt)==="[object Generator]"}X.isGeneratorObject=$;function Q(xt){return r(xt)==="[object WebAssembly.Module]"}X.isWebAssemblyCompiledModule=Q;function nt(xt){return h(xt,i)}X.isNumberObject=nt;function Y(xt){return h(xt,n)}X.isStringObject=Y;function q(xt){return h(xt,o)}X.isBooleanObject=q;function ot(xt){return t&&h(xt,a)}X.isBigIntObject=ot;function it(xt){return e&&h(xt,s)}X.isSymbolObject=it;function dt(xt){return nt(xt)||Y(xt)||q(xt)||ot(xt)||it(xt)}X.isBoxedPrimitive=dt;function wt(xt){return typeof Uint8Array<"u"&&(N(xt)||lt(xt))}X.isAnyArrayBuffer=wt,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(xt){Object.defineProperty(X,xt,{enumerable:!1,value:function(){throw new Error(xt+" is not supported in userland")}})})}),O2=Vt((X,V)=>{V.exports=function(c){return c&&typeof c=="object"&&typeof c.copy=="function"&&typeof c.fill=="function"&&typeof c.readUInt8=="function"}}),F2=Vt(X=>{var V=Object.getOwnPropertyDescriptors||function(j){for(var G=Object.keys(j),rt={},ct=0;ct<G.length;ct++)rt[G[ct]]=Object.getOwnPropertyDescriptor(j,G[ct]);return rt},c=/%[sdj%]/g;X.format=function(j){if(!b(j)){for(var G=[],rt=0;rt<arguments.length;rt++)G.push(t(arguments[rt]));return G.join(" ")}for(var rt=1,ct=arguments,lt=ct.length,tt=String(j).replace(c,function($){if($==="%%")return"%";if(rt>=lt)return $;switch($){case"%s":return String(ct[rt++]);case"%d":return Number(ct[rt++]);case"%j":try{return JSON.stringify(ct[rt++])}catch{return"[Circular]"}default:return $}}),Z=ct[rt];rt<lt;Z=ct[++rt])y(Z)||!w(Z)?tt+=" "+Z:tt+=" "+t(Z);return tt},X.deprecate=function(j,G){if(typeof process<"u"&&process.noDeprecation===!0)return j;if(typeof process>"u")return function(){return X.deprecate(j,G).apply(this,arguments)};var rt=!1;function ct(){if(!rt){if(process.throwDeprecation)throw new Error(G);process.traceDeprecation?console.trace(G):console.error(G),rt=!0}return j.apply(this,arguments)}return ct};var g={},E=/^$/;A="false",A=A.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),E=new RegExp("^"+A+"$","i");var A;X.debuglog=function(j){if(j=j.toUpperCase(),!g[j])if(E.test(j)){var G=process.pid;g[j]=function(){var rt=X.format.apply(X,arguments);console.error("%s %d: %s",j,G,rt)}}else g[j]=function(){};return g[j]};function t(j,G){var rt={seen:[],stylize:r};return arguments.length>=3&&(rt.depth=arguments[2]),arguments.length>=4&&(rt.colors=arguments[3]),p(G)?rt.showHidden=G:G&&X._extend(rt,G),T(rt.showHidden)&&(rt.showHidden=!1),T(rt.depth)&&(rt.depth=2),T(rt.colors)&&(rt.colors=!1),T(rt.customInspect)&&(rt.customInspect=!0),rt.colors&&(rt.stylize=e),n(rt,j,rt.depth)}X.inspect=t,t.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},t.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function e(j,G){var rt=t.styles[G];return rt?"\x1B["+t.colors[rt][0]+"m"+j+"\x1B["+t.colors[rt][1]+"m":j}function r(j,G){return j}function i(j){var G={};return j.forEach(function(rt,ct){G[rt]=!0}),G}function n(j,G,rt){if(j.customInspect&&G&&k(G.inspect)&&G.inspect!==X.inspect&&!(G.constructor&&G.constructor.prototype===G)){var ct=G.inspect(rt,j);return b(ct)||(ct=n(j,ct,rt)),ct}var lt=o(j,G);if(lt)return lt;var tt=Object.keys(G),Z=i(tt);if(j.showHidden&&(tt=Object.getOwnPropertyNames(G)),f(G)&&(tt.indexOf("message")>=0||tt.indexOf("description")>=0))return a(G);if(tt.length===0){if(k(G)){var st=G.name?": "+G.name:"";return j.stylize("[Function"+st+"]","special")}if(M(G))return j.stylize(RegExp.prototype.toString.call(G),"regexp");if(u(G))return j.stylize(Date.prototype.toString.call(G),"date");if(f(G))return a(G)}var $="",Q=!1,nt=["{","}"];if(m(G)&&(Q=!0,nt=["[","]"]),k(G)){var Y=G.name?": "+G.name:"";$=" [Function"+Y+"]"}if(M(G)&&($=" "+RegExp.prototype.toString.call(G)),u(G)&&($=" "+Date.prototype.toUTCString.call(G)),f(G)&&($=" "+a(G)),tt.length===0&&(!Q||G.length==0))return nt[0]+$+nt[1];if(rt<0)return M(G)?j.stylize(RegExp.prototype.toString.call(G),"regexp"):j.stylize("[Object]","special");j.seen.push(G);var q;return Q?q=s(j,G,rt,Z,tt):q=tt.map(function(ot){return h(j,G,rt,Z,ot,Q)}),j.seen.pop(),v(q,$,nt)}function o(j,G){if(T(G))return j.stylize("undefined","undefined");if(b(G)){var rt="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return j.stylize(rt,"string")}if(x(G))return j.stylize(""+G,"number");if(p(G))return j.stylize(""+G,"boolean");if(y(G))return j.stylize("null","null")}function a(j){return"["+Error.prototype.toString.call(j)+"]"}function s(j,G,rt,ct,lt){for(var tt=[],Z=0,st=G.length;Z<st;++Z)R(G,String(Z))?tt.push(h(j,G,rt,ct,String(Z),!0)):tt.push("");return lt.forEach(function($){$.match(/^\d+$/)||tt.push(h(j,G,rt,ct,$,!0))}),tt}function h(j,G,rt,ct,lt,tt){var Z,st,$;if($=Object.getOwnPropertyDescriptor(G,lt)||{value:G[lt]},$.get?$.set?st=j.stylize("[Getter/Setter]","special"):st=j.stylize("[Getter]","special"):$.set&&(st=j.stylize("[Setter]","special")),R(ct,lt)||(Z="["+lt+"]"),st||(j.seen.indexOf($.value)<0?(y(rt)?st=n(j,$.value,null):st=n(j,$.value,rt-1),st.indexOf(`
|
||
`)>-1&&(tt?st=st.split(`
|
||
`).map(function(Q){return" "+Q}).join(`
|
||
`).slice(2):st=`
|
||
`+st.split(`
|
||
`).map(function(Q){return" "+Q}).join(`
|
||
`))):st=j.stylize("[Circular]","special")),T(Z)){if(tt&<.match(/^\d+$/))return st;Z=JSON.stringify(""+lt),Z.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Z=Z.slice(1,-1),Z=j.stylize(Z,"name")):(Z=Z.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Z=j.stylize(Z,"string"))}return Z+": "+st}function v(j,G,rt){var ct=0,lt=j.reduce(function(tt,Z){return ct++,Z.indexOf(`
|
||
`)>=0&&ct++,tt+Z.replace(/\u001b\[\d\d?m/g,"").length+1},0);return lt>60?rt[0]+(G===""?"":G+`
|
||
`)+" "+j.join(`,
|
||
`)+" "+rt[1]:rt[0]+G+" "+j.join(", ")+" "+rt[1]}X.types=z2();function m(j){return Array.isArray(j)}X.isArray=m;function p(j){return typeof j=="boolean"}X.isBoolean=p;function y(j){return j===null}X.isNull=y;function l(j){return j==null}X.isNullOrUndefined=l;function x(j){return typeof j=="number"}X.isNumber=x;function b(j){return typeof j=="string"}X.isString=b;function S(j){return typeof j=="symbol"}X.isSymbol=S;function T(j){return j===void 0}X.isUndefined=T;function M(j){return w(j)&&D(j)==="[object RegExp]"}X.isRegExp=M,X.types.isRegExp=M;function w(j){return typeof j=="object"&&j!==null}X.isObject=w;function u(j){return w(j)&&D(j)==="[object Date]"}X.isDate=u,X.types.isDate=u;function f(j){return w(j)&&(D(j)==="[object Error]"||j instanceof Error)}X.isError=f,X.types.isNativeError=f;function k(j){return typeof j=="function"}X.isFunction=k;function _(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}X.isPrimitive=_,X.isBuffer=O2();function D(j){return Object.prototype.toString.call(j)}function I(j){return j<10?"0"+j.toString(10):j.toString(10)}var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(){var j=new Date,G=[I(j.getHours()),I(j.getMinutes()),I(j.getSeconds())].join(":");return[j.getDate(),O[j.getMonth()],G].join(" ")}X.log=function(){console.log("%s - %s",B(),X.format.apply(X,arguments))},X.inherits=Up(),X._extend=function(j,G){if(!G||!w(G))return j;for(var rt=Object.keys(G),ct=rt.length;ct--;)j[rt[ct]]=G[rt[ct]];return j};function R(j,G){return Object.prototype.hasOwnProperty.call(j,G)}var L=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;X.promisify=function(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');if(L&&j[L]){var G=j[L];if(typeof G!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(G,L,{value:G,enumerable:!1,writable:!1,configurable:!0}),G}function G(){for(var rt,ct,lt=new Promise(function(st,$){rt=st,ct=$}),tt=[],Z=0;Z<arguments.length;Z++)tt.push(arguments[Z]);tt.push(function(st,$){st?ct(st):rt($)});try{j.apply(this,tt)}catch(st){ct(st)}return lt}return Object.setPrototypeOf(G,Object.getPrototypeOf(j)),L&&Object.defineProperty(G,L,{value:G,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(G,V(j))},X.promisify.custom=L;function F(j,G){if(!j){var rt=new Error("Promise was rejected with a falsy value");rt.reason=j,j=rt}return G(j)}function N(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');function G(){for(var rt=[],ct=0;ct<arguments.length;ct++)rt.push(arguments[ct]);var lt=rt.pop();if(typeof lt!="function")throw new TypeError("The last argument must be of type Function");var tt=this,Z=function(){return lt.apply(tt,arguments)};j.apply(this,rt).then(function(st){process.nextTick(Z.bind(null,null,st))},function(st){process.nextTick(F.bind(null,st,Z))})}return Object.setPrototypeOf(G,Object.getPrototypeOf(j)),Object.defineProperties(G,V(j)),G}X.callbackify=N}),YM=Vt((X,V)=>{function c(h,v){var m=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);v&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(h,y).enumerable})),m.push.apply(m,p)}return m}function g(h){for(var v=1;v<arguments.length;v++){var m=arguments[v]!=null?arguments[v]:{};v%2?c(Object(m),!0).forEach(function(p){E(h,p,m[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(m)):c(Object(m)).forEach(function(p){Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(m,p))})}return h}function E(h,v,m){return v in h?Object.defineProperty(h,v,{value:m,enumerable:!0,configurable:!0,writable:!0}):h[v]=m,h}function A(h,v){if(!(h instanceof v))throw new TypeError("Cannot call a class as a function")}function t(h,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}function e(h,v,m){return v&&t(h.prototype,v),h}var r=m0(),i=r.Buffer,n=F2(),o=n.inspect,a=o&&o.custom||"inspect";function s(h,v,m){i.prototype.copy.call(h,v,m)}V.exports=function(){function h(){A(this,h),this.head=null,this.tail=null,this.length=0}return e(h,[{key:"push",value:function(v){var m={data:v,next:null};this.length>0?this.tail.next=m:this.head=m,this.tail=m,++this.length}},{key:"unshift",value:function(v){var m={data:v,next:this.head};this.length===0&&(this.tail=m),this.head=m,++this.length}},{key:"shift",value:function(){if(this.length!==0){var v=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,v}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(v){if(this.length===0)return"";for(var m=this.head,p=""+m.data;m=m.next;)p+=v+m.data;return p}},{key:"concat",value:function(v){if(this.length===0)return i.alloc(0);for(var m=i.allocUnsafe(v>>>0),p=this.head,y=0;p;)s(p.data,m,y),y+=p.data.length,p=p.next;return m}},{key:"consume",value:function(v,m){var p;return v<this.head.data.length?(p=this.head.data.slice(0,v),this.head.data=this.head.data.slice(v)):v===this.head.data.length?p=this.shift():p=m?this._getString(v):this._getBuffer(v),p}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(v){var m=this.head,p=1,y=m.data;for(v-=y.length;m=m.next;){var l=m.data,x=v>l.length?l.length:v;if(x===l.length?y+=l:y+=l.slice(0,v),v-=x,v===0){x===l.length?(++p,m.next?this.head=m.next:this.head=this.tail=null):(this.head=m,m.data=l.slice(x));break}++p}return this.length-=p,y}},{key:"_getBuffer",value:function(v){var m=i.allocUnsafe(v),p=this.head,y=1;for(p.data.copy(m),v-=p.data.length;p=p.next;){var l=p.data,x=v>l.length?l.length:v;if(l.copy(m,m.length-v,0,x),v-=x,v===0){x===l.length?(++y,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=l.slice(x));break}++y}return this.length-=y,m}},{key:a,value:function(v,m){return o(this,g({},m,{depth:0,customInspect:!1}))}}]),h}()}),B2=Vt((X,V)=>{function c(r,i){var n=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(i?i(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(t,this,r)):process.nextTick(t,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s){!i&&s?n._writableState?n._writableState.errorEmitted?process.nextTick(E,n):(n._writableState.errorEmitted=!0,process.nextTick(g,n,s)):process.nextTick(g,n,s):i?(process.nextTick(E,n),i(s)):process.nextTick(E,n)}),this)}function g(r,i){t(r,i),E(r)}function E(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function A(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function t(r,i){r.emit("error",i)}function e(r,i){var n=r._readableState,o=r._writableState;n&&n.autoDestroy||o&&o.autoDestroy?r.destroy(i):r.emit("error",i)}V.exports={destroy:c,undestroy:A,errorOrDestroy:e}}),v0=Vt((X,V)=>{function c(i,n){i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.__proto__=n}var g={};function E(i,n,o){o||(o=Error);function a(h,v,m){return typeof n=="string"?n:n(h,v,m)}var s=function(h){c(v,h);function v(m,p,y){return h.call(this,a(m,p,y))||this}return v}(o);s.prototype.name=o.name,s.prototype.code=i,g[i]=s}function A(i,n){if(Array.isArray(i)){var o=i.length;return i=i.map(function(a){return String(a)}),o>2?"one of ".concat(n," ").concat(i.slice(0,o-1).join(", "),", or ")+i[o-1]:o===2?"one of ".concat(n," ").concat(i[0]," or ").concat(i[1]):"of ".concat(n," ").concat(i[0])}else return"of ".concat(n," ").concat(String(i))}function t(i,n,o){return i.substr(0,n.length)===n}function e(i,n,o){return(o===void 0||o>i.length)&&(o=i.length),i.substring(o-n.length,o)===n}function r(i,n,o){return typeof o!="number"&&(o=0),o+n.length>i.length?!1:i.indexOf(n,o)!==-1}E("ERR_INVALID_OPT_VALUE",function(i,n){return'The value "'+n+'" is invalid for option "'+i+'"'},TypeError),E("ERR_INVALID_ARG_TYPE",function(i,n,o){var a;typeof n=="string"&&t(n,"not ")?(a="must not be",n=n.replace(/^not /,"")):a="must be";var s;if(e(i," argument"))s="The ".concat(i," ").concat(a," ").concat(A(n,"type"));else{var h=r(i,".")?"property":"argument";s='The "'.concat(i,'" ').concat(h," ").concat(a," ").concat(A(n,"type"))}return s+=". Received type ".concat(typeof o),s},TypeError),E("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),E("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),E("ERR_STREAM_PREMATURE_CLOSE","Premature close"),E("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" after a stream was destroyed"}),E("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),E("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),E("ERR_STREAM_WRITE_AFTER_END","write after end"),E("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),E("ERR_UNKNOWN_ENCODING",function(i){return"Unknown encoding: "+i},TypeError),E("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),V.exports.codes=g}),R2=Vt((X,V)=>{var c=v0().codes.ERR_INVALID_OPT_VALUE;function g(A,t,e){return A.highWaterMark!=null?A.highWaterMark:t?A[e]:null}function E(A,t,e,r){var i=g(t,r,e);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var n=r?e:"highWaterMark";throw new c(n,i)}return Math.floor(i)}return A.objectMode?16:16*1024}V.exports={getHighWaterMark:E}}),KM=Vt((X,V)=>{V.exports=c;function c(E,A){if(g("noDeprecation"))return E;var t=!1;function e(){if(!t){if(g("throwDeprecation"))throw new Error(A);g("traceDeprecation")?console.trace(A):console.warn(A),t=!0}return E.apply(this,arguments)}return e}function g(E){try{if(!window.localStorage)return!1}catch{return!1}var A=window.localStorage[E];return A==null?!1:String(A).toLowerCase()==="true"}}),j2=Vt((X,V)=>{V.exports=u;function c(Z){var st=this;this.next=null,this.entry=null,this.finish=function(){tt(st,Z)}}var g;u.WritableState=M;var E={deprecate:KM()},A=P2(),t=m0().Buffer,e=window.Uint8Array||function(){};function r(Z){return t.from(Z)}function i(Z){return t.isBuffer(Z)||Z instanceof e}var n=B2(),o=R2(),a=o.getHighWaterMark,s=v0().codes,h=s.ERR_INVALID_ARG_TYPE,v=s.ERR_METHOD_NOT_IMPLEMENTED,m=s.ERR_MULTIPLE_CALLBACK,p=s.ERR_STREAM_CANNOT_PIPE,y=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,x=s.ERR_STREAM_WRITE_AFTER_END,b=s.ERR_UNKNOWN_ENCODING,S=n.errorOrDestroy;Up()(u,A);function T(){}function M(Z,st,$){g=g||y0(),Z=Z||{},typeof $!="boolean"&&($=st instanceof g),this.objectMode=!!Z.objectMode,$&&(this.objectMode=this.objectMode||!!Z.writableObjectMode),this.highWaterMark=a(this,Z,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Q=Z.decodeStrings===!1;this.decodeStrings=!Q,this.defaultEncoding=Z.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(nt){R(st,nt)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Z.emitClose!==!1,this.autoDestroy=!!Z.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}M.prototype.getBuffer=function(){for(var Z=this.bufferedRequest,st=[];Z;)st.push(Z),Z=Z.next;return st},function(){try{Object.defineProperty(M.prototype,"buffer",{get:E.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var w;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(u,Symbol.hasInstance,{value:function(Z){return w.call(this,Z)?!0:this!==u?!1:Z&&Z._writableState instanceof M}})):w=function(Z){return Z instanceof this};function u(Z){g=g||y0();var st=this instanceof g;if(!st&&!w.call(u,this))return new u(Z);this._writableState=new M(Z,this,st),this.writable=!0,Z&&(typeof Z.write=="function"&&(this._write=Z.write),typeof Z.writev=="function"&&(this._writev=Z.writev),typeof Z.destroy=="function"&&(this._destroy=Z.destroy),typeof Z.final=="function"&&(this._final=Z.final)),A.call(this)}u.prototype.pipe=function(){S(this,new p)};function f(Z,st){var $=new x;S(Z,$),process.nextTick(st,$)}function k(Z,st,$,Q){var nt;return $===null?nt=new l:typeof $!="string"&&!st.objectMode&&(nt=new h("chunk",["string","Buffer"],$)),nt?(S(Z,nt),process.nextTick(Q,nt),!1):!0}u.prototype.write=function(Z,st,$){var Q=this._writableState,nt=!1,Y=!Q.objectMode&&i(Z);return Y&&!t.isBuffer(Z)&&(Z=r(Z)),typeof st=="function"&&($=st,st=null),Y?st="buffer":st||(st=Q.defaultEncoding),typeof $!="function"&&($=T),Q.ending?f(this,$):(Y||k(this,Q,Z,$))&&(Q.pendingcb++,nt=D(this,Q,Y,Z,st,$)),nt},u.prototype.cork=function(){this._writableState.corked++},u.prototype.uncork=function(){var Z=this._writableState;Z.corked&&(Z.corked--,!Z.writing&&!Z.corked&&!Z.bufferProcessing&&Z.bufferedRequest&&N(this,Z))},u.prototype.setDefaultEncoding=function(Z){if(typeof Z=="string"&&(Z=Z.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Z+"").toLowerCase())>-1))throw new b(Z);return this._writableState.defaultEncoding=Z,this},Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function _(Z,st,$){return!Z.objectMode&&Z.decodeStrings!==!1&&typeof st=="string"&&(st=t.from(st,$)),st}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function D(Z,st,$,Q,nt,Y){if(!$){var q=_(st,Q,nt);Q!==q&&($=!0,nt="buffer",Q=q)}var ot=st.objectMode?1:Q.length;st.length+=ot;var it=st.length<st.highWaterMark;if(it||(st.needDrain=!0),st.writing||st.corked){var dt=st.lastBufferedRequest;st.lastBufferedRequest={chunk:Q,encoding:nt,isBuf:$,callback:Y,next:null},dt?dt.next=st.lastBufferedRequest:st.bufferedRequest=st.lastBufferedRequest,st.bufferedRequestCount+=1}else I(Z,st,!1,ot,Q,nt,Y);return it}function I(Z,st,$,Q,nt,Y,q){st.writelen=Q,st.writecb=q,st.writing=!0,st.sync=!0,st.destroyed?st.onwrite(new y("write")):$?Z._writev(nt,st.onwrite):Z._write(nt,Y,st.onwrite),st.sync=!1}function O(Z,st,$,Q,nt){--st.pendingcb,$?(process.nextTick(nt,Q),process.nextTick(ct,Z,st),Z._writableState.errorEmitted=!0,S(Z,Q)):(nt(Q),Z._writableState.errorEmitted=!0,S(Z,Q),ct(Z,st))}function B(Z){Z.writing=!1,Z.writecb=null,Z.length-=Z.writelen,Z.writelen=0}function R(Z,st){var $=Z._writableState,Q=$.sync,nt=$.writecb;if(typeof nt!="function")throw new m;if(B($),st)O(Z,$,Q,st,nt);else{var Y=j($)||Z.destroyed;!Y&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest&&N(Z,$),Q?process.nextTick(L,Z,$,Y,nt):L(Z,$,Y,nt)}}function L(Z,st,$,Q){$||F(Z,st),st.pendingcb--,Q(),ct(Z,st)}function F(Z,st){st.length===0&&st.needDrain&&(st.needDrain=!1,Z.emit("drain"))}function N(Z,st){st.bufferProcessing=!0;var $=st.bufferedRequest;if(Z._writev&&$&&$.next){var Q=st.bufferedRequestCount,nt=new Array(Q),Y=st.corkedRequestsFree;Y.entry=$;for(var q=0,ot=!0;$;)nt[q]=$,$.isBuf||(ot=!1),$=$.next,q+=1;nt.allBuffers=ot,I(Z,st,!0,st.length,nt,"",Y.finish),st.pendingcb++,st.lastBufferedRequest=null,Y.next?(st.corkedRequestsFree=Y.next,Y.next=null):st.corkedRequestsFree=new c(st),st.bufferedRequestCount=0}else{for(;$;){var it=$.chunk,dt=$.encoding,wt=$.callback,xt=st.objectMode?1:it.length;if(I(Z,st,!1,xt,it,dt,wt),$=$.next,st.bufferedRequestCount--,st.writing)break}$===null&&(st.lastBufferedRequest=null)}st.bufferedRequest=$,st.bufferProcessing=!1}u.prototype._write=function(Z,st,$){$(new v("_write()"))},u.prototype._writev=null,u.prototype.end=function(Z,st,$){var Q=this._writableState;return typeof Z=="function"?($=Z,Z=null,st=null):typeof st=="function"&&($=st,st=null),Z!=null&&this.write(Z,st),Q.corked&&(Q.corked=1,this.uncork()),Q.ending||lt(this,Q,$),this},Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function j(Z){return Z.ending&&Z.length===0&&Z.bufferedRequest===null&&!Z.finished&&!Z.writing}function G(Z,st){Z._final(function($){st.pendingcb--,$&&S(Z,$),st.prefinished=!0,Z.emit("prefinish"),ct(Z,st)})}function rt(Z,st){!st.prefinished&&!st.finalCalled&&(typeof Z._final=="function"&&!st.destroyed?(st.pendingcb++,st.finalCalled=!0,process.nextTick(G,Z,st)):(st.prefinished=!0,Z.emit("prefinish")))}function ct(Z,st){var $=j(st);if($&&(rt(Z,st),st.pendingcb===0&&(st.finished=!0,Z.emit("finish"),st.autoDestroy))){var Q=Z._readableState;(!Q||Q.autoDestroy&&Q.endEmitted)&&Z.destroy()}return $}function lt(Z,st,$){st.ending=!0,ct(Z,st),$&&(st.finished?process.nextTick($):Z.once("finish",$)),st.ended=!0,Z.writable=!1}function tt(Z,st,$){var Q=Z.entry;for(Z.entry=null;Q;){var nt=Q.callback;st.pendingcb--,nt($),Q=Q.next}st.corkedRequestsFree.next=Z}Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Z){this._writableState&&(this._writableState.destroyed=Z)}}),u.prototype.destroy=n.destroy,u.prototype._undestroy=n.undestroy,u.prototype._destroy=function(Z,st){st(Z)}}),y0=Vt((X,V)=>{var c=Object.keys||function(o){var a=[];for(var s in o)a.push(s);return a};V.exports=r;var g=U2(),E=j2();for(Up()(r,g),A=c(E.prototype),e=0;e<A.length;e++)t=A[e],r.prototype[t]||(r.prototype[t]=E.prototype[t]);var A,t,e;function r(o){if(!(this instanceof r))return new r(o);g.call(this,o),E.call(this,o),this.allowHalfOpen=!0,o&&(o.readable===!1&&(this.readable=!1),o.writable===!1&&(this.writable=!1),o.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",i)))}Object.defineProperty(r.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(r.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(r.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function i(){this._writableState.ended||process.nextTick(n,this)}function n(o){o.end()}Object.defineProperty(r.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(o){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=o,this._writableState.destroyed=o)}})}),t6=Vt((X,V)=>{var c=m0(),g=c.Buffer;function E(t,e){for(var r in t)e[r]=t[r]}g.from&&g.alloc&&g.allocUnsafe&&g.allocUnsafeSlow?V.exports=c:(E(c,X),X.Buffer=A);function A(t,e,r){return g(t,e,r)}A.prototype=Object.create(g.prototype),E(g,A),A.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return g(t,e,r)},A.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=g(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i},A.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return g(t)},A.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return c.SlowBuffer(t)}}),N2=Vt(X=>{var V=t6().Buffer,c=V.isEncoding||function(y){switch(y=""+y,y&&y.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function g(y){if(!y)return"utf8";for(var l;;)switch(y){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return y;default:if(l)return;y=(""+y).toLowerCase(),l=!0}}function E(y){var l=g(y);if(typeof l!="string"&&(V.isEncoding===c||!c(y)))throw new Error("Unknown encoding: "+y);return l||y}X.StringDecoder=A;function A(y){this.encoding=E(y);var l;switch(this.encoding){case"utf16le":this.text=a,this.end=s,l=4;break;case"utf8":this.fillLast=i,l=4;break;case"base64":this.text=h,this.end=v,l=3;break;default:this.write=m,this.end=p;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=V.allocUnsafe(l)}A.prototype.write=function(y){if(y.length===0)return"";var l,x;if(this.lastNeed){if(l=this.fillLast(y),l===void 0)return"";x=this.lastNeed,this.lastNeed=0}else x=0;return x<y.length?l?l+this.text(y,x):this.text(y,x):l||""},A.prototype.end=o,A.prototype.text=n,A.prototype.fillLast=function(y){if(this.lastNeed<=y.length)return y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,y.length),this.lastNeed-=y.length};function t(y){return y<=127?0:y>>5===6?2:y>>4===14?3:y>>3===30?4:y>>6===2?-1:-2}function e(y,l,x){var b=l.length-1;if(b<x)return 0;var S=t(l[b]);return S>=0?(S>0&&(y.lastNeed=S-1),S):--b<x||S===-2?0:(S=t(l[b]),S>=0?(S>0&&(y.lastNeed=S-2),S):--b<x||S===-2?0:(S=t(l[b]),S>=0?(S>0&&(S===2?S=0:y.lastNeed=S-3),S):0))}function r(y,l,x){if((l[0]&192)!==128)return y.lastNeed=0,"<22>";if(y.lastNeed>1&&l.length>1){if((l[1]&192)!==128)return y.lastNeed=1,"<22>";if(y.lastNeed>2&&l.length>2&&(l[2]&192)!==128)return y.lastNeed=2,"<22>"}}function i(y){var l=this.lastTotal-this.lastNeed,x=r(this,y);if(x!==void 0)return x;if(this.lastNeed<=y.length)return y.copy(this.lastChar,l,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,l,0,y.length),this.lastNeed-=y.length}function n(y,l){var x=e(this,y,l);if(!this.lastNeed)return y.toString("utf8",l);this.lastTotal=x;var b=y.length-(x-this.lastNeed);return y.copy(this.lastChar,0,b),y.toString("utf8",l,b)}function o(y){var l=y&&y.length?this.write(y):"";return this.lastNeed?l+"<22>":l}function a(y,l){if((y.length-l)%2===0){var x=y.toString("utf16le",l);if(x){var b=x.charCodeAt(x.length-1);if(b>=55296&&b<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=y[y.length-1],y.toString("utf16le",l,y.length-1)}function s(y){var l=y&&y.length?this.write(y):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return l+this.lastChar.toString("utf16le",0,x)}return l}function h(y,l){var x=(y.length-l)%3;return x===0?y.toString("base64",l):(this.lastNeed=3-x,this.lastTotal=3,x===1?this.lastChar[0]=y[y.length-1]:(this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1]),y.toString("base64",l,y.length-x))}function v(y){var l=y&&y.length?this.write(y):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function m(y){return y.toString(this.encoding)}function p(y){return y&&y.length?this.write(y):""}}),F1=Vt((X,V)=>{var c=v0().codes.ERR_STREAM_PREMATURE_CLOSE;function g(e){var r=!1;return function(){if(!r){r=!0;for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];e.apply(this,n)}}}function E(){}function A(e){return e.setHeader&&typeof e.abort=="function"}function t(e,r,i){if(typeof r=="function")return t(e,null,r);r||(r={}),i=g(i||E);var n=r.readable||r.readable!==!1&&e.readable,o=r.writable||r.writable!==!1&&e.writable,a=function(){e.writable||h()},s=e._writableState&&e._writableState.finished,h=function(){o=!1,s=!0,n||i.call(e)},v=e._readableState&&e._readableState.endEmitted,m=function(){n=!1,v=!0,o||i.call(e)},p=function(x){i.call(e,x)},y=function(){var x;if(n&&!v)return(!e._readableState||!e._readableState.ended)&&(x=new c),i.call(e,x);if(o&&!s)return(!e._writableState||!e._writableState.ended)&&(x=new c),i.call(e,x)},l=function(){e.req.on("finish",h)};return A(e)?(e.on("complete",h),e.on("abort",y),e.req?l():e.on("request",l)):o&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",m),e.on("finish",h),r.error!==!1&&e.on("error",p),e.on("close",y),function(){e.removeListener("complete",h),e.removeListener("abort",y),e.removeListener("request",l),e.req&&e.req.removeListener("finish",h),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",h),e.removeListener("end",m),e.removeListener("error",p),e.removeListener("close",y)}}V.exports=t}),e6=Vt((X,V)=>{var c;function g(l,x,b){return x in l?Object.defineProperty(l,x,{value:b,enumerable:!0,configurable:!0,writable:!0}):l[x]=b,l}var E=F1(),A=Symbol("lastResolve"),t=Symbol("lastReject"),e=Symbol("error"),r=Symbol("ended"),i=Symbol("lastPromise"),n=Symbol("handlePromise"),o=Symbol("stream");function a(l,x){return{value:l,done:x}}function s(l){var x=l[A];if(x!==null){var b=l[o].read();b!==null&&(l[i]=null,l[A]=null,l[t]=null,x(a(b,!1)))}}function h(l){process.nextTick(s,l)}function v(l,x){return function(b,S){l.then(function(){if(x[r]){b(a(void 0,!0));return}x[n](b,S)},S)}}var m=Object.getPrototypeOf(function(){}),p=Object.setPrototypeOf((c={get stream(){return this[o]},next:function(){var l=this,x=this[e];if(x!==null)return Promise.reject(x);if(this[r])return Promise.resolve(a(void 0,!0));if(this[o].destroyed)return new Promise(function(M,w){process.nextTick(function(){l[e]?w(l[e]):M(a(void 0,!0))})});var b=this[i],S;if(b)S=new Promise(v(b,this));else{var T=this[o].read();if(T!==null)return Promise.resolve(a(T,!1));S=new Promise(this[n])}return this[i]=S,S}},g(c,Symbol.asyncIterator,function(){return this}),g(c,"return",function(){var l=this;return new Promise(function(x,b){l[o].destroy(null,function(S){if(S){b(S);return}x(a(void 0,!0))})})}),c),m),y=function(l){var x,b=Object.create(p,(x={},g(x,o,{value:l,writable:!0}),g(x,A,{value:null,writable:!0}),g(x,t,{value:null,writable:!0}),g(x,e,{value:null,writable:!0}),g(x,r,{value:l._readableState.endEmitted,writable:!0}),g(x,n,{value:function(S,T){var M=b[o].read();M?(b[i]=null,b[A]=null,b[t]=null,S(a(M,!1))):(b[A]=S,b[t]=T)},writable:!0}),x));return b[i]=null,E(l,function(S){if(S&&S.code!=="ERR_STREAM_PREMATURE_CLOSE"){var T=b[t];T!==null&&(b[i]=null,b[A]=null,b[t]=null,T(S)),b[e]=S;return}var M=b[A];M!==null&&(b[i]=null,b[A]=null,b[t]=null,M(a(void 0,!0))),b[r]=!0}),l.on("readable",h.bind(null,b)),b};V.exports=y}),r6=Vt((X,V)=>{V.exports=function(){throw new Error("Readable.from is not available in the browser")}}),U2=Vt((X,V)=>{V.exports=f;var c;f.ReadableState=u,s0().EventEmitter;var g=function(Y,q){return Y.listeners(q).length},E=P2(),A=m0().Buffer,t=window.Uint8Array||function(){};function e(Y){return A.from(Y)}function r(Y){return A.isBuffer(Y)||Y instanceof t}var i=F2(),n;i&&i.debuglog?n=i.debuglog("stream"):n=function(){};var o=YM(),a=B2(),s=R2(),h=s.getHighWaterMark,v=v0().codes,m=v.ERR_INVALID_ARG_TYPE,p=v.ERR_STREAM_PUSH_AFTER_EOF,y=v.ERR_METHOD_NOT_IMPLEMENTED,l=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x,b,S;Up()(f,E);var T=a.errorOrDestroy,M=["error","close","destroy","pause","resume"];function w(Y,q,ot){if(typeof Y.prependListener=="function")return Y.prependListener(q,ot);!Y._events||!Y._events[q]?Y.on(q,ot):Array.isArray(Y._events[q])?Y._events[q].unshift(ot):Y._events[q]=[ot,Y._events[q]]}function u(Y,q,ot){c=c||y0(),Y=Y||{},typeof ot!="boolean"&&(ot=q instanceof c),this.objectMode=!!Y.objectMode,ot&&(this.objectMode=this.objectMode||!!Y.readableObjectMode),this.highWaterMark=h(this,Y,"readableHighWaterMark",ot),this.buffer=new o,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=Y.emitClose!==!1,this.autoDestroy=!!Y.autoDestroy,this.destroyed=!1,this.defaultEncoding=Y.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Y.encoding&&(x||(x=N2().StringDecoder),this.decoder=new x(Y.encoding),this.encoding=Y.encoding)}function f(Y){if(c=c||y0(),!(this instanceof f))return new f(Y);var q=this instanceof c;this._readableState=new u(Y,this,q),this.readable=!0,Y&&(typeof Y.read=="function"&&(this._read=Y.read),typeof Y.destroy=="function"&&(this._destroy=Y.destroy)),E.call(this)}Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Y){this._readableState&&(this._readableState.destroyed=Y)}}),f.prototype.destroy=a.destroy,f.prototype._undestroy=a.undestroy,f.prototype._destroy=function(Y,q){q(Y)},f.prototype.push=function(Y,q){var ot=this._readableState,it;return ot.objectMode?it=!0:typeof Y=="string"&&(q=q||ot.defaultEncoding,q!==ot.encoding&&(Y=A.from(Y,q),q=""),it=!0),k(this,Y,q,!1,it)},f.prototype.unshift=function(Y){return k(this,Y,null,!0,!1)};function k(Y,q,ot,it,dt){n("readableAddChunk",q);var wt=Y._readableState;if(q===null)wt.reading=!1,R(Y,wt);else{var xt;if(dt||(xt=D(wt,q)),xt)T(Y,xt);else if(wt.objectMode||q&&q.length>0)if(typeof q!="string"&&!wt.objectMode&&Object.getPrototypeOf(q)!==A.prototype&&(q=e(q)),it)wt.endEmitted?T(Y,new l):_(Y,wt,q,!0);else if(wt.ended)T(Y,new p);else{if(wt.destroyed)return!1;wt.reading=!1,wt.decoder&&!ot?(q=wt.decoder.write(q),wt.objectMode||q.length!==0?_(Y,wt,q,!1):N(Y,wt)):_(Y,wt,q,!1)}else it||(wt.reading=!1,N(Y,wt))}return!wt.ended&&(wt.length<wt.highWaterMark||wt.length===0)}function _(Y,q,ot,it){q.flowing&&q.length===0&&!q.sync?(q.awaitDrain=0,Y.emit("data",ot)):(q.length+=q.objectMode?1:ot.length,it?q.buffer.unshift(ot):q.buffer.push(ot),q.needReadable&&L(Y)),N(Y,q)}function D(Y,q){var ot;return!r(q)&&typeof q!="string"&&q!==void 0&&!Y.objectMode&&(ot=new m("chunk",["string","Buffer","Uint8Array"],q)),ot}f.prototype.isPaused=function(){return this._readableState.flowing===!1},f.prototype.setEncoding=function(Y){x||(x=N2().StringDecoder);var q=new x(Y);this._readableState.decoder=q,this._readableState.encoding=this._readableState.decoder.encoding;for(var ot=this._readableState.buffer.head,it="";ot!==null;)it+=q.write(ot.data),ot=ot.next;return this._readableState.buffer.clear(),it!==""&&this._readableState.buffer.push(it),this._readableState.length=it.length,this};var I=1073741824;function O(Y){return Y>=I?Y=I:(Y--,Y|=Y>>>1,Y|=Y>>>2,Y|=Y>>>4,Y|=Y>>>8,Y|=Y>>>16,Y++),Y}function B(Y,q){return Y<=0||q.length===0&&q.ended?0:q.objectMode?1:Y!==Y?q.flowing&&q.length?q.buffer.head.data.length:q.length:(Y>q.highWaterMark&&(q.highWaterMark=O(Y)),Y<=q.length?Y:q.ended?q.length:(q.needReadable=!0,0))}f.prototype.read=function(Y){n("read",Y),Y=parseInt(Y,10);var q=this._readableState,ot=Y;if(Y!==0&&(q.emittedReadable=!1),Y===0&&q.needReadable&&((q.highWaterMark!==0?q.length>=q.highWaterMark:q.length>0)||q.ended))return n("read: emitReadable",q.length,q.ended),q.length===0&&q.ended?$(this):L(this),null;if(Y=B(Y,q),Y===0&&q.ended)return q.length===0&&$(this),null;var it=q.needReadable;n("need readable",it),(q.length===0||q.length-Y<q.highWaterMark)&&(it=!0,n("length less than watermark",it)),q.ended||q.reading?(it=!1,n("reading or ended",it)):it&&(n("do read"),q.reading=!0,q.sync=!0,q.length===0&&(q.needReadable=!0),this._read(q.highWaterMark),q.sync=!1,q.reading||(Y=B(ot,q)));var dt;return Y>0?dt=st(Y,q):dt=null,dt===null?(q.needReadable=q.length<=q.highWaterMark,Y=0):(q.length-=Y,q.awaitDrain=0),q.length===0&&(q.ended||(q.needReadable=!0),ot!==Y&&q.ended&&$(this)),dt!==null&&this.emit("data",dt),dt};function R(Y,q){if(n("onEofChunk"),!q.ended){if(q.decoder){var ot=q.decoder.end();ot&&ot.length&&(q.buffer.push(ot),q.length+=q.objectMode?1:ot.length)}q.ended=!0,q.sync?L(Y):(q.needReadable=!1,q.emittedReadable||(q.emittedReadable=!0,F(Y)))}}function L(Y){var q=Y._readableState;n("emitReadable",q.needReadable,q.emittedReadable),q.needReadable=!1,q.emittedReadable||(n("emitReadable",q.flowing),q.emittedReadable=!0,process.nextTick(F,Y))}function F(Y){var q=Y._readableState;n("emitReadable_",q.destroyed,q.length,q.ended),!q.destroyed&&(q.length||q.ended)&&(Y.emit("readable"),q.emittedReadable=!1),q.needReadable=!q.flowing&&!q.ended&&q.length<=q.highWaterMark,Z(Y)}function N(Y,q){q.readingMore||(q.readingMore=!0,process.nextTick(j,Y,q))}function j(Y,q){for(;!q.reading&&!q.ended&&(q.length<q.highWaterMark||q.flowing&&q.length===0);){var ot=q.length;if(n("maybeReadMore read 0"),Y.read(0),ot===q.length)break}q.readingMore=!1}f.prototype._read=function(Y){T(this,new y("_read()"))},f.prototype.pipe=function(Y,q){var ot=this,it=this._readableState;switch(it.pipesCount){case 0:it.pipes=Y;break;case 1:it.pipes=[it.pipes,Y];break;default:it.pipes.push(Y);break}it.pipesCount+=1,n("pipe count=%d opts=%j",it.pipesCount,q);var dt=(!q||q.end!==!1)&&Y!==process.stdout&&Y!==process.stderr,wt=dt?Ft:bt;it.endEmitted?process.nextTick(wt):ot.once("end",wt),Y.on("unpipe",xt);function xt(vt,Ut){n("onunpipe"),vt===ot&&Ut&&Ut.hasUnpiped===!1&&(Ut.hasUnpiped=!0,te())}function Ft(){n("onend"),Y.end()}var Et=G(ot);Y.on("drain",Et);var Nt=!1;function te(){n("cleanup"),Y.removeListener("close",Wt),Y.removeListener("finish",gt),Y.removeListener("drain",Et),Y.removeListener("error",Qt),Y.removeListener("unpipe",xt),ot.removeListener("end",Ft),ot.removeListener("end",bt),ot.removeListener("data",Jt),Nt=!0,it.awaitDrain&&(!Y._writableState||Y._writableState.needDrain)&&Et()}ot.on("data",Jt);function Jt(vt){n("ondata");var Ut=Y.write(vt);n("dest.write",Ut),Ut===!1&&((it.pipesCount===1&&it.pipes===Y||it.pipesCount>1&&nt(it.pipes,Y)!==-1)&&!Nt&&(n("false write response, pause",it.awaitDrain),it.awaitDrain++),ot.pause())}function Qt(vt){n("onerror",vt),bt(),Y.removeListener("error",Qt),g(Y,"error")===0&&T(Y,vt)}w(Y,"error",Qt);function Wt(){Y.removeListener("finish",gt),bt()}Y.once("close",Wt);function gt(){n("onfinish"),Y.removeListener("close",Wt),bt()}Y.once("finish",gt);function bt(){n("unpipe"),ot.unpipe(Y)}return Y.emit("pipe",ot),it.flowing||(n("pipe resume"),ot.resume()),Y};function G(Y){return function(){var q=Y._readableState;n("pipeOnDrain",q.awaitDrain),q.awaitDrain&&q.awaitDrain--,q.awaitDrain===0&&g(Y,"data")&&(q.flowing=!0,Z(Y))}}f.prototype.unpipe=function(Y){var q=this._readableState,ot={hasUnpiped:!1};if(q.pipesCount===0)return this;if(q.pipesCount===1)return Y&&Y!==q.pipes?this:(Y||(Y=q.pipes),q.pipes=null,q.pipesCount=0,q.flowing=!1,Y&&Y.emit("unpipe",this,ot),this);if(!Y){var it=q.pipes,dt=q.pipesCount;q.pipes=null,q.pipesCount=0,q.flowing=!1;for(var wt=0;wt<dt;wt++)it[wt].emit("unpipe",this,{hasUnpiped:!1});return this}var xt=nt(q.pipes,Y);return xt===-1?this:(q.pipes.splice(xt,1),q.pipesCount-=1,q.pipesCount===1&&(q.pipes=q.pipes[0]),Y.emit("unpipe",this,ot),this)},f.prototype.on=function(Y,q){var ot=E.prototype.on.call(this,Y,q),it=this._readableState;return Y==="data"?(it.readableListening=this.listenerCount("readable")>0,it.flowing!==!1&&this.resume()):Y==="readable"&&!it.endEmitted&&!it.readableListening&&(it.readableListening=it.needReadable=!0,it.flowing=!1,it.emittedReadable=!1,n("on readable",it.length,it.reading),it.length?L(this):it.reading||process.nextTick(ct,this)),ot},f.prototype.addListener=f.prototype.on,f.prototype.removeListener=function(Y,q){var ot=E.prototype.removeListener.call(this,Y,q);return Y==="readable"&&process.nextTick(rt,this),ot},f.prototype.removeAllListeners=function(Y){var q=E.prototype.removeAllListeners.apply(this,arguments);return(Y==="readable"||Y===void 0)&&process.nextTick(rt,this),q};function rt(Y){var q=Y._readableState;q.readableListening=Y.listenerCount("readable")>0,q.resumeScheduled&&!q.paused?q.flowing=!0:Y.listenerCount("data")>0&&Y.resume()}function ct(Y){n("readable nexttick read 0"),Y.read(0)}f.prototype.resume=function(){var Y=this._readableState;return Y.flowing||(n("resume"),Y.flowing=!Y.readableListening,lt(this,Y)),Y.paused=!1,this};function lt(Y,q){q.resumeScheduled||(q.resumeScheduled=!0,process.nextTick(tt,Y,q))}function tt(Y,q){n("resume",q.reading),q.reading||Y.read(0),q.resumeScheduled=!1,Y.emit("resume"),Z(Y),q.flowing&&!q.reading&&Y.read(0)}f.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Z(Y){var q=Y._readableState;for(n("flow",q.flowing);q.flowing&&Y.read()!==null;);}f.prototype.wrap=function(Y){var q=this,ot=this._readableState,it=!1;Y.on("end",function(){if(n("wrapped end"),ot.decoder&&!ot.ended){var xt=ot.decoder.end();xt&&xt.length&&q.push(xt)}q.push(null)}),Y.on("data",function(xt){if(n("wrapped data"),ot.decoder&&(xt=ot.decoder.write(xt)),!(ot.objectMode&&xt==null)&&!(!ot.objectMode&&(!xt||!xt.length))){var Ft=q.push(xt);Ft||(it=!0,Y.pause())}});for(var dt in Y)this[dt]===void 0&&typeof Y[dt]=="function"&&(this[dt]=function(xt){return function(){return Y[xt].apply(Y,arguments)}}(dt));for(var wt=0;wt<M.length;wt++)Y.on(M[wt],this.emit.bind(this,M[wt]));return this._read=function(xt){n("wrapped _read",xt),it&&(it=!1,Y.resume())},this},typeof Symbol=="function"&&(f.prototype[Symbol.asyncIterator]=function(){return b===void 0&&(b=e6()),b(this)}),Object.defineProperty(f.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(f.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(f.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Y){this._readableState&&(this._readableState.flowing=Y)}}),f._fromList=st,Object.defineProperty(f.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function st(Y,q){if(q.length===0)return null;var ot;return q.objectMode?ot=q.buffer.shift():!Y||Y>=q.length?(q.decoder?ot=q.buffer.join(""):q.buffer.length===1?ot=q.buffer.first():ot=q.buffer.concat(q.length),q.buffer.clear()):ot=q.buffer.consume(Y,q.decoder),ot}function $(Y){var q=Y._readableState;n("endReadable",q.endEmitted),q.endEmitted||(q.ended=!0,process.nextTick(Q,q,Y))}function Q(Y,q){if(n("endReadableNT",Y.endEmitted,Y.length),!Y.endEmitted&&Y.length===0&&(Y.endEmitted=!0,q.readable=!1,q.emit("end"),Y.autoDestroy)){var ot=q._writableState;(!ot||ot.autoDestroy&&ot.finished)&&q.destroy()}}typeof Symbol=="function"&&(f.from=function(Y,q){return S===void 0&&(S=r6()),S(f,Y,q)});function nt(Y,q){for(var ot=0,it=Y.length;ot<it;ot++)if(Y[ot]===q)return ot;return-1}}),V2=Vt((X,V)=>{V.exports=i;var c=v0().codes,g=c.ERR_METHOD_NOT_IMPLEMENTED,E=c.ERR_MULTIPLE_CALLBACK,A=c.ERR_TRANSFORM_ALREADY_TRANSFORMING,t=c.ERR_TRANSFORM_WITH_LENGTH_0,e=y0();Up()(i,e);function r(a,s){var h=this._transformState;h.transforming=!1;var v=h.writecb;if(v===null)return this.emit("error",new E);h.writechunk=null,h.writecb=null,s!=null&&this.push(s),v(a);var m=this._readableState;m.reading=!1,(m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}function i(a){if(!(this instanceof i))return new i(a);e.call(this,a),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,a&&(typeof a.transform=="function"&&(this._transform=a.transform),typeof a.flush=="function"&&(this._flush=a.flush)),this.on("prefinish",n)}function n(){var a=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(s,h){o(a,s,h)}):o(this,null,null)}i.prototype.push=function(a,s){return this._transformState.needTransform=!1,e.prototype.push.call(this,a,s)},i.prototype._transform=function(a,s,h){h(new g("_transform()"))},i.prototype._write=function(a,s,h){var v=this._transformState;if(v.writecb=h,v.writechunk=a,v.writeencoding=s,!v.transforming){var m=this._readableState;(v.needTransform||m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}},i.prototype._read=function(a){var s=this._transformState;s.writechunk!==null&&!s.transforming?(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform)):s.needTransform=!0},i.prototype._destroy=function(a,s){e.prototype._destroy.call(this,a,function(h){s(h)})};function o(a,s,h){if(s)return a.emit("error",s);if(h!=null&&a.push(h),a._writableState.length)throw new t;if(a._transformState.transforming)throw new A;return a.push(null)}}),n6=Vt((X,V)=>{V.exports=g;var c=V2();Up()(g,c);function g(E){if(!(this instanceof g))return new g(E);c.call(this,E)}g.prototype._transform=function(E,A,t){t(null,E)}}),a6=Vt((X,V)=>{var c;function g(h){var v=!1;return function(){v||(v=!0,h.apply(void 0,arguments))}}var E=v0().codes,A=E.ERR_MISSING_ARGS,t=E.ERR_STREAM_DESTROYED;function e(h){if(h)throw h}function r(h){return h.setHeader&&typeof h.abort=="function"}function i(h,v,m,p){p=g(p);var y=!1;h.on("close",function(){y=!0}),c===void 0&&(c=F1()),c(h,{readable:v,writable:m},function(x){if(x)return p(x);y=!0,p()});var l=!1;return function(x){if(!y&&!l){if(l=!0,r(h))return h.abort();if(typeof h.destroy=="function")return h.destroy();p(x||new t("pipe"))}}}function n(h){h()}function o(h,v){return h.pipe(v)}function a(h){return!h.length||typeof h[h.length-1]!="function"?e:h.pop()}function s(){for(var h=arguments.length,v=new Array(h),m=0;m<h;m++)v[m]=arguments[m];var p=a(v);if(Array.isArray(v[0])&&(v=v[0]),v.length<2)throw new A("streams");var y,l=v.map(function(x,b){var S=b<v.length-1,T=b>0;return i(x,S,T,function(M){y||(y=M),M&&l.forEach(n),!S&&(l.forEach(n),p(y))})});return v.reduce(o)}V.exports=s}),i6=Vt((X,V)=>{V.exports=E;var c=s0().EventEmitter,g=Up();g(E,c),E.Readable=U2(),E.Writable=j2(),E.Duplex=y0(),E.Transform=V2(),E.PassThrough=n6(),E.finished=F1(),E.pipeline=a6(),E.Stream=E;function E(){c.call(this)}E.prototype.pipe=function(A,t){var e=this;function r(v){A.writable&&A.write(v)===!1&&e.pause&&e.pause()}e.on("data",r);function i(){e.readable&&e.resume&&e.resume()}A.on("drain",i),!A._isStdio&&(!t||t.end!==!1)&&(e.on("end",o),e.on("close",a));var n=!1;function o(){n||(n=!0,A.end())}function a(){n||(n=!0,typeof A.destroy=="function"&&A.destroy())}function s(v){if(h(),c.listenerCount(this,"error")===0)throw v}e.on("error",s),A.on("error",s);function h(){e.removeListener("data",r),A.removeListener("drain",i),e.removeListener("end",o),e.removeListener("close",a),e.removeListener("error",s),A.removeListener("error",s),e.removeListener("end",h),e.removeListener("close",h),A.removeListener("close",h)}return e.on("end",h),e.on("close",h),A.on("close",h),A.emit("pipe",e),A}}),Fg=Vt(X=>{var V=Object.getOwnPropertyDescriptors||function(j){for(var G=Object.keys(j),rt={},ct=0;ct<G.length;ct++)rt[G[ct]]=Object.getOwnPropertyDescriptor(j,G[ct]);return rt},c=/%[sdj%]/g;X.format=function(j){if(!b(j)){for(var G=[],rt=0;rt<arguments.length;rt++)G.push(t(arguments[rt]));return G.join(" ")}for(var rt=1,ct=arguments,lt=ct.length,tt=String(j).replace(c,function($){if($==="%%")return"%";if(rt>=lt)return $;switch($){case"%s":return String(ct[rt++]);case"%d":return Number(ct[rt++]);case"%j":try{return JSON.stringify(ct[rt++])}catch{return"[Circular]"}default:return $}}),Z=ct[rt];rt<lt;Z=ct[++rt])y(Z)||!w(Z)?tt+=" "+Z:tt+=" "+t(Z);return tt},X.deprecate=function(j,G){if(typeof process<"u"&&process.noDeprecation===!0)return j;if(typeof process>"u")return function(){return X.deprecate(j,G).apply(this,arguments)};var rt=!1;function ct(){if(!rt){if(process.throwDeprecation)throw new Error(G);process.traceDeprecation?console.trace(G):console.error(G),rt=!0}return j.apply(this,arguments)}return ct};var g={},E=/^$/;A="false",A=A.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),E=new RegExp("^"+A+"$","i");var A;X.debuglog=function(j){if(j=j.toUpperCase(),!g[j])if(E.test(j)){var G=process.pid;g[j]=function(){var rt=X.format.apply(X,arguments);console.error("%s %d: %s",j,G,rt)}}else g[j]=function(){};return g[j]};function t(j,G){var rt={seen:[],stylize:r};return arguments.length>=3&&(rt.depth=arguments[2]),arguments.length>=4&&(rt.colors=arguments[3]),p(G)?rt.showHidden=G:G&&X._extend(rt,G),T(rt.showHidden)&&(rt.showHidden=!1),T(rt.depth)&&(rt.depth=2),T(rt.colors)&&(rt.colors=!1),T(rt.customInspect)&&(rt.customInspect=!0),rt.colors&&(rt.stylize=e),n(rt,j,rt.depth)}X.inspect=t,t.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},t.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function e(j,G){var rt=t.styles[G];return rt?"\x1B["+t.colors[rt][0]+"m"+j+"\x1B["+t.colors[rt][1]+"m":j}function r(j,G){return j}function i(j){var G={};return j.forEach(function(rt,ct){G[rt]=!0}),G}function n(j,G,rt){if(j.customInspect&&G&&k(G.inspect)&&G.inspect!==X.inspect&&!(G.constructor&&G.constructor.prototype===G)){var ct=G.inspect(rt,j);return b(ct)||(ct=n(j,ct,rt)),ct}var lt=o(j,G);if(lt)return lt;var tt=Object.keys(G),Z=i(tt);if(j.showHidden&&(tt=Object.getOwnPropertyNames(G)),f(G)&&(tt.indexOf("message")>=0||tt.indexOf("description")>=0))return a(G);if(tt.length===0){if(k(G)){var st=G.name?": "+G.name:"";return j.stylize("[Function"+st+"]","special")}if(M(G))return j.stylize(RegExp.prototype.toString.call(G),"regexp");if(u(G))return j.stylize(Date.prototype.toString.call(G),"date");if(f(G))return a(G)}var $="",Q=!1,nt=["{","}"];if(m(G)&&(Q=!0,nt=["[","]"]),k(G)){var Y=G.name?": "+G.name:"";$=" [Function"+Y+"]"}if(M(G)&&($=" "+RegExp.prototype.toString.call(G)),u(G)&&($=" "+Date.prototype.toUTCString.call(G)),f(G)&&($=" "+a(G)),tt.length===0&&(!Q||G.length==0))return nt[0]+$+nt[1];if(rt<0)return M(G)?j.stylize(RegExp.prototype.toString.call(G),"regexp"):j.stylize("[Object]","special");j.seen.push(G);var q;return Q?q=s(j,G,rt,Z,tt):q=tt.map(function(ot){return h(j,G,rt,Z,ot,Q)}),j.seen.pop(),v(q,$,nt)}function o(j,G){if(T(G))return j.stylize("undefined","undefined");if(b(G)){var rt="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return j.stylize(rt,"string")}if(x(G))return j.stylize(""+G,"number");if(p(G))return j.stylize(""+G,"boolean");if(y(G))return j.stylize("null","null")}function a(j){return"["+Error.prototype.toString.call(j)+"]"}function s(j,G,rt,ct,lt){for(var tt=[],Z=0,st=G.length;Z<st;++Z)R(G,String(Z))?tt.push(h(j,G,rt,ct,String(Z),!0)):tt.push("");return lt.forEach(function($){$.match(/^\d+$/)||tt.push(h(j,G,rt,ct,$,!0))}),tt}function h(j,G,rt,ct,lt,tt){var Z,st,$;if($=Object.getOwnPropertyDescriptor(G,lt)||{value:G[lt]},$.get?$.set?st=j.stylize("[Getter/Setter]","special"):st=j.stylize("[Getter]","special"):$.set&&(st=j.stylize("[Setter]","special")),R(ct,lt)||(Z="["+lt+"]"),st||(j.seen.indexOf($.value)<0?(y(rt)?st=n(j,$.value,null):st=n(j,$.value,rt-1),st.indexOf(`
|
||
`)>-1&&(tt?st=st.split(`
|
||
`).map(function(Q){return" "+Q}).join(`
|
||
`).slice(2):st=`
|
||
`+st.split(`
|
||
`).map(function(Q){return" "+Q}).join(`
|
||
`))):st=j.stylize("[Circular]","special")),T(Z)){if(tt&<.match(/^\d+$/))return st;Z=JSON.stringify(""+lt),Z.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Z=Z.slice(1,-1),Z=j.stylize(Z,"name")):(Z=Z.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Z=j.stylize(Z,"string"))}return Z+": "+st}function v(j,G,rt){var ct=0,lt=j.reduce(function(tt,Z){return ct++,Z.indexOf(`
|
||
`)>=0&&ct++,tt+Z.replace(/\u001b\[\d\d?m/g,"").length+1},0);return lt>60?rt[0]+(G===""?"":G+`
|
||
`)+" "+j.join(`,
|
||
`)+" "+rt[1]:rt[0]+G+" "+j.join(", ")+" "+rt[1]}X.types=z2();function m(j){return Array.isArray(j)}X.isArray=m;function p(j){return typeof j=="boolean"}X.isBoolean=p;function y(j){return j===null}X.isNull=y;function l(j){return j==null}X.isNullOrUndefined=l;function x(j){return typeof j=="number"}X.isNumber=x;function b(j){return typeof j=="string"}X.isString=b;function S(j){return typeof j=="symbol"}X.isSymbol=S;function T(j){return j===void 0}X.isUndefined=T;function M(j){return w(j)&&D(j)==="[object RegExp]"}X.isRegExp=M,X.types.isRegExp=M;function w(j){return typeof j=="object"&&j!==null}X.isObject=w;function u(j){return w(j)&&D(j)==="[object Date]"}X.isDate=u,X.types.isDate=u;function f(j){return w(j)&&(D(j)==="[object Error]"||j instanceof Error)}X.isError=f,X.types.isNativeError=f;function k(j){return typeof j=="function"}X.isFunction=k;function _(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}X.isPrimitive=_,X.isBuffer=O2();function D(j){return Object.prototype.toString.call(j)}function I(j){return j<10?"0"+j.toString(10):j.toString(10)}var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(){var j=new Date,G=[I(j.getHours()),I(j.getMinutes()),I(j.getSeconds())].join(":");return[j.getDate(),O[j.getMonth()],G].join(" ")}X.log=function(){console.log("%s - %s",B(),X.format.apply(X,arguments))},X.inherits=Up(),X._extend=function(j,G){if(!G||!w(G))return j;for(var rt=Object.keys(G),ct=rt.length;ct--;)j[rt[ct]]=G[rt[ct]];return j};function R(j,G){return Object.prototype.hasOwnProperty.call(j,G)}var L=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;X.promisify=function(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');if(L&&j[L]){var G=j[L];if(typeof G!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(G,L,{value:G,enumerable:!1,writable:!1,configurable:!0}),G}function G(){for(var rt,ct,lt=new Promise(function(st,$){rt=st,ct=$}),tt=[],Z=0;Z<arguments.length;Z++)tt.push(arguments[Z]);tt.push(function(st,$){st?ct(st):rt($)});try{j.apply(this,tt)}catch(st){ct(st)}return lt}return Object.setPrototypeOf(G,Object.getPrototypeOf(j)),L&&Object.defineProperty(G,L,{value:G,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(G,V(j))},X.promisify.custom=L;function F(j,G){if(!j){var rt=new Error("Promise was rejected with a falsy value");rt.reason=j,j=rt}return G(j)}function N(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');function G(){for(var rt=[],ct=0;ct<arguments.length;ct++)rt.push(arguments[ct]);var lt=rt.pop();if(typeof lt!="function")throw new TypeError("The last argument must be of type Function");var tt=this,Z=function(){return lt.apply(tt,arguments)};j.apply(this,rt).then(function(st){process.nextTick(Z.bind(null,null,st))},function(st){process.nextTick(F.bind(null,st,Z))})}return Object.setPrototypeOf(G,Object.getPrototypeOf(j)),Object.defineProperties(G,V(j)),G}X.callbackify=N}),q2=Vt((X,V)=>{function c(x){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},c(x)}function g(x,b,S){return Object.defineProperty(x,"prototype",{writable:!1}),x}function E(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function A(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),Object.defineProperty(x,"prototype",{writable:!1}),b&&t(x,b)}function t(x,b){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,T){return S.__proto__=T,S},t(x,b)}function e(x){var b=n();return function(){var S=o(x),T;if(b){var M=o(this).constructor;T=Reflect.construct(S,arguments,M)}else T=S.apply(this,arguments);return r(this,T)}}function r(x,b){if(b&&(c(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i(x)}function i(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function o(x){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(b){return b.__proto__||Object.getPrototypeOf(b)},o(x)}var a={},s,h;function v(x,b,S){S||(S=Error);function T(w,u,f){return typeof b=="string"?b:b(w,u,f)}var M=function(w){A(f,w);var u=e(f);function f(k,_,D){var I;return E(this,f),I=u.call(this,T(k,_,D)),I.code=x,I}return g(f)}(S);a[x]=M}function m(x,b){if(Array.isArray(x)){var S=x.length;return x=x.map(function(T){return String(T)}),S>2?"one of ".concat(b," ").concat(x.slice(0,S-1).join(", "),", or ")+x[S-1]:S===2?"one of ".concat(b," ").concat(x[0]," or ").concat(x[1]):"of ".concat(b," ").concat(x[0])}else return"of ".concat(b," ").concat(String(x))}function p(x,b,S){return x.substr(0,b.length)===b}function y(x,b,S){return(S===void 0||S>x.length)&&(S=x.length),x.substring(S-b.length,S)===b}function l(x,b,S){return typeof S!="number"&&(S=0),S+b.length>x.length?!1:x.indexOf(b,S)!==-1}v("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),v("ERR_INVALID_ARG_TYPE",function(x,b,S){s===void 0&&(s=iv()),s(typeof x=="string","'name' must be a string");var T;typeof b=="string"&&p(b,"not ")?(T="must not be",b=b.replace(/^not /,"")):T="must be";var M;if(y(x," argument"))M="The ".concat(x," ").concat(T," ").concat(m(b,"type"));else{var w=l(x,".")?"property":"argument";M='The "'.concat(x,'" ').concat(w," ").concat(T," ").concat(m(b,"type"))}return M+=". Received type ".concat(c(S)),M},TypeError),v("ERR_INVALID_ARG_VALUE",function(x,b){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";h===void 0&&(h=Fg());var T=h.inspect(b);return T.length>128&&(T="".concat(T.slice(0,128),"...")),"The argument '".concat(x,"' ").concat(S,". Received ").concat(T)},TypeError),v("ERR_INVALID_RETURN_VALUE",function(x,b,S){var T;return S&&S.constructor&&S.constructor.name?T="instance of ".concat(S.constructor.name):T="type ".concat(c(S)),"Expected ".concat(x,' to be returned from the "').concat(b,'"')+" function but got ".concat(T,".")},TypeError),v("ERR_MISSING_ARGS",function(){for(var x=arguments.length,b=new Array(x),S=0;S<x;S++)b[S]=arguments[S];s===void 0&&(s=iv()),s(b.length>0,"At least one arg needs to be specified");var T="The ",M=b.length;switch(b=b.map(function(w){return'"'.concat(w,'"')}),M){case 1:T+="".concat(b[0]," argument");break;case 2:T+="".concat(b[0]," and ").concat(b[1]," arguments");break;default:T+=b.slice(0,M-1).join(", "),T+=", and ".concat(b[M-1]," arguments");break}return"".concat(T," must be specified")},TypeError),V.exports.codes=a}),o6=Vt((X,V)=>{function c(N,j){var G=Object.keys(N);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(N);j&&(rt=rt.filter(function(ct){return Object.getOwnPropertyDescriptor(N,ct).enumerable})),G.push.apply(G,rt)}return G}function g(N){for(var j=1;j<arguments.length;j++){var G=arguments[j]!=null?arguments[j]:{};j%2?c(Object(G),!0).forEach(function(rt){E(N,rt,G[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(N,Object.getOwnPropertyDescriptors(G)):c(Object(G)).forEach(function(rt){Object.defineProperty(N,rt,Object.getOwnPropertyDescriptor(G,rt))})}return N}function E(N,j,G){return j=r(j),j in N?Object.defineProperty(N,j,{value:G,enumerable:!0,configurable:!0,writable:!0}):N[j]=G,N}function A(N,j){if(!(N instanceof j))throw new TypeError("Cannot call a class as a function")}function t(N,j){for(var G=0;G<j.length;G++){var rt=j[G];rt.enumerable=rt.enumerable||!1,rt.configurable=!0,"value"in rt&&(rt.writable=!0),Object.defineProperty(N,r(rt.key),rt)}}function e(N,j,G){return j&&t(N.prototype,j),Object.defineProperty(N,"prototype",{writable:!1}),N}function r(N){var j=i(N,"string");return x(j)==="symbol"?j:String(j)}function i(N,j){if(x(N)!=="object"||N===null)return N;var G=N[Symbol.toPrimitive];if(G!==void 0){var rt=G.call(N,j||"default");if(x(rt)!=="object")return rt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(j==="string"?String:Number)(N)}function n(N,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function");N.prototype=Object.create(j&&j.prototype,{constructor:{value:N,writable:!0,configurable:!0}}),Object.defineProperty(N,"prototype",{writable:!1}),j&&y(N,j)}function o(N){var j=m();return function(){var G=l(N),rt;if(j){var ct=l(this).constructor;rt=Reflect.construct(G,arguments,ct)}else rt=G.apply(this,arguments);return a(this,rt)}}function a(N,j){if(j&&(x(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(N)}function s(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}function h(N){var j=typeof Map=="function"?new Map:void 0;return h=function(G){if(G===null||!p(G))return G;if(typeof G!="function")throw new TypeError("Super expression must either be null or a function");if(typeof j<"u"){if(j.has(G))return j.get(G);j.set(G,rt)}function rt(){return v(G,arguments,l(this).constructor)}return rt.prototype=Object.create(G.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),y(rt,G)},h(N)}function v(N,j,G){return m()?v=Reflect.construct.bind():v=function(rt,ct,lt){var tt=[null];tt.push.apply(tt,ct);var Z=Function.bind.apply(rt,tt),st=new Z;return lt&&y(st,lt.prototype),st},v.apply(null,arguments)}function m(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function p(N){return Function.toString.call(N).indexOf("[native code]")!==-1}function y(N,j){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(G,rt){return G.__proto__=rt,G},y(N,j)}function l(N){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(j){return j.__proto__||Object.getPrototypeOf(j)},l(N)}function x(N){"@babel/helpers - typeof";return x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},x(N)}var b=Fg(),S=b.inspect,T=q2(),M=T.codes.ERR_INVALID_ARG_TYPE;function w(N,j,G){return(G===void 0||G>N.length)&&(G=N.length),N.substring(G-j.length,G)===j}function u(N,j){if(j=Math.floor(j),N.length==0||j==0)return"";var G=N.length*j;for(j=Math.floor(Math.log(j)/Math.log(2));j;)N+=N,j--;return N+=N.substring(0,G-N.length),N}var f="",k="",_="",D="",I={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},O=10;function B(N){var j=Object.keys(N),G=Object.create(Object.getPrototypeOf(N));return j.forEach(function(rt){G[rt]=N[rt]}),Object.defineProperty(G,"message",{value:N.message}),G}function R(N){return S(N,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function L(N,j,G){var rt="",ct="",lt=0,tt="",Z=!1,st=R(N),$=st.split(`
|
||
`),Q=R(j).split(`
|
||
`),nt=0,Y="";if(G==="strictEqual"&&x(N)==="object"&&x(j)==="object"&&N!==null&&j!==null&&(G="strictEqualObject"),$.length===1&&Q.length===1&&$[0]!==Q[0]){var q=$[0].length+Q[0].length;if(q<=O){if((x(N)!=="object"||N===null)&&(x(j)!=="object"||j===null)&&(N!==0||j!==0))return"".concat(I[G],`
|
||
|
||
`)+"".concat($[0]," !== ").concat(Q[0],`
|
||
`)}else if(G!=="strictEqualObject"){var ot=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(q<ot){for(;$[0][nt]===Q[0][nt];)nt++;nt>2&&(Y=`
|
||
`.concat(u(" ",nt),"^"),nt=0)}}}for(var it=$[$.length-1],dt=Q[Q.length-1];it===dt&&(nt++<2?tt=`
|
||
`.concat(it).concat(tt):rt=it,$.pop(),Q.pop(),!($.length===0||Q.length===0));)it=$[$.length-1],dt=Q[Q.length-1];var wt=Math.max($.length,Q.length);if(wt===0){var xt=st.split(`
|
||
`);if(xt.length>30)for(xt[26]="".concat(f,"...").concat(D);xt.length>27;)xt.pop();return"".concat(I.notIdentical,`
|
||
|
||
`).concat(xt.join(`
|
||
`),`
|
||
`)}nt>3&&(tt=`
|
||
`.concat(f,"...").concat(D).concat(tt),Z=!0),rt!==""&&(tt=`
|
||
`.concat(rt).concat(tt),rt="");var Ft=0,Et=I[G]+`
|
||
`.concat(k,"+ actual").concat(D," ").concat(_,"- expected").concat(D),Nt=" ".concat(f,"...").concat(D," Lines skipped");for(nt=0;nt<wt;nt++){var te=nt-lt;if($.length<nt+1)te>1&&nt>2&&(te>4?(ct+=`
|
||
`.concat(f,"...").concat(D),Z=!0):te>3&&(ct+=`
|
||
`.concat(Q[nt-2]),Ft++),ct+=`
|
||
`.concat(Q[nt-1]),Ft++),lt=nt,rt+=`
|
||
`.concat(_,"-").concat(D," ").concat(Q[nt]),Ft++;else if(Q.length<nt+1)te>1&&nt>2&&(te>4?(ct+=`
|
||
`.concat(f,"...").concat(D),Z=!0):te>3&&(ct+=`
|
||
`.concat($[nt-2]),Ft++),ct+=`
|
||
`.concat($[nt-1]),Ft++),lt=nt,ct+=`
|
||
`.concat(k,"+").concat(D," ").concat($[nt]),Ft++;else{var Jt=Q[nt],Qt=$[nt],Wt=Qt!==Jt&&(!w(Qt,",")||Qt.slice(0,-1)!==Jt);Wt&&w(Jt,",")&&Jt.slice(0,-1)===Qt&&(Wt=!1,Qt+=","),Wt?(te>1&&nt>2&&(te>4?(ct+=`
|
||
`.concat(f,"...").concat(D),Z=!0):te>3&&(ct+=`
|
||
`.concat($[nt-2]),Ft++),ct+=`
|
||
`.concat($[nt-1]),Ft++),lt=nt,ct+=`
|
||
`.concat(k,"+").concat(D," ").concat(Qt),rt+=`
|
||
`.concat(_,"-").concat(D," ").concat(Jt),Ft+=2):(ct+=rt,rt="",(te===1||nt===0)&&(ct+=`
|
||
`.concat(Qt),Ft++))}if(Ft>20&&nt<wt-2)return"".concat(Et).concat(Nt,`
|
||
`).concat(ct,`
|
||
`).concat(f,"...").concat(D).concat(rt,`
|
||
`)+"".concat(f,"...").concat(D)}return"".concat(Et).concat(Z?Nt:"",`
|
||
`).concat(ct).concat(rt).concat(tt).concat(Y)}var F=function(N,j){n(rt,N);var G=o(rt);function rt(ct){var lt;if(A(this,rt),x(ct)!=="object"||ct===null)throw new M("options","Object",ct);var tt=ct.message,Z=ct.operator,st=ct.stackStartFn,$=ct.actual,Q=ct.expected,nt=Error.stackTraceLimit;if(Error.stackTraceLimit=0,tt!=null)lt=G.call(this,String(tt));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1?(f="\x1B[34m",k="\x1B[32m",D="\x1B[39m",_="\x1B[31m"):(f="",k="",D="",_="")),x($)==="object"&&$!==null&&x(Q)==="object"&&Q!==null&&"stack"in $&&$ instanceof Error&&"stack"in Q&&Q instanceof Error&&($=B($),Q=B(Q)),Z==="deepStrictEqual"||Z==="strictEqual")lt=G.call(this,L($,Q,Z));else if(Z==="notDeepStrictEqual"||Z==="notStrictEqual"){var Y=I[Z],q=R($).split(`
|
||
`);if(Z==="notStrictEqual"&&x($)==="object"&&$!==null&&(Y=I.notStrictEqualObject),q.length>30)for(q[26]="".concat(f,"...").concat(D);q.length>27;)q.pop();q.length===1?lt=G.call(this,"".concat(Y," ").concat(q[0])):lt=G.call(this,"".concat(Y,`
|
||
|
||
`).concat(q.join(`
|
||
`),`
|
||
`))}else{var ot=R($),it="",dt=I[Z];Z==="notDeepEqual"||Z==="notEqual"?(ot="".concat(I[Z],`
|
||
|
||
`).concat(ot),ot.length>1024&&(ot="".concat(ot.slice(0,1021),"..."))):(it="".concat(R(Q)),ot.length>512&&(ot="".concat(ot.slice(0,509),"...")),it.length>512&&(it="".concat(it.slice(0,509),"...")),Z==="deepEqual"||Z==="equal"?ot="".concat(dt,`
|
||
|
||
`).concat(ot,`
|
||
|
||
should equal
|
||
|
||
`):it=" ".concat(Z," ").concat(it)),lt=G.call(this,"".concat(ot).concat(it))}return Error.stackTraceLimit=nt,lt.generatedMessage=!tt,Object.defineProperty(s(lt),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),lt.code="ERR_ASSERTION",lt.actual=$,lt.expected=Q,lt.operator=Z,Error.captureStackTrace&&Error.captureStackTrace(s(lt),st),lt.stack,lt.name="AssertionError",a(lt)}return e(rt,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:j,value:function(ct,lt){return S(this,g(g({},lt),{},{customInspect:!1,depth:0}))}}]),rt}(h(Error),S.custom);V.exports=F}),H2=Vt((X,V)=>{var c=Object.prototype.toString;V.exports=function(g){var E=c.call(g),A=E==="[object Arguments]";return A||(A=E!=="[object Array]"&&g!==null&&typeof g=="object"&&typeof g.length=="number"&&g.length>=0&&c.call(g.callee)==="[object Function]"),A}}),s6=Vt((X,V)=>{var c;Object.keys||(g=Object.prototype.hasOwnProperty,E=Object.prototype.toString,A=H2(),t=Object.prototype.propertyIsEnumerable,e=!t.call({toString:null},"toString"),r=t.call(function(){},"prototype"),i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=function(h){var v=h.constructor;return v&&v.prototype===h},o={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},a=function(){if(typeof window>"u")return!1;for(var h in window)try{if(!o["$"+h]&&g.call(window,h)&&window[h]!==null&&typeof window[h]=="object")try{n(window[h])}catch{return!0}}catch{return!0}return!1}(),s=function(h){if(typeof window>"u"||!a)return n(h);try{return n(h)}catch{return!1}},c=function(h){var v=h!==null&&typeof h=="object",m=E.call(h)==="[object Function]",p=A(h),y=v&&E.call(h)==="[object String]",l=[];if(!v&&!m&&!p)throw new TypeError("Object.keys called on a non-object");var x=r&&m;if(y&&h.length>0&&!g.call(h,0))for(var b=0;b<h.length;++b)l.push(String(b));if(p&&h.length>0)for(var S=0;S<h.length;++S)l.push(String(S));else for(var T in h)!(x&&T==="prototype")&&g.call(h,T)&&l.push(String(T));if(e)for(var M=s(h),w=0;w<i.length;++w)!(M&&i[w]==="constructor")&&g.call(h,i[w])&&l.push(i[w]);return l});var g,E,A,t,e,r,i,n,o,a,s;V.exports=c}),G2=Vt((X,V)=>{var c=Array.prototype.slice,g=H2(),E=Object.keys,A=E?function(e){return E(e)}:s6(),t=Object.keys;A.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(r){return g(r)?t(c.call(r)):t(r)})}else Object.keys=A;return Object.keys||A},V.exports=A}),l6=Vt((X,V)=>{var c=G2(),g=D1()(),E=Og(),A=Object,t=E("Array.prototype.push"),e=E("Object.prototype.propertyIsEnumerable"),r=g?Object.getOwnPropertySymbols:null;V.exports=function(i,n){if(i==null)throw new TypeError("target must be an object");var o=A(i);if(arguments.length===1)return o;for(var a=1;a<arguments.length;++a){var s=A(arguments[a]),h=c(s),v=g&&(Object.getOwnPropertySymbols||r);if(v)for(var m=v(s),p=0;p<m.length;++p){var y=m[p];e(s,y)&&t(h,y)}for(var l=0;l<h.length;++l){var x=h[l];if(e(s,x)){var b=s[x];o[x]=b}}}return o}}),u6=Vt((X,V)=>{var c=l6(),g=function(){if(!Object.assign)return!1;for(var A="abcdefghijklmnopqrst",t=A.split(""),e={},r=0;r<t.length;++r)e[t[r]]=t[r];var i=Object.assign({},e),n="";for(var o in i)n+=o;return A!==n},E=function(){if(!Object.assign||!Object.preventExtensions)return!1;var A=Object.preventExtensions({1:2});try{Object.assign(A,"xy")}catch{return A[1]==="y"}return!1};V.exports=function(){return!Object.assign||g()||E()?c:Object.assign}}),W2=Vt((X,V)=>{var c=function(g){return g!==g};V.exports=function(g,E){return g===0&&E===0?1/g===1/E:!!(g===E||c(g)&&c(E))}}),B1=Vt((X,V)=>{var c=W2();V.exports=function(){return typeof Object.is=="function"?Object.is:c}}),av=Vt((X,V)=>{var c=G2(),g=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",E=Object.prototype.toString,A=Array.prototype.concat,t=Object.defineProperty,e=function(a){return typeof a=="function"&&E.call(a)==="[object Function]"},r=L2()(),i=t&&r,n=function(a,s,h,v){if(s in a){if(v===!0){if(a[s]===h)return}else if(!e(v)||!v())return}i?t(a,s,{configurable:!0,enumerable:!1,value:h,writable:!0}):a[s]=h},o=function(a,s){var h=arguments.length>2?arguments[2]:{},v=c(s);g&&(v=A.call(v,Object.getOwnPropertySymbols(s)));for(var m=0;m<v.length;m+=1)n(a,v[m],s[v[m]],h[v[m]])};o.supportsDescriptors=!!i,V.exports=o}),c6=Vt((X,V)=>{var c=B1(),g=av();V.exports=function(){var E=c();return g(Object,{is:E},{is:function(){return Object.is!==E}}),E}}),h6=Vt((X,V)=>{var c=av(),g=nv(),E=W2(),A=B1(),t=c6(),e=g(A(),Object);c(e,{getPolyfill:A,implementation:E,shim:t}),V.exports=e}),Z2=Vt((X,V)=>{V.exports=function(c){return c!==c}}),X2=Vt((X,V)=>{var c=Z2();V.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:c}}),f6=Vt((X,V)=>{var c=av(),g=X2();V.exports=function(){var E=g();return c(Number,{isNaN:E},{isNaN:function(){return Number.isNaN!==E}}),E}}),p6=Vt((X,V)=>{var c=nv(),g=av(),E=Z2(),A=X2(),t=f6(),e=c(A(),Number);g(e,{getPolyfill:A,implementation:E,shim:t}),V.exports=e}),d6=Vt((X,V)=>{function c(Wt,gt){return e(Wt)||t(Wt,gt)||E(Wt,gt)||g()}function g(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E(Wt,gt){if(Wt){if(typeof Wt=="string")return A(Wt,gt);var bt=Object.prototype.toString.call(Wt).slice(8,-1);if(bt==="Object"&&Wt.constructor&&(bt=Wt.constructor.name),bt==="Map"||bt==="Set")return Array.from(Wt);if(bt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(bt))return A(Wt,gt)}}function A(Wt,gt){(gt==null||gt>Wt.length)&&(gt=Wt.length);for(var bt=0,vt=new Array(gt);bt<gt;bt++)vt[bt]=Wt[bt];return vt}function t(Wt,gt){var bt=Wt==null?null:typeof Symbol<"u"&&Wt[Symbol.iterator]||Wt["@@iterator"];if(bt!=null){var vt,Ut,Kt,Zt,le=[],Te=!0,Se=!1;try{if(Kt=(bt=bt.call(Wt)).next,gt!==0)for(;!(Te=(vt=Kt.call(bt)).done)&&(le.push(vt.value),le.length!==gt);Te=!0);}catch(Fe){Se=!0,Ut=Fe}finally{try{if(!Te&&bt.return!=null&&(Zt=bt.return(),Object(Zt)!==Zt))return}finally{if(Se)throw Ut}}return le}}function e(Wt){if(Array.isArray(Wt))return Wt}function r(Wt){"@babel/helpers - typeof";return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(gt){return typeof gt}:function(gt){return gt&&typeof Symbol=="function"&>.constructor===Symbol&>!==Symbol.prototype?"symbol":typeof gt},r(Wt)}var i=/a/g.flags!==void 0,n=function(Wt){var gt=[];return Wt.forEach(function(bt){return gt.push(bt)}),gt},o=function(Wt){var gt=[];return Wt.forEach(function(bt,vt){return gt.push([vt,bt])}),gt},a=Object.is?Object.is:h6(),s=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},h=Number.isNaN?Number.isNaN:p6();function v(Wt){return Wt.call.bind(Wt)}var m=v(Object.prototype.hasOwnProperty),p=v(Object.prototype.propertyIsEnumerable),y=v(Object.prototype.toString),l=Fg().types,x=l.isAnyArrayBuffer,b=l.isArrayBufferView,S=l.isDate,T=l.isMap,M=l.isRegExp,w=l.isSet,u=l.isNativeError,f=l.isBoxedPrimitive,k=l.isNumberObject,_=l.isStringObject,D=l.isBooleanObject,I=l.isBigIntObject,O=l.isSymbolObject,B=l.isFloat32Array,R=l.isFloat64Array;function L(Wt){if(Wt.length===0||Wt.length>10)return!0;for(var gt=0;gt<Wt.length;gt++){var bt=Wt.charCodeAt(gt);if(bt<48||bt>57)return!0}return Wt.length===10&&Wt>=Math.pow(2,32)}function F(Wt){return Object.keys(Wt).filter(L).concat(s(Wt).filter(Object.prototype.propertyIsEnumerable.bind(Wt)))}function N(Wt,gt){if(Wt===gt)return 0;for(var bt=Wt.length,vt=gt.length,Ut=0,Kt=Math.min(bt,vt);Ut<Kt;++Ut)if(Wt[Ut]!==gt[Ut]){bt=Wt[Ut],vt=gt[Ut];break}return bt<vt?-1:vt<bt?1:0}var j=!0,G=!1,rt=0,ct=1,lt=2,tt=3;function Z(Wt,gt){return i?Wt.source===gt.source&&Wt.flags===gt.flags:RegExp.prototype.toString.call(Wt)===RegExp.prototype.toString.call(gt)}function st(Wt,gt){if(Wt.byteLength!==gt.byteLength)return!1;for(var bt=0;bt<Wt.byteLength;bt++)if(Wt[bt]!==gt[bt])return!1;return!0}function $(Wt,gt){return Wt.byteLength!==gt.byteLength?!1:N(new Uint8Array(Wt.buffer,Wt.byteOffset,Wt.byteLength),new Uint8Array(gt.buffer,gt.byteOffset,gt.byteLength))===0}function Q(Wt,gt){return Wt.byteLength===gt.byteLength&&N(new Uint8Array(Wt),new Uint8Array(gt))===0}function nt(Wt,gt){return k(Wt)?k(gt)&&a(Number.prototype.valueOf.call(Wt),Number.prototype.valueOf.call(gt)):_(Wt)?_(gt)&&String.prototype.valueOf.call(Wt)===String.prototype.valueOf.call(gt):D(Wt)?D(gt)&&Boolean.prototype.valueOf.call(Wt)===Boolean.prototype.valueOf.call(gt):I(Wt)?I(gt)&&BigInt.prototype.valueOf.call(Wt)===BigInt.prototype.valueOf.call(gt):O(gt)&&Symbol.prototype.valueOf.call(Wt)===Symbol.prototype.valueOf.call(gt)}function Y(Wt,gt,bt,vt){if(Wt===gt)return Wt!==0?!0:bt?a(Wt,gt):!0;if(bt){if(r(Wt)!=="object")return typeof Wt=="number"&&h(Wt)&&h(gt);if(r(gt)!=="object"||Wt===null||gt===null||Object.getPrototypeOf(Wt)!==Object.getPrototypeOf(gt))return!1}else{if(Wt===null||r(Wt)!=="object")return gt===null||r(gt)!=="object"?Wt==gt:!1;if(gt===null||r(gt)!=="object")return!1}var Ut=y(Wt),Kt=y(gt);if(Ut!==Kt)return!1;if(Array.isArray(Wt)){if(Wt.length!==gt.length)return!1;var Zt=F(Wt),le=F(gt);return Zt.length!==le.length?!1:ot(Wt,gt,bt,vt,ct,Zt)}if(Ut==="[object Object]"&&(!T(Wt)&&T(gt)||!w(Wt)&&w(gt)))return!1;if(S(Wt)){if(!S(gt)||Date.prototype.getTime.call(Wt)!==Date.prototype.getTime.call(gt))return!1}else if(M(Wt)){if(!M(gt)||!Z(Wt,gt))return!1}else if(u(Wt)||Wt instanceof Error){if(Wt.message!==gt.message||Wt.name!==gt.name)return!1}else if(b(Wt)){if(!bt&&(B(Wt)||R(Wt))){if(!st(Wt,gt))return!1}else if(!$(Wt,gt))return!1;var Te=F(Wt),Se=F(gt);return Te.length!==Se.length?!1:ot(Wt,gt,bt,vt,rt,Te)}else{if(w(Wt))return!w(gt)||Wt.size!==gt.size?!1:ot(Wt,gt,bt,vt,lt);if(T(Wt))return!T(gt)||Wt.size!==gt.size?!1:ot(Wt,gt,bt,vt,tt);if(x(Wt)){if(!Q(Wt,gt))return!1}else if(f(Wt)&&!nt(Wt,gt))return!1}return ot(Wt,gt,bt,vt,rt)}function q(Wt,gt){return gt.filter(function(bt){return p(Wt,bt)})}function ot(Wt,gt,bt,vt,Ut,Kt){if(arguments.length===5){Kt=Object.keys(Wt);var Zt=Object.keys(gt);if(Kt.length!==Zt.length)return!1}for(var le=0;le<Kt.length;le++)if(!m(gt,Kt[le]))return!1;if(bt&&arguments.length===5){var Te=s(Wt);if(Te.length!==0){var Se=0;for(le=0;le<Te.length;le++){var Fe=Te[le];if(p(Wt,Fe)){if(!p(gt,Fe))return!1;Kt.push(Fe),Se++}else if(p(gt,Fe))return!1}var Oe=s(gt);if(Te.length!==Oe.length&&q(gt,Oe).length!==Se)return!1}else{var ur=s(gt);if(ur.length!==0&&q(gt,ur).length!==0)return!1}}if(Kt.length===0&&(Ut===rt||Ut===ct&&Wt.length===0||Wt.size===0))return!0;if(vt===void 0)vt={val1:new Map,val2:new Map,position:0};else{var fr=vt.val1.get(Wt);if(fr!==void 0){var We=vt.val2.get(gt);if(We!==void 0)return fr===We}vt.position++}vt.val1.set(Wt,vt.position),vt.val2.set(gt,vt.position);var Lr=te(Wt,gt,bt,Kt,vt,Ut);return vt.val1.delete(Wt),vt.val2.delete(gt),Lr}function it(Wt,gt,bt,vt){for(var Ut=n(Wt),Kt=0;Kt<Ut.length;Kt++){var Zt=Ut[Kt];if(Y(gt,Zt,bt,vt))return Wt.delete(Zt),!0}return!1}function dt(Wt){switch(r(Wt)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":Wt=+Wt;case"number":if(h(Wt))return!1}return!0}function wt(Wt,gt,bt){var vt=dt(bt);return vt??(gt.has(vt)&&!Wt.has(vt))}function xt(Wt,gt,bt,vt,Ut){var Kt=dt(bt);if(Kt!=null)return Kt;var Zt=gt.get(Kt);return Zt===void 0&&!gt.has(Kt)||!Y(vt,Zt,!1,Ut)?!1:!Wt.has(Kt)&&Y(vt,Zt,!1,Ut)}function Ft(Wt,gt,bt,vt){for(var Ut=null,Kt=n(Wt),Zt=0;Zt<Kt.length;Zt++){var le=Kt[Zt];if(r(le)==="object"&&le!==null)Ut===null&&(Ut=new Set),Ut.add(le);else if(!gt.has(le)){if(bt||!wt(Wt,gt,le))return!1;Ut===null&&(Ut=new Set),Ut.add(le)}}if(Ut!==null){for(var Te=n(gt),Se=0;Se<Te.length;Se++){var Fe=Te[Se];if(r(Fe)==="object"&&Fe!==null){if(!it(Ut,Fe,bt,vt))return!1}else if(!bt&&!Wt.has(Fe)&&!it(Ut,Fe,bt,vt))return!1}return Ut.size===0}return!0}function Et(Wt,gt,bt,vt,Ut,Kt){for(var Zt=n(Wt),le=0;le<Zt.length;le++){var Te=Zt[le];if(Y(bt,Te,Ut,Kt)&&Y(vt,gt.get(Te),Ut,Kt))return Wt.delete(Te),!0}return!1}function Nt(Wt,gt,bt,vt){for(var Ut=null,Kt=o(Wt),Zt=0;Zt<Kt.length;Zt++){var le=c(Kt[Zt],2),Te=le[0],Se=le[1];if(r(Te)==="object"&&Te!==null)Ut===null&&(Ut=new Set),Ut.add(Te);else{var Fe=gt.get(Te);if(Fe===void 0&&!gt.has(Te)||!Y(Se,Fe,bt,vt)){if(bt||!xt(Wt,gt,Te,Se,vt))return!1;Ut===null&&(Ut=new Set),Ut.add(Te)}}}if(Ut!==null){for(var Oe=o(gt),ur=0;ur<Oe.length;ur++){var fr=c(Oe[ur],2),We=fr[0],Lr=fr[1];if(r(We)==="object"&&We!==null){if(!Et(Ut,Wt,We,Lr,bt,vt))return!1}else if(!bt&&(!Wt.has(We)||!Y(Wt.get(We),Lr,!1,vt))&&!Et(Ut,Wt,We,Lr,!1,vt))return!1}return Ut.size===0}return!0}function te(Wt,gt,bt,vt,Ut,Kt){var Zt=0;if(Kt===lt){if(!Ft(Wt,gt,bt,Ut))return!1}else if(Kt===tt){if(!Nt(Wt,gt,bt,Ut))return!1}else if(Kt===ct)for(;Zt<Wt.length;Zt++)if(m(Wt,Zt)){if(!m(gt,Zt)||!Y(Wt[Zt],gt[Zt],bt,Ut))return!1}else{if(m(gt,Zt))return!1;for(var le=Object.keys(Wt);Zt<le.length;Zt++){var Te=le[Zt];if(!m(gt,Te)||!Y(Wt[Te],gt[Te],bt,Ut))return!1}return le.length===Object.keys(gt).length}for(Zt=0;Zt<vt.length;Zt++){var Se=vt[Zt];if(!Y(Wt[Se],gt[Se],bt,Ut))return!1}return!0}function Jt(Wt,gt){return Y(Wt,gt,G)}function Qt(Wt,gt){return Y(Wt,gt,j)}V.exports={isDeepEqual:Jt,isDeepStrictEqual:Qt}}),iv=Vt((X,V)=>{function c(lt){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(tt){return typeof tt}:function(tt){return tt&&typeof Symbol=="function"&&tt.constructor===Symbol&&tt!==Symbol.prototype?"symbol":typeof tt},c(lt)}function g(lt,tt,Z){return Object.defineProperty(lt,"prototype",{writable:!1}),lt}function E(lt,tt){if(!(lt instanceof tt))throw new TypeError("Cannot call a class as a function")}var A=q2(),t=A.codes,e=t.ERR_AMBIGUOUS_ARGUMENT,r=t.ERR_INVALID_ARG_TYPE,i=t.ERR_INVALID_ARG_VALUE,n=t.ERR_INVALID_RETURN_VALUE,o=t.ERR_MISSING_ARGS,a=o6(),s=Fg(),h=s.inspect,v=Fg().types,m=v.isPromise,p=v.isRegExp,y=u6()(),l=B1()(),x=Og()("RegExp.prototype.test"),b,S;function T(){var lt=d6();b=lt.isDeepEqual,S=lt.isDeepStrictEqual}var M=!1,w=V.exports=D,u={};function f(lt){throw lt.message instanceof Error?lt.message:new a(lt)}function k(lt,tt,Z,st,$){var Q=arguments.length,nt;if(Q===0)nt="Failed";else if(Q===1)Z=lt,lt=void 0;else{if(M===!1){M=!0;var Y=process.emitWarning?process.emitWarning:console.warn.bind(console);Y("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}Q===2&&(st="!=")}if(Z instanceof Error)throw Z;var q={actual:lt,expected:tt,operator:st===void 0?"fail":st,stackStartFn:$||k};Z!==void 0&&(q.message=Z);var ot=new a(q);throw nt&&(ot.message=nt,ot.generatedMessage=!0),ot}w.fail=k,w.AssertionError=a;function _(lt,tt,Z,st){if(!Z){var $=!1;if(tt===0)$=!0,st="No value argument passed to `assert.ok()`";else if(st instanceof Error)throw st;var Q=new a({actual:Z,expected:!0,message:st,operator:"==",stackStartFn:lt});throw Q.generatedMessage=$,Q}}function D(){for(var lt=arguments.length,tt=new Array(lt),Z=0;Z<lt;Z++)tt[Z]=arguments[Z];_.apply(void 0,[D,tt.length].concat(tt))}w.ok=D,w.equal=function lt(tt,Z,st){if(arguments.length<2)throw new o("actual","expected");tt!=Z&&f({actual:tt,expected:Z,message:st,operator:"==",stackStartFn:lt})},w.notEqual=function lt(tt,Z,st){if(arguments.length<2)throw new o("actual","expected");tt==Z&&f({actual:tt,expected:Z,message:st,operator:"!=",stackStartFn:lt})},w.deepEqual=function lt(tt,Z,st){if(arguments.length<2)throw new o("actual","expected");b===void 0&&T(),b(tt,Z)||f({actual:tt,expected:Z,message:st,operator:"deepEqual",stackStartFn:lt})},w.notDeepEqual=function lt(tt,Z,st){if(arguments.length<2)throw new o("actual","expected");b===void 0&&T(),b(tt,Z)&&f({actual:tt,expected:Z,message:st,operator:"notDeepEqual",stackStartFn:lt})},w.deepStrictEqual=function lt(tt,Z,st){if(arguments.length<2)throw new o("actual","expected");b===void 0&&T(),S(tt,Z)||f({actual:tt,expected:Z,message:st,operator:"deepStrictEqual",stackStartFn:lt})},w.notDeepStrictEqual=I;function I(lt,tt,Z){if(arguments.length<2)throw new o("actual","expected");b===void 0&&T(),S(lt,tt)&&f({actual:lt,expected:tt,message:Z,operator:"notDeepStrictEqual",stackStartFn:I})}w.strictEqual=function lt(tt,Z,st){if(arguments.length<2)throw new o("actual","expected");l(tt,Z)||f({actual:tt,expected:Z,message:st,operator:"strictEqual",stackStartFn:lt})},w.notStrictEqual=function lt(tt,Z,st){if(arguments.length<2)throw new o("actual","expected");l(tt,Z)&&f({actual:tt,expected:Z,message:st,operator:"notStrictEqual",stackStartFn:lt})};var O=g(function lt(tt,Z,st){var $=this;E(this,lt),Z.forEach(function(Q){Q in tt&&(st!==void 0&&typeof st[Q]=="string"&&p(tt[Q])&&x(tt[Q],st[Q])?$[Q]=st[Q]:$[Q]=tt[Q])})});function B(lt,tt,Z,st,$,Q){if(!(Z in lt)||!S(lt[Z],tt[Z])){if(!st){var nt=new O(lt,$),Y=new O(tt,$,lt),q=new a({actual:nt,expected:Y,operator:"deepStrictEqual",stackStartFn:Q});throw q.actual=lt,q.expected=tt,q.operator=Q.name,q}f({actual:lt,expected:tt,message:st,operator:Q.name,stackStartFn:Q})}}function R(lt,tt,Z,st){if(typeof tt!="function"){if(p(tt))return x(tt,lt);if(arguments.length===2)throw new r("expected",["Function","RegExp"],tt);if(c(lt)!=="object"||lt===null){var $=new a({actual:lt,expected:tt,message:Z,operator:"deepStrictEqual",stackStartFn:st});throw $.operator=st.name,$}var Q=Object.keys(tt);if(tt instanceof Error)Q.push("name","message");else if(Q.length===0)throw new i("error",tt,"may not be an empty object");return b===void 0&&T(),Q.forEach(function(nt){typeof lt[nt]=="string"&&p(tt[nt])&&x(tt[nt],lt[nt])||B(lt,tt,nt,Z,Q,st)}),!0}return tt.prototype!==void 0&< instanceof tt?!0:Error.isPrototypeOf(tt)?!1:tt.call({},lt)===!0}function L(lt){if(typeof lt!="function")throw new r("fn","Function",lt);try{lt()}catch(tt){return tt}return u}function F(lt){return m(lt)||lt!==null&&c(lt)==="object"&&typeof lt.then=="function"&&typeof lt.catch=="function"}function N(lt){return Promise.resolve().then(function(){var tt;if(typeof lt=="function"){if(tt=lt(),!F(tt))throw new n("instance of Promise","promiseFn",tt)}else if(F(lt))tt=lt;else throw new r("promiseFn",["Function","Promise"],lt);return Promise.resolve().then(function(){return tt}).then(function(){return u}).catch(function(Z){return Z})})}function j(lt,tt,Z,st){if(typeof Z=="string"){if(arguments.length===4)throw new r("error",["Object","Error","Function","RegExp"],Z);if(c(tt)==="object"&&tt!==null){if(tt.message===Z)throw new e("error/message",'The error message "'.concat(tt.message,'" is identical to the message.'))}else if(tt===Z)throw new e("error/message",'The error "'.concat(tt,'" is identical to the message.'));st=Z,Z=void 0}else if(Z!=null&&c(Z)!=="object"&&typeof Z!="function")throw new r("error",["Object","Error","Function","RegExp"],Z);if(tt===u){var $="";Z&&Z.name&&($+=" (".concat(Z.name,")")),$+=st?": ".concat(st):".";var Q=lt.name==="rejects"?"rejection":"exception";f({actual:void 0,expected:Z,operator:lt.name,message:"Missing expected ".concat(Q).concat($),stackStartFn:lt})}if(Z&&!R(tt,Z,st,lt))throw tt}function G(lt,tt,Z,st){if(tt!==u){if(typeof Z=="string"&&(st=Z,Z=void 0),!Z||R(tt,Z)){var $=st?": ".concat(st):".",Q=lt.name==="doesNotReject"?"rejection":"exception";f({actual:tt,expected:Z,operator:lt.name,message:"Got unwanted ".concat(Q).concat($,`
|
||
`)+'Actual message: "'.concat(tt&&tt.message,'"'),stackStartFn:lt})}throw tt}}w.throws=function lt(tt){for(var Z=arguments.length,st=new Array(Z>1?Z-1:0),$=1;$<Z;$++)st[$-1]=arguments[$];j.apply(void 0,[lt,L(tt)].concat(st))},w.rejects=function lt(tt){for(var Z=arguments.length,st=new Array(Z>1?Z-1:0),$=1;$<Z;$++)st[$-1]=arguments[$];return N(tt).then(function(Q){return j.apply(void 0,[lt,Q].concat(st))})},w.doesNotThrow=function lt(tt){for(var Z=arguments.length,st=new Array(Z>1?Z-1:0),$=1;$<Z;$++)st[$-1]=arguments[$];G.apply(void 0,[lt,L(tt)].concat(st))},w.doesNotReject=function lt(tt){for(var Z=arguments.length,st=new Array(Z>1?Z-1:0),$=1;$<Z;$++)st[$-1]=arguments[$];return N(tt).then(function(Q){return G.apply(void 0,[lt,Q].concat(st))})},w.ifError=function lt(tt){if(tt!=null){var Z="ifError got unwanted exception: ";c(tt)==="object"&&typeof tt.message=="string"?tt.message.length===0&&tt.constructor?Z+=tt.constructor.name:Z+=tt.message:Z+=h(tt);var st=new a({actual:tt,expected:null,operator:"ifError",message:Z,stackStartFn:lt}),$=tt.stack;if(typeof $=="string"){var Q=$.split(`
|
||
`);Q.shift();for(var nt=st.stack.split(`
|
||
`),Y=0;Y<Q.length;Y++){var q=nt.indexOf(Q[Y]);if(q!==-1){nt=nt.slice(0,q);break}}st.stack="".concat(nt.join(`
|
||
`),`
|
||
`).concat(Q.join(`
|
||
`))}throw st}};function rt(lt,tt,Z,st,$){if(!p(tt))throw new r("regexp","RegExp",tt);var Q=$==="match";if(typeof lt!="string"||x(tt,lt)!==Q){if(Z instanceof Error)throw Z;var nt=!Z;Z=Z||(typeof lt!="string"?'The "string" argument must be of type string. Received type '+"".concat(c(lt)," (").concat(h(lt),")"):(Q?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(h(tt),`. Input:
|
||
|
||
`).concat(h(lt),`
|
||
`));var Y=new a({actual:lt,expected:tt,message:Z,operator:$,stackStartFn:st});throw Y.generatedMessage=nt,Y}}w.match=function lt(tt,Z,st){rt(tt,Z,st,lt,"match")},w.doesNotMatch=function lt(tt,Z,st){rt(tt,Z,st,lt,"doesNotMatch")};function ct(){for(var lt=arguments.length,tt=new Array(lt),Z=0;Z<lt;Z++)tt[Z]=arguments[Z];_.apply(void 0,[ct,tt.length].concat(tt))}w.strict=y(ct,w,{equal:w.strictEqual,deepEqual:w.deepStrictEqual,notEqual:w.notStrictEqual,notDeepEqual:w.notDeepStrictEqual}),w.strict.strict=w.strict}),g6=Vt((X,V)=>{var c=1e3,g=c*60,E=g*60,A=E*24,t=A*365.25;V.exports=function(o,a){a=a||{};var s=typeof o;if(s==="string"&&o.length>0)return e(o);if(s==="number"&&isNaN(o)===!1)return a.long?i(o):r(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function e(o){if(o=String(o),!(o.length>100)){var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(o);if(a){var s=parseFloat(a[1]),h=(a[2]||"ms").toLowerCase();switch(h){case"years":case"year":case"yrs":case"yr":case"y":return s*t;case"days":case"day":case"d":return s*A;case"hours":case"hour":case"hrs":case"hr":case"h":return s*E;case"minutes":case"minute":case"mins":case"min":case"m":return s*g;case"seconds":case"second":case"secs":case"sec":case"s":return s*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(o){return o>=A?Math.round(o/A)+"d":o>=E?Math.round(o/E)+"h":o>=g?Math.round(o/g)+"m":o>=c?Math.round(o/c)+"s":o+"ms"}function i(o){return n(o,A,"day")||n(o,E,"hour")||n(o,g,"minute")||n(o,c,"second")||o+" ms"}function n(o,a,s){if(!(o<a))return o<a*1.5?Math.floor(o/a)+" "+s:Math.ceil(o/a)+" "+s+"s"}}),m6=Vt((X,V)=>{X=V.exports=E.debug=E.default=E,X.coerce=r,X.disable=t,X.enable=A,X.enabled=e,X.humanize=g6(),X.names=[],X.skips=[],X.formatters={};var c;function g(i){var n=0,o;for(o in i)n=(n<<5)-n+i.charCodeAt(o),n|=0;return X.colors[Math.abs(n)%X.colors.length]}function E(i){function n(){if(n.enabled){var o=n,a=+new Date,s=a-(c||a);o.diff=s,o.prev=c,o.curr=a,c=a;for(var h=new Array(arguments.length),v=0;v<h.length;v++)h[v]=arguments[v];h[0]=X.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");var m=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,function(y,l){if(y==="%%")return y;m++;var x=X.formatters[l];if(typeof x=="function"){var b=h[m];y=x.call(o,b),h.splice(m,1),m--}return y}),X.formatArgs.call(o,h);var p=n.log||X.log||console.log.bind(console);p.apply(o,h)}}return n.namespace=i,n.enabled=X.enabled(i),n.useColors=X.useColors(),n.color=g(i),typeof X.init=="function"&&X.init(n),n}function A(i){X.save(i),X.names=[],X.skips=[];for(var n=(typeof i=="string"?i:"").split(/[\s,]+/),o=n.length,a=0;a<o;a++)n[a]&&(i=n[a].replace(/\*/g,".*?"),i[0]==="-"?X.skips.push(new RegExp("^"+i.substr(1)+"$")):X.names.push(new RegExp("^"+i+"$")))}function t(){X.enable("")}function e(i){var n,o;for(n=0,o=X.skips.length;n<o;n++)if(X.skips[n].test(i))return!1;for(n=0,o=X.names.length;n<o;n++)if(X.names[n].test(i))return!0;return!1}function r(i){return i instanceof Error?i.stack||i.message:i}}),v6=Vt((X,V)=>{X=V.exports=m6(),X.log=E,X.formatArgs=g,X.save=A,X.load=t,X.useColors=c,X.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:e(),X.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function c(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}X.formatters.j=function(r){try{return JSON.stringify(r)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}};function g(r){var i=this.useColors;if(r[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+r[0]+(i?"%c ":" ")+"+"+X.humanize(this.diff),!!i){var n="color: "+this.color;r.splice(1,0,n,"color: inherit");var o=0,a=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(o++,s==="%c"&&(a=o))}),r.splice(a,0,n)}}function E(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function A(r){try{r==null?X.storage.removeItem("debug"):X.storage.debug=r}catch{}}function t(){var r;try{r=X.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=vh.DEBUG),r}X.enable(t());function e(){try{return window.localStorage}catch{}}}),y6=Vt((X,V)=>{var c=iv(),g=v6()("stream-parser");V.exports=r;var E=-1,A=0,t=1,e=2;function r(l){var x=l&&typeof l._transform=="function",b=l&&typeof l._write=="function";if(!x&&!b)throw new Error("must pass a Writable or Transform stream in");g("extending Parser into stream"),l._bytes=n,l._skipBytes=o,x&&(l._passthrough=a),x?l._transform=h:l._write=s}function i(l){g("initializing parser stream"),l._parserBytesLeft=0,l._parserBuffers=[],l._parserBuffered=0,l._parserState=E,l._parserCallback=null,typeof l.push=="function"&&(l._parserOutput=l.push.bind(l)),l._parserInit=!0}function n(l,x){c(!this._parserCallback,'there is already a "callback" set!'),c(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||i(this),g("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=x,this._parserState=A}function o(l,x){c(!this._parserCallback,'there is already a "callback" set!'),c(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||i(this),g("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=x,this._parserState=t}function a(l,x){c(!this._parserCallback,'There is already a "callback" set!'),c(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||i(this),g("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=x,this._parserState=e}function s(l,x,b){this._parserInit||i(this),g("write(%o bytes)",l.length),typeof x=="function"&&(b=x),p(this,l,null,b)}function h(l,x,b){this._parserInit||i(this),g("transform(%o bytes)",l.length),typeof x!="function"&&(x=this._parserOutput),p(this,l,x,b)}function v(l,x,b,S){return l._parserBytesLeft<=0?S(new Error("got data but not currently parsing anything")):x.length<=l._parserBytesLeft?function(){return m(l,x,b,S)}:function(){var T=x.slice(0,l._parserBytesLeft);return m(l,T,b,function(M){if(M)return S(M);if(x.length>T.length)return function(){return v(l,x.slice(T.length),b,S)}})}}function m(l,x,b,S){if(l._parserBytesLeft-=x.length,g("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===A?(l._parserBuffers.push(x),l._parserBuffered+=x.length):l._parserState===e&&b(x),l._parserBytesLeft===0){var T=l._parserCallback;if(T&&l._parserState===A&&l._parserBuffers.length>1&&(x=Buffer.concat(l._parserBuffers,l._parserBuffered)),l._parserState!==A&&(x=null),l._parserCallback=null,l._parserBuffered=0,l._parserState=E,l._parserBuffers.splice(0),T){var M=[];x&&M.push(x),b&&M.push(b);var w=T.length>M.length;w&&M.push(y(S));var u=T.apply(l,M);if(!w||S===u)return S}}else return S}var p=y(v);function y(l){return function(){for(var x=l.apply(this,arguments);typeof x=="function";)x=x();return x}}}),Vl=Vt(X=>{var V=i6().Transform,c=y6();function g(){V.call(this,{readableObjectMode:!0})}g.prototype=Object.create(V.prototype),g.prototype.constructor=g,c(g.prototype),X.ParserStream=g,X.sliceEq=function(A,t,e){for(var r=t,i=0;i<e.length;)if(A[r++]!==e[i++])return!1;return!0},X.str2arr=function(A,t){var e=[],r=0;if(t&&t==="hex")for(;r<A.length;)e.push(parseInt(A.slice(r,r+2),16)),r+=2;else for(;r<A.length;r++)e.push(A.charCodeAt(r)&255);return e},X.readUInt16LE=function(A,t){return A[t]|A[t+1]<<8},X.readUInt16BE=function(A,t){return A[t+1]|A[t]<<8},X.readUInt32LE=function(A,t){return A[t]|A[t+1]<<8|A[t+2]<<16|A[t+3]*16777216},X.readUInt32BE=function(A,t){return A[t+3]|A[t+2]<<8|A[t+1]<<16|A[t]*16777216};function E(A,t,e){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||"",this.name=this.constructor.name,this.message=A,t&&(this.code=t),e&&(this.statusCode=e)}E.prototype=Object.create(Error.prototype),E.prototype.constructor=E,X.ProbeError=E}),x6=Vt((X,V)=>{var c=Vl().readUInt16BE,g=Vl().readUInt32BE;function E(a,s){if(a.length<4+s)return null;var h=g(a,s);return a.length<h+s||h<8?null:{boxtype:String.fromCharCode.apply(null,a.slice(s+4,s+8)),data:a.slice(s+8,s+h),end:s+h}}V.exports.unbox=E;function A(a,s){for(var h=0;;){var v=E(a,h);if(!v)break;switch(v.boxtype){case"ispe":s.sizes.push({width:g(v.data,4),height:g(v.data,8)});break;case"irot":s.transforms.push({type:"irot",value:v.data[0]&3});break;case"imir":s.transforms.push({type:"imir",value:v.data[0]&1});break}h=v.end}}function t(a,s,h){for(var v=0,m=0;m<h;m++)v=v*256+(a[s+m]||0);return v}function e(a,s){for(var h=a[4]>>4&15,v=a[4]&15,m=a[5]>>4&15,p=c(a,6),y=8,l=0;l<p;l++){var x=c(a,y);y+=2;var b=c(a,y);y+=2;var S=t(a,y,m);y+=m;var T=c(a,y);if(y+=2,b===0&&T===1){var M=t(a,y,h),w=t(a,y+h,v);s.item_loc[x]={length:w,offset:M+S}}y+=T*(h+v)}}function r(a,s){for(var h=c(a,4),v=6,m=0;m<h;m++){var p=E(a,v);if(!p)break;if(p.boxtype==="infe"){for(var y=c(p.data,4),l="",x=8;x<p.data.length&&p.data[x];x++)l+=String.fromCharCode(p.data[x]);s.item_inf[l]=y}v=p.end}}function i(a,s){for(var h=0;;){var v=E(a,h);if(!v)break;v.boxtype==="ipco"&&A(v.data,s),h=v.end}}function n(a,s){for(var h=4;;){var v=E(a,h);if(!v)break;v.boxtype==="iprp"&&i(v.data,s),v.boxtype==="iloc"&&e(v.data,s),v.boxtype==="iinf"&&r(v.data,s),h=v.end}}function o(a){var s=a.reduce(function(m,p){return m.width>p.width||m.width===p.width&&m.height>p.height?m:p}),h=a.reduce(function(m,p){return m.height>p.height||m.height===p.height&&m.width>p.width?m:p}),v;return s.width>h.height||s.width===h.height&&s.height>h.width?v=s:v=h,v}V.exports.readSizeFromMeta=function(a){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(n(a,s),!!s.sizes.length){var h=o(s.sizes),v=1;s.transforms.forEach(function(p){var y={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},l={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(p.type==="imir"&&(p.value===0?v=l[v]:(v=l[v],v=y[v],v=y[v])),p.type==="irot")for(var x=0;x<p.value;x++)v=y[v]});var m=null;return s.item_inf.Exif&&(m=s.item_loc[s.item_inf.Exif]),{width:h.width,height:h.height,orientation:s.transforms.length?v:null,variants:s.sizes,exif_location:m}}},V.exports.getMimeType=function(a){var s=String.fromCharCode.apply(null,a.slice(0,4)),h={};h[s]=!0;for(var v=8;v<a.length;v+=4)h[String.fromCharCode.apply(null,a.slice(v,v+4))]=!0;if(!(!h.mif1&&!h.msf1&&!h.miaf))return s==="avif"||s==="avis"||s==="avio"?{type:"avif",mime:"image/avif"}:s==="heic"||s==="heix"?{type:"heic",mime:"image/heic"}:s==="hevc"||s==="hevx"?{type:"heic",mime:"image/heic-sequence"}:h.avif||h.avis?{type:"avif",mime:"image/avif"}:h.heic||h.heix||h.hevc||h.hevx||h.heis?h.msf1?{type:"heif",mime:"image/heif-sequence"}:{type:"heif",mime:"image/heif"}:{type:"avif",mime:"image/avif"}}}),R1=Vt((X,V)=>{function c(A,t){var e=new Error(A);return e.code=t,e}function g(A){try{return decodeURIComponent(escape(A))}catch{return A}}function E(A,t,e){this.input=A.subarray(t,e),this.start=t;var r=String.fromCharCode.apply(null,this.input.subarray(0,4));if(r!=="II*\0"&&r!=="MM\0*")throw c("invalid TIFF signature","EBADDATA");this.big_endian=r[0]==="M"}E.prototype.each=function(A){this.aborted=!1;var t=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:t}];this.ifds_to_read.length>0&&!this.aborted;){var e=this.ifds_to_read.shift();e.offset&&this.scan_ifd(e.id,e.offset,A)}},E.prototype.read_uint16=function(A){var t=this.input;if(A+2>t.length)throw c("unexpected EOF","EBADDATA");return this.big_endian?t[A]*256+t[A+1]:t[A]+t[A+1]*256},E.prototype.read_uint32=function(A){var t=this.input;if(A+4>t.length)throw c("unexpected EOF","EBADDATA");return this.big_endian?t[A]*16777216+t[A+1]*65536+t[A+2]*256+t[A+3]:t[A]+t[A+1]*256+t[A+2]*65536+t[A+3]*16777216},E.prototype.is_subifd_link=function(A,t){return A===0&&t===34665||A===0&&t===34853||A===34665&&t===40965},E.prototype.exif_format_length=function(A){switch(A){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},E.prototype.exif_format_read=function(A,t){var e;switch(A){case 1:case 2:return e=this.input[t],e;case 6:return e=this.input[t],e|(e&128)*33554430;case 3:return e=this.read_uint16(t),e;case 8:return e=this.read_uint16(t),e|(e&32768)*131070;case 4:return e=this.read_uint32(t),e;case 9:return e=this.read_uint32(t),e|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},E.prototype.scan_ifd=function(A,t,e){var r=this.read_uint16(t);t+=2;for(var i=0;i<r;i++){var n=this.read_uint16(t),o=this.read_uint16(t+2),a=this.read_uint32(t+4),s=this.exif_format_length(o),h=a*s,v=h<=4?t+8:this.read_uint32(t+8),m=!1;if(v+h>this.input.length)throw c("unexpected EOF","EBADDATA");for(var p=[],y=v,l=0;l<a;l++,y+=s){var x=this.exif_format_read(o,y);if(x===null){p=null;break}p.push(x)}Array.isArray(p)&&o===2&&(p=g(String.fromCharCode.apply(null,p)),p&&p[p.length-1]==="\0"&&(p=p.slice(0,-1))),this.is_subifd_link(A,n)&&Array.isArray(p)&&Number.isInteger(p[0])&&p[0]>0&&(this.ifds_to_read.push({id:n,offset:p[0]}),m=!0);var b={is_big_endian:this.big_endian,ifd:A,tag:n,format:o,count:a,entry_offset:t+this.start,data_length:h,data_offset:v+this.start,value:p,is_subifd_link:m};if(e(b)===!1){this.aborted=!0;return}t+=12}A===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},V.exports.ExifParser=E,V.exports.get_orientation=function(A){var t=0;try{return new E(A,0,A.length).each(function(e){if(e.ifd===0&&e.tag===274&&Array.isArray(e.value))return t=e.value[0],!1}),t}catch{return-1}}}),_6=Vt((X,V)=>{var c=Vl().str2arr,g=Vl().sliceEq,E=Vl().readUInt32BE,A=x6(),t=R1(),e=c("ftyp");V.exports=function(r){if(g(r,4,e)){var i=A.unbox(r,0);if(i){var n=A.getMimeType(i.data);if(n){for(var o,a=i.end;;){var s=A.unbox(r,a);if(!s)break;if(a=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){o=s.data;break}}if(o){var h=A.readSizeFromMeta(o);if(h){var v={width:h.width,height:h.height,type:n.type,mime:n.mime,wUnits:"px",hUnits:"px"};if(h.variants.length>1&&(v.variants=h.variants),h.orientation&&(v.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=r.length){var m=E(r,h.exif_location.offset),p=r.slice(h.exif_location.offset+m+4,h.exif_location.offset+h.exif_location.length),y=t.get_orientation(p);y>0&&(v.orientation=y)}return v}}}}}}}),b6=Vt((X,V)=>{var c=Vl().str2arr,g=Vl().sliceEq,E=Vl().readUInt16LE,A=c("BM");V.exports=function(t){if(!(t.length<26)&&g(t,0,A))return{width:E(t,18),height:E(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}),w6=Vt((X,V)=>{var c=Vl().str2arr,g=Vl().sliceEq,E=Vl().readUInt16LE,A=c("GIF87a"),t=c("GIF89a");V.exports=function(e){if(!(e.length<10)&&!(!g(e,0,A)&&!g(e,0,t)))return{width:E(e,6),height:E(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}),T6=Vt((X,V)=>{var c=Vl().readUInt16LE,g=0,E=1,A=16;V.exports=function(t){var e=c(t,0),r=c(t,2),i=c(t,4);if(!(e!==g||r!==E||!i)){for(var n=[],o={width:0,height:0},a=0;a<i;a++){var s=t[6+A*a]||256,h=t[6+A*a+1]||256,v={width:s,height:h};n.push(v),(s>o.width||h>o.height)&&(o=v)}return{width:o.width,height:o.height,variants:n,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}),k6=Vt((X,V)=>{var c=Vl().readUInt16BE,g=Vl().str2arr,E=Vl().sliceEq,A=R1(),t=g("Exif\0\0");V.exports=function(e){if(!(e.length<2)&&!(e[0]!==255||e[1]!==216||e[2]!==255))for(var r=2;;){for(;;){if(e.length-r<2)return;if(e[r++]===255)break}for(var i=e[r++],n;i===255;)i=e[r++];if(208<=i&&i<=217||i===1)n=0;else if(192<=i&&i<=254){if(e.length-r<2)return;n=c(e,r)-2,r+=2}else return;if(i===217||i===218)return;var o;if(i===225&&n>=10&&E(e,r,t)&&(o=A.get_orientation(e.slice(r+6,r+n))),n>=5&&192<=i&&i<=207&&i!==196&&i!==200&&i!==204){if(e.length-r<n)return;var a={width:c(e,r+3),height:c(e,r+1),type:"jpg",mime:"image/jpeg",wUnits:"px",hUnits:"px"};return o>0&&(a.orientation=o),a}r+=n}}}),A6=Vt((X,V)=>{var c=Vl().str2arr,g=Vl().sliceEq,E=Vl().readUInt32BE,A=c(`PNG\r
|
||
|
||
`),t=c("IHDR");V.exports=function(e){if(!(e.length<24)&&g(e,0,A)&&g(e,12,t))return{width:E(e,16),height:E(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}),M6=Vt((X,V)=>{var c=Vl().str2arr,g=Vl().sliceEq,E=Vl().readUInt32BE,A=c("8BPS\0");V.exports=function(t){if(!(t.length<22)&&g(t,0,A))return{width:E(t,18),height:E(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}),S6=Vt((X,V)=>{function c(s){return s===32||s===9||s===13||s===10}function g(s){return typeof s=="number"&&isFinite(s)&&s>0}function E(s){var h=0,v=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(h=3);h<v&&c(s[h]);)h++;return h===v?!1:s[h]===60}var A=/<[-_.:a-zA-Z0-9][^>]*>/,t=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,e=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,i=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,n=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function o(s){var h=s.match(e),v=s.match(r),m=s.match(i);return{width:h&&(h[1]||h[2]),height:v&&(v[1]||v[2]),viewbox:m&&(m[1]||m[2])}}function a(s){return n.test(s)?s.match(n)[0]:"px"}V.exports=function(s){if(E(s)){for(var h="",v=0;v<s.length;v++)h+=String.fromCharCode(s[v]);var m=(h.match(A)||[""])[0];if(t.test(m)){var p=o(m),y=parseFloat(p.width),l=parseFloat(p.height);if(p.width&&p.height)return!g(y)||!g(l)?void 0:{width:y,height:l,type:"svg",mime:"image/svg+xml",wUnits:a(p.width),hUnits:a(p.height)};var x=(p.viewbox||"").split(" "),b={width:x[2],height:x[3]},S=parseFloat(b.width),T=parseFloat(b.height);if(!(!g(S)||!g(T))&&a(b.width)===a(b.height)){var M=S/T;return p.width?g(y)?{width:y,height:y/M,type:"svg",mime:"image/svg+xml",wUnits:a(p.width),hUnits:a(p.width)}:void 0:p.height?g(l)?{width:l*M,height:l,type:"svg",mime:"image/svg+xml",wUnits:a(p.height),hUnits:a(p.height)}:void 0:{width:S,height:T,type:"svg",mime:"image/svg+xml",wUnits:a(b.width),hUnits:a(b.height)}}}}}}),E6=Vt((X,V)=>{var c=Vl().str2arr,g=Vl().sliceEq,E=Vl().readUInt16LE,A=Vl().readUInt16BE,t=Vl().readUInt32LE,e=Vl().readUInt32BE,r=c("II*\0"),i=c("MM\0*");function n(s,h,v){return v?A(s,h):E(s,h)}function o(s,h,v){return v?e(s,h):t(s,h)}function a(s,h,v){var m=n(s,h+2,v),p=o(s,h+4,v);return p!==1||m!==3&&m!==4?null:m===3?n(s,h+8,v):o(s,h+8,v)}V.exports=function(s){if(!(s.length<8)&&!(!g(s,0,r)&&!g(s,0,i))){var h=s[0]===77,v=o(s,4,h)-8;if(!(v<0)){var m=v+8;if(!(s.length-m<2)){var p=n(s,m+0,h)*12;if(!(p<=0)&&(m+=2,!(s.length-m<p))){var y,l,x,b;for(y=0;y<p;y+=12)b=n(s,m+y,h),b===256?l=a(s,m+y,h):b===257&&(x=a(s,m+y,h));if(l&&x)return{width:l,height:x,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}}}}}}}),P6=Vt((X,V)=>{var c=Vl().str2arr,g=Vl().sliceEq,E=Vl().readUInt16LE,A=Vl().readUInt32LE,t=R1(),e=c("RIFF"),r=c("WEBP");function i(a,s){if(!(a[s+3]!==157||a[s+4]!==1||a[s+5]!==42))return{width:E(a,s+6)&16383,height:E(a,s+8)&16383,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function n(a,s){if(a[s]===47){var h=A(a,s+1);return{width:(h&16383)+1,height:(h>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function o(a,s){return{width:(a[s+6]<<16|a[s+5]<<8|a[s+4])+1,height:(a[s+9]<<s|a[s+8]<<8|a[s+7])+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}V.exports=function(a){if(!(a.length<16)&&!(!g(a,0,e)&&!g(a,8,r))){var s=12,h=null,v=0,m=A(a,4)+8;if(!(m>a.length)){for(;s+8<m;){if(a[s]===0){s++;continue}var p=String.fromCharCode.apply(null,a.slice(s,s+4)),y=A(a,s+4);p==="VP8 "&&y>=10?h=h||i(a,s+8):p==="VP8L"&&y>=9?h=h||n(a,s+8):p==="VP8X"&&y>=10?h=h||o(a,s+8):p==="EXIF"&&(v=t.get_orientation(a.slice(s+8,s+8+y)),s=1/0),s+=8+y}if(h)return v>0&&(h.orientation=v),h}}}}),I6=Vt((X,V)=>{V.exports={avif:_6(),bmp:b6(),gif:w6(),ico:T6(),jpeg:k6(),png:A6(),psd:M6(),svg:S6(),tiff:E6(),webp:P6()}}),L6=Vt((X,V)=>{var c=I6();function g(E){for(var A=Object.keys(c),t=0;t<A.length;t++){var e=c[A[t]](E);if(e)return e}return null}V.exports=function(E){return g(E)},V.exports.parsers=c}),C6=Vt(X=>{var V=L6(),c=Np().IMAGE_URL_PREFIX,g=m0().Buffer;X.getImageSize=function(E){var A=E.replace(c,""),t=new g(A,"base64");return V(t)}}),D6=Vt((X,V)=>{var c=qr(),g=Dg(),E=vo(),A=ao(),t=qr().maxRowLength,e=C6().getImageSize;V.exports=function(o,a){var s,h;if(a._hasZ)s=a.z.length,h=t(a.z);else if(a._hasSource){var v=e(a.source);s=v.height,h=v.width}var m=A.getFromId(o,a.xaxis||"x"),p=A.getFromId(o,a.yaxis||"y"),y=m.d2c(a.x0)-a.dx/2,l=p.d2c(a.y0)-a.dy/2,x,b=[y,y+h*a.dx],S=[l,l+s*a.dy];if(m&&m.type==="log")for(x=0;x<h;x++)b.push(y+x*a.dx);if(p&&p.type==="log")for(x=0;x<s;x++)S.push(l+x*a.dy);a._extremes[m._id]=A.findExtremes(m,b),a._extremes[p._id]=A.findExtremes(p,S),a._scaler=n(a);var T={x0:y,y0:l,z:a.z,w:h,h:s};return[T]};function r(o,a,s,h){return function(v){return c.constrain((v-o)*a,s,h)}}function i(o,a){return function(s){return c.constrain(s,o,a)}}function n(o){var a=g.colormodel[o.colormodel],s=a.colormodel||o.colormodel,h=s.length;o._sArray=[];for(var v=0;v<h;v++)a.min[v]!==o.zmin[v]||a.max[v]!==o.zmax[v]?o._sArray.push(r(o.zmin[v],(a.max[v]-a.min[v])/(o.zmax[v]-o.zmin[v]),a.min[v],a.max[v])):o._sArray.push(i(a.min[v],a.max[v]));return function(m){for(var p=m.slice(0,h),y=0;y<h;y++){var l=p[y];if(!E(l))return!1;p[y]=o._sArray[y](l)}return p}}}),z6=Vt((X,V)=>{var c=Ai(),g=qr(),E=g.strTranslate,A=Cf(),t=Dg(),e=r2(),r=x1().STYLE;V.exports=function(i,n,o,a){var s=n.xaxis,h=n.yaxis,v=!i._context._exportedPlot&&e();g.makeTraceGroups(a,o,"im").each(function(m){var p=c.select(this),y=m[0],l=y.trace,x=(l.zsmooth==="fast"||l.zsmooth===!1&&v)&&!l._hasZ&&l._hasSource&&s.type==="linear"&&h.type==="linear";l._realImage=x;var b=y.z,S=y.x0,T=y.y0,M=y.w,w=y.h,u=l.dx,f=l.dy,k,_,D,I,O,B;for(B=0;k===void 0&&B<M;)k=s.c2p(S+B*u),B++;for(B=M;_===void 0&&B>0;)_=s.c2p(S+B*u),B--;for(B=0;I===void 0&&B<w;)I=h.c2p(T+B*f),B++;for(B=w;O===void 0&&B>0;)O=h.c2p(T+B*f),B--;if(_<k&&(D=_,_=k,k=D),O<I&&(D=I,I=O,O=D),!x){var R=.5;k=Math.max(-R*s._length,k),_=Math.min((1+R)*s._length,_),I=Math.max(-R*h._length,I),O=Math.min((1+R)*h._length,O)}var L=Math.round(_-k),F=Math.round(O-I),N=L<=0||F<=0;if(N){var j=p.selectAll("image").data([]);j.exit().remove();return}function G(Y){var q=document.createElement("canvas");q.width=L,q.height=F;var ot=q.getContext("2d",{willReadFrequently:!0}),it=function(gt){return g.constrain(Math.round(s.c2p(S+gt*u)-k),0,L)},dt=function(gt){return g.constrain(Math.round(h.c2p(T+gt*f)-I),0,F)},wt=t.colormodel[l.colormodel],xt=wt.colormodel||l.colormodel,Ft=wt.fmt,Et;for(B=0;B<y.w;B++){var Nt=it(B),te=it(B+1);if(!(te===Nt||isNaN(te)||isNaN(Nt)))for(var Jt=0;Jt<y.h;Jt++){var Qt=dt(Jt),Wt=dt(Jt+1);Wt===Qt||isNaN(Wt)||isNaN(Qt)||!Y(B,Jt)||(Et=l._scaler(Y(B,Jt)),Et?ot.fillStyle=xt+"("+Ft(Et).join(",")+")":ot.fillStyle="rgba(0,0,0,0)",ot.fillRect(Nt,Qt,te-Nt,Wt-Qt))}}return q}var rt=p.selectAll("image").data([m]);rt.enter().append("svg:image").attr({xmlns:A.svg,preserveAspectRatio:"none"}),rt.exit().remove();var ct=l.zsmooth===!1?r:"";if(x){var lt=g.simpleMap(s.range,s.r2l),tt=g.simpleMap(h.range,h.r2l),Z=lt[1]<lt[0],st=tt[1]>tt[0];if(Z||st){var $=k+L/2,Q=I+F/2;ct+="transform:"+E($+"px",Q+"px")+"scale("+(Z?-1:1)+","+(st?-1:1)+")"+E(-$+"px",-Q+"px")+";"}}rt.attr("style",ct);var nt=new Promise(function(Y){if(l._hasZ)Y();else if(l._hasSource)if(l._canvas&&l._canvas.el.width===M&&l._canvas.el.height===w&&l._canvas.source===l.source)Y();else{var q=document.createElement("canvas");q.width=M,q.height=w;var ot=q.getContext("2d",{willReadFrequently:!0});l._image=l._image||new Image;var it=l._image;it.onload=function(){ot.drawImage(it,0,0),l._canvas={el:q,source:l.source},Y()},it.setAttribute("src",l.source)}}).then(function(){var Y,q;if(l._hasZ)q=G(function(dt,wt){var xt=b[wt][dt];return g.isTypedArray(xt)&&(xt=Array.from(xt)),xt}),Y=q.toDataURL("image/png");else if(l._hasSource)if(x)Y=l.source;else{var ot=l._canvas.el.getContext("2d",{willReadFrequently:!0}),it=ot.getImageData(0,0,M,w).data;q=G(function(dt,wt){var xt=4*(wt*M+dt);return[it[xt],it[xt+1],it[xt+2],it[xt+3]]}),Y=q.toDataURL("image/png")}rt.attr({"xlink:href":Y,height:F,width:L,x:k,y:I})});i._promises.push(nt)})}}),O6=Vt((X,V)=>{var c=Ai();V.exports=function(g){c.select(g).selectAll(".im image").style("opacity",function(E){return E[0].trace.opacity})}}),F6=Vt((X,V)=>{var c=Hu(),g=qr(),E=g.isArrayOrTypedArray,A=Dg();V.exports=function(t,e,r){var i=t.cd[0],n=i.trace,o=t.xa,a=t.ya;if(!(c.inbox(e-i.x0,e-(i.x0+i.w*n.dx),0)>0||c.inbox(r-i.y0,r-(i.y0+i.h*n.dy),0)>0)){var s=Math.floor((e-i.x0)/n.dx),h=Math.floor(Math.abs(r-i.y0)/n.dy),v;if(n._hasZ?v=i.z[h][s]:n._hasSource&&(v=n._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(s,h,1,1).data),!!v){var m=i.hi||n.hoverinfo,p;if(m){var y=m.split("+");y.indexOf("all")!==-1&&(y=["color"]),y.indexOf("color")!==-1&&(p=!0)}var l=A.colormodel[n.colormodel],x=l.colormodel||n.colormodel,b=x.length,S=n._scaler(v),T=l.suffix,M=[];(n.hovertemplate||p)&&(M.push("["+[S[0]+T[0],S[1]+T[1],S[2]+T[2]].join(", ")),b===4&&M.push(", "+S[3]+T[3]),M.push("]"),M=M.join(""),t.extraText=x.toUpperCase()+": "+M);var w;E(n.hovertext)&&E(n.hovertext[h])?w=n.hovertext[h][s]:E(n.text)&&E(n.text[h])&&(w=n.text[h][s]);var u=a.c2p(i.y0+(h+.5)*n.dy),f=i.x0+(s+.5)*n.dx,k=i.y0+(h+.5)*n.dy,_="["+v.slice(0,n.colormodel.length).join(", ")+"]";return[g.extendFlat(t,{index:[h,s],x0:o.c2p(i.x0+s*n.dx),x1:o.c2p(i.x0+(s+1)*n.dx),y0:u,y1:u,color:S,xVal:f,xLabelVal:f,yVal:k,yLabelVal:k,zLabelVal:_,text:w,hovertemplateLabels:{zLabel:_,colorLabel:M,"color[0]Label":S[0]+T[0],"color[1]Label":S[1]+T[1],"color[2]Label":S[2]+T[2],"color[3]Label":S[3]+T[3]}})]}}}}),B6=Vt((X,V)=>{V.exports=function(c,g){return"xVal"in g&&(c.x=g.xVal),"yVal"in g&&(c.y=g.yVal),g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),c.color=g.color,c.colormodel=g.trace.colormodel,c.z||(c.z=g.color),c}}),R6=Vt((X,V)=>{V.exports={attributes:E2(),supplyDefaults:DM(),calc:D6(),plot:z6(),style:O6(),hoverPoints:F6(),eventData:B6(),moduleType:"trace",name:"image",basePlotModule:Pc(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}),j6=Vt((X,V)=>{V.exports=R6()}),x0=Vt((X,V)=>{var c=Ks(),g=pu().attributes,E=Nl(),A=Hc(),t=Zo().hovertemplateAttrs,e=Zo().texttemplateAttrs,r=po().extendFlat,i=Eh().pattern,n=E({editType:"plot",arrayOk:!0,colorEditType:"plot"});V.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:A.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:i,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:r({},c.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:t({},{keys:["label","color","value","percent","text"]}),texttemplate:e({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:r({},n,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:r({},n,{}),outsidetextfont:r({},n,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:r({},n,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:g({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}),_0=Vt((X,V)=>{var c=vo(),g=qr(),E=x0(),A=pu().defaults,t=zf().handleText,e=qr().coercePattern;function r(o,a){var s=g.isArrayOrTypedArray(o),h=g.isArrayOrTypedArray(a),v=Math.min(s?o.length:1/0,h?a.length:1/0);if(isFinite(v)||(v=0),v&&h){for(var m,p=0;p<v;p++){var y=a[p];if(c(y)&&y>0){m=!0;break}}m||(v=0)}return{hasLabels:s,hasValues:h,len:v}}function i(o,a,s,h,v){var m=h("marker.line.width");m&&h("marker.line.color",v?void 0:s.paper_bgcolor);var p=h("marker.colors");e(h,"marker.pattern",p),o.marker&&!a.marker.pattern.fgcolor&&(a.marker.pattern.fgcolor=o.marker.colors),a.marker.pattern.bgcolor||(a.marker.pattern.bgcolor=s.paper_bgcolor)}function n(o,a,s,h){function v(_,D){return g.coerce(o,a,E,_,D)}var m=v("labels"),p=v("values"),y=r(m,p),l=y.len;if(a._hasLabels=y.hasLabels,a._hasValues=y.hasValues,!a._hasLabels&&a._hasValues&&(v("label0"),v("dlabel")),!l){a.visible=!1;return}a._length=l,i(o,a,h,v,!0),v("scalegroup");var x=v("text"),b=v("texttemplate"),S;if(b||(S=v("textinfo",g.isArrayOrTypedArray(x)?"text+percent":"percent")),v("hovertext"),v("hovertemplate"),b||S&&S!=="none"){var T=v("textposition");t(o,a,h,v,T,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var M=Array.isArray(T)||T==="auto",w=M||T==="outside";w&&v("automargin"),(T==="inside"||T==="auto"||Array.isArray(T))&&v("insidetextorientation")}else S==="none"&&v("textposition","none");A(a,h,v);var u=v("hole"),f=v("title.text");if(f){var k=v("title.position",u?"middle center":"top center");!u&&k==="middle center"&&(a.title.position="top center"),g.coerceFont(v,"title.font",h.font)}v("sort"),v("direction"),v("rotation"),v("pull")}V.exports={handleLabelsAndValues:r,handleMarkerDefaults:i,supplyDefaults:n}}),j1=Vt((X,V)=>{V.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),N6=Vt((X,V)=>{var c=qr(),g=j1();V.exports=function(E,A){function t(e,r){return c.coerce(E,A,g,e,r)}t("hiddenlabels"),t("piecolorway",A.colorway),t("extendpiecolors")}}),Bg=Vt((X,V)=>{var c=vo(),g=yh(),E=vi(),A={};function t(n,o){var a=[],s=n._fullLayout,h=s.hiddenlabels||[],v=o.labels,m=o.marker.colors||[],p=o.values,y=o._length,l=o._hasValues&&y,x,b;if(o.dlabel)for(v=new Array(y),x=0;x<y;x++)v[x]=String(o.label0+x*o.dlabel);var S={},T=e(s["_"+o.type+"colormap"]),M=0,w=!1;for(x=0;x<y;x++){var u,f,k;if(l){if(u=p[x],!c(u))continue;u=+u}else u=1;f=v[x],(f===void 0||f==="")&&(f=x),f=String(f);var _=S[f];_===void 0?(S[f]=a.length,k=h.indexOf(f)!==-1,k||(M+=u),a.push({v:u,label:f,color:T(m[x],f),i:x,pts:[x],hidden:k})):(w=!0,b=a[_],b.v+=u,b.pts.push(x),b.hidden||(M+=u),b.color===!1&&m[x]&&(b.color=T(m[x],f)))}a=a.filter(function(I){return I.v>=0});var D=o.type==="funnelarea"?w:o.sort;return D&&a.sort(function(I,O){return O.v-I.v}),a[0]&&(a[0].vTotal=M),a}function e(n){return function(o,a){return!o||(o=g(o),!o.isValid())?!1:(o=E.addOpacity(o,o.getAlpha()),n[a]||(n[a]=o),o)}}function r(n,o){var a=(o||{}).type;a||(a="pie");var s=n._fullLayout,h=n.calcdata,v=s[a+"colorway"],m=s["_"+a+"colormap"];s["extend"+a+"colors"]&&(v=i(v,A));for(var p=0,y=0;y<h.length;y++){var l=h[y],x=l[0].trace.type;if(x===a)for(var b=0;b<l.length;b++){var S=l[b];S.color===!1&&(m[S.label]?S.color=m[S.label]:(m[S.label]=S.color=v[p%v.length],p++))}}}function i(n,o){var a,s=JSON.stringify(n),h=o[s];if(!h){for(h=n.slice(),a=0;a<n.length;a++)h.push(g(n[a]).lighten(20).toHexString());for(a=0;a<n.length;a++)h.push(g(n[a]).darken(20).toHexString());o[s]=h}return h}V.exports={calc:t,crossTraceCalc:r,makePullColorFn:e,generateExtendedColors:i}}),U6=Vt((X,V)=>{var c=vf().appendArrayMultiPointValues;V.exports=function(g,E){var A={curveNumber:E.index,pointNumbers:g.pts,data:E._input,fullData:E,label:g.label,color:g.color,value:g.v,percent:g.percent,text:g.text,bbox:g.bbox,v:g.v};return g.pts.length===1&&(A.pointNumber=A.i=g.pts[0]),c(A,E,g.pts),E.type==="funnelarea"&&(delete A.v,delete A.i),A}}),N1=Vt((X,V)=>{var c=Ai(),g=fu(),E=Hu(),A=vi(),t=go(),e=qr(),r=e.strScale,i=e.strTranslate,n=sl(),o=of(),a=o.recordMinTextSize,s=o.clearMinTextSize,h=d0().TEXTPAD,v=Sd(),m=U6(),p=qr().isValidTextValue;function y(st,$){var Q=st._context.staticPlot,nt=st._fullLayout,Y=nt._size;s("pie",nt),T($,st),G($,Y);var q=e.makeTraceGroups(nt._pielayer,$,"trace").each(function(ot){var it=c.select(this),dt=ot[0],wt=dt.trace;ct(ot),it.attr("stroke-linejoin","round"),it.each(function(){var xt=c.select(this).selectAll("g.slice").data(ot);xt.enter().append("g").classed("slice",!0),xt.exit().remove();var Ft=[[[],[]],[[],[]]],Et=!1;xt.each(function(vt,Ut){if(vt.hidden){c.select(this).selectAll("path,g").remove();return}vt.pointNumber=vt.i,vt.curveNumber=wt.index,Ft[vt.pxmid[1]<0?0:1][vt.pxmid[0]<0?0:1].push(vt);var Kt=dt.cx,Zt=dt.cy,le=c.select(this),Te=le.selectAll("path.surface").data([vt]);if(Te.enter().append("path").classed("surface",!0).style({"pointer-events":Q?"none":"all"}),le.call(x,st,ot),wt.pull){var Se=+v.castOption(wt.pull,vt.pts)||0;Se>0&&(Kt+=Se*vt.pxmid[0],Zt+=Se*vt.pxmid[1])}vt.cxFinal=Kt,vt.cyFinal=Zt;function Fe(he,Dt,qt,zt){var ut=zt*(Dt[0]-he[0]),yt=zt*(Dt[1]-he[1]);return"a"+zt*dt.r+","+zt*dt.r+" 0 "+vt.largeArc+(qt?" 1 ":" 0 ")+ut+","+yt}var Oe=wt.hole;if(vt.v===dt.vTotal){var ur="M"+(Kt+vt.px0[0])+","+(Zt+vt.px0[1])+Fe(vt.px0,vt.pxmid,!0,1)+Fe(vt.pxmid,vt.px0,!0,1)+"Z";Oe?Te.attr("d","M"+(Kt+Oe*vt.px0[0])+","+(Zt+Oe*vt.px0[1])+Fe(vt.px0,vt.pxmid,!1,Oe)+Fe(vt.pxmid,vt.px0,!1,Oe)+"Z"+ur):Te.attr("d",ur)}else{var fr=Fe(vt.px0,vt.px1,!0,1);if(Oe){var We=1-Oe;Te.attr("d","M"+(Kt+Oe*vt.px1[0])+","+(Zt+Oe*vt.px1[1])+Fe(vt.px1,vt.px0,!1,Oe)+"l"+We*vt.px0[0]+","+We*vt.px0[1]+fr+"Z")}else Te.attr("d","M"+Kt+","+Zt+"l"+vt.px0[0]+","+vt.px0[1]+fr+"Z")}tt(st,vt,dt);var Lr=v.castOption(wt.textposition,vt.pts),kr=le.selectAll("g.slicetext").data(vt.text&&Lr!=="none"?[0]:[]);kr.enter().append("g").classed("slicetext",!0),kr.exit().remove(),kr.each(function(){var he=e.ensureSingle(c.select(this),"text","",function($t){$t.attr("data-notex",1)}),Dt=e.ensureUniformFontSize(st,Lr==="outside"?b(wt,vt,nt.font):S(wt,vt,nt.font));he.text(vt.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(t.font,Dt).call(n.convertToTspans,st);var qt=t.bBox(he.node()),zt;if(Lr==="outside")zt=O(qt,vt);else if(zt=M(qt,vt,dt),Lr==="auto"&&zt.scale<1){var ut=e.ensureUniformFontSize(st,wt.outsidetextfont);he.call(t.font,ut),qt=t.bBox(he.node()),zt=O(qt,vt)}var yt=zt.textPosAngle,Mt=yt===void 0?vt.pxmid:lt(dt.r,yt);if(zt.targetX=Kt+Mt[0]*zt.rCenter+(zt.x||0),zt.targetY=Zt+Mt[1]*zt.rCenter+(zt.y||0),Z(zt,qt),zt.outside){var Ot=zt.targetY;vt.yLabelMin=Ot-qt.height/2,vt.yLabelMid=Ot,vt.yLabelMax=Ot+qt.height/2,vt.labelExtraX=0,vt.labelExtraY=0,Et=!0}zt.fontSize=Dt.size,a(wt.type,zt,nt),ot[Ut].transform=zt,e.setTransormAndDisplay(he,zt)})});var Nt=c.select(this).selectAll("g.titletext").data(wt.title.text?[0]:[]);if(Nt.enter().append("g").classed("titletext",!0),Nt.exit().remove(),Nt.each(function(){var vt=e.ensureSingle(c.select(this),"text","",function(Zt){Zt.attr("data-notex",1)}),Ut=wt.title.text;wt._meta&&(Ut=e.templateString(Ut,wt._meta)),vt.text(Ut).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(t.font,wt.title.font).call(n.convertToTspans,st);var Kt;wt.title.position==="middle center"?Kt=B(dt):Kt=R(dt,Y),vt.attr("transform",i(Kt.x,Kt.y)+r(Math.min(1,Kt.scale))+i(Kt.tx,Kt.ty))}),Et&&j(Ft,wt),l(xt,wt),Et&&wt.automargin){var te=t.bBox(it.node()),Jt=wt.domain,Qt=Y.w*(Jt.x[1]-Jt.x[0]),Wt=Y.h*(Jt.y[1]-Jt.y[0]),gt=(.5*Qt-dt.r)/Y.w,bt=(.5*Wt-dt.r)/Y.h;g.autoMargin(st,"pie."+wt.uid+".automargin",{xl:Jt.x[0]-gt,xr:Jt.x[1]+gt,yb:Jt.y[0]-bt,yt:Jt.y[1]+bt,l:Math.max(dt.cx-dt.r-te.left,0),r:Math.max(te.right-(dt.cx+dt.r),0),b:Math.max(te.bottom-(dt.cy+dt.r),0),t:Math.max(dt.cy-dt.r-te.top,0),pad:5})}})});setTimeout(function(){q.selectAll("tspan").each(function(){var ot=c.select(this);ot.attr("dy")&&ot.attr("dy",ot.attr("dy"))})},0)}function l(st,$){st.each(function(Q){var nt=c.select(this);if(!Q.labelExtraX&&!Q.labelExtraY){nt.select("path.textline").remove();return}var Y=nt.select("g.slicetext text");Q.transform.targetX+=Q.labelExtraX,Q.transform.targetY+=Q.labelExtraY,e.setTransormAndDisplay(Y,Q.transform);var q=Q.cxFinal+Q.pxmid[0],ot=Q.cyFinal+Q.pxmid[1],it="M"+q+","+ot,dt=(Q.yLabelMax-Q.yLabelMin)*(Q.pxmid[0]<0?-1:1)/4;if(Q.labelExtraX){var wt=Q.labelExtraX*Q.pxmid[1]/Q.pxmid[0],xt=Q.yLabelMid+Q.labelExtraY-(Q.cyFinal+Q.pxmid[1]);Math.abs(wt)>Math.abs(xt)?it+="l"+xt*Q.pxmid[0]/Q.pxmid[1]+","+xt+"H"+(q+Q.labelExtraX+dt):it+="l"+Q.labelExtraX+","+wt+"v"+(xt-wt)+"h"+dt}else it+="V"+(Q.yLabelMid+Q.labelExtraY)+"h"+dt;e.ensureSingle(nt,"path","textline").call(A.stroke,$.outsidetextfont.color).attr({"stroke-width":Math.min(2,$.outsidetextfont.size/8),d:it,fill:"none"})})}function x(st,$,Q){var nt=Q[0],Y=nt.cx,q=nt.cy,ot=nt.trace,it=ot.type==="funnelarea";"_hasHoverLabel"in ot||(ot._hasHoverLabel=!1),"_hasHoverEvent"in ot||(ot._hasHoverEvent=!1),st.on("mouseover",function(dt){var wt=$._fullLayout,xt=$._fullData[ot.index];if(!($._dragging||wt.hovermode===!1)){var Ft=xt.hoverinfo;if(Array.isArray(Ft)&&(Ft=E.castHoverinfo({hoverinfo:[v.castOption(Ft,dt.pts)],_module:ot._module},wt,0)),Ft==="all"&&(Ft="label+text+value+percent+name"),xt.hovertemplate||Ft!=="none"&&Ft!=="skip"&&Ft){var Et=dt.rInscribed||0,Nt=Y+dt.pxmid[0]*(1-Et),te=q+dt.pxmid[1]*(1-Et),Jt=wt.separators,Qt=[];if(Ft&&Ft.indexOf("label")!==-1&&Qt.push(dt.label),dt.text=v.castOption(xt.hovertext||xt.text,dt.pts),Ft&&Ft.indexOf("text")!==-1){var Wt=dt.text;e.isValidTextValue(Wt)&&Qt.push(Wt)}dt.value=dt.v,dt.valueLabel=v.formatPieValue(dt.v,Jt),Ft&&Ft.indexOf("value")!==-1&&Qt.push(dt.valueLabel),dt.percent=dt.v/nt.vTotal,dt.percentLabel=v.formatPiePercent(dt.percent,Jt),Ft&&Ft.indexOf("percent")!==-1&&Qt.push(dt.percentLabel);var gt=xt.hoverlabel,bt=gt.font,vt=[];E.loneHover({trace:ot,x0:Nt-Et*nt.r,x1:Nt+Et*nt.r,y:te,_x0:it?Y+dt.TL[0]:Nt-Et*nt.r,_x1:it?Y+dt.TR[0]:Nt+Et*nt.r,_y0:it?q+dt.TL[1]:te-Et*nt.r,_y1:it?q+dt.BL[1]:te+Et*nt.r,text:Qt.join("<br>"),name:xt.hovertemplate||Ft.indexOf("name")!==-1?xt.name:void 0,idealAlign:dt.pxmid[0]<0?"left":"right",color:v.castOption(gt.bgcolor,dt.pts)||dt.color,borderColor:v.castOption(gt.bordercolor,dt.pts),fontFamily:v.castOption(bt.family,dt.pts),fontSize:v.castOption(bt.size,dt.pts),fontColor:v.castOption(bt.color,dt.pts),nameLength:v.castOption(gt.namelength,dt.pts),textAlign:v.castOption(gt.align,dt.pts),hovertemplate:v.castOption(xt.hovertemplate,dt.pts),hovertemplateLabels:dt,eventData:[m(dt,xt)]},{container:wt._hoverlayer.node(),outerContainer:wt._paper.node(),gd:$,inOut_bbox:vt}),dt.bbox=vt[0],ot._hasHoverLabel=!0}ot._hasHoverEvent=!0,$.emit("plotly_hover",{points:[m(dt,xt)],event:c.event})}}),st.on("mouseout",function(dt){var wt=$._fullLayout,xt=$._fullData[ot.index],Ft=c.select(this).datum();ot._hasHoverEvent&&(dt.originalEvent=c.event,$.emit("plotly_unhover",{points:[m(Ft,xt)],event:c.event}),ot._hasHoverEvent=!1),ot._hasHoverLabel&&(E.loneUnhover(wt._hoverlayer.node()),ot._hasHoverLabel=!1)}),st.on("click",function(dt){var wt=$._fullLayout,xt=$._fullData[ot.index];$._dragging||wt.hovermode===!1||($._hoverdata=[m(dt,xt)],E.click($,c.event))})}function b(st,$,Q){var nt=v.castOption(st.outsidetextfont.color,$.pts)||v.castOption(st.textfont.color,$.pts)||Q.color,Y=v.castOption(st.outsidetextfont.family,$.pts)||v.castOption(st.textfont.family,$.pts)||Q.family,q=v.castOption(st.outsidetextfont.size,$.pts)||v.castOption(st.textfont.size,$.pts)||Q.size,ot=v.castOption(st.outsidetextfont.weight,$.pts)||v.castOption(st.textfont.weight,$.pts)||Q.weight,it=v.castOption(st.outsidetextfont.style,$.pts)||v.castOption(st.textfont.style,$.pts)||Q.style,dt=v.castOption(st.outsidetextfont.variant,$.pts)||v.castOption(st.textfont.variant,$.pts)||Q.variant,wt=v.castOption(st.outsidetextfont.textcase,$.pts)||v.castOption(st.textfont.textcase,$.pts)||Q.textcase,xt=v.castOption(st.outsidetextfont.lineposition,$.pts)||v.castOption(st.textfont.lineposition,$.pts)||Q.lineposition,Ft=v.castOption(st.outsidetextfont.shadow,$.pts)||v.castOption(st.textfont.shadow,$.pts)||Q.shadow;return{color:nt,family:Y,size:q,weight:ot,style:it,variant:dt,textcase:wt,lineposition:xt,shadow:Ft}}function S(st,$,Q){var nt=v.castOption(st.insidetextfont.color,$.pts);!nt&&st._input.textfont&&(nt=v.castOption(st._input.textfont.color,$.pts));var Y=v.castOption(st.insidetextfont.family,$.pts)||v.castOption(st.textfont.family,$.pts)||Q.family,q=v.castOption(st.insidetextfont.size,$.pts)||v.castOption(st.textfont.size,$.pts)||Q.size,ot=v.castOption(st.insidetextfont.weight,$.pts)||v.castOption(st.textfont.weight,$.pts)||Q.weight,it=v.castOption(st.insidetextfont.style,$.pts)||v.castOption(st.textfont.style,$.pts)||Q.style,dt=v.castOption(st.insidetextfont.variant,$.pts)||v.castOption(st.textfont.variant,$.pts)||Q.variant,wt=v.castOption(st.insidetextfont.textcase,$.pts)||v.castOption(st.textfont.textcase,$.pts)||Q.textcase,xt=v.castOption(st.insidetextfont.lineposition,$.pts)||v.castOption(st.textfont.lineposition,$.pts)||Q.lineposition,Ft=v.castOption(st.insidetextfont.shadow,$.pts)||v.castOption(st.textfont.shadow,$.pts)||Q.shadow;return{color:nt||A.contrast($.color),family:Y,size:q,weight:ot,style:it,variant:dt,textcase:wt,lineposition:xt,shadow:Ft}}function T(st,$){for(var Q,nt,Y=0;Y<st.length;Y++)if(Q=st[Y][0],nt=Q.trace,nt.title.text){var q=nt.title.text;nt._meta&&(q=e.templateString(q,nt._meta));var ot=t.tester.append("text").attr("data-notex",1).text(q).call(t.font,nt.title.font).call(n.convertToTspans,$),it=t.bBox(ot.node(),!0);Q.titleBox={width:it.width,height:it.height},ot.remove()}}function M(st,$,Q){var nt=Q.r||$.rpx1,Y=$.rInscribed,q=$.startangle===$.stopangle;if(q)return{rCenter:1-Y,scale:0,rotate:0,textPosAngle:0};var ot=$.ring,it=ot===1&&Math.abs($.startangle-$.stopangle)===Math.PI*2,dt=$.halfangle,wt=$.midangle,xt=Q.trace.insidetextorientation,Ft=xt==="horizontal",Et=xt==="tangential",Nt=xt==="radial",te=xt==="auto",Jt=[],Qt;if(!te){var Wt=function(le,Te){if(w($,le)){var Se=Math.abs(le-$.startangle),Fe=Math.abs(le-$.stopangle),Oe=Se<Fe?Se:Fe;Te==="tan"?Qt=f(st,nt,ot,Oe,0):Qt=u(st,nt,ot,Oe,Math.PI/2),Qt.textPosAngle=le,Jt.push(Qt)}},gt;if(Ft||Et){for(gt=4;gt>=-4;gt-=2)Wt(Math.PI*gt,"tan");for(gt=4;gt>=-4;gt-=2)Wt(Math.PI*(gt+1),"tan")}if(Ft||Nt){for(gt=4;gt>=-4;gt-=2)Wt(Math.PI*(gt+1.5),"rad");for(gt=4;gt>=-4;gt-=2)Wt(Math.PI*(gt+.5),"rad")}}if(it||te||Ft){var bt=Math.sqrt(st.width*st.width+st.height*st.height);if(Qt={scale:Y*nt*2/bt,rCenter:1-Y,rotate:0},Qt.textPosAngle=($.startangle+$.stopangle)/2,Qt.scale>=1)return Qt;Jt.push(Qt)}(te||Nt)&&(Qt=u(st,nt,ot,dt,wt),Qt.textPosAngle=($.startangle+$.stopangle)/2,Jt.push(Qt)),(te||Et)&&(Qt=f(st,nt,ot,dt,wt),Qt.textPosAngle=($.startangle+$.stopangle)/2,Jt.push(Qt));for(var vt=0,Ut=0,Kt=0;Kt<Jt.length;Kt++){var Zt=Jt[Kt].scale;if(Ut<Zt&&(Ut=Zt,vt=Kt),!te&&Ut>=1)break}return Jt[vt]}function w(st,$){var Q=st.startangle,nt=st.stopangle;return Q>$&&$>nt||Q<$&&$<nt}function u(st,$,Q,nt,Y){$=Math.max(0,$-2*h);var q=st.width/st.height,ot=D(q,nt,$,Q);return{scale:ot*2/st.height,rCenter:k(q,ot/$),rotate:_(Y)}}function f(st,$,Q,nt,Y){$=Math.max(0,$-2*h);var q=st.height/st.width,ot=D(q,nt,$,Q);return{scale:ot*2/st.width,rCenter:k(q,ot/$),rotate:_(Y+Math.PI/2)}}function k(st,$){return Math.cos($)-st*$}function _(st){return(180/Math.PI*st+720)%180-90}function D(st,$,Q,nt){var Y=st+1/(2*Math.tan($));return Q*Math.min(1/(Math.sqrt(Y*Y+.5)+Y),nt/(Math.sqrt(st*st+nt/2)+st))}function I(st,$){return st.v===$.vTotal&&!$.trace.hole?1:Math.min(1/(1+1/Math.sin(st.halfangle)),st.ring/2)}function O(st,$){var Q=$.pxmid[0],nt=$.pxmid[1],Y=st.width/2,q=st.height/2;return Q<0&&(Y*=-1),nt<0&&(q*=-1),{scale:1,rCenter:1,rotate:0,x:Y+Math.abs(q)*(Y>0?1:-1)/2,y:q/(1+Q*Q/(nt*nt)),outside:!0}}function B(st){var $=Math.sqrt(st.titleBox.width*st.titleBox.width+st.titleBox.height*st.titleBox.height);return{x:st.cx,y:st.cy,scale:st.trace.hole*st.r*2/$,tx:0,ty:-st.titleBox.height/2+st.trace.title.font.size}}function R(st,$){var Q=1,nt=1,Y,q=st.trace,ot={x:st.cx,y:st.cy},it={tx:0,ty:0};it.ty+=q.title.font.size,Y=N(q),q.title.position.indexOf("top")!==-1?(ot.y-=(1+Y)*st.r,it.ty-=st.titleBox.height):q.title.position.indexOf("bottom")!==-1&&(ot.y+=(1+Y)*st.r);var dt=L(st.r,st.trace.aspectratio),wt=$.w*(q.domain.x[1]-q.domain.x[0])/2;return q.title.position.indexOf("left")!==-1?(wt=wt+dt,ot.x-=(1+Y)*dt,it.tx+=st.titleBox.width/2):q.title.position.indexOf("center")!==-1?wt*=2:q.title.position.indexOf("right")!==-1&&(wt=wt+dt,ot.x+=(1+Y)*dt,it.tx-=st.titleBox.width/2),Q=wt/st.titleBox.width,nt=F(st,$)/st.titleBox.height,{x:ot.x,y:ot.y,scale:Math.min(Q,nt),tx:it.tx,ty:it.ty}}function L(st,$){return st/($===void 0?1:$)}function F(st,$){var Q=st.trace,nt=$.h*(Q.domain.y[1]-Q.domain.y[0]);return Math.min(st.titleBox.height,nt/2)}function N(st){var $=st.pull;if(!$)return 0;var Q;if(e.isArrayOrTypedArray($))for($=0,Q=0;Q<st.pull.length;Q++)st.pull[Q]>$&&($=st.pull[Q]);return $}function j(st,$){var Q,nt,Y,q,ot,it,dt,wt,xt,Ft,Et,Nt,te;function Jt(bt,vt){return bt.pxmid[1]-vt.pxmid[1]}function Qt(bt,vt){return vt.pxmid[1]-bt.pxmid[1]}function Wt(bt,vt){vt||(vt={});var Ut=vt.labelExtraY+(nt?vt.yLabelMax:vt.yLabelMin),Kt=nt?bt.yLabelMin:bt.yLabelMax,Zt=nt?bt.yLabelMax:bt.yLabelMin,le=bt.cyFinal+ot(bt.px0[1],bt.px1[1]),Te=Ut-Kt,Se,Fe,Oe,ur,fr,We;if(Te*dt>0&&(bt.labelExtraY=Te),!!e.isArrayOrTypedArray($.pull))for(Fe=0;Fe<Ft.length;Fe++)Oe=Ft[Fe],!(Oe===bt||(v.castOption($.pull,bt.pts)||0)>=(v.castOption($.pull,Oe.pts)||0))&&((bt.pxmid[1]-Oe.pxmid[1])*dt>0?(ur=Oe.cyFinal+ot(Oe.px0[1],Oe.px1[1]),Te=ur-Kt-bt.labelExtraY,Te*dt>0&&(bt.labelExtraY+=Te)):(Zt+bt.labelExtraY-le)*dt>0&&(Se=3*it*Math.abs(Fe-Ft.indexOf(bt)),fr=Oe.cxFinal+q(Oe.px0[0],Oe.px1[0]),We=fr+Se-(bt.cxFinal+bt.pxmid[0])-bt.labelExtraX,We*it>0&&(bt.labelExtraX+=We)))}for(nt=0;nt<2;nt++)for(Y=nt?Jt:Qt,ot=nt?Math.max:Math.min,dt=nt?1:-1,Q=0;Q<2;Q++){for(q=Q?Math.max:Math.min,it=Q?1:-1,wt=st[nt][Q],wt.sort(Y),xt=st[1-nt][Q],Ft=xt.concat(wt),Nt=[],Et=0;Et<wt.length;Et++)wt[Et].yLabelMid!==void 0&&Nt.push(wt[Et]);for(te=!1,Et=0;nt&&Et<xt.length;Et++)if(xt[Et].yLabelMid!==void 0){te=xt[Et];break}for(Et=0;Et<Nt.length;Et++){var gt=Et&&Nt[Et-1];te&&!Et&&(gt=te),Wt(Nt[Et],gt)}}}function G(st,$){for(var Q=[],nt=0;nt<st.length;nt++){var Y=st[nt][0],q=Y.trace,ot=q.domain,it=$.w*(ot.x[1]-ot.x[0]),dt=$.h*(ot.y[1]-ot.y[0]);q.title.text&&q.title.position!=="middle center"&&(dt-=F(Y,$));var wt=it/2,xt=dt/2;q.type==="funnelarea"&&!q.scalegroup&&(xt/=q.aspectratio),Y.r=Math.min(wt,xt)/(1+N(q)),Y.cx=$.l+$.w*(q.domain.x[1]+q.domain.x[0])/2,Y.cy=$.t+$.h*(1-q.domain.y[0])-dt/2,q.title.text&&q.title.position.indexOf("bottom")!==-1&&(Y.cy-=F(Y,$)),q.scalegroup&&Q.indexOf(q.scalegroup)===-1&&Q.push(q.scalegroup)}rt(st,Q)}function rt(st,$){for(var Q,nt,Y,q=0;q<$.length;q++){var ot=1/0,it=$[q];for(nt=0;nt<st.length;nt++)if(Q=st[nt][0],Y=Q.trace,Y.scalegroup===it){var dt;if(Y.type==="pie")dt=Q.r*Q.r;else if(Y.type==="funnelarea"){var wt,xt;Y.aspectratio>1?(wt=Q.r,xt=wt/Y.aspectratio):(xt=Q.r,wt=xt*Y.aspectratio),wt*=(1+Y.baseratio)/2,dt=wt*xt}ot=Math.min(ot,dt/Q.vTotal)}for(nt=0;nt<st.length;nt++)if(Q=st[nt][0],Y=Q.trace,Y.scalegroup===it){var Ft=ot*Q.vTotal;Y.type==="funnelarea"&&(Ft/=(1+Y.baseratio)/2,Ft/=Y.aspectratio),Q.r=Math.sqrt(Ft)}}}function ct(st){var $=st[0],Q=$.r,nt=$.trace,Y=v.getRotationAngle(nt.rotation),q=2*Math.PI/$.vTotal,ot="px0",it="px1",dt,wt,xt;if(nt.direction==="counterclockwise"){for(dt=0;dt<st.length&&st[dt].hidden;dt++);if(dt===st.length)return;Y+=q*st[dt].v,q*=-1,ot="px1",it="px0"}for(xt=lt(Q,Y),dt=0;dt<st.length;dt++)wt=st[dt],!wt.hidden&&(wt[ot]=xt,wt.startangle=Y,Y+=q*wt.v/2,wt.pxmid=lt(Q,Y),wt.midangle=Y,Y+=q*wt.v/2,xt=lt(Q,Y),wt.stopangle=Y,wt[it]=xt,wt.largeArc=wt.v>$.vTotal/2?1:0,wt.halfangle=Math.PI*Math.min(wt.v/$.vTotal,.5),wt.ring=1-nt.hole,wt.rInscribed=I(wt,$))}function lt(st,$){return[st*Math.sin($),-st*Math.cos($)]}function tt(st,$,Q){var nt=st._fullLayout,Y=Q.trace,q=Y.texttemplate,ot=Y.textinfo;if(!q&&ot&&ot!=="none"){var it=ot.split("+"),dt=function(vt){return it.indexOf(vt)!==-1},wt=dt("label"),xt=dt("text"),Ft=dt("value"),Et=dt("percent"),Nt=nt.separators,te;if(te=wt?[$.label]:[],xt){var Jt=v.getFirstFilled(Y.text,$.pts);p(Jt)&&te.push(Jt)}Ft&&te.push(v.formatPieValue($.v,Nt)),Et&&te.push(v.formatPiePercent($.v/Q.vTotal,Nt)),$.text=te.join("<br>")}function Qt(vt){return{label:vt.label,value:vt.v,valueLabel:v.formatPieValue(vt.v,nt.separators),percent:vt.v/Q.vTotal,percentLabel:v.formatPiePercent(vt.v/Q.vTotal,nt.separators),color:vt.color,text:vt.text,customdata:e.castOption(Y,vt.i,"customdata")}}if(q){var Wt=e.castOption(Y,$.i,"texttemplate");if(!Wt)$.text="";else{var gt=Qt($),bt=v.getFirstFilled(Y.text,$.pts);(p(bt)||bt==="")&&(gt.text=bt),$.text=e.texttemplateString(Wt,gt,st._fullLayout._d3locale,gt,Y._meta||{})}}}function Z(st,$){var Q=st.rotate*Math.PI/180,nt=Math.cos(Q),Y=Math.sin(Q),q=($.left+$.right)/2,ot=($.top+$.bottom)/2;st.textX=q*nt-ot*Y,st.textY=q*Y+ot*nt,st.noCenter=!0}V.exports={plot:y,formatSliceLabel:tt,transformInsideText:M,determineInsideTextFont:S,positionTitleOutside:R,prerenderTitles:T,layoutAreas:G,attachFxHandlers:x,computeTransform:Z}}),V6=Vt((X,V)=>{var c=Ai(),g=wg(),E=of().resizeText;V.exports=function(A){var t=A._fullLayout._pielayer.selectAll(".trace");E(A,t,"pie"),t.each(function(e){var r=e[0],i=r.trace,n=c.select(this);n.style({opacity:i.opacity}),n.selectAll("path.surface").each(function(o){c.select(this).call(g,o,i,A)})})}}),q6=Vt(X=>{var V=fu();X.name="pie",X.plot=function(c,g,E,A){V.plotBasePlot(X.name,c,g,E,A)},X.clean=function(c,g,E,A){V.cleanBasePlot(X.name,c,g,E,A)}}),H6=Vt((X,V)=>{V.exports={attributes:x0(),supplyDefaults:_0().supplyDefaults,supplyLayoutDefaults:N6(),layoutAttributes:j1(),calc:Bg().calc,crossTraceCalc:Bg().crossTraceCalc,plot:N1().plot,style:V6(),styleOne:wg(),moduleType:"trace",name:"pie",basePlotModule:q6(),categories:["pie-like","pie","showLegend"],meta:{}}}),G6=Vt((X,V)=>{V.exports=H6()}),W6=Vt(X=>{var V=fu();X.name="sunburst",X.plot=function(c,g,E,A){V.plotBasePlot(X.name,c,g,E,A)},X.clean=function(c,g,E,A){V.cleanBasePlot(X.name,c,g,E,A)}}),$2=Vt((X,V)=>{V.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}),ov=Vt((X,V)=>{var c=Ks(),g=Zo().hovertemplateAttrs,E=Zo().texttemplateAttrs,A=wl(),t=pu().attributes,e=x0(),r=$2(),i=po().extendFlat,n=Eh().pattern;V.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:i({colors:{valType:"data_array",editType:"calc"},line:{color:i({},e.marker.line.color,{dflt:null}),width:i({},e.marker.line.width,{dflt:1}),editType:"calc"},pattern:n,editType:"calc"},A("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:e.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:E({editType:"plot"},{keys:r.eventDataKeys.concat(["label","value"])}),hovertext:e.hovertext,hoverinfo:i({},c.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:g({},{keys:r.eventDataKeys}),textfont:e.textfont,insidetextorientation:e.insidetextorientation,insidetextfont:e.insidetextfont,outsidetextfont:i({},e.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:e.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:t({name:"sunburst",trace:!0,editType:"calc"})}}),J2=Vt((X,V)=>{V.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),Z6=Vt((X,V)=>{var c=qr(),g=ov(),E=pu().defaults,A=zf().handleText,t=_0().handleMarkerDefaults,e=Ul(),r=e.hasColorscale,i=e.handleDefaults;V.exports=function(n,o,a,s){function h(b,S){return c.coerce(n,o,g,b,S)}var v=h("labels"),m=h("parents");if(!v||!v.length||!m||!m.length){o.visible=!1;return}var p=h("values");p&&p.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),t(n,o,s,h);var y=o._hasColorscale=r(n,"marker","colors")||(n.marker||{}).coloraxis;y&&i(n,o,s,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",y?1:.7);var l=h("text");h("texttemplate"),o.texttemplate||h("textinfo",c.isArrayOrTypedArray(l)?"text+label":"label"),h("hovertext"),h("hovertemplate");var x="auto";A(n,o,s,h,x,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("insidetextorientation"),h("sort"),h("rotation"),h("root.color"),E(o,s,h),o._length=null}}),X6=Vt((X,V)=>{var c=qr(),g=J2();V.exports=function(E,A){function t(e,r){return c.coerce(E,A,g,e,r)}t("sunburstcolorway",A.colorway),t("extendsunburstcolors")}}),sv=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X):(c=c||self,g(c.d3=c.d3||{}))})(X,function(c){function g(zt,ut){return zt.parent===ut.parent?1:2}function E(zt){return zt.reduce(A,0)/zt.length}function A(zt,ut){return zt+ut.x}function t(zt){return 1+zt.reduce(e,0)}function e(zt,ut){return Math.max(zt,ut.y)}function r(zt){for(var ut;ut=zt.children;)zt=ut[0];return zt}function i(zt){for(var ut;ut=zt.children;)zt=ut[ut.length-1];return zt}function n(){var zt=g,ut=1,yt=1,Mt=!1;function Ot($t){var ee,we=0;$t.eachAfter(function(Ue){var mr=Ue.children;mr?(Ue.x=E(mr),Ue.y=t(mr)):(Ue.x=ee?we+=zt(Ue,ee):0,Ue.y=0,ee=Ue)});var Me=r($t),Re=i($t),Be=Me.x-zt(Me,Re)/2,Ze=Re.x+zt(Re,Me)/2;return $t.eachAfter(Mt?function(Ue){Ue.x=(Ue.x-$t.x)*ut,Ue.y=($t.y-Ue.y)*yt}:function(Ue){Ue.x=(Ue.x-Be)/(Ze-Be)*ut,Ue.y=(1-($t.y?Ue.y/$t.y:1))*yt})}return Ot.separation=function($t){return arguments.length?(zt=$t,Ot):zt},Ot.size=function($t){return arguments.length?(Mt=!1,ut=+$t[0],yt=+$t[1],Ot):Mt?null:[ut,yt]},Ot.nodeSize=function($t){return arguments.length?(Mt=!0,ut=+$t[0],yt=+$t[1],Ot):Mt?[ut,yt]:null},Ot}function o(zt){var ut=0,yt=zt.children,Mt=yt&&yt.length;if(!Mt)ut=1;else for(;--Mt>=0;)ut+=yt[Mt].value;zt.value=ut}function a(){return this.eachAfter(o)}function s(zt){var ut=this,yt,Mt=[ut],Ot,$t,ee;do for(yt=Mt.reverse(),Mt=[];ut=yt.pop();)if(zt(ut),Ot=ut.children,Ot)for($t=0,ee=Ot.length;$t<ee;++$t)Mt.push(Ot[$t]);while(Mt.length);return this}function h(zt){for(var ut=this,yt=[ut],Mt,Ot;ut=yt.pop();)if(zt(ut),Mt=ut.children,Mt)for(Ot=Mt.length-1;Ot>=0;--Ot)yt.push(Mt[Ot]);return this}function v(zt){for(var ut=this,yt=[ut],Mt=[],Ot,$t,ee;ut=yt.pop();)if(Mt.push(ut),Ot=ut.children,Ot)for($t=0,ee=Ot.length;$t<ee;++$t)yt.push(Ot[$t]);for(;ut=Mt.pop();)zt(ut);return this}function m(zt){return this.eachAfter(function(ut){for(var yt=+zt(ut.data)||0,Mt=ut.children,Ot=Mt&&Mt.length;--Ot>=0;)yt+=Mt[Ot].value;ut.value=yt})}function p(zt){return this.eachBefore(function(ut){ut.children&&ut.children.sort(zt)})}function y(zt){for(var ut=this,yt=l(ut,zt),Mt=[ut];ut!==yt;)ut=ut.parent,Mt.push(ut);for(var Ot=Mt.length;zt!==yt;)Mt.splice(Ot,0,zt),zt=zt.parent;return Mt}function l(zt,ut){if(zt===ut)return zt;var yt=zt.ancestors(),Mt=ut.ancestors(),Ot=null;for(zt=yt.pop(),ut=Mt.pop();zt===ut;)Ot=zt,zt=yt.pop(),ut=Mt.pop();return Ot}function x(){for(var zt=this,ut=[zt];zt=zt.parent;)ut.push(zt);return ut}function b(){var zt=[];return this.each(function(ut){zt.push(ut)}),zt}function S(){var zt=[];return this.eachBefore(function(ut){ut.children||zt.push(ut)}),zt}function T(){var zt=this,ut=[];return zt.each(function(yt){yt!==zt&&ut.push({source:yt.parent,target:yt})}),ut}function M(zt,ut){var yt=new _(zt),Mt=+zt.value&&(yt.value=zt.value),Ot,$t=[yt],ee,we,Me,Re;for(ut==null&&(ut=u);Ot=$t.pop();)if(Mt&&(Ot.value=+Ot.data.value),(we=ut(Ot.data))&&(Re=we.length))for(Ot.children=new Array(Re),Me=Re-1;Me>=0;--Me)$t.push(ee=Ot.children[Me]=new _(we[Me])),ee.parent=Ot,ee.depth=Ot.depth+1;return yt.eachBefore(k)}function w(){return M(this).eachBefore(f)}function u(zt){return zt.children}function f(zt){zt.data=zt.data.data}function k(zt){var ut=0;do zt.height=ut;while((zt=zt.parent)&&zt.height<++ut)}function _(zt){this.data=zt,this.depth=this.height=0,this.parent=null}_.prototype=M.prototype={constructor:_,count:a,each:s,eachAfter:v,eachBefore:h,sum:m,sort:p,path:y,ancestors:x,descendants:b,leaves:S,links:T,copy:w};var D=Array.prototype.slice;function I(zt){for(var ut=zt.length,yt,Mt;ut;)Mt=Math.random()*ut--|0,yt=zt[ut],zt[ut]=zt[Mt],zt[Mt]=yt;return zt}function O(zt){for(var ut=0,yt=(zt=I(D.call(zt))).length,Mt=[],Ot,$t;ut<yt;)Ot=zt[ut],$t&&L($t,Ot)?++ut:($t=N(Mt=B(Mt,Ot)),ut=0);return $t}function B(zt,ut){var yt,Mt;if(F(ut,zt))return[ut];for(yt=0;yt<zt.length;++yt)if(R(ut,zt[yt])&&F(G(zt[yt],ut),zt))return[zt[yt],ut];for(yt=0;yt<zt.length-1;++yt)for(Mt=yt+1;Mt<zt.length;++Mt)if(R(G(zt[yt],zt[Mt]),ut)&&R(G(zt[yt],ut),zt[Mt])&&R(G(zt[Mt],ut),zt[yt])&&F(rt(zt[yt],zt[Mt],ut),zt))return[zt[yt],zt[Mt],ut];throw new Error}function R(zt,ut){var yt=zt.r-ut.r,Mt=ut.x-zt.x,Ot=ut.y-zt.y;return yt<0||yt*yt<Mt*Mt+Ot*Ot}function L(zt,ut){var yt=zt.r-ut.r+1e-6,Mt=ut.x-zt.x,Ot=ut.y-zt.y;return yt>0&&yt*yt>Mt*Mt+Ot*Ot}function F(zt,ut){for(var yt=0;yt<ut.length;++yt)if(!L(zt,ut[yt]))return!1;return!0}function N(zt){switch(zt.length){case 1:return j(zt[0]);case 2:return G(zt[0],zt[1]);case 3:return rt(zt[0],zt[1],zt[2])}}function j(zt){return{x:zt.x,y:zt.y,r:zt.r}}function G(zt,ut){var yt=zt.x,Mt=zt.y,Ot=zt.r,$t=ut.x,ee=ut.y,we=ut.r,Me=$t-yt,Re=ee-Mt,Be=we-Ot,Ze=Math.sqrt(Me*Me+Re*Re);return{x:(yt+$t+Me/Ze*Be)/2,y:(Mt+ee+Re/Ze*Be)/2,r:(Ze+Ot+we)/2}}function rt(zt,ut,yt){var Mt=zt.x,Ot=zt.y,$t=zt.r,ee=ut.x,we=ut.y,Me=ut.r,Re=yt.x,Be=yt.y,Ze=yt.r,Ue=Mt-ee,mr=Mt-Re,ln=Ot-we,an=Ot-Be,vn=Me-$t,Sn=Ze-$t,An=Mt*Mt+Ot*Ot-$t*$t,pn=An-ee*ee-we*we+Me*Me,On=An-Re*Re-Be*Be+Ze*Ze,Nn=mr*ln-Ue*an,ke=(ln*On-an*pn)/(Nn*2)-Mt,ze=(an*vn-ln*Sn)/Nn,je=(mr*pn-Ue*On)/(Nn*2)-Ot,Ne=(Ue*Sn-mr*vn)/Nn,_r=ze*ze+Ne*Ne-1,Xr=2*($t+ke*ze+je*Ne),rn=ke*ke+je*je-$t*$t,Br=-(_r?(Xr+Math.sqrt(Xr*Xr-4*_r*rn))/(2*_r):rn/Xr);return{x:Mt+ke+ze*Br,y:Ot+je+Ne*Br,r:Br}}function ct(zt,ut,yt){var Mt=zt.x-ut.x,Ot,$t,ee=zt.y-ut.y,we,Me,Re=Mt*Mt+ee*ee;Re?($t=ut.r+yt.r,$t*=$t,Me=zt.r+yt.r,Me*=Me,$t>Me?(Ot=(Re+Me-$t)/(2*Re),we=Math.sqrt(Math.max(0,Me/Re-Ot*Ot)),yt.x=zt.x-Ot*Mt-we*ee,yt.y=zt.y-Ot*ee+we*Mt):(Ot=(Re+$t-Me)/(2*Re),we=Math.sqrt(Math.max(0,$t/Re-Ot*Ot)),yt.x=ut.x+Ot*Mt-we*ee,yt.y=ut.y+Ot*ee+we*Mt)):(yt.x=ut.x+yt.r,yt.y=ut.y)}function lt(zt,ut){var yt=zt.r+ut.r-1e-6,Mt=ut.x-zt.x,Ot=ut.y-zt.y;return yt>0&&yt*yt>Mt*Mt+Ot*Ot}function tt(zt){var ut=zt._,yt=zt.next._,Mt=ut.r+yt.r,Ot=(ut.x*yt.r+yt.x*ut.r)/Mt,$t=(ut.y*yt.r+yt.y*ut.r)/Mt;return Ot*Ot+$t*$t}function Z(zt){this._=zt,this.next=null,this.previous=null}function st(zt){if(!(Ot=zt.length))return 0;var ut,yt,Mt,Ot,$t,ee,we,Me,Re,Be,Ze;if(ut=zt[0],ut.x=0,ut.y=0,!(Ot>1))return ut.r;if(yt=zt[1],ut.x=-yt.r,yt.x=ut.r,yt.y=0,!(Ot>2))return ut.r+yt.r;ct(yt,ut,Mt=zt[2]),ut=new Z(ut),yt=new Z(yt),Mt=new Z(Mt),ut.next=Mt.previous=yt,yt.next=ut.previous=Mt,Mt.next=yt.previous=ut;t:for(we=3;we<Ot;++we){ct(ut._,yt._,Mt=zt[we]),Mt=new Z(Mt),Me=yt.next,Re=ut.previous,Be=yt._.r,Ze=ut._.r;do if(Be<=Ze){if(lt(Me._,Mt._)){yt=Me,ut.next=yt,yt.previous=ut,--we;continue t}Be+=Me._.r,Me=Me.next}else{if(lt(Re._,Mt._)){ut=Re,ut.next=yt,yt.previous=ut,--we;continue t}Ze+=Re._.r,Re=Re.previous}while(Me!==Re.next);for(Mt.previous=ut,Mt.next=yt,ut.next=yt.previous=yt=Mt,$t=tt(ut);(Mt=Mt.next)!==yt;)(ee=tt(Mt))<$t&&(ut=Mt,$t=ee);yt=ut.next}for(ut=[yt._],Mt=yt;(Mt=Mt.next)!==yt;)ut.push(Mt._);for(Mt=O(ut),we=0;we<Ot;++we)ut=zt[we],ut.x-=Mt.x,ut.y-=Mt.y;return Mt.r}function $(zt){return st(zt),zt}function Q(zt){return zt==null?null:nt(zt)}function nt(zt){if(typeof zt!="function")throw new Error;return zt}function Y(){return 0}function q(zt){return function(){return zt}}function ot(zt){return Math.sqrt(zt.value)}function it(){var zt=null,ut=1,yt=1,Mt=Y;function Ot($t){return $t.x=ut/2,$t.y=yt/2,zt?$t.eachBefore(dt(zt)).eachAfter(wt(Mt,.5)).eachBefore(xt(1)):$t.eachBefore(dt(ot)).eachAfter(wt(Y,1)).eachAfter(wt(Mt,$t.r/Math.min(ut,yt))).eachBefore(xt(Math.min(ut,yt)/(2*$t.r))),$t}return Ot.radius=function($t){return arguments.length?(zt=Q($t),Ot):zt},Ot.size=function($t){return arguments.length?(ut=+$t[0],yt=+$t[1],Ot):[ut,yt]},Ot.padding=function($t){return arguments.length?(Mt=typeof $t=="function"?$t:q(+$t),Ot):Mt},Ot}function dt(zt){return function(ut){ut.children||(ut.r=Math.max(0,+zt(ut)||0))}}function wt(zt,ut){return function(yt){if(Mt=yt.children){var Mt,Ot,$t=Mt.length,ee=zt(yt)*ut||0,we;if(ee)for(Ot=0;Ot<$t;++Ot)Mt[Ot].r+=ee;if(we=st(Mt),ee)for(Ot=0;Ot<$t;++Ot)Mt[Ot].r-=ee;yt.r=we+ee}}}function xt(zt){return function(ut){var yt=ut.parent;ut.r*=zt,yt&&(ut.x=yt.x+zt*ut.x,ut.y=yt.y+zt*ut.y)}}function Ft(zt){zt.x0=Math.round(zt.x0),zt.y0=Math.round(zt.y0),zt.x1=Math.round(zt.x1),zt.y1=Math.round(zt.y1)}function Et(zt,ut,yt,Mt,Ot){for(var $t=zt.children,ee,we=-1,Me=$t.length,Re=zt.value&&(Mt-ut)/zt.value;++we<Me;)ee=$t[we],ee.y0=yt,ee.y1=Ot,ee.x0=ut,ee.x1=ut+=ee.value*Re}function Nt(){var zt=1,ut=1,yt=0,Mt=!1;function Ot(ee){var we=ee.height+1;return ee.x0=ee.y0=yt,ee.x1=zt,ee.y1=ut/we,ee.eachBefore($t(ut,we)),Mt&&ee.eachBefore(Ft),ee}function $t(ee,we){return function(Me){Me.children&&Et(Me,Me.x0,ee*(Me.depth+1)/we,Me.x1,ee*(Me.depth+2)/we);var Re=Me.x0,Be=Me.y0,Ze=Me.x1-yt,Ue=Me.y1-yt;Ze<Re&&(Re=Ze=(Re+Ze)/2),Ue<Be&&(Be=Ue=(Be+Ue)/2),Me.x0=Re,Me.y0=Be,Me.x1=Ze,Me.y1=Ue}}return Ot.round=function(ee){return arguments.length?(Mt=!!ee,Ot):Mt},Ot.size=function(ee){return arguments.length?(zt=+ee[0],ut=+ee[1],Ot):[zt,ut]},Ot.padding=function(ee){return arguments.length?(yt=+ee,Ot):yt},Ot}var te="$",Jt={depth:-1},Qt={};function Wt(zt){return zt.id}function gt(zt){return zt.parentId}function bt(){var zt=Wt,ut=gt;function yt(Mt){var Ot,$t,ee=Mt.length,we,Me,Re,Be=new Array(ee),Ze,Ue,mr={};for($t=0;$t<ee;++$t)Ot=Mt[$t],Re=Be[$t]=new _(Ot),(Ze=zt(Ot,$t,Mt))!=null&&(Ze+="")&&(Ue=te+(Re.id=Ze),mr[Ue]=Ue in mr?Qt:Re);for($t=0;$t<ee;++$t)if(Re=Be[$t],Ze=ut(Mt[$t],$t,Mt),Ze==null||!(Ze+="")){if(we)throw new Error("multiple roots");we=Re}else{if(Me=mr[te+Ze],!Me)throw new Error("missing: "+Ze);if(Me===Qt)throw new Error("ambiguous: "+Ze);Me.children?Me.children.push(Re):Me.children=[Re],Re.parent=Me}if(!we)throw new Error("no root");if(we.parent=Jt,we.eachBefore(function(ln){ln.depth=ln.parent.depth+1,--ee}).eachBefore(k),we.parent=null,ee>0)throw new Error("cycle");return we}return yt.id=function(Mt){return arguments.length?(zt=nt(Mt),yt):zt},yt.parentId=function(Mt){return arguments.length?(ut=nt(Mt),yt):ut},yt}function vt(zt,ut){return zt.parent===ut.parent?1:2}function Ut(zt){var ut=zt.children;return ut?ut[0]:zt.t}function Kt(zt){var ut=zt.children;return ut?ut[ut.length-1]:zt.t}function Zt(zt,ut,yt){var Mt=yt/(ut.i-zt.i);ut.c-=Mt,ut.s+=yt,zt.c+=Mt,ut.z+=yt,ut.m+=yt}function le(zt){for(var ut=0,yt=0,Mt=zt.children,Ot=Mt.length,$t;--Ot>=0;)$t=Mt[Ot],$t.z+=ut,$t.m+=ut,ut+=$t.s+(yt+=$t.c)}function Te(zt,ut,yt){return zt.a.parent===ut.parent?zt.a:yt}function Se(zt,ut){this._=zt,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=ut}Se.prototype=Object.create(_.prototype);function Fe(zt){for(var ut=new Se(zt,0),yt,Mt=[ut],Ot,$t,ee,we;yt=Mt.pop();)if($t=yt._.children)for(yt.children=new Array(we=$t.length),ee=we-1;ee>=0;--ee)Mt.push(Ot=yt.children[ee]=new Se($t[ee],ee)),Ot.parent=yt;return(ut.parent=new Se(null,0)).children=[ut],ut}function Oe(){var zt=vt,ut=1,yt=1,Mt=null;function Ot(Re){var Be=Fe(Re);if(Be.eachAfter($t),Be.parent.m=-Be.z,Be.eachBefore(ee),Mt)Re.eachBefore(Me);else{var Ze=Re,Ue=Re,mr=Re;Re.eachBefore(function(An){An.x<Ze.x&&(Ze=An),An.x>Ue.x&&(Ue=An),An.depth>mr.depth&&(mr=An)});var ln=Ze===Ue?1:zt(Ze,Ue)/2,an=ln-Ze.x,vn=ut/(Ue.x+ln+an),Sn=yt/(mr.depth||1);Re.eachBefore(function(An){An.x=(An.x+an)*vn,An.y=An.depth*Sn})}return Re}function $t(Re){var Be=Re.children,Ze=Re.parent.children,Ue=Re.i?Ze[Re.i-1]:null;if(Be){le(Re);var mr=(Be[0].z+Be[Be.length-1].z)/2;Ue?(Re.z=Ue.z+zt(Re._,Ue._),Re.m=Re.z-mr):Re.z=mr}else Ue&&(Re.z=Ue.z+zt(Re._,Ue._));Re.parent.A=we(Re,Ue,Re.parent.A||Ze[0])}function ee(Re){Re._.x=Re.z+Re.parent.m,Re.m+=Re.parent.m}function we(Re,Be,Ze){if(Be){for(var Ue=Re,mr=Re,ln=Be,an=Ue.parent.children[0],vn=Ue.m,Sn=mr.m,An=ln.m,pn=an.m,On;ln=Kt(ln),Ue=Ut(Ue),ln&&Ue;)an=Ut(an),mr=Kt(mr),mr.a=Re,On=ln.z+An-Ue.z-vn+zt(ln._,Ue._),On>0&&(Zt(Te(ln,Re,Ze),Re,On),vn+=On,Sn+=On),An+=ln.m,vn+=Ue.m,pn+=an.m,Sn+=mr.m;ln&&!Kt(mr)&&(mr.t=ln,mr.m+=An-Sn),Ue&&!Ut(an)&&(an.t=Ue,an.m+=vn-pn,Ze=Re)}return Ze}function Me(Re){Re.x*=ut,Re.y=Re.depth*yt}return Ot.separation=function(Re){return arguments.length?(zt=Re,Ot):zt},Ot.size=function(Re){return arguments.length?(Mt=!1,ut=+Re[0],yt=+Re[1],Ot):Mt?null:[ut,yt]},Ot.nodeSize=function(Re){return arguments.length?(Mt=!0,ut=+Re[0],yt=+Re[1],Ot):Mt?[ut,yt]:null},Ot}function ur(zt,ut,yt,Mt,Ot){for(var $t=zt.children,ee,we=-1,Me=$t.length,Re=zt.value&&(Ot-yt)/zt.value;++we<Me;)ee=$t[we],ee.x0=ut,ee.x1=Mt,ee.y0=yt,ee.y1=yt+=ee.value*Re}var fr=(1+Math.sqrt(5))/2;function We(zt,ut,yt,Mt,Ot,$t){for(var ee=[],we=ut.children,Me,Re,Be=0,Ze=0,Ue=we.length,mr,ln,an=ut.value,vn,Sn,An,pn,On,Nn,ke;Be<Ue;){mr=Ot-yt,ln=$t-Mt;do vn=we[Ze++].value;while(!vn&&Ze<Ue);for(Sn=An=vn,Nn=Math.max(ln/mr,mr/ln)/(an*zt),ke=vn*vn*Nn,On=Math.max(An/ke,ke/Sn);Ze<Ue;++Ze){if(vn+=Re=we[Ze].value,Re<Sn&&(Sn=Re),Re>An&&(An=Re),ke=vn*vn*Nn,pn=Math.max(An/ke,ke/Sn),pn>On){vn-=Re;break}On=pn}ee.push(Me={value:vn,dice:mr<ln,children:we.slice(Be,Ze)}),Me.dice?Et(Me,yt,Mt,Ot,an?Mt+=ln*vn/an:$t):ur(Me,yt,Mt,an?yt+=mr*vn/an:Ot,$t),an-=vn,Be=Ze}return ee}var Lr=function zt(ut){function yt(Mt,Ot,$t,ee,we){We(ut,Mt,Ot,$t,ee,we)}return yt.ratio=function(Mt){return zt((Mt=+Mt)>1?Mt:1)},yt}(fr);function kr(){var zt=Lr,ut=!1,yt=1,Mt=1,Ot=[0],$t=Y,ee=Y,we=Y,Me=Y,Re=Y;function Be(Ue){return Ue.x0=Ue.y0=0,Ue.x1=yt,Ue.y1=Mt,Ue.eachBefore(Ze),Ot=[0],ut&&Ue.eachBefore(Ft),Ue}function Ze(Ue){var mr=Ot[Ue.depth],ln=Ue.x0+mr,an=Ue.y0+mr,vn=Ue.x1-mr,Sn=Ue.y1-mr;vn<ln&&(ln=vn=(ln+vn)/2),Sn<an&&(an=Sn=(an+Sn)/2),Ue.x0=ln,Ue.y0=an,Ue.x1=vn,Ue.y1=Sn,Ue.children&&(mr=Ot[Ue.depth+1]=$t(Ue)/2,ln+=Re(Ue)-mr,an+=ee(Ue)-mr,vn-=we(Ue)-mr,Sn-=Me(Ue)-mr,vn<ln&&(ln=vn=(ln+vn)/2),Sn<an&&(an=Sn=(an+Sn)/2),zt(Ue,ln,an,vn,Sn))}return Be.round=function(Ue){return arguments.length?(ut=!!Ue,Be):ut},Be.size=function(Ue){return arguments.length?(yt=+Ue[0],Mt=+Ue[1],Be):[yt,Mt]},Be.tile=function(Ue){return arguments.length?(zt=nt(Ue),Be):zt},Be.padding=function(Ue){return arguments.length?Be.paddingInner(Ue).paddingOuter(Ue):Be.paddingInner()},Be.paddingInner=function(Ue){return arguments.length?($t=typeof Ue=="function"?Ue:q(+Ue),Be):$t},Be.paddingOuter=function(Ue){return arguments.length?Be.paddingTop(Ue).paddingRight(Ue).paddingBottom(Ue).paddingLeft(Ue):Be.paddingTop()},Be.paddingTop=function(Ue){return arguments.length?(ee=typeof Ue=="function"?Ue:q(+Ue),Be):ee},Be.paddingRight=function(Ue){return arguments.length?(we=typeof Ue=="function"?Ue:q(+Ue),Be):we},Be.paddingBottom=function(Ue){return arguments.length?(Me=typeof Ue=="function"?Ue:q(+Ue),Be):Me},Be.paddingLeft=function(Ue){return arguments.length?(Re=typeof Ue=="function"?Ue:q(+Ue),Be):Re},Be}function he(zt,ut,yt,Mt,Ot){var $t=zt.children,ee,we=$t.length,Me,Re=new Array(we+1);for(Re[0]=Me=ee=0;ee<we;++ee)Re[ee+1]=Me+=$t[ee].value;Be(0,we,zt.value,ut,yt,Mt,Ot);function Be(Ze,Ue,mr,ln,an,vn,Sn){if(Ze>=Ue-1){var An=$t[Ze];An.x0=ln,An.y0=an,An.x1=vn,An.y1=Sn;return}for(var pn=Re[Ze],On=mr/2+pn,Nn=Ze+1,ke=Ue-1;Nn<ke;){var ze=Nn+ke>>>1;Re[ze]<On?Nn=ze+1:ke=ze}On-Re[Nn-1]<Re[Nn]-On&&Ze+1<Nn&&--Nn;var je=Re[Nn]-pn,Ne=mr-je;if(vn-ln>Sn-an){var _r=(ln*Ne+vn*je)/mr;Be(Ze,Nn,je,ln,an,_r,Sn),Be(Nn,Ue,Ne,_r,an,vn,Sn)}else{var Xr=(an*Ne+Sn*je)/mr;Be(Ze,Nn,je,ln,an,vn,Xr),Be(Nn,Ue,Ne,ln,Xr,vn,Sn)}}}function Dt(zt,ut,yt,Mt,Ot){(zt.depth&1?ur:Et)(zt,ut,yt,Mt,Ot)}var qt=function zt(ut){function yt(Mt,Ot,$t,ee,we){if((Me=Mt._squarify)&&Me.ratio===ut)for(var Me,Re,Be,Ze,Ue=-1,mr,ln=Me.length,an=Mt.value;++Ue<ln;){for(Re=Me[Ue],Be=Re.children,Ze=Re.value=0,mr=Be.length;Ze<mr;++Ze)Re.value+=Be[Ze].value;Re.dice?Et(Re,Ot,$t,ee,$t+=(we-$t)*Re.value/an):ur(Re,Ot,$t,Ot+=(ee-Ot)*Re.value/an,we),an-=Re.value}else Mt._squarify=Me=We(ut,Mt,Ot,$t,ee,we),Me.ratio=ut}return yt.ratio=function(Mt){return zt((Mt=+Mt)>1?Mt:1)},yt}(fr);c.cluster=n,c.hierarchy=M,c.pack=it,c.packEnclose=O,c.packSiblings=$,c.partition=Nt,c.stratify=bt,c.tree=Oe,c.treemap=kr,c.treemapBinary=he,c.treemapDice=Et,c.treemapResquarify=qt,c.treemapSlice=ur,c.treemapSliceDice=Dt,c.treemapSquarify=Lr,Object.defineProperty(c,"__esModule",{value:!0})})}),lv=Vt(X=>{var V=sv(),c=vo(),g=qr(),E=Ul().makeColorScaleFuncFromTrace,A=Bg().makePullColorFn,t=Bg().generateExtendedColors,e=Ul().calc,r=ts().ALMOST_EQUAL,i={},n={},o={};X.calc=function(s,h){var v=s._fullLayout,m=h.ids,p=g.isArrayOrTypedArray(m),y=h.labels,l=h.parents,x=h.values,b=g.isArrayOrTypedArray(x),S=[],T={},M={},w=function($,Q){T[$]?T[$].push(Q):T[$]=[Q],M[Q]=1},u=function($){return $||typeof $=="number"},f=function($){return!b||c(x[$])&&x[$]>=0},k,_,D;p?(k=Math.min(m.length,l.length),_=function($){return u(m[$])&&f($)},D=function($){return String(m[$])}):(k=Math.min(y.length,l.length),_=function($){return u(y[$])&&f($)},D=function($){return String(y[$])}),b&&(k=Math.min(k,x.length));for(var I=0;I<k;I++)if(_(I)){var O=D(I),B=u(l[I])?String(l[I]):"",R={i:I,id:O,pid:B,label:u(y[I])?String(y[I]):""};b&&(R.v=+x[I]),S.push(R),w(B,O)}if(T[""]){if(T[""].length>1){for(var L=g.randstr(),F=0;F<S.length;F++)S[F].pid===""&&(S[F].pid=L);S.unshift({hasMultipleRoots:!0,id:L,pid:"",label:""})}}else{var N=[],j;for(j in T)M[j]||N.push(j);if(N.length===1)j=N[0],S.unshift({hasImpliedRoot:!0,id:j,pid:"",label:j});else return g.warn(["Multiple implied roots, cannot build",h.type,"hierarchy of",h.name+".","These roots include:",N.join(", ")].join(" "))}var G;try{G=V.stratify().id(function($){return $.id}).parentId(function($){return $.pid})(S)}catch($){return g.warn(["Failed to build",h.type,"hierarchy of",h.name+".","Error:",$.message].join(" "))}var rt=V.hierarchy(G),ct=!1;if(b)switch(h.branchvalues){case"remainder":rt.sum(function($){return $.data.v});break;case"total":rt.each(function($){var Q=$.data.data,nt=Q.v;if($.children){var Y=$.children.reduce(function(q,ot){return q+ot.data.data.v},0);if((Q.hasImpliedRoot||Q.hasMultipleRoots)&&(nt=Y),nt<Y*r)return ct=!0,g.warn(["Total value for node",$.data.data.id,"of",h.name,"is smaller than the sum of its children.",`
|
||
parent value =`,nt,`
|
||
children sum =`,Y].join(" "))}$.value=nt});break}else a(rt,h,{branches:h.count.indexOf("branches")!==-1,leaves:h.count.indexOf("leaves")!==-1});if(!ct){h.sort&&rt.sort(function($,Q){return Q.value-$.value});var lt,tt,Z=h.marker.colors||[],st=!!Z.length;return h._hasColorscale?(st||(Z=b?h.values:h._values),e(s,h,{vals:Z,containerStr:"marker",cLetter:"c"}),tt=E(h.marker)):lt=A(v["_"+h.type+"colormap"]),rt.each(function($){var Q=$.data.data;Q.color=h._hasColorscale?tt(Z[Q.i]):lt(Z[Q.i],Q.id)}),S[0].hierarchy=rt,S}},X._runCrossTraceCalc=function(s,h){var v=h._fullLayout,m=h.calcdata,p=v[s+"colorway"],y=v["_"+s+"colormap"];v["extend"+s+"colors"]&&(p=t(p,s==="icicle"?o:s==="treemap"?n:i));var l=0,x;function b(w){var u=w.data.data,f=u.id;u.color===!1&&(y[f]?u.color=y[f]:w.parent?w.parent.parent?u.color=w.parent.data.data.color:(y[f]=u.color=p[l%p.length],l++):u.color=x)}for(var S=0;S<m.length;S++){var T=m[S],M=T[0];M.trace.type===s&&M.hierarchy&&(x=M.trace.root.color,M.hierarchy.each(b))}},X.crossTraceCalc=function(s){return X._runCrossTraceCalc("sunburst",s)};function a(s,h,v){var m=0,p=s.children;if(p){for(var y=p.length,l=0;l<y;l++)m+=a(p[l],h,v);v.branches&&m++}else v.leaves&&m++;return s.value=s.data.data.value=m,h._values||(h._values=[]),h._values[s.data.data.i]=m,m}});function b0(X,V,c){X.prototype=V.prototype=c,c.constructor=X}function Rg(X,V){var c=Object.create(X.prototype);for(var g in V)c[g]=V[g];return c}var U1=bl(()=>{});function Vp(){}function Q2(){return this.rgb().formatHex()}function $6(){return this.rgb().formatHex8()}function J6(){return nw(this).formatHsl()}function Y2(){return this.rgb().formatRgb()}function jg(X){var V,c;return X=(X+"").trim().toLowerCase(),(V=iw.exec(X))?(c=V[1].length,V=parseInt(V[1],16),c===6?K2(V):c===3?new Lh(V>>8&15|V>>4&240,V>>4&15|V&240,(V&15)<<4|V&15,1):c===8?uv(V>>24&255,V>>16&255,V>>8&255,(V&255)/255):c===4?uv(V>>12&15|V>>8&240,V>>8&15|V>>4&240,V>>4&15|V&240,((V&15)<<4|V&15)/255):null):(V=ow.exec(X))?new Lh(V[1],V[2],V[3],1):(V=sw.exec(X))?new Lh(V[1]*255/100,V[2]*255/100,V[3]*255/100,1):(V=lw.exec(X))?uv(V[1],V[2],V[3],V[4]):(V=uw.exec(X))?uv(V[1]*255/100,V[2]*255/100,V[3]*255/100,V[4]):(V=cw.exec(X))?rw(V[1],V[2]/100,V[3]/100,1):(V=hw.exec(X))?rw(V[1],V[2]/100,V[3]/100,V[4]):G1.hasOwnProperty(X)?K2(G1[X]):X==="transparent"?new Lh(NaN,NaN,NaN,0):null}function K2(X){return new Lh(X>>16&255,X>>8&255,X&255,1)}function uv(X,V,c,g){return g<=0&&(X=V=c=NaN),new Lh(X,V,c,g)}function V1(X){return X instanceof Vp||(X=jg(X)),X?(X=X.rgb(),new Lh(X.r,X.g,X.b,X.opacity)):new Lh}function cv(X,V,c,g){return arguments.length===1?V1(X):new Lh(X,V,c,g??1)}function Lh(X,V,c,g){this.r=+X,this.g=+V,this.b=+c,this.opacity=+g}function tw(){return`#${Dd(this.r)}${Dd(this.g)}${Dd(this.b)}`}function Q6(){return`#${Dd(this.r)}${Dd(this.g)}${Dd(this.b)}${Dd((isNaN(this.opacity)?1:this.opacity)*255)}`}function ew(){let X=hv(this.opacity);return`${X===1?"rgb(":"rgba("}${Cd(this.r)}, ${Cd(this.g)}, ${Cd(this.b)}${X===1?")":`, ${X})`}`}function hv(X){return isNaN(X)?1:Math.max(0,Math.min(1,X))}function Cd(X){return Math.max(0,Math.min(255,Math.round(X)||0))}function Dd(X){return X=Cd(X),(X<16?"0":"")+X.toString(16)}function rw(X,V,c,g){return g<=0?X=V=c=NaN:c<=0||c>=1?X=V=NaN:V<=0&&(X=NaN),new Wf(X,V,c,g)}function nw(X){if(X instanceof Wf)return new Wf(X.h,X.s,X.l,X.opacity);if(X instanceof Vp||(X=jg(X)),!X)return new Wf;if(X instanceof Wf)return X;X=X.rgb();var V=X.r/255,c=X.g/255,g=X.b/255,E=Math.min(V,c,g),A=Math.max(V,c,g),t=NaN,e=A-E,r=(A+E)/2;return e?(V===A?t=(c-g)/e+(c<g)*6:c===A?t=(g-V)/e+2:t=(V-c)/e+4,e/=r<.5?A+E:2-A-E,t*=60):e=r>0&&r<1?0:t,new Wf(t,e,r,X.opacity)}function q1(X,V,c,g){return arguments.length===1?nw(X):new Wf(X,V,c,g??1)}function Wf(X,V,c,g){this.h=+X,this.s=+V,this.l=+c,this.opacity=+g}function aw(X){return X=(X||0)%360,X<0?X+360:X}function fv(X){return Math.max(0,Math.min(1,X||0))}function H1(X,V,c){return(X<60?V+(c-V)*X/60:X<180?c:X<240?V+(c-V)*(240-X)/60:V)*255}var qp,zd,Od,w0,Zf,iw,ow,sw,lw,uw,cw,hw,G1,W1=bl(()=>{U1(),qp=.7,zd=1/qp,Od="\\s*([+-]?\\d+)\\s*",w0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iw=/^#([0-9a-f]{3,8})$/,ow=new RegExp(`^rgb\\(${Od},${Od},${Od}\\)$`),sw=new RegExp(`^rgb\\(${Zf},${Zf},${Zf}\\)$`),lw=new RegExp(`^rgba\\(${Od},${Od},${Od},${w0}\\)$`),uw=new RegExp(`^rgba\\(${Zf},${Zf},${Zf},${w0}\\)$`),cw=new RegExp(`^hsl\\(${w0},${Zf},${Zf}\\)$`),hw=new RegExp(`^hsla\\(${w0},${Zf},${Zf},${w0}\\)$`),G1={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},b0(Vp,jg,{copy(X){return Object.assign(new this.constructor,this,X)},displayable(){return this.rgb().displayable()},hex:Q2,formatHex:Q2,formatHex8:$6,formatHsl:J6,formatRgb:Y2,toString:Y2}),b0(Lh,cv,Rg(Vp,{brighter(X){return X=X==null?zd:Math.pow(zd,X),new Lh(this.r*X,this.g*X,this.b*X,this.opacity)},darker(X){return X=X==null?qp:Math.pow(qp,X),new Lh(this.r*X,this.g*X,this.b*X,this.opacity)},rgb(){return this},clamp(){return new Lh(Cd(this.r),Cd(this.g),Cd(this.b),hv(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:tw,formatHex:tw,formatHex8:Q6,formatRgb:ew,toString:ew})),b0(Wf,q1,Rg(Vp,{brighter(X){return X=X==null?zd:Math.pow(zd,X),new Wf(this.h,this.s,this.l*X,this.opacity)},darker(X){return X=X==null?qp:Math.pow(qp,X),new Wf(this.h,this.s,this.l*X,this.opacity)},rgb(){var X=this.h%360+(this.h<0)*360,V=isNaN(X)||isNaN(this.s)?0:this.s,c=this.l,g=c+(c<.5?c:1-c)*V,E=2*c-g;return new Lh(H1(X>=240?X-240:X+120,E,g),H1(X,E,g),H1(X<120?X+240:X-120,E,g),this.opacity)},clamp(){return new Wf(aw(this.h),fv(this.s),fv(this.l),hv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let X=hv(this.opacity);return`${X===1?"hsl(":"hsla("}${aw(this.h)}, ${fv(this.s)*100}%, ${fv(this.l)*100}%${X===1?")":`, ${X})`}`}}))}),Z1,X1,fw=bl(()=>{Z1=Math.PI/180,X1=180/Math.PI});function pw(X){if(X instanceof op)return new op(X.l,X.a,X.b,X.opacity);if(X instanceof Tp)return dw(X);X instanceof Lh||(X=V1(X));var V=K1(X.r),c=K1(X.g),g=K1(X.b),E=J1((.2225045*V+.7168786*c+.0606169*g)/rx),A,t;return V===c&&c===g?A=t=E:(A=J1((.4360747*V+.3850649*c+.1430804*g)/ex),t=J1((.0139322*V+.0971045*c+.7141733*g)/nx)),new op(116*E-16,500*(A-E),200*(E-t),X.opacity)}function $1(X,V,c,g){return arguments.length===1?pw(X):new op(X,V,c,g??1)}function op(X,V,c,g){this.l=+X,this.a=+V,this.b=+c,this.opacity=+g}function J1(X){return X>gw?Math.pow(X,.3333333333333333):X/ix+ax}function Q1(X){return X>Fd?X*X*X:ix*(X-ax)}function Y1(X){return 255*(X<=.0031308?12.92*X:1.055*Math.pow(X,.4166666666666667)-.055)}function K1(X){return(X/=255)<=.04045?X/12.92:Math.pow((X+.055)/1.055,2.4)}function Y6(X){if(X instanceof Tp)return new Tp(X.h,X.c,X.l,X.opacity);if(X instanceof op||(X=pw(X)),X.a===0&&X.b===0)return new Tp(NaN,0<X.l&&X.l<100?0:NaN,X.l,X.opacity);var V=Math.atan2(X.b,X.a)*X1;return new Tp(V<0?V+360:V,Math.sqrt(X.a*X.a+X.b*X.b),X.l,X.opacity)}function tx(X,V,c,g){return arguments.length===1?Y6(X):new Tp(X,V,c,g??1)}function Tp(X,V,c,g){this.h=+X,this.c=+V,this.l=+c,this.opacity=+g}function dw(X){if(isNaN(X.h))return new op(X.l,0,0,X.opacity);var V=X.h*Z1;return new op(X.l,Math.cos(V)*X.c,Math.sin(V)*X.c,X.opacity)}var Ng,ex,rx,nx,ax,Fd,ix,gw,K6=bl(()=>{U1(),W1(),fw(),Ng=18,ex=.96422,rx=1,nx=.82521,ax=4/29,Fd=6/29,ix=3*Fd*Fd,gw=Fd*Fd*Fd,b0(op,$1,Rg(Vp,{brighter(X){return new op(this.l+Ng*(X??1),this.a,this.b,this.opacity)},darker(X){return new op(this.l-Ng*(X??1),this.a,this.b,this.opacity)},rgb(){var X=(this.l+16)/116,V=isNaN(this.a)?X:X+this.a/500,c=isNaN(this.b)?X:X-this.b/200;return V=ex*Q1(V),X=rx*Q1(X),c=nx*Q1(c),new Lh(Y1(3.1338561*V-1.6168667*X-.4906146*c),Y1(-.9787684*V+1.9161415*X+.033454*c),Y1(.0719453*V-.2289914*X+1.4052427*c),this.opacity)}})),b0(Tp,tx,Rg(Vp,{brighter(X){return new Tp(this.h,this.c,this.l+Ng*(X??1),this.opacity)},darker(X){return new Tp(this.h,this.c,this.l-Ng*(X??1),this.opacity)},rgb(){return dw(this).rgb()}}))});function tS(X){if(X instanceof Bd)return new Bd(X.h,X.s,X.l,X.opacity);X instanceof Lh||(X=V1(X));var V=X.r/255,c=X.g/255,g=X.b/255,E=(cx*g+lx*V-ux*c)/(cx+lx-ux),A=g-E,t=(T0*(c-E)-dv*A)/Ug,e=Math.sqrt(t*t+A*A)/(T0*E*(1-E)),r=e?Math.atan2(t,A)*X1-120:NaN;return new Bd(r<0?r+360:r,e,E,X.opacity)}function ox(X,V,c,g){return arguments.length===1?tS(X):new Bd(X,V,c,g??1)}function Bd(X,V,c,g){this.h=+X,this.s=+V,this.l=+c,this.opacity=+g}var sx,pv,dv,Ug,T0,lx,ux,cx,eS=bl(()=>{U1(),W1(),fw(),sx=-.14861,pv=1.78277,dv=-.29227,Ug=-.90649,T0=1.97294,lx=T0*Ug,ux=T0*pv,cx=pv*dv-Ug*sx,b0(Bd,ox,Rg(Vp,{brighter(X){return X=X==null?zd:Math.pow(zd,X),new Bd(this.h,this.s,this.l*X,this.opacity)},darker(X){return X=X==null?qp:Math.pow(qp,X),new Bd(this.h,this.s,this.l*X,this.opacity)},rgb(){var X=isNaN(this.h)?0:(this.h+120)*Z1,V=+this.l,c=isNaN(this.s)?0:this.s*V*(1-V),g=Math.cos(X),E=Math.sin(X);return new Lh(255*(V+c*(sx*g+pv*E)),255*(V+c*(dv*g+Ug*E)),255*(V+c*(T0*g)),this.opacity)}}))}),k0=bl(()=>{W1(),K6(),eS()});function mw(X,V,c,g,E){var A=X*X,t=A*X;return((1-3*X+3*A-t)*V+(4-6*A+3*t)*c+(1+3*X+3*A-3*t)*g+t*E)/6}function vw(X){var V=X.length-1;return function(c){var g=c<=0?c=0:c>=1?(c=1,V-1):Math.floor(c*V),E=X[g],A=X[g+1],t=g>0?X[g-1]:2*E-A,e=g<V-1?X[g+2]:2*A-E;return mw((c-g/V)*V,t,E,A,e)}}var hx=bl(()=>{});function yw(X){var V=X.length;return function(c){var g=Math.floor(((c%=1)<0?++c:c)*V),E=X[(g+V-1)%V],A=X[g%V],t=X[(g+1)%V],e=X[(g+2)%V];return mw((c-g/V)*V,E,A,t,e)}}var xw=bl(()=>{hx()}),Vg,_w=bl(()=>{Vg=X=>()=>X});function bw(X,V){return function(c){return X+c*V}}function rS(X,V,c){return X=Math.pow(X,c),V=Math.pow(V,c)-X,c=1/c,function(g){return Math.pow(X+g*V,c)}}function gv(X,V){var c=V-X;return c?bw(X,c>180||c<-180?c-360*Math.round(c/360):c):Vg(isNaN(X)?V:X)}function nS(X){return(X=+X)==1?Ch:function(V,c){return c-V?rS(V,c,X):Vg(isNaN(V)?c:V)}}function Ch(X,V){var c=V-X;return c?bw(X,c):Vg(isNaN(X)?V:X)}var A0=bl(()=>{_w()});function ww(X){return function(V){var c=V.length,g=new Array(c),E=new Array(c),A=new Array(c),t,e;for(t=0;t<c;++t)e=cv(V[t]),g[t]=e.r||0,E[t]=e.g||0,A[t]=e.b||0;return g=X(g),E=X(E),A=X(A),e.opacity=1,function(r){return e.r=g(r),e.g=E(r),e.b=A(r),e+""}}}var mv,Tw,kw,Aw=bl(()=>{k0(),hx(),xw(),A0(),mv=function X(V){var c=nS(V);function g(E,A){var t=c((E=cv(E)).r,(A=cv(A)).r),e=c(E.g,A.g),r=c(E.b,A.b),i=Ch(E.opacity,A.opacity);return function(n){return E.r=t(n),E.g=e(n),E.b=r(n),E.opacity=i(n),E+""}}return g.gamma=X,g}(1),Tw=ww(vw),kw=ww(yw)});function fx(X,V){V||(V=[]);var c=X?Math.min(V.length,X.length):0,g=V.slice(),E;return function(A){for(E=0;E<c;++E)g[E]=X[E]*(1-A)+V[E]*A;return g}}function Mw(X){return ArrayBuffer.isView(X)&&!(X instanceof DataView)}var px=bl(()=>{});function aS(X,V){return(Mw(V)?fx:Sw)(X,V)}function Sw(X,V){var c=V?V.length:0,g=X?Math.min(c,X.length):0,E=new Array(g),A=new Array(c),t;for(t=0;t<g;++t)E[t]=_v(X[t],V[t]);for(;t<c;++t)A[t]=V[t];return function(e){for(t=0;t<g;++t)A[t]=E[t](e);return A}}var Ew=bl(()=>{bv(),px()});function Pw(X,V){var c=new Date;return X=+X,V=+V,function(g){return c.setTime(X*(1-g)+V*g),c}}var Iw=bl(()=>{});function sp(X,V){return X=+X,V=+V,function(c){return X*(1-c)+V*c}}var vv=bl(()=>{});function Lw(X,V){var c={},g={},E;(X===null||typeof X!="object")&&(X={}),(V===null||typeof V!="object")&&(V={});for(E in V)E in X?c[E]=_v(X[E],V[E]):g[E]=V[E];return function(A){for(E in c)g[E]=c[E](A);return g}}var Cw=bl(()=>{bv()});function iS(X){return function(){return X}}function oS(X){return function(V){return X(V)+""}}function Dw(X,V){var c=yv.lastIndex=xv.lastIndex=0,g,E,A,t=-1,e=[],r=[];for(X=X+"",V=V+"";(g=yv.exec(X))&&(E=xv.exec(V));)(A=E.index)>c&&(A=V.slice(c,A),e[t]?e[t]+=A:e[++t]=A),(g=g[0])===(E=E[0])?e[t]?e[t]+=E:e[++t]=E:(e[++t]=null,r.push({i:t,x:sp(g,E)})),c=xv.lastIndex;return c<V.length&&(A=V.slice(c),e[t]?e[t]+=A:e[++t]=A),e.length<2?r[0]?oS(r[0].x):iS(V):(V=r.length,function(i){for(var n=0,o;n<V;++n)e[(o=r[n]).i]=o.x(i);return e.join("")})}var yv,xv,zw=bl(()=>{vv(),yv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xv=new RegExp(yv.source,"g")});function _v(X,V){var c=typeof V,g;return V==null||c==="boolean"?Vg(V):(c==="number"?sp:c==="string"?(g=jg(V))?(V=g,mv):Dw:V instanceof jg?mv:V instanceof Date?Pw:Mw(V)?fx:Array.isArray(V)?Sw:typeof V.valueOf!="function"&&typeof V.toString!="function"||isNaN(V)?Lw:sp)(X,V)}var bv=bl(()=>{k0(),Aw(),Ew(),Iw(),vv(),Cw(),zw(),_w(),px()});function sS(X){var V=X.length;return function(c){return X[Math.max(0,Math.min(V-1,Math.floor(c*V)))]}}var lS=bl(()=>{});function uS(X,V){var c=gv(+X,+V);return function(g){var E=c(g);return E-360*Math.floor(E/360)}}var cS=bl(()=>{A0()});function hS(X,V){return X=+X,V=+V,function(c){return Math.round(X*(1-c)+V*c)}}var fS=bl(()=>{});function Ow(X,V,c,g,E,A){var t,e,r;return(t=Math.sqrt(X*X+V*V))&&(X/=t,V/=t),(r=X*c+V*g)&&(c-=X*r,g-=V*r),(e=Math.sqrt(c*c+g*g))&&(c/=e,g/=e,r/=e),X*g<V*c&&(X=-X,V=-V,r=-r,t=-t),{translateX:E,translateY:A,rotate:Math.atan2(V,X)*dx,skewX:Math.atan(r)*dx,scaleX:t,scaleY:e}}var dx,wv,pS=bl(()=>{dx=180/Math.PI,wv={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function dS(X){let V=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(X+"");return V.isIdentity?wv:Ow(V.a,V.b,V.c,V.d,V.e,V.f)}function gS(X){return X==null?wv:(Tv||(Tv=document.createElementNS("http://www.w3.org/2000/svg","g")),Tv.setAttribute("transform",X),(X=Tv.transform.baseVal.consolidate())?(X=X.matrix,Ow(X.a,X.b,X.c,X.d,X.e,X.f)):wv)}var Tv,mS=bl(()=>{pS()});function Fw(X,V,c,g){function E(i){return i.length?i.pop()+" ":""}function A(i,n,o,a,s,h){if(i!==o||n!==a){var v=s.push("translate(",null,V,null,c);h.push({i:v-4,x:sp(i,o)},{i:v-2,x:sp(n,a)})}else(o||a)&&s.push("translate("+o+V+a+c)}function t(i,n,o,a){i!==n?(i-n>180?n+=360:n-i>180&&(i+=360),a.push({i:o.push(E(o)+"rotate(",null,g)-2,x:sp(i,n)})):n&&o.push(E(o)+"rotate("+n+g)}function e(i,n,o,a){i!==n?a.push({i:o.push(E(o)+"skewX(",null,g)-2,x:sp(i,n)}):n&&o.push(E(o)+"skewX("+n+g)}function r(i,n,o,a,s,h){if(i!==o||n!==a){var v=s.push(E(s)+"scale(",null,",",null,")");h.push({i:v-4,x:sp(i,o)},{i:v-2,x:sp(n,a)})}else(o!==1||a!==1)&&s.push(E(s)+"scale("+o+","+a+")")}return function(i,n){var o=[],a=[];return i=X(i),n=X(n),A(i.translateX,i.translateY,n.translateX,n.translateY,o,a),t(i.rotate,n.rotate,o,a),e(i.skewX,n.skewX,o,a),r(i.scaleX,i.scaleY,n.scaleX,n.scaleY,o,a),i=n=null,function(s){for(var h=-1,v=a.length,m;++h<v;)o[(m=a[h]).i]=m.x(s);return o.join("")}}}var Bw,Rw,vS=bl(()=>{vv(),mS(),Bw=Fw(dS,"px, ","px)","deg)"),Rw=Fw(gS,", ",")",")")});function jw(X){return((X=Math.exp(X))+1/X)/2}function yS(X){return((X=Math.exp(X))-1/X)/2}function xS(X){return((X=Math.exp(2*X))-1)/(X+1)}var Nw,Uw,_S=bl(()=>{Nw=1e-12,Uw=function X(V,c,g){function E(A,t){var e=A[0],r=A[1],i=A[2],n=t[0],o=t[1],a=t[2],s=n-e,h=o-r,v=s*s+h*h,m,p;if(v<Nw)p=Math.log(a/i)/V,m=function(T){return[e+T*s,r+T*h,i*Math.exp(V*T*p)]};else{var y=Math.sqrt(v),l=(a*a-i*i+g*v)/(2*i*c*y),x=(a*a-i*i-g*v)/(2*a*c*y),b=Math.log(Math.sqrt(l*l+1)-l),S=Math.log(Math.sqrt(x*x+1)-x);p=(S-b)/V,m=function(T){var M=T*p,w=jw(b),u=i/(c*y)*(w*xS(V*M+b)-yS(b));return[e+u*s,r+u*h,i*w/jw(V*M+b)]}}return m.duration=p*1e3*V/Math.SQRT2,m}return E.rho=function(A){var t=Math.max(.001,+A),e=t*t,r=e*e;return X(t,e,r)},E}(Math.SQRT2,2,4)});function Vw(X){return function(V,c){var g=X((V=q1(V)).h,(c=q1(c)).h),E=Ch(V.s,c.s),A=Ch(V.l,c.l),t=Ch(V.opacity,c.opacity);return function(e){return V.h=g(e),V.s=E(e),V.l=A(e),V.opacity=t(e),V+""}}}var qw,Hw,bS=bl(()=>{k0(),A0(),qw=Vw(gv),Hw=Vw(Ch)});function wS(X,V){var c=Ch((X=$1(X)).l,(V=$1(V)).l),g=Ch(X.a,V.a),E=Ch(X.b,V.b),A=Ch(X.opacity,V.opacity);return function(t){return X.l=c(t),X.a=g(t),X.b=E(t),X.opacity=A(t),X+""}}var TS=bl(()=>{k0(),A0()});function Gw(X){return function(V,c){var g=X((V=tx(V)).h,(c=tx(c)).h),E=Ch(V.c,c.c),A=Ch(V.l,c.l),t=Ch(V.opacity,c.opacity);return function(e){return V.h=g(e),V.c=E(e),V.l=A(e),V.opacity=t(e),V+""}}}var Ww,Zw,kS=bl(()=>{k0(),A0(),Ww=Gw(gv),Zw=Gw(Ch)});function Xw(X){return function V(c){c=+c;function g(E,A){var t=X((E=ox(E)).h,(A=ox(A)).h),e=Ch(E.s,A.s),r=Ch(E.l,A.l),i=Ch(E.opacity,A.opacity);return function(n){return E.h=t(n),E.s=e(n),E.l=r(Math.pow(n,c)),E.opacity=i(n),E+""}}return g.gamma=V,g}(1)}var $w,Jw,AS=bl(()=>{k0(),A0(),$w=Xw(gv),Jw=Xw(Ch)});function MS(X,V){V===void 0&&(V=X,X=_v);for(var c=0,g=V.length-1,E=V[0],A=new Array(g<0?0:g);c<g;)A[c]=X(E,E=V[++c]);return function(t){var e=Math.max(0,Math.min(g-1,Math.floor(t*=g)));return A[e](t-e)}}var SS=bl(()=>{bv()});function ES(X,V){for(var c=new Array(V),g=0;g<V;++g)c[g]=X(g/(V-1));return c}var PS=bl(()=>{}),Rd={};ET(Rd,{interpolate:()=>_v,interpolateArray:()=>aS,interpolateBasis:()=>vw,interpolateBasisClosed:()=>yw,interpolateCubehelix:()=>$w,interpolateCubehelixLong:()=>Jw,interpolateDate:()=>Pw,interpolateDiscrete:()=>sS,interpolateHcl:()=>Ww,interpolateHclLong:()=>Zw,interpolateHsl:()=>qw,interpolateHslLong:()=>Hw,interpolateHue:()=>uS,interpolateLab:()=>wS,interpolateNumber:()=>sp,interpolateNumberArray:()=>fx,interpolateObject:()=>Lw,interpolateRgb:()=>mv,interpolateRgbBasis:()=>Tw,interpolateRgbBasisClosed:()=>kw,interpolateRound:()=>hS,interpolateString:()=>Dw,interpolateTransformCss:()=>Bw,interpolateTransformSvg:()=>Rw,interpolateZoom:()=>Uw,piecewise:()=>MS,quantize:()=>ES});var M0=bl(()=>{bv(),Ew(),hx(),xw(),Iw(),lS(),cS(),vv(),px(),Cw(),fS(),zw(),vS(),_S(),Aw(),bS(),TS(),kS(),AS(),SS(),PS()}),gx=Vt((X,V)=>{var c=go(),g=vi();V.exports=function(E,A,t,e,r){var i=A.data.data,n=i.i,o=r||i.color;if(n>=0){A.i=i.i;var a=t.marker;a.pattern?(!a.colors||!a.pattern.shape)&&(a.color=o,A.color=o):(a.color=o,A.color=o),c.pointStyle(E,t,e,A)}else g.fill(E,o)}}),Qw=Vt((X,V)=>{var c=Ai(),g=vi(),E=qr(),A=of().resizeText,t=gx();function e(i){var n=i._fullLayout._sunburstlayer.selectAll(".trace");A(i,n,"sunburst"),n.each(function(o){var a=c.select(this),s=o[0],h=s.trace;a.style("opacity",h.opacity),a.selectAll("path.surface").each(function(v){c.select(this).call(r,v,h,i)})})}function r(i,n,o,a){var s=n.data.data,h=!n.children,v=s.i,m=E.castOption(o,v,"marker.line.color")||g.defaultLine,p=E.castOption(o,v,"marker.line.width")||0;i.call(t,n,o,a).style("stroke-width",p).call(g.stroke,m).style("opacity",h?o.leaf.opacity:null)}V.exports={style:e,styleOne:r}}),Hp=Vt(X=>{var V=qr(),c=vi(),g=tp(),E=Sd();X.findEntryWithLevel=function(r,i){var n;return i&&r.eachAfter(function(o){if(X.getPtId(o)===i)return n=o.copy()}),n||r},X.findEntryWithChild=function(r,i){var n;return r.eachAfter(function(o){for(var a=o.children||[],s=0;s<a.length;s++){var h=a[s];if(X.getPtId(h)===i)return n=o.copy()}}),n||r},X.isEntry=function(r){return!r.parent},X.isLeaf=function(r){return!r.children},X.getPtId=function(r){return r.data.data.id},X.getPtLabel=function(r){return r.data.data.label},X.getValue=function(r){return r.value},X.isHierarchyRoot=function(r){return e(r)===""},X.setSliceCursor=function(r,i,n){var o=n.isTransitioning;if(!o){var a=r.datum();o=n.hideOnRoot&&X.isHierarchyRoot(a)||n.hideOnLeaves&&X.isLeaf(a)}g(r,o?null:"pointer")};function A(r,i,n){return{color:X.getOutsideTextFontKey("color",r,i,n),family:X.getOutsideTextFontKey("family",r,i,n),size:X.getOutsideTextFontKey("size",r,i,n),weight:X.getOutsideTextFontKey("weight",r,i,n),style:X.getOutsideTextFontKey("style",r,i,n),variant:X.getOutsideTextFontKey("variant",r,i,n),textcase:X.getOutsideTextFontKey("textcase",r,i,n),lineposition:X.getOutsideTextFontKey("lineposition",r,i,n),shadow:X.getOutsideTextFontKey("shadow",r,i,n)}}function t(r,i,n,o){var a=(o||{}).onPathbar,s=i.data.data,h=s.i,v=V.castOption(r,h,(a?"pathbar.textfont":"insidetextfont")+".color");return!v&&r._input.textfont&&(v=V.castOption(r._input,h,"textfont.color")),{color:v||c.contrast(s.color),family:X.getInsideTextFontKey("family",r,i,n,o),size:X.getInsideTextFontKey("size",r,i,n,o),weight:X.getInsideTextFontKey("weight",r,i,n,o),style:X.getInsideTextFontKey("style",r,i,n,o),variant:X.getInsideTextFontKey("variant",r,i,n,o),textcase:X.getInsideTextFontKey("textcase",r,i,n,o),lineposition:X.getInsideTextFontKey("lineposition",r,i,n,o),shadow:X.getInsideTextFontKey("shadow",r,i,n,o)}}X.getInsideTextFontKey=function(r,i,n,o,a){var s=(a||{}).onPathbar,h=s?"pathbar.textfont":"insidetextfont",v=n.data.data.i;return V.castOption(i,v,h+"."+r)||V.castOption(i,v,"textfont."+r)||o.size},X.getOutsideTextFontKey=function(r,i,n,o){var a=n.data.data.i;return V.castOption(i,a,"outsidetextfont."+r)||V.castOption(i,a,"textfont."+r)||o.size},X.isOutsideText=function(r,i){return!r._hasColorscale&&X.isHierarchyRoot(i)},X.determineTextFont=function(r,i,n,o){return X.isOutsideText(r,i)?A(r,i,n):t(r,i,n,o)},X.hasTransition=function(r){return!!(r&&r.duration>0)},X.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},X.isHeader=function(r,i){return!(X.isLeaf(r)||r.depth===i._maxDepth-1)};function e(r){return r.data.data.pid}X.getParent=function(r,i){return X.findEntryWithLevel(r,e(i))},X.listPath=function(r,i){var n=r.parent;if(!n)return[];var o=i?[n.data[i]]:[n];return X.listPath(n,i).concat(o)},X.getPath=function(r){return X.listPath(r,"label").join("/")+"/"},X.formatValue=E.formatPieValue,X.formatPercent=function(r,i){var n=V.formatPercent(r,0);return n==="0%"&&(n=E.formatPiePercent(r,i)),n}}),kv=Vt((X,V)=>{var c=Ai(),g=Mi(),E=vf().appendArrayPointValue,A=Hu(),t=qr(),e=vg(),r=Hp(),i=Sd(),n=i.formatPieValue;V.exports=function(a,s,h,v,m){var p=v[0],y=p.trace,l=p.hierarchy,x=y.type==="sunburst",b=y.type==="treemap"||y.type==="icicle";"_hasHoverLabel"in y||(y._hasHoverLabel=!1),"_hasHoverEvent"in y||(y._hasHoverEvent=!1);var S=function(w){var u=h._fullLayout;if(!(h._dragging||u.hovermode===!1)){var f=h._fullData[y.index],k=w.data.data,_=k.i,D=r.isHierarchyRoot(w),I=r.getParent(l,w),O=r.getValue(w),B=function(q){return t.castOption(f,_,q)},R=B("hovertemplate"),L=A.castHoverinfo(f,u,_),F=u.separators,N;if(R||L&&L!=="none"&&L!=="skip"){var j,G;x&&(j=p.cx+w.pxmid[0]*(1-w.rInscribed),G=p.cy+w.pxmid[1]*(1-w.rInscribed)),b&&(j=w._hoverX,G=w._hoverY);var rt={},ct=[],lt=[],tt=function(q){return ct.indexOf(q)!==-1};L&&(ct=L==="all"?f._module.attributes.hoverinfo.flags:L.split("+")),rt.label=k.label,tt("label")&&rt.label&<.push(rt.label),k.hasOwnProperty("v")&&(rt.value=k.v,rt.valueLabel=n(rt.value,F),tt("value")&<.push(rt.valueLabel)),rt.currentPath=w.currentPath=r.getPath(w.data),tt("current path")&&!D&<.push(rt.currentPath);var Z,st=[],$=function(){st.indexOf(Z)===-1&&(lt.push(Z),st.push(Z))};rt.percentParent=w.percentParent=O/r.getValue(I),rt.parent=w.parentString=r.getPtLabel(I),tt("percent parent")&&(Z=r.formatPercent(rt.percentParent,F)+" of "+rt.parent,$()),rt.percentEntry=w.percentEntry=O/r.getValue(s),rt.entry=w.entry=r.getPtLabel(s),tt("percent entry")&&!D&&!w.onPathbar&&(Z=r.formatPercent(rt.percentEntry,F)+" of "+rt.entry,$()),rt.percentRoot=w.percentRoot=O/r.getValue(l),rt.root=w.root=r.getPtLabel(l),tt("percent root")&&!D&&(Z=r.formatPercent(rt.percentRoot,F)+" of "+rt.root,$()),rt.text=B("hovertext")||B("text"),tt("text")&&(Z=rt.text,t.isValidTextValue(Z)&<.push(Z)),N=[o(w,f,m.eventDataKeys)];var Q={trace:f,y:G,_x0:w._x0,_x1:w._x1,_y0:w._y0,_y1:w._y1,text:lt.join("<br>"),name:R||tt("name")?f.name:void 0,color:B("hoverlabel.bgcolor")||k.color,borderColor:B("hoverlabel.bordercolor"),fontFamily:B("hoverlabel.font.family"),fontSize:B("hoverlabel.font.size"),fontColor:B("hoverlabel.font.color"),fontWeight:B("hoverlabel.font.weight"),fontStyle:B("hoverlabel.font.style"),fontVariant:B("hoverlabel.font.variant"),nameLength:B("hoverlabel.namelength"),textAlign:B("hoverlabel.align"),hovertemplate:R,hovertemplateLabels:rt,eventData:N};x&&(Q.x0=j-w.rInscribed*w.rpx1,Q.x1=j+w.rInscribed*w.rpx1,Q.idealAlign=w.pxmid[0]<0?"left":"right"),b&&(Q.x=j,Q.idealAlign=j<0?"left":"right");var nt=[];A.loneHover(Q,{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:h,inOut_bbox:nt}),N[0].bbox=nt[0],y._hasHoverLabel=!0}if(b){var Y=a.select("path.surface");m.styleOne(Y,w,f,h,{hovered:!0})}y._hasHoverEvent=!0,h.emit("plotly_hover",{points:N||[o(w,f,m.eventDataKeys)],event:c.event})}},T=function(w){var u=h._fullLayout,f=h._fullData[y.index],k=c.select(this).datum();if(y._hasHoverEvent&&(w.originalEvent=c.event,h.emit("plotly_unhover",{points:[o(k,f,m.eventDataKeys)],event:c.event}),y._hasHoverEvent=!1),y._hasHoverLabel&&(A.loneUnhover(u._hoverlayer.node()),y._hasHoverLabel=!1),b){var _=a.select("path.surface");m.styleOne(_,k,f,h,{hovered:!1})}},M=function(w){var u=h._fullLayout,f=h._fullData[y.index],k=x&&(r.isHierarchyRoot(w)||r.isLeaf(w)),_=r.getPtId(w),D=r.isEntry(w)?r.findEntryWithChild(l,_):r.findEntryWithLevel(l,_),I=r.getPtId(D),O={points:[o(w,f,m.eventDataKeys)],event:c.event};k||(O.nextLevel=I);var B=e.triggerHandler(h,"plotly_"+y.type+"click",O);if(B!==!1&&u.hovermode&&(h._hoverdata=[o(w,f,m.eventDataKeys)],A.click(h,c.event)),!k&&B!==!1&&!h._dragging&&!h._transitioning){g.call("_storeDirectGUIEdit",f,u._tracePreGUI[f.uid],{level:f.level});var R={data:[{level:I}],traces:[y.index]},L={frame:{redraw:!1,duration:m.transitionTime},transition:{duration:m.transitionTime,easing:m.transitionEasing},mode:"immediate",fromcurrent:!0};A.loneUnhover(u._hoverlayer.node()),g.call("animate",h,R,L)}};a.on("mouseover",S),a.on("mouseout",T),a.on("click",M)};function o(a,s,h){for(var v=a.data.data,m={curveNumber:s.index,pointNumber:v.i,data:s._input,fullData:s},p=0;p<h.length;p++){var y=h[p];y in a&&(m[y]=a[y])}return"parentString"in a&&!r.isHierarchyRoot(a)&&(m.parent=a.parentString),E(m,s,v.i),m}}),mx=Vt(X=>{var V=Ai(),c=sv(),g=(M0(),xd(Rd)).interpolate,E=go(),A=qr(),t=sl(),e=of(),r=e.recordMinTextSize,i=e.clearMinTextSize,n=N1(),o=Sd().getRotationAngle,a=n.computeTransform,s=n.transformInsideText,h=Qw().styleOne,v=Gf().resizeText,m=kv(),p=$2(),y=Hp();X.plot=function(M,w,u,f){var k=M._fullLayout,_=k._sunburstlayer,D,I,O=!u,B=!k.uniformtext.mode&&y.hasTransition(u);if(i("sunburst",k),D=_.selectAll("g.trace.sunburst").data(w,function(L){return L[0].trace.uid}),D.enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),D.order(),B){f&&(I=f());var R=V.transition().duration(u.duration).ease(u.easing).each("end",function(){I&&I()}).each("interrupt",function(){I&&I()});R.each(function(){_.selectAll("g.trace").each(function(L){l(M,L,this,u)})})}else D.each(function(L){l(M,L,this,u)}),k.uniformtext.mode&&v(M,k._sunburstlayer.selectAll(".trace"),"sunburst");O&&D.exit().remove()};function l(M,w,u,f){var k=M._context.staticPlot,_=M._fullLayout,D=!_.uniformtext.mode&&y.hasTransition(f),I=V.select(u),O=I.selectAll("g.slice"),B=w[0],R=B.trace,L=B.hierarchy,F=y.findEntryWithLevel(L,R.level),N=y.getMaxDepth(R),j=_._size,G=R.domain,rt=j.w*(G.x[1]-G.x[0]),ct=j.h*(G.y[1]-G.y[0]),lt=.5*Math.min(rt,ct),tt=B.cx=j.l+j.w*(G.x[1]+G.x[0])/2,Z=B.cy=j.t+j.h*(1-G.y[0])-ct/2;if(!F)return O.remove();var st=null,$={};D&&O.each(function(vt){$[y.getPtId(vt)]={rpx0:vt.rpx0,rpx1:vt.rpx1,x0:vt.x0,x1:vt.x1,transform:vt.transform},!st&&y.isEntry(vt)&&(st=vt)});var Q=x(F).descendants(),nt=F.height+1,Y=0,q=N;B.hasMultipleRoots&&y.isHierarchyRoot(F)&&(Q=Q.slice(1),nt-=1,Y=1,q+=1),Q=Q.filter(function(vt){return vt.y1<=q});var ot=o(R.rotation);ot&&Q.forEach(function(vt){vt.x0+=ot,vt.x1+=ot});var it=Math.min(nt,N),dt=function(vt){return(vt-Y)/it*lt},wt=function(vt,Ut){return[vt*Math.cos(Ut),-vt*Math.sin(Ut)]},xt=function(vt){return A.pathAnnulus(vt.rpx0,vt.rpx1,vt.x0,vt.x1,tt,Z)},Ft=function(vt){return tt+S(vt)[0]*(vt.transform.rCenter||0)+(vt.transform.x||0)},Et=function(vt){return Z+S(vt)[1]*(vt.transform.rCenter||0)+(vt.transform.y||0)};O=O.data(Q,y.getPtId),O.enter().append("g").classed("slice",!0),D?O.exit().transition().each(function(){var vt=V.select(this),Ut=vt.select("path.surface");Ut.transition().attrTween("d",function(Zt){var le=Qt(Zt);return function(Te){return xt(le(Te))}});var Kt=vt.select("g.slicetext");Kt.attr("opacity",0)}).remove():O.exit().remove(),O.order();var Nt=null;if(D&&st){var te=y.getPtId(st);O.each(function(vt){Nt===null&&y.getPtId(vt)===te&&(Nt=vt.x1)})}var Jt=O;D&&(Jt=Jt.transition().each("end",function(){var vt=V.select(this);y.setSliceCursor(vt,M,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),Jt.each(function(vt){var Ut=V.select(this),Kt=A.ensureSingle(Ut,"path","surface",function(Oe){Oe.style("pointer-events",k?"none":"all")});vt.rpx0=dt(vt.y0),vt.rpx1=dt(vt.y1),vt.xmid=(vt.x0+vt.x1)/2,vt.pxmid=wt(vt.rpx1,vt.xmid),vt.midangle=-(vt.xmid-Math.PI/2),vt.startangle=-(vt.x0-Math.PI/2),vt.stopangle=-(vt.x1-Math.PI/2),vt.halfangle=.5*Math.min(A.angleDelta(vt.x0,vt.x1)||Math.PI,Math.PI),vt.ring=1-vt.rpx0/vt.rpx1,vt.rInscribed=b(vt),D?Kt.transition().attrTween("d",function(Oe){var ur=Wt(Oe);return function(fr){return xt(ur(fr))}}):Kt.attr("d",xt),Ut.call(m,F,M,w,{eventDataKeys:p.eventDataKeys,transitionTime:p.CLICK_TRANSITION_TIME,transitionEasing:p.CLICK_TRANSITION_EASING}).call(y.setSliceCursor,M,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:M._transitioning}),Kt.call(h,vt,R,M);var Zt=A.ensureSingle(Ut,"g","slicetext"),le=A.ensureSingle(Zt,"text","",function(Oe){Oe.attr("data-notex",1)}),Te=A.ensureUniformFontSize(M,y.determineTextFont(R,vt,_.font));le.text(X.formatSliceLabel(vt,F,R,w,_)).classed("slicetext",!0).attr("text-anchor","middle").call(E.font,Te).call(t.convertToTspans,M);var Se=E.bBox(le.node());vt.transform=s(Se,vt,B),vt.transform.targetX=Ft(vt),vt.transform.targetY=Et(vt);var Fe=function(Oe,ur){var fr=Oe.transform;return a(fr,ur),fr.fontSize=Te.size,r(R.type,fr,_),A.getTextTransform(fr)};D?le.transition().attrTween("transform",function(Oe){var ur=gt(Oe);return function(fr){return Fe(ur(fr),Se)}}):le.attr("transform",Fe(vt,Se))});function Qt(vt){var Ut=y.getPtId(vt),Kt=$[Ut],Zt=$[y.getPtId(F)],le;if(Zt){var Te=(vt.x1>Zt.x1?2*Math.PI:0)+ot;le=vt.rpx1<Zt.rpx1?{x0:vt.x0,x1:vt.x1,rpx0:0,rpx1:0}:{x0:Te,x1:Te,rpx0:vt.rpx0,rpx1:vt.rpx1}}else{var Se,Fe=y.getPtId(vt.parent);O.each(function(Lr){if(y.getPtId(Lr)===Fe)return Se=Lr});var Oe=Se.children,ur;Oe.forEach(function(Lr,kr){if(y.getPtId(Lr)===Ut)return ur=kr});var fr=Oe.length,We=g(Se.x0,Se.x1);le={rpx0:lt,rpx1:lt,x0:We(ur/fr),x1:We((ur+1)/fr)}}return g(Kt,le)}function Wt(vt){var Ut=$[y.getPtId(vt)],Kt,Zt={x0:vt.x0,x1:vt.x1,rpx0:vt.rpx0,rpx1:vt.rpx1};if(Ut)Kt=Ut;else if(st)if(vt.parent)if(Nt){var le=(vt.x1>Nt?2*Math.PI:0)+ot;Kt={x0:le,x1:le}}else Kt={rpx0:lt,rpx1:lt},A.extendFlat(Kt,bt(vt));else Kt={rpx0:0,rpx1:0};else Kt={x0:ot,x1:ot};return g(Kt,Zt)}function gt(vt){var Ut=$[y.getPtId(vt)],Kt,Zt=vt.transform;if(Ut)Kt=Ut;else if(Kt={rpx1:vt.rpx1,transform:{textPosAngle:Zt.textPosAngle,scale:0,rotate:Zt.rotate,rCenter:Zt.rCenter,x:Zt.x,y:Zt.y}},st)if(vt.parent)if(Nt){var le=vt.x1>Nt?2*Math.PI:0;Kt.x0=Kt.x1=le}else A.extendFlat(Kt,bt(vt));else Kt.x0=Kt.x1=ot;else Kt.x0=Kt.x1=ot;var Te=g(Kt.transform.textPosAngle,vt.transform.textPosAngle),Se=g(Kt.rpx1,vt.rpx1),Fe=g(Kt.x0,vt.x0),Oe=g(Kt.x1,vt.x1),ur=g(Kt.transform.scale,Zt.scale),fr=g(Kt.transform.rotate,Zt.rotate),We=Zt.rCenter===0?3:Kt.transform.rCenter===0?1/3:1,Lr=g(Kt.transform.rCenter,Zt.rCenter),kr=function(he){return Lr(Math.pow(he,We))};return function(he){var Dt=Se(he),qt=Fe(he),zt=Oe(he),ut=kr(he),yt=wt(Dt,(qt+zt)/2),Mt=Te(he),Ot={pxmid:yt,rpx1:Dt,transform:{textPosAngle:Mt,rCenter:ut,x:Zt.x,y:Zt.y}};return r(R.type,Zt,_),{transform:{targetX:Ft(Ot),targetY:Et(Ot),scale:ur(he),rotate:fr(he),rCenter:ut}}}}function bt(vt){var Ut=vt.parent,Kt=$[y.getPtId(Ut)],Zt={};if(Kt){var le=Ut.children,Te=le.indexOf(vt),Se=le.length,Fe=g(Kt.x0,Kt.x1);Zt.x0=Fe(Te/Se),Zt.x1=Fe(Te/Se)}else Zt.x0=Zt.x1=0;return Zt}}function x(M){return c.partition().size([2*Math.PI,M.height+1])(M)}X.formatSliceLabel=function(M,w,u,f,k){var _=u.texttemplate,D=u.textinfo;if(!_&&(!D||D==="none"))return"";var I=k.separators,O=f[0],B=M.data.data,R=O.hierarchy,L=y.isHierarchyRoot(M),F=y.getParent(R,M),N=y.getValue(M);if(!_){var j=D.split("+"),G=function(Y){return j.indexOf(Y)!==-1},rt=[],ct;if(G("label")&&B.label&&rt.push(B.label),B.hasOwnProperty("v")&&G("value")&&rt.push(y.formatValue(B.v,I)),!L){G("current path")&&rt.push(y.getPath(M.data));var lt=0;G("percent parent")&<++,G("percent entry")&<++,G("percent root")&<++;var tt=lt>1;if(lt){var Z,st=function(Y){ct=y.formatPercent(Z,I),tt&&(ct+=" of "+Y),rt.push(ct)};G("percent parent")&&!L&&(Z=N/y.getValue(F),st("parent")),G("percent entry")&&(Z=N/y.getValue(w),st("entry")),G("percent root")&&(Z=N/y.getValue(R),st("root"))}}return G("text")&&(ct=A.castOption(u,B.i,"text"),A.isValidTextValue(ct)&&rt.push(ct)),rt.join("<br>")}var $=A.castOption(u,B.i,"texttemplate");if(!$)return"";var Q={};B.label&&(Q.label=B.label),B.hasOwnProperty("v")&&(Q.value=B.v,Q.valueLabel=y.formatValue(B.v,I)),Q.currentPath=y.getPath(M.data),L||(Q.percentParent=N/y.getValue(F),Q.percentParentLabel=y.formatPercent(Q.percentParent,I),Q.parent=y.getPtLabel(F)),Q.percentEntry=N/y.getValue(w),Q.percentEntryLabel=y.formatPercent(Q.percentEntry,I),Q.entry=y.getPtLabel(w),Q.percentRoot=N/y.getValue(R),Q.percentRootLabel=y.formatPercent(Q.percentRoot,I),Q.root=y.getPtLabel(R),B.hasOwnProperty("color")&&(Q.color=B.color);var nt=A.castOption(u,B.i,"text");return(A.isValidTextValue(nt)||nt==="")&&(Q.text=nt),Q.customdata=A.castOption(u,B.i,"customdata"),A.texttemplateString($,Q,k._d3locale,Q,u._meta||{})};function b(M){return M.rpx0===0&&A.isFullCircle([M.x0,M.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(M.halfangle)),M.ring/2))}function S(M){return T(M.rpx1,M.transform.textPosAngle)}function T(M,w){return[M*Math.sin(w),-M*Math.cos(w)]}}),IS=Vt((X,V)=>{V.exports={moduleType:"trace",name:"sunburst",basePlotModule:W6(),categories:[],animatable:!0,attributes:ov(),layoutAttributes:J2(),supplyDefaults:Z6(),supplyLayoutDefaults:X6(),calc:lv().calc,crossTraceCalc:lv().crossTraceCalc,plot:mx().plot,style:Qw().style,colorbar:Wh(),meta:{}}}),LS=Vt((X,V)=>{V.exports=IS()}),CS=Vt(X=>{var V=fu();X.name="treemap",X.plot=function(c,g,E,A){V.plotBasePlot(X.name,c,g,E,A)},X.clean=function(c,g,E,A){V.cleanBasePlot(X.name,c,g,E,A)}}),S0=Vt((X,V)=>{V.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}),vx=Vt((X,V)=>{var c=Zo().hovertemplateAttrs,g=Zo().texttemplateAttrs,E=wl(),A=pu().attributes,t=x0(),e=ov(),r=S0(),i=po().extendFlat,n=Eh().pattern;V.exports={labels:e.labels,parents:e.parents,values:e.values,branchvalues:e.branchvalues,count:e.count,level:e.level,maxdepth:e.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:i({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:e.marker.colors,pattern:n,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:e.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:i({},t.textfont,{}),editType:"calc"},text:t.text,textinfo:e.textinfo,texttemplate:g({editType:"plot"},{keys:r.eventDataKeys.concat(["label","value"])}),hovertext:t.hovertext,hoverinfo:e.hoverinfo,hovertemplate:c({},{keys:r.eventDataKeys}),textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:i({},t.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:t.sort,root:e.root,domain:A({name:"treemap",trace:!0,editType:"calc"})}}),Yw=Vt((X,V)=>{V.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),DS=Vt((X,V)=>{var c=qr(),g=vx(),E=vi(),A=pu().defaults,t=zf().handleText,e=d0().TEXTPAD,r=_0().handleMarkerDefaults,i=Ul(),n=i.hasColorscale,o=i.handleDefaults;V.exports=function(a,s,h,v){function m(f,k){return c.coerce(a,s,g,f,k)}var p=m("labels"),y=m("parents");if(!p||!p.length||!y||!y.length){s.visible=!1;return}var l=m("values");l&&l.length?m("branchvalues"):m("count"),m("level"),m("maxdepth");var x=m("tiling.packing");x==="squarify"&&m("tiling.squarifyratio"),m("tiling.flip"),m("tiling.pad");var b=m("text");m("texttemplate"),s.texttemplate||m("textinfo",c.isArrayOrTypedArray(b)?"text+label":"label"),m("hovertext"),m("hovertemplate");var S=m("pathbar.visible"),T="auto";t(a,s,v,m,T,{hasPathbar:S,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),m("textposition");var M=s.textposition.indexOf("bottom")!==-1;r(a,s,v,m);var w=s._hasColorscale=n(a,"marker","colors")||(a.marker||{}).coloraxis;w?o(a,s,v,m,{prefix:"marker.",cLetter:"c"}):m("marker.depthfade",!(s.marker.colors||[]).length);var u=s.textfont.size*2;m("marker.pad.t",M?u/4:u),m("marker.pad.l",u/4),m("marker.pad.r",u/4),m("marker.pad.b",M?u:u/4),m("marker.cornerradius"),s._hovered={marker:{line:{width:2,color:E.contrast(v.paper_bgcolor)}}},S&&(m("pathbar.thickness",s.pathbar.textfont.size+2*e),m("pathbar.side"),m("pathbar.edgeshape")),m("sort"),m("root.color"),A(s,v,m),s._length=null}}),zS=Vt((X,V)=>{var c=qr(),g=Yw();V.exports=function(E,A){function t(e,r){return c.coerce(E,A,g,e,r)}t("treemapcolorway",A.colorway),t("extendtreemapcolors")}}),Kw=Vt(X=>{var V=lv();X.calc=function(c,g){return V.calc(c,g)},X.crossTraceCalc=function(c){return V._runCrossTraceCalc("treemap",c)}}),t3=Vt((X,V)=>{V.exports=function c(g,E,A){var t;A.swapXY&&(t=g.x0,g.x0=g.y0,g.y0=t,t=g.x1,g.x1=g.y1,g.y1=t),A.flipX&&(t=g.x0,g.x0=E[0]-g.x1,g.x1=E[0]-t),A.flipY&&(t=g.y0,g.y0=E[1]-g.y1,g.y1=E[1]-t);var e=g.children;if(e)for(var r=0;r<e.length;r++)c(e[r],E,A)}}),e3=Vt((X,V)=>{var c=sv(),g=t3();V.exports=function(A,t,e){var r=e.flipX,i=e.flipY,n=e.packing==="dice-slice",o=e.pad[i?"bottom":"top"],a=e.pad[r?"right":"left"],s=e.pad[r?"left":"right"],h=e.pad[i?"top":"bottom"],v;n&&(v=a,a=o,o=v,v=s,s=h,h=v);var m=c.treemap().tile(E(e.packing,e.squarifyratio)).paddingInner(e.pad.inner).paddingLeft(a).paddingRight(s).paddingTop(o).paddingBottom(h).size(n?[t[1],t[0]]:t)(A);return(n||r||i)&&g(m,t,{swapXY:n,flipX:r,flipY:i}),m};function E(A,t){switch(A){case"squarify":return c.treemapSquarify.ratio(t);case"binary":return c.treemapBinary;case"dice":return c.treemapDice;case"slice":return c.treemapSlice;default:return c.treemapSliceDice}}}),yx=Vt((X,V)=>{var c=Ai(),g=vi(),E=qr(),A=Hp(),t=of().resizeText,e=gx();function r(n){var o=n._fullLayout._treemaplayer.selectAll(".trace");t(n,o,"treemap"),o.each(function(a){var s=c.select(this),h=a[0],v=h.trace;s.style("opacity",v.opacity),s.selectAll("path.surface").each(function(m){c.select(this).call(i,m,v,n,{hovered:!1})})})}function i(n,o,a,s,h){var v=(h||{}).hovered,m=o.data.data,p=m.i,y,l,x=m.color,b=A.isHierarchyRoot(o),S=1;if(v)y=a._hovered.marker.line.color,l=a._hovered.marker.line.width;else if(b&&x===a.root.color)S=100,y="rgba(0,0,0,0)",l=0;else if(y=E.castOption(a,p,"marker.line.color")||g.defaultLine,l=E.castOption(a,p,"marker.line.width")||0,!a._hasColorscale&&!o.onPathbar){var T=a.marker.depthfade;if(T){var M=g.combine(g.addOpacity(a._backgroundColor,.75),x),w;if(T===!0){var u=A.getMaxDepth(a);isFinite(u)?A.isLeaf(o)?w=0:w=a._maxVisibleLayers-(o.data.depth-a._entryDepth):w=o.data.height+1}else w=o.data.depth-a._entryDepth,a._atRootLevel||w++;if(w>0)for(var f=0;f<w;f++){var k=.5*f/w;x=g.combine(g.addOpacity(M,k),x)}}}n.call(e,o,a,s,x).style("stroke-width",l).call(g.stroke,y).style("opacity",S)}V.exports={style:r,styleOne:i}}),OS=Vt((X,V)=>{var c=Ai(),g=qr(),E=go(),A=sl(),t=e3(),e=yx().styleOne,r=S0(),i=Hp(),n=kv(),o=!0;V.exports=function(a,s,h,v,m){var p=m.barDifY,y=m.width,l=m.height,x=m.viewX,b=m.viewY,S=m.pathSlice,T=m.toMoveInsideSlice,M=m.strTransform,w=m.hasTransition,u=m.handleSlicesExit,f=m.makeUpdateSliceInterpolator,k=m.makeUpdateTextInterpolator,_={},D=a._context.staticPlot,I=a._fullLayout,O=s[0],B=O.trace,R=O.hierarchy,L=y/B._entryDepth,F=i.listPath(h.data,"id"),N=t(R.copy(),[y,l],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();N=N.filter(function(G){var rt=F.indexOf(G.data.id);return rt===-1?!1:(G.x0=L*rt,G.x1=L*(rt+1),G.y0=p,G.y1=p+l,G.onPathbar=!0,!0)}),N.reverse(),v=v.data(N,i.getPtId),v.enter().append("g").classed("pathbar",!0),u(v,o,_,[y,l],S),v.order();var j=v;w&&(j=j.transition().each("end",function(){var G=c.select(this);i.setSliceCursor(G,a,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),j.each(function(G){G._x0=x(G.x0),G._x1=x(G.x1),G._y0=b(G.y0),G._y1=b(G.y1),G._hoverX=x(G.x1-Math.min(y,l)/2),G._hoverY=b(G.y1-l/2);var rt=c.select(this),ct=g.ensureSingle(rt,"path","surface",function(st){st.style("pointer-events",D?"none":"all")});w?ct.transition().attrTween("d",function(st){var $=f(st,o,_,[y,l]);return function(Q){return S($(Q))}}):ct.attr("d",S),rt.call(n,h,a,s,{styleOne:e,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(i.setSliceCursor,a,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:a._transitioning}),ct.call(e,G,B,a,{hovered:!1}),G._text=(i.getPtLabel(G)||"").split("<br>").join(" ")||"";var lt=g.ensureSingle(rt,"g","slicetext"),tt=g.ensureSingle(lt,"text","",function(st){st.attr("data-notex",1)}),Z=g.ensureUniformFontSize(a,i.determineTextFont(B,G,I.font,{onPathbar:!0}));tt.text(G._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(E.font,Z).call(A.convertToTspans,a),G.textBB=E.bBox(tt.node()),G.transform=T(G,{fontSize:Z.size,onPathbar:!0}),G.transform.fontSize=Z.size,w?tt.transition().attrTween("transform",function(st){var $=k(st,o,_,[y,l]);return function(Q){return M($(Q))}}):tt.attr("transform",M(G))})}}),FS=Vt((X,V)=>{var c=Ai(),g=(M0(),xd(Rd)).interpolate,E=Hp(),A=qr(),t=d0().TEXTPAD,e=g0(),r=e.toMoveInsideBar,i=of(),n=i.recordMinTextSize,o=S0(),a=OS();function s(h){return E.isHierarchyRoot(h)?"":E.getPtId(h)}V.exports=function(h,v,m,p,y){var l=h._fullLayout,x=v[0],b=x.trace,S=b.type,T=S==="icicle",M=x.hierarchy,w=E.findEntryWithLevel(M,b.level),u=c.select(m),f=u.selectAll("g.pathbar"),k=u.selectAll("g.slice");if(!w){f.remove(),k.remove();return}var _=E.isHierarchyRoot(w),D=!l.uniformtext.mode&&E.hasTransition(p),I=E.getMaxDepth(b),O=function(We){return We.data.depth-w.data.depth<I},B=l._size,R=b.domain,L=B.w*(R.x[1]-R.x[0]),F=B.h*(R.y[1]-R.y[0]),N=L,j=b.pathbar.thickness,G=b.marker.line.width+o.gapWithPathbar,rt=b.pathbar.visible?b.pathbar.side.indexOf("bottom")>-1?F+G:-(j+G):0,ct={x0:N,x1:N,y0:rt,y1:rt+j},lt=function(We,Lr,kr){var he=b.tiling.pad,Dt=function(yt){return yt-he<=Lr.x0},qt=function(yt){return yt+he>=Lr.x1},zt=function(yt){return yt-he<=Lr.y0},ut=function(yt){return yt+he>=Lr.y1};return We.x0===Lr.x0&&We.x1===Lr.x1&&We.y0===Lr.y0&&We.y1===Lr.y1?{x0:We.x0,x1:We.x1,y0:We.y0,y1:We.y1}:{x0:Dt(We.x0-he)?0:qt(We.x0-he)?kr[0]:We.x0,x1:Dt(We.x1+he)?0:qt(We.x1+he)?kr[0]:We.x1,y0:zt(We.y0-he)?0:ut(We.y0-he)?kr[1]:We.y0,y1:zt(We.y1+he)?0:ut(We.y1+he)?kr[1]:We.y1}},tt=null,Z={},st={},$=null,Q=function(We,Lr){return Lr?Z[s(We)]:st[s(We)]},nt=function(We,Lr,kr,he){if(Lr)return Z[s(M)]||ct;var Dt=st[b.level]||kr;return O(We)?lt(We,Dt,he):{}};x.hasMultipleRoots&&_&&I++,b._maxDepth=I,b._backgroundColor=l.paper_bgcolor,b._entryDepth=w.data.depth,b._atRootLevel=_;var Y=-L/2+B.l+B.w*(R.x[1]+R.x[0])/2,q=-F/2+B.t+B.h*(1-(R.y[1]+R.y[0])/2),ot=function(We){return Y+We},it=function(We){return q+We},dt=it(0),wt=ot(0),xt=function(We){return wt+We},Ft=function(We){return dt+We};function Et(We,Lr){return We+","+Lr}var Nt=xt(0),te=function(We){We.x=Math.max(Nt,We.x)},Jt=b.pathbar.edgeshape,Qt=function(We){var Lr=xt(Math.max(Math.min(We.x0,We.x0),0)),kr=xt(Math.min(Math.max(We.x1,We.x1),N)),he=Ft(We.y0),Dt=Ft(We.y1),qt=j/2,zt={},ut={};zt.x=Lr,ut.x=kr,zt.y=ut.y=(he+Dt)/2;var yt={x:Lr,y:he},Mt={x:kr,y:he},Ot={x:kr,y:Dt},$t={x:Lr,y:Dt};return Jt===">"?(yt.x-=qt,Mt.x-=qt,Ot.x-=qt,$t.x-=qt):Jt==="/"?(Ot.x-=qt,$t.x-=qt,zt.x-=qt/2,ut.x-=qt/2):Jt==="\\"?(yt.x-=qt,Mt.x-=qt,zt.x-=qt/2,ut.x-=qt/2):Jt==="<"&&(zt.x-=qt,ut.x-=qt),te(yt),te($t),te(zt),te(Mt),te(Ot),te(ut),"M"+Et(yt.x,yt.y)+"L"+Et(Mt.x,Mt.y)+"L"+Et(ut.x,ut.y)+"L"+Et(Ot.x,Ot.y)+"L"+Et($t.x,$t.y)+"L"+Et(zt.x,zt.y)+"Z"},Wt=b[T?"tiling":"marker"].pad,gt=function(We){return b.textposition.indexOf(We)!==-1},bt=gt("top"),vt=gt("left"),Ut=gt("right"),Kt=gt("bottom"),Zt=function(We){var Lr=ot(We.x0),kr=ot(We.x1),he=it(We.y0),Dt=it(We.y1),qt=kr-Lr,zt=Dt-he;if(!qt||!zt)return"";var ut=b.marker.cornerradius||0,yt=Math.min(ut,qt/2,zt/2);yt&&We.data&&We.data.data&&We.data.data.label&&(bt&&(yt=Math.min(yt,Wt.t)),vt&&(yt=Math.min(yt,Wt.l)),Ut&&(yt=Math.min(yt,Wt.r)),Kt&&(yt=Math.min(yt,Wt.b)));var Mt=function(Ot,$t){return yt?"a"+Et(yt,yt)+" 0 0 1 "+Et(Ot,$t):""};return"M"+Et(Lr,he+yt)+Mt(yt,-yt)+"L"+Et(kr-yt,he)+Mt(yt,yt)+"L"+Et(kr,Dt-yt)+Mt(-yt,yt)+"L"+Et(Lr+yt,Dt)+Mt(-yt,-yt)+"Z"},le=function(We,Lr){var kr=We.x0,he=We.x1,Dt=We.y0,qt=We.y1,zt=We.textBB,ut=bt||Lr.isHeader&&!Kt,yt=ut?"start":Kt?"end":"middle",Mt=gt("right"),Ot=gt("left")||Lr.onPathbar,$t=Ot?-1:Mt?1:0;if(Lr.isHeader){if(kr+=(T?Wt:Wt.l)-t,he-=(T?Wt:Wt.r)-t,kr>=he){var ee=(kr+he)/2;kr=ee,he=ee}var we;Kt?(we=qt-(T?Wt:Wt.b),Dt<we&&we<qt&&(Dt=we)):(we=Dt+(T?Wt:Wt.t),Dt<we&&we<qt&&(qt=we))}var Me=r(kr,he,Dt,qt,zt,{isHorizontal:!1,constrained:!0,angle:0,anchor:yt,leftToRight:$t});return Me.fontSize=Lr.fontSize,Me.targetX=ot(Me.targetX),Me.targetY=it(Me.targetY),isNaN(Me.targetX)||isNaN(Me.targetY)?{}:(kr!==he&&Dt!==qt&&n(b.type,Me,l),{scale:Me.scale,rotate:Me.rotate,textX:Me.textX,textY:Me.textY,anchorX:Me.anchorX,anchorY:Me.anchorY,targetX:Me.targetX,targetY:Me.targetY})},Te=function(We,Lr){for(var kr,he=0,Dt=We;!kr&&he<I;)he++,Dt=Dt.parent,Dt?kr=Q(Dt,Lr):he=I;return kr||{}},Se=function(We,Lr,kr,he){var Dt=Q(We,Lr),qt;if(Lr)qt=ct;else{var zt=Q(w,Lr);zt?qt=lt(We,zt,he):qt={}}return g(Dt,qt)},Fe=function(We,Lr,kr,he,Dt){var qt=Q(We,Lr),zt;if(qt)zt=qt;else if(Lr)zt=ct;else if(tt)if(We.parent){var ut=$||kr;ut&&!Lr?zt=lt(We,ut,he):(zt={},A.extendFlat(zt,Te(We,Lr)))}else zt=A.extendFlat({},We),T&&(Dt.orientation==="h"?Dt.flipX?zt.x0=We.x1:zt.x1=0:Dt.flipY?zt.y0=We.y1:zt.y1=0);else zt={};return g(zt,{x0:We.x0,x1:We.x1,y0:We.y0,y1:We.y1})},Oe=function(We,Lr,kr,he){var Dt=Q(We,Lr),qt={},zt=nt(We,Lr,kr,he);A.extendFlat(qt,{transform:le({x0:zt.x0,x1:zt.x1,y0:zt.y0,y1:zt.y1,textBB:We.textBB,_text:We._text},{isHeader:E.isHeader(We,b)})}),Dt?qt=Dt:We.parent&&A.extendFlat(qt,Te(We,Lr));var ut=We.transform;return We.x0!==We.x1&&We.y0!==We.y1&&n(b.type,ut,l),g(qt,{transform:{scale:ut.scale,rotate:ut.rotate,textX:ut.textX,textY:ut.textY,anchorX:ut.anchorX,anchorY:ut.anchorY,targetX:ut.targetX,targetY:ut.targetY}})},ur=function(We,Lr,kr,he,Dt){var qt=he[0],zt=he[1];D?We.exit().transition().each(function(){var ut=c.select(this),yt=ut.select("path.surface");yt.transition().attrTween("d",function(Ot){var $t=Se(Ot,Lr,kr,[qt,zt]);return function(ee){return Dt($t(ee))}});var Mt=ut.select("g.slicetext");Mt.attr("opacity",0)}).remove():We.exit().remove()},fr=function(We){var Lr=We.transform;return We.x0!==We.x1&&We.y0!==We.y1&&n(b.type,Lr,l),A.getTextTransform({textX:Lr.textX,textY:Lr.textY,anchorX:Lr.anchorX,anchorY:Lr.anchorY,targetX:Lr.targetX,targetY:Lr.targetY,scale:Lr.scale,rotate:Lr.rotate})};D&&(f.each(function(We){Z[s(We)]={x0:We.x0,x1:We.x1,y0:We.y0,y1:We.y1},We.transform&&(Z[s(We)].transform={textX:We.transform.textX,textY:We.transform.textY,anchorX:We.transform.anchorX,anchorY:We.transform.anchorY,targetX:We.transform.targetX,targetY:We.transform.targetY,scale:We.transform.scale,rotate:We.transform.rotate})}),k.each(function(We){st[s(We)]={x0:We.x0,x1:We.x1,y0:We.y0,y1:We.y1},We.transform&&(st[s(We)].transform={textX:We.transform.textX,textY:We.transform.textY,anchorX:We.transform.anchorX,anchorY:We.transform.anchorY,targetX:We.transform.targetX,targetY:We.transform.targetY,scale:We.transform.scale,rotate:We.transform.rotate}),!tt&&E.isEntry(We)&&(tt=We)})),$=y(h,v,w,k,{width:L,height:F,viewX:ot,viewY:it,pathSlice:Zt,toMoveInsideSlice:le,prevEntry:tt,makeUpdateSliceInterpolator:Fe,makeUpdateTextInterpolator:Oe,handleSlicesExit:ur,hasTransition:D,strTransform:fr}),b.pathbar.visible?a(h,v,w,f,{barDifY:rt,width:N,height:j,viewX:xt,viewY:Ft,pathSlice:Qt,toMoveInsideSlice:le,makeUpdateSliceInterpolator:Fe,makeUpdateTextInterpolator:Oe,handleSlicesExit:ur,hasTransition:D,strTransform:fr}):f.remove()}}),r3=Vt((X,V)=>{var c=Ai(),g=Hp(),E=of(),A=E.clearMinTextSize,t=Gf().resizeText,e=FS();V.exports=function(r,i,n,o,a){var s=a.type,h=a.drawDescendants,v=r._fullLayout,m=v["_"+s+"layer"],p,y,l=!n;if(A(s,v),p=m.selectAll("g.trace."+s).data(i,function(b){return b[0].trace.uid}),p.enter().append("g").classed("trace",!0).classed(s,!0),p.order(),!v.uniformtext.mode&&g.hasTransition(n)){o&&(y=o());var x=c.transition().duration(n.duration).ease(n.easing).each("end",function(){y&&y()}).each("interrupt",function(){y&&y()});x.each(function(){m.selectAll("g.trace").each(function(b){e(r,b,this,n,h)})})}else p.each(function(b){e(r,b,this,n,h)}),v.uniformtext.mode&&t(r,m.selectAll(".trace"),s);l&&p.exit().remove()}}),BS=Vt((X,V)=>{var c=Ai(),g=qr(),E=go(),A=sl(),t=e3(),e=yx().styleOne,r=S0(),i=Hp(),n=kv(),o=mx().formatSliceLabel,a=!1;V.exports=function(s,h,v,m,p){var y=p.width,l=p.height,x=p.viewX,b=p.viewY,S=p.pathSlice,T=p.toMoveInsideSlice,M=p.strTransform,w=p.hasTransition,u=p.handleSlicesExit,f=p.makeUpdateSliceInterpolator,k=p.makeUpdateTextInterpolator,_=p.prevEntry,D={},I=s._context.staticPlot,O=s._fullLayout,B=h[0],R=B.trace,L=R.textposition.indexOf("left")!==-1,F=R.textposition.indexOf("right")!==-1,N=R.textposition.indexOf("bottom")!==-1,j=!N&&!R.marker.pad.t||N&&!R.marker.pad.b,G=t(v,[y,l],{packing:R.tiling.packing,squarifyratio:R.tiling.squarifyratio,flipX:R.tiling.flip.indexOf("x")>-1,flipY:R.tiling.flip.indexOf("y")>-1,pad:{inner:R.tiling.pad,top:R.marker.pad.t,left:R.marker.pad.l,right:R.marker.pad.r,bottom:R.marker.pad.b}}),rt=G.descendants(),ct=1/0,lt=-1/0;rt.forEach(function(Q){var nt=Q.depth;nt>=R._maxDepth?(Q.x0=Q.x1=(Q.x0+Q.x1)/2,Q.y0=Q.y1=(Q.y0+Q.y1)/2):(ct=Math.min(ct,nt),lt=Math.max(lt,nt))}),m=m.data(rt,i.getPtId),R._maxVisibleLayers=isFinite(lt)?lt-ct+1:0,m.enter().append("g").classed("slice",!0),u(m,a,D,[y,l],S),m.order();var tt=null;if(w&&_){var Z=i.getPtId(_);m.each(function(Q){tt===null&&i.getPtId(Q)===Z&&(tt={x0:Q.x0,x1:Q.x1,y0:Q.y0,y1:Q.y1})})}var st=function(){return tt||{x0:0,x1:y,y0:0,y1:l}},$=m;return w&&($=$.transition().each("end",function(){var Q=c.select(this);i.setSliceCursor(Q,s,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),$.each(function(Q){var nt=i.isHeader(Q,R);Q._x0=x(Q.x0),Q._x1=x(Q.x1),Q._y0=b(Q.y0),Q._y1=b(Q.y1),Q._hoverX=x(Q.x1-R.marker.pad.r),Q._hoverY=b(N?Q.y1-R.marker.pad.b/2:Q.y0+R.marker.pad.t/2);var Y=c.select(this),q=g.ensureSingle(Y,"path","surface",function(Ft){Ft.style("pointer-events",I?"none":"all")});w?q.transition().attrTween("d",function(Ft){var Et=f(Ft,a,st(),[y,l]);return function(Nt){return S(Et(Nt))}}):q.attr("d",S),Y.call(n,v,s,h,{styleOne:e,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(i.setSliceCursor,s,{isTransitioning:s._transitioning}),q.call(e,Q,R,s,{hovered:!1}),Q.x0===Q.x1||Q.y0===Q.y1?Q._text="":nt?Q._text=j?"":i.getPtLabel(Q)||"":Q._text=o(Q,v,R,h,O)||"";var ot=g.ensureSingle(Y,"g","slicetext"),it=g.ensureSingle(ot,"text","",function(Ft){Ft.attr("data-notex",1)}),dt=g.ensureUniformFontSize(s,i.determineTextFont(R,Q,O.font)),wt=Q._text||" ",xt=nt&&wt.indexOf("<br>")===-1;it.text(wt).classed("slicetext",!0).attr("text-anchor",F?"end":L||xt?"start":"middle").call(E.font,dt).call(A.convertToTspans,s),Q.textBB=E.bBox(it.node()),Q.transform=T(Q,{fontSize:dt.size,isHeader:nt}),Q.transform.fontSize=dt.size,w?it.transition().attrTween("transform",function(Ft){var Et=k(Ft,a,st(),[y,l]);return function(Nt){return M(Et(Nt))}}):it.attr("transform",M(Q))}),tt}}),RS=Vt((X,V)=>{var c=r3(),g=BS();V.exports=function(E,A,t,e){return c(E,A,t,e,{type:"treemap",drawDescendants:g})}}),jS=Vt((X,V)=>{V.exports={moduleType:"trace",name:"treemap",basePlotModule:CS(),categories:[],animatable:!0,attributes:vx(),layoutAttributes:Yw(),supplyDefaults:DS(),supplyLayoutDefaults:zS(),calc:Kw().calc,crossTraceCalc:Kw().crossTraceCalc,plot:RS(),style:yx().style,colorbar:Wh(),meta:{}}}),NS=Vt((X,V)=>{V.exports=jS()}),US=Vt(X=>{var V=fu();X.name="icicle",X.plot=function(c,g,E,A){V.plotBasePlot(X.name,c,g,E,A)},X.clean=function(c,g,E,A){V.cleanBasePlot(X.name,c,g,E,A)}}),n3=Vt((X,V)=>{var c=Zo().hovertemplateAttrs,g=Zo().texttemplateAttrs,E=wl(),A=pu().attributes,t=x0(),e=ov(),r=vx(),i=S0(),n=po().extendFlat,o=Eh().pattern;V.exports={labels:e.labels,parents:e.parents,values:e.values,branchvalues:e.branchvalues,count:e.count,level:e.level,maxdepth:e.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:r.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:n({colors:e.marker.colors,line:e.marker.line,pattern:o,editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),leaf:e.leaf,pathbar:r.pathbar,text:t.text,textinfo:e.textinfo,texttemplate:g({editType:"plot"},{keys:i.eventDataKeys.concat(["label","value"])}),hovertext:t.hovertext,hoverinfo:e.hoverinfo,hovertemplate:c({},{keys:i.eventDataKeys}),textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:r.outsidetextfont,textposition:r.textposition,sort:t.sort,root:e.root,domain:A({name:"icicle",trace:!0,editType:"calc"})}}),a3=Vt((X,V)=>{V.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),VS=Vt((X,V)=>{var c=qr(),g=n3(),E=vi(),A=pu().defaults,t=zf().handleText,e=d0().TEXTPAD,r=_0().handleMarkerDefaults,i=Ul(),n=i.hasColorscale,o=i.handleDefaults;V.exports=function(a,s,h,v){function m(M,w){return c.coerce(a,s,g,M,w)}var p=m("labels"),y=m("parents");if(!p||!p.length||!y||!y.length){s.visible=!1;return}var l=m("values");l&&l.length?m("branchvalues"):m("count"),m("level"),m("maxdepth"),m("tiling.orientation"),m("tiling.flip"),m("tiling.pad");var x=m("text");m("texttemplate"),s.texttemplate||m("textinfo",c.isArrayOrTypedArray(x)?"text+label":"label"),m("hovertext"),m("hovertemplate");var b=m("pathbar.visible"),S="auto";t(a,s,v,m,S,{hasPathbar:b,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),m("textposition"),r(a,s,v,m);var T=s._hasColorscale=n(a,"marker","colors")||(a.marker||{}).coloraxis;T&&o(a,s,v,m,{prefix:"marker.",cLetter:"c"}),m("leaf.opacity",T?1:.7),s._hovered={marker:{line:{width:2,color:E.contrast(v.paper_bgcolor)}}},b&&(m("pathbar.thickness",s.pathbar.textfont.size+2*e),m("pathbar.side"),m("pathbar.edgeshape")),m("sort"),m("root.color"),A(s,v,m),s._length=null}}),qS=Vt((X,V)=>{var c=qr(),g=a3();V.exports=function(E,A){function t(e,r){return c.coerce(E,A,g,e,r)}t("iciclecolorway",A.colorway),t("extendiciclecolors")}}),i3=Vt(X=>{var V=lv();X.calc=function(c,g){return V.calc(c,g)},X.crossTraceCalc=function(c){return V._runCrossTraceCalc("icicle",c)}}),HS=Vt((X,V)=>{var c=sv(),g=t3();V.exports=function(E,A,t){var e=t.flipX,r=t.flipY,i=t.orientation==="h",n=t.maxDepth,o=A[0],a=A[1];n&&(o=(E.height+1)*A[0]/Math.min(E.height+1,n),a=(E.height+1)*A[1]/Math.min(E.height+1,n));var s=c.partition().padding(t.pad.inner).size(i?[A[1],o]:[A[0],a])(E);return(i||e||r)&&g(s,A,{swapXY:i,flipX:e,flipY:r}),s}}),o3=Vt((X,V)=>{var c=Ai(),g=vi(),E=qr(),A=of().resizeText,t=gx();function e(i){var n=i._fullLayout._iciclelayer.selectAll(".trace");A(i,n,"icicle"),n.each(function(o){var a=c.select(this),s=o[0],h=s.trace;a.style("opacity",h.opacity),a.selectAll("path.surface").each(function(v){c.select(this).call(r,v,h,i)})})}function r(i,n,o,a){var s=n.data.data,h=!n.children,v=s.i,m=E.castOption(o,v,"marker.line.color")||g.defaultLine,p=E.castOption(o,v,"marker.line.width")||0;i.call(t,n,o,a).style("stroke-width",p).call(g.stroke,m).style("opacity",h?o.leaf.opacity:null)}V.exports={style:e,styleOne:r}}),GS=Vt((X,V)=>{var c=Ai(),g=qr(),E=go(),A=sl(),t=HS(),e=o3().styleOne,r=S0(),i=Hp(),n=kv(),o=mx().formatSliceLabel,a=!1;V.exports=function(s,h,v,m,p){var y=p.width,l=p.height,x=p.viewX,b=p.viewY,S=p.pathSlice,T=p.toMoveInsideSlice,M=p.strTransform,w=p.hasTransition,u=p.handleSlicesExit,f=p.makeUpdateSliceInterpolator,k=p.makeUpdateTextInterpolator,_=p.prevEntry,D={},I=s._context.staticPlot,O=s._fullLayout,B=h[0],R=B.trace,L=R.textposition.indexOf("left")!==-1,F=R.textposition.indexOf("right")!==-1,N=R.textposition.indexOf("bottom")!==-1,j=t(v,[y,l],{flipX:R.tiling.flip.indexOf("x")>-1,flipY:R.tiling.flip.indexOf("y")>-1,orientation:R.tiling.orientation,pad:{inner:R.tiling.pad},maxDepth:R._maxDepth}),G=j.descendants(),rt=1/0,ct=-1/0;G.forEach(function($){var Q=$.depth;Q>=R._maxDepth?($.x0=$.x1=($.x0+$.x1)/2,$.y0=$.y1=($.y0+$.y1)/2):(rt=Math.min(rt,Q),ct=Math.max(ct,Q))}),m=m.data(G,i.getPtId),R._maxVisibleLayers=isFinite(ct)?ct-rt+1:0,m.enter().append("g").classed("slice",!0),u(m,a,D,[y,l],S),m.order();var lt=null;if(w&&_){var tt=i.getPtId(_);m.each(function($){lt===null&&i.getPtId($)===tt&&(lt={x0:$.x0,x1:$.x1,y0:$.y0,y1:$.y1})})}var Z=function(){return lt||{x0:0,x1:y,y0:0,y1:l}},st=m;return w&&(st=st.transition().each("end",function(){var $=c.select(this);i.setSliceCursor($,s,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),st.each(function($){$._x0=x($.x0),$._x1=x($.x1),$._y0=b($.y0),$._y1=b($.y1),$._hoverX=x($.x1-R.tiling.pad),$._hoverY=b(N?$.y1-R.tiling.pad/2:$.y0+R.tiling.pad/2);var Q=c.select(this),nt=g.ensureSingle(Q,"path","surface",function(it){it.style("pointer-events",I?"none":"all")});w?nt.transition().attrTween("d",function(it){var dt=f(it,a,Z(),[y,l],{orientation:R.tiling.orientation,flipX:R.tiling.flip.indexOf("x")>-1,flipY:R.tiling.flip.indexOf("y")>-1});return function(wt){return S(dt(wt))}}):nt.attr("d",S),Q.call(n,v,s,h,{styleOne:e,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(i.setSliceCursor,s,{isTransitioning:s._transitioning}),nt.call(e,$,R,s,{hovered:!1}),$.x0===$.x1||$.y0===$.y1?$._text="":$._text=o($,v,R,h,O)||"";var Y=g.ensureSingle(Q,"g","slicetext"),q=g.ensureSingle(Y,"text","",function(it){it.attr("data-notex",1)}),ot=g.ensureUniformFontSize(s,i.determineTextFont(R,$,O.font));q.text($._text||" ").classed("slicetext",!0).attr("text-anchor",F?"end":L?"start":"middle").call(E.font,ot).call(A.convertToTspans,s),$.textBB=E.bBox(q.node()),$.transform=T($,{fontSize:ot.size}),$.transform.fontSize=ot.size,w?q.transition().attrTween("transform",function(it){var dt=k(it,a,Z(),[y,l]);return function(wt){return M(dt(wt))}}):q.attr("transform",M($))}),lt}}),WS=Vt((X,V)=>{var c=r3(),g=GS();V.exports=function(E,A,t,e){return c(E,A,t,e,{type:"icicle",drawDescendants:g})}}),ZS=Vt((X,V)=>{V.exports={moduleType:"trace",name:"icicle",basePlotModule:US(),categories:[],animatable:!0,attributes:n3(),layoutAttributes:a3(),supplyDefaults:VS(),supplyLayoutDefaults:qS(),calc:i3().calc,crossTraceCalc:i3().crossTraceCalc,plot:WS(),style:o3().style,colorbar:Wh(),meta:{}}}),XS=Vt((X,V)=>{V.exports=ZS()}),$S=Vt(X=>{var V=fu();X.name="funnelarea",X.plot=function(c,g,E,A){V.plotBasePlot(X.name,c,g,E,A)},X.clean=function(c,g,E,A){V.cleanBasePlot(X.name,c,g,E,A)}}),s3=Vt((X,V)=>{var c=x0(),g=Ks(),E=pu().attributes,A=Zo().hovertemplateAttrs,t=Zo().texttemplateAttrs,e=po().extendFlat;V.exports={labels:c.labels,label0:c.label0,dlabel:c.dlabel,values:c.values,marker:{colors:c.marker.colors,line:{color:e({},c.marker.line.color,{dflt:null}),width:e({},c.marker.line.width,{dflt:1}),editType:"calc"},pattern:c.marker.pattern,editType:"calc"},text:c.text,hovertext:c.hovertext,scalegroup:e({},c.scalegroup,{}),textinfo:e({},c.textinfo,{flags:["label","text","value","percent"]}),texttemplate:t({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:e({},g.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:A({},{keys:["label","color","value","text","percent"]}),textposition:e({},c.textposition,{values:["inside","none"],dflt:"inside"}),textfont:c.textfont,insidetextfont:c.insidetextfont,title:{text:c.title.text,font:c.title.font,position:e({},c.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:E({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}),l3=Vt((X,V)=>{var c=j1().hiddenlabels;V.exports={hiddenlabels:c,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),JS=Vt((X,V)=>{var c=qr(),g=s3(),E=pu().defaults,A=zf().handleText,t=_0().handleLabelsAndValues,e=_0().handleMarkerDefaults;V.exports=function(r,i,n,o){function a(S,T){return c.coerce(r,i,g,S,T)}var s=a("labels"),h=a("values"),v=t(s,h),m=v.len;if(i._hasLabels=v.hasLabels,i._hasValues=v.hasValues,!i._hasLabels&&i._hasValues&&(a("label0"),a("dlabel")),!m){i.visible=!1;return}i._length=m,e(r,i,o,a),a("scalegroup");var p=a("text"),y=a("texttemplate"),l;if(y||(l=a("textinfo",Array.isArray(p)?"text+percent":"percent")),a("hovertext"),a("hovertemplate"),y||l&&l!=="none"){var x=a("textposition");A(r,i,o,a,x,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else l==="none"&&a("textposition","none");E(i,o,a);var b=a("title.text");b&&(a("title.position"),c.coerceFont(a,"title.font",o.font)),a("aspectratio"),a("baseratio")}}),QS=Vt((X,V)=>{var c=qr(),g=l3();V.exports=function(E,A){function t(e,r){return c.coerce(E,A,g,e,r)}t("hiddenlabels"),t("funnelareacolorway",A.colorway),t("extendfunnelareacolors")}}),u3=Vt((X,V)=>{var c=Bg();function g(A,t){return c.calc(A,t)}function E(A){c.crossTraceCalc(A,{type:"funnelarea"})}V.exports={calc:g,crossTraceCalc:E}}),YS=Vt((X,V)=>{var c=Ai(),g=go(),E=qr(),A=E.strScale,t=E.strTranslate,e=sl(),r=g0(),i=r.toMoveInsideBar,n=of(),o=n.recordMinTextSize,a=n.clearMinTextSize,s=Sd(),h=N1(),v=h.attachFxHandlers,m=h.determineInsideTextFont,p=h.layoutAreas,y=h.prerenderTitles,l=h.positionTitleOutside,x=h.formatSliceLabel;V.exports=function(M,w){var u=M._context.staticPlot,f=M._fullLayout;a("funnelarea",f),y(w,M),p(w,f._size),E.makeTraceGroups(f._funnelarealayer,w,"trace").each(function(k){var _=c.select(this),D=k[0],I=D.trace;T(k),_.each(function(){var O=c.select(this).selectAll("g.slice").data(k);O.enter().append("g").classed("slice",!0),O.exit().remove(),O.each(function(R,L){if(R.hidden){c.select(this).selectAll("path,g").remove();return}R.pointNumber=R.i,R.curveNumber=I.index;var F=D.cx,N=D.cy,j=c.select(this),G=j.selectAll("path.surface").data([R]);G.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),j.call(v,M,k);var rt="M"+(F+R.TR[0])+","+(N+R.TR[1])+b(R.TR,R.BR)+b(R.BR,R.BL)+b(R.BL,R.TL)+"Z";G.attr("d",rt),x(M,R,D);var ct=s.castOption(I.textposition,R.pts),lt=j.selectAll("g.slicetext").data(R.text&&ct!=="none"?[0]:[]);lt.enter().append("g").classed("slicetext",!0),lt.exit().remove(),lt.each(function(){var tt=E.ensureSingle(c.select(this),"text","",function(ot){ot.attr("data-notex",1)}),Z=E.ensureUniformFontSize(M,m(I,R,f.font));tt.text(R.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(g.font,Z).call(e.convertToTspans,M);var st=g.bBox(tt.node()),$,Q,nt,Y=Math.min(R.BL[1],R.BR[1])+N,q=Math.max(R.TL[1],R.TR[1])+N;Q=Math.max(R.TL[0],R.BL[0])+F,nt=Math.min(R.TR[0],R.BR[0])+F,$=i(Q,nt,Y,q,st,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),$.fontSize=Z.size,o(I.type,$,f),k[L].transform=$,E.setTransormAndDisplay(tt,$)})});var B=c.select(this).selectAll("g.titletext").data(I.title.text?[0]:[]);B.enter().append("g").classed("titletext",!0),B.exit().remove(),B.each(function(){var R=E.ensureSingle(c.select(this),"text","",function(N){N.attr("data-notex",1)}),L=I.title.text;I._meta&&(L=E.templateString(L,I._meta)),R.text(L).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(g.font,I.title.font).call(e.convertToTspans,M);var F=l(D,f._size);R.attr("transform",t(F.x,F.y)+A(Math.min(1,F.scale))+t(F.tx,F.ty))})})})};function b(M,w){var u=w[0]-M[0],f=w[1]-M[1];return"l"+u+","+f}function S(M,w){return[.5*(M[0]+w[0]),.5*(M[1]+w[1])]}function T(M){if(!M.length)return;var w=M[0],u=w.trace,f=u.aspectratio,k=u.baseratio;k>.999&&(k=.999);var _=Math.pow(k,2),D=w.vTotal,I=D*_/(1-_),O=D,B=I/D;function R(){var dt=Math.sqrt(B);return{x:dt,y:-dt}}function L(){var dt=R();return[dt.x,dt.y]}var F,N=[];N.push(L());var j,G;for(j=M.length-1;j>-1;j--)if(G=M[j],!G.hidden){var rt=G.v/O;B+=rt,N.push(L())}var ct=1/0,lt=-1/0;for(j=0;j<N.length;j++)F=N[j],ct=Math.min(ct,F[1]),lt=Math.max(lt,F[1]);for(j=0;j<N.length;j++)N[j][1]-=(lt+ct)/2;var tt=N[N.length-1][0],Z=w.r,st=(lt-ct)/2,$=Z/tt,Q=Z/st*f;for(w.r=Q*st,j=0;j<N.length;j++)N[j][0]*=$,N[j][1]*=Q;F=N[0];var nt=[-F[0],F[1]],Y=[F[0],F[1]],q=0;for(j=M.length-1;j>-1;j--)if(G=M[j],!G.hidden){q+=1;var ot=N[q][0],it=N[q][1];G.TL=[-ot,it],G.TR=[ot,it],G.BL=nt,G.BR=Y,G.pxmid=S(G.TR,G.BR),nt=G.TL,Y=G.TR}}}),KS=Vt((X,V)=>{var c=Ai(),g=wg(),E=of().resizeText;V.exports=function(A){var t=A._fullLayout._funnelarealayer.selectAll(".trace");E(A,t,"funnelarea"),t.each(function(e){var r=e[0],i=r.trace,n=c.select(this);n.style({opacity:i.opacity}),n.selectAll("path.surface").each(function(o){c.select(this).call(g,o,i,A)})})}}),tE=Vt((X,V)=>{V.exports={moduleType:"trace",name:"funnelarea",basePlotModule:$S(),categories:["pie-like","funnelarea","showLegend"],attributes:s3(),layoutAttributes:l3(),supplyDefaults:JS(),supplyLayoutDefaults:QS(),calc:u3().calc,crossTraceCalc:u3().crossTraceCalc,plot:YS(),style:KS(),styleOne:wg(),meta:{}}}),eE=Vt((X,V)=>{V.exports=tE()}),Dh=Vt((X,V)=>{(function(){var c={1964:function(t,e,r){t.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(t,e,r){function i(ut,yt){if(!(ut instanceof yt))throw new TypeError("Cannot call a class as a function")}function n(ut,yt){for(var Mt=0;Mt<yt.length;Mt++){var Ot=yt[Mt];Ot.enumerable=Ot.enumerable||!1,Ot.configurable=!0,"value"in Ot&&(Ot.writable=!0),Object.defineProperty(ut,a(Ot.key),Ot)}}function o(ut,yt,Mt){return yt&&n(ut.prototype,yt),Object.defineProperty(ut,"prototype",{writable:!1}),ut}function a(ut){var yt=s(ut,"string");return b(yt)=="symbol"?yt:yt+""}function s(ut,yt){if(b(ut)!="object"||!ut)return ut;var Mt=ut[Symbol.toPrimitive];if(Mt!==void 0){var Ot=Mt.call(ut,yt);if(b(Ot)!="object")return Ot;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ut)}function h(ut,yt,Mt){return yt=y(yt),v(ut,p()?Reflect.construct(yt,[],y(ut).constructor):yt.apply(ut,Mt))}function v(ut,yt){if(yt&&(b(yt)=="object"||typeof yt=="function"))return yt;if(yt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return m(ut)}function m(ut){if(ut===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ut}function p(){try{var ut=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(p=function(){return!!ut})()}function y(ut){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(yt){return yt.__proto__||Object.getPrototypeOf(yt)},y(ut)}function l(ut,yt){if(typeof yt!="function"&&yt!==null)throw new TypeError("Super expression must either be null or a function");ut.prototype=Object.create(yt&&yt.prototype,{constructor:{value:ut,writable:!0,configurable:!0}}),Object.defineProperty(ut,"prototype",{writable:!1}),yt&&x(ut,yt)}function x(ut,yt){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Mt,Ot){return Mt.__proto__=Ot,Mt},x(ut,yt)}function b(ut){"@babel/helpers - typeof";return b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(yt){return typeof yt}:function(yt){return yt&&typeof Symbol=="function"&&yt.constructor===Symbol&&yt!==Symbol.prototype?"symbol":typeof yt},b(ut)}var S=r(7507),T=r(3778),M=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=k,e.IS=50;var w=2147483647;k.TYPED_ARRAY_SUPPORT=u(),!k.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{var ut=new Uint8Array(1),yt={foo:function(){return 42}};return Object.setPrototypeOf(yt,Uint8Array.prototype),Object.setPrototypeOf(ut,yt),ut.foo()===42}catch{return!1}}Object.defineProperty(k.prototype,"parent",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.buffer}}),Object.defineProperty(k.prototype,"offset",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.byteOffset}});function f(ut){if(ut>w)throw new RangeError('The value "'+ut+'" is invalid for option "size"');var yt=new Uint8Array(ut);return Object.setPrototypeOf(yt,k.prototype),yt}function k(ut,yt,Mt){if(typeof ut=="number"){if(typeof yt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return O(ut)}return _(ut,yt,Mt)}k.poolSize=8192;function _(ut,yt,Mt){if(typeof ut=="string")return B(ut,yt);if(ArrayBuffer.isView(ut))return L(ut);if(ut==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+b(ut));if(kr(ut,ArrayBuffer)||ut&&kr(ut.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(kr(ut,SharedArrayBuffer)||ut&&kr(ut.buffer,SharedArrayBuffer)))return F(ut,yt,Mt);if(typeof ut=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Ot=ut.valueOf&&ut.valueOf();if(Ot!=null&&Ot!==ut)return k.from(Ot,yt,Mt);var $t=N(ut);if($t)return $t;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ut[Symbol.toPrimitive]=="function")return k.from(ut[Symbol.toPrimitive]("string"),yt,Mt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+b(ut))}k.from=function(ut,yt,Mt){return _(ut,yt,Mt)},Object.setPrototypeOf(k.prototype,Uint8Array.prototype),Object.setPrototypeOf(k,Uint8Array);function D(ut){if(typeof ut!="number")throw new TypeError('"size" argument must be of type number');if(ut<0)throw new RangeError('The value "'+ut+'" is invalid for option "size"')}function I(ut,yt,Mt){return D(ut),ut<=0?f(ut):yt!==void 0?typeof Mt=="string"?f(ut).fill(yt,Mt):f(ut).fill(yt):f(ut)}k.alloc=function(ut,yt,Mt){return I(ut,yt,Mt)};function O(ut){return D(ut),f(ut<0?0:j(ut)|0)}k.allocUnsafe=function(ut){return O(ut)},k.allocUnsafeSlow=function(ut){return O(ut)};function B(ut,yt){if((typeof yt!="string"||yt==="")&&(yt="utf8"),!k.isEncoding(yt))throw new TypeError("Unknown encoding: "+yt);var Mt=G(ut,yt)|0,Ot=f(Mt),$t=Ot.write(ut,yt);return $t!==Mt&&(Ot=Ot.slice(0,$t)),Ot}function R(ut){for(var yt=ut.length<0?0:j(ut.length)|0,Mt=f(yt),Ot=0;Ot<yt;Ot+=1)Mt[Ot]=ut[Ot]&255;return Mt}function L(ut){if(kr(ut,Uint8Array)){var yt=new Uint8Array(ut);return F(yt.buffer,yt.byteOffset,yt.byteLength)}return R(ut)}function F(ut,yt,Mt){if(yt<0||ut.byteLength<yt)throw new RangeError('"offset" is outside of buffer bounds');if(ut.byteLength<yt+(Mt||0))throw new RangeError('"length" is outside of buffer bounds');var Ot;return yt===void 0&&Mt===void 0?Ot=new Uint8Array(ut):Mt===void 0?Ot=new Uint8Array(ut,yt):Ot=new Uint8Array(ut,yt,Mt),Object.setPrototypeOf(Ot,k.prototype),Ot}function N(ut){if(k.isBuffer(ut)){var yt=j(ut.length)|0,Mt=f(yt);return Mt.length===0||ut.copy(Mt,0,0,yt),Mt}if(ut.length!==void 0)return typeof ut.length!="number"||he(ut.length)?f(0):R(ut);if(ut.type==="Buffer"&&Array.isArray(ut.data))return R(ut.data)}function j(ut){if(ut>=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return ut|0}k.isBuffer=function(ut){return ut!=null&&ut._isBuffer===!0&&ut!==k.prototype},k.compare=function(ut,yt){if(kr(ut,Uint8Array)&&(ut=k.from(ut,ut.offset,ut.byteLength)),kr(yt,Uint8Array)&&(yt=k.from(yt,yt.offset,yt.byteLength)),!k.isBuffer(ut)||!k.isBuffer(yt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ut===yt)return 0;for(var Mt=ut.length,Ot=yt.length,$t=0,ee=Math.min(Mt,Ot);$t<ee;++$t)if(ut[$t]!==yt[$t]){Mt=ut[$t],Ot=yt[$t];break}return Mt<Ot?-1:Ot<Mt?1:0},k.isEncoding=function(ut){switch(String(ut).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},k.concat=function(ut,yt){if(!Array.isArray(ut))throw new TypeError('"list" argument must be an Array of Buffers');if(ut.length===0)return k.alloc(0);var Mt;if(yt===void 0)for(yt=0,Mt=0;Mt<ut.length;++Mt)yt+=ut[Mt].length;var Ot=k.allocUnsafe(yt),$t=0;for(Mt=0;Mt<ut.length;++Mt){var ee=ut[Mt];if(kr(ee,Uint8Array))$t+ee.length>Ot.length?(k.isBuffer(ee)||(ee=k.from(ee)),ee.copy(Ot,$t)):Uint8Array.prototype.set.call(Ot,ee,$t);else if(k.isBuffer(ee))ee.copy(Ot,$t);else throw new TypeError('"list" argument must be an Array of Buffers');$t+=ee.length}return Ot};function G(ut,yt){if(k.isBuffer(ut))return ut.length;if(ArrayBuffer.isView(ut)||kr(ut,ArrayBuffer))return ut.byteLength;if(typeof ut!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+b(ut));var Mt=ut.length,Ot=arguments.length>2&&arguments[2]===!0;if(!Ot&&Mt===0)return 0;for(var $t=!1;;)switch(yt){case"ascii":case"latin1":case"binary":return Mt;case"utf8":case"utf-8":return Oe(ut).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mt*2;case"hex":return Mt>>>1;case"base64":return We(ut).length;default:if($t)return Ot?-1:Oe(ut).length;yt=(""+yt).toLowerCase(),$t=!0}}k.byteLength=G;function rt(ut,yt,Mt){var Ot=!1;if((yt===void 0||yt<0)&&(yt=0),yt>this.length||((Mt===void 0||Mt>this.length)&&(Mt=this.length),Mt<=0)||(Mt>>>=0,yt>>>=0,Mt<=yt))return"";for(ut||(ut="utf8");;)switch(ut){case"hex":return xt(this,yt,Mt);case"utf8":case"utf-8":return q(this,yt,Mt);case"ascii":return dt(this,yt,Mt);case"latin1":case"binary":return wt(this,yt,Mt);case"base64":return Y(this,yt,Mt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ft(this,yt,Mt);default:if(Ot)throw new TypeError("Unknown encoding: "+ut);ut=(ut+"").toLowerCase(),Ot=!0}}k.prototype._isBuffer=!0;function ct(ut,yt,Mt){var Ot=ut[yt];ut[yt]=ut[Mt],ut[Mt]=Ot}k.prototype.swap16=function(){var ut=this.length;if(ut%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var yt=0;yt<ut;yt+=2)ct(this,yt,yt+1);return this},k.prototype.swap32=function(){var ut=this.length;if(ut%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var yt=0;yt<ut;yt+=4)ct(this,yt,yt+3),ct(this,yt+1,yt+2);return this},k.prototype.swap64=function(){var ut=this.length;if(ut%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var yt=0;yt<ut;yt+=8)ct(this,yt,yt+7),ct(this,yt+1,yt+6),ct(this,yt+2,yt+5),ct(this,yt+3,yt+4);return this},k.prototype.toString=function(){var ut=this.length;return ut===0?"":arguments.length===0?q(this,0,ut):rt.apply(this,arguments)},k.prototype.toLocaleString=k.prototype.toString,k.prototype.equals=function(ut){if(!k.isBuffer(ut))throw new TypeError("Argument must be a Buffer");return this===ut?!0:k.compare(this,ut)===0},k.prototype.inspect=function(){var ut="",yt=e.IS;return ut=this.toString("hex",0,yt).replace(/(.{2})/g,"$1 ").trim(),this.length>yt&&(ut+=" ... "),"<Buffer "+ut+">"},M&&(k.prototype[M]=k.prototype.inspect),k.prototype.compare=function(ut,yt,Mt,Ot,$t){if(kr(ut,Uint8Array)&&(ut=k.from(ut,ut.offset,ut.byteLength)),!k.isBuffer(ut))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+b(ut));if(yt===void 0&&(yt=0),Mt===void 0&&(Mt=ut?ut.length:0),Ot===void 0&&(Ot=0),$t===void 0&&($t=this.length),yt<0||Mt>ut.length||Ot<0||$t>this.length)throw new RangeError("out of range index");if(Ot>=$t&&yt>=Mt)return 0;if(Ot>=$t)return-1;if(yt>=Mt)return 1;if(yt>>>=0,Mt>>>=0,Ot>>>=0,$t>>>=0,this===ut)return 0;for(var ee=$t-Ot,we=Mt-yt,Me=Math.min(ee,we),Re=this.slice(Ot,$t),Be=ut.slice(yt,Mt),Ze=0;Ze<Me;++Ze)if(Re[Ze]!==Be[Ze]){ee=Re[Ze],we=Be[Ze];break}return ee<we?-1:we<ee?1:0};function lt(ut,yt,Mt,Ot,$t){if(ut.length===0)return-1;if(typeof Mt=="string"?(Ot=Mt,Mt=0):Mt>2147483647?Mt=2147483647:Mt<-2147483648&&(Mt=-2147483648),Mt=+Mt,he(Mt)&&(Mt=$t?0:ut.length-1),Mt<0&&(Mt=ut.length+Mt),Mt>=ut.length){if($t)return-1;Mt=ut.length-1}else if(Mt<0)if($t)Mt=0;else return-1;if(typeof yt=="string"&&(yt=k.from(yt,Ot)),k.isBuffer(yt))return yt.length===0?-1:tt(ut,yt,Mt,Ot,$t);if(typeof yt=="number")return yt=yt&255,typeof Uint8Array.prototype.indexOf=="function"?$t?Uint8Array.prototype.indexOf.call(ut,yt,Mt):Uint8Array.prototype.lastIndexOf.call(ut,yt,Mt):tt(ut,[yt],Mt,Ot,$t);throw new TypeError("val must be string, number or Buffer")}function tt(ut,yt,Mt,Ot,$t){var ee=1,we=ut.length,Me=yt.length;if(Ot!==void 0&&(Ot=String(Ot).toLowerCase(),Ot==="ucs2"||Ot==="ucs-2"||Ot==="utf16le"||Ot==="utf-16le")){if(ut.length<2||yt.length<2)return-1;ee=2,we/=2,Me/=2,Mt/=2}function Re(ln,an){return ee===1?ln[an]:ln.readUInt16BE(an*ee)}var Be;if($t){var Ze=-1;for(Be=Mt;Be<we;Be++)if(Re(ut,Be)===Re(yt,Ze===-1?0:Be-Ze)){if(Ze===-1&&(Ze=Be),Be-Ze+1===Me)return Ze*ee}else Ze!==-1&&(Be-=Be-Ze),Ze=-1}else for(Mt+Me>we&&(Mt=we-Me),Be=Mt;Be>=0;Be--){for(var Ue=!0,mr=0;mr<Me;mr++)if(Re(ut,Be+mr)!==Re(yt,mr)){Ue=!1;break}if(Ue)return Be}return-1}k.prototype.includes=function(ut,yt,Mt){return this.indexOf(ut,yt,Mt)!==-1},k.prototype.indexOf=function(ut,yt,Mt){return lt(this,ut,yt,Mt,!0)},k.prototype.lastIndexOf=function(ut,yt,Mt){return lt(this,ut,yt,Mt,!1)};function Z(ut,yt,Mt,Ot){Mt=Number(Mt)||0;var $t=ut.length-Mt;Ot?(Ot=Number(Ot),Ot>$t&&(Ot=$t)):Ot=$t;var ee=yt.length;Ot>ee/2&&(Ot=ee/2);var we;for(we=0;we<Ot;++we){var Me=parseInt(yt.substr(we*2,2),16);if(he(Me))return we;ut[Mt+we]=Me}return we}function st(ut,yt,Mt,Ot){return Lr(Oe(yt,ut.length-Mt),ut,Mt,Ot)}function $(ut,yt,Mt,Ot){return Lr(ur(yt),ut,Mt,Ot)}function Q(ut,yt,Mt,Ot){return Lr(We(yt),ut,Mt,Ot)}function nt(ut,yt,Mt,Ot){return Lr(fr(yt,ut.length-Mt),ut,Mt,Ot)}k.prototype.write=function(ut,yt,Mt,Ot){if(yt===void 0)Ot="utf8",Mt=this.length,yt=0;else if(Mt===void 0&&typeof yt=="string")Ot=yt,Mt=this.length,yt=0;else if(isFinite(yt))yt=yt>>>0,isFinite(Mt)?(Mt=Mt>>>0,Ot===void 0&&(Ot="utf8")):(Ot=Mt,Mt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var $t=this.length-yt;if((Mt===void 0||Mt>$t)&&(Mt=$t),ut.length>0&&(Mt<0||yt<0)||yt>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ot||(Ot="utf8");for(var ee=!1;;)switch(Ot){case"hex":return Z(this,ut,yt,Mt);case"utf8":case"utf-8":return st(this,ut,yt,Mt);case"ascii":case"latin1":case"binary":return $(this,ut,yt,Mt);case"base64":return Q(this,ut,yt,Mt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nt(this,ut,yt,Mt);default:if(ee)throw new TypeError("Unknown encoding: "+Ot);Ot=(""+Ot).toLowerCase(),ee=!0}},k.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Y(ut,yt,Mt){return yt===0&&Mt===ut.length?S.fromByteArray(ut):S.fromByteArray(ut.slice(yt,Mt))}function q(ut,yt,Mt){Mt=Math.min(ut.length,Mt);for(var Ot=[],$t=yt;$t<Mt;){var ee=ut[$t],we=null,Me=ee>239?4:ee>223?3:ee>191?2:1;if($t+Me<=Mt){var Re=void 0,Be=void 0,Ze=void 0,Ue=void 0;switch(Me){case 1:ee<128&&(we=ee);break;case 2:Re=ut[$t+1],(Re&192)===128&&(Ue=(ee&31)<<6|Re&63,Ue>127&&(we=Ue));break;case 3:Re=ut[$t+1],Be=ut[$t+2],(Re&192)===128&&(Be&192)===128&&(Ue=(ee&15)<<12|(Re&63)<<6|Be&63,Ue>2047&&(Ue<55296||Ue>57343)&&(we=Ue));break;case 4:Re=ut[$t+1],Be=ut[$t+2],Ze=ut[$t+3],(Re&192)===128&&(Be&192)===128&&(Ze&192)===128&&(Ue=(ee&15)<<18|(Re&63)<<12|(Be&63)<<6|Ze&63,Ue>65535&&Ue<1114112&&(we=Ue))}}we===null?(we=65533,Me=1):we>65535&&(we-=65536,Ot.push(we>>>10&1023|55296),we=56320|we&1023),Ot.push(we),$t+=Me}return it(Ot)}var ot=4096;function it(ut){var yt=ut.length;if(yt<=ot)return String.fromCharCode.apply(String,ut);for(var Mt="",Ot=0;Ot<yt;)Mt+=String.fromCharCode.apply(String,ut.slice(Ot,Ot+=ot));return Mt}function dt(ut,yt,Mt){var Ot="";Mt=Math.min(ut.length,Mt);for(var $t=yt;$t<Mt;++$t)Ot+=String.fromCharCode(ut[$t]&127);return Ot}function wt(ut,yt,Mt){var Ot="";Mt=Math.min(ut.length,Mt);for(var $t=yt;$t<Mt;++$t)Ot+=String.fromCharCode(ut[$t]);return Ot}function xt(ut,yt,Mt){var Ot=ut.length;(!yt||yt<0)&&(yt=0),(!Mt||Mt<0||Mt>Ot)&&(Mt=Ot);for(var $t="",ee=yt;ee<Mt;++ee)$t+=Dt[ut[ee]];return $t}function Ft(ut,yt,Mt){for(var Ot=ut.slice(yt,Mt),$t="",ee=0;ee<Ot.length-1;ee+=2)$t+=String.fromCharCode(Ot[ee]+Ot[ee+1]*256);return $t}k.prototype.slice=function(ut,yt){var Mt=this.length;ut=~~ut,yt=yt===void 0?Mt:~~yt,ut<0?(ut+=Mt,ut<0&&(ut=0)):ut>Mt&&(ut=Mt),yt<0?(yt+=Mt,yt<0&&(yt=0)):yt>Mt&&(yt=Mt),yt<ut&&(yt=ut);var Ot=this.subarray(ut,yt);return Object.setPrototypeOf(Ot,k.prototype),Ot};function Et(ut,yt,Mt){if(ut%1!==0||ut<0)throw new RangeError("offset is not uint");if(ut+yt>Mt)throw new RangeError("Trying to access beyond buffer length")}k.prototype.readUintLE=k.prototype.readUIntLE=function(ut,yt,Mt){ut=ut>>>0,yt=yt>>>0,Mt||Et(ut,yt,this.length);for(var Ot=this[ut],$t=1,ee=0;++ee<yt&&($t*=256);)Ot+=this[ut+ee]*$t;return Ot},k.prototype.readUintBE=k.prototype.readUIntBE=function(ut,yt,Mt){ut=ut>>>0,yt=yt>>>0,Mt||Et(ut,yt,this.length);for(var Ot=this[ut+--yt],$t=1;yt>0&&($t*=256);)Ot+=this[ut+--yt]*$t;return Ot},k.prototype.readUint8=k.prototype.readUInt8=function(ut,yt){return ut=ut>>>0,yt||Et(ut,1,this.length),this[ut]},k.prototype.readUint16LE=k.prototype.readUInt16LE=function(ut,yt){return ut=ut>>>0,yt||Et(ut,2,this.length),this[ut]|this[ut+1]<<8},k.prototype.readUint16BE=k.prototype.readUInt16BE=function(ut,yt){return ut=ut>>>0,yt||Et(ut,2,this.length),this[ut]<<8|this[ut+1]},k.prototype.readUint32LE=k.prototype.readUInt32LE=function(ut,yt){return ut=ut>>>0,yt||Et(ut,4,this.length),(this[ut]|this[ut+1]<<8|this[ut+2]<<16)+this[ut+3]*16777216},k.prototype.readUint32BE=k.prototype.readUInt32BE=function(ut,yt){return ut=ut>>>0,yt||Et(ut,4,this.length),this[ut]*16777216+(this[ut+1]<<16|this[ut+2]<<8|this[ut+3])},k.prototype.readBigUInt64LE=qt(function(ut){ut=ut>>>0,le(ut,"offset");var yt=this[ut],Mt=this[ut+7];(yt===void 0||Mt===void 0)&&Te(ut,this.length-8);var Ot=yt+this[++ut]*Math.pow(2,8)+this[++ut]*Math.pow(2,16)+this[++ut]*Math.pow(2,24),$t=this[++ut]+this[++ut]*Math.pow(2,8)+this[++ut]*Math.pow(2,16)+Mt*Math.pow(2,24);return BigInt(Ot)+(BigInt($t)<<BigInt(32))}),k.prototype.readBigUInt64BE=qt(function(ut){ut=ut>>>0,le(ut,"offset");var yt=this[ut],Mt=this[ut+7];(yt===void 0||Mt===void 0)&&Te(ut,this.length-8);var Ot=yt*Math.pow(2,24)+this[++ut]*Math.pow(2,16)+this[++ut]*Math.pow(2,8)+this[++ut],$t=this[++ut]*Math.pow(2,24)+this[++ut]*Math.pow(2,16)+this[++ut]*Math.pow(2,8)+Mt;return(BigInt(Ot)<<BigInt(32))+BigInt($t)}),k.prototype.readIntLE=function(ut,yt,Mt){ut=ut>>>0,yt=yt>>>0,Mt||Et(ut,yt,this.length);for(var Ot=this[ut],$t=1,ee=0;++ee<yt&&($t*=256);)Ot+=this[ut+ee]*$t;return $t*=128,Ot>=$t&&(Ot-=Math.pow(2,8*yt)),Ot},k.prototype.readIntBE=function(ut,yt,Mt){ut=ut>>>0,yt=yt>>>0,Mt||Et(ut,yt,this.length);for(var Ot=yt,$t=1,ee=this[ut+--Ot];Ot>0&&($t*=256);)ee+=this[ut+--Ot]*$t;return $t*=128,ee>=$t&&(ee-=Math.pow(2,8*yt)),ee},k.prototype.readInt8=function(ut,yt){return ut=ut>>>0,yt||Et(ut,1,this.length),this[ut]&128?(255-this[ut]+1)*-1:this[ut]},k.prototype.readInt16LE=function(ut,yt){ut=ut>>>0,yt||Et(ut,2,this.length);var Mt=this[ut]|this[ut+1]<<8;return Mt&32768?Mt|4294901760:Mt},k.prototype.readInt16BE=function(ut,yt){ut=ut>>>0,yt||Et(ut,2,this.length);var Mt=this[ut+1]|this[ut]<<8;return Mt&32768?Mt|4294901760:Mt},k.prototype.readInt32LE=function(ut,yt){return ut=ut>>>0,yt||Et(ut,4,this.length),this[ut]|this[ut+1]<<8|this[ut+2]<<16|this[ut+3]<<24},k.prototype.readInt32BE=function(ut,yt){return ut=ut>>>0,yt||Et(ut,4,this.length),this[ut]<<24|this[ut+1]<<16|this[ut+2]<<8|this[ut+3]},k.prototype.readBigInt64LE=qt(function(ut){ut=ut>>>0,le(ut,"offset");var yt=this[ut],Mt=this[ut+7];(yt===void 0||Mt===void 0)&&Te(ut,this.length-8);var Ot=this[ut+4]+this[ut+5]*Math.pow(2,8)+this[ut+6]*Math.pow(2,16)+(Mt<<24);return(BigInt(Ot)<<BigInt(32))+BigInt(yt+this[++ut]*Math.pow(2,8)+this[++ut]*Math.pow(2,16)+this[++ut]*Math.pow(2,24))}),k.prototype.readBigInt64BE=qt(function(ut){ut=ut>>>0,le(ut,"offset");var yt=this[ut],Mt=this[ut+7];(yt===void 0||Mt===void 0)&&Te(ut,this.length-8);var Ot=(yt<<24)+this[++ut]*Math.pow(2,16)+this[++ut]*Math.pow(2,8)+this[++ut];return(BigInt(Ot)<<BigInt(32))+BigInt(this[++ut]*Math.pow(2,24)+this[++ut]*Math.pow(2,16)+this[++ut]*Math.pow(2,8)+Mt)}),k.prototype.readFloatLE=function(ut,yt){return ut=ut>>>0,yt||Et(ut,4,this.length),T.read(this,ut,!0,23,4)},k.prototype.readFloatBE=function(ut,yt){return ut=ut>>>0,yt||Et(ut,4,this.length),T.read(this,ut,!1,23,4)},k.prototype.readDoubleLE=function(ut,yt){return ut=ut>>>0,yt||Et(ut,8,this.length),T.read(this,ut,!0,52,8)},k.prototype.readDoubleBE=function(ut,yt){return ut=ut>>>0,yt||Et(ut,8,this.length),T.read(this,ut,!1,52,8)};function Nt(ut,yt,Mt,Ot,$t,ee){if(!k.isBuffer(ut))throw new TypeError('"buffer" argument must be a Buffer instance');if(yt>$t||yt<ee)throw new RangeError('"value" argument is out of bounds');if(Mt+Ot>ut.length)throw new RangeError("Index out of range")}k.prototype.writeUintLE=k.prototype.writeUIntLE=function(ut,yt,Mt,Ot){if(ut=+ut,yt=yt>>>0,Mt=Mt>>>0,!Ot){var $t=Math.pow(2,8*Mt)-1;Nt(this,ut,yt,Mt,$t,0)}var ee=1,we=0;for(this[yt]=ut&255;++we<Mt&&(ee*=256);)this[yt+we]=ut/ee&255;return yt+Mt},k.prototype.writeUintBE=k.prototype.writeUIntBE=function(ut,yt,Mt,Ot){if(ut=+ut,yt=yt>>>0,Mt=Mt>>>0,!Ot){var $t=Math.pow(2,8*Mt)-1;Nt(this,ut,yt,Mt,$t,0)}var ee=Mt-1,we=1;for(this[yt+ee]=ut&255;--ee>=0&&(we*=256);)this[yt+ee]=ut/we&255;return yt+Mt},k.prototype.writeUint8=k.prototype.writeUInt8=function(ut,yt,Mt){return ut=+ut,yt=yt>>>0,Mt||Nt(this,ut,yt,1,255,0),this[yt]=ut&255,yt+1},k.prototype.writeUint16LE=k.prototype.writeUInt16LE=function(ut,yt,Mt){return ut=+ut,yt=yt>>>0,Mt||Nt(this,ut,yt,2,65535,0),this[yt]=ut&255,this[yt+1]=ut>>>8,yt+2},k.prototype.writeUint16BE=k.prototype.writeUInt16BE=function(ut,yt,Mt){return ut=+ut,yt=yt>>>0,Mt||Nt(this,ut,yt,2,65535,0),this[yt]=ut>>>8,this[yt+1]=ut&255,yt+2},k.prototype.writeUint32LE=k.prototype.writeUInt32LE=function(ut,yt,Mt){return ut=+ut,yt=yt>>>0,Mt||Nt(this,ut,yt,4,4294967295,0),this[yt+3]=ut>>>24,this[yt+2]=ut>>>16,this[yt+1]=ut>>>8,this[yt]=ut&255,yt+4},k.prototype.writeUint32BE=k.prototype.writeUInt32BE=function(ut,yt,Mt){return ut=+ut,yt=yt>>>0,Mt||Nt(this,ut,yt,4,4294967295,0),this[yt]=ut>>>24,this[yt+1]=ut>>>16,this[yt+2]=ut>>>8,this[yt+3]=ut&255,yt+4};function te(ut,yt,Mt,Ot,$t){Zt(yt,Ot,$t,ut,Mt,7);var ee=Number(yt&BigInt(4294967295));ut[Mt++]=ee,ee=ee>>8,ut[Mt++]=ee,ee=ee>>8,ut[Mt++]=ee,ee=ee>>8,ut[Mt++]=ee;var we=Number(yt>>BigInt(32)&BigInt(4294967295));return ut[Mt++]=we,we=we>>8,ut[Mt++]=we,we=we>>8,ut[Mt++]=we,we=we>>8,ut[Mt++]=we,Mt}function Jt(ut,yt,Mt,Ot,$t){Zt(yt,Ot,$t,ut,Mt,7);var ee=Number(yt&BigInt(4294967295));ut[Mt+7]=ee,ee=ee>>8,ut[Mt+6]=ee,ee=ee>>8,ut[Mt+5]=ee,ee=ee>>8,ut[Mt+4]=ee;var we=Number(yt>>BigInt(32)&BigInt(4294967295));return ut[Mt+3]=we,we=we>>8,ut[Mt+2]=we,we=we>>8,ut[Mt+1]=we,we=we>>8,ut[Mt]=we,Mt+8}k.prototype.writeBigUInt64LE=qt(function(ut){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return te(this,ut,yt,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeBigUInt64BE=qt(function(ut){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Jt(this,ut,yt,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeIntLE=function(ut,yt,Mt,Ot){if(ut=+ut,yt=yt>>>0,!Ot){var $t=Math.pow(2,8*Mt-1);Nt(this,ut,yt,Mt,$t-1,-$t)}var ee=0,we=1,Me=0;for(this[yt]=ut&255;++ee<Mt&&(we*=256);)ut<0&&Me===0&&this[yt+ee-1]!==0&&(Me=1),this[yt+ee]=(ut/we>>0)-Me&255;return yt+Mt},k.prototype.writeIntBE=function(ut,yt,Mt,Ot){if(ut=+ut,yt=yt>>>0,!Ot){var $t=Math.pow(2,8*Mt-1);Nt(this,ut,yt,Mt,$t-1,-$t)}var ee=Mt-1,we=1,Me=0;for(this[yt+ee]=ut&255;--ee>=0&&(we*=256);)ut<0&&Me===0&&this[yt+ee+1]!==0&&(Me=1),this[yt+ee]=(ut/we>>0)-Me&255;return yt+Mt},k.prototype.writeInt8=function(ut,yt,Mt){return ut=+ut,yt=yt>>>0,Mt||Nt(this,ut,yt,1,127,-128),ut<0&&(ut=255+ut+1),this[yt]=ut&255,yt+1},k.prototype.writeInt16LE=function(ut,yt,Mt){return ut=+ut,yt=yt>>>0,Mt||Nt(this,ut,yt,2,32767,-32768),this[yt]=ut&255,this[yt+1]=ut>>>8,yt+2},k.prototype.writeInt16BE=function(ut,yt,Mt){return ut=+ut,yt=yt>>>0,Mt||Nt(this,ut,yt,2,32767,-32768),this[yt]=ut>>>8,this[yt+1]=ut&255,yt+2},k.prototype.writeInt32LE=function(ut,yt,Mt){return ut=+ut,yt=yt>>>0,Mt||Nt(this,ut,yt,4,2147483647,-2147483648),this[yt]=ut&255,this[yt+1]=ut>>>8,this[yt+2]=ut>>>16,this[yt+3]=ut>>>24,yt+4},k.prototype.writeInt32BE=function(ut,yt,Mt){return ut=+ut,yt=yt>>>0,Mt||Nt(this,ut,yt,4,2147483647,-2147483648),ut<0&&(ut=4294967295+ut+1),this[yt]=ut>>>24,this[yt+1]=ut>>>16,this[yt+2]=ut>>>8,this[yt+3]=ut&255,yt+4},k.prototype.writeBigInt64LE=qt(function(ut){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return te(this,ut,yt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),k.prototype.writeBigInt64BE=qt(function(ut){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Jt(this,ut,yt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Qt(ut,yt,Mt,Ot,$t,ee){if(Mt+Ot>ut.length)throw new RangeError("Index out of range");if(Mt<0)throw new RangeError("Index out of range")}function Wt(ut,yt,Mt,Ot,$t){return yt=+yt,Mt=Mt>>>0,$t||Qt(ut,yt,Mt,4),T.write(ut,yt,Mt,Ot,23,4),Mt+4}k.prototype.writeFloatLE=function(ut,yt,Mt){return Wt(this,ut,yt,!0,Mt)},k.prototype.writeFloatBE=function(ut,yt,Mt){return Wt(this,ut,yt,!1,Mt)};function gt(ut,yt,Mt,Ot,$t){return yt=+yt,Mt=Mt>>>0,$t||Qt(ut,yt,Mt,8),T.write(ut,yt,Mt,Ot,52,8),Mt+8}k.prototype.writeDoubleLE=function(ut,yt,Mt){return gt(this,ut,yt,!0,Mt)},k.prototype.writeDoubleBE=function(ut,yt,Mt){return gt(this,ut,yt,!1,Mt)},k.prototype.copy=function(ut,yt,Mt,Ot){if(!k.isBuffer(ut))throw new TypeError("argument should be a Buffer");if(Mt||(Mt=0),!Ot&&Ot!==0&&(Ot=this.length),yt>=ut.length&&(yt=ut.length),yt||(yt=0),Ot>0&&Ot<Mt&&(Ot=Mt),Ot===Mt||ut.length===0||this.length===0)return 0;if(yt<0)throw new RangeError("targetStart out of bounds");if(Mt<0||Mt>=this.length)throw new RangeError("Index out of range");if(Ot<0)throw new RangeError("sourceEnd out of bounds");Ot>this.length&&(Ot=this.length),ut.length-yt<Ot-Mt&&(Ot=ut.length-yt+Mt);var $t=Ot-Mt;return this===ut&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(yt,Mt,Ot):Uint8Array.prototype.set.call(ut,this.subarray(Mt,Ot),yt),$t},k.prototype.fill=function(ut,yt,Mt,Ot){if(typeof ut=="string"){if(typeof yt=="string"?(Ot=yt,yt=0,Mt=this.length):typeof Mt=="string"&&(Ot=Mt,Mt=this.length),Ot!==void 0&&typeof Ot!="string")throw new TypeError("encoding must be a string");if(typeof Ot=="string"&&!k.isEncoding(Ot))throw new TypeError("Unknown encoding: "+Ot);if(ut.length===1){var $t=ut.charCodeAt(0);(Ot==="utf8"&&$t<128||Ot==="latin1")&&(ut=$t)}}else typeof ut=="number"?ut=ut&255:typeof ut=="boolean"&&(ut=Number(ut));if(yt<0||this.length<yt||this.length<Mt)throw new RangeError("Out of range index");if(Mt<=yt)return this;yt=yt>>>0,Mt=Mt===void 0?this.length:Mt>>>0,ut||(ut=0);var ee;if(typeof ut=="number")for(ee=yt;ee<Mt;++ee)this[ee]=ut;else{var we=k.isBuffer(ut)?ut:k.from(ut,Ot),Me=we.length;if(Me===0)throw new TypeError('The value "'+ut+'" is invalid for argument "value"');for(ee=0;ee<Mt-yt;++ee)this[ee+yt]=we[ee%Me]}return this};var bt={};function vt(ut,yt,Mt){bt[ut]=function(Ot){function $t(){var ee;return i(this,$t),ee=h(this,$t),Object.defineProperty(ee,"message",{value:yt.apply(ee,arguments),writable:!0,configurable:!0}),ee.name="".concat(ee.name," [").concat(ut,"]"),ee.stack,delete ee.name,ee}return l($t,Ot),o($t,[{key:"code",get:function(){return ut},set:function(ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ee,writable:!0})}},{key:"toString",value:function(){return"".concat(this.name," [").concat(ut,"]: ").concat(this.message)}}])}(Mt)}vt("ERR_BUFFER_OUT_OF_BOUNDS",function(ut){return ut?"".concat(ut," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),vt("ERR_INVALID_ARG_TYPE",function(ut,yt){return'The "'.concat(ut,'" argument must be of type number. Received type ').concat(b(yt))},TypeError),vt("ERR_OUT_OF_RANGE",function(ut,yt,Mt){var Ot='The value of "'.concat(ut,'" is out of range.'),$t=Mt;return Number.isInteger(Mt)&&Math.abs(Mt)>Math.pow(2,32)?$t=Ut(String(Mt)):typeof Mt=="bigint"&&($t=String(Mt),(Mt>Math.pow(BigInt(2),BigInt(32))||Mt<-Math.pow(BigInt(2),BigInt(32)))&&($t=Ut($t)),$t+="n"),Ot+=" It must be ".concat(yt,". Received ").concat($t),Ot},RangeError);function Ut(ut){for(var yt="",Mt=ut.length,Ot=ut[0]==="-"?1:0;Mt>=Ot+4;Mt-=3)yt="_".concat(ut.slice(Mt-3,Mt)).concat(yt);return"".concat(ut.slice(0,Mt)).concat(yt)}function Kt(ut,yt,Mt){le(yt,"offset"),(ut[yt]===void 0||ut[yt+Mt]===void 0)&&Te(yt,ut.length-(Mt+1))}function Zt(ut,yt,Mt,Ot,$t,ee){if(ut>Mt||ut<yt){var we=typeof yt=="bigint"?"n":"",Me;throw yt===0||yt===BigInt(0)?Me=">= 0".concat(we," and < 2").concat(we," ** ").concat((ee+1)*8).concat(we):Me=">= -(2".concat(we," ** ").concat((ee+1)*8-1).concat(we,") and < 2 ** ")+"".concat((ee+1)*8-1).concat(we),new bt.ERR_OUT_OF_RANGE("value",Me,ut)}Kt(Ot,$t,ee)}function le(ut,yt){if(typeof ut!="number")throw new bt.ERR_INVALID_ARG_TYPE(yt,"number",ut)}function Te(ut,yt,Mt){throw Math.floor(ut)!==ut?(le(ut,Mt),new bt.ERR_OUT_OF_RANGE("offset","an integer",ut)):yt<0?new bt.ERR_BUFFER_OUT_OF_BOUNDS:new bt.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(yt),ut)}var Se=/[^+/0-9A-Za-z-_]/g;function Fe(ut){if(ut=ut.split("=")[0],ut=ut.trim().replace(Se,""),ut.length<2)return"";for(;ut.length%4!==0;)ut=ut+"=";return ut}function Oe(ut,yt){yt=yt||1/0;for(var Mt,Ot=ut.length,$t=null,ee=[],we=0;we<Ot;++we){if(Mt=ut.charCodeAt(we),Mt>55295&&Mt<57344){if(!$t){if(Mt>56319){(yt-=3)>-1&&ee.push(239,191,189);continue}else if(we+1===Ot){(yt-=3)>-1&&ee.push(239,191,189);continue}$t=Mt;continue}if(Mt<56320){(yt-=3)>-1&&ee.push(239,191,189),$t=Mt;continue}Mt=($t-55296<<10|Mt-56320)+65536}else $t&&(yt-=3)>-1&&ee.push(239,191,189);if($t=null,Mt<128){if((yt-=1)<0)break;ee.push(Mt)}else if(Mt<2048){if((yt-=2)<0)break;ee.push(Mt>>6|192,Mt&63|128)}else if(Mt<65536){if((yt-=3)<0)break;ee.push(Mt>>12|224,Mt>>6&63|128,Mt&63|128)}else if(Mt<1114112){if((yt-=4)<0)break;ee.push(Mt>>18|240,Mt>>12&63|128,Mt>>6&63|128,Mt&63|128)}else throw new Error("Invalid code point")}return ee}function ur(ut){for(var yt=[],Mt=0;Mt<ut.length;++Mt)yt.push(ut.charCodeAt(Mt)&255);return yt}function fr(ut,yt){for(var Mt,Ot,$t,ee=[],we=0;we<ut.length&&!((yt-=2)<0);++we)Mt=ut.charCodeAt(we),Ot=Mt>>8,$t=Mt%256,ee.push($t),ee.push(Ot);return ee}function We(ut){return S.toByteArray(Fe(ut))}function Lr(ut,yt,Mt,Ot){var $t;for($t=0;$t<Ot&&!($t+Mt>=yt.length||$t>=ut.length);++$t)yt[$t+Mt]=ut[$t];return $t}function kr(ut,yt){return ut instanceof yt||ut!=null&&ut.constructor!=null&&ut.constructor.name!=null&&ut.constructor.name===yt.name}function he(ut){return ut!==ut}var Dt=function(){for(var ut="0123456789abcdef",yt=new Array(256),Mt=0;Mt<16;++Mt)for(var Ot=Mt*16,$t=0;$t<16;++$t)yt[Ot+$t]=ut[Mt]+ut[$t];return yt}();function qt(ut){return typeof BigInt>"u"?zt:ut}function zt(){throw new Error("BigInt not supported")}},9216:function(t){t.exports=n,t.exports.isMobile=n,t.exports.default=n;var e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,i=/android|ipad|playbook|silk/i;function n(o){o||(o={});var a=o.ua;if(!a&&typeof navigator<"u"&&(a=navigator.userAgent),a&&a.headers&&typeof a.headers["user-agent"]=="string"&&(a=a.headers["user-agent"]),typeof a!="string")return!1;var s=e.test(a)&&!r.test(a)||!!o.tablet&&i.test(a);return!s&&o.tablet&&o.featureDetect&&navigator&&navigator.maxTouchPoints>1&&a.indexOf("Macintosh")!==-1&&a.indexOf("Safari")!==-1&&(s=!0),s}},6296:function(t,e,r){t.exports=h;var i=r(7261),n=r(9977),o=r(1811);function a(v,m){this._controllerNames=Object.keys(v),this._controllerList=this._controllerNames.map(function(p){return v[p]}),this._mode=m,this._active=v[m],this._active||(this._mode="turntable",this._active=v.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=a.prototype;s.flush=function(v){for(var m=this._controllerList,p=0;p<m.length;++p)m[p].flush(v)},s.idle=function(v){for(var m=this._controllerList,p=0;p<m.length;++p)m[p].idle(v)},s.lookAt=function(v,m,p,y){for(var l=this._controllerList,x=0;x<l.length;++x)l[x].lookAt(v,m,p,y)},s.rotate=function(v,m,p,y){for(var l=this._controllerList,x=0;x<l.length;++x)l[x].rotate(v,m,p,y)},s.pan=function(v,m,p,y){for(var l=this._controllerList,x=0;x<l.length;++x)l[x].pan(v,m,p,y)},s.translate=function(v,m,p,y){for(var l=this._controllerList,x=0;x<l.length;++x)l[x].translate(v,m,p,y)},s.setMatrix=function(v,m){for(var p=this._controllerList,y=0;y<p.length;++y)p[y].setMatrix(v,m)},s.setDistanceLimits=function(v,m){for(var p=this._controllerList,y=0;y<p.length;++y)p[y].setDistanceLimits(v,m)},s.setDistance=function(v,m){for(var p=this._controllerList,y=0;y<p.length;++y)p[y].setDistance(v,m)},s.recalcMatrix=function(v){this._active.recalcMatrix(v)},s.getDistance=function(v){return this._active.getDistance(v)},s.getDistanceLimits=function(v){return this._active.getDistanceLimits(v)},s.lastT=function(){return this._active.lastT()},s.setMode=function(v){if(v!==this._mode){var m=this._controllerNames.indexOf(v);if(!(m<0)){var p=this._active,y=this._controllerList[m],l=Math.max(p.lastT(),y.lastT());p.recalcMatrix(l),y.setMatrix(l,p.computedMatrix),this._active=y,this._mode=v,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},s.getMode=function(){return this._mode};function h(v){v=v||{};var m=v.eye||[0,0,1],p=v.center||[0,0,0],y=v.up||[0,1,0],l=v.distanceLimits||[0,1/0],x=v.mode||"turntable",b=i(),S=n(),T=o();return b.setDistanceLimits(l[0],l[1]),b.lookAt(0,m,p,y),S.setDistanceLimits(l[0],l[1]),S.lookAt(0,m,p,y),T.setDistanceLimits(l[0],l[1]),T.lookAt(0,m,p,y),new a({turntable:b,orbit:S,matrix:T},x)}},7169:function(t,e,r){var i=typeof WeakMap>"u"?r(1538):WeakMap,n=r(2762),o=r(8116),a=new i;function s(h){var v=a.get(h),m=v&&(v._triangleBuffer.handle||v._triangleBuffer.buffer);if(!m||!h.isBuffer(m)){var p=n(h,new Float32Array([-1,-1,-1,4,4,-1]));v=o(h,[{buffer:p,type:h.FLOAT,size:2}]),v._triangleBuffer=p,a.set(h,v)}v.bind(),h.drawArrays(h.TRIANGLES,0,3),v.unbind()}t.exports=s},1085:function(t,e,r){var i=r(1371);t.exports=n;function n(o,a,s){a=typeof a=="number"?a:1,s=s||": ";var h=o.split(/\r?\n/),v=String(h.length+a-1).length;return h.map(function(m,p){var y=p+a,l=String(y).length,x=i(y,v-l);return x+s+m}).join(`
|
||
`)}},3952:function(t,e,r){t.exports=o;var i=r(3250);function n(a,s){for(var h=new Array(s+1),v=0;v<a.length;++v)h[v]=a[v];for(var v=0;v<=a.length;++v){for(var m=a.length;m<=s;++m){for(var p=new Array(s),y=0;y<s;++y)p[y]=Math.pow(m+1-v,y);h[m]=p}var l=i.apply(void 0,h);if(l)return!0}return!1}function o(a){var s=a.length;if(s===0)return[];if(s===1)return[0];for(var h=a[0].length,v=[a[0]],m=[0],p=1;p<s;++p){if(v.push(a[p]),!n(v,h)){v.pop();continue}if(m.push(p),m.length===h+1)return m}return m}},5995:function(t,e,r){t.exports=o;var i=r(7642),n=r(6037);function o(a,s){return i(s).filter(function(h){for(var v=new Array(h.length),m=0;m<h.length;++m)v[m]=s[h[m]];return n(v)*a<1})}},3502:function(t,e,r){t.exports=o;var i=r(5995),n=r(9127);function o(a,s){return n(i(a,s))}},6468:function(t){t.exports=function(e){return atob(e)}},2642:function(t,e,r){t.exports=o;var i=r(727);function n(a){for(var s=0,h=0;h<a.length;++h)s+=a[h];return s}function o(a,s){for(var h=s.length,v=new Array(h+1),m=0;m<h;++m){for(var p=new Array(h+1),y=0;y<=h;++y)p[y]=a[y][m];v[m]=p}v[h]=new Array(h+1);for(var m=0;m<=h;++m)v[h][m]=1;for(var l=new Array(h+1),m=0;m<h;++m)l[m]=s[m];l[h]=1;var x=i(v,l),b=n(x[h+1]);b===0&&(b=1);for(var S=new Array(h+1),m=0;m<=h;++m)S[m]=n(x[m])/b;return S}},7507:function(t,e){e.byteLength=v,e.toByteArray=p,e.fromByteArray=x;for(var r=[],i=[],n=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)r[a]=o[a],i[o.charCodeAt(a)]=a;i[45]=62,i[95]=63;function h(b){var S=b.length;if(S%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var T=b.indexOf("=");T===-1&&(T=S);var M=T===S?0:4-T%4;return[T,M]}function v(b){var S=h(b),T=S[0],M=S[1];return(T+M)*3/4-M}function m(b,S,T){return(S+T)*3/4-T}function p(b){var S,T=h(b),M=T[0],w=T[1],u=new n(m(b,M,w)),f=0,k=w>0?M-4:M,_;for(_=0;_<k;_+=4)S=i[b.charCodeAt(_)]<<18|i[b.charCodeAt(_+1)]<<12|i[b.charCodeAt(_+2)]<<6|i[b.charCodeAt(_+3)],u[f++]=S>>16&255,u[f++]=S>>8&255,u[f++]=S&255;return w===2&&(S=i[b.charCodeAt(_)]<<2|i[b.charCodeAt(_+1)]>>4,u[f++]=S&255),w===1&&(S=i[b.charCodeAt(_)]<<10|i[b.charCodeAt(_+1)]<<4|i[b.charCodeAt(_+2)]>>2,u[f++]=S>>8&255,u[f++]=S&255),u}function y(b){return r[b>>18&63]+r[b>>12&63]+r[b>>6&63]+r[b&63]}function l(b,S,T){for(var M,w=[],u=S;u<T;u+=3)M=(b[u]<<16&16711680)+(b[u+1]<<8&65280)+(b[u+2]&255),w.push(y(M));return w.join("")}function x(b){for(var S,T=b.length,M=T%3,w=[],u=16383,f=0,k=T-M;f<k;f+=u)w.push(l(b,f,f+u>k?k:f+u));return M===1?(S=b[T-1],w.push(r[S>>2]+r[S<<4&63]+"==")):M===2&&(S=(b[T-2]<<8)+b[T-1],w.push(r[S>>10]+r[S>>4&63]+r[S<<2&63]+"=")),w.join("")}},3865:function(t,e,r){var i=r(869);t.exports=n;function n(o,a){return i(o[0].mul(a[1]).add(a[0].mul(o[1])),o[1].mul(a[1]))}},1318:function(t){t.exports=e;function e(r,i){return r[0].mul(i[1]).cmp(i[0].mul(r[1]))}},8697:function(t,e,r){var i=r(869);t.exports=n;function n(o,a){return i(o[0].mul(a[1]),o[1].mul(a[0]))}},7842:function(t,e,r){var i=r(6330),n=r(1533),o=r(2651),a=r(6768),s=r(869),h=r(8697);t.exports=v;function v(m,p){if(i(m))return p?h(m,v(p)):[m[0].clone(),m[1].clone()];var y=0,l,x;if(n(m))l=m.clone();else if(typeof m=="string")l=a(m);else{if(m===0)return[o(0),o(1)];if(m===Math.floor(m))l=o(m);else{for(;m!==Math.floor(m);)m=m*Math.pow(2,256),y-=256;l=o(m)}}if(i(p))l.mul(p[1]),x=p[0].clone();else if(n(p))x=p.clone();else if(typeof p=="string")x=a(p);else if(!p)x=o(1);else if(p===Math.floor(p))x=o(p);else{for(;p!==Math.floor(p);)p=p*Math.pow(2,256),y+=256;x=o(p)}return y>0?l=l.ushln(y):y<0&&(x=x.ushln(-y)),s(l,x)}},6330:function(t,e,r){var i=r(1533);t.exports=n;function n(o){return Array.isArray(o)&&o.length===2&&i(o[0])&&i(o[1])}},5716:function(t,e,r){var i=r(6859);t.exports=n;function n(o){return o.cmp(new i(0))}},1369:function(t,e,r){var i=r(5716);t.exports=n;function n(o){var a=o.length,s=o.words,h=0;if(a===1)h=s[0];else if(a===2)h=s[0]+s[1]*67108864;else for(var v=0;v<a;v++){var m=s[v];h+=m*Math.pow(67108864,v)}return i(o)*h}},4025:function(t,e,r){var i=r(2361),n=r(8828).countTrailingZeros;t.exports=o;function o(a){var s=n(i.lo(a));if(s<32)return s;var h=n(i.hi(a));return h>20?52:h+32}},1533:function(t,e,r){r(6859),t.exports=i;function i(n){return n&&typeof n=="object"&&!!n.words}},2651:function(t,e,r){var i=r(6859),n=r(2361);t.exports=o;function o(a){var s=n.exponent(a);return s<52?new i(a):new i(a*Math.pow(2,52-s)).ushln(s-52)}},869:function(t,e,r){var i=r(2651),n=r(5716);t.exports=o;function o(a,s){var h=n(a),v=n(s);if(h===0)return[i(0),i(1)];if(v===0)return[i(0),i(0)];v<0&&(a=a.neg(),s=s.neg());var m=a.gcd(s);return m.cmpn(1)?[a.div(m),s.div(m)]:[a,s]}},6768:function(t,e,r){var i=r(6859);t.exports=n;function n(o){return new i(o)}},6504:function(t,e,r){var i=r(869);t.exports=n;function n(o,a){return i(o[0].mul(a[0]),o[1].mul(a[1]))}},7721:function(t,e,r){var i=r(5716);t.exports=n;function n(o){return i(o[0])*i(o[1])}},5572:function(t,e,r){var i=r(869);t.exports=n;function n(o,a){return i(o[0].mul(a[1]).sub(o[1].mul(a[0])),o[1].mul(a[1]))}},946:function(t,e,r){var i=r(1369),n=r(4025);t.exports=o;function o(a){var s=a[0],h=a[1];if(s.cmpn(0)===0)return 0;var v=s.abs().divmod(h.abs()),m=v.div,p=i(m),y=v.mod,l=s.negative!==h.negative?-1:1;if(y.cmpn(0)===0)return l*p;if(p){var x=n(p)+4,b=i(y.ushln(x).divRound(h));return l*(p+b*Math.pow(2,-x))}else{var S=h.bitLength()-y.bitLength()+53,b=i(y.ushln(S).divRound(h));return S<1023?l*b*Math.pow(2,-S):(b*=Math.pow(2,-1023),l*b*Math.pow(2,1023-S))}}},2478:function(t){function e(s,h,v,m,p){for(var y=p+1;m<=p;){var l=m+p>>>1,x=s[l],b=v!==void 0?v(x,h):x-h;b>=0?(y=l,p=l-1):m=l+1}return y}function r(s,h,v,m,p){for(var y=p+1;m<=p;){var l=m+p>>>1,x=s[l],b=v!==void 0?v(x,h):x-h;b>0?(y=l,p=l-1):m=l+1}return y}function i(s,h,v,m,p){for(var y=m-1;m<=p;){var l=m+p>>>1,x=s[l],b=v!==void 0?v(x,h):x-h;b<0?(y=l,m=l+1):p=l-1}return y}function n(s,h,v,m,p){for(var y=m-1;m<=p;){var l=m+p>>>1,x=s[l],b=v!==void 0?v(x,h):x-h;b<=0?(y=l,m=l+1):p=l-1}return y}function o(s,h,v,m,p){for(;m<=p;){var y=m+p>>>1,l=s[y],x=v!==void 0?v(l,h):l-h;if(x===0)return y;x<=0?m=y+1:p=y-1}return-1}function a(s,h,v,m,p,y){return typeof v=="function"?y(s,h,v,m===void 0?0:m|0,p===void 0?s.length-1:p|0):y(s,h,void 0,v===void 0?0:v|0,m===void 0?s.length-1:m|0)}t.exports={ge:function(s,h,v,m,p){return a(s,h,v,m,p,e)},gt:function(s,h,v,m,p){return a(s,h,v,m,p,r)},lt:function(s,h,v,m,p){return a(s,h,v,m,p,i)},le:function(s,h,v,m,p){return a(s,h,v,m,p,n)},eq:function(s,h,v,m,p){return a(s,h,v,m,p,o)}}},8828:function(t,e){"use restrict";var r=32;e.INT_BITS=r,e.INT_MAX=2147483647,e.INT_MIN=-1<<r-1,e.sign=function(o){return(o>0)-(o<0)},e.abs=function(o){var a=o>>r-1;return(o^a)-a},e.min=function(o,a){return a^(o^a)&-(o<a)},e.max=function(o,a){return o^(o^a)&-(o<a)},e.isPow2=function(o){return!(o&o-1)&&!!o},e.log2=function(o){var a,s;return a=(o>65535)<<4,o>>>=a,s=(o>255)<<3,o>>>=s,a|=s,s=(o>15)<<2,o>>>=s,a|=s,s=(o>3)<<1,o>>>=s,a|=s,a|o>>1},e.log10=function(o){return o>=1e9?9:o>=1e8?8:o>=1e7?7:o>=1e6?6:o>=1e5?5:o>=1e4?4:o>=1e3?3:o>=100?2:o>=10?1:0},e.popCount=function(o){return o=o-(o>>>1&1431655765),o=(o&858993459)+(o>>>2&858993459),(o+(o>>>4)&252645135)*16843009>>>24};function i(o){var a=32;return o&=-o,o&&a--,o&65535&&(a-=16),o&16711935&&(a-=8),o&252645135&&(a-=4),o&858993459&&(a-=2),o&1431655765&&(a-=1),a}e.countTrailingZeros=i,e.nextPow2=function(o){return o+=o===0,--o,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o+1},e.prevPow2=function(o){return o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o-(o>>>1)},e.parity=function(o){return o^=o>>>16,o^=o>>>8,o^=o>>>4,o&=15,27030>>>o&1};var n=new Array(256);(function(o){for(var a=0;a<256;++a){var s=a,h=a,v=7;for(s>>>=1;s;s>>>=1)h<<=1,h|=s&1,--v;o[a]=h<<v&255}})(n),e.reverse=function(o){return n[o&255]<<24|n[o>>>8&255]<<16|n[o>>>16&255]<<8|n[o>>>24&255]},e.interleave2=function(o,a){return o&=65535,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,a&=65535,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,o|a<<1},e.deinterleave2=function(o,a){return o=o>>>a&1431655765,o=(o|o>>>1)&858993459,o=(o|o>>>2)&252645135,o=(o|o>>>4)&16711935,o=(o|o>>>16)&65535,o<<16>>16},e.interleave3=function(o,a,s){return o&=1023,o=(o|o<<16)&4278190335,o=(o|o<<8)&251719695,o=(o|o<<4)&3272356035,o=(o|o<<2)&1227133513,a&=1023,a=(a|a<<16)&4278190335,a=(a|a<<8)&251719695,a=(a|a<<4)&3272356035,a=(a|a<<2)&1227133513,o|=a<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,o|s<<2},e.deinterleave3=function(o,a){return o=o>>>a&1227133513,o=(o|o>>>2)&3272356035,o=(o|o>>>4)&251719695,o=(o|o>>>8)&4278190335,o=(o|o>>>16)&1023,o<<22>>22},e.nextCombination=function(o){var a=o|o-1;return a+1|(~a&-~a)-1>>>i(o)+1}},6859:function(t,e,r){t=r.nmd(t),function(i,n){function o(L,F){if(!L)throw new Error(F||"Assertion failed")}function a(L,F){L.super_=F;var N=function(){};N.prototype=F.prototype,L.prototype=new N,L.prototype.constructor=L}function s(L,F,N){if(s.isBN(L))return L;this.negative=0,this.words=null,this.length=0,this.red=null,L!==null&&((F==="le"||F==="be")&&(N=F,F=10),this._init(L||0,F||10,N||"be"))}typeof i=="object"?i.exports=s:n.BN=s,s.BN=s,s.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=r(7790).Buffer}catch{}s.isBN=function(L){return L instanceof s?!0:L!==null&&typeof L=="object"&&L.constructor.wordSize===s.wordSize&&Array.isArray(L.words)},s.max=function(L,F){return L.cmp(F)>0?L:F},s.min=function(L,F){return L.cmp(F)<0?L:F},s.prototype._init=function(L,F,N){if(typeof L=="number")return this._initNumber(L,F,N);if(typeof L=="object")return this._initArray(L,F,N);F==="hex"&&(F=16),o(F===(F|0)&&F>=2&&F<=36),L=L.toString().replace(/\s+/g,"");var j=0;L[0]==="-"&&(j++,this.negative=1),j<L.length&&(F===16?this._parseHex(L,j,N):(this._parseBase(L,F,j),N==="le"&&this._initArray(this.toArray(),F,N)))},s.prototype._initNumber=function(L,F,N){L<0&&(this.negative=1,L=-L),L<67108864?(this.words=[L&67108863],this.length=1):L<4503599627370496?(this.words=[L&67108863,L/67108864&67108863],this.length=2):(o(L<9007199254740992),this.words=[L&67108863,L/67108864&67108863,1],this.length=3),N==="le"&&this._initArray(this.toArray(),F,N)},s.prototype._initArray=function(L,F,N){if(o(typeof L.length=="number"),L.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(L.length/3),this.words=new Array(this.length);for(var j=0;j<this.length;j++)this.words[j]=0;var G,rt,ct=0;if(N==="be")for(j=L.length-1,G=0;j>=0;j-=3)rt=L[j]|L[j-1]<<8|L[j-2]<<16,this.words[G]|=rt<<ct&67108863,this.words[G+1]=rt>>>26-ct&67108863,ct+=24,ct>=26&&(ct-=26,G++);else if(N==="le")for(j=0,G=0;j<L.length;j+=3)rt=L[j]|L[j+1]<<8|L[j+2]<<16,this.words[G]|=rt<<ct&67108863,this.words[G+1]=rt>>>26-ct&67108863,ct+=24,ct>=26&&(ct-=26,G++);return this.strip()};function v(L,F){var N=L.charCodeAt(F);return N>=65&&N<=70?N-55:N>=97&&N<=102?N-87:N-48&15}function m(L,F,N){var j=v(L,N);return N-1>=F&&(j|=v(L,N-1)<<4),j}s.prototype._parseHex=function(L,F,N){this.length=Math.ceil((L.length-F)/6),this.words=new Array(this.length);for(var j=0;j<this.length;j++)this.words[j]=0;var G=0,rt=0,ct;if(N==="be")for(j=L.length-1;j>=F;j-=2)ct=m(L,F,j)<<G,this.words[rt]|=ct&67108863,G>=18?(G-=18,rt+=1,this.words[rt]|=ct>>>26):G+=8;else{var lt=L.length-F;for(j=lt%2===0?F+1:F;j<L.length;j+=2)ct=m(L,F,j)<<G,this.words[rt]|=ct&67108863,G>=18?(G-=18,rt+=1,this.words[rt]|=ct>>>26):G+=8}this.strip()};function p(L,F,N,j){for(var G=0,rt=Math.min(L.length,N),ct=F;ct<rt;ct++){var lt=L.charCodeAt(ct)-48;G*=j,lt>=49?G+=lt-49+10:lt>=17?G+=lt-17+10:G+=lt}return G}s.prototype._parseBase=function(L,F,N){this.words=[0],this.length=1;for(var j=0,G=1;G<=67108863;G*=F)j++;j--,G=G/F|0;for(var rt=L.length-N,ct=rt%j,lt=Math.min(rt,rt-ct)+N,tt=0,Z=N;Z<lt;Z+=j)tt=p(L,Z,Z+j,F),this.imuln(G),this.words[0]+tt<67108864?this.words[0]+=tt:this._iaddn(tt);if(ct!==0){var st=1;for(tt=p(L,Z,L.length,F),Z=0;Z<ct;Z++)st*=F;this.imuln(st),this.words[0]+tt<67108864?this.words[0]+=tt:this._iaddn(tt)}this.strip()},s.prototype.copy=function(L){L.words=new Array(this.length);for(var F=0;F<this.length;F++)L.words[F]=this.words[F];L.length=this.length,L.negative=this.negative,L.red=this.red},s.prototype.clone=function(){var L=new s(null);return this.copy(L),L},s.prototype._expand=function(L){for(;this.length<L;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(L,F){L=L||10,F=F|0||1;var N;if(L===16||L==="hex"){N="";for(var j=0,G=0,rt=0;rt<this.length;rt++){var ct=this.words[rt],lt=((ct<<j|G)&16777215).toString(16);G=ct>>>24-j&16777215,G!==0||rt!==this.length-1?N=y[6-lt.length]+lt+N:N=lt+N,j+=2,j>=26&&(j-=26,rt--)}for(G!==0&&(N=G.toString(16)+N);N.length%F!==0;)N="0"+N;return this.negative!==0&&(N="-"+N),N}if(L===(L|0)&&L>=2&&L<=36){var tt=l[L],Z=x[L];N="";var st=this.clone();for(st.negative=0;!st.isZero();){var $=st.modn(Z).toString(L);st=st.idivn(Z),st.isZero()?N=$+N:N=y[tt-$.length]+$+N}for(this.isZero()&&(N="0"+N);N.length%F!==0;)N="0"+N;return this.negative!==0&&(N="-"+N),N}o(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var L=this.words[0];return this.length===2?L+=this.words[1]*67108864:this.length===3&&this.words[2]===1?L+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-L:L},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(L,F){return o(typeof h<"u"),this.toArrayLike(h,L,F)},s.prototype.toArray=function(L,F){return this.toArrayLike(Array,L,F)},s.prototype.toArrayLike=function(L,F,N){var j=this.byteLength(),G=N||Math.max(1,j);o(j<=G,"byte array longer than desired length"),o(G>0,"Requested array length <= 0"),this.strip();var rt=F==="le",ct=new L(G),lt,tt,Z=this.clone();if(rt){for(tt=0;!Z.isZero();tt++)lt=Z.andln(255),Z.iushrn(8),ct[tt]=lt;for(;tt<G;tt++)ct[tt]=0}else{for(tt=0;tt<G-j;tt++)ct[tt]=0;for(tt=0;!Z.isZero();tt++)lt=Z.andln(255),Z.iushrn(8),ct[G-tt-1]=lt}return ct},Math.clz32?s.prototype._countBits=function(L){return 32-Math.clz32(L)}:s.prototype._countBits=function(L){var F=L,N=0;return F>=4096&&(N+=13,F>>>=13),F>=64&&(N+=7,F>>>=7),F>=8&&(N+=4,F>>>=4),F>=2&&(N+=2,F>>>=2),N+F},s.prototype._zeroBits=function(L){if(L===0)return 26;var F=L,N=0;return F&8191||(N+=13,F>>>=13),F&127||(N+=7,F>>>=7),F&15||(N+=4,F>>>=4),F&3||(N+=2,F>>>=2),F&1||N++,N},s.prototype.bitLength=function(){var L=this.words[this.length-1],F=this._countBits(L);return(this.length-1)*26+F};function b(L){for(var F=new Array(L.bitLength()),N=0;N<F.length;N++){var j=N/26|0,G=N%26;F[N]=(L.words[j]&1<<G)>>>G}return F}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var L=0,F=0;F<this.length;F++){var N=this._zeroBits(this.words[F]);if(L+=N,N!==26)break}return L},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(L){return this.negative!==0?this.abs().inotn(L).iaddn(1):this.clone()},s.prototype.fromTwos=function(L){return this.testn(L-1)?this.notn(L).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(L){for(;this.length<L.length;)this.words[this.length++]=0;for(var F=0;F<L.length;F++)this.words[F]=this.words[F]|L.words[F];return this.strip()},s.prototype.ior=function(L){return o((this.negative|L.negative)===0),this.iuor(L)},s.prototype.or=function(L){return this.length>L.length?this.clone().ior(L):L.clone().ior(this)},s.prototype.uor=function(L){return this.length>L.length?this.clone().iuor(L):L.clone().iuor(this)},s.prototype.iuand=function(L){var F;this.length>L.length?F=L:F=this;for(var N=0;N<F.length;N++)this.words[N]=this.words[N]&L.words[N];return this.length=F.length,this.strip()},s.prototype.iand=function(L){return o((this.negative|L.negative)===0),this.iuand(L)},s.prototype.and=function(L){return this.length>L.length?this.clone().iand(L):L.clone().iand(this)},s.prototype.uand=function(L){return this.length>L.length?this.clone().iuand(L):L.clone().iuand(this)},s.prototype.iuxor=function(L){var F,N;this.length>L.length?(F=this,N=L):(F=L,N=this);for(var j=0;j<N.length;j++)this.words[j]=F.words[j]^N.words[j];if(this!==F)for(;j<F.length;j++)this.words[j]=F.words[j];return this.length=F.length,this.strip()},s.prototype.ixor=function(L){return o((this.negative|L.negative)===0),this.iuxor(L)},s.prototype.xor=function(L){return this.length>L.length?this.clone().ixor(L):L.clone().ixor(this)},s.prototype.uxor=function(L){return this.length>L.length?this.clone().iuxor(L):L.clone().iuxor(this)},s.prototype.inotn=function(L){o(typeof L=="number"&&L>=0);var F=Math.ceil(L/26)|0,N=L%26;this._expand(F),N>0&&F--;for(var j=0;j<F;j++)this.words[j]=~this.words[j]&67108863;return N>0&&(this.words[j]=~this.words[j]&67108863>>26-N),this.strip()},s.prototype.notn=function(L){return this.clone().inotn(L)},s.prototype.setn=function(L,F){o(typeof L=="number"&&L>=0);var N=L/26|0,j=L%26;return this._expand(N+1),F?this.words[N]=this.words[N]|1<<j:this.words[N]=this.words[N]&~(1<<j),this.strip()},s.prototype.iadd=function(L){var F;if(this.negative!==0&&L.negative===0)return this.negative=0,F=this.isub(L),this.negative^=1,this._normSign();if(this.negative===0&&L.negative!==0)return L.negative=0,F=this.isub(L),L.negative=1,F._normSign();var N,j;this.length>L.length?(N=this,j=L):(N=L,j=this);for(var G=0,rt=0;rt<j.length;rt++)F=(N.words[rt]|0)+(j.words[rt]|0)+G,this.words[rt]=F&67108863,G=F>>>26;for(;G!==0&&rt<N.length;rt++)F=(N.words[rt]|0)+G,this.words[rt]=F&67108863,G=F>>>26;if(this.length=N.length,G!==0)this.words[this.length]=G,this.length++;else if(N!==this)for(;rt<N.length;rt++)this.words[rt]=N.words[rt];return this},s.prototype.add=function(L){var F;return L.negative!==0&&this.negative===0?(L.negative=0,F=this.sub(L),L.negative^=1,F):L.negative===0&&this.negative!==0?(this.negative=0,F=L.sub(this),this.negative=1,F):this.length>L.length?this.clone().iadd(L):L.clone().iadd(this)},s.prototype.isub=function(L){if(L.negative!==0){L.negative=0;var F=this.iadd(L);return L.negative=1,F._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(L),this.negative=1,this._normSign();var N=this.cmp(L);if(N===0)return this.negative=0,this.length=1,this.words[0]=0,this;var j,G;N>0?(j=this,G=L):(j=L,G=this);for(var rt=0,ct=0;ct<G.length;ct++)F=(j.words[ct]|0)-(G.words[ct]|0)+rt,rt=F>>26,this.words[ct]=F&67108863;for(;rt!==0&&ct<j.length;ct++)F=(j.words[ct]|0)+rt,rt=F>>26,this.words[ct]=F&67108863;if(rt===0&&ct<j.length&&j!==this)for(;ct<j.length;ct++)this.words[ct]=j.words[ct];return this.length=Math.max(this.length,ct),j!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(L){return this.clone().isub(L)};function S(L,F,N){N.negative=F.negative^L.negative;var j=L.length+F.length|0;N.length=j,j=j-1|0;var G=L.words[0]|0,rt=F.words[0]|0,ct=G*rt,lt=ct&67108863,tt=ct/67108864|0;N.words[0]=lt;for(var Z=1;Z<j;Z++){for(var st=tt>>>26,$=tt&67108863,Q=Math.min(Z,F.length-1),nt=Math.max(0,Z-L.length+1);nt<=Q;nt++){var Y=Z-nt|0;G=L.words[Y]|0,rt=F.words[nt]|0,ct=G*rt+$,st+=ct/67108864|0,$=ct&67108863}N.words[Z]=$|0,tt=st|0}return tt!==0?N.words[Z]=tt|0:N.length--,N.strip()}var T=function(L,F,N){var j=L.words,G=F.words,rt=N.words,ct=0,lt,tt,Z,st=j[0]|0,$=st&8191,Q=st>>>13,nt=j[1]|0,Y=nt&8191,q=nt>>>13,ot=j[2]|0,it=ot&8191,dt=ot>>>13,wt=j[3]|0,xt=wt&8191,Ft=wt>>>13,Et=j[4]|0,Nt=Et&8191,te=Et>>>13,Jt=j[5]|0,Qt=Jt&8191,Wt=Jt>>>13,gt=j[6]|0,bt=gt&8191,vt=gt>>>13,Ut=j[7]|0,Kt=Ut&8191,Zt=Ut>>>13,le=j[8]|0,Te=le&8191,Se=le>>>13,Fe=j[9]|0,Oe=Fe&8191,ur=Fe>>>13,fr=G[0]|0,We=fr&8191,Lr=fr>>>13,kr=G[1]|0,he=kr&8191,Dt=kr>>>13,qt=G[2]|0,zt=qt&8191,ut=qt>>>13,yt=G[3]|0,Mt=yt&8191,Ot=yt>>>13,$t=G[4]|0,ee=$t&8191,we=$t>>>13,Me=G[5]|0,Re=Me&8191,Be=Me>>>13,Ze=G[6]|0,Ue=Ze&8191,mr=Ze>>>13,ln=G[7]|0,an=ln&8191,vn=ln>>>13,Sn=G[8]|0,An=Sn&8191,pn=Sn>>>13,On=G[9]|0,Nn=On&8191,ke=On>>>13;N.negative=L.negative^F.negative,N.length=19,lt=Math.imul($,We),tt=Math.imul($,Lr),tt=tt+Math.imul(Q,We)|0,Z=Math.imul(Q,Lr);var ze=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(ze>>>26)|0,ze&=67108863,lt=Math.imul(Y,We),tt=Math.imul(Y,Lr),tt=tt+Math.imul(q,We)|0,Z=Math.imul(q,Lr),lt=lt+Math.imul($,he)|0,tt=tt+Math.imul($,Dt)|0,tt=tt+Math.imul(Q,he)|0,Z=Z+Math.imul(Q,Dt)|0;var je=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(je>>>26)|0,je&=67108863,lt=Math.imul(it,We),tt=Math.imul(it,Lr),tt=tt+Math.imul(dt,We)|0,Z=Math.imul(dt,Lr),lt=lt+Math.imul(Y,he)|0,tt=tt+Math.imul(Y,Dt)|0,tt=tt+Math.imul(q,he)|0,Z=Z+Math.imul(q,Dt)|0,lt=lt+Math.imul($,zt)|0,tt=tt+Math.imul($,ut)|0,tt=tt+Math.imul(Q,zt)|0,Z=Z+Math.imul(Q,ut)|0;var Ne=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,lt=Math.imul(xt,We),tt=Math.imul(xt,Lr),tt=tt+Math.imul(Ft,We)|0,Z=Math.imul(Ft,Lr),lt=lt+Math.imul(it,he)|0,tt=tt+Math.imul(it,Dt)|0,tt=tt+Math.imul(dt,he)|0,Z=Z+Math.imul(dt,Dt)|0,lt=lt+Math.imul(Y,zt)|0,tt=tt+Math.imul(Y,ut)|0,tt=tt+Math.imul(q,zt)|0,Z=Z+Math.imul(q,ut)|0,lt=lt+Math.imul($,Mt)|0,tt=tt+Math.imul($,Ot)|0,tt=tt+Math.imul(Q,Mt)|0,Z=Z+Math.imul(Q,Ot)|0;var _r=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(_r>>>26)|0,_r&=67108863,lt=Math.imul(Nt,We),tt=Math.imul(Nt,Lr),tt=tt+Math.imul(te,We)|0,Z=Math.imul(te,Lr),lt=lt+Math.imul(xt,he)|0,tt=tt+Math.imul(xt,Dt)|0,tt=tt+Math.imul(Ft,he)|0,Z=Z+Math.imul(Ft,Dt)|0,lt=lt+Math.imul(it,zt)|0,tt=tt+Math.imul(it,ut)|0,tt=tt+Math.imul(dt,zt)|0,Z=Z+Math.imul(dt,ut)|0,lt=lt+Math.imul(Y,Mt)|0,tt=tt+Math.imul(Y,Ot)|0,tt=tt+Math.imul(q,Mt)|0,Z=Z+Math.imul(q,Ot)|0,lt=lt+Math.imul($,ee)|0,tt=tt+Math.imul($,we)|0,tt=tt+Math.imul(Q,ee)|0,Z=Z+Math.imul(Q,we)|0;var Xr=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,lt=Math.imul(Qt,We),tt=Math.imul(Qt,Lr),tt=tt+Math.imul(Wt,We)|0,Z=Math.imul(Wt,Lr),lt=lt+Math.imul(Nt,he)|0,tt=tt+Math.imul(Nt,Dt)|0,tt=tt+Math.imul(te,he)|0,Z=Z+Math.imul(te,Dt)|0,lt=lt+Math.imul(xt,zt)|0,tt=tt+Math.imul(xt,ut)|0,tt=tt+Math.imul(Ft,zt)|0,Z=Z+Math.imul(Ft,ut)|0,lt=lt+Math.imul(it,Mt)|0,tt=tt+Math.imul(it,Ot)|0,tt=tt+Math.imul(dt,Mt)|0,Z=Z+Math.imul(dt,Ot)|0,lt=lt+Math.imul(Y,ee)|0,tt=tt+Math.imul(Y,we)|0,tt=tt+Math.imul(q,ee)|0,Z=Z+Math.imul(q,we)|0,lt=lt+Math.imul($,Re)|0,tt=tt+Math.imul($,Be)|0,tt=tt+Math.imul(Q,Re)|0,Z=Z+Math.imul(Q,Be)|0;var rn=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(rn>>>26)|0,rn&=67108863,lt=Math.imul(bt,We),tt=Math.imul(bt,Lr),tt=tt+Math.imul(vt,We)|0,Z=Math.imul(vt,Lr),lt=lt+Math.imul(Qt,he)|0,tt=tt+Math.imul(Qt,Dt)|0,tt=tt+Math.imul(Wt,he)|0,Z=Z+Math.imul(Wt,Dt)|0,lt=lt+Math.imul(Nt,zt)|0,tt=tt+Math.imul(Nt,ut)|0,tt=tt+Math.imul(te,zt)|0,Z=Z+Math.imul(te,ut)|0,lt=lt+Math.imul(xt,Mt)|0,tt=tt+Math.imul(xt,Ot)|0,tt=tt+Math.imul(Ft,Mt)|0,Z=Z+Math.imul(Ft,Ot)|0,lt=lt+Math.imul(it,ee)|0,tt=tt+Math.imul(it,we)|0,tt=tt+Math.imul(dt,ee)|0,Z=Z+Math.imul(dt,we)|0,lt=lt+Math.imul(Y,Re)|0,tt=tt+Math.imul(Y,Be)|0,tt=tt+Math.imul(q,Re)|0,Z=Z+Math.imul(q,Be)|0,lt=lt+Math.imul($,Ue)|0,tt=tt+Math.imul($,mr)|0,tt=tt+Math.imul(Q,Ue)|0,Z=Z+Math.imul(Q,mr)|0;var Br=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(Br>>>26)|0,Br&=67108863,lt=Math.imul(Kt,We),tt=Math.imul(Kt,Lr),tt=tt+Math.imul(Zt,We)|0,Z=Math.imul(Zt,Lr),lt=lt+Math.imul(bt,he)|0,tt=tt+Math.imul(bt,Dt)|0,tt=tt+Math.imul(vt,he)|0,Z=Z+Math.imul(vt,Dt)|0,lt=lt+Math.imul(Qt,zt)|0,tt=tt+Math.imul(Qt,ut)|0,tt=tt+Math.imul(Wt,zt)|0,Z=Z+Math.imul(Wt,ut)|0,lt=lt+Math.imul(Nt,Mt)|0,tt=tt+Math.imul(Nt,Ot)|0,tt=tt+Math.imul(te,Mt)|0,Z=Z+Math.imul(te,Ot)|0,lt=lt+Math.imul(xt,ee)|0,tt=tt+Math.imul(xt,we)|0,tt=tt+Math.imul(Ft,ee)|0,Z=Z+Math.imul(Ft,we)|0,lt=lt+Math.imul(it,Re)|0,tt=tt+Math.imul(it,Be)|0,tt=tt+Math.imul(dt,Re)|0,Z=Z+Math.imul(dt,Be)|0,lt=lt+Math.imul(Y,Ue)|0,tt=tt+Math.imul(Y,mr)|0,tt=tt+Math.imul(q,Ue)|0,Z=Z+Math.imul(q,mr)|0,lt=lt+Math.imul($,an)|0,tt=tt+Math.imul($,vn)|0,tt=tt+Math.imul(Q,an)|0,Z=Z+Math.imul(Q,vn)|0;var _n=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(_n>>>26)|0,_n&=67108863,lt=Math.imul(Te,We),tt=Math.imul(Te,Lr),tt=tt+Math.imul(Se,We)|0,Z=Math.imul(Se,Lr),lt=lt+Math.imul(Kt,he)|0,tt=tt+Math.imul(Kt,Dt)|0,tt=tt+Math.imul(Zt,he)|0,Z=Z+Math.imul(Zt,Dt)|0,lt=lt+Math.imul(bt,zt)|0,tt=tt+Math.imul(bt,ut)|0,tt=tt+Math.imul(vt,zt)|0,Z=Z+Math.imul(vt,ut)|0,lt=lt+Math.imul(Qt,Mt)|0,tt=tt+Math.imul(Qt,Ot)|0,tt=tt+Math.imul(Wt,Mt)|0,Z=Z+Math.imul(Wt,Ot)|0,lt=lt+Math.imul(Nt,ee)|0,tt=tt+Math.imul(Nt,we)|0,tt=tt+Math.imul(te,ee)|0,Z=Z+Math.imul(te,we)|0,lt=lt+Math.imul(xt,Re)|0,tt=tt+Math.imul(xt,Be)|0,tt=tt+Math.imul(Ft,Re)|0,Z=Z+Math.imul(Ft,Be)|0,lt=lt+Math.imul(it,Ue)|0,tt=tt+Math.imul(it,mr)|0,tt=tt+Math.imul(dt,Ue)|0,Z=Z+Math.imul(dt,mr)|0,lt=lt+Math.imul(Y,an)|0,tt=tt+Math.imul(Y,vn)|0,tt=tt+Math.imul(q,an)|0,Z=Z+Math.imul(q,vn)|0,lt=lt+Math.imul($,An)|0,tt=tt+Math.imul($,pn)|0,tt=tt+Math.imul(Q,An)|0,Z=Z+Math.imul(Q,pn)|0;var bn=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(bn>>>26)|0,bn&=67108863,lt=Math.imul(Oe,We),tt=Math.imul(Oe,Lr),tt=tt+Math.imul(ur,We)|0,Z=Math.imul(ur,Lr),lt=lt+Math.imul(Te,he)|0,tt=tt+Math.imul(Te,Dt)|0,tt=tt+Math.imul(Se,he)|0,Z=Z+Math.imul(Se,Dt)|0,lt=lt+Math.imul(Kt,zt)|0,tt=tt+Math.imul(Kt,ut)|0,tt=tt+Math.imul(Zt,zt)|0,Z=Z+Math.imul(Zt,ut)|0,lt=lt+Math.imul(bt,Mt)|0,tt=tt+Math.imul(bt,Ot)|0,tt=tt+Math.imul(vt,Mt)|0,Z=Z+Math.imul(vt,Ot)|0,lt=lt+Math.imul(Qt,ee)|0,tt=tt+Math.imul(Qt,we)|0,tt=tt+Math.imul(Wt,ee)|0,Z=Z+Math.imul(Wt,we)|0,lt=lt+Math.imul(Nt,Re)|0,tt=tt+Math.imul(Nt,Be)|0,tt=tt+Math.imul(te,Re)|0,Z=Z+Math.imul(te,Be)|0,lt=lt+Math.imul(xt,Ue)|0,tt=tt+Math.imul(xt,mr)|0,tt=tt+Math.imul(Ft,Ue)|0,Z=Z+Math.imul(Ft,mr)|0,lt=lt+Math.imul(it,an)|0,tt=tt+Math.imul(it,vn)|0,tt=tt+Math.imul(dt,an)|0,Z=Z+Math.imul(dt,vn)|0,lt=lt+Math.imul(Y,An)|0,tt=tt+Math.imul(Y,pn)|0,tt=tt+Math.imul(q,An)|0,Z=Z+Math.imul(q,pn)|0,lt=lt+Math.imul($,Nn)|0,tt=tt+Math.imul($,ke)|0,tt=tt+Math.imul(Q,Nn)|0,Z=Z+Math.imul(Q,ke)|0;var Fn=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,lt=Math.imul(Oe,he),tt=Math.imul(Oe,Dt),tt=tt+Math.imul(ur,he)|0,Z=Math.imul(ur,Dt),lt=lt+Math.imul(Te,zt)|0,tt=tt+Math.imul(Te,ut)|0,tt=tt+Math.imul(Se,zt)|0,Z=Z+Math.imul(Se,ut)|0,lt=lt+Math.imul(Kt,Mt)|0,tt=tt+Math.imul(Kt,Ot)|0,tt=tt+Math.imul(Zt,Mt)|0,Z=Z+Math.imul(Zt,Ot)|0,lt=lt+Math.imul(bt,ee)|0,tt=tt+Math.imul(bt,we)|0,tt=tt+Math.imul(vt,ee)|0,Z=Z+Math.imul(vt,we)|0,lt=lt+Math.imul(Qt,Re)|0,tt=tt+Math.imul(Qt,Be)|0,tt=tt+Math.imul(Wt,Re)|0,Z=Z+Math.imul(Wt,Be)|0,lt=lt+Math.imul(Nt,Ue)|0,tt=tt+Math.imul(Nt,mr)|0,tt=tt+Math.imul(te,Ue)|0,Z=Z+Math.imul(te,mr)|0,lt=lt+Math.imul(xt,an)|0,tt=tt+Math.imul(xt,vn)|0,tt=tt+Math.imul(Ft,an)|0,Z=Z+Math.imul(Ft,vn)|0,lt=lt+Math.imul(it,An)|0,tt=tt+Math.imul(it,pn)|0,tt=tt+Math.imul(dt,An)|0,Z=Z+Math.imul(dt,pn)|0,lt=lt+Math.imul(Y,Nn)|0,tt=tt+Math.imul(Y,ke)|0,tt=tt+Math.imul(q,Nn)|0,Z=Z+Math.imul(q,ke)|0;var on=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(on>>>26)|0,on&=67108863,lt=Math.imul(Oe,zt),tt=Math.imul(Oe,ut),tt=tt+Math.imul(ur,zt)|0,Z=Math.imul(ur,ut),lt=lt+Math.imul(Te,Mt)|0,tt=tt+Math.imul(Te,Ot)|0,tt=tt+Math.imul(Se,Mt)|0,Z=Z+Math.imul(Se,Ot)|0,lt=lt+Math.imul(Kt,ee)|0,tt=tt+Math.imul(Kt,we)|0,tt=tt+Math.imul(Zt,ee)|0,Z=Z+Math.imul(Zt,we)|0,lt=lt+Math.imul(bt,Re)|0,tt=tt+Math.imul(bt,Be)|0,tt=tt+Math.imul(vt,Re)|0,Z=Z+Math.imul(vt,Be)|0,lt=lt+Math.imul(Qt,Ue)|0,tt=tt+Math.imul(Qt,mr)|0,tt=tt+Math.imul(Wt,Ue)|0,Z=Z+Math.imul(Wt,mr)|0,lt=lt+Math.imul(Nt,an)|0,tt=tt+Math.imul(Nt,vn)|0,tt=tt+Math.imul(te,an)|0,Z=Z+Math.imul(te,vn)|0,lt=lt+Math.imul(xt,An)|0,tt=tt+Math.imul(xt,pn)|0,tt=tt+Math.imul(Ft,An)|0,Z=Z+Math.imul(Ft,pn)|0,lt=lt+Math.imul(it,Nn)|0,tt=tt+Math.imul(it,ke)|0,tt=tt+Math.imul(dt,Nn)|0,Z=Z+Math.imul(dt,ke)|0;var Bn=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,lt=Math.imul(Oe,Mt),tt=Math.imul(Oe,Ot),tt=tt+Math.imul(ur,Mt)|0,Z=Math.imul(ur,Ot),lt=lt+Math.imul(Te,ee)|0,tt=tt+Math.imul(Te,we)|0,tt=tt+Math.imul(Se,ee)|0,Z=Z+Math.imul(Se,we)|0,lt=lt+Math.imul(Kt,Re)|0,tt=tt+Math.imul(Kt,Be)|0,tt=tt+Math.imul(Zt,Re)|0,Z=Z+Math.imul(Zt,Be)|0,lt=lt+Math.imul(bt,Ue)|0,tt=tt+Math.imul(bt,mr)|0,tt=tt+Math.imul(vt,Ue)|0,Z=Z+Math.imul(vt,mr)|0,lt=lt+Math.imul(Qt,an)|0,tt=tt+Math.imul(Qt,vn)|0,tt=tt+Math.imul(Wt,an)|0,Z=Z+Math.imul(Wt,vn)|0,lt=lt+Math.imul(Nt,An)|0,tt=tt+Math.imul(Nt,pn)|0,tt=tt+Math.imul(te,An)|0,Z=Z+Math.imul(te,pn)|0,lt=lt+Math.imul(xt,Nn)|0,tt=tt+Math.imul(xt,ke)|0,tt=tt+Math.imul(Ft,Nn)|0,Z=Z+Math.imul(Ft,ke)|0;var ue=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(ue>>>26)|0,ue&=67108863,lt=Math.imul(Oe,ee),tt=Math.imul(Oe,we),tt=tt+Math.imul(ur,ee)|0,Z=Math.imul(ur,we),lt=lt+Math.imul(Te,Re)|0,tt=tt+Math.imul(Te,Be)|0,tt=tt+Math.imul(Se,Re)|0,Z=Z+Math.imul(Se,Be)|0,lt=lt+Math.imul(Kt,Ue)|0,tt=tt+Math.imul(Kt,mr)|0,tt=tt+Math.imul(Zt,Ue)|0,Z=Z+Math.imul(Zt,mr)|0,lt=lt+Math.imul(bt,an)|0,tt=tt+Math.imul(bt,vn)|0,tt=tt+Math.imul(vt,an)|0,Z=Z+Math.imul(vt,vn)|0,lt=lt+Math.imul(Qt,An)|0,tt=tt+Math.imul(Qt,pn)|0,tt=tt+Math.imul(Wt,An)|0,Z=Z+Math.imul(Wt,pn)|0,lt=lt+Math.imul(Nt,Nn)|0,tt=tt+Math.imul(Nt,ke)|0,tt=tt+Math.imul(te,Nn)|0,Z=Z+Math.imul(te,ke)|0;var xe=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(xe>>>26)|0,xe&=67108863,lt=Math.imul(Oe,Re),tt=Math.imul(Oe,Be),tt=tt+Math.imul(ur,Re)|0,Z=Math.imul(ur,Be),lt=lt+Math.imul(Te,Ue)|0,tt=tt+Math.imul(Te,mr)|0,tt=tt+Math.imul(Se,Ue)|0,Z=Z+Math.imul(Se,mr)|0,lt=lt+Math.imul(Kt,an)|0,tt=tt+Math.imul(Kt,vn)|0,tt=tt+Math.imul(Zt,an)|0,Z=Z+Math.imul(Zt,vn)|0,lt=lt+Math.imul(bt,An)|0,tt=tt+Math.imul(bt,pn)|0,tt=tt+Math.imul(vt,An)|0,Z=Z+Math.imul(vt,pn)|0,lt=lt+Math.imul(Qt,Nn)|0,tt=tt+Math.imul(Qt,ke)|0,tt=tt+Math.imul(Wt,Nn)|0,Z=Z+Math.imul(Wt,ke)|0;var Pr=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,lt=Math.imul(Oe,Ue),tt=Math.imul(Oe,mr),tt=tt+Math.imul(ur,Ue)|0,Z=Math.imul(ur,mr),lt=lt+Math.imul(Te,an)|0,tt=tt+Math.imul(Te,vn)|0,tt=tt+Math.imul(Se,an)|0,Z=Z+Math.imul(Se,vn)|0,lt=lt+Math.imul(Kt,An)|0,tt=tt+Math.imul(Kt,pn)|0,tt=tt+Math.imul(Zt,An)|0,Z=Z+Math.imul(Zt,pn)|0,lt=lt+Math.imul(bt,Nn)|0,tt=tt+Math.imul(bt,ke)|0,tt=tt+Math.imul(vt,Nn)|0,Z=Z+Math.imul(vt,ke)|0;var Sr=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,lt=Math.imul(Oe,an),tt=Math.imul(Oe,vn),tt=tt+Math.imul(ur,an)|0,Z=Math.imul(ur,vn),lt=lt+Math.imul(Te,An)|0,tt=tt+Math.imul(Te,pn)|0,tt=tt+Math.imul(Se,An)|0,Z=Z+Math.imul(Se,pn)|0,lt=lt+Math.imul(Kt,Nn)|0,tt=tt+Math.imul(Kt,ke)|0,tt=tt+Math.imul(Zt,Nn)|0,Z=Z+Math.imul(Zt,ke)|0;var gr=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(gr>>>26)|0,gr&=67108863,lt=Math.imul(Oe,An),tt=Math.imul(Oe,pn),tt=tt+Math.imul(ur,An)|0,Z=Math.imul(ur,pn),lt=lt+Math.imul(Te,Nn)|0,tt=tt+Math.imul(Te,ke)|0,tt=tt+Math.imul(Se,Nn)|0,Z=Z+Math.imul(Se,ke)|0;var dr=(ct+lt|0)+((tt&8191)<<13)|0;ct=(Z+(tt>>>13)|0)+(dr>>>26)|0,dr&=67108863,lt=Math.imul(Oe,Nn),tt=Math.imul(Oe,ke),tt=tt+Math.imul(ur,Nn)|0,Z=Math.imul(ur,ke);var Er=(ct+lt|0)+((tt&8191)<<13)|0;return ct=(Z+(tt>>>13)|0)+(Er>>>26)|0,Er&=67108863,rt[0]=ze,rt[1]=je,rt[2]=Ne,rt[3]=_r,rt[4]=Xr,rt[5]=rn,rt[6]=Br,rt[7]=_n,rt[8]=bn,rt[9]=Fn,rt[10]=on,rt[11]=Bn,rt[12]=ue,rt[13]=xe,rt[14]=Pr,rt[15]=Sr,rt[16]=gr,rt[17]=dr,rt[18]=Er,ct!==0&&(rt[19]=ct,N.length++),N};Math.imul||(T=S);function M(L,F,N){N.negative=F.negative^L.negative,N.length=L.length+F.length;for(var j=0,G=0,rt=0;rt<N.length-1;rt++){var ct=G;G=0;for(var lt=j&67108863,tt=Math.min(rt,F.length-1),Z=Math.max(0,rt-L.length+1);Z<=tt;Z++){var st=rt-Z,$=L.words[st]|0,Q=F.words[Z]|0,nt=$*Q,Y=nt&67108863;ct=ct+(nt/67108864|0)|0,Y=Y+lt|0,lt=Y&67108863,ct=ct+(Y>>>26)|0,G+=ct>>>26,ct&=67108863}N.words[rt]=lt,j=ct,ct=G}return j!==0?N.words[rt]=j:N.length--,N.strip()}function w(L,F,N){var j=new u;return j.mulp(L,F,N)}s.prototype.mulTo=function(L,F){var N,j=this.length+L.length;return this.length===10&&L.length===10?N=T(this,L,F):j<63?N=S(this,L,F):j<1024?N=M(this,L,F):N=w(this,L,F),N};function u(L,F){this.x=L,this.y=F}u.prototype.makeRBT=function(L){for(var F=new Array(L),N=s.prototype._countBits(L)-1,j=0;j<L;j++)F[j]=this.revBin(j,N,L);return F},u.prototype.revBin=function(L,F,N){if(L===0||L===N-1)return L;for(var j=0,G=0;G<F;G++)j|=(L&1)<<F-G-1,L>>=1;return j},u.prototype.permute=function(L,F,N,j,G,rt){for(var ct=0;ct<rt;ct++)j[ct]=F[L[ct]],G[ct]=N[L[ct]]},u.prototype.transform=function(L,F,N,j,G,rt){this.permute(rt,L,F,N,j,G);for(var ct=1;ct<G;ct<<=1)for(var lt=ct<<1,tt=Math.cos(2*Math.PI/lt),Z=Math.sin(2*Math.PI/lt),st=0;st<G;st+=lt)for(var $=tt,Q=Z,nt=0;nt<ct;nt++){var Y=N[st+nt],q=j[st+nt],ot=N[st+nt+ct],it=j[st+nt+ct],dt=$*ot-Q*it;it=$*it+Q*ot,ot=dt,N[st+nt]=Y+ot,j[st+nt]=q+it,N[st+nt+ct]=Y-ot,j[st+nt+ct]=q-it,nt!==lt&&(dt=tt*$-Z*Q,Q=tt*Q+Z*$,$=dt)}},u.prototype.guessLen13b=function(L,F){var N=Math.max(F,L)|1,j=N&1,G=0;for(N=N/2|0;N;N=N>>>1)G++;return 1<<G+1+j},u.prototype.conjugate=function(L,F,N){if(!(N<=1))for(var j=0;j<N/2;j++){var G=L[j];L[j]=L[N-j-1],L[N-j-1]=G,G=F[j],F[j]=-F[N-j-1],F[N-j-1]=-G}},u.prototype.normalize13b=function(L,F){for(var N=0,j=0;j<F/2;j++){var G=Math.round(L[2*j+1]/F)*8192+Math.round(L[2*j]/F)+N;L[j]=G&67108863,G<67108864?N=0:N=G/67108864|0}return L},u.prototype.convert13b=function(L,F,N,j){for(var G=0,rt=0;rt<F;rt++)G=G+(L[rt]|0),N[2*rt]=G&8191,G=G>>>13,N[2*rt+1]=G&8191,G=G>>>13;for(rt=2*F;rt<j;++rt)N[rt]=0;o(G===0),o((G&-8192)===0)},u.prototype.stub=function(L){for(var F=new Array(L),N=0;N<L;N++)F[N]=0;return F},u.prototype.mulp=function(L,F,N){var j=2*this.guessLen13b(L.length,F.length),G=this.makeRBT(j),rt=this.stub(j),ct=new Array(j),lt=new Array(j),tt=new Array(j),Z=new Array(j),st=new Array(j),$=new Array(j),Q=N.words;Q.length=j,this.convert13b(L.words,L.length,ct,j),this.convert13b(F.words,F.length,Z,j),this.transform(ct,rt,lt,tt,j,G),this.transform(Z,rt,st,$,j,G);for(var nt=0;nt<j;nt++){var Y=lt[nt]*st[nt]-tt[nt]*$[nt];tt[nt]=lt[nt]*$[nt]+tt[nt]*st[nt],lt[nt]=Y}return this.conjugate(lt,tt,j),this.transform(lt,tt,Q,rt,j,G),this.conjugate(Q,rt,j),this.normalize13b(Q,j),N.negative=L.negative^F.negative,N.length=L.length+F.length,N.strip()},s.prototype.mul=function(L){var F=new s(null);return F.words=new Array(this.length+L.length),this.mulTo(L,F)},s.prototype.mulf=function(L){var F=new s(null);return F.words=new Array(this.length+L.length),w(this,L,F)},s.prototype.imul=function(L){return this.clone().mulTo(L,this)},s.prototype.imuln=function(L){o(typeof L=="number"),o(L<67108864);for(var F=0,N=0;N<this.length;N++){var j=(this.words[N]|0)*L,G=(j&67108863)+(F&67108863);F>>=26,F+=j/67108864|0,F+=G>>>26,this.words[N]=G&67108863}return F!==0&&(this.words[N]=F,this.length++),this},s.prototype.muln=function(L){return this.clone().imuln(L)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(L){var F=b(L);if(F.length===0)return new s(1);for(var N=this,j=0;j<F.length&&F[j]===0;j++,N=N.sqr());if(++j<F.length)for(var G=N.sqr();j<F.length;j++,G=G.sqr())F[j]!==0&&(N=N.mul(G));return N},s.prototype.iushln=function(L){o(typeof L=="number"&&L>=0);var F=L%26,N=(L-F)/26,j=67108863>>>26-F<<26-F,G;if(F!==0){var rt=0;for(G=0;G<this.length;G++){var ct=this.words[G]&j,lt=(this.words[G]|0)-ct<<F;this.words[G]=lt|rt,rt=ct>>>26-F}rt&&(this.words[G]=rt,this.length++)}if(N!==0){for(G=this.length-1;G>=0;G--)this.words[G+N]=this.words[G];for(G=0;G<N;G++)this.words[G]=0;this.length+=N}return this.strip()},s.prototype.ishln=function(L){return o(this.negative===0),this.iushln(L)},s.prototype.iushrn=function(L,F,N){o(typeof L=="number"&&L>=0);var j;F?j=(F-F%26)/26:j=0;var G=L%26,rt=Math.min((L-G)/26,this.length),ct=67108863^67108863>>>G<<G,lt=N;if(j-=rt,j=Math.max(0,j),lt){for(var tt=0;tt<rt;tt++)lt.words[tt]=this.words[tt];lt.length=rt}if(rt!==0)if(this.length>rt)for(this.length-=rt,tt=0;tt<this.length;tt++)this.words[tt]=this.words[tt+rt];else this.words[0]=0,this.length=1;var Z=0;for(tt=this.length-1;tt>=0&&(Z!==0||tt>=j);tt--){var st=this.words[tt]|0;this.words[tt]=Z<<26-G|st>>>G,Z=st&ct}return lt&&Z!==0&&(lt.words[lt.length++]=Z),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(L,F,N){return o(this.negative===0),this.iushrn(L,F,N)},s.prototype.shln=function(L){return this.clone().ishln(L)},s.prototype.ushln=function(L){return this.clone().iushln(L)},s.prototype.shrn=function(L){return this.clone().ishrn(L)},s.prototype.ushrn=function(L){return this.clone().iushrn(L)},s.prototype.testn=function(L){o(typeof L=="number"&&L>=0);var F=L%26,N=(L-F)/26,j=1<<F;if(this.length<=N)return!1;var G=this.words[N];return!!(G&j)},s.prototype.imaskn=function(L){o(typeof L=="number"&&L>=0);var F=L%26,N=(L-F)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=N)return this;if(F!==0&&N++,this.length=Math.min(N,this.length),F!==0){var j=67108863^67108863>>>F<<F;this.words[this.length-1]&=j}return this.strip()},s.prototype.maskn=function(L){return this.clone().imaskn(L)},s.prototype.iaddn=function(L){return o(typeof L=="number"),o(L<67108864),L<0?this.isubn(-L):this.negative!==0?this.length===1&&(this.words[0]|0)<L?(this.words[0]=L-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(L),this.negative=1,this):this._iaddn(L)},s.prototype._iaddn=function(L){this.words[0]+=L;for(var F=0;F<this.length&&this.words[F]>=67108864;F++)this.words[F]-=67108864,F===this.length-1?this.words[F+1]=1:this.words[F+1]++;return this.length=Math.max(this.length,F+1),this},s.prototype.isubn=function(L){if(o(typeof L=="number"),o(L<67108864),L<0)return this.iaddn(-L);if(this.negative!==0)return this.negative=0,this.iaddn(L),this.negative=1,this;if(this.words[0]-=L,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var F=0;F<this.length&&this.words[F]<0;F++)this.words[F]+=67108864,this.words[F+1]-=1;return this.strip()},s.prototype.addn=function(L){return this.clone().iaddn(L)},s.prototype.subn=function(L){return this.clone().isubn(L)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(L,F,N){var j=L.length+N,G;this._expand(j);var rt,ct=0;for(G=0;G<L.length;G++){rt=(this.words[G+N]|0)+ct;var lt=(L.words[G]|0)*F;rt-=lt&67108863,ct=(rt>>26)-(lt/67108864|0),this.words[G+N]=rt&67108863}for(;G<this.length-N;G++)rt=(this.words[G+N]|0)+ct,ct=rt>>26,this.words[G+N]=rt&67108863;if(ct===0)return this.strip();for(o(ct===-1),ct=0,G=0;G<this.length;G++)rt=-(this.words[G]|0)+ct,ct=rt>>26,this.words[G]=rt&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(L,F){var N=this.length-L.length,j=this.clone(),G=L,rt=G.words[G.length-1]|0,ct=this._countBits(rt);N=26-ct,N!==0&&(G=G.ushln(N),j.iushln(N),rt=G.words[G.length-1]|0);var lt=j.length-G.length,tt;if(F!=="mod"){tt=new s(null),tt.length=lt+1,tt.words=new Array(tt.length);for(var Z=0;Z<tt.length;Z++)tt.words[Z]=0}var st=j.clone()._ishlnsubmul(G,1,lt);st.negative===0&&(j=st,tt&&(tt.words[lt]=1));for(var $=lt-1;$>=0;$--){var Q=(j.words[G.length+$]|0)*67108864+(j.words[G.length+$-1]|0);for(Q=Math.min(Q/rt|0,67108863),j._ishlnsubmul(G,Q,$);j.negative!==0;)Q--,j.negative=0,j._ishlnsubmul(G,1,$),j.isZero()||(j.negative^=1);tt&&(tt.words[$]=Q)}return tt&&tt.strip(),j.strip(),F!=="div"&&N!==0&&j.iushrn(N),{div:tt||null,mod:j}},s.prototype.divmod=function(L,F,N){if(o(!L.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var j,G,rt;return this.negative!==0&&L.negative===0?(rt=this.neg().divmod(L,F),F!=="mod"&&(j=rt.div.neg()),F!=="div"&&(G=rt.mod.neg(),N&&G.negative!==0&&G.iadd(L)),{div:j,mod:G}):this.negative===0&&L.negative!==0?(rt=this.divmod(L.neg(),F),F!=="mod"&&(j=rt.div.neg()),{div:j,mod:rt.mod}):this.negative&L.negative?(rt=this.neg().divmod(L.neg(),F),F!=="div"&&(G=rt.mod.neg(),N&&G.negative!==0&&G.isub(L)),{div:rt.div,mod:G}):L.length>this.length||this.cmp(L)<0?{div:new s(0),mod:this}:L.length===1?F==="div"?{div:this.divn(L.words[0]),mod:null}:F==="mod"?{div:null,mod:new s(this.modn(L.words[0]))}:{div:this.divn(L.words[0]),mod:new s(this.modn(L.words[0]))}:this._wordDiv(L,F)},s.prototype.div=function(L){return this.divmod(L,"div",!1).div},s.prototype.mod=function(L){return this.divmod(L,"mod",!1).mod},s.prototype.umod=function(L){return this.divmod(L,"mod",!0).mod},s.prototype.divRound=function(L){var F=this.divmod(L);if(F.mod.isZero())return F.div;var N=F.div.negative!==0?F.mod.isub(L):F.mod,j=L.ushrn(1),G=L.andln(1),rt=N.cmp(j);return rt<0||G===1&&rt===0?F.div:F.div.negative!==0?F.div.isubn(1):F.div.iaddn(1)},s.prototype.modn=function(L){o(L<=67108863);for(var F=67108864%L,N=0,j=this.length-1;j>=0;j--)N=(F*N+(this.words[j]|0))%L;return N},s.prototype.idivn=function(L){o(L<=67108863);for(var F=0,N=this.length-1;N>=0;N--){var j=(this.words[N]|0)+F*67108864;this.words[N]=j/L|0,F=j%L}return this.strip()},s.prototype.divn=function(L){return this.clone().idivn(L)},s.prototype.egcd=function(L){o(L.negative===0),o(!L.isZero());var F=this,N=L.clone();F.negative!==0?F=F.umod(L):F=F.clone();for(var j=new s(1),G=new s(0),rt=new s(0),ct=new s(1),lt=0;F.isEven()&&N.isEven();)F.iushrn(1),N.iushrn(1),++lt;for(var tt=N.clone(),Z=F.clone();!F.isZero();){for(var st=0,$=1;!(F.words[0]&$)&&st<26;++st,$<<=1);if(st>0)for(F.iushrn(st);st-- >0;)(j.isOdd()||G.isOdd())&&(j.iadd(tt),G.isub(Z)),j.iushrn(1),G.iushrn(1);for(var Q=0,nt=1;!(N.words[0]&nt)&&Q<26;++Q,nt<<=1);if(Q>0)for(N.iushrn(Q);Q-- >0;)(rt.isOdd()||ct.isOdd())&&(rt.iadd(tt),ct.isub(Z)),rt.iushrn(1),ct.iushrn(1);F.cmp(N)>=0?(F.isub(N),j.isub(rt),G.isub(ct)):(N.isub(F),rt.isub(j),ct.isub(G))}return{a:rt,b:ct,gcd:N.iushln(lt)}},s.prototype._invmp=function(L){o(L.negative===0),o(!L.isZero());var F=this,N=L.clone();F.negative!==0?F=F.umod(L):F=F.clone();for(var j=new s(1),G=new s(0),rt=N.clone();F.cmpn(1)>0&&N.cmpn(1)>0;){for(var ct=0,lt=1;!(F.words[0]<)&&ct<26;++ct,lt<<=1);if(ct>0)for(F.iushrn(ct);ct-- >0;)j.isOdd()&&j.iadd(rt),j.iushrn(1);for(var tt=0,Z=1;!(N.words[0]&Z)&&tt<26;++tt,Z<<=1);if(tt>0)for(N.iushrn(tt);tt-- >0;)G.isOdd()&&G.iadd(rt),G.iushrn(1);F.cmp(N)>=0?(F.isub(N),j.isub(G)):(N.isub(F),G.isub(j))}var st;return F.cmpn(1)===0?st=j:st=G,st.cmpn(0)<0&&st.iadd(L),st},s.prototype.gcd=function(L){if(this.isZero())return L.abs();if(L.isZero())return this.abs();var F=this.clone(),N=L.clone();F.negative=0,N.negative=0;for(var j=0;F.isEven()&&N.isEven();j++)F.iushrn(1),N.iushrn(1);do{for(;F.isEven();)F.iushrn(1);for(;N.isEven();)N.iushrn(1);var G=F.cmp(N);if(G<0){var rt=F;F=N,N=rt}else if(G===0||N.cmpn(1)===0)break;F.isub(N)}while(!0);return N.iushln(j)},s.prototype.invm=function(L){return this.egcd(L).a.umod(L)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(L){return this.words[0]&L},s.prototype.bincn=function(L){o(typeof L=="number");var F=L%26,N=(L-F)/26,j=1<<F;if(this.length<=N)return this._expand(N+1),this.words[N]|=j,this;for(var G=j,rt=N;G!==0&&rt<this.length;rt++){var ct=this.words[rt]|0;ct+=G,G=ct>>>26,ct&=67108863,this.words[rt]=ct}return G!==0&&(this.words[rt]=G,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(L){var F=L<0;if(this.negative!==0&&!F)return-1;if(this.negative===0&&F)return 1;this.strip();var N;if(this.length>1)N=1;else{F&&(L=-L),o(L<=67108863,"Number is too big");var j=this.words[0]|0;N=j===L?0:j<L?-1:1}return this.negative!==0?-N|0:N},s.prototype.cmp=function(L){if(this.negative!==0&&L.negative===0)return-1;if(this.negative===0&&L.negative!==0)return 1;var F=this.ucmp(L);return this.negative!==0?-F|0:F},s.prototype.ucmp=function(L){if(this.length>L.length)return 1;if(this.length<L.length)return-1;for(var F=0,N=this.length-1;N>=0;N--){var j=this.words[N]|0,G=L.words[N]|0;if(j!==G){j<G?F=-1:j>G&&(F=1);break}}return F},s.prototype.gtn=function(L){return this.cmpn(L)===1},s.prototype.gt=function(L){return this.cmp(L)===1},s.prototype.gten=function(L){return this.cmpn(L)>=0},s.prototype.gte=function(L){return this.cmp(L)>=0},s.prototype.ltn=function(L){return this.cmpn(L)===-1},s.prototype.lt=function(L){return this.cmp(L)===-1},s.prototype.lten=function(L){return this.cmpn(L)<=0},s.prototype.lte=function(L){return this.cmp(L)<=0},s.prototype.eqn=function(L){return this.cmpn(L)===0},s.prototype.eq=function(L){return this.cmp(L)===0},s.red=function(L){return new B(L)},s.prototype.toRed=function(L){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),L.convertTo(this)._forceRed(L)},s.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(L){return this.red=L,this},s.prototype.forceRed=function(L){return o(!this.red,"Already a number in reduction context"),this._forceRed(L)},s.prototype.redAdd=function(L){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,L)},s.prototype.redIAdd=function(L){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,L)},s.prototype.redSub=function(L){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,L)},s.prototype.redISub=function(L){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,L)},s.prototype.redShl=function(L){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,L)},s.prototype.redMul=function(L){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.mul(this,L)},s.prototype.redIMul=function(L){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.imul(this,L)},s.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(L){return o(this.red&&!L.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,L)};var f={k256:null,p224:null,p192:null,p25519:null};function k(L,F){this.name=L,this.p=new s(F,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}k.prototype._tmp=function(){var L=new s(null);return L.words=new Array(Math.ceil(this.n/13)),L},k.prototype.ireduce=function(L){var F=L,N;do this.split(F,this.tmp),F=this.imulK(F),F=F.iadd(this.tmp),N=F.bitLength();while(N>this.n);var j=N<this.n?-1:F.ucmp(this.p);return j===0?(F.words[0]=0,F.length=1):j>0?F.isub(this.p):F.strip!==void 0?F.strip():F._strip(),F},k.prototype.split=function(L,F){L.iushrn(this.n,0,F)},k.prototype.imulK=function(L){return L.imul(this.k)};function _(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(_,k),_.prototype.split=function(L,F){for(var N=4194303,j=Math.min(L.length,9),G=0;G<j;G++)F.words[G]=L.words[G];if(F.length=j,L.length<=9){L.words[0]=0,L.length=1;return}var rt=L.words[9];for(F.words[F.length++]=rt&N,G=10;G<L.length;G++){var ct=L.words[G]|0;L.words[G-10]=(ct&N)<<4|rt>>>22,rt=ct}rt>>>=22,L.words[G-10]=rt,rt===0&&L.length>10?L.length-=10:L.length-=9},_.prototype.imulK=function(L){L.words[L.length]=0,L.words[L.length+1]=0,L.length+=2;for(var F=0,N=0;N<L.length;N++){var j=L.words[N]|0;F+=j*977,L.words[N]=F&67108863,F=j*64+(F/67108864|0)}return L.words[L.length-1]===0&&(L.length--,L.words[L.length-1]===0&&L.length--),L};function D(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(D,k);function I(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(I,k);function O(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(O,k),O.prototype.imulK=function(L){for(var F=0,N=0;N<L.length;N++){var j=(L.words[N]|0)*19+F,G=j&67108863;j>>>=26,L.words[N]=G,F=j}return F!==0&&(L.words[L.length++]=F),L},s._prime=function(L){if(f[L])return f[L];var F;if(L==="k256")F=new _;else if(L==="p224")F=new D;else if(L==="p192")F=new I;else if(L==="p25519")F=new O;else throw new Error("Unknown prime "+L);return f[L]=F,F};function B(L){if(typeof L=="string"){var F=s._prime(L);this.m=F.p,this.prime=F}else o(L.gtn(1),"modulus must be greater than 1"),this.m=L,this.prime=null}B.prototype._verify1=function(L){o(L.negative===0,"red works only with positives"),o(L.red,"red works only with red numbers")},B.prototype._verify2=function(L,F){o((L.negative|F.negative)===0,"red works only with positives"),o(L.red&&L.red===F.red,"red works only with red numbers")},B.prototype.imod=function(L){return this.prime?this.prime.ireduce(L)._forceRed(this):L.umod(this.m)._forceRed(this)},B.prototype.neg=function(L){return L.isZero()?L.clone():this.m.sub(L)._forceRed(this)},B.prototype.add=function(L,F){this._verify2(L,F);var N=L.add(F);return N.cmp(this.m)>=0&&N.isub(this.m),N._forceRed(this)},B.prototype.iadd=function(L,F){this._verify2(L,F);var N=L.iadd(F);return N.cmp(this.m)>=0&&N.isub(this.m),N},B.prototype.sub=function(L,F){this._verify2(L,F);var N=L.sub(F);return N.cmpn(0)<0&&N.iadd(this.m),N._forceRed(this)},B.prototype.isub=function(L,F){this._verify2(L,F);var N=L.isub(F);return N.cmpn(0)<0&&N.iadd(this.m),N},B.prototype.shl=function(L,F){return this._verify1(L),this.imod(L.ushln(F))},B.prototype.imul=function(L,F){return this._verify2(L,F),this.imod(L.imul(F))},B.prototype.mul=function(L,F){return this._verify2(L,F),this.imod(L.mul(F))},B.prototype.isqr=function(L){return this.imul(L,L.clone())},B.prototype.sqr=function(L){return this.mul(L,L)},B.prototype.sqrt=function(L){if(L.isZero())return L.clone();var F=this.m.andln(3);if(o(F%2===1),F===3){var N=this.m.add(new s(1)).iushrn(2);return this.pow(L,N)}for(var j=this.m.subn(1),G=0;!j.isZero()&&j.andln(1)===0;)G++,j.iushrn(1);o(!j.isZero());var rt=new s(1).toRed(this),ct=rt.redNeg(),lt=this.m.subn(1).iushrn(1),tt=this.m.bitLength();for(tt=new s(2*tt*tt).toRed(this);this.pow(tt,lt).cmp(ct)!==0;)tt.redIAdd(ct);for(var Z=this.pow(tt,j),st=this.pow(L,j.addn(1).iushrn(1)),$=this.pow(L,j),Q=G;$.cmp(rt)!==0;){for(var nt=$,Y=0;nt.cmp(rt)!==0;Y++)nt=nt.redSqr();o(Y<Q);var q=this.pow(Z,new s(1).iushln(Q-Y-1));st=st.redMul(q),Z=q.redSqr(),$=$.redMul(Z),Q=Y}return st},B.prototype.invm=function(L){var F=L._invmp(this.m);return F.negative!==0?(F.negative=0,this.imod(F).redNeg()):this.imod(F)},B.prototype.pow=function(L,F){if(F.isZero())return new s(1).toRed(this);if(F.cmpn(1)===0)return L.clone();var N=4,j=new Array(1<<N);j[0]=new s(1).toRed(this),j[1]=L;for(var G=2;G<j.length;G++)j[G]=this.mul(j[G-1],L);var rt=j[0],ct=0,lt=0,tt=F.bitLength()%26;for(tt===0&&(tt=26),G=F.length-1;G>=0;G--){for(var Z=F.words[G],st=tt-1;st>=0;st--){var $=Z>>st&1;if(rt!==j[0]&&(rt=this.sqr(rt)),$===0&&ct===0){lt=0;continue}ct<<=1,ct|=$,lt++,!(lt!==N&&(G!==0||st!==0))&&(rt=this.mul(rt,j[ct]),lt=0,ct=0)}tt=26}return rt},B.prototype.convertTo=function(L){var F=L.umod(this.m);return F===L?F.clone():F},B.prototype.convertFrom=function(L){var F=L.clone();return F.red=null,F},s.mont=function(L){return new R(L)};function R(L){B.call(this,L),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(R,B),R.prototype.convertTo=function(L){return this.imod(L.ushln(this.shift))},R.prototype.convertFrom=function(L){var F=this.imod(L.mul(this.rinv));return F.red=null,F},R.prototype.imul=function(L,F){if(L.isZero()||F.isZero())return L.words[0]=0,L.length=1,L;var N=L.imul(F),j=N.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=N.isub(j).iushrn(this.shift),rt=G;return G.cmp(this.m)>=0?rt=G.isub(this.m):G.cmpn(0)<0&&(rt=G.iadd(this.m)),rt._forceRed(this)},R.prototype.mul=function(L,F){if(L.isZero()||F.isZero())return new s(0)._forceRed(this);var N=L.mul(F),j=N.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=N.isub(j).iushrn(this.shift),rt=G;return G.cmp(this.m)>=0?rt=G.isub(this.m):G.cmpn(0)<0&&(rt=G.iadd(this.m)),rt._forceRed(this)},R.prototype.invm=function(L){var F=this.imod(L._invmp(this.m).mul(this.r2));return F._forceRed(this)}}(t,this)},6204:function(t){t.exports=e;function e(r){var i,n,o,a=r.length,s=0;for(i=0;i<a;++i)s+=r[i].length;var h=new Array(s),v=0;for(i=0;i<a;++i){var m=r[i],p=m.length;for(n=0;n<p;++n){var y=h[v++]=new Array(p-1),l=0;for(o=0;o<p;++o)o!==n&&(y[l++]=m[o]);if(n&1){var x=y[1];y[1]=y[0],y[0]=x}}}return h}},6867:function(t,e,r){t.exports=l;var i=r(1888),n=r(855),o=r(7150);function a(x,b){for(var S=0;S<x;++S)if(!(b[S]<=b[S+x]))return!0;return!1}function s(x,b,S,T){for(var M=0,w=0,u=0,f=x.length;u<f;++u){var k=x[u];if(!a(b,k)){for(var _=0;_<2*b;++_)S[M++]=k[_];T[w++]=u}}return w}function h(x,b,S,T){var M=x.length,w=b.length;if(!(M<=0||w<=0)){var u=x[0].length>>>1;if(!(u<=0)){var f,k=i.mallocDouble(2*u*M),_=i.mallocInt32(M);if(M=s(x,u,k,_),M>0){if(u===1&&T)n.init(M),f=n.sweepComplete(u,S,0,M,k,_,0,M,k,_);else{var D=i.mallocDouble(2*u*w),I=i.mallocInt32(w);w=s(b,u,D,I),w>0&&(n.init(M+w),u===1?f=n.sweepBipartite(u,S,0,M,k,_,0,w,D,I):f=o(u,S,T,M,k,_,w,D,I),i.free(D),i.free(I))}i.free(k),i.free(_)}return f}}}var v;function m(x,b){v.push([x,b])}function p(x){return v=[],h(x,x,m,!0),v}function y(x,b){return v=[],h(x,b,m,!1),v}function l(x,b,S){switch(arguments.length){case 1:return p(x);case 2:return typeof b=="function"?h(x,x,b,!0):y(x,b);case 3:return h(x,b,S,!1);default:throw new Error("box-intersect: Invalid arguments")}}},2455:function(t,e){function r(){function o(h,v,m,p,y,l,x,b,S,T,M){for(var w=2*h,u=p,f=w*p;u<y;++u,f+=w){var k=l[v+f],_=l[v+f+h],D=x[u];t:for(var I=b,O=w*b;I<S;++I,O+=w){var B=T[v+O],R=T[v+O+h],L=M[I];if(!(R<k||_<B)){for(var F=v+1;F<h;++F){var N=l[F+f],j=l[F+h+f],G=T[F+O],rt=T[F+h+O];if(j<G||rt<N)continue t}var ct=m(D,L);if(ct!==void 0)return ct}}}}function a(h,v,m,p,y,l,x,b,S,T,M){for(var w=2*h,u=b,f=w*b;u<S;++u,f+=w){var k=T[v+f],_=T[v+f+h],D=M[u];t:for(var I=p,O=w*p;I<y;++I,O+=w){var B=l[v+O],R=l[v+O+h],L=x[I];if(!(_<B||R<k)){for(var F=v+1;F<h;++F){var N=l[F+O],j=l[F+h+O],G=T[F+f],rt=T[F+h+f];if(j<G||rt<N)continue t}var ct=m(L,D);if(ct!==void 0)return ct}}}}function s(h,v,m,p,y,l,x,b,S,T,M){return y-p>S-b?o(h,v,m,p,y,l,x,b,S,T,M):a(h,v,m,p,y,l,x,b,S,T,M)}return s}function i(){function o(m,p,y,l,x,b,S,T,M,w,u){for(var f=2*m,k=l,_=f*l;k<x;++k,_+=f){var D=b[p+_],I=b[p+_+m],O=S[k];t:for(var B=T,R=f*T;B<M;++B,R+=f){var L=w[p+R],F=u[B];if(!(L<=D||I<L)){for(var N=p+1;N<m;++N){var j=b[N+_],G=b[N+m+_],rt=w[N+R],ct=w[N+m+R];if(G<rt||ct<j)continue t}var lt=y(F,O);if(lt!==void 0)return lt}}}}function a(m,p,y,l,x,b,S,T,M,w,u){for(var f=2*m,k=l,_=f*l;k<x;++k,_+=f){var D=b[p+_],I=b[p+_+m],O=S[k];t:for(var B=T,R=f*T;B<M;++B,R+=f){var L=w[p+R],F=u[B];if(!(L<D||I<L)){for(var N=p+1;N<m;++N){var j=b[N+_],G=b[N+m+_],rt=w[N+R],ct=w[N+m+R];if(G<rt||ct<j)continue t}var lt=y(O,F);if(lt!==void 0)return lt}}}}function s(m,p,y,l,x,b,S,T,M,w,u){for(var f=2*m,k=T,_=f*T;k<M;++k,_+=f){var D=w[p+_],I=u[k];t:for(var O=l,B=f*l;O<x;++O,B+=f){var R=b[p+B],L=b[p+B+m],F=S[O];if(!(D<=R||L<D)){for(var N=p+1;N<m;++N){var j=b[N+B],G=b[N+m+B],rt=w[N+_],ct=w[N+m+_];if(G<rt||ct<j)continue t}var lt=y(I,F);if(lt!==void 0)return lt}}}}function h(m,p,y,l,x,b,S,T,M,w,u){for(var f=2*m,k=T,_=f*T;k<M;++k,_+=f){var D=w[p+_],I=u[k];t:for(var O=l,B=f*l;O<x;++O,B+=f){var R=b[p+B],L=b[p+B+m],F=S[O];if(!(D<R||L<D)){for(var N=p+1;N<m;++N){var j=b[N+B],G=b[N+m+B],rt=w[N+_],ct=w[N+m+_];if(G<rt||ct<j)continue t}var lt=y(F,I);if(lt!==void 0)return lt}}}}function v(m,p,y,l,x,b,S,T,M,w,u,f){return b-x>w-M?l?o(m,p,y,x,b,S,T,M,w,u,f):a(m,p,y,x,b,S,T,M,w,u,f):l?s(m,p,y,x,b,S,T,M,w,u,f):h(m,p,y,x,b,S,T,M,w,u,f)}return v}function n(o){return o?r():i()}e.partial=n(!1),e.full=n(!0)},7150:function(t,e,r){t.exports=L;var i=r(1888),n=r(8828),o=r(2455),a=o.partial,s=o.full,h=r(855),v=r(3545),m=r(8105),p=128,y=1<<22,l=1<<22,x=m("!(lo>=p0)&&!(p1>=hi)"),b=m("lo===p0"),S=m("lo<p0"),T=m("hi<=p0"),M=m("lo<=p0&&p0<=hi"),w=m("lo<p0&&p0<=hi"),u=6,f=2,k=1024,_=i.mallocInt32(k),D=i.mallocDouble(k);function I(F,N){var j=8*n.log2(N+1)*(F+1)|0,G=n.nextPow2(u*j);_.length<G&&(i.free(_),_=i.mallocInt32(G));var rt=n.nextPow2(f*j);D.length<rt&&(i.free(D),D=i.mallocDouble(rt))}function O(F,N,j,G,rt,ct,lt,tt,Z){var st=u*F;_[st]=N,_[st+1]=j,_[st+2]=G,_[st+3]=rt,_[st+4]=ct,_[st+5]=lt;var $=f*F;D[$]=tt,D[$+1]=Z}function B(F,N,j,G,rt,ct,lt,tt,Z,st,$){var Q=2*F,nt=Z*Q,Y=st[nt+N];t:for(var q=rt,ot=rt*Q;q<ct;++q,ot+=Q){var it=lt[ot+N],dt=lt[ot+N+F];if(!(Y<it||dt<Y)&&!(G&&Y===it)){for(var wt=tt[q],xt=N+1;xt<F;++xt){var it=lt[ot+xt],dt=lt[ot+xt+F],Ft=st[nt+xt],Et=st[nt+xt+F];if(dt<Ft||Et<it)continue t}var Nt;if(G?Nt=j($,wt):Nt=j(wt,$),Nt!==void 0)return Nt}}}function R(F,N,j,G,rt,ct,lt,tt,Z,st){var $=2*F,Q=tt*$,nt=Z[Q+N];t:for(var Y=G,q=G*$;Y<rt;++Y,q+=$){var ot=lt[Y];if(ot!==st){var it=ct[q+N],dt=ct[q+N+F];if(!(nt<it||dt<nt)){for(var wt=N+1;wt<F;++wt){var it=ct[q+wt],dt=ct[q+wt+F],xt=Z[Q+wt],Ft=Z[Q+wt+F];if(dt<xt||Ft<it)continue t}var Et=j(ot,st);if(Et!==void 0)return Et}}}}function L(F,N,j,G,rt,ct,lt,tt,Z){I(F,G+lt);var st=0,$=2*F,Q;for(O(st++,0,0,G,0,lt,j?16:0,-1/0,1/0),j||O(st++,0,0,lt,0,G,1,-1/0,1/0);st>0;){st-=1;var nt=st*u,Y=_[nt],q=_[nt+1],ot=_[nt+2],it=_[nt+3],dt=_[nt+4],wt=_[nt+5],xt=st*f,Ft=D[xt],Et=D[xt+1],Nt=wt&1,te=!!(wt&16),Jt=rt,Qt=ct,Wt=tt,gt=Z;if(Nt&&(Jt=tt,Qt=Z,Wt=rt,gt=ct),!(wt&2&&(ot=S(F,Y,q,ot,Jt,Qt,Et),q>=ot))&&!(wt&4&&(q=T(F,Y,q,ot,Jt,Qt,Ft),q>=ot))){var bt=ot-q,vt=dt-it;if(te){if(F*bt*(bt+vt)<l){if(Q=h.scanComplete(F,Y,N,q,ot,Jt,Qt,it,dt,Wt,gt),Q!==void 0)return Q;continue}}else if(F*Math.min(bt,vt)<p){if(Q=a(F,Y,N,Nt,q,ot,Jt,Qt,it,dt,Wt,gt),Q!==void 0)return Q;continue}else if(F*bt*vt<y){if(Q=h.scanBipartite(F,Y,N,Nt,q,ot,Jt,Qt,it,dt,Wt,gt),Q!==void 0)return Q;continue}var Ut=x(F,Y,q,ot,Jt,Qt,Ft,Et);if(q<Ut)if(F*(Ut-q)<p){if(Q=s(F,Y+1,N,q,Ut,Jt,Qt,it,dt,Wt,gt),Q!==void 0)return Q}else if(Y===F-2){if(Nt?Q=h.sweepBipartite(F,N,it,dt,Wt,gt,q,Ut,Jt,Qt):Q=h.sweepBipartite(F,N,q,Ut,Jt,Qt,it,dt,Wt,gt),Q!==void 0)return Q}else O(st++,Y+1,q,Ut,it,dt,Nt,-1/0,1/0),O(st++,Y+1,it,dt,q,Ut,Nt^1,-1/0,1/0);if(Ut<ot){var Kt=v(F,Y,it,dt,Wt,gt),Zt=Wt[$*Kt+Y],le=b(F,Y,Kt,dt,Wt,gt,Zt);if(le<dt&&O(st++,Y,Ut,ot,le,dt,(Nt|4)+(te?16:0),Zt,Et),it<Kt&&O(st++,Y,Ut,ot,it,Kt,(Nt|2)+(te?16:0),Ft,Zt),Kt+1===le){if(te?Q=R(F,Y,N,Ut,ot,Jt,Qt,Kt,Wt,gt[Kt]):Q=B(F,Y,N,Nt,Ut,ot,Jt,Qt,Kt,Wt,gt[Kt]),Q!==void 0)return Q}else if(Kt<le){var Te;if(te){if(Te=M(F,Y,Ut,ot,Jt,Qt,Zt),Ut<Te){var Se=b(F,Y,Ut,Te,Jt,Qt,Zt);if(Y===F-2){if(Ut<Se&&(Q=h.sweepComplete(F,N,Ut,Se,Jt,Qt,Kt,le,Wt,gt),Q!==void 0)||Se<Te&&(Q=h.sweepBipartite(F,N,Se,Te,Jt,Qt,Kt,le,Wt,gt),Q!==void 0))return Q}else Ut<Se&&O(st++,Y+1,Ut,Se,Kt,le,16,-1/0,1/0),Se<Te&&(O(st++,Y+1,Se,Te,Kt,le,0,-1/0,1/0),O(st++,Y+1,Kt,le,Se,Te,1,-1/0,1/0))}}else Nt?Te=w(F,Y,Ut,ot,Jt,Qt,Zt):Te=M(F,Y,Ut,ot,Jt,Qt,Zt),Ut<Te&&(Y===F-2?Nt?Q=h.sweepBipartite(F,N,Kt,le,Wt,gt,Ut,Te,Jt,Qt):Q=h.sweepBipartite(F,N,Ut,Te,Jt,Qt,Kt,le,Wt,gt):(O(st++,Y+1,Ut,Te,Kt,le,Nt,-1/0,1/0),O(st++,Y+1,Kt,le,Ut,Te,Nt^1,-1/0,1/0)))}}}}}},3545:function(t,e,r){t.exports=s;var i=r(8105),n=i("lo<p0"),o=8;function a(h,v,m,p,y,l){for(var x=2*h,b=x*(m+1)+v,S=m+1;S<p;++S,b+=x)for(var T=y[b],M=S,w=x*(S-1);M>m&&y[w+v]>T;--M,w-=x){for(var u=w,f=w+x,k=0;k<x;++k,++u,++f){var _=y[u];y[u]=y[f],y[f]=_}var D=l[M];l[M]=l[M-1],l[M-1]=D}}function s(h,v,m,p,y,l){if(p<=m+1)return m;for(var x=m,b=p,S=p+m>>>1,T=2*h,M=S,w=y[T*S+v];x<b;){if(b-x<o){a(h,v,x,b,y,l),w=y[T*S+v];break}var u=b-x,f=Math.random()*u+x|0,k=y[T*f+v],_=Math.random()*u+x|0,D=y[T*_+v],I=Math.random()*u+x|0,O=y[T*I+v];k<=D?O>=D?(M=_,w=D):k>=O?(M=f,w=k):(M=I,w=O):D>=O?(M=_,w=D):O>=k?(M=f,w=k):(M=I,w=O);for(var B=T*(b-1),R=T*M,L=0;L<T;++L,++B,++R){var F=y[B];y[B]=y[R],y[R]=F}var N=l[b-1];l[b-1]=l[M],l[M]=N,M=n(h,v,x,b-1,y,l,w);for(var B=T*(b-1),R=T*M,L=0;L<T;++L,++B,++R){var F=y[B];y[B]=y[R],y[R]=F}var N=l[b-1];if(l[b-1]=l[M],l[M]=N,S<M){for(b=M-1;x<b&&y[T*(b-1)+v]===w;)b-=1;b+=1}else if(M<S)for(x=M+1;x<b&&y[T*x+v]===w;)x+=1;else break}return n(h,v,m,S,y,l,y[T*S+v])}},8105:function(t){t.exports=r;var e={"lo===p0":i,"lo<p0":n,"lo<=p0":o,"hi<=p0":a,"lo<p0&&p0<=hi":h,"lo<=p0&&p0<=hi":s,"!(lo>=p0)&&!(p1>=hi)":v};function r(m){return e[m]}function i(m,p,y,l,x,b,S){for(var T=2*m,M=T*y,w=M,u=y,f=p,k=m+p,_=y;l>_;++_,M+=T){var D=x[M+f];if(D===S)if(u===_)u+=1,w+=T;else{for(var I=0;T>I;++I){var O=x[M+I];x[M+I]=x[w],x[w++]=O}var B=b[_];b[_]=b[u],b[u++]=B}}return u}function n(m,p,y,l,x,b,S){for(var T=2*m,M=T*y,w=M,u=y,f=p,k=m+p,_=y;l>_;++_,M+=T){var D=x[M+f];if(D<S)if(u===_)u+=1,w+=T;else{for(var I=0;T>I;++I){var O=x[M+I];x[M+I]=x[w],x[w++]=O}var B=b[_];b[_]=b[u],b[u++]=B}}return u}function o(m,p,y,l,x,b,S){for(var T=2*m,M=T*y,w=M,u=y,f=p,k=m+p,_=y;l>_;++_,M+=T){var D=x[M+k];if(D<=S)if(u===_)u+=1,w+=T;else{for(var I=0;T>I;++I){var O=x[M+I];x[M+I]=x[w],x[w++]=O}var B=b[_];b[_]=b[u],b[u++]=B}}return u}function a(m,p,y,l,x,b,S){for(var T=2*m,M=T*y,w=M,u=y,f=p,k=m+p,_=y;l>_;++_,M+=T){var D=x[M+k];if(D<=S)if(u===_)u+=1,w+=T;else{for(var I=0;T>I;++I){var O=x[M+I];x[M+I]=x[w],x[w++]=O}var B=b[_];b[_]=b[u],b[u++]=B}}return u}function s(m,p,y,l,x,b,S){for(var T=2*m,M=T*y,w=M,u=y,f=p,k=m+p,_=y;l>_;++_,M+=T){var D=x[M+f],I=x[M+k];if(D<=S&&S<=I)if(u===_)u+=1,w+=T;else{for(var O=0;T>O;++O){var B=x[M+O];x[M+O]=x[w],x[w++]=B}var R=b[_];b[_]=b[u],b[u++]=R}}return u}function h(m,p,y,l,x,b,S){for(var T=2*m,M=T*y,w=M,u=y,f=p,k=m+p,_=y;l>_;++_,M+=T){var D=x[M+f],I=x[M+k];if(D<S&&S<=I)if(u===_)u+=1,w+=T;else{for(var O=0;T>O;++O){var B=x[M+O];x[M+O]=x[w],x[w++]=B}var R=b[_];b[_]=b[u],b[u++]=R}}return u}function v(m,p,y,l,x,b,S,T){for(var M=2*m,w=M*y,u=w,f=y,k=p,_=m+p,D=y;l>D;++D,w+=M){var I=x[w+k],O=x[w+_];if(!(I>=S)&&!(T>=O))if(f===D)f+=1,u+=M;else{for(var B=0;M>B;++B){var R=x[w+B];x[w+B]=x[u],x[u++]=R}var L=b[D];b[D]=b[f],b[f++]=L}}return f}},4192:function(t){t.exports=r;var e=32;function r(p,y){y<=4*e?i(0,y-1,p):m(0,y-1,p)}function i(p,y,l){for(var x=2*(p+1),b=p+1;b<=y;++b){for(var S=l[x++],T=l[x++],M=b,w=x-2;M-- >p;){var u=l[w-2],f=l[w-1];if(u<S||u===S&&f<T)break;l[w]=u,l[w+1]=f,w-=2}l[w]=S,l[w+1]=T}}function n(p,y,l){p*=2,y*=2;var x=l[p],b=l[p+1];l[p]=l[y],l[p+1]=l[y+1],l[y]=x,l[y+1]=b}function o(p,y,l){p*=2,y*=2,l[p]=l[y],l[p+1]=l[y+1]}function a(p,y,l,x){p*=2,y*=2,l*=2;var b=x[p],S=x[p+1];x[p]=x[y],x[p+1]=x[y+1],x[y]=x[l],x[y+1]=x[l+1],x[l]=b,x[l+1]=S}function s(p,y,l,x,b){p*=2,y*=2,b[p]=b[y],b[y]=l,b[p+1]=b[y+1],b[y+1]=x}function h(p,y,l){p*=2,y*=2;var x=l[p],b=l[y];return x<b?!1:x===b?l[p+1]>l[y+1]:!0}function v(p,y,l,x){p*=2;var b=x[p];return b<y?!0:b===y?x[p+1]<l:!1}function m(p,y,l){var x=(y-p+1)/6|0,b=p+x,S=y-x,T=p+y>>1,M=T-x,w=T+x,u=b,f=M,k=T,_=w,D=S,I=p+1,O=y-1,B=0;h(u,f,l)&&(B=u,u=f,f=B),h(_,D,l)&&(B=_,_=D,D=B),h(u,k,l)&&(B=u,u=k,k=B),h(f,k,l)&&(B=f,f=k,k=B),h(u,_,l)&&(B=u,u=_,_=B),h(k,_,l)&&(B=k,k=_,_=B),h(f,D,l)&&(B=f,f=D,D=B),h(f,k,l)&&(B=f,f=k,k=B),h(_,D,l)&&(B=_,_=D,D=B);for(var R=l[2*f],L=l[2*f+1],F=l[2*_],N=l[2*_+1],j=2*u,G=2*k,rt=2*D,ct=2*b,lt=2*T,tt=2*S,Z=0;Z<2;++Z){var st=l[j+Z],$=l[G+Z],Q=l[rt+Z];l[ct+Z]=st,l[lt+Z]=$,l[tt+Z]=Q}o(M,p,l),o(w,y,l);for(var nt=I;nt<=O;++nt)if(v(nt,R,L,l))nt!==I&&n(nt,I,l),++I;else if(!v(nt,F,N,l))for(;;)if(v(O,F,N,l)){v(O,R,L,l)?(a(nt,I,O,l),++I,--O):(n(nt,O,l),--O);break}else{if(--O<nt)break;continue}s(p,I-1,R,L,l),s(y,O+1,F,N,l),I-2-p<=e?i(p,I-2,l):m(p,I-2,l),y-(O+2)<=e?i(O+2,y,l):m(O+2,y,l),O-I<=e?i(I,O,l):m(I,O,l)}},855:function(t,e,r){t.exports={init:b,sweepBipartite:M,sweepComplete:w,scanBipartite:u,scanComplete:f};var i=r(1888),n=r(8828),o=r(4192),a=1<<28,s=1024,h=i.mallocInt32(s),v=i.mallocInt32(s),m=i.mallocInt32(s),p=i.mallocInt32(s),y=i.mallocInt32(s),l=i.mallocInt32(s),x=i.mallocDouble(s*8);function b(k){var _=n.nextPow2(k);h.length<_&&(i.free(h),h=i.mallocInt32(_)),v.length<_&&(i.free(v),v=i.mallocInt32(_)),m.length<_&&(i.free(m),m=i.mallocInt32(_)),p.length<_&&(i.free(p),p=i.mallocInt32(_)),y.length<_&&(i.free(y),y=i.mallocInt32(_)),l.length<_&&(i.free(l),l=i.mallocInt32(_));var D=8*_;x.length<D&&(i.free(x),x=i.mallocDouble(D))}function S(k,_,D,I){var O=_[I],B=k[D-1];k[O]=B,_[B]=O}function T(k,_,D,I){k[D]=I,_[I]=D}function M(k,_,D,I,O,B,R,L,F,N){for(var j=0,G=2*k,rt=k-1,ct=G-1,lt=D;lt<I;++lt){var tt=B[lt],Z=G*lt;x[j++]=O[Z+rt],x[j++]=-(tt+1),x[j++]=O[Z+ct],x[j++]=tt}for(var lt=R;lt<L;++lt){var tt=N[lt]+a,st=G*lt;x[j++]=F[st+rt],x[j++]=-tt,x[j++]=F[st+ct],x[j++]=tt}var $=j>>>1;o(x,$);for(var Q=0,nt=0,lt=0;lt<$;++lt){var Y=x[2*lt+1]|0;if(Y>=a)Y=Y-a|0,S(m,p,nt--,Y);else if(Y>=0)S(h,v,Q--,Y);else if(Y<=-a){Y=-Y-a|0;for(var q=0;q<Q;++q){var ot=_(h[q],Y);if(ot!==void 0)return ot}T(m,p,nt++,Y)}else{Y=-Y-1|0;for(var q=0;q<nt;++q){var ot=_(Y,m[q]);if(ot!==void 0)return ot}T(h,v,Q++,Y)}}}function w(k,_,D,I,O,B,R,L,F,N){for(var j=0,G=2*k,rt=k-1,ct=G-1,lt=D;lt<I;++lt){var tt=B[lt]+1<<1,Z=G*lt;x[j++]=O[Z+rt],x[j++]=-tt,x[j++]=O[Z+ct],x[j++]=tt}for(var lt=R;lt<L;++lt){var tt=N[lt]+1<<1,st=G*lt;x[j++]=F[st+rt],x[j++]=-tt|1,x[j++]=F[st+ct],x[j++]=tt|1}var $=j>>>1;o(x,$);for(var Q=0,nt=0,Y=0,lt=0;lt<$;++lt){var q=x[2*lt+1]|0,ot=q&1;if(lt<$-1&&q>>1===x[2*lt+3]>>1&&(ot=2,lt+=1),q<0){for(var it=-(q>>1)-1,dt=0;dt<Y;++dt){var wt=_(y[dt],it);if(wt!==void 0)return wt}if(ot!==0)for(var dt=0;dt<Q;++dt){var wt=_(h[dt],it);if(wt!==void 0)return wt}if(ot!==1)for(var dt=0;dt<nt;++dt){var wt=_(m[dt],it);if(wt!==void 0)return wt}ot===0?T(h,v,Q++,it):ot===1?T(m,p,nt++,it):ot===2&&T(y,l,Y++,it)}else{var it=(q>>1)-1;ot===0?S(h,v,Q--,it):ot===1?S(m,p,nt--,it):ot===2&&S(y,l,Y--,it)}}}function u(k,_,D,I,O,B,R,L,F,N,j,G){var rt=0,ct=2*k,lt=_,tt=_+k,Z=1,st=1;I?st=a:Z=a;for(var $=O;$<B;++$){var Q=$+Z,nt=ct*$;x[rt++]=R[nt+lt],x[rt++]=-Q,x[rt++]=R[nt+tt],x[rt++]=Q}for(var $=F;$<N;++$){var Q=$+st,Y=ct*$;x[rt++]=j[Y+lt],x[rt++]=-Q}var q=rt>>>1;o(x,q);for(var ot=0,$=0;$<q;++$){var it=x[2*$+1]|0;if(it<0){var Q=-it,dt=!1;if(Q>=a?(dt=!I,Q-=a):(dt=!!I,Q-=1),dt)T(h,v,ot++,Q);else{var wt=G[Q],xt=ct*Q,Ft=j[xt+_+1],Et=j[xt+_+1+k];t:for(var Nt=0;Nt<ot;++Nt){var te=h[Nt],Jt=ct*te;if(!(Et<R[Jt+_+1]||R[Jt+_+1+k]<Ft)){for(var Qt=_+2;Qt<k;++Qt)if(j[xt+Qt+k]<R[Jt+Qt]||R[Jt+Qt+k]<j[xt+Qt])continue t;var Wt=L[te],gt;if(I?gt=D(wt,Wt):gt=D(Wt,wt),gt!==void 0)return gt}}}}else S(h,v,ot--,it-Z)}}function f(k,_,D,I,O,B,R,L,F,N,j){for(var G=0,rt=2*k,ct=_,lt=_+k,tt=I;tt<O;++tt){var Z=tt+a,st=rt*tt;x[G++]=B[st+ct],x[G++]=-Z,x[G++]=B[st+lt],x[G++]=Z}for(var tt=L;tt<F;++tt){var Z=tt+1,$=rt*tt;x[G++]=N[$+ct],x[G++]=-Z}var Q=G>>>1;o(x,Q);for(var nt=0,tt=0;tt<Q;++tt){var Y=x[2*tt+1]|0;if(Y<0){var Z=-Y;if(Z>=a)h[nt++]=Z-a;else{Z-=1;var q=j[Z],ot=rt*Z,it=N[ot+_+1],dt=N[ot+_+1+k];t:for(var wt=0;wt<nt;++wt){var xt=h[wt],Ft=R[xt];if(Ft===q)break;var Et=rt*xt;if(!(dt<B[Et+_+1]||B[Et+_+1+k]<it)){for(var Nt=_+2;Nt<k;++Nt)if(N[ot+Nt+k]<B[Et+Nt]||B[Et+Nt+k]<N[ot+Nt])continue t;var te=D(Ft,q);if(te!==void 0)return te}}}}else{for(var Z=Y-a,wt=nt-1;wt>=0;--wt)if(h[wt]===Z){for(var Nt=wt+1;Nt<nt;++Nt)h[Nt-1]=h[Nt];break}--nt}}}},2538:function(t,e,r){var i=r(8902),n=r(5542),o=r(2272),a=r(5023);t.exports=p;function s(y){return[Math.min(y[0],y[1]),Math.max(y[0],y[1])]}function h(y,l){return y[0]-l[0]||y[1]-l[1]}function v(y){return y.map(s).sort(h)}function m(y,l,x){return l in y?y[l]:x}function p(y,l,x){Array.isArray(l)?(x=x||{},l=l||[]):(x=l||{},l=[]);var b=!!m(x,"delaunay",!0),S=!!m(x,"interior",!0),T=!!m(x,"exterior",!0),M=!!m(x,"infinity",!1);if(!S&&!T||y.length===0)return[];var w=i(y,l);if(b||S!==T||M){for(var u=n(y.length,v(l)),f=0;f<w.length;++f){var k=w[f];u.addTriangle(k[0],k[1],k[2])}return b&&o(y,u),T?S?M?a(u,0,M):u.cells():a(u,1,M):a(u,-1)}else return w}},2272:function(t,e,r){var i=r(2646)[4];r(2478),t.exports=o;function n(a,s,h,v,m,p){var y=s.opposite(v,m);if(!(y<0)){if(m<v){var l=v;v=m,m=l,l=p,p=y,y=l}s.isConstraint(v,m)||i(a[v],a[m],a[p],a[y])<0&&h.push(v,m)}}function o(a,s){for(var h=[],v=a.length,m=s.stars,p=0;p<v;++p)for(var y=m[p],l=1;l<y.length;l+=2){var x=y[l];if(!(x<p)&&!s.isConstraint(p,x)){for(var b=y[l-1],S=-1,T=1;T<y.length;T+=2)if(y[T-1]===x){S=y[T];break}S<0||i(a[p],a[x],a[b],a[S])<0&&h.push(p,x)}}for(;h.length>0;){for(var x=h.pop(),p=h.pop(),b=-1,S=-1,y=m[p],M=1;M<y.length;M+=2){var w=y[M-1],u=y[M];w===x?S=u:u===x&&(b=w)}b<0||S<0||i(a[p],a[x],a[b],a[S])>=0||(s.flip(p,x),n(a,s,h,b,p,S),n(a,s,h,p,S,b),n(a,s,h,S,x,b),n(a,s,h,x,b,S))}}},5023:function(t,e,r){var i=r(2478);t.exports=v;function n(m,p,y,l,x,b,S){this.cells=m,this.neighbor=p,this.flags=l,this.constraint=y,this.active=x,this.next=b,this.boundary=S}var o=n.prototype;function a(m,p){return m[0]-p[0]||m[1]-p[1]||m[2]-p[2]}o.locate=function(){var m=[0,0,0];return function(p,y,l){var x=p,b=y,S=l;return y<l?y<p&&(x=y,b=l,S=p):l<p&&(x=l,b=p,S=y),x<0?-1:(m[0]=x,m[1]=b,m[2]=S,i.eq(this.cells,m,a))}}();function s(m,p){for(var y=m.cells(),l=y.length,x=0;x<l;++x){var b=y[x],S=b[0],T=b[1],M=b[2];T<M?T<S&&(b[0]=T,b[1]=M,b[2]=S):M<S&&(b[0]=M,b[1]=S,b[2]=T)}y.sort(a);for(var w=new Array(l),x=0;x<w.length;++x)w[x]=0;var u=[],f=[],k=new Array(3*l),_=new Array(3*l),D=null;p&&(D=[]);for(var I=new n(y,k,_,w,u,f,D),x=0;x<l;++x)for(var b=y[x],O=0;O<3;++O){var S=b[O],T=b[(O+1)%3],B=k[3*x+O]=I.locate(T,S,m.opposite(T,S)),R=_[3*x+O]=m.isConstraint(S,T);B<0&&(R?f.push(x):(u.push(x),w[x]=1),p&&D.push([T,S,-1]))}return I}function h(m,p,y){for(var l=0,x=0;x<m.length;++x)p[x]===y&&(m[l++]=m[x]);return m.length=l,m}function v(m,p,y){var l=s(m,y);if(p===0)return y?l.cells.concat(l.boundary):l.cells;for(var x=1,b=l.active,S=l.next,T=l.flags,M=l.cells,w=l.constraint,u=l.neighbor;b.length>0||S.length>0;){for(;b.length>0;){var f=b.pop();if(T[f]!==-x){T[f]=x;for(var k=M[f],_=0;_<3;++_){var D=u[3*f+_];D>=0&&T[D]===0&&(w[3*f+_]?S.push(D):(b.push(D),T[D]=x))}}}var I=S;S=b,b=I,S.length=0,x=-x}var O=h(M,T,p);return y?O.concat(l.boundary):O}},8902:function(t,e,r){var i=r(2478),n=r(3250)[3],o=0,a=1,s=2;t.exports=S;function h(T,M,w,u,f){this.a=T,this.b=M,this.idx=w,this.lowerIds=u,this.upperIds=f}function v(T,M,w,u){this.a=T,this.b=M,this.type=w,this.idx=u}function m(T,M){var w=T.a[0]-M.a[0]||T.a[1]-M.a[1]||T.type-M.type;return w||T.type!==o&&(w=n(T.a,T.b,M.b),w)?w:T.idx-M.idx}function p(T,M){return n(T.a,T.b,M)}function y(T,M,w,u,f){for(var k=i.lt(M,u,p),_=i.gt(M,u,p),D=k;D<_;++D){for(var I=M[D],O=I.lowerIds,B=O.length;B>1&&n(w[O[B-2]],w[O[B-1]],u)>0;)T.push([O[B-1],O[B-2],f]),B-=1;O.length=B,O.push(f);for(var R=I.upperIds,B=R.length;B>1&&n(w[R[B-2]],w[R[B-1]],u)<0;)T.push([R[B-2],R[B-1],f]),B-=1;R.length=B,R.push(f)}}function l(T,M){var w;return T.a[0]<M.a[0]?w=n(T.a,T.b,M.a):w=n(M.b,M.a,T.a),w||(M.b[0]<T.b[0]?w=n(T.a,T.b,M.b):w=n(M.b,M.a,T.b),w||T.idx-M.idx)}function x(T,M,w){var u=i.le(T,w,l),f=T[u],k=f.upperIds,_=k[k.length-1];f.upperIds=[_],T.splice(u+1,0,new h(w.a,w.b,w.idx,[_],k))}function b(T,M,w){var u=w.a;w.a=w.b,w.b=u;var f=i.eq(T,w,l),k=T[f],_=T[f-1];_.upperIds=k.upperIds,T.splice(f,1)}function S(T,M){for(var w=T.length,u=M.length,f=[],k=0;k<w;++k)f.push(new v(T[k],null,o,k));for(var k=0;k<u;++k){var _=M[k],D=T[_[0]],I=T[_[1]];D[0]<I[0]?f.push(new v(D,I,s,k),new v(I,D,a,k)):D[0]>I[0]&&f.push(new v(I,D,s,k),new v(D,I,a,k))}f.sort(m);for(var O=f[0].a[0]-(1+Math.abs(f[0].a[0]))*Math.pow(2,-52),B=[new h([O,1],[O,0],-1,[],[])],R=[],k=0,L=f.length;k<L;++k){var F=f[k],N=F.type;N===o?y(R,B,T,F.a,F.idx):N===s?x(B,T,F):b(B,T,F)}return R}},5542:function(t,e,r){var i=r(2478);t.exports=s;function n(h,v){this.stars=h,this.edges=v}var o=n.prototype;function a(h,v,m){for(var p=1,y=h.length;p<y;p+=2)if(h[p-1]===v&&h[p]===m){h[p-1]=h[y-2],h[p]=h[y-1],h.length=y-2;return}}o.isConstraint=function(){var h=[0,0];function v(m,p){return m[0]-p[0]||m[1]-p[1]}return function(m,p){return h[0]=Math.min(m,p),h[1]=Math.max(m,p),i.eq(this.edges,h,v)>=0}}(),o.removeTriangle=function(h,v,m){var p=this.stars;a(p[h],v,m),a(p[v],m,h),a(p[m],h,v)},o.addTriangle=function(h,v,m){var p=this.stars;p[h].push(v,m),p[v].push(m,h),p[m].push(h,v)},o.opposite=function(h,v){for(var m=this.stars[v],p=1,y=m.length;p<y;p+=2)if(m[p]===h)return m[p-1];return-1},o.flip=function(h,v){var m=this.opposite(h,v),p=this.opposite(v,h);this.removeTriangle(h,v,m),this.removeTriangle(v,h,p),this.addTriangle(h,p,m),this.addTriangle(v,m,p)},o.edges=function(){for(var h=this.stars,v=[],m=0,p=h.length;m<p;++m)for(var y=h[m],l=0,x=y.length;l<x;l+=2)v.push([y[l],y[l+1]]);return v},o.cells=function(){for(var h=this.stars,v=[],m=0,p=h.length;m<p;++m)for(var y=h[m],l=0,x=y.length;l<x;l+=2){var b=y[l],S=y[l+1];m<Math.min(b,S)&&v.push([m,b,S])}return v};function s(h,v){for(var m=new Array(h),p=0;p<h;++p)m[p]=[];return new n(m,v)}},2419:function(t){t.exports=e;function e(r){for(var i=1,n=1;n<r.length;++n)for(var o=0;o<n;++o)if(r[n]<r[o])i=-i;else if(r[o]===r[n])return 0;return i}},3628:function(t,e,r){var i=r(1338),n=r(727);function o(h,v){for(var m=0,p=h.length,y=0;y<p;++y)m+=h[y]*v[y];return m}function a(h){var v=h.length;if(v===0)return[];h[0].length;var m=i([h.length+1,h.length+1],1),p=i([h.length+1],1);m[v][v]=0;for(var y=0;y<v;++y){for(var l=0;l<=y;++l)m[l][y]=m[y][l]=2*o(h[y],h[l]);p[y]=o(h[y],h[y])}for(var x=n(m,p),b=0,S=x[v+1],y=0;y<S.length;++y)b+=S[y];for(var T=new Array(v),y=0;y<v;++y){for(var S=x[y],M=0,l=0;l<S.length;++l)M+=S[l];T[y]=M/b}return T}function s(h){if(h.length===0)return[];for(var v=h[0].length,m=i([v]),p=a(h),y=0;y<h.length;++y)for(var l=0;l<v;++l)m[l]+=h[y][l]*p[y];return m}s.barycenetric=a,t.exports=s},6037:function(t,e,r){t.exports=n;var i=r(3628);function n(o){for(var a=i(o),s=0,h=0;h<o.length;++h)for(var v=o[h],m=0;m<a.length;++m)s+=Math.pow(v[m]-a[m],2);return Math.sqrt(s/o.length)}},332:function(t,e,r){t.exports=D;var i=r(1755),n=r(6867),o=r(1125),a=r(7842),s=r(1318),h=r(946),v=r(5838),m=r(1278),p=r(3637);function y(I){var O=h(I);return[m(O,-1/0),m(O,1/0)]}function l(I,O){for(var B=new Array(O.length),R=0;R<O.length;++R){var L=O[R],F=I[L[0]],N=I[L[1]];B[R]=[m(Math.min(F[0],N[0]),-1/0),m(Math.min(F[1],N[1]),-1/0),m(Math.max(F[0],N[0]),1/0),m(Math.max(F[1],N[1]),1/0)]}return B}function x(I){for(var O=new Array(I.length),B=0;B<I.length;++B){var R=I[B];O[B]=[m(R[0],-1/0),m(R[1],-1/0),m(R[0],1/0),m(R[1],1/0)]}return O}function b(I,O,B){var R=[];return n(B,function(L,F){var N=O[L],j=O[F];if(!(N[0]===j[0]||N[0]===j[1]||N[1]===j[0]||N[1]===j[1])){var G=I[N[0]],rt=I[N[1]],ct=I[j[0]],lt=I[j[1]];o(G,rt,ct,lt)&&R.push([L,F])}}),R}function S(I,O,B,R){var L=[];return n(B,R,function(F,N){var j=O[F];if(!(j[0]===N||j[1]===N)){var G=I[N],rt=I[j[0]],ct=I[j[1]];o(rt,ct,G,G)&&L.push([F,N])}}),L}function T(I,O,B,R,L){var F,N,j=I.map(function(xt){return[a(xt[0]),a(xt[1])]});for(F=0;F<B.length;++F){var G=B[F];N=G[0];var rt=G[1],ct=O[N],lt=O[rt],tt=p(v(I[ct[0]]),v(I[ct[1]]),v(I[lt[0]]),v(I[lt[1]]));if(tt){var Z=I.length;I.push([h(tt[0]),h(tt[1])]),j.push(tt),R.push([N,Z],[rt,Z])}}for(R.sort(function(xt,Ft){if(xt[0]!==Ft[0])return xt[0]-Ft[0];var Et=j[xt[1]],Nt=j[Ft[1]];return s(Et[0],Nt[0])||s(Et[1],Nt[1])}),F=R.length-1;F>=0;--F){var st=R[F];N=st[0];var $=O[N],Q=$[0],nt=$[1],Y=I[Q],q=I[nt];if((Y[0]-q[0]||Y[1]-q[1])<0){var ot=Q;Q=nt,nt=ot}$[0]=Q;var it=$[1]=st[1],dt;for(L&&(dt=$[2]);F>0&&R[F-1][0]===N;){var st=R[--F],wt=st[1];L?O.push([it,wt,dt]):O.push([it,wt]),it=wt}L?O.push([it,nt,dt]):O.push([it,nt])}return j}function M(I,O,B){for(var R=O.length,L=new i(R),F=[],N=0;N<O.length;++N){var j=O[N],G=y(j[0]),rt=y(j[1]);F.push([m(G[0],-1/0),m(rt[0],-1/0),m(G[1],1/0),m(rt[1],1/0)])}n(F,function(st,$){L.link(st,$)});for(var ct=!0,lt=new Array(R),N=0;N<R;++N){var tt=L.find(N);tt!==N&&(ct=!1,I[tt]=[Math.min(I[N][0],I[tt][0]),Math.min(I[N][1],I[tt][1])])}if(ct)return null;for(var Z=0,N=0;N<R;++N){var tt=L.find(N);tt===N?(lt[N]=Z,I[Z++]=I[N]):lt[N]=-1}I.length=Z;for(var N=0;N<R;++N)lt[N]<0&&(lt[N]=lt[L.find(N)]);return lt}function w(I,O){return I[0]-O[0]||I[1]-O[1]}function u(I,O){var B=I[0]-O[0]||I[1]-O[1];return B||(I[2]<O[2]?-1:I[2]>O[2]?1:0)}function f(I,O,B){if(I.length!==0){if(O)for(var R=0;R<I.length;++R){var L=I[R],F=O[L[0]],N=O[L[1]];L[0]=Math.min(F,N),L[1]=Math.max(F,N)}else for(var R=0;R<I.length;++R){var L=I[R],F=L[0],N=L[1];L[0]=Math.min(F,N),L[1]=Math.max(F,N)}B?I.sort(u):I.sort(w);for(var j=1,R=1;R<I.length;++R){var G=I[R-1],rt=I[R];rt[0]===G[0]&&rt[1]===G[1]&&(!B||rt[2]===G[2])||(I[j++]=rt)}I.length=j}}function k(I,O,B){var R=M(I,[],x(I));return f(O,R,B),!!R}function _(I,O,B){var R=l(I,O),L=b(I,O,R),F=x(I),N=S(I,O,R,F),j=T(I,O,L,N,B),G=M(I,j);return f(O,G,B),G?!0:L.length>0||N.length>0}function D(I,O,B){var R;if(B){R=O;for(var L=new Array(O.length),F=0;F<O.length;++F){var N=O[F];L[F]=[N[0],N[1],B[F]]}O=L}for(var j=k(I,O,!!B);_(I,O,!!B);)j=!0;if(B&&j){R.length=0,B.length=0;for(var F=0;F<O.length;++F){var N=O[F];R.push([N[0],N[1]]),B.push(N[2])}}return j}},3637:function(t,e,r){t.exports=p;var i=r(6504),n=r(8697),o=r(5572),a=r(7721),s=r(544),h=r(2653),v=r(8987);function m(y,l){return o(i(y[0],l[1]),i(y[1],l[0]))}function p(y,l,x,b){var S=s(l,y),T=s(b,x),M=m(S,T);if(a(M)===0)return null;var w=s(y,x),u=m(T,w),f=n(u,M),k=v(S,f),_=h(y,k);return _}},3642:function(t){t.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(t,e,r){var i=r(3642),n=r(395);t.exports=o;function o(v){var m,p,y,l,x,b,S,T,f,M,w;if(v||(v={}),T=(v.nshades||72)-1,S=v.format||"hex",b=v.colormap,b||(b="jet"),typeof b=="string"){if(b=b.toLowerCase(),!i[b])throw Error(b+" not a supported colorscale");x=i[b]}else if(Array.isArray(b))x=b.slice();else throw Error("unsupported colormap option",b);if(x.length>T+1)throw new Error(b+" map requires nshades to be at least size "+x.length);Array.isArray(v.alpha)?v.alpha.length!==2?M=[1,1]:M=v.alpha.slice():typeof v.alpha=="number"?M=[v.alpha,v.alpha]:M=[1,1],m=x.map(function(D){return Math.round(D.index*T)}),M[0]=Math.min(Math.max(M[0],0),1),M[1]=Math.min(Math.max(M[1],0),1);var u=x.map(function(D,I){var O=x[I].index,B=x[I].rgb.slice();return B.length===4&&B[3]>=0&&B[3]<=1||(B[3]=M[0]+(M[1]-M[0])*O),B}),f=[];for(w=0;w<m.length-1;++w){l=m[w+1]-m[w],p=u[w],y=u[w+1];for(var k=0;k<l;k++){var _=k/l;f.push([Math.round(n(p[0],y[0],_)),Math.round(n(p[1],y[1],_)),Math.round(n(p[2],y[2],_)),n(p[3],y[3],_)])}}return f.push(x[x.length-1].rgb.concat(M[1])),S==="hex"?f=f.map(s):S==="rgbaString"?f=f.map(h):S==="float"&&(f=f.map(a)),f}function a(v){return[v[0]/255,v[1]/255,v[2]/255,v[3]]}function s(v){for(var m,p="#",y=0;y<3;++y)m=v[y],m=m.toString(16),p+=("00"+m).substr(m.length);return p}function h(v){return"rgba("+v.join(",")+")"}},3140:function(t,e,r){t.exports=v;var i=r(3250),n=r(8572),o=r(9362),a=r(5382),s=r(8210);function h(m,p,y){var l=o(m[0],-p[0]),x=o(m[1],-p[1]),b=o(y[0],-p[0]),S=o(y[1],-p[1]),T=s(a(l,b),a(x,S));return T[T.length-1]>=0}function v(m,p,y,l){var x=i(p,y,l);if(x===0){var b=n(i(m,p,y)),S=n(i(m,p,l));if(b===S){if(b===0){var T=h(m,p,y),M=h(m,p,l);return T===M?0:T?1:-1}return 0}else{if(S===0)return b>0||h(m,p,l)?-1:1;if(b===0)return S>0||h(m,p,y)?1:-1}return n(S-b)}var w=i(m,p,y);if(w>0)return x>0&&i(m,p,l)>0?1:-1;if(w<0)return x>0||i(m,p,l)>0?1:-1;var u=i(m,p,l);return u>0||h(m,p,y)?1:-1}},8572:function(t){t.exports=function(e){return e<0?-1:e>0?1:0}},8507:function(t){t.exports=i;var e=Math.min;function r(n,o){return n-o}function i(n,o){var a=n.length,s=n.length-o.length;if(s)return s;switch(a){case 0:return 0;case 1:return n[0]-o[0];case 2:return n[0]+n[1]-o[0]-o[1]||e(n[0],n[1])-e(o[0],o[1]);case 3:var h=n[0]+n[1],v=o[0]+o[1];if(s=h+n[2]-(v+o[2]),s)return s;var m=e(n[0],n[1]),p=e(o[0],o[1]);return e(m,n[2])-e(p,o[2])||e(m+n[2],h)-e(p+o[2],v);case 4:var y=n[0],l=n[1],x=n[2],b=n[3],S=o[0],T=o[1],M=o[2],w=o[3];return y+l+x+b-(S+T+M+w)||e(y,l,x,b)-e(S,T,M,w,S)||e(y+l,y+x,y+b,l+x,l+b,x+b)-e(S+T,S+M,S+w,T+M,T+w,M+w)||e(y+l+x,y+l+b,y+x+b,l+x+b)-e(S+T+M,S+T+w,S+M+w,T+M+w);default:for(var u=n.slice().sort(r),f=o.slice().sort(r),k=0;k<a;++k)if(s=u[k]-f[k],s)return s;return 0}}},3788:function(t,e,r){var i=r(8507),n=r(2419);t.exports=o;function o(a,s){return i(a,s)||n(a)-n(s)}},7352:function(t,e,r){var i=r(5721),n=r(4750),o=r(2690);t.exports=a;function a(s){var h=s.length;if(h===0)return[];if(h===1)return[[0]];var v=s[0].length;return v===0?[]:v===1?i(s):v===2?n(s):o(s,v)}},5721:function(t){t.exports=e;function e(r){for(var i=0,n=0,o=1;o<r.length;++o)r[o][0]<r[i][0]&&(i=o),r[o][0]>r[n][0]&&(n=o);return i<n?[[i],[n]]:i>n?[[n],[i]]:[[i]]}},4750:function(t,e,r){t.exports=n;var i=r(3090);function n(o){var a=i(o),s=a.length;if(s<=2)return[];for(var h=new Array(s),v=a[s-1],m=0;m<s;++m){var p=a[m];h[m]=[v,p],v=p}return h}},2690:function(t,e,r){t.exports=s;var i=r(8954),n=r(3952);function o(h,v){for(var m=h.length,p=new Array(m),y=0;y<v.length;++y)p[y]=h[v[y]];for(var l=v.length,y=0;y<m;++y)v.indexOf(y)<0&&(p[l++]=h[y]);return p}function a(h,v){for(var m=h.length,p=v.length,y=0;y<m;++y)for(var l=h[y],x=0;x<l.length;++x){var b=l[x];if(b<p)l[x]=v[b];else{b=b-p;for(var S=0;S<p;++S)b>=v[S]&&(b+=1);l[x]=b}}return h}function s(h,v){try{return i(h,!0)}catch{var m=n(h);if(m.length<=v)return[];var p=o(h,m),y=i(p,!0);return a(y,m)}}},4769:function(t){function e(i,n,o,a,s,h){var v=6*s*s-6*s,m=3*s*s-4*s+1,p=-6*s*s+6*s,y=3*s*s-2*s;if(i.length){h||(h=new Array(i.length));for(var l=i.length-1;l>=0;--l)h[l]=v*i[l]+m*n[l]+p*o[l]+y*a[l];return h}return v*i+m*n+p*o[l]+y*a}function r(i,n,o,a,s,h){var v=s-1,m=s*s,p=v*v,y=(1+2*s)*p,l=s*p,x=m*(3-2*s),b=m*v;if(i.length){h||(h=new Array(i.length));for(var S=i.length-1;S>=0;--S)h[S]=y*i[S]+l*n[S]+x*o[S]+b*a[S];return h}return y*i+l*n+x*o+b*a}t.exports=r,t.exports.derivative=e},7642:function(t,e,r){var i=r(8954),n=r(1682);t.exports=h;function o(v,m){this.point=v,this.index=m}function a(v,m){for(var p=v.point,y=m.point,l=p.length,x=0;x<l;++x){var b=y[x]-p[x];if(b)return b}return 0}function s(v,m,p){if(v===1)return p?[[-1,0]]:[];var y=m.map(function(T,M){return[T[0],M]});y.sort(function(T,M){return T[0]-M[0]});for(var l=new Array(v-1),x=1;x<v;++x){var b=y[x-1],S=y[x];l[x-1]=[b[1],S[1]]}return p&&l.push([-1,l[0][1]],[l[v-1][1],-1]),l}function h(v,m){var p=v.length;if(p===0)return[];var y=v[0].length;if(y<1)return[];if(y===1)return s(p,v,m);for(var l=new Array(p),x=1,b=0;b<p;++b){for(var S=v[b],T=new Array(y+1),M=0,w=0;w<y;++w){var u=S[w];T[w]=u,M+=u*u}T[y]=M,l[b]=new o(T,b),x=Math.max(M,x)}n(l,a),p=l.length;for(var f=new Array(p+y+1),k=new Array(p+y+1),_=(y+1)*(y+1)*x,D=new Array(y+1),b=0;b<=y;++b)D[b]=0;D[y]=_,f[0]=D.slice(),k[0]=-1;for(var b=0;b<=y;++b){var T=D.slice();T[b]=1,f[b+1]=T,k[b+1]=-1}for(var b=0;b<p;++b){var I=l[b];f[b+y+1]=I.point,k[b+y+1]=I.index}var O=i(f,!1);if(m?O=O.filter(function(B){for(var R=0,L=0;L<=y;++L){var F=k[B[L]];if(F<0&&++R>=2)return!1;B[L]=F}return!0}):O=O.filter(function(B){for(var R=0;R<=y;++R){var L=k[B[R]];if(L<0)return!1;B[R]=L}return!0}),y&1)for(var b=0;b<O.length;++b){var I=O[b],T=I[0];I[0]=I[1],I[1]=T}return O}},2361:function(t){var e=!1;if(typeof Float64Array<"u"){var r=new Float64Array(1),i=new Uint32Array(r.buffer);if(r[0]=1,e=!0,i[1]===1072693248){let o=function(h,v){return i[0]=h,i[1]=v,r[0]},a=function(h){return r[0]=h,i[0]},s=function(h){return r[0]=h,i[1]};t.exports=function(h){return r[0]=h,[i[0],i[1]]},t.exports.pack=o,t.exports.lo=a,t.exports.hi=s}else if(i[0]===1072693248){let o=function(h,v){return i[1]=h,i[0]=v,r[0]},a=function(h){return r[0]=h,i[1]},s=function(h){return r[0]=h,i[0]};t.exports=function(h){return r[0]=h,[i[1],i[0]]},t.exports.pack=o,t.exports.lo=a,t.exports.hi=s}else e=!1}if(!e){let o=function(h,v){return n.writeUInt32LE(h,0,!0),n.writeUInt32LE(v,4,!0),n.readDoubleLE(0,!0)},a=function(h){return n.writeDoubleLE(h,0,!0),n.readUInt32LE(0,!0)},s=function(h){return n.writeDoubleLE(h,0,!0),n.readUInt32LE(4,!0)};var n=new Buffer(8);t.exports=function(h){return n.writeDoubleLE(h,0,!0),[n.readUInt32LE(0,!0),n.readUInt32LE(4,!0)]},t.exports.pack=o,t.exports.lo=a,t.exports.hi=s}t.exports.sign=function(o){return t.exports.hi(o)>>>31},t.exports.exponent=function(o){var a=t.exports.hi(o);return(a<<1>>>21)-1023},t.exports.fraction=function(o){var a=t.exports.lo(o),s=t.exports.hi(o),h=s&(1<<20)-1;return s&2146435072&&(h+=1048576),[a,h]},t.exports.denormalized=function(o){var a=t.exports.hi(o);return!(a&2146435072)}},1338:function(t){function e(n,o,a){var s=n[a]|0;if(s<=0)return[];var h=new Array(s),v;if(a===n.length-1)for(v=0;v<s;++v)h[v]=o;else for(v=0;v<s;++v)h[v]=e(n,o,a+1);return h}function r(n,o){var a,s;for(a=new Array(n),s=0;s<n;++s)a[s]=o;return a}function i(n,o){switch(typeof o>"u"&&(o=0),typeof n){case"number":if(n>0)return r(n|0,o);break;case"object":if(typeof n.length=="number")return e(n,o,0);break}return[]}t.exports=i},3134:function(t,e,r){t.exports=n;var i=r(1682);function n(o,a){var s=o.length;if(typeof a!="number"){a=0;for(var h=0;h<s;++h){var v=o[h];a=Math.max(a,v[0],v[1])}a=(a|0)+1}a=a|0;for(var m=new Array(a),h=0;h<a;++h)m[h]=[];for(var h=0;h<s;++h){var v=o[h];m[v[0]].push(v[1]),m[v[1]].push(v[0])}for(var p=0;p<a;++p)i(m[p],function(y,l){return y-l});return m}},5033:function(t){t.exports=e;function e(r,i,n){var o=i||0,a=n||1;return[[r[12]+r[0],r[13]+r[1],r[14]+r[2],r[15]+r[3]],[r[12]-r[0],r[13]-r[1],r[14]-r[2],r[15]-r[3]],[r[12]+r[4],r[13]+r[5],r[14]+r[6],r[15]+r[7]],[r[12]-r[4],r[13]-r[5],r[14]-r[6],r[15]-r[7]],[o*r[12]+r[8],o*r[13]+r[9],o*r[14]+r[10],o*r[15]+r[11]],[a*r[12]-r[8],a*r[13]-r[9],a*r[14]-r[10],a*r[15]-r[11]]]}},9215:function(t,e,r){t.exports=v;var i=r(4769),n=r(2478);function o(m,p,y){return Math.min(p,Math.max(m,y))}function a(m,p,y){this.dimension=m.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var l=0;l<this.dimension;++l)this.bounds[0][l]=-1/0,this.bounds[1][l]=1/0;this._state=m.slice().reverse(),this._velocity=p.slice().reverse(),this._time=[y],this._scratch=[m.slice(),m.slice(),m.slice(),m.slice(),m.slice()]}var s=a.prototype;s.flush=function(m){var p=n.gt(this._time,m)-1;p<=0||(this._time.splice(0,p),this._state.splice(0,p*this.dimension),this._velocity.splice(0,p*this.dimension))},s.curve=function(m){var p=this._time,y=p.length,l=n.le(p,m),x=this._scratch[0],b=this._state,S=this._velocity,T=this.dimension,M=this.bounds;if(l<0)for(var w=T-1,u=0;u<T;++u,--w)x[u]=b[w];else if(l>=y-1)for(var w=b.length-1,f=m-p[y-1],u=0;u<T;++u,--w)x[u]=b[w]+f*S[w];else{for(var w=T*(l+1)-1,k=p[l],_=p[l+1],D=_-k||1,I=this._scratch[1],O=this._scratch[2],B=this._scratch[3],R=this._scratch[4],L=!0,u=0;u<T;++u,--w)I[u]=b[w],B[u]=S[w]*D,O[u]=b[w+T],R[u]=S[w+T]*D,L=L&&I[u]===O[u]&&B[u]===R[u]&&B[u]===0;if(L)for(var u=0;u<T;++u)x[u]=I[u];else i(I,B,O,R,(m-k)/D,x)}for(var F=M[0],N=M[1],u=0;u<T;++u)x[u]=o(F[u],N[u],x[u]);return x},s.dcurve=function(m){var p=this._time,y=p.length,l=n.le(p,m),x=this._scratch[0],b=this._state,S=this._velocity,T=this.dimension;if(l>=y-1)for(var M=b.length-1,w=m-p[y-1],u=0;u<T;++u,--M)x[u]=S[M];else{for(var M=T*(l+1)-1,f=p[l],k=p[l+1],_=k-f||1,D=this._scratch[1],I=this._scratch[2],O=this._scratch[3],B=this._scratch[4],R=!0,u=0;u<T;++u,--M)D[u]=b[M],O[u]=S[M]*_,I[u]=b[M+T],B[u]=S[M+T]*_,R=R&&D[u]===I[u]&&O[u]===B[u]&&O[u]===0;if(R)for(var u=0;u<T;++u)x[u]=0;else{i.derivative(D,O,I,B,(m-f)/_,x);for(var u=0;u<T;++u)x[u]/=_}}return x},s.lastT=function(){var m=this._time;return m[m.length-1]},s.stable=function(){for(var m=this._velocity,p=m.length,y=this.dimension-1;y>=0;--y)if(m[--p])return!1;return!0},s.jump=function(m){var p=this.lastT(),y=this.dimension;if(!(m<p||arguments.length!==y+1)){var l=this._state,x=this._velocity,b=l.length-this.dimension,S=this.bounds,T=S[0],M=S[1];this._time.push(p,m);for(var w=0;w<2;++w)for(var u=0;u<y;++u)l.push(l[b++]),x.push(0);this._time.push(m);for(var u=y;u>0;--u)l.push(o(T[u-1],M[u-1],arguments[u])),x.push(0)}},s.push=function(m){var p=this.lastT(),y=this.dimension;if(!(m<p||arguments.length!==y+1)){var l=this._state,x=this._velocity,b=l.length-this.dimension,S=m-p,T=this.bounds,M=T[0],w=T[1],u=S>1e-6?1/S:0;this._time.push(m);for(var f=y;f>0;--f){var k=o(M[f-1],w[f-1],arguments[f]);l.push(k),x.push((k-l[b++])*u)}}},s.set=function(m){var p=this.dimension;if(!(m<this.lastT()||arguments.length!==p+1)){var y=this._state,l=this._velocity,x=this.bounds,b=x[0],S=x[1];this._time.push(m);for(var T=p;T>0;--T)y.push(o(b[T-1],S[T-1],arguments[T])),l.push(0)}},s.move=function(m){var p=this.lastT(),y=this.dimension;if(!(m<=p||arguments.length!==y+1)){var l=this._state,x=this._velocity,b=l.length-this.dimension,S=this.bounds,T=S[0],M=S[1],w=m-p,u=w>1e-6?1/w:0;this._time.push(m);for(var f=y;f>0;--f){var k=arguments[f];l.push(o(T[f-1],M[f-1],l[b++]+k)),x.push(k*u)}}},s.idle=function(m){var p=this.lastT();if(!(m<p)){var y=this.dimension,l=this._state,x=this._velocity,b=l.length-y,S=this.bounds,T=S[0],M=S[1],w=m-p;this._time.push(m);for(var u=y-1;u>=0;--u)l.push(o(T[u],M[u],l[b]+w*x[b])),x.push(0),b+=1}};function h(m){for(var p=new Array(m),y=0;y<m;++y)p[y]=0;return p}function v(m,p,y){switch(arguments.length){case 0:return new a([0],[0],0);case 1:if(typeof m=="number"){var l=h(m);return new a(l,l,0)}else return new a(m,h(m.length),0);case 2:if(typeof p=="number"){var l=h(m.length);return new a(m,l,+p)}else y=0;case 3:if(m.length!==p.length)throw new Error("state and velocity lengths must match");return new a(m,p,y)}}},3840:function(t){t.exports=T;var e=0,r=1;function i(M,w,u,f,k,_){this._color=M,this.key=w,this.value=u,this.left=f,this.right=k,this._count=_}function n(M){return new i(M._color,M.key,M.value,M.left,M.right,M._count)}function o(M,w){return new i(M,w.key,w.value,w.left,w.right,w._count)}function a(M){M._count=1+(M.left?M.left._count:0)+(M.right?M.right._count:0)}function s(M,w){this._compare=M,this.root=w}var h=s.prototype;Object.defineProperty(h,"keys",{get:function(){var M=[];return this.forEach(function(w,u){M.push(w)}),M}}),Object.defineProperty(h,"values",{get:function(){var M=[];return this.forEach(function(w,u){M.push(u)}),M}}),Object.defineProperty(h,"length",{get:function(){return this.root?this.root._count:0}}),h.insert=function(M,w){for(var u=this._compare,f=this.root,k=[],_=[];f;){var D=u(M,f.key);k.push(f),_.push(D),D<=0?f=f.left:f=f.right}k.push(new i(e,M,w,null,null,1));for(var I=k.length-2;I>=0;--I){var f=k[I];_[I]<=0?k[I]=new i(f._color,f.key,f.value,k[I+1],f.right,f._count+1):k[I]=new i(f._color,f.key,f.value,f.left,k[I+1],f._count+1)}for(var I=k.length-1;I>1;--I){var O=k[I-1],f=k[I];if(O._color===r||f._color===r)break;var B=k[I-2];if(B.left===O)if(O.left===f){var R=B.right;if(R&&R._color===e)O._color=r,B.right=o(r,R),B._color=e,I-=1;else{if(B._color=e,B.left=O.right,O._color=r,O.right=B,k[I-2]=O,k[I-1]=f,a(B),a(O),I>=3){var L=k[I-3];L.left===B?L.left=O:L.right=O}break}}else{var R=B.right;if(R&&R._color===e)O._color=r,B.right=o(r,R),B._color=e,I-=1;else{if(O.right=f.left,B._color=e,B.left=f.right,f._color=r,f.left=O,f.right=B,k[I-2]=f,k[I-1]=O,a(B),a(O),a(f),I>=3){var L=k[I-3];L.left===B?L.left=f:L.right=f}break}}else if(O.right===f){var R=B.left;if(R&&R._color===e)O._color=r,B.left=o(r,R),B._color=e,I-=1;else{if(B._color=e,B.right=O.left,O._color=r,O.left=B,k[I-2]=O,k[I-1]=f,a(B),a(O),I>=3){var L=k[I-3];L.right===B?L.right=O:L.left=O}break}}else{var R=B.left;if(R&&R._color===e)O._color=r,B.left=o(r,R),B._color=e,I-=1;else{if(O.left=f.right,B._color=e,B.right=f.left,f._color=r,f.right=O,f.left=B,k[I-2]=f,k[I-1]=O,a(B),a(O),a(f),I>=3){var L=k[I-3];L.right===B?L.right=f:L.left=f}break}}}return k[0]._color=r,new s(u,k[0])};function v(M,w){if(w.left){var u=v(M,w.left);if(u)return u}var u=M(w.key,w.value);if(u)return u;if(w.right)return v(M,w.right)}function m(M,w,u,f){var k=w(M,f.key);if(k<=0){if(f.left){var _=m(M,w,u,f.left);if(_)return _}var _=u(f.key,f.value);if(_)return _}if(f.right)return m(M,w,u,f.right)}function p(M,w,u,f,k){var _=u(M,k.key),D=u(w,k.key),I;if(_<=0&&(k.left&&(I=p(M,w,u,f,k.left),I)||D>0&&(I=f(k.key,k.value),I)))return I;if(D>0&&k.right)return p(M,w,u,f,k.right)}h.forEach=function(M,w,u){if(this.root)switch(arguments.length){case 1:return v(M,this.root);case 2:return m(w,this._compare,M,this.root);case 3:return this._compare(w,u)>=0?void 0:p(w,u,this._compare,M,this.root)}},Object.defineProperty(h,"begin",{get:function(){for(var M=[],w=this.root;w;)M.push(w),w=w.left;return new y(this,M)}}),Object.defineProperty(h,"end",{get:function(){for(var M=[],w=this.root;w;)M.push(w),w=w.right;return new y(this,M)}}),h.at=function(M){if(M<0)return new y(this,[]);for(var w=this.root,u=[];;){if(u.push(w),w.left){if(M<w.left._count){w=w.left;continue}M-=w.left._count}if(!M)return new y(this,u);if(M-=1,w.right){if(M>=w.right._count)break;w=w.right}else break}return new y(this,[])},h.ge=function(M){for(var w=this._compare,u=this.root,f=[],k=0;u;){var _=w(M,u.key);f.push(u),_<=0&&(k=f.length),_<=0?u=u.left:u=u.right}return f.length=k,new y(this,f)},h.gt=function(M){for(var w=this._compare,u=this.root,f=[],k=0;u;){var _=w(M,u.key);f.push(u),_<0&&(k=f.length),_<0?u=u.left:u=u.right}return f.length=k,new y(this,f)},h.lt=function(M){for(var w=this._compare,u=this.root,f=[],k=0;u;){var _=w(M,u.key);f.push(u),_>0&&(k=f.length),_<=0?u=u.left:u=u.right}return f.length=k,new y(this,f)},h.le=function(M){for(var w=this._compare,u=this.root,f=[],k=0;u;){var _=w(M,u.key);f.push(u),_>=0&&(k=f.length),_<0?u=u.left:u=u.right}return f.length=k,new y(this,f)},h.find=function(M){for(var w=this._compare,u=this.root,f=[];u;){var k=w(M,u.key);if(f.push(u),k===0)return new y(this,f);k<=0?u=u.left:u=u.right}return new y(this,[])},h.remove=function(M){var w=this.find(M);return w?w.remove():this},h.get=function(M){for(var w=this._compare,u=this.root;u;){var f=w(M,u.key);if(f===0)return u.value;f<=0?u=u.left:u=u.right}};function y(M,w){this.tree=M,this._stack=w}var l=y.prototype;Object.defineProperty(l,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(l,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),l.clone=function(){return new y(this.tree,this._stack.slice())};function x(M,w){M.key=w.key,M.value=w.value,M.left=w.left,M.right=w.right,M._color=w._color,M._count=w._count}function b(M){for(var w,u,f,k,_=M.length-1;_>=0;--_){if(w=M[_],_===0){w._color=r;return}if(u=M[_-1],u.left===w){if(f=u.right,f.right&&f.right._color===e){if(f=u.right=n(f),k=f.right=n(f.right),u.right=f.left,f.left=u,f.right=k,f._color=u._color,w._color=r,u._color=r,k._color=r,a(u),a(f),_>1){var D=M[_-2];D.left===u?D.left=f:D.right=f}M[_-1]=f;return}else if(f.left&&f.left._color===e){if(f=u.right=n(f),k=f.left=n(f.left),u.right=k.left,f.left=k.right,k.left=u,k.right=f,k._color=u._color,u._color=r,f._color=r,w._color=r,a(u),a(f),a(k),_>1){var D=M[_-2];D.left===u?D.left=k:D.right=k}M[_-1]=k;return}if(f._color===r)if(u._color===e){u._color=r,u.right=o(e,f);return}else{u.right=o(e,f);continue}else{if(f=n(f),u.right=f.left,f.left=u,f._color=u._color,u._color=e,a(u),a(f),_>1){var D=M[_-2];D.left===u?D.left=f:D.right=f}M[_-1]=f,M[_]=u,_+1<M.length?M[_+1]=w:M.push(w),_=_+2}}else{if(f=u.left,f.left&&f.left._color===e){if(f=u.left=n(f),k=f.left=n(f.left),u.left=f.right,f.right=u,f.left=k,f._color=u._color,w._color=r,u._color=r,k._color=r,a(u),a(f),_>1){var D=M[_-2];D.right===u?D.right=f:D.left=f}M[_-1]=f;return}else if(f.right&&f.right._color===e){if(f=u.left=n(f),k=f.right=n(f.right),u.left=k.right,f.right=k.left,k.right=u,k.left=f,k._color=u._color,u._color=r,f._color=r,w._color=r,a(u),a(f),a(k),_>1){var D=M[_-2];D.right===u?D.right=k:D.left=k}M[_-1]=k;return}if(f._color===r)if(u._color===e){u._color=r,u.left=o(e,f);return}else{u.left=o(e,f);continue}else{if(f=n(f),u.left=f.right,f.right=u,f._color=u._color,u._color=e,a(u),a(f),_>1){var D=M[_-2];D.right===u?D.right=f:D.left=f}M[_-1]=f,M[_]=u,_+1<M.length?M[_+1]=w:M.push(w),_=_+2}}}}l.remove=function(){var M=this._stack;if(M.length===0)return this.tree;var w=new Array(M.length),u=M[M.length-1];w[w.length-1]=new i(u._color,u.key,u.value,u.left,u.right,u._count);for(var f=M.length-2;f>=0;--f){var u=M[f];u.left===M[f+1]?w[f]=new i(u._color,u.key,u.value,w[f+1],u.right,u._count):w[f]=new i(u._color,u.key,u.value,u.left,w[f+1],u._count)}if(u=w[w.length-1],u.left&&u.right){var k=w.length;for(u=u.left;u.right;)w.push(u),u=u.right;var _=w[k-1];w.push(new i(u._color,_.key,_.value,u.left,u.right,u._count)),w[k-1].key=u.key,w[k-1].value=u.value;for(var f=w.length-2;f>=k;--f)u=w[f],w[f]=new i(u._color,u.key,u.value,u.left,w[f+1],u._count);w[k-1].left=w[k]}if(u=w[w.length-1],u._color===e){var D=w[w.length-2];D.left===u?D.left=null:D.right===u&&(D.right=null),w.pop();for(var f=0;f<w.length;++f)w[f]._count--;return new s(this.tree._compare,w[0])}else if(u.left||u.right){u.left?x(u,u.left):u.right&&x(u,u.right),u._color=r;for(var f=0;f<w.length-1;++f)w[f]._count--;return new s(this.tree._compare,w[0])}else{if(w.length===1)return new s(this.tree._compare,null);for(var f=0;f<w.length;++f)w[f]._count--;var I=w[w.length-2];b(w),I.left===u?I.left=null:I.right=null}return new s(this.tree._compare,w[0])},Object.defineProperty(l,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(l,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(l,"index",{get:function(){var M=0,w=this._stack;if(w.length===0){var u=this.tree.root;return u?u._count:0}else w[w.length-1].left&&(M=w[w.length-1].left._count);for(var f=w.length-2;f>=0;--f)w[f+1]===w[f].right&&(++M,w[f].left&&(M+=w[f].left._count));return M},enumerable:!0}),l.next=function(){var M=this._stack;if(M.length!==0){var w=M[M.length-1];if(w.right)for(w=w.right;w;)M.push(w),w=w.left;else for(M.pop();M.length>0&&M[M.length-1].right===w;)w=M[M.length-1],M.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var M=this._stack;if(M.length===0)return!1;if(M[M.length-1].right)return!0;for(var w=M.length-1;w>0;--w)if(M[w-1].left===M[w])return!0;return!1}}),l.update=function(M){var w=this._stack;if(w.length===0)throw new Error("Can't update empty node!");var u=new Array(w.length),f=w[w.length-1];u[u.length-1]=new i(f._color,f.key,M,f.left,f.right,f._count);for(var k=w.length-2;k>=0;--k)f=w[k],f.left===w[k+1]?u[k]=new i(f._color,f.key,f.value,u[k+1],f.right,f._count):u[k]=new i(f._color,f.key,f.value,f.left,u[k+1],f._count);return new s(this.tree._compare,u[0])},l.prev=function(){var M=this._stack;if(M.length!==0){var w=M[M.length-1];if(w.left)for(w=w.left;w;)M.push(w),w=w.right;else for(M.pop();M.length>0&&M[M.length-1].left===w;)w=M[M.length-1],M.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var M=this._stack;if(M.length===0)return!1;if(M[M.length-1].left)return!0;for(var w=M.length-1;w>0;--w)if(M[w-1].right===M[w])return!0;return!1}});function S(M,w){return M<w?-1:M>w?1:0}function T(M){return new s(M||S,null)}},3837:function(t,e,r){t.exports=I;var i=r(4935),n=r(501),o=r(5304),a=r(6429),s=r(6444),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),v=ArrayBuffer,m=DataView;function p(O){return v.isView(O)&&!(O instanceof m)}function y(O){return Array.isArray(O)||p(O)}function l(O,B){return O[0]=B[0],O[1]=B[1],O[2]=B[2],O}function x(O){this.gl=O,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=o(O)}var b=x.prototype;b.update=function(O){O=O||{};function B(Q,nt,Y){if(Y in O){var q=O[Y],ot=this[Y],it;(Q?y(q)&&y(q[0]):y(q))?this[Y]=it=[nt(q[0]),nt(q[1]),nt(q[2])]:this[Y]=it=[nt(q),nt(q),nt(q)];for(var dt=0;dt<3;++dt)if(it[dt]!==ot[dt])return!0}return!1}var R=B.bind(this,!1,Number),L=B.bind(this,!1,Boolean),F=B.bind(this,!1,String),N=B.bind(this,!0,function(Q){if(y(Q)){if(Q.length===3)return[+Q[0],+Q[1],+Q[2],1];if(Q.length===4)return[+Q[0],+Q[1],+Q[2],+Q[3]]}return[0,0,0,1]}),j,G=!1,rt=!1;if("bounds"in O)for(var ct=O.bounds,lt=0;lt<2;++lt)for(var tt=0;tt<3;++tt)ct[lt][tt]!==this.bounds[lt][tt]&&(rt=!0),this.bounds[lt][tt]=ct[lt][tt];if("ticks"in O){j=O.ticks,G=!0,this.autoTicks=!1;for(var lt=0;lt<3;++lt)this.tickSpacing[lt]=0}else R("tickSpacing")&&(this.autoTicks=!0,rt=!0);if(this._firstInit&&("ticks"in O||"tickSpacing"in O||(this.autoTicks=!0),rt=!0,G=!0,this._firstInit=!1),rt&&this.autoTicks&&(j=s.create(this.bounds,this.tickSpacing),G=!0),G){for(var lt=0;lt<3;++lt)j[lt].sort(function(nt,Y){return nt.x-Y.x});s.equal(j,this.ticks)?G=!1:this.ticks=j}L("tickEnable"),F("tickFont")&&(G=!0),F("tickFontStyle")&&(G=!0),F("tickFontWeight")&&(G=!0),F("tickFontVariant")&&(G=!0),R("tickSize"),R("tickAngle"),R("tickPad"),N("tickColor");var Z=F("labels");F("labelFont")&&(Z=!0),F("labelFontStyle")&&(Z=!0),F("labelFontWeight")&&(Z=!0),F("labelFontVariant")&&(Z=!0),L("labelEnable"),R("labelSize"),R("labelPad"),N("labelColor"),L("lineEnable"),L("lineMirror"),R("lineWidth"),N("lineColor"),L("lineTickEnable"),L("lineTickMirror"),R("lineTickLength"),R("lineTickWidth"),N("lineTickColor"),L("gridEnable"),R("gridWidth"),N("gridColor"),L("zeroEnable"),N("zeroLineColor"),R("zeroLineWidth"),L("backgroundEnable"),N("backgroundColor");var st=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],$=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(Z||G)&&this._text.update(this.bounds,this.labels,st,this.ticks,$):this._text=i(this.gl,this.bounds,this.labels,st,this.ticks,$),this._lines&&G&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=n(this.gl,this.bounds,this.ticks))};function S(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var T=[new S,new S,new S];function M(O,B,R,L,F){for(var N=O.primalOffset,j=O.primalMinor,G=O.mirrorOffset,rt=O.mirrorMinor,ct=L[B],lt=0;lt<3;++lt)if(B!==lt){var tt=N,Z=G,st=j,$=rt;ct&1<<lt&&(tt=G,Z=N,st=rt,$=j),tt[lt]=R[0][lt],Z[lt]=R[1][lt],F[lt]>0?(st[lt]=-1,$[lt]=0):(st[lt]=0,$[lt]=1)}}var w=[0,0,0],u={model:h,view:h,projection:h,_ortho:!1};b.isOpaque=function(){return!0},b.isTransparent=function(){return!1},b.drawTransparent=function(O){};var f=0,k=[0,0,0],_=[0,0,0],D=[0,0,0];b.draw=function(O){O=O||u;for(var B=this.gl,R=O.model||h,L=O.view||h,F=O.projection||h,N=this.bounds,j=O._ortho||!1,G=a(R,L,F,N,j),rt=G.cubeEdges,ct=G.axis,lt=L[12],tt=L[13],Z=L[14],st=L[15],$=j?2:1,Q=$*this.pixelRatio*(F[3]*lt+F[7]*tt+F[11]*Z+F[15]*st)/B.drawingBufferHeight,nt=0;nt<3;++nt)this.lastCubeProps.cubeEdges[nt]=rt[nt],this.lastCubeProps.axis[nt]=ct[nt];for(var Y=T,nt=0;nt<3;++nt)M(T[nt],nt,this.bounds,rt,ct);for(var B=this.gl,q=w,nt=0;nt<3;++nt)this.backgroundEnable[nt]?q[nt]=ct[nt]:q[nt]=0;this._background.draw(R,L,F,N,q,this.backgroundColor),this._lines.bind(R,L,F,this);for(var nt=0;nt<3;++nt){var ot=[0,0,0];ct[nt]>0?ot[nt]=N[1][nt]:ot[nt]=N[0][nt];for(var it=0;it<2;++it){var dt=(nt+1+it)%3,wt=(nt+1+(it^1))%3;this.gridEnable[dt]&&this._lines.drawGrid(dt,wt,this.bounds,ot,this.gridColor[dt],this.gridWidth[dt]*this.pixelRatio)}for(var it=0;it<2;++it){var dt=(nt+1+it)%3,wt=(nt+1+(it^1))%3;this.zeroEnable[wt]&&Math.min(N[0][wt],N[1][wt])<=0&&Math.max(N[0][wt],N[1][wt])>=0&&this._lines.drawZero(dt,wt,this.bounds,ot,this.zeroLineColor[wt],this.zeroLineWidth[wt]*this.pixelRatio)}}for(var nt=0;nt<3;++nt){this.lineEnable[nt]&&this._lines.drawAxisLine(nt,this.bounds,Y[nt].primalOffset,this.lineColor[nt],this.lineWidth[nt]*this.pixelRatio),this.lineMirror[nt]&&this._lines.drawAxisLine(nt,this.bounds,Y[nt].mirrorOffset,this.lineColor[nt],this.lineWidth[nt]*this.pixelRatio);for(var xt=l(k,Y[nt].primalMinor),Ft=l(_,Y[nt].mirrorMinor),Et=this.lineTickLength,it=0;it<3;++it){var Nt=Q/R[5*it];xt[it]*=Et[it]*Nt,Ft[it]*=Et[it]*Nt}this.lineTickEnable[nt]&&this._lines.drawAxisTicks(nt,Y[nt].primalOffset,xt,this.lineTickColor[nt],this.lineTickWidth[nt]*this.pixelRatio),this.lineTickMirror[nt]&&this._lines.drawAxisTicks(nt,Y[nt].mirrorOffset,Ft,this.lineTickColor[nt],this.lineTickWidth[nt]*this.pixelRatio)}this._lines.unbind(),this._text.bind(R,L,F,this.pixelRatio);var te,Jt=.5,Qt,Wt;function gt(le){Wt=[0,0,0],Wt[le]=1}function bt(le,Te,Se){var Fe=(le+1)%3,Oe=(le+2)%3,ur=Te[Fe],fr=Te[Oe],We=Se[Fe],Lr=Se[Oe];if(ur>0&&Lr>0){gt(Fe);return}else if(ur>0&&Lr<0){gt(Fe);return}else if(ur<0&&Lr>0){gt(Fe);return}else if(ur<0&&Lr<0){gt(Fe);return}else if(fr>0&&We>0){gt(Oe);return}else if(fr>0&&We<0){gt(Oe);return}else if(fr<0&&We>0){gt(Oe);return}else if(fr<0&&We<0){gt(Oe);return}}for(var nt=0;nt<3;++nt){for(var vt=Y[nt].primalMinor,Ut=Y[nt].mirrorMinor,Kt=l(D,Y[nt].primalOffset),it=0;it<3;++it)this.lineTickEnable[nt]&&(Kt[it]+=Q*vt[it]*Math.max(this.lineTickLength[it],0)/R[5*it]);var Zt=[0,0,0];if(Zt[nt]=1,this.tickEnable[nt]){this.tickAngle[nt]===-3600?(this.tickAngle[nt]=0,this.tickAlign[nt]="auto"):this.tickAlign[nt]=-1,Qt=1,te=[this.tickAlign[nt],Jt,Qt],te[0]==="auto"?te[0]=f:te[0]=parseInt(""+te[0]),Wt=[0,0,0],bt(nt,vt,Ut);for(var it=0;it<3;++it)Kt[it]+=Q*vt[it]*this.tickPad[it]/R[5*it];this._text.drawTicks(nt,this.tickSize[nt],this.tickAngle[nt],Kt,this.tickColor[nt],Zt,Wt,te)}if(this.labelEnable[nt]){Qt=0,Wt=[0,0,0],this.labels[nt].length>4&&(gt(nt),Qt=1),te=[this.labelAlign[nt],Jt,Qt],te[0]==="auto"?te[0]=f:te[0]=parseInt(""+te[0]);for(var it=0;it<3;++it)Kt[it]+=Q*vt[it]*this.labelPad[it]/R[5*it];Kt[nt]+=.5*(N[0][nt]+N[1][nt]),this._text.drawLabel(nt,this.labelSize[nt],this.labelAngle[nt],Kt,this.labelColor[nt],[0,0,0],Wt,te)}}this._text.unbind()},b.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function I(O,B){var R=new x(O);return R.update(B),R}},5304:function(t,e,r){t.exports=h;var i=r(2762),n=r(8116),o=r(1879).bg;function a(v,m,p,y){this.gl=v,this.buffer=m,this.vao=p,this.shader=y}var s=a.prototype;s.draw=function(v,m,p,y,l,x){for(var b=!1,S=0;S<3;++S)b=b||l[S];if(b){var T=this.gl;T.enable(T.POLYGON_OFFSET_FILL),T.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:v,view:m,projection:p,bounds:y,enable:l,colors:x},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),T.disable(T.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function h(v){for(var m=[],p=[],y=0,l=0;l<3;++l)for(var x=(l+1)%3,b=(l+2)%3,S=[0,0,0],T=[0,0,0],M=-1;M<=1;M+=2){p.push(y,y+2,y+1,y+1,y+2,y+3),S[l]=M,T[l]=M;for(var w=-1;w<=1;w+=2){S[x]=w;for(var u=-1;u<=1;u+=2)S[b]=u,m.push(S[0],S[1],S[2],T[0],T[1],T[2]),y+=1}var f=x;x=b,b=f}var k=i(v,new Float32Array(m)),_=i(v,new Uint16Array(p),v.ELEMENT_ARRAY_BUFFER),D=n(v,[{buffer:k,type:v.FLOAT,size:3,offset:0,stride:24},{buffer:k,type:v.FLOAT,size:3,offset:12,stride:24}],_),I=o(v);return I.attributes.position.location=0,I.attributes.normal.location=1,new a(v,k,D,I)}},6429:function(t,e,r){t.exports=M;var i=r(8828),n=r(6760),o=r(5202),a=r(3250),s=new Array(16),h=new Array(8),v=new Array(8),m=new Array(3),p=[0,0,0];(function(){for(var w=0;w<8;++w)h[w]=[1,1,1,1],v[w]=[1,1,1]})();function y(w,u,f){for(var k=0;k<4;++k){w[k]=f[12+k];for(var _=0;_<3;++_)w[k]+=u[_]*f[4*_+k]}}var l=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function x(w){for(var u=0;u<l.length;++u)if(w=o.positive(w,l[u]),w.length<3)return 0;for(var f=w[0],k=f[0]/f[3],_=f[1]/f[3],D=0,u=1;u+1<w.length;++u){var I=w[u],O=w[u+1],B=I[0]/I[3],R=I[1]/I[3],L=O[0]/O[3],F=O[1]/O[3],N=B-k,j=R-_,G=L-k,rt=F-_;D+=Math.abs(N*rt-j*G)}return D}var b=[1,1,1],S=[0,0,0],T={cubeEdges:b,axis:S};function M(w,u,f,k,_){n(s,u,w),n(s,f,s);for(var D=0,I=0;I<2;++I){m[2]=k[I][2];for(var O=0;O<2;++O){m[1]=k[O][1];for(var B=0;B<2;++B)m[0]=k[B][0],y(h[D],m,s),D+=1}}for(var R=-1,I=0;I<8;++I){for(var L=h[I][3],F=0;F<3;++F)v[I][F]=h[I][F]/L;_&&(v[I][2]*=-1),L<0&&(R<0||v[I][2]<v[R][2])&&(R=I)}if(R<0){R=0;for(var N=0;N<3;++N){for(var j=(N+2)%3,G=(N+1)%3,rt=-1,ct=-1,lt=0;lt<2;++lt){var tt=lt<<N,Z=tt+(lt<<j)+(1-lt<<G),st=tt+(1-lt<<j)+(lt<<G);a(v[tt],v[Z],v[st],p)<0||(lt?rt=1:ct=1)}if(rt<0||ct<0){ct>rt&&(R|=1<<N);continue}for(var lt=0;lt<2;++lt){var tt=lt<<N,Z=tt+(lt<<j)+(1-lt<<G),st=tt+(1-lt<<j)+(lt<<G),$=x([h[tt],h[Z],h[st],h[tt+(1<<j)+(1<<G)]]);lt?rt=$:ct=$}if(ct>rt){R|=1<<N;continue}}}for(var Q=7^R,nt=-1,I=0;I<8;++I)I===R||I===Q||(nt<0||v[nt][1]>v[I][1])&&(nt=I);for(var Y=-1,I=0;I<3;++I){var q=nt^1<<I;if(!(q===R||q===Q)){Y<0&&(Y=q);var G=v[q];G[0]<v[Y][0]&&(Y=q)}}for(var ot=-1,I=0;I<3;++I){var q=nt^1<<I;if(!(q===R||q===Q||q===Y)){ot<0&&(ot=q);var G=v[q];G[0]>v[ot][0]&&(ot=q)}}var it=b;it[0]=it[1]=it[2]=0,it[i.log2(Y^nt)]=nt&Y,it[i.log2(nt^ot)]=nt&ot;var dt=ot^7;dt===R||dt===Q?(dt=Y^7,it[i.log2(ot^dt)]=dt&ot):it[i.log2(Y^dt)]=dt&Y;for(var wt=S,xt=R,N=0;N<3;++N)xt&1<<N?wt[N]=-1:wt[N]=1;return T}},501:function(t,e,r){t.exports=b;var i=r(2762),n=r(8116),o=r(1879).n,a=[0,0,0],s=[0,0,0],h=[0,0,0],v=[0,0,0],m=[1,1];function p(S){return S[0]=S[1]=S[2]=0,S}function y(S,T){return S[0]=T[0],S[1]=T[1],S[2]=T[2],S}function l(S,T,M,w,u,f,k,_){this.gl=S,this.vertBuffer=T,this.vao=M,this.shader=w,this.tickCount=u,this.tickOffset=f,this.gridCount=k,this.gridOffset=_}var x=l.prototype;x.bind=function(S,T,M){this.shader.bind(),this.shader.uniforms.model=S,this.shader.uniforms.view=T,this.shader.uniforms.projection=M,m[0]=this.gl.drawingBufferWidth,m[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=m,this.vao.bind()},x.unbind=function(){this.vao.unbind()},x.drawAxisLine=function(S,T,M,w,u){var f=p(s);this.shader.uniforms.majorAxis=s,f[S]=T[1][S]-T[0][S],this.shader.uniforms.minorAxis=f;var k=y(v,M);k[S]+=T[0][S],this.shader.uniforms.offset=k,this.shader.uniforms.lineWidth=u,this.shader.uniforms.color=w;var _=p(h);_[(S+2)%3]=1,this.shader.uniforms.screenAxis=_,this.vao.draw(this.gl.TRIANGLES,6);var _=p(h);_[(S+1)%3]=1,this.shader.uniforms.screenAxis=_,this.vao.draw(this.gl.TRIANGLES,6)},x.drawAxisTicks=function(S,T,M,w,u){if(this.tickCount[S]){var f=p(a);f[S]=1,this.shader.uniforms.majorAxis=f,this.shader.uniforms.offset=T,this.shader.uniforms.minorAxis=M,this.shader.uniforms.color=w,this.shader.uniforms.lineWidth=u;var k=p(h);k[S]=1,this.shader.uniforms.screenAxis=k,this.vao.draw(this.gl.TRIANGLES,this.tickCount[S],this.tickOffset[S])}},x.drawGrid=function(S,T,M,w,u,f){if(this.gridCount[S]){var k=p(s);k[T]=M[1][T]-M[0][T],this.shader.uniforms.minorAxis=k;var _=y(v,w);_[T]+=M[0][T],this.shader.uniforms.offset=_;var D=p(a);D[S]=1,this.shader.uniforms.majorAxis=D;var I=p(h);I[S]=1,this.shader.uniforms.screenAxis=I,this.shader.uniforms.lineWidth=f,this.shader.uniforms.color=u,this.vao.draw(this.gl.TRIANGLES,this.gridCount[S],this.gridOffset[S])}},x.drawZero=function(S,T,M,w,u,f){var k=p(s);this.shader.uniforms.majorAxis=k,k[S]=M[1][S]-M[0][S],this.shader.uniforms.minorAxis=k;var _=y(v,w);_[S]+=M[0][S],this.shader.uniforms.offset=_;var D=p(h);D[T]=1,this.shader.uniforms.screenAxis=D,this.shader.uniforms.lineWidth=f,this.shader.uniforms.color=u,this.vao.draw(this.gl.TRIANGLES,6)},x.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()};function b(S,T,M){var w=[],u=[0,0,0],f=[0,0,0],k=[0,0,0],_=[0,0,0];w.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var D=0;D<3;++D){for(var I=w.length/3|0,O=0;O<M[D].length;++O){var B=+M[D][O].x;w.push(B,0,1,B,1,1,B,0,-1,B,0,-1,B,1,1,B,1,-1)}var L=w.length/3|0;u[D]=I,f[D]=L-I;for(var I=w.length/3|0,R=0;R<M[D].length;++R){var B=+M[D][R].x;w.push(B,0,1,B,1,1,B,0,-1,B,0,-1,B,1,1,B,1,-1)}var L=w.length/3|0;k[D]=I,_[D]=L-I}var F=i(S,new Float32Array(w)),N=n(S,[{buffer:F,type:S.FLOAT,size:3,stride:0,offset:0}]),j=o(S);return j.attributes.position.location=0,new l(S,F,N,j,f,u,_,k)}},1879:function(t,e,r){var i=r(3236),n=r(9405),o=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position;
|
||
|
||
uniform mat4 model, view, projection;
|
||
uniform vec3 offset, majorAxis, minorAxis, screenAxis;
|
||
uniform float lineWidth;
|
||
uniform vec2 screenShape;
|
||
|
||
vec3 project(vec3 p) {
|
||
vec4 pp = projection * (view * (model * vec4(p, 1.0)));
|
||
return pp.xyz / max(pp.w, 0.0001);
|
||
}
|
||
|
||
void main() {
|
||
vec3 major = position.x * majorAxis;
|
||
vec3 minor = position.y * minorAxis;
|
||
|
||
vec3 vPosition = major + minor + offset;
|
||
vec3 pPosition = project(vPosition);
|
||
vec3 offset = project(vPosition + screenAxis * position.z);
|
||
|
||
vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;
|
||
|
||
gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);
|
||
}
|
||
`]),a=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
uniform vec4 color;
|
||
void main() {
|
||
gl_FragColor = color;
|
||
}`]);e.n=function(p){return n(p,o,a,null,[{name:"position",type:"vec3"}])};var s=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position;
|
||
|
||
uniform mat4 model, view, projection;
|
||
uniform vec3 offset, axis, alignDir, alignOpt;
|
||
uniform float scale, angle, pixelScale;
|
||
uniform vec2 resolution;
|
||
|
||
vec3 project(vec3 p) {
|
||
vec4 pp = projection * (view * (model * vec4(p, 1.0)));
|
||
return pp.xyz / max(pp.w, 0.0001);
|
||
}
|
||
|
||
float computeViewAngle(vec3 a, vec3 b) {
|
||
vec3 A = project(a);
|
||
vec3 B = project(b);
|
||
|
||
return atan(
|
||
(B.y - A.y) * resolution.y,
|
||
(B.x - A.x) * resolution.x
|
||
);
|
||
}
|
||
|
||
const float PI = 3.141592;
|
||
const float TWO_PI = 2.0 * PI;
|
||
const float HALF_PI = 0.5 * PI;
|
||
const float ONE_AND_HALF_PI = 1.5 * PI;
|
||
|
||
int option = int(floor(alignOpt.x + 0.001));
|
||
float hv_ratio = alignOpt.y;
|
||
bool enableAlign = (alignOpt.z != 0.0);
|
||
|
||
float mod_angle(float a) {
|
||
return mod(a, PI);
|
||
}
|
||
|
||
float positive_angle(float a) {
|
||
return mod_angle((a < 0.0) ?
|
||
a + TWO_PI :
|
||
a
|
||
);
|
||
}
|
||
|
||
float look_upwards(float a) {
|
||
float b = positive_angle(a);
|
||
return ((b > HALF_PI) && (b <= ONE_AND_HALF_PI)) ?
|
||
b - PI :
|
||
b;
|
||
}
|
||
|
||
float look_horizontal_or_vertical(float a, float ratio) {
|
||
// ratio controls the ratio between being horizontal to (vertical + horizontal)
|
||
// if ratio is set to 0.5 then it is 50%, 50%.
|
||
// when using a higher ratio e.g. 0.75 the result would
|
||
// likely be more horizontal than vertical.
|
||
|
||
float b = positive_angle(a);
|
||
|
||
return
|
||
(b < ( ratio) * HALF_PI) ? 0.0 :
|
||
(b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :
|
||
(b < (2.0 + ratio) * HALF_PI) ? 0.0 :
|
||
(b < (4.0 - ratio) * HALF_PI) ? HALF_PI :
|
||
0.0;
|
||
}
|
||
|
||
float roundTo(float a, float b) {
|
||
return float(b * floor((a + 0.5 * b) / b));
|
||
}
|
||
|
||
float look_round_n_directions(float a, int n) {
|
||
float b = positive_angle(a);
|
||
float div = TWO_PI / float(n);
|
||
float c = roundTo(b, div);
|
||
return look_upwards(c);
|
||
}
|
||
|
||
float applyAlignOption(float rawAngle, float delta) {
|
||
return
|
||
(option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions
|
||
(option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical
|
||
(option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis
|
||
(option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards
|
||
(option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal
|
||
rawAngle; // otherwise return back raw input angle
|
||
}
|
||
|
||
bool isAxisTitle = (axis.x == 0.0) &&
|
||
(axis.y == 0.0) &&
|
||
(axis.z == 0.0);
|
||
|
||
void main() {
|
||
//Compute world offset
|
||
float axisDistance = position.z;
|
||
vec3 dataPosition = axisDistance * axis + offset;
|
||
|
||
float beta = angle; // i.e. user defined attributes for each tick
|
||
|
||
float axisAngle;
|
||
float clipAngle;
|
||
float flip;
|
||
|
||
if (enableAlign) {
|
||
axisAngle = (isAxisTitle) ? HALF_PI :
|
||
computeViewAngle(dataPosition, dataPosition + axis);
|
||
clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);
|
||
|
||
axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;
|
||
clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;
|
||
|
||
flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),
|
||
vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;
|
||
|
||
beta += applyAlignOption(clipAngle, flip * PI);
|
||
}
|
||
|
||
//Compute plane offset
|
||
vec2 planeCoord = position.xy * pixelScale;
|
||
|
||
mat2 planeXform = scale * mat2(
|
||
cos(beta), sin(beta),
|
||
-sin(beta), cos(beta)
|
||
);
|
||
|
||
vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;
|
||
|
||
//Compute clip position
|
||
vec3 clipPosition = project(dataPosition);
|
||
|
||
//Apply text offset in clip coordinates
|
||
clipPosition += vec3(viewOffset, 0.0);
|
||
|
||
//Done
|
||
gl_Position = vec4(clipPosition, 1.0);
|
||
}
|
||
`]),h=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
uniform vec4 color;
|
||
void main() {
|
||
gl_FragColor = color;
|
||
}`]);e.Q=function(p){return n(p,s,h,null,[{name:"position",type:"vec3"}])};var v=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position;
|
||
attribute vec3 normal;
|
||
|
||
uniform mat4 model, view, projection;
|
||
uniform vec3 enable;
|
||
uniform vec3 bounds[2];
|
||
|
||
varying vec3 colorChannel;
|
||
|
||
void main() {
|
||
|
||
vec3 signAxis = sign(bounds[1] - bounds[0]);
|
||
|
||
vec3 realNormal = signAxis * normal;
|
||
|
||
if(dot(realNormal, enable) > 0.0) {
|
||
vec3 minRange = min(bounds[0], bounds[1]);
|
||
vec3 maxRange = max(bounds[0], bounds[1]);
|
||
vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));
|
||
gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));
|
||
} else {
|
||
gl_Position = vec4(0,0,0,0);
|
||
}
|
||
|
||
colorChannel = abs(realNormal);
|
||
}
|
||
`]),m=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
uniform vec4 colors[3];
|
||
|
||
varying vec3 colorChannel;
|
||
|
||
void main() {
|
||
gl_FragColor = colorChannel.x * colors[0] +
|
||
colorChannel.y * colors[1] +
|
||
colorChannel.z * colors[2];
|
||
}`]);e.bg=function(p){return n(p,v,m,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(t,e,r){t.exports=x;var i=r(2762),n=r(8116),o=r(4359),a=r(1879).Q,s=window||process.global||{},h=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var v=3;function m(b,S,T,M){this.gl=b,this.shader=S,this.buffer=T,this.vao=M,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var p=m.prototype,y=[0,0];p.bind=function(b,S,T,M){this.vao.bind(),this.shader.bind();var w=this.shader.uniforms;w.model=b,w.view=S,w.projection=T,w.pixelScale=M,y[0]=this.gl.drawingBufferWidth,y[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=y},p.unbind=function(){this.vao.unbind()},p.update=function(b,S,T,M,w){var u=[];function f(N,j,G,rt,ct,lt){var tt=[G.style,G.weight,G.variant,G.family].join("_"),Z=h[tt];Z||(Z=h[tt]={});var st=Z[j];st||(st=Z[j]=l(j,{triangles:!0,font:G.family,fontStyle:G.style,fontWeight:G.weight,fontVariant:G.variant,textAlign:"center",textBaseline:"middle",lineSpacing:ct,styletags:lt}));for(var $=(rt||12)/12,Q=st.positions,nt=st.cells,Y=0,q=nt.length;Y<q;++Y)for(var ot=nt[Y],it=2;it>=0;--it){var dt=Q[ot[it]];u.push($*dt[0],-$*dt[1],N)}}for(var k=[0,0,0],_=[0,0,0],D=[0,0,0],I=[0,0,0],O=1.25,B={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},R=0;R<3;++R){D[R]=u.length/v|0,f(.5*(b[0][R]+b[1][R]),S[R],T[R],12,O,B),I[R]=(u.length/v|0)-D[R],k[R]=u.length/v|0;for(var L=0;L<M[R].length;++L)if(M[R][L].text){var F={family:M[R][L].font||w[R].family,style:w[R].fontStyle||w[R].style,weight:w[R].fontWeight||w[R].weight,variant:w[R].fontVariant||w[R].variant};f(M[R][L].x,M[R][L].text,F,M[R][L].fontSize||12,O,B)}_[R]=(u.length/v|0)-k[R]}this.buffer.update(u),this.tickOffset=k,this.tickCount=_,this.labelOffset=D,this.labelCount=I},p.drawTicks=function(b,S,T,M,w,u,f,k){this.tickCount[b]&&(this.shader.uniforms.axis=u,this.shader.uniforms.color=w,this.shader.uniforms.angle=T,this.shader.uniforms.scale=S,this.shader.uniforms.offset=M,this.shader.uniforms.alignDir=f,this.shader.uniforms.alignOpt=k,this.vao.draw(this.gl.TRIANGLES,this.tickCount[b],this.tickOffset[b]))},p.drawLabel=function(b,S,T,M,w,u,f,k){this.labelCount[b]&&(this.shader.uniforms.axis=u,this.shader.uniforms.color=w,this.shader.uniforms.angle=T,this.shader.uniforms.scale=S,this.shader.uniforms.offset=M,this.shader.uniforms.alignDir=f,this.shader.uniforms.alignOpt=k,this.vao.draw(this.gl.TRIANGLES,this.labelCount[b],this.labelOffset[b]))},p.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function l(b,S){try{return o(b,S)}catch(T){return console.warn('error vectorizing text:"'+b+'" error:',T),{cells:[],positions:[]}}}function x(b,S,T,M,w,u){var f=i(b),k=n(b,[{buffer:f,size:3}]),_=a(b);_.attributes.position.location=0;var D=new m(b,_,f,k);return D.update(S,T,M,w,u),D}},6444:function(t,e){e.create=i,e.equal=n;function r(o,a){var s=o+"",h=s.indexOf("."),v=0;h>=0&&(v=s.length-h-1);var m=Math.pow(10,v),p=Math.round(o*a*m),y=p+"";if(y.indexOf("e")>=0)return y;var l=p/m,x=p%m;p<0?(l=-Math.ceil(l)|0,x=-x|0):(l=Math.floor(l)|0,x=x|0);var b=""+l;if(p<0&&(b="-"+b),v){for(var S=""+x;S.length<v;)S="0"+S;return b+"."+S}else return b}function i(o,a){for(var s=[],h=0;h<3;++h){for(var v=[],m=.5*(o[0][h]+o[1][h]),p=0;p*a[h]<=o[1][h];++p)v.push({x:p*a[h],text:r(a[h],p)});for(var p=-1;p*a[h]>=o[0][h];--p)v.push({x:p*a[h],text:r(a[h],p)});s.push(v)}return s}function n(o,a){for(var s=0;s<3;++s){if(o[s].length!==a[s].length)return!1;for(var h=0;h<o[s].length;++h){var v=o[s][h],m=a[s][h];if(v.x!==m.x||v.text!==m.text||v.font!==m.font||v.fontColor!==m.fontColor||v.fontSize!==m.fontSize||v.dx!==m.dx||v.dy!==m.dy)return!1}}return!0}},5445:function(t,e,r){t.exports=T;var i=r(5033),n=r(5202),o=r(6429),a=r(6760),s=r(5665),h=r(5352),v=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),m=new Float32Array(16);function p(M,w,u){this.lo=M,this.hi=w,this.pixelsPerDataUnit=u}var y=[0,0,0,1],l=[0,0,0,1];function x(M,w,u,f,k){for(var _=0;_<3;++_){for(var D=y,I=l,O=0;O<3;++O)I[O]=D[O]=u[O];I[3]=D[3]=1,I[_]+=1,h(I,I,w),I[3]<0&&(M[_]=1/0),D[_]-=1,h(D,D,w),D[3]<0&&(M[_]=1/0);var B=(D[0]/D[3]-I[0]/I[3])*f,R=(D[1]/D[3]-I[1]/I[3])*k;M[_]=.25*Math.sqrt(B*B+R*R)}return M}var b=[new p(1/0,-1/0,1/0),new p(1/0,-1/0,1/0),new p(1/0,-1/0,1/0)],S=[0,0,0];function T(M,w,u,f,R){var _=w.model||v,D=w.view||v,I=w.projection||v,O=w._ortho||!1,B=M.bounds,R=R||o(_,D,I,B,O),L=R.axis;a(m,D,_),a(m,I,m);for(var F=b,N=0;N<3;++N)F[N].lo=1/0,F[N].hi=-1/0,F[N].pixelsPerDataUnit=1/0;var j=i(s(m,m));s(m,m);for(var G=0;G<3;++G){var rt=(G+1)%3,ct=(G+2)%3,lt=S;t:for(var N=0;N<2;++N){var tt=[];if(L[G]<0!=!!N){lt[G]=B[N][G];for(var Z=0;Z<2;++Z){lt[rt]=B[Z^N][rt];for(var st=0;st<2;++st)lt[ct]=B[st^Z^N][ct],tt.push(lt.slice())}for(var $=O?5:4,Z=$;Z===$;++Z){if(tt.length===0)continue t;tt=n.positive(tt,j[Z])}for(var Z=0;Z<tt.length;++Z)for(var ct=tt[Z],Q=x(S,m,ct,u,f),st=0;st<3;++st)F[st].lo=Math.min(F[st].lo,ct[st]),F[st].hi=Math.max(F[st].hi,ct[st]),st!==G&&(F[st].pixelsPerDataUnit=Math.min(F[st].pixelsPerDataUnit,Math.abs(Q[st])))}}}return F}},2762:function(t,e,r){var i=r(1888),n=r(5298),o=r(9618),a=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(l,x,b,S,T){this.gl=l,this.type=x,this.handle=b,this.length=S,this.usage=T}var h=s.prototype;h.bind=function(){this.gl.bindBuffer(this.type,this.handle)},h.unbind=function(){this.gl.bindBuffer(this.type,null)},h.dispose=function(){this.gl.deleteBuffer(this.handle)};function v(l,x,b,S,T,M){var w=T.length*T.BYTES_PER_ELEMENT;if(M<0)return l.bufferData(x,T,S),w;if(w+M>b)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(x,M,T),b}function m(l,x){for(var b=i.malloc(l.length,x),S=l.length,T=0;T<S;++T)b[T]=l[T];return b}function p(l,x){for(var b=1,S=x.length-1;S>=0;--S){if(x[S]!==b)return!1;b*=l[S]}return!0}h.update=function(l,x){if(typeof x!="number"&&(x=-1),this.bind(),typeof l=="object"&&typeof l.shape<"u"){var b=l.dtype;if(a.indexOf(b)<0&&(b="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var S=gl.getExtension("OES_element_index_uint");S&&b!=="uint16"?b="uint32":b="uint16"}if(b===l.dtype&&p(l.shape,l.stride))l.offset===0&&l.data.length===l.shape[0]?this.length=v(this.gl,this.type,this.length,this.usage,l.data,x):this.length=v(this.gl,this.type,this.length,this.usage,l.data.subarray(l.offset,l.shape[0]),x);else{var T=i.malloc(l.size,b),M=o(T,l.shape);n.assign(M,l),x<0?this.length=v(this.gl,this.type,this.length,this.usage,T,x):this.length=v(this.gl,this.type,this.length,this.usage,T.subarray(0,l.size),x),i.free(T)}}else if(Array.isArray(l)){var w;this.type===this.gl.ELEMENT_ARRAY_BUFFER?w=m(l,"uint16"):w=m(l,"float32"),x<0?this.length=v(this.gl,this.type,this.length,this.usage,w,x):this.length=v(this.gl,this.type,this.length,this.usage,w.subarray(0,l.length),x),i.free(w)}else if(typeof l=="object"&&typeof l.length=="number")this.length=v(this.gl,this.type,this.length,this.usage,l,x);else if(typeof l=="number"||l===void 0){if(x>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");l=l|0,l<=0&&(l=1),this.gl.bufferData(this.type,l|0,this.usage),this.length=l}else throw new Error("gl-buffer: Invalid data type")};function y(l,x,b,S){if(b=b||l.ARRAY_BUFFER,S=S||l.DYNAMIC_DRAW,b!==l.ARRAY_BUFFER&&b!==l.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(S!==l.DYNAMIC_DRAW&&S!==l.STATIC_DRAW&&S!==l.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var T=l.createBuffer(),M=new s(l,b,T,0,S);return M.update(x),M}t.exports=y},6405:function(t,e,r){var i=r(2931);t.exports=function(o,a){var s=o.positions,h=o.vectors,v={positions:[],vertexIntensity:[],vertexIntensityBounds:o.vertexIntensityBounds,vectors:[],cells:[],coneOffset:o.coneOffset,colormap:o.colormap};if(o.positions.length===0)return a&&(a[0]=[0,0,0],a[1]=[0,0,0]),v;for(var m=0,p=1/0,y=-1/0,l=1/0,x=-1/0,b=1/0,S=-1/0,T=null,M=null,w=[],u=1/0,f=!1,k=o.coneSizemode==="raw",_=0;_<s.length;_++){var D=s[_];p=Math.min(D[0],p),y=Math.max(D[0],y),l=Math.min(D[1],l),x=Math.max(D[1],x),b=Math.min(D[2],b),S=Math.max(D[2],S);var I=h[_];if(i.length(I)>m&&(m=i.length(I)),_&&!k){var O=2*i.distance(T,D)/(i.length(M)+i.length(I));O?(u=Math.min(u,O),f=!1):f=!0}f||(T=D,M=I),w.push(I)}var B=[p,l,b],R=[y,x,S];a&&(a[0]=B,a[1]=R),m===0&&(m=1);var L=1/m;isFinite(u)||(u=1),v.vectorScale=u;var F=o.coneSize||(k?1:.5);o.absoluteConeSize&&(F=o.absoluteConeSize*L),v.coneScale=F;for(var _=0,N=0;_<s.length;_++)for(var D=s[_],j=D[0],G=D[1],rt=D[2],ct=w[_],lt=i.length(ct)*L,tt=0,Z=8;tt<Z;tt++){v.positions.push([j,G,rt,N++]),v.positions.push([j,G,rt,N++]),v.positions.push([j,G,rt,N++]),v.positions.push([j,G,rt,N++]),v.positions.push([j,G,rt,N++]),v.positions.push([j,G,rt,N++]),v.vectors.push(ct),v.vectors.push(ct),v.vectors.push(ct),v.vectors.push(ct),v.vectors.push(ct),v.vectors.push(ct),v.vertexIntensity.push(lt,lt,lt),v.vertexIntensity.push(lt,lt,lt);var st=v.positions.length;v.cells.push([st-6,st-5,st-4],[st-3,st-2,st-1])}return v};var n=r(614);t.exports.createMesh=r(9060),t.exports.createConeMesh=function(o,a){return t.exports.createMesh(o,a,{shaders:n,traceType:"cone"})}},9060:function(t,e,r){var i=r(9405),n=r(2762),o=r(8116),a=r(7766),s=r(6760),h=r(7608),v=r(9618),m=r(6729),p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function y(w,u,f,k,_,D,I,O,B,R,L){this.gl=w,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=u,this.dirty=!0,this.triShader=f,this.pickShader=k,this.trianglePositions=_,this.triangleVectors=D,this.triangleColors=O,this.triangleUVs=B,this.triangleIds=I,this.triangleVAO=R,this.triangleCount=0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.traceType=L,this.tubeScale=1,this.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=p,this._view=p,this._projection=p,this._resolution=[1,1]}var l=y.prototype;l.isOpaque=function(){return this.opacity>=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(w){this.pickId=w};function x(w){for(var u=m({colormap:w,nshades:256,format:"rgba"}),f=new Uint8Array(1024),k=0;k<256;++k){for(var _=u[k],D=0;D<3;++D)f[4*k+D]=_[D];f[4*k+3]=_[3]*255}return v(f,[256,256,4],[4,0,1])}function b(w){for(var u=w.length,f=new Array(u),k=0;k<u;++k)f[k]=w[k][2];return f}l.update=function(w){w=w||{};var u=this.gl;this.dirty=!0,"lightPosition"in w&&(this.lightPosition=w.lightPosition),"opacity"in w&&(this.opacity=w.opacity),"ambient"in w&&(this.ambientLight=w.ambient),"diffuse"in w&&(this.diffuseLight=w.diffuse),"specular"in w&&(this.specularLight=w.specular),"roughness"in w&&(this.roughness=w.roughness),"fresnel"in w&&(this.fresnel=w.fresnel),w.tubeScale!==void 0&&(this.tubeScale=w.tubeScale),w.vectorScale!==void 0&&(this.vectorScale=w.vectorScale),w.coneScale!==void 0&&(this.coneScale=w.coneScale),w.coneOffset!==void 0&&(this.coneOffset=w.coneOffset),w.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=u.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=u.LINEAR,this.texture.setPixels(x(w.colormap)),this.texture.generateMipmap());var f=w.cells,k=w.positions,_=w.vectors;if(!(!k||!f||!_)){var D=[],I=[],O=[],B=[],R=[];this.cells=f,this.positions=k,this.vectors=_;var L=w.meshColor||[1,1,1,1],F=w.vertexIntensity,N=1/0,j=-1/0;if(F)if(w.vertexIntensityBounds)N=+w.vertexIntensityBounds[0],j=+w.vertexIntensityBounds[1];else for(var G=0;G<F.length;++G){var rt=F[G];N=Math.min(N,rt),j=Math.max(j,rt)}else for(var G=0;G<k.length;++G){var rt=k[G][2];N=Math.min(N,rt),j=Math.max(j,rt)}F?this.intensity=F:this.intensity=b(k),this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(var G=0;G<k.length;++G)for(var ct=k[G],lt=0;lt<3;++lt)isNaN(ct[lt])||!isFinite(ct[lt])||(this.bounds[0][lt]=Math.min(this.bounds[0][lt],ct[lt]),this.bounds[1][lt]=Math.max(this.bounds[1][lt],ct[lt]));var tt=0;t:for(var G=0;G<f.length;++G){var Z=f[G];switch(Z.length){case 3:for(var lt=0;lt<3;++lt)for(var st=Z[lt],ct=k[st],$=0;$<3;++$)if(isNaN(ct[$])||!isFinite(ct[$]))continue t;for(var lt=0;lt<3;++lt){var st=Z[2-lt],ct=k[st];D.push(ct[0],ct[1],ct[2],ct[3]);var Q=_[st];I.push(Q[0],Q[1],Q[2],Q[3]||0);var nt=L;nt.length===3?O.push(nt[0],nt[1],nt[2],1):O.push(nt[0],nt[1],nt[2],nt[3]);var Y;F?Y=[(F[st]-N)/(j-N),0]:Y=[(ct[2]-N)/(j-N),0],B.push(Y[0],Y[1]),R.push(G)}tt+=1;break}}this.triangleCount=tt,this.trianglePositions.update(D),this.triangleVectors.update(I),this.triangleColors.update(O),this.triangleUVs.update(B),this.triangleIds.update(new Uint32Array(R))}},l.drawTransparent=l.draw=function(w){w=w||{};for(var u=this.gl,f=w.model||p,k=w.view||p,_=w.projection||p,D=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],I=0;I<3;++I)D[0][I]=Math.max(D[0][I],this.clipBounds[0][I]),D[1][I]=Math.min(D[1][I],this.clipBounds[1][I]);var O={model:f,view:k,projection:_,inverseModel:p.slice(),clipBounds:D,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,texture:0};O.inverseModel=h(O.inverseModel,O.model),u.disable(u.CULL_FACE),this.texture.bind(0);var B=new Array(16);s(B,O.view,O.model),s(B,O.projection,B),h(B,B);for(var I=0;I<3;++I)O.eyePosition[I]=B[12+I]/B[15];for(var R=B[15],I=0;I<3;++I)R+=this.lightPosition[I]*B[4*I+3];for(var I=0;I<3;++I){for(var L=B[12+I],F=0;F<3;++F)L+=B[4*F+I]*this.lightPosition[F];O.lightPosition[I]=L/R}if(this.triangleCount>0){var N=this.triShader;N.bind(),N.uniforms=O,this.triangleVAO.bind(),u.drawArrays(u.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},l.drawPick=function(w){w=w||{};for(var u=this.gl,f=w.model||p,k=w.view||p,_=w.projection||p,D=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],I=0;I<3;++I)D[0][I]=Math.max(D[0][I],this.clipBounds[0][I]),D[1][I]=Math.min(D[1][I],this.clipBounds[1][I]);this._model=[].slice.call(f),this._view=[].slice.call(k),this._projection=[].slice.call(_),this._resolution=[u.drawingBufferWidth,u.drawingBufferHeight];var O={model:f,view:k,projection:_,clipBounds:D,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},B=this.pickShader;B.bind(),B.uniforms=O,this.triangleCount>0&&(this.triangleVAO.bind(),u.drawArrays(u.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},l.pick=function(w){if(!w||w.id!==this.pickId)return null;var u=w.value[0]+256*w.value[1]+65536*w.value[2],f=this.cells[u],k=this.positions[f[1]].slice(0,3),_={position:k,dataCoordinate:k,index:Math.floor(f[1]/48)};return this.traceType==="cone"?_.index=Math.floor(f[1]/48):this.traceType==="streamtube"&&(_.intensity=this.intensity[f[1]],_.velocity=this.vectors[f[1]].slice(0,3),_.divergence=this.vectors[f[1]][3],_.index=u),_},l.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()};function S(w,u){var f=i(w,u.meshShader.vertex,u.meshShader.fragment,null,u.meshShader.attributes);return f.attributes.position.location=0,f.attributes.color.location=2,f.attributes.uv.location=3,f.attributes.vector.location=4,f}function T(w,u){var f=i(w,u.pickShader.vertex,u.pickShader.fragment,null,u.pickShader.attributes);return f.attributes.position.location=0,f.attributes.id.location=1,f.attributes.vector.location=4,f}function M(w,u,f){var k=f.shaders;arguments.length===1&&(u=w,w=u.gl);var _=S(w,k),D=T(w,k),I=a(w,v(new Uint8Array([255,255,255,255]),[1,1,4]));I.generateMipmap(),I.minFilter=w.LINEAR_MIPMAP_LINEAR,I.magFilter=w.LINEAR;var O=n(w),B=n(w),R=n(w),L=n(w),F=n(w),N=o(w,[{buffer:O,type:w.FLOAT,size:4},{buffer:F,type:w.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:R,type:w.FLOAT,size:4},{buffer:L,type:w.FLOAT,size:2},{buffer:B,type:w.FLOAT,size:4}]),j=new y(w,I,_,D,O,B,F,R,L,N,f.traceType||"cone");return j.update(u),j}t.exports=M},614:function(t,e,r){var i=r(3236),n=i([`precision highp float;
|
||
|
||
precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
vec3 getOrthogonalVector(vec3 v) {
|
||
// Return up-vector for only-z vector.
|
||
// Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
|
||
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
|
||
// Assign z = 0, x = -b, y = a:
|
||
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
|
||
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
|
||
return normalize(vec3(-v.y, v.x, 0.0));
|
||
} else {
|
||
return normalize(vec3(0.0, v.z, -v.y));
|
||
}
|
||
}
|
||
|
||
// Calculate the cone vertex and normal at the given index.
|
||
//
|
||
// The returned vertex is for a cone with its top at origin and height of 1.0,
|
||
// pointing in the direction of the vector attribute.
|
||
//
|
||
// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.
|
||
// These vertices are used to make up the triangles of the cone by the following:
|
||
// segment + 0 top vertex
|
||
// segment + 1 perimeter vertex a+1
|
||
// segment + 2 perimeter vertex a
|
||
// segment + 3 center base vertex
|
||
// segment + 4 perimeter vertex a
|
||
// segment + 5 perimeter vertex a+1
|
||
// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.
|
||
// To go from index to segment, floor(index / 6)
|
||
// To go from segment to angle, 2*pi * (segment/segmentCount)
|
||
// To go from index to segment index, index - (segment*6)
|
||
//
|
||
vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {
|
||
|
||
const float segmentCount = 8.0;
|
||
|
||
float index = rawIndex - floor(rawIndex /
|
||
(segmentCount * 6.0)) *
|
||
(segmentCount * 6.0);
|
||
|
||
float segment = floor(0.001 + index/6.0);
|
||
float segmentIndex = index - (segment*6.0);
|
||
|
||
normal = -normalize(d);
|
||
|
||
if (segmentIndex > 2.99 && segmentIndex < 3.01) {
|
||
return mix(vec3(0.0), -d, coneOffset);
|
||
}
|
||
|
||
float nextAngle = (
|
||
(segmentIndex > 0.99 && segmentIndex < 1.01) ||
|
||
(segmentIndex > 4.99 && segmentIndex < 5.01)
|
||
) ? 1.0 : 0.0;
|
||
float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);
|
||
|
||
vec3 v1 = mix(d, vec3(0.0), coneOffset);
|
||
vec3 v2 = v1 - d;
|
||
|
||
vec3 u = getOrthogonalVector(d);
|
||
vec3 v = normalize(cross(u, d));
|
||
|
||
vec3 x = u * cos(angle) * length(d)*0.25;
|
||
vec3 y = v * sin(angle) * length(d)*0.25;
|
||
vec3 v3 = v2 + x + y;
|
||
if (segmentIndex < 3.0) {
|
||
vec3 tx = u * sin(angle);
|
||
vec3 ty = v * -cos(angle);
|
||
vec3 tangent = tx + ty;
|
||
normal = normalize(cross(v3 - v1, tangent));
|
||
}
|
||
|
||
if (segmentIndex == 0.0) {
|
||
return mix(d, vec3(0.0), coneOffset);
|
||
}
|
||
return v3;
|
||
}
|
||
|
||
attribute vec3 vector;
|
||
attribute vec4 color, position;
|
||
attribute vec2 uv;
|
||
|
||
uniform float vectorScale, coneScale, coneOffset;
|
||
uniform mat4 model, view, projection, inverseModel;
|
||
uniform vec3 eyePosition, lightPosition;
|
||
|
||
varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
|
||
varying vec4 f_color;
|
||
varying vec2 f_uv;
|
||
|
||
void main() {
|
||
// Scale the vector magnitude to stay constant with
|
||
// model & view changes.
|
||
vec3 normal;
|
||
vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);
|
||
vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
|
||
|
||
//Lighting geometry parameters
|
||
vec4 cameraCoordinate = view * conePosition;
|
||
cameraCoordinate.xyz /= cameraCoordinate.w;
|
||
f_lightDirection = lightPosition - cameraCoordinate.xyz;
|
||
f_eyeDirection = eyePosition - cameraCoordinate.xyz;
|
||
f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);
|
||
|
||
// vec4 m_position = model * vec4(conePosition, 1.0);
|
||
vec4 t_position = view * conePosition;
|
||
gl_Position = projection * t_position;
|
||
|
||
f_color = color;
|
||
f_data = conePosition.xyz;
|
||
f_position = position.xyz;
|
||
f_uv = uv;
|
||
}
|
||
`]),o=i([`#extension GL_OES_standard_derivatives : enable
|
||
|
||
precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
float beckmannDistribution(float x, float roughness) {
|
||
float NdotH = max(x, 0.0001);
|
||
float cos2Alpha = NdotH * NdotH;
|
||
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
|
||
float roughness2 = roughness * roughness;
|
||
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
|
||
return exp(tan2Alpha / roughness2) / denom;
|
||
}
|
||
|
||
float cookTorranceSpecular(
|
||
vec3 lightDirection,
|
||
vec3 viewDirection,
|
||
vec3 surfaceNormal,
|
||
float roughness,
|
||
float fresnel) {
|
||
|
||
float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);
|
||
float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);
|
||
|
||
//Half angle vector
|
||
vec3 H = normalize(lightDirection + viewDirection);
|
||
|
||
//Geometric term
|
||
float NdotH = max(dot(surfaceNormal, H), 0.0);
|
||
float VdotH = max(dot(viewDirection, H), 0.000001);
|
||
float LdotH = max(dot(lightDirection, H), 0.000001);
|
||
float G1 = (2.0 * NdotH * VdotN) / VdotH;
|
||
float G2 = (2.0 * NdotH * LdotN) / LdotH;
|
||
float G = min(1.0, min(G1, G2));
|
||
|
||
//Distribution term
|
||
float D = beckmannDistribution(NdotH, roughness);
|
||
|
||
//Fresnel term
|
||
float F = pow(1.0 - VdotN, fresnel);
|
||
|
||
//Multiply terms and done
|
||
return G * F * D / max(3.14159265 * VdotN, 0.000001);
|
||
}
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec3 clipBounds[2];
|
||
uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;
|
||
uniform sampler2D texture;
|
||
|
||
varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
|
||
varying vec4 f_color;
|
||
varying vec2 f_uv;
|
||
|
||
void main() {
|
||
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
|
||
vec3 N = normalize(f_normal);
|
||
vec3 L = normalize(f_lightDirection);
|
||
vec3 V = normalize(f_eyeDirection);
|
||
|
||
if(gl_FrontFacing) {
|
||
N = -N;
|
||
}
|
||
|
||
float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));
|
||
float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
|
||
|
||
vec4 surfaceColor = f_color * texture2D(texture, f_uv);
|
||
vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
|
||
|
||
gl_FragColor = litColor * opacity;
|
||
}
|
||
`]),a=i([`precision highp float;
|
||
|
||
precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
vec3 getOrthogonalVector(vec3 v) {
|
||
// Return up-vector for only-z vector.
|
||
// Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
|
||
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
|
||
// Assign z = 0, x = -b, y = a:
|
||
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
|
||
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
|
||
return normalize(vec3(-v.y, v.x, 0.0));
|
||
} else {
|
||
return normalize(vec3(0.0, v.z, -v.y));
|
||
}
|
||
}
|
||
|
||
// Calculate the cone vertex and normal at the given index.
|
||
//
|
||
// The returned vertex is for a cone with its top at origin and height of 1.0,
|
||
// pointing in the direction of the vector attribute.
|
||
//
|
||
// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.
|
||
// These vertices are used to make up the triangles of the cone by the following:
|
||
// segment + 0 top vertex
|
||
// segment + 1 perimeter vertex a+1
|
||
// segment + 2 perimeter vertex a
|
||
// segment + 3 center base vertex
|
||
// segment + 4 perimeter vertex a
|
||
// segment + 5 perimeter vertex a+1
|
||
// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.
|
||
// To go from index to segment, floor(index / 6)
|
||
// To go from segment to angle, 2*pi * (segment/segmentCount)
|
||
// To go from index to segment index, index - (segment*6)
|
||
//
|
||
vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {
|
||
|
||
const float segmentCount = 8.0;
|
||
|
||
float index = rawIndex - floor(rawIndex /
|
||
(segmentCount * 6.0)) *
|
||
(segmentCount * 6.0);
|
||
|
||
float segment = floor(0.001 + index/6.0);
|
||
float segmentIndex = index - (segment*6.0);
|
||
|
||
normal = -normalize(d);
|
||
|
||
if (segmentIndex > 2.99 && segmentIndex < 3.01) {
|
||
return mix(vec3(0.0), -d, coneOffset);
|
||
}
|
||
|
||
float nextAngle = (
|
||
(segmentIndex > 0.99 && segmentIndex < 1.01) ||
|
||
(segmentIndex > 4.99 && segmentIndex < 5.01)
|
||
) ? 1.0 : 0.0;
|
||
float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);
|
||
|
||
vec3 v1 = mix(d, vec3(0.0), coneOffset);
|
||
vec3 v2 = v1 - d;
|
||
|
||
vec3 u = getOrthogonalVector(d);
|
||
vec3 v = normalize(cross(u, d));
|
||
|
||
vec3 x = u * cos(angle) * length(d)*0.25;
|
||
vec3 y = v * sin(angle) * length(d)*0.25;
|
||
vec3 v3 = v2 + x + y;
|
||
if (segmentIndex < 3.0) {
|
||
vec3 tx = u * sin(angle);
|
||
vec3 ty = v * -cos(angle);
|
||
vec3 tangent = tx + ty;
|
||
normal = normalize(cross(v3 - v1, tangent));
|
||
}
|
||
|
||
if (segmentIndex == 0.0) {
|
||
return mix(d, vec3(0.0), coneOffset);
|
||
}
|
||
return v3;
|
||
}
|
||
|
||
attribute vec4 vector;
|
||
attribute vec4 position;
|
||
attribute vec4 id;
|
||
|
||
uniform mat4 model, view, projection;
|
||
uniform float vectorScale, coneScale, coneOffset;
|
||
|
||
varying vec3 f_position;
|
||
varying vec4 f_id;
|
||
|
||
void main() {
|
||
vec3 normal;
|
||
vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);
|
||
vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
|
||
gl_Position = projection * (view * conePosition);
|
||
f_id = id;
|
||
f_position = position.xyz;
|
||
}
|
||
`]),s=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec3 clipBounds[2];
|
||
uniform float pickId;
|
||
|
||
varying vec3 f_position;
|
||
varying vec4 f_id;
|
||
|
||
void main() {
|
||
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
|
||
|
||
gl_FragColor = vec4(pickId, f_id.xyz);
|
||
}`]);e.meshShader={vertex:n,fragment:o,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},e.pickShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(t){t.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(t,e,r){var i=r(737);t.exports=function(n){return i[n]}},9165:function(t,e,r){t.exports=y;var i=r(2762),n=r(8116),o=r(3436),a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,x,b,S){this.gl=l,this.shader=S,this.buffer=x,this.vao=b,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var h=s.prototype;h.isOpaque=function(){return!this.hasAlpha},h.isTransparent=function(){return this.hasAlpha},h.drawTransparent=h.draw=function(l){var x=this.gl,b=this.shader.uniforms;this.shader.bind();var S=b.view=l.view||a,T=b.projection=l.projection||a;b.model=l.model||a,b.clipBounds=this.clipBounds,b.opacity=this.opacity;var M=S[12],w=S[13],u=S[14],f=S[15],k=l._ortho||!1,_=k?2:1,D=_*this.pixelRatio*(T[3]*M+T[7]*w+T[11]*u+T[15]*f)/x.drawingBufferHeight;this.vao.bind();for(var I=0;I<3;++I)x.lineWidth(this.lineWidth[I]*this.pixelRatio),b.capSize=this.capSize[I]*D,this.lineCount[I]&&x.drawArrays(x.LINES,this.lineOffset[I],this.lineCount[I]);this.vao.unbind()};function v(l,x){for(var b=0;b<3;++b)l[0][b]=Math.min(l[0][b],x[b]),l[1][b]=Math.max(l[1][b],x[b])}var m=function(){for(var l=new Array(3),x=0;x<3;++x){for(var b=[],S=1;S<=2;++S)for(var T=-1;T<=1;T+=2){var M=(S+x)%3,w=[0,0,0];w[M]=T,b.push(w)}l[x]=b}return l}();function p(l,x,b,S){for(var T=m[S],M=0;M<T.length;++M){var w=T[M];l.push(x[0],x[1],x[2],b[0],b[1],b[2],b[3],w[0],w[1],w[2])}return T.length}h.update=function(l){l=l||{},"lineWidth"in l&&(this.lineWidth=l.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in l&&(this.capSize=l.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),this.hasAlpha=!1,"opacity"in l&&(this.opacity=+l.opacity,this.opacity<1&&(this.hasAlpha=!0));var x=l.color||[[0,0,0],[0,0,0],[0,0,0]],b=l.position,S=l.error;if(Array.isArray(x[0])||(x=[x,x,x]),b&&S){var T=[],M=b.length,w=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var u=0;u<3;++u){this.lineOffset[u]=w;t:for(var f=0;f<M;++f){for(var k=b[f],_=0;_<3;++_)if(isNaN(k[_])||!isFinite(k[_]))continue t;var D=S[f],I=x[u];if(Array.isArray(I[0])&&(I=x[f]),I.length===3?I=[I[0],I[1],I[2],1]:I.length===4&&(I=[I[0],I[1],I[2],I[3]],!this.hasAlpha&&I[3]<1&&(this.hasAlpha=!0)),!(isNaN(D[0][u])||isNaN(D[1][u]))){if(D[0][u]<0){var O=k.slice();O[u]+=D[0][u],T.push(k[0],k[1],k[2],I[0],I[1],I[2],I[3],0,0,0,O[0],O[1],O[2],I[0],I[1],I[2],I[3],0,0,0),v(this.bounds,O),w+=2+p(T,O,I,u)}if(D[1][u]>0){var O=k.slice();O[u]+=D[1][u],T.push(k[0],k[1],k[2],I[0],I[1],I[2],I[3],0,0,0,O[0],O[1],O[2],I[0],I[1],I[2],I[3],0,0,0),v(this.bounds,O),w+=2+p(T,O,I,u)}}}this.lineCount[u]=w-this.lineOffset[u]}this.buffer.update(T)}},h.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function y(l){var x=l.gl,b=i(x),S=n(x,[{buffer:b,type:x.FLOAT,size:3,offset:0,stride:40},{buffer:b,type:x.FLOAT,size:4,offset:12,stride:40},{buffer:b,type:x.FLOAT,size:3,offset:28,stride:40}]),T=o(x);T.attributes.position.location=0,T.attributes.color.location=1,T.attributes.offset.location=2;var M=new s(x,b,S,T);return M.update(l),M}},3436:function(t,e,r){var i=r(3236),n=r(9405),o=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position, offset;
|
||
attribute vec4 color;
|
||
uniform mat4 model, view, projection;
|
||
uniform float capSize;
|
||
varying vec4 fragColor;
|
||
varying vec3 fragPosition;
|
||
|
||
void main() {
|
||
vec4 worldPosition = model * vec4(position, 1.0);
|
||
worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);
|
||
gl_Position = projection * (view * worldPosition);
|
||
fragColor = color;
|
||
fragPosition = position;
|
||
}`]),a=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec3 clipBounds[2];
|
||
uniform float opacity;
|
||
varying vec3 fragPosition;
|
||
varying vec4 fragColor;
|
||
|
||
void main() {
|
||
if (
|
||
outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||
|
||
fragColor.a * opacity == 0.
|
||
) discard;
|
||
|
||
gl_FragColor = opacity * fragColor;
|
||
}`]);t.exports=function(s){return n(s,o,a,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(t,e,r){var i=r(7766);t.exports=w;var n=null,o,a,s,h;function v(u){var f=u.getParameter(u.FRAMEBUFFER_BINDING),k=u.getParameter(u.RENDERBUFFER_BINDING),_=u.getParameter(u.TEXTURE_BINDING_2D);return[f,k,_]}function m(u,f){u.bindFramebuffer(u.FRAMEBUFFER,f[0]),u.bindRenderbuffer(u.RENDERBUFFER,f[1]),u.bindTexture(u.TEXTURE_2D,f[2])}function p(u,f){var k=u.getParameter(f.MAX_COLOR_ATTACHMENTS_WEBGL);n=new Array(k+1);for(var _=0;_<=k;++_){for(var D=new Array(k),I=0;I<_;++I)D[I]=u.COLOR_ATTACHMENT0+I;for(var I=_;I<k;++I)D[I]=u.NONE;n[_]=D}}function y(u){switch(u){case o:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case s:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case h:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function l(u,f,k,_,D,I){if(!_)return null;var O=i(u,f,k,D,_);return O.magFilter=u.NEAREST,O.minFilter=u.NEAREST,O.mipSamples=1,O.bind(),u.framebufferTexture2D(u.FRAMEBUFFER,I,u.TEXTURE_2D,O.handle,0),O}function x(u,f,k,_,D){var I=u.createRenderbuffer();return u.bindRenderbuffer(u.RENDERBUFFER,I),u.renderbufferStorage(u.RENDERBUFFER,_,f,k),u.framebufferRenderbuffer(u.FRAMEBUFFER,D,u.RENDERBUFFER,I),I}function b(u){var f=v(u.gl),k=u.gl,_=u.handle=k.createFramebuffer(),D=u._shape[0],I=u._shape[1],O=u.color.length,B=u._ext,R=u._useStencil,L=u._useDepth,F=u._colorType;k.bindFramebuffer(k.FRAMEBUFFER,_);for(var N=0;N<O;++N)u.color[N]=l(k,D,I,F,k.RGBA,k.COLOR_ATTACHMENT0+N);O===0?(u._color_rb=x(k,D,I,k.RGBA4,k.COLOR_ATTACHMENT0),B&&B.drawBuffersWEBGL(n[0])):O>1&&B.drawBuffersWEBGL(n[O]);var j=k.getExtension("WEBGL_depth_texture");j?R?u.depth=l(k,D,I,j.UNSIGNED_INT_24_8_WEBGL,k.DEPTH_STENCIL,k.DEPTH_STENCIL_ATTACHMENT):L&&(u.depth=l(k,D,I,k.UNSIGNED_SHORT,k.DEPTH_COMPONENT,k.DEPTH_ATTACHMENT)):L&&R?u._depth_rb=x(k,D,I,k.DEPTH_STENCIL,k.DEPTH_STENCIL_ATTACHMENT):L?u._depth_rb=x(k,D,I,k.DEPTH_COMPONENT16,k.DEPTH_ATTACHMENT):R&&(u._depth_rb=x(k,D,I,k.STENCIL_INDEX,k.STENCIL_ATTACHMENT));var G=k.checkFramebufferStatus(k.FRAMEBUFFER);if(G!==k.FRAMEBUFFER_COMPLETE){u._destroyed=!0,k.bindFramebuffer(k.FRAMEBUFFER,null),k.deleteFramebuffer(u.handle),u.handle=null,u.depth&&(u.depth.dispose(),u.depth=null),u._depth_rb&&(k.deleteRenderbuffer(u._depth_rb),u._depth_rb=null);for(var N=0;N<u.color.length;++N)u.color[N].dispose(),u.color[N]=null;u._color_rb&&(k.deleteRenderbuffer(u._color_rb),u._color_rb=null),m(k,f),y(G)}m(k,f)}function S(u,f,k,_,D,I,O,B){this.gl=u,this._shape=[f|0,k|0],this._destroyed=!1,this._ext=B,this.color=new Array(D);for(var R=0;R<D;++R)this.color[R]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=_,this._useDepth=I,this._useStencil=O;var L=this,F=[f|0,k|0];Object.defineProperties(F,{0:{get:function(){return L._shape[0]},set:function(N){return L.width=N}},1:{get:function(){return L._shape[1]},set:function(N){return L.height=N}}}),this._shapeVector=F,b(this)}var T=S.prototype;function M(u,f,k){if(u._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(!(u._shape[0]===f&&u._shape[1]===k)){var _=u.gl,D=_.getParameter(_.MAX_RENDERBUFFER_SIZE);if(f<0||f>D||k<0||k>D)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");u._shape[0]=f,u._shape[1]=k;for(var I=v(_),O=0;O<u.color.length;++O)u.color[O].shape=u._shape;u._color_rb&&(_.bindRenderbuffer(_.RENDERBUFFER,u._color_rb),_.renderbufferStorage(_.RENDERBUFFER,_.RGBA4,u._shape[0],u._shape[1])),u.depth&&(u.depth.shape=u._shape),u._depth_rb&&(_.bindRenderbuffer(_.RENDERBUFFER,u._depth_rb),u._useDepth&&u._useStencil?_.renderbufferStorage(_.RENDERBUFFER,_.DEPTH_STENCIL,u._shape[0],u._shape[1]):u._useDepth?_.renderbufferStorage(_.RENDERBUFFER,_.DEPTH_COMPONENT16,u._shape[0],u._shape[1]):u._useStencil&&_.renderbufferStorage(_.RENDERBUFFER,_.STENCIL_INDEX,u._shape[0],u._shape[1])),_.bindFramebuffer(_.FRAMEBUFFER,u.handle);var B=_.checkFramebufferStatus(_.FRAMEBUFFER);B!==_.FRAMEBUFFER_COMPLETE&&(u.dispose(),m(_,I),y(B)),m(_,I)}}Object.defineProperties(T,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(u){if(Array.isArray(u)||(u=[u|0,u|0]),u.length!==2)throw new Error("gl-fbo: Shape vector must be length 2");var f=u[0]|0,k=u[1]|0;return M(this,f,k),[f,k]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(u){return u=u|0,M(this,u,this._shape[1]),u},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(u){return u=u|0,M(this,this._shape[0],u),u},enumerable:!1}}),T.bind=function(){if(!this._destroyed){var u=this.gl;u.bindFramebuffer(u.FRAMEBUFFER,this.handle),u.viewport(0,0,this._shape[0],this._shape[1])}},T.dispose=function(){if(!this._destroyed){this._destroyed=!0;var u=this.gl;u.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(u.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var f=0;f<this.color.length;++f)this.color[f].dispose(),this.color[f]=null;this._color_rb&&(u.deleteRenderbuffer(this._color_rb),this._color_rb=null)}};function w(u,f,k,_){o||(o=u.FRAMEBUFFER_UNSUPPORTED,a=u.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,s=u.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,h=u.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var D=u.getExtension("WEBGL_draw_buffers");if(!n&&D&&p(u,D),Array.isArray(f)&&(_=k,k=f[1]|0,f=f[0]|0),typeof f!="number")throw new Error("gl-fbo: Missing shape parameter");var I=u.getParameter(u.MAX_RENDERBUFFER_SIZE);if(f<0||f>I||k<0||k>I)throw new Error("gl-fbo: Parameters are too large for FBO");_=_||{};var O=1;if("color"in _){if(O=Math.max(_.color|0,0),O<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(O>1)if(D){if(O>u.getParameter(D.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+O+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var B=u.UNSIGNED_BYTE,R=u.getExtension("OES_texture_float");if(_.float&&O>0){if(!R)throw new Error("gl-fbo: Context does not support floating point textures");B=u.FLOAT}else _.preferFloat&&O>0&&R&&(B=u.FLOAT);var L=!0;"depth"in _&&(L=!!_.depth);var F=!1;return"stencil"in _&&(F=!!_.stencil),new S(u,f,k,B,O,L,F,D)}},2992:function(t,e,r){var i=r(3387).sprintf,n=r(5171),o=r(1848),a=r(1085);t.exports=s;function s(h,v,m){var p=o(v)||"of unknown name (see npm glsl-shader-name)",y="unknown type";m!==void 0&&(y=m===n.FRAGMENT_SHADER?"fragment":"vertex");for(var l=i(`Error compiling %s shader %s:
|
||
`,y,p),x=i("%s%s",l,h),b=h.split(`
|
||
`),S={},T=0;T<b.length;T++){var M=b[T];if(!(M===""||M==="\0")){var w=parseInt(M.split(":")[2]);if(isNaN(w))throw new Error(i("Could not parse error: %s",M));S[w]=M}}for(var u=a(v).split(`
|
||
`),T=0;T<u.length;T++)if(!(!S[T+3]&&!S[T+2]&&!S[T+1])){var f=u[T];if(l+=f+`
|
||
`,S[T+1]){var k=S[T+1];k=k.substr(k.split(":",3).join(":").length+1).trim(),l+=i(`^^^ %s
|
||
|
||
`,k)}}return{long:l.trim(),short:x.trim()}}},7319:function(t,e,r){var i=r(3236),n=r(9405),o=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position, nextPosition;
|
||
attribute float arcLength, lineWidth;
|
||
attribute vec4 color;
|
||
|
||
uniform vec2 screenShape;
|
||
uniform float pixelRatio;
|
||
uniform mat4 model, view, projection;
|
||
|
||
varying vec4 fragColor;
|
||
varying vec3 worldPosition;
|
||
varying float pixelArcLength;
|
||
|
||
vec4 project(vec3 p) {
|
||
return projection * (view * (model * vec4(p, 1.0)));
|
||
}
|
||
|
||
void main() {
|
||
vec4 startPoint = project(position);
|
||
vec4 endPoint = project(nextPosition);
|
||
|
||
vec2 A = startPoint.xy / startPoint.w;
|
||
vec2 B = endPoint.xy / endPoint.w;
|
||
|
||
float clipAngle = atan(
|
||
(B.y - A.y) * screenShape.y,
|
||
(B.x - A.x) * screenShape.x
|
||
);
|
||
|
||
vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(
|
||
sin(clipAngle),
|
||
-cos(clipAngle)
|
||
) / screenShape;
|
||
|
||
gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);
|
||
|
||
worldPosition = position;
|
||
pixelArcLength = arcLength;
|
||
fragColor = color;
|
||
}
|
||
`]),a=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec3 clipBounds[2];
|
||
uniform sampler2D dashTexture;
|
||
uniform float dashScale;
|
||
uniform float opacity;
|
||
|
||
varying vec3 worldPosition;
|
||
varying float pixelArcLength;
|
||
varying vec4 fragColor;
|
||
|
||
void main() {
|
||
if (
|
||
outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||
|
||
fragColor.a * opacity == 0.
|
||
) discard;
|
||
|
||
float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;
|
||
if(dashWeight < 0.5) {
|
||
discard;
|
||
}
|
||
gl_FragColor = fragColor * opacity;
|
||
}
|
||
`]),s=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
#define FLOAT_MAX 1.70141184e38
|
||
#define FLOAT_MIN 1.17549435e-38
|
||
|
||
// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl
|
||
vec4 packFloat(float v) {
|
||
float av = abs(v);
|
||
|
||
//Handle special cases
|
||
if(av < FLOAT_MIN) {
|
||
return vec4(0.0, 0.0, 0.0, 0.0);
|
||
} else if(v > FLOAT_MAX) {
|
||
return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;
|
||
} else if(v < -FLOAT_MAX) {
|
||
return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;
|
||
}
|
||
|
||
vec4 c = vec4(0,0,0,0);
|
||
|
||
//Compute exponent and mantissa
|
||
float e = floor(log2(av));
|
||
float m = av * pow(2.0, -e) - 1.0;
|
||
|
||
//Unpack mantissa
|
||
c[1] = floor(128.0 * m);
|
||
m -= c[1] / 128.0;
|
||
c[2] = floor(32768.0 * m);
|
||
m -= c[2] / 32768.0;
|
||
c[3] = floor(8388608.0 * m);
|
||
|
||
//Unpack exponent
|
||
float ebias = e + 127.0;
|
||
c[0] = floor(ebias / 2.0);
|
||
ebias -= c[0] * 2.0;
|
||
c[1] += floor(ebias) * 128.0;
|
||
|
||
//Unpack sign bit
|
||
c[0] += 128.0 * step(0.0, -v);
|
||
|
||
//Scale back to range
|
||
return c / 255.0;
|
||
}
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform float pickId;
|
||
uniform vec3 clipBounds[2];
|
||
|
||
varying vec3 worldPosition;
|
||
varying float pixelArcLength;
|
||
varying vec4 fragColor;
|
||
|
||
void main() {
|
||
if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;
|
||
|
||
gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);
|
||
}`]),h=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];e.createShader=function(v){return n(v,o,a,null,h)},e.createPickShader=function(v){return n(v,o,s,null,h)}},5714:function(t,e,r){t.exports=u;var i=r(2762),n=r(8116),o=r(7766),a=new Uint8Array(4),s=new Float32Array(a.buffer);function h(f,k,_,D){return a[0]=D,a[1]=_,a[2]=k,a[3]=f,s[0]}var v=r(2478),m=r(9618),p=r(7319),y=p.createShader,l=p.createPickShader,x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function b(f,k){for(var _=0,D=0;D<3;++D){var I=f[D]-k[D];_+=I*I}return Math.sqrt(_)}function S(f){for(var k=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],_=0;_<3;++_)k[0][_]=Math.max(f[0][_],k[0][_]),k[1][_]=Math.min(f[1][_],k[1][_]);return k}function T(f,k,_,D){this.arcLength=f,this.position=k,this.index=_,this.dataCoordinate=D}function M(f,k,_,D,I,O){this.gl=f,this.shader=k,this.pickShader=_,this.buffer=D,this.vao=I,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=O,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var w=M.prototype;w.isTransparent=function(){return this.hasAlpha},w.isOpaque=function(){return!this.hasAlpha},w.pickSlots=1,w.setPickBase=function(f){this.pickId=f},w.drawTransparent=w.draw=function(f){if(this.vertexCount){var k=this.gl,_=this.shader,D=this.vao;_.bind(),_.uniforms={model:f.model||x,view:f.view||x,projection:f.projection||x,clipBounds:S(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[k.drawingBufferWidth,k.drawingBufferHeight],pixelRatio:this.pixelRatio},D.bind(),D.draw(k.TRIANGLE_STRIP,this.vertexCount),D.unbind()}},w.drawPick=function(f){if(this.vertexCount){var k=this.gl,_=this.pickShader,D=this.vao;_.bind(),_.uniforms={model:f.model||x,view:f.view||x,projection:f.projection||x,pickId:this.pickId,clipBounds:S(this.clipBounds),screenShape:[k.drawingBufferWidth,k.drawingBufferHeight],pixelRatio:this.pixelRatio},D.bind(),D.draw(k.TRIANGLE_STRIP,this.vertexCount),D.unbind()}},w.update=function(f){var k,_;this.dirty=!0;var D=!!f.connectGaps;"dashScale"in f&&(this.dashScale=f.dashScale),this.hasAlpha=!1,"opacity"in f&&(this.opacity=+f.opacity,this.opacity<1&&(this.hasAlpha=!0));var I=[],O=[],B=[],R=0,L=0,F=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],N=f.position||f.positions;if(N){var j=f.color||f.colors||[0,0,0,1],G=f.lineWidth||1,rt=!1;t:for(k=1;k<N.length;++k){var ct=N[k-1],lt=N[k];for(O.push(R),B.push(ct.slice()),_=0;_<3;++_){if(isNaN(ct[_])||isNaN(lt[_])||!isFinite(ct[_])||!isFinite(lt[_])){if(!D&&I.length>0){for(var tt=0;tt<24;++tt)I.push(I[I.length-12]);L+=2,rt=!0}continue t}F[0][_]=Math.min(F[0][_],ct[_],lt[_]),F[1][_]=Math.max(F[1][_],ct[_],lt[_])}var Z,st;Array.isArray(j[0])?(Z=j.length>k-1?j[k-1]:j.length>0?j[j.length-1]:[0,0,0,1],st=j.length>k?j[k]:j.length>0?j[j.length-1]:[0,0,0,1]):Z=st=j,Z.length===3&&(Z=[Z[0],Z[1],Z[2],1]),st.length===3&&(st=[st[0],st[1],st[2],1]),!this.hasAlpha&&Z[3]<1&&(this.hasAlpha=!0);var $;Array.isArray(G)?$=G.length>k-1?G[k-1]:G.length>0?G[G.length-1]:[0,0,0,1]:$=G;var Q=R;if(R+=b(ct,lt),rt){for(_=0;_<2;++_)I.push(ct[0],ct[1],ct[2],lt[0],lt[1],lt[2],Q,$,Z[0],Z[1],Z[2],Z[3]);L+=2,rt=!1}I.push(ct[0],ct[1],ct[2],lt[0],lt[1],lt[2],Q,$,Z[0],Z[1],Z[2],Z[3],ct[0],ct[1],ct[2],lt[0],lt[1],lt[2],Q,-$,Z[0],Z[1],Z[2],Z[3],lt[0],lt[1],lt[2],ct[0],ct[1],ct[2],R,-$,st[0],st[1],st[2],st[3],lt[0],lt[1],lt[2],ct[0],ct[1],ct[2],R,$,st[0],st[1],st[2],st[3]),L+=4}}if(this.buffer.update(I),O.push(R),B.push(N[N.length-1].slice()),this.bounds=F,this.vertexCount=L,this.points=B,this.arcLength=O,"dashes"in f){var nt=f.dashes,Y=nt.slice();for(Y.unshift(0),k=1;k<Y.length;++k)Y[k]=Y[k-1]+Y[k];var q=m(new Array(256*4),[256,1,4]);for(k=0;k<256;++k){for(_=0;_<4;++_)q.set(k,0,_,0);v.le(Y,Y[Y.length-1]*k/255)&1?q.set(k,0,0,0):q.set(k,0,0,255)}this.texture.setPixels(q)}},w.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},w.pick=function(f){if(!f||f.id!==this.pickId)return null;var k=h(f.value[0],f.value[1],f.value[2],0),_=v.le(this.arcLength,k);if(_<0)return null;if(_===this.arcLength.length-1)return new T(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),_);for(var D=this.points[_],I=this.points[Math.min(_+1,this.points.length-1)],O=(k-this.arcLength[_])/(this.arcLength[_+1]-this.arcLength[_]),B=1-O,R=[0,0,0],L=0;L<3;++L)R[L]=B*D[L]+O*I[L];var F=Math.min(O<.5?_:_+1,this.points.length-1);return new T(k,R,F,this.points[F])};function u(f){var k=f.gl||f.scene&&f.scene.gl,_=y(k);_.attributes.position.location=0,_.attributes.nextPosition.location=1,_.attributes.arcLength.location=2,_.attributes.lineWidth.location=3,_.attributes.color.location=4;var D=l(k);D.attributes.position.location=0,D.attributes.nextPosition.location=1,D.attributes.arcLength.location=2,D.attributes.lineWidth.location=3,D.attributes.color.location=4;for(var I=i(k),O=n(k,[{buffer:I,size:3,offset:0,stride:48},{buffer:I,size:3,offset:12,stride:48},{buffer:I,size:1,offset:24,stride:48},{buffer:I,size:1,offset:28,stride:48},{buffer:I,size:4,offset:32,stride:48}]),B=m(new Array(1024),[256,1,4]),R=0;R<1024;++R)B.data[R]=255;var L=o(k,B);L.wrap=k.REPEAT;var F=new M(k,_,D,I,O,L);return F.update(f),F}},1903:function(t){t.exports=e;function e(r){var i=new Float32Array(16);return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i}},6864:function(t){t.exports=e;function e(){var r=new Float32Array(16);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}},9921:function(t){t.exports=e;function e(r){var i=r[0],n=r[1],o=r[2],a=r[3],s=r[4],h=r[5],v=r[6],m=r[7],p=r[8],y=r[9],l=r[10],x=r[11],b=r[12],S=r[13],T=r[14],M=r[15],w=i*h-n*s,u=i*v-o*s,f=i*m-a*s,k=n*v-o*h,_=n*m-a*h,D=o*m-a*v,I=p*S-y*b,O=p*T-l*b,B=p*M-x*b,R=y*T-l*S,L=y*M-x*S,F=l*M-x*T;return w*F-u*L+f*R+k*B-_*O+D*I}},7399:function(t){t.exports=e;function e(r,i){var n=i[0],o=i[1],a=i[2],s=i[3],h=n+n,v=o+o,m=a+a,p=n*h,y=o*h,l=o*v,x=a*h,b=a*v,S=a*m,T=s*h,M=s*v,w=s*m;return r[0]=1-l-S,r[1]=y+w,r[2]=x-M,r[3]=0,r[4]=y-w,r[5]=1-p-S,r[6]=b+T,r[7]=0,r[8]=x+M,r[9]=b-T,r[10]=1-p-l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}},6743:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],h=i[3],v=o+o,m=a+a,p=s+s,y=o*v,l=o*m,x=o*p,b=a*m,S=a*p,T=s*p,M=h*v,w=h*m,u=h*p;return r[0]=1-(b+T),r[1]=l+u,r[2]=x-w,r[3]=0,r[4]=l-u,r[5]=1-(y+T),r[6]=S+M,r[7]=0,r[8]=x+w,r[9]=S-M,r[10]=1-(y+b),r[11]=0,r[12]=n[0],r[13]=n[1],r[14]=n[2],r[15]=1,r}},7894:function(t){t.exports=e;function e(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}},7608:function(t){t.exports=e;function e(r,i){var n=i[0],o=i[1],a=i[2],s=i[3],h=i[4],v=i[5],m=i[6],p=i[7],y=i[8],l=i[9],x=i[10],b=i[11],S=i[12],T=i[13],M=i[14],w=i[15],u=n*v-o*h,f=n*m-a*h,k=n*p-s*h,_=o*m-a*v,D=o*p-s*v,I=a*p-s*m,O=y*T-l*S,B=y*M-x*S,R=y*w-b*S,L=l*M-x*T,F=l*w-b*T,N=x*w-b*M,j=u*N-f*F+k*L+_*R-D*B+I*O;return j?(j=1/j,r[0]=(v*N-m*F+p*L)*j,r[1]=(a*F-o*N-s*L)*j,r[2]=(T*I-M*D+w*_)*j,r[3]=(x*D-l*I-b*_)*j,r[4]=(m*R-h*N-p*B)*j,r[5]=(n*N-a*R+s*B)*j,r[6]=(M*k-S*I-w*f)*j,r[7]=(y*I-x*k+b*f)*j,r[8]=(h*F-v*R+p*O)*j,r[9]=(o*R-n*F-s*O)*j,r[10]=(S*D-T*k+w*u)*j,r[11]=(l*k-y*D-b*u)*j,r[12]=(v*B-h*L-m*O)*j,r[13]=(n*L-o*B+a*O)*j,r[14]=(T*f-S*_-M*u)*j,r[15]=(y*_-l*f+x*u)*j,r):null}},6582:function(t,e,r){var i=r(7894);t.exports=n;function n(o,a,s,h){var v,m,p,y,l,x,b,S,T,M,w=a[0],u=a[1],f=a[2],k=h[0],_=h[1],D=h[2],I=s[0],O=s[1],B=s[2];return Math.abs(w-I)<1e-6&&Math.abs(u-O)<1e-6&&Math.abs(f-B)<1e-6?i(o):(b=w-I,S=u-O,T=f-B,M=1/Math.sqrt(b*b+S*S+T*T),b*=M,S*=M,T*=M,v=_*T-D*S,m=D*b-k*T,p=k*S-_*b,M=Math.sqrt(v*v+m*m+p*p),M?(M=1/M,v*=M,m*=M,p*=M):(v=0,m=0,p=0),y=S*p-T*m,l=T*v-b*p,x=b*m-S*v,M=Math.sqrt(y*y+l*l+x*x),M?(M=1/M,y*=M,l*=M,x*=M):(y=0,l=0,x=0),o[0]=v,o[1]=y,o[2]=b,o[3]=0,o[4]=m,o[5]=l,o[6]=S,o[7]=0,o[8]=p,o[9]=x,o[10]=T,o[11]=0,o[12]=-(v*w+m*u+p*f),o[13]=-(y*w+l*u+x*f),o[14]=-(b*w+S*u+T*f),o[15]=1,o)}},6760:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],h=i[3],v=i[4],m=i[5],p=i[6],y=i[7],l=i[8],x=i[9],b=i[10],S=i[11],T=i[12],M=i[13],w=i[14],u=i[15],f=n[0],k=n[1],_=n[2],D=n[3];return r[0]=f*o+k*v+_*l+D*T,r[1]=f*a+k*m+_*x+D*M,r[2]=f*s+k*p+_*b+D*w,r[3]=f*h+k*y+_*S+D*u,f=n[4],k=n[5],_=n[6],D=n[7],r[4]=f*o+k*v+_*l+D*T,r[5]=f*a+k*m+_*x+D*M,r[6]=f*s+k*p+_*b+D*w,r[7]=f*h+k*y+_*S+D*u,f=n[8],k=n[9],_=n[10],D=n[11],r[8]=f*o+k*v+_*l+D*T,r[9]=f*a+k*m+_*x+D*M,r[10]=f*s+k*p+_*b+D*w,r[11]=f*h+k*y+_*S+D*u,f=n[12],k=n[13],_=n[14],D=n[15],r[12]=f*o+k*v+_*l+D*T,r[13]=f*a+k*m+_*x+D*M,r[14]=f*s+k*p+_*b+D*w,r[15]=f*h+k*y+_*S+D*u,r}},4040:function(t){t.exports=e;function e(r,i,n,o,a,s,h){var v=1/(i-n),m=1/(o-a),p=1/(s-h);return r[0]=-2*v,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*m,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*p,r[11]=0,r[12]=(i+n)*v,r[13]=(a+o)*m,r[14]=(h+s)*p,r[15]=1,r}},4772:function(t){t.exports=e;function e(r,i,n,o,a){var s=1/Math.tan(i/2),h=1/(o-a);return r[0]=s/n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(a+o)*h,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*a*o*h,r[15]=0,r}},6079:function(t){t.exports=e;function e(r,i,n,o){var a=o[0],s=o[1],h=o[2],v=Math.sqrt(a*a+s*s+h*h),m,p,y,l,x,b,S,T,M,w,u,f,k,_,D,I,O,B,R,L,F,N,j,G;return Math.abs(v)<1e-6?null:(v=1/v,a*=v,s*=v,h*=v,m=Math.sin(n),p=Math.cos(n),y=1-p,l=i[0],x=i[1],b=i[2],S=i[3],T=i[4],M=i[5],w=i[6],u=i[7],f=i[8],k=i[9],_=i[10],D=i[11],I=a*a*y+p,O=s*a*y+h*m,B=h*a*y-s*m,R=a*s*y-h*m,L=s*s*y+p,F=h*s*y+a*m,N=a*h*y+s*m,j=s*h*y-a*m,G=h*h*y+p,r[0]=l*I+T*O+f*B,r[1]=x*I+M*O+k*B,r[2]=b*I+w*O+_*B,r[3]=S*I+u*O+D*B,r[4]=l*R+T*L+f*F,r[5]=x*R+M*L+k*F,r[6]=b*R+w*L+_*F,r[7]=S*R+u*L+D*F,r[8]=l*N+T*j+f*G,r[9]=x*N+M*j+k*G,r[10]=b*N+w*j+_*G,r[11]=S*N+u*j+D*G,i!==r&&(r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15]),r)}},5567:function(t){t.exports=e;function e(r,i,n){var o=Math.sin(n),a=Math.cos(n),s=i[4],h=i[5],v=i[6],m=i[7],p=i[8],y=i[9],l=i[10],x=i[11];return i!==r&&(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15]),r[4]=s*a+p*o,r[5]=h*a+y*o,r[6]=v*a+l*o,r[7]=m*a+x*o,r[8]=p*a-s*o,r[9]=y*a-h*o,r[10]=l*a-v*o,r[11]=x*a-m*o,r}},2408:function(t){t.exports=e;function e(r,i,n){var o=Math.sin(n),a=Math.cos(n),s=i[0],h=i[1],v=i[2],m=i[3],p=i[8],y=i[9],l=i[10],x=i[11];return i!==r&&(r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15]),r[0]=s*a-p*o,r[1]=h*a-y*o,r[2]=v*a-l*o,r[3]=m*a-x*o,r[8]=s*o+p*a,r[9]=h*o+y*a,r[10]=v*o+l*a,r[11]=m*o+x*a,r}},7089:function(t){t.exports=e;function e(r,i,n){var o=Math.sin(n),a=Math.cos(n),s=i[0],h=i[1],v=i[2],m=i[3],p=i[4],y=i[5],l=i[6],x=i[7];return i!==r&&(r[8]=i[8],r[9]=i[9],r[10]=i[10],r[11]=i[11],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15]),r[0]=s*a+p*o,r[1]=h*a+y*o,r[2]=v*a+l*o,r[3]=m*a+x*o,r[4]=p*a-s*o,r[5]=y*a-h*o,r[6]=l*a-v*o,r[7]=x*a-m*o,r}},2504:function(t){t.exports=e;function e(r,i,n){var o=n[0],a=n[1],s=n[2];return r[0]=i[0]*o,r[1]=i[1]*o,r[2]=i[2]*o,r[3]=i[3]*o,r[4]=i[4]*a,r[5]=i[5]*a,r[6]=i[6]*a,r[7]=i[7]*a,r[8]=i[8]*s,r[9]=i[9]*s,r[10]=i[10]*s,r[11]=i[11]*s,r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15],r}},7656:function(t){t.exports=e;function e(r,i,n){var o=n[0],a=n[1],s=n[2],h,v,m,p,y,l,x,b,S,T,M,w;return i===r?(r[12]=i[0]*o+i[4]*a+i[8]*s+i[12],r[13]=i[1]*o+i[5]*a+i[9]*s+i[13],r[14]=i[2]*o+i[6]*a+i[10]*s+i[14],r[15]=i[3]*o+i[7]*a+i[11]*s+i[15]):(h=i[0],v=i[1],m=i[2],p=i[3],y=i[4],l=i[5],x=i[6],b=i[7],S=i[8],T=i[9],M=i[10],w=i[11],r[0]=h,r[1]=v,r[2]=m,r[3]=p,r[4]=y,r[5]=l,r[6]=x,r[7]=b,r[8]=S,r[9]=T,r[10]=M,r[11]=w,r[12]=h*o+y*a+S*s+i[12],r[13]=v*o+l*a+T*s+i[13],r[14]=m*o+x*a+M*s+i[14],r[15]=p*o+b*a+w*s+i[15]),r}},5665:function(t){t.exports=e;function e(r,i){if(r===i){var n=i[1],o=i[2],a=i[3],s=i[6],h=i[7],v=i[11];r[1]=i[4],r[2]=i[8],r[3]=i[12],r[4]=n,r[6]=i[9],r[7]=i[13],r[8]=o,r[9]=s,r[11]=i[14],r[12]=a,r[13]=h,r[14]=v}else r[0]=i[0],r[1]=i[4],r[2]=i[8],r[3]=i[12],r[4]=i[1],r[5]=i[5],r[6]=i[9],r[7]=i[13],r[8]=i[2],r[9]=i[6],r[10]=i[10],r[11]=i[14],r[12]=i[3],r[13]=i[7],r[14]=i[11],r[15]=i[15];return r}},7626:function(t,e,r){var i=r(2642),n=r(9346);t.exports=v;function o(m,p){for(var y=[0,0,0,0],l=0;l<4;++l)for(var x=0;x<4;++x)y[x]+=m[4*l+x]*p[l];return y}function a(m,p,y,l,x){for(var b=o(l,o(y,o(p,[m[0],m[1],m[2],1]))),S=0;S<3;++S)b[S]/=b[3];return[.5*x[0]*(1+b[0]),.5*x[1]*(1-b[1])]}function s(m,p){if(m.length===2){for(var y=0,l=0,x=0;x<2;++x)y+=Math.pow(p[x]-m[0][x],2),l+=Math.pow(p[x]-m[1][x],2);return y=Math.sqrt(y),l=Math.sqrt(l),y+l<1e-6?[1,0]:[l/(y+l),y/(l+y)]}else if(m.length===3){var b=[0,0];return n(m[0],m[1],m[2],p,b),i(m,b)}return[]}function h(m,p){for(var y=[0,0,0],l=0;l<m.length;++l)for(var x=m[l],b=p[l],S=0;S<3;++S)y[S]+=b*x[S];return y}function v(m,p,y,l,x,b){if(m.length===1)return[0,m[0].slice()];for(var S=new Array(m.length),T=0;T<m.length;++T)S[T]=a(m[T],y,l,x,b);for(var M=0,w=1/0,T=0;T<S.length;++T){for(var u=0,f=0;f<2;++f)u+=Math.pow(S[T][f]-p[f],2);u<w&&(w=u,M=T)}for(var k=s(S,p),_=0,T=0;T<3;++T){if(k[T]<-.001||k[T]>1.0001)return null;_+=k[T]}return Math.abs(_-1)>.001?null:[M,h(m,k),k]}},840:function(t,e,r){var i=r(3236),n=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position, normal;
|
||
attribute vec4 color;
|
||
attribute vec2 uv;
|
||
|
||
uniform mat4 model
|
||
, view
|
||
, projection
|
||
, inverseModel;
|
||
uniform vec3 eyePosition
|
||
, lightPosition;
|
||
|
||
varying vec3 f_normal
|
||
, f_lightDirection
|
||
, f_eyeDirection
|
||
, f_data;
|
||
varying vec4 f_color;
|
||
varying vec2 f_uv;
|
||
|
||
vec4 project(vec3 p) {
|
||
return projection * (view * (model * vec4(p, 1.0)));
|
||
}
|
||
|
||
void main() {
|
||
gl_Position = project(position);
|
||
|
||
//Lighting geometry parameters
|
||
vec4 cameraCoordinate = view * vec4(position , 1.0);
|
||
cameraCoordinate.xyz /= cameraCoordinate.w;
|
||
f_lightDirection = lightPosition - cameraCoordinate.xyz;
|
||
f_eyeDirection = eyePosition - cameraCoordinate.xyz;
|
||
f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);
|
||
|
||
f_color = color;
|
||
f_data = position;
|
||
f_uv = uv;
|
||
}
|
||
`]),o=i([`#extension GL_OES_standard_derivatives : enable
|
||
|
||
precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
float beckmannDistribution(float x, float roughness) {
|
||
float NdotH = max(x, 0.0001);
|
||
float cos2Alpha = NdotH * NdotH;
|
||
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
|
||
float roughness2 = roughness * roughness;
|
||
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
|
||
return exp(tan2Alpha / roughness2) / denom;
|
||
}
|
||
|
||
float cookTorranceSpecular(
|
||
vec3 lightDirection,
|
||
vec3 viewDirection,
|
||
vec3 surfaceNormal,
|
||
float roughness,
|
||
float fresnel) {
|
||
|
||
float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);
|
||
float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);
|
||
|
||
//Half angle vector
|
||
vec3 H = normalize(lightDirection + viewDirection);
|
||
|
||
//Geometric term
|
||
float NdotH = max(dot(surfaceNormal, H), 0.0);
|
||
float VdotH = max(dot(viewDirection, H), 0.000001);
|
||
float LdotH = max(dot(lightDirection, H), 0.000001);
|
||
float G1 = (2.0 * NdotH * VdotN) / VdotH;
|
||
float G2 = (2.0 * NdotH * LdotN) / LdotH;
|
||
float G = min(1.0, min(G1, G2));
|
||
|
||
//Distribution term
|
||
float D = beckmannDistribution(NdotH, roughness);
|
||
|
||
//Fresnel term
|
||
float F = pow(1.0 - VdotN, fresnel);
|
||
|
||
//Multiply terms and done
|
||
return G * F * D / max(3.14159265 * VdotN, 0.000001);
|
||
}
|
||
|
||
//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec3 clipBounds[2];
|
||
uniform float roughness
|
||
, fresnel
|
||
, kambient
|
||
, kdiffuse
|
||
, kspecular;
|
||
uniform sampler2D texture;
|
||
|
||
varying vec3 f_normal
|
||
, f_lightDirection
|
||
, f_eyeDirection
|
||
, f_data;
|
||
varying vec4 f_color;
|
||
varying vec2 f_uv;
|
||
|
||
void main() {
|
||
if (f_color.a == 0.0 ||
|
||
outOfRange(clipBounds[0], clipBounds[1], f_data)
|
||
) discard;
|
||
|
||
vec3 N = normalize(f_normal);
|
||
vec3 L = normalize(f_lightDirection);
|
||
vec3 V = normalize(f_eyeDirection);
|
||
|
||
if(gl_FrontFacing) {
|
||
N = -N;
|
||
}
|
||
|
||
float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));
|
||
//float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d
|
||
|
||
float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
|
||
|
||
vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);
|
||
vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
|
||
|
||
gl_FragColor = litColor * f_color.a;
|
||
}
|
||
`]),a=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position;
|
||
attribute vec4 color;
|
||
attribute vec2 uv;
|
||
|
||
uniform mat4 model, view, projection;
|
||
|
||
varying vec4 f_color;
|
||
varying vec3 f_data;
|
||
varying vec2 f_uv;
|
||
|
||
void main() {
|
||
gl_Position = projection * (view * (model * vec4(position, 1.0)));
|
||
f_color = color;
|
||
f_data = position;
|
||
f_uv = uv;
|
||
}`]),s=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec3 clipBounds[2];
|
||
uniform sampler2D texture;
|
||
uniform float opacity;
|
||
|
||
varying vec4 f_color;
|
||
varying vec3 f_data;
|
||
varying vec2 f_uv;
|
||
|
||
void main() {
|
||
if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;
|
||
|
||
gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;
|
||
}`]),h=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
attribute vec3 position;
|
||
attribute vec4 color;
|
||
attribute vec2 uv;
|
||
attribute float pointSize;
|
||
|
||
uniform mat4 model, view, projection;
|
||
uniform vec3 clipBounds[2];
|
||
|
||
varying vec4 f_color;
|
||
varying vec2 f_uv;
|
||
|
||
void main() {
|
||
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
|
||
|
||
gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);
|
||
} else {
|
||
gl_Position = projection * (view * (model * vec4(position, 1.0)));
|
||
}
|
||
gl_PointSize = pointSize;
|
||
f_color = color;
|
||
f_uv = uv;
|
||
}`]),v=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
uniform sampler2D texture;
|
||
uniform float opacity;
|
||
|
||
varying vec4 f_color;
|
||
varying vec2 f_uv;
|
||
|
||
void main() {
|
||
vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);
|
||
if(dot(pointR, pointR) > 0.25) {
|
||
discard;
|
||
}
|
||
gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;
|
||
}`]),m=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position;
|
||
attribute vec4 id;
|
||
|
||
uniform mat4 model, view, projection;
|
||
|
||
varying vec3 f_position;
|
||
varying vec4 f_id;
|
||
|
||
void main() {
|
||
gl_Position = projection * (view * (model * vec4(position, 1.0)));
|
||
f_id = id;
|
||
f_position = position;
|
||
}`]),p=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec3 clipBounds[2];
|
||
uniform float pickId;
|
||
|
||
varying vec3 f_position;
|
||
varying vec4 f_id;
|
||
|
||
void main() {
|
||
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
|
||
|
||
gl_FragColor = vec4(pickId, f_id.xyz);
|
||
}`]),y=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
attribute vec3 position;
|
||
attribute float pointSize;
|
||
attribute vec4 id;
|
||
|
||
uniform mat4 model, view, projection;
|
||
uniform vec3 clipBounds[2];
|
||
|
||
varying vec3 f_position;
|
||
varying vec4 f_id;
|
||
|
||
void main() {
|
||
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
|
||
|
||
gl_Position = vec4(0.0, 0.0, 0.0, 0.0);
|
||
} else {
|
||
gl_Position = projection * (view * (model * vec4(position, 1.0)));
|
||
gl_PointSize = pointSize;
|
||
}
|
||
f_id = id;
|
||
f_position = position;
|
||
}`]),l=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position;
|
||
|
||
uniform mat4 model, view, projection;
|
||
|
||
void main() {
|
||
gl_Position = projection * (view * (model * vec4(position, 1.0)));
|
||
}`]),x=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
uniform vec3 contourColor;
|
||
|
||
void main() {
|
||
gl_FragColor = vec4(contourColor, 1.0);
|
||
}
|
||
`]);e.meshShader={vertex:n,fragment:o,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.wireShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.pointShader={vertex:h,fragment:v,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:m,fragment:p,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},e.pointPickShader={vertex:y,fragment:p,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},e.contourShader={vertex:l,fragment:x,attributes:[{name:"position",type:"vec3"}]}},7201:function(t,e,r){var i=1e-6,n=1e-6,o=r(9405),a=r(2762),s=r(8116),h=r(7766),v=r(8406),m=r(6760),p=r(7608),y=r(9618),l=r(6729),x=r(7765),b=r(1888),S=r(840),T=r(7626),M=S.meshShader,w=S.wireShader,u=S.pointShader,f=S.pickShader,k=S.pointPickShader,_=S.contourShader,D=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function I(tt,Z,st,$,Q,nt,Y,q,ot,it,dt,wt,xt,Ft,Et,Nt,te,Jt,Qt,Wt,gt,bt,vt,Ut,Kt,Zt,le){this.gl=tt,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=Z,this.dirty=!0,this.triShader=st,this.lineShader=$,this.pointShader=Q,this.pickShader=nt,this.pointPickShader=Y,this.contourShader=q,this.trianglePositions=ot,this.triangleColors=dt,this.triangleNormals=xt,this.triangleUVs=wt,this.triangleIds=it,this.triangleVAO=Ft,this.triangleCount=0,this.lineWidth=1,this.edgePositions=Et,this.edgeColors=te,this.edgeUVs=Jt,this.edgeIds=Nt,this.edgeVAO=Qt,this.edgeCount=0,this.pointPositions=Wt,this.pointColors=bt,this.pointUVs=vt,this.pointSizes=Ut,this.pointIds=gt,this.pointVAO=Kt,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=Zt,this.contourVAO=le,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=D,this._view=D,this._projection=D,this._resolution=[1,1]}var O=I.prototype;O.isOpaque=function(){return!this.hasAlpha},O.isTransparent=function(){return this.hasAlpha},O.pickSlots=1,O.setPickBase=function(tt){this.pickId=tt};function B(tt,Z){if(!Z||!Z.length)return 1;for(var st=0;st<Z.length;++st){if(Z.length<2)return 1;if(Z[st][0]===tt)return Z[st][1];if(Z[st][0]>tt&&st>0){var $=(Z[st][0]-tt)/(Z[st][0]-Z[st-1][0]);return Z[st][1]*(1-$)+$*Z[st-1][1]}}return 1}function R(tt,Z){for(var st=l({colormap:tt,nshades:256,format:"rgba"}),$=new Uint8Array(1024),Q=0;Q<256;++Q){for(var nt=st[Q],Y=0;Y<3;++Y)$[4*Q+Y]=nt[Y];Z?$[4*Q+3]=255*B(Q/255,Z):$[4*Q+3]=255*nt[3]}return y($,[256,256,4],[4,0,1])}function L(tt){for(var Z=tt.length,st=new Array(Z),$=0;$<Z;++$)st[$]=tt[$][2];return st}O.highlight=function(tt){if(!tt||!this.contourEnable){this.contourCount=0;return}for(var Z=x(this.cells,this.intensity,tt.intensity),st=Z.cells,$=Z.vertexIds,Q=Z.vertexWeights,nt=st.length,Y=b.mallocFloat32(6*nt),q=0,ot=0;ot<nt;++ot)for(var it=st[ot],dt=0;dt<2;++dt){var wt=it[0];it.length===2&&(wt=it[dt]);for(var xt=$[wt][0],Ft=$[wt][1],Et=Q[wt],Nt=1-Et,te=this.positions[xt],Jt=this.positions[Ft],Qt=0;Qt<3;++Qt)Y[q++]=Et*te[Qt]+Nt*Jt[Qt]}this.contourCount=q/3|0,this.contourPositions.update(Y.subarray(0,q)),b.free(Y)},O.update=function(tt){tt=tt||{};var Z=this.gl;this.dirty=!0,"contourEnable"in tt&&(this.contourEnable=tt.contourEnable),"contourColor"in tt&&(this.contourColor=tt.contourColor),"lineWidth"in tt&&(this.lineWidth=tt.lineWidth),"lightPosition"in tt&&(this.lightPosition=tt.lightPosition),this.hasAlpha=!1,"opacity"in tt&&(this.opacity=tt.opacity,this.opacity<1&&(this.hasAlpha=!0)),"opacityscale"in tt&&(this.opacityscale=tt.opacityscale,this.hasAlpha=!0),"ambient"in tt&&(this.ambientLight=tt.ambient),"diffuse"in tt&&(this.diffuseLight=tt.diffuse),"specular"in tt&&(this.specularLight=tt.specular),"roughness"in tt&&(this.roughness=tt.roughness),"fresnel"in tt&&(this.fresnel=tt.fresnel),tt.texture?(this.texture.dispose(),this.texture=h(Z,tt.texture)):tt.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=Z.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=Z.LINEAR,this.texture.setPixels(R(tt.colormap,this.opacityscale)),this.texture.generateMipmap());var st=tt.cells,$=tt.positions;if(!(!$||!st)){var Q=[],nt=[],Y=[],q=[],ot=[],it=[],dt=[],wt=[],xt=[],Ft=[],Et=[],Nt=[],te=[],Jt=[];this.cells=st,this.positions=$;var Qt=tt.vertexNormals,Wt=tt.cellNormals,gt=tt.vertexNormalsEpsilon===void 0?i:tt.vertexNormalsEpsilon,bt=tt.faceNormalsEpsilon===void 0?n:tt.faceNormalsEpsilon;tt.useFacetNormals&&!Wt&&(Wt=v.faceNormals(st,$,bt)),!Wt&&!Qt&&(Qt=v.vertexNormals(st,$,gt));var vt=tt.vertexColors,Ut=tt.cellColors,Kt=tt.meshColor||[1,1,1,1],Zt=tt.vertexUVs,le=tt.vertexIntensity,Te=tt.cellUVs,Se=tt.cellIntensity,Fe=1/0,Oe=-1/0;if(!Zt&&!Te)if(le)if(tt.vertexIntensityBounds)Fe=+tt.vertexIntensityBounds[0],Oe=+tt.vertexIntensityBounds[1];else for(var ur=0;ur<le.length;++ur){var fr=le[ur];Fe=Math.min(Fe,fr),Oe=Math.max(Oe,fr)}else if(Se)if(tt.cellIntensityBounds)Fe=+tt.cellIntensityBounds[0],Oe=+tt.cellIntensityBounds[1];else for(var ur=0;ur<Se.length;++ur){var fr=Se[ur];Fe=Math.min(Fe,fr),Oe=Math.max(Oe,fr)}else for(var ur=0;ur<$.length;++ur){var fr=$[ur][2];Fe=Math.min(Fe,fr),Oe=Math.max(Oe,fr)}le?this.intensity=le:Se?this.intensity=Se:this.intensity=L($),this.pickVertex=!(Se||Ut);var We=tt.pointSizes,Lr=tt.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(var ur=0;ur<$.length;++ur)for(var kr=$[ur],he=0;he<3;++he)isNaN(kr[he])||!isFinite(kr[he])||(this.bounds[0][he]=Math.min(this.bounds[0][he],kr[he]),this.bounds[1][he]=Math.max(this.bounds[1][he],kr[he]));var Dt=0,qt=0,zt=0;t:for(var ur=0;ur<st.length;++ur){var ut=st[ur];switch(ut.length){case 1:for(var yt=ut[0],kr=$[yt],he=0;he<3;++he)if(isNaN(kr[he])||!isFinite(kr[he]))continue t;Ft.push(kr[0],kr[1],kr[2]);var Mt;vt?Mt=vt[yt]:Ut?Mt=Ut[ur]:Mt=Kt,this.opacityscale&&le?nt.push(Mt[0],Mt[1],Mt[2],this.opacity*B((le[yt]-Fe)/(Oe-Fe),this.opacityscale)):Mt.length===3?Et.push(Mt[0],Mt[1],Mt[2],this.opacity):(Et.push(Mt[0],Mt[1],Mt[2],Mt[3]*this.opacity),Mt[3]<1&&(this.hasAlpha=!0));var Ot;Zt?Ot=Zt[yt]:le?Ot=[(le[yt]-Fe)/(Oe-Fe),0]:Te?Ot=Te[ur]:Se?Ot=[(Se[ur]-Fe)/(Oe-Fe),0]:Ot=[(kr[2]-Fe)/(Oe-Fe),0],Nt.push(Ot[0],Ot[1]),We?te.push(We[yt]):te.push(Lr),Jt.push(ur),zt+=1;break;case 2:for(var he=0;he<2;++he)for(var yt=ut[he],kr=$[yt],$t=0;$t<3;++$t)if(isNaN(kr[$t])||!isFinite(kr[$t]))continue t;for(var he=0;he<2;++he){var yt=ut[he],kr=$[yt];it.push(kr[0],kr[1],kr[2]);var Mt;vt?Mt=vt[yt]:Ut?Mt=Ut[ur]:Mt=Kt,this.opacityscale&&le?nt.push(Mt[0],Mt[1],Mt[2],this.opacity*B((le[yt]-Fe)/(Oe-Fe),this.opacityscale)):Mt.length===3?dt.push(Mt[0],Mt[1],Mt[2],this.opacity):(dt.push(Mt[0],Mt[1],Mt[2],Mt[3]*this.opacity),Mt[3]<1&&(this.hasAlpha=!0));var Ot;Zt?Ot=Zt[yt]:le?Ot=[(le[yt]-Fe)/(Oe-Fe),0]:Te?Ot=Te[ur]:Se?Ot=[(Se[ur]-Fe)/(Oe-Fe),0]:Ot=[(kr[2]-Fe)/(Oe-Fe),0],wt.push(Ot[0],Ot[1]),xt.push(ur)}qt+=1;break;case 3:for(var he=0;he<3;++he)for(var yt=ut[he],kr=$[yt],$t=0;$t<3;++$t)if(isNaN(kr[$t])||!isFinite(kr[$t]))continue t;for(var he=0;he<3;++he){var yt=ut[2-he],kr=$[yt];Q.push(kr[0],kr[1],kr[2]);var Mt;vt?Mt=vt[yt]:Ut?Mt=Ut[ur]:Mt=Kt,Mt?this.opacityscale&&le?nt.push(Mt[0],Mt[1],Mt[2],this.opacity*B((le[yt]-Fe)/(Oe-Fe),this.opacityscale)):Mt.length===3?nt.push(Mt[0],Mt[1],Mt[2],this.opacity):(nt.push(Mt[0],Mt[1],Mt[2],Mt[3]*this.opacity),Mt[3]<1&&(this.hasAlpha=!0)):nt.push(.5,.5,.5,1);var Ot;Zt?Ot=Zt[yt]:le?Ot=[(le[yt]-Fe)/(Oe-Fe),0]:Te?Ot=Te[ur]:Se?Ot=[(Se[ur]-Fe)/(Oe-Fe),0]:Ot=[(kr[2]-Fe)/(Oe-Fe),0],q.push(Ot[0],Ot[1]);var ee;Qt?ee=Qt[yt]:ee=Wt[ur],Y.push(ee[0],ee[1],ee[2]),ot.push(ur)}Dt+=1;break}}this.pointCount=zt,this.edgeCount=qt,this.triangleCount=Dt,this.pointPositions.update(Ft),this.pointColors.update(Et),this.pointUVs.update(Nt),this.pointSizes.update(te),this.pointIds.update(new Uint32Array(Jt)),this.edgePositions.update(it),this.edgeColors.update(dt),this.edgeUVs.update(wt),this.edgeIds.update(new Uint32Array(xt)),this.trianglePositions.update(Q),this.triangleColors.update(nt),this.triangleUVs.update(q),this.triangleNormals.update(Y),this.triangleIds.update(new Uint32Array(ot))}},O.drawTransparent=O.draw=function(tt){tt=tt||{};for(var Z=this.gl,st=tt.model||D,$=tt.view||D,Q=tt.projection||D,nt=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],Y=0;Y<3;++Y)nt[0][Y]=Math.max(nt[0][Y],this.clipBounds[0][Y]),nt[1][Y]=Math.min(nt[1][Y],this.clipBounds[1][Y]);var q={model:st,view:$,projection:Q,inverseModel:D.slice(),clipBounds:nt,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],contourColor:this.contourColor,texture:0};q.inverseModel=p(q.inverseModel,q.model),Z.disable(Z.CULL_FACE),this.texture.bind(0);var ot=new Array(16);m(ot,q.view,q.model),m(ot,q.projection,ot),p(ot,ot);for(var Y=0;Y<3;++Y)q.eyePosition[Y]=ot[12+Y]/ot[15];for(var it=ot[15],Y=0;Y<3;++Y)it+=this.lightPosition[Y]*ot[4*Y+3];for(var Y=0;Y<3;++Y){for(var dt=ot[12+Y],wt=0;wt<3;++wt)dt+=ot[4*wt+Y]*this.lightPosition[wt];q.lightPosition[Y]=dt/it}if(this.triangleCount>0){var xt=this.triShader;xt.bind(),xt.uniforms=q,this.triangleVAO.bind(),Z.drawArrays(Z.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var xt=this.lineShader;xt.bind(),xt.uniforms=q,this.edgeVAO.bind(),Z.lineWidth(this.lineWidth*this.pixelRatio),Z.drawArrays(Z.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var xt=this.pointShader;xt.bind(),xt.uniforms=q,this.pointVAO.bind(),Z.drawArrays(Z.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var xt=this.contourShader;xt.bind(),xt.uniforms=q,this.contourVAO.bind(),Z.drawArrays(Z.LINES,0,this.contourCount),this.contourVAO.unbind()}},O.drawPick=function(tt){tt=tt||{};for(var Z=this.gl,st=tt.model||D,$=tt.view||D,Q=tt.projection||D,nt=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],Y=0;Y<3;++Y)nt[0][Y]=Math.max(nt[0][Y],this.clipBounds[0][Y]),nt[1][Y]=Math.min(nt[1][Y],this.clipBounds[1][Y]);this._model=[].slice.call(st),this._view=[].slice.call($),this._projection=[].slice.call(Q),this._resolution=[Z.drawingBufferWidth,Z.drawingBufferHeight];var q={model:st,view:$,projection:Q,clipBounds:nt,pickId:this.pickId/255},ot=this.pickShader;if(ot.bind(),ot.uniforms=q,this.triangleCount>0&&(this.triangleVAO.bind(),Z.drawArrays(Z.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),Z.lineWidth(this.lineWidth*this.pixelRatio),Z.drawArrays(Z.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var ot=this.pointPickShader;ot.bind(),ot.uniforms=q,this.pointVAO.bind(),Z.drawArrays(Z.POINTS,0,this.pointCount),this.pointVAO.unbind()}},O.pick=function(tt){if(!tt||tt.id!==this.pickId)return null;for(var Z=tt.value[0]+256*tt.value[1]+65536*tt.value[2],st=this.cells[Z],$=this.positions,Q=new Array(st.length),nt=0;nt<st.length;++nt)Q[nt]=$[st[nt]];var Y=tt.coord[0],q=tt.coord[1];if(!this.pickVertex){var ot=this.positions[st[0]],it=this.positions[st[1]],dt=this.positions[st[2]],wt=[(ot[0]+it[0]+dt[0])/3,(ot[1]+it[1]+dt[1])/3,(ot[2]+it[2]+dt[2])/3];return{_cellCenter:!0,position:[Y,q],index:Z,cell:st,cellId:Z,intensity:this.intensity[Z],dataCoordinate:wt}}var xt=T(Q,[Y*this.pixelRatio,this._resolution[1]-q*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!xt)return null;for(var Ft=xt[2],Et=0,nt=0;nt<st.length;++nt)Et+=Ft[nt]*this.intensity[st[nt]];return{position:xt[1],index:st[xt[0]],cell:st,cellId:Z,intensity:Et,dataCoordinate:this.positions[st[xt[0]]]}},O.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()};function F(tt){var Z=o(tt,M.vertex,M.fragment);return Z.attributes.position.location=0,Z.attributes.color.location=2,Z.attributes.uv.location=3,Z.attributes.normal.location=4,Z}function N(tt){var Z=o(tt,w.vertex,w.fragment);return Z.attributes.position.location=0,Z.attributes.color.location=2,Z.attributes.uv.location=3,Z}function j(tt){var Z=o(tt,u.vertex,u.fragment);return Z.attributes.position.location=0,Z.attributes.color.location=2,Z.attributes.uv.location=3,Z.attributes.pointSize.location=4,Z}function G(tt){var Z=o(tt,f.vertex,f.fragment);return Z.attributes.position.location=0,Z.attributes.id.location=1,Z}function rt(tt){var Z=o(tt,k.vertex,k.fragment);return Z.attributes.position.location=0,Z.attributes.id.location=1,Z.attributes.pointSize.location=4,Z}function ct(tt){var Z=o(tt,_.vertex,_.fragment);return Z.attributes.position.location=0,Z}function lt(tt,Z){arguments.length===1&&(Z=tt,tt=Z.gl);var st=tt.getExtension("OES_standard_derivatives")||tt.getExtension("MOZ_OES_standard_derivatives")||tt.getExtension("WEBKIT_OES_standard_derivatives");if(!st)throw new Error("derivatives not supported");var $=F(tt),Q=N(tt),nt=j(tt),Y=G(tt),q=rt(tt),ot=ct(tt),it=h(tt,y(new Uint8Array([255,255,255,255]),[1,1,4]));it.generateMipmap(),it.minFilter=tt.LINEAR_MIPMAP_LINEAR,it.magFilter=tt.LINEAR;var dt=a(tt),wt=a(tt),xt=a(tt),Ft=a(tt),Et=a(tt),Nt=s(tt,[{buffer:dt,type:tt.FLOAT,size:3},{buffer:Et,type:tt.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:wt,type:tt.FLOAT,size:4},{buffer:xt,type:tt.FLOAT,size:2},{buffer:Ft,type:tt.FLOAT,size:3}]),te=a(tt),Jt=a(tt),Qt=a(tt),Wt=a(tt),gt=s(tt,[{buffer:te,type:tt.FLOAT,size:3},{buffer:Wt,type:tt.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:Jt,type:tt.FLOAT,size:4},{buffer:Qt,type:tt.FLOAT,size:2}]),bt=a(tt),vt=a(tt),Ut=a(tt),Kt=a(tt),Zt=a(tt),le=s(tt,[{buffer:bt,type:tt.FLOAT,size:3},{buffer:Zt,type:tt.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:vt,type:tt.FLOAT,size:4},{buffer:Ut,type:tt.FLOAT,size:2},{buffer:Kt,type:tt.FLOAT,size:1}]),Te=a(tt),Se=s(tt,[{buffer:Te,type:tt.FLOAT,size:3}]),Fe=new I(tt,it,$,Q,nt,Y,q,ot,dt,Et,wt,xt,Ft,Nt,te,Wt,Jt,Qt,gt,bt,Zt,vt,Ut,Kt,le,Te,Se);return Fe.update(Z),Fe}t.exports=lt},4437:function(t,e,r){t.exports=v;var i=r(3025),n=r(6296),o=r(351),a=r(8512),s=r(24),h=r(7520);function v(m,p){m=m||document.body,p=p||{};var y=[.01,1/0];"distanceLimits"in p&&(y[0]=p.distanceLimits[0],y[1]=p.distanceLimits[1]),"zoomMin"in p&&(y[0]=p.zoomMin),"zoomMax"in p&&(y[1]=p.zoomMax);var l=n({center:p.center||[0,0,0],up:p.up||[0,1,0],eye:p.eye||[0,0,10],mode:p.mode||"orbit",distanceLimits:y}),x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0,S=m.clientWidth,T=m.clientHeight,M={keyBindingMode:"rotate",enableWheel:!0,view:l,element:m,delay:p.delay||16,rotateSpeed:p.rotateSpeed||1,zoomSpeed:p.zoomSpeed||1,translateSpeed:p.translateSpeed||1,flipX:!!p.flipX,flipY:!!p.flipY,modes:l.modes,_ortho:p._ortho||p.projection&&p.projection.type==="orthographic"||!1,tick:function(){var w=i(),u=this.delay,f=w-2*u;l.idle(w-u),l.recalcMatrix(f),l.flush(w-(100+u*2));for(var k=!0,_=l.computedMatrix,D=0;D<16;++D)k=k&&x[D]===_[D],x[D]=_[D];var I=m.clientWidth===S&&m.clientHeight===T;return S=m.clientWidth,T=m.clientHeight,k?!I:(b=Math.exp(l.computedRadius[0]),!0)},lookAt:function(w,u,f){l.lookAt(l.lastT(),w,u,f)},rotate:function(w,u,f){l.rotate(l.lastT(),w,u,f)},pan:function(w,u,f){l.pan(l.lastT(),w,u,f)},translate:function(w,u,f){l.translate(l.lastT(),w,u,f)}};return Object.defineProperties(M,{matrix:{get:function(){return l.computedMatrix},set:function(w){return l.setMatrix(l.lastT(),w),l.computedMatrix},enumerable:!0},mode:{get:function(){return l.getMode()},set:function(w){var u=l.computedUp.slice(),f=l.computedEye.slice(),k=l.computedCenter.slice();if(l.setMode(w),w==="turntable"){var _=i();l._active.lookAt(_,f,k,u),l._active.lookAt(_+500,f,k,[0,0,1]),l._active.flush(_)}return l.getMode()},enumerable:!0},center:{get:function(){return l.computedCenter},set:function(w){return l.lookAt(l.lastT(),null,w),l.computedCenter},enumerable:!0},eye:{get:function(){return l.computedEye},set:function(w){return l.lookAt(l.lastT(),w),l.computedEye},enumerable:!0},up:{get:function(){return l.computedUp},set:function(w){return l.lookAt(l.lastT(),null,null,w),l.computedUp},enumerable:!0},distance:{get:function(){return b},set:function(w){return l.setDistance(l.lastT(),w),w},enumerable:!0},distanceLimits:{get:function(){return l.getDistanceLimits(y)},set:function(w){return l.setDistanceLimits(w),w},enumerable:!0}}),m.addEventListener("contextmenu",function(w){return w.preventDefault(),!1}),M._lastX=-1,M._lastY=-1,M._lastMods={shift:!1,control:!1,alt:!1,meta:!1},M.enableMouseListeners=function(){M.mouseListener=o(m,w),m.addEventListener("touchstart",function(u){var f=s(u.changedTouches[0],m);w(0,f[0],f[1],M._lastMods),w(1,f[0],f[1],M._lastMods)},h?{passive:!0}:!1),m.addEventListener("touchmove",function(u){var f=s(u.changedTouches[0],m);w(1,f[0],f[1],M._lastMods),u.preventDefault()},h?{passive:!1}:!1),m.addEventListener("touchend",function(u){w(0,M._lastX,M._lastY,M._lastMods)},h?{passive:!0}:!1);function w(u,f,k,_){var D=M.keyBindingMode;if(D!==!1){var I=D==="rotate",O=D==="pan",B=D==="zoom",R=!!_.control,L=!!_.alt,F=!!_.shift,N=!!(u&1),j=!!(u&2),G=!!(u&4),rt=1/m.clientHeight,ct=rt*(f-M._lastX),lt=rt*(k-M._lastY),tt=M.flipX?1:-1,Z=M.flipY?1:-1,st=Math.PI*M.rotateSpeed,$=i();if(M._lastX!==-1&&M._lastY!==-1&&((I&&N&&!R&&!L&&!F||N&&!R&&!L&&F)&&l.rotate($,tt*st*ct,-Z*st*lt,0),(O&&N&&!R&&!L&&!F||j||N&&R&&!L&&!F)&&l.pan($,-M.translateSpeed*ct*b,M.translateSpeed*lt*b,0),B&&N&&!R&&!L&&!F||G||N&&!R&&L&&!F)){var Q=-M.zoomSpeed*lt/window.innerHeight*($-l.lastT())*100;l.pan($,0,0,b*(Math.exp(Q)-1))}return M._lastX=f,M._lastY=k,M._lastMods=_,!0}}M.wheelListener=a(m,function(u,f){if(M.keyBindingMode!==!1&&M.enableWheel){var k=M.flipX?1:-1,_=M.flipY?1:-1,D=i();if(Math.abs(u)>Math.abs(f))l.rotate(D,0,0,-u*k*Math.PI*M.rotateSpeed/window.innerWidth);else if(!M._ortho){var I=-M.zoomSpeed*_*f/window.innerHeight*(D-l.lastT())/20;l.pan(D,0,0,b*(Math.exp(I)-1))}}},!0)},M.enableMouseListeners(),M}},799:function(t,e,r){var i=r(3236),n=r(9405),o=i([`precision mediump float;
|
||
#define GLSLIFY 1
|
||
attribute vec2 position;
|
||
varying vec2 uv;
|
||
void main() {
|
||
uv = position;
|
||
gl_Position = vec4(position, 0, 1);
|
||
}`]),a=i([`precision mediump float;
|
||
#define GLSLIFY 1
|
||
|
||
uniform sampler2D accumBuffer;
|
||
varying vec2 uv;
|
||
|
||
void main() {
|
||
vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));
|
||
gl_FragColor = min(vec4(1,1,1,1), accum);
|
||
}`]);t.exports=function(s){return n(s,o,a,null,[{name:"position",type:"vec2"}])}},4100:function(t,e,r){var i=r(4437),n=r(3837),o=r(5445),a=r(4449),s=r(3589),h=r(2260),v=r(7169),m=r(351),p=r(4772),y=r(4040),l=r(799),x=r(9216)({tablet:!0,featureDetect:!0});t.exports={createScene:w,createCamera:i};function b(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function S(f,k){var _=null;try{_=f.getContext("webgl",k),_||(_=f.getContext("experimental-webgl",k))}catch{return null}return _}function T(f){var k=Math.round(Math.log(Math.abs(f))/Math.log(10));if(k<0){var _=Math.round(Math.pow(10,-k));return Math.ceil(f*_)/_}else if(k>0){var _=Math.round(Math.pow(10,k));return Math.ceil(f/_)*_}return Math.ceil(f)}function M(f){return typeof f=="boolean"?f:!0}function w(f){f=f||{},f.camera=f.camera||{};var k=f.canvas;if(!k)if(k=document.createElement("canvas"),f.container){var _=f.container;_.appendChild(k)}else document.body.appendChild(k);var D=f.gl;if(D||(f.glOptions&&(x=!!f.glOptions.preserveDrawingBuffer),D=S(k,f.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:x})),!D)throw new Error("webgl not supported");var I=f.bounds||[[-10,-10,-10],[10,10,10]],O=new b,B=h(D,D.drawingBufferWidth,D.drawingBufferHeight,{preferFloat:!x}),R=l(D),L=f.cameraObject&&f.cameraObject._ortho===!0||f.camera.projection&&f.camera.projection.type==="orthographic"||!1,F={eye:f.camera.eye||[2,0,0],center:f.camera.center||[0,0,0],up:f.camera.up||[0,1,0],zoomMin:f.camera.zoomMax||.1,zoomMax:f.camera.zoomMin||100,mode:f.camera.mode||"turntable",_ortho:L},N=f.axes||{},j=n(D,N);j.enable=!N.disable;var G=f.spikes||{},rt=a(D,G),ct=[],lt=[],tt=[],Z=[],st=!0,Y=!0,$=new Array(16),Q=new Array(16),nt={view:null,projection:$,model:Q,_ortho:!1},Y=!0,q=[D.drawingBufferWidth,D.drawingBufferHeight],ot=f.cameraObject||i(k,F),it={gl:D,contextLost:!1,pixelRatio:f.pixelRatio||1,canvas:k,selection:O,camera:ot,axes:j,axesPixels:null,spikes:rt,bounds:I,objects:ct,shape:q,aspect:f.aspectRatio||[1,1,1],pickRadius:f.pickRadius||10,zNear:f.zNear||.01,zFar:f.zFar||1e3,fovy:f.fovy||Math.PI/4,clearColor:f.clearColor||[0,0,0,0],autoResize:M(f.autoResize),autoBounds:M(f.autoBounds),autoScale:!!f.autoScale,autoCenter:M(f.autoCenter),clipToBounds:M(f.clipToBounds),snapToData:!!f.snapToData,onselect:f.onselect||null,onrender:f.onrender||null,onclick:f.onclick||null,cameraParams:nt,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(Wt){this.aspect[0]=Wt.x,this.aspect[1]=Wt.y,this.aspect[2]=Wt.z,Y=!0},setBounds:function(Wt,gt){this.bounds[0][Wt]=gt.min,this.bounds[1][Wt]=gt.max},setClearColor:function(Wt){this.clearColor=Wt},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},dt=[D.drawingBufferWidth/it.pixelRatio|0,D.drawingBufferHeight/it.pixelRatio|0];function wt(){if(!it._stopped&&it.autoResize){var Wt=k.parentNode,gt=1,bt=1;Wt&&Wt!==document.body?(gt=Wt.clientWidth,bt=Wt.clientHeight):(gt=window.innerWidth,bt=window.innerHeight);var vt=Math.ceil(gt*it.pixelRatio)|0,Ut=Math.ceil(bt*it.pixelRatio)|0;if(vt!==k.width||Ut!==k.height){k.width=vt,k.height=Ut;var Kt=k.style;Kt.position=Kt.position||"absolute",Kt.left="0px",Kt.top="0px",Kt.width=gt+"px",Kt.height=bt+"px",st=!0}}}it.autoResize&&wt(),window.addEventListener("resize",wt);function xt(){for(var Wt=ct.length,gt=Z.length,bt=0;bt<gt;++bt)tt[bt]=0;t:for(var bt=0;bt<Wt;++bt){var vt=ct[bt],Ut=vt.pickSlots;if(!Ut){lt[bt]=-1;continue}for(var Kt=0;Kt<gt;++Kt)if(tt[Kt]+Ut<255){lt[bt]=Kt,vt.setPickBase(tt[Kt]+1),tt[Kt]+=Ut;continue t}var Zt=s(D,q);lt[bt]=gt,Z.push(Zt),tt.push(Ut),vt.setPickBase(1),gt+=1}for(;gt>0&&tt[gt-1]===0;)tt.pop(),Z.pop().dispose()}it.update=function(Wt){it._stopped||(st=!0,Y=!0)},it.add=function(Wt){it._stopped||(Wt.axes=j,ct.push(Wt),lt.push(-1),st=!0,Y=!0,xt())},it.remove=function(Wt){if(!it._stopped){var gt=ct.indexOf(Wt);gt<0||(ct.splice(gt,1),lt.pop(),st=!0,Y=!0,xt())}},it.dispose=function(){if(!it._stopped&&(it._stopped=!0,window.removeEventListener("resize",wt),k.removeEventListener("webglcontextlost",Ft),it.mouseListener.enabled=!1,!it.contextLost)){j.dispose(),rt.dispose();for(var Wt=0;Wt<ct.length;++Wt)ct[Wt].dispose();B.dispose();for(var Wt=0;Wt<Z.length;++Wt)Z[Wt].dispose();R.dispose(),D=null,j=null,rt=null,ct=[]}},it._mouseRotating=!1,it._prevButtons=0,it.enableMouseListeners=function(){it.mouseListener=m(k,function(Wt,gt,bt){if(!it._stopped){var vt=Z.length,Ut=ct.length,Kt=O.object;O.distance=1/0,O.mouse[0]=gt,O.mouse[1]=bt,O.object=null,O.screen=null,O.dataCoordinate=O.dataPosition=null;var Zt=!1;if(Wt&&it._prevButtons)it._mouseRotating=!0;else{it._mouseRotating&&(Y=!0),it._mouseRotating=!1;for(var le=0;le<vt;++le){var Te=Z[le].query(gt,dt[1]-bt-1,it.pickRadius);if(Te){if(Te.distance>O.distance)continue;for(var Se=0;Se<Ut;++Se){var Fe=ct[Se];if(lt[Se]===le){var Oe=Fe.pick(Te);Oe&&(O.buttons=Wt,O.screen=Te.coord,O.distance=Te.distance,O.object=Fe,O.index=Oe.distance,O.dataPosition=Oe.position,O.dataCoordinate=Oe.dataCoordinate,O.data=Oe,Zt=!0)}}}}}Kt&&Kt!==O.object&&(Kt.highlight&&Kt.highlight(null),st=!0),O.object&&(O.object.highlight&&O.object.highlight(O.data),st=!0),Zt=Zt||O.object!==Kt,Zt&&it.onselect&&it.onselect(O),Wt&1&&!(it._prevButtons&1)&&it.onclick&&it.onclick(O),it._prevButtons=Wt}})};function Ft(){if(it.contextLost)return!0;D.isContextLost()&&(it.contextLost=!0,it.mouseListener.enabled=!1,it.selection.object=null,it.oncontextloss&&it.oncontextloss())}k.addEventListener("webglcontextlost",Ft);function Et(){if(!Ft()){D.colorMask(!0,!0,!0,!0),D.depthMask(!0),D.disable(D.BLEND),D.enable(D.DEPTH_TEST),D.depthFunc(D.LEQUAL);for(var Wt=ct.length,gt=Z.length,bt=0;bt<gt;++bt){var vt=Z[bt];vt.shape=dt,vt.begin();for(var Ut=0;Ut<Wt;++Ut)if(lt[Ut]===bt){var Kt=ct[Ut];Kt.drawPick&&(Kt.pixelRatio=1,Kt.drawPick(nt))}vt.end()}}}var Nt=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],te=[Nt[0].slice(),Nt[1].slice()];function Jt(){if(!Ft()){wt();var Wt=it.camera.tick();nt.view=it.camera.matrix,st=st||Wt,Y=Y||Wt,j.pixelRatio=it.pixelRatio,rt.pixelRatio=it.pixelRatio;var gt=ct.length,bt=Nt[0],vt=Nt[1];bt[0]=bt[1]=bt[2]=1/0,vt[0]=vt[1]=vt[2]=-1/0;for(var Ut=0;Ut<gt;++Ut){var Kt=ct[Ut];Kt.pixelRatio=it.pixelRatio,Kt.axes=it.axes,st=st||!!Kt.dirty,Y=Y||!!Kt.dirty;var Zt=Kt.bounds;if(Zt)for(var le=Zt[0],Te=Zt[1],Se=0;Se<3;++Se)bt[Se]=Math.min(bt[Se],le[Se]),vt[Se]=Math.max(vt[Se],Te[Se])}var Fe=it.bounds;if(it.autoBounds)for(var Se=0;Se<3;++Se){if(vt[Se]<bt[Se])bt[Se]=-1,vt[Se]=1;else{bt[Se]===vt[Se]&&(bt[Se]-=1,vt[Se]+=1);var Oe=.05*(vt[Se]-bt[Se]);bt[Se]=bt[Se]-Oe,vt[Se]=vt[Se]+Oe}Fe[0][Se]=bt[Se],Fe[1][Se]=vt[Se]}for(var ur=!1,Se=0;Se<3;++Se)ur=ur||te[0][Se]!==Fe[0][Se]||te[1][Se]!==Fe[1][Se],te[0][Se]=Fe[0][Se],te[1][Se]=Fe[1][Se];if(Y=Y||ur,st=st||ur,!!st){if(ur){for(var fr=[0,0,0],Ut=0;Ut<3;++Ut)fr[Ut]=T((Fe[1][Ut]-Fe[0][Ut])/10);j.autoTicks?j.update({bounds:Fe,tickSpacing:fr}):j.update({bounds:Fe})}var We=D.drawingBufferWidth,Lr=D.drawingBufferHeight;q[0]=We,q[1]=Lr,dt[0]=Math.max(We/it.pixelRatio,1)|0,dt[1]=Math.max(Lr/it.pixelRatio,1)|0,u(it,L);for(var Ut=0;Ut<gt;++Ut){var Kt=ct[Ut];Kt.axesBounds=Fe,it.clipToBounds&&(Kt.clipBounds=Fe)}O.object&&(it.snapToData?rt.position=O.dataCoordinate:rt.position=O.dataPosition,rt.bounds=Fe),Y&&(Y=!1,Et()),it.axesPixels=o(it.axes,nt,We,Lr),it.onrender&&it.onrender(),D.bindFramebuffer(D.FRAMEBUFFER,null),D.viewport(0,0,We,Lr),it.clearRGBA(),D.depthMask(!0),D.colorMask(!0,!0,!0,!0),D.enable(D.DEPTH_TEST),D.depthFunc(D.LEQUAL),D.disable(D.BLEND),D.disable(D.CULL_FACE);var kr=!1;j.enable&&(kr=kr||j.isTransparent(),j.draw(nt)),rt.axes=j,O.object&&rt.draw(nt),D.disable(D.CULL_FACE);for(var Ut=0;Ut<gt;++Ut){var Kt=ct[Ut];Kt.axes=j,Kt.pixelRatio=it.pixelRatio,Kt.isOpaque&&Kt.isOpaque()&&Kt.draw(nt),Kt.isTransparent&&Kt.isTransparent()&&(kr=!0)}if(kr){B.shape=q,B.bind(),D.clear(D.DEPTH_BUFFER_BIT),D.colorMask(!1,!1,!1,!1),D.depthMask(!0),D.depthFunc(D.LESS),j.enable&&j.isTransparent()&&j.drawTransparent(nt);for(var Ut=0;Ut<gt;++Ut){var Kt=ct[Ut];Kt.isOpaque&&Kt.isOpaque()&&Kt.draw(nt)}D.enable(D.BLEND),D.blendEquation(D.FUNC_ADD),D.blendFunc(D.ONE,D.ONE_MINUS_SRC_ALPHA),D.colorMask(!0,!0,!0,!0),D.depthMask(!1),D.clearColor(0,0,0,0),D.clear(D.COLOR_BUFFER_BIT),j.isTransparent()&&j.drawTransparent(nt);for(var Ut=0;Ut<gt;++Ut){var Kt=ct[Ut];Kt.isTransparent&&Kt.isTransparent()&&Kt.drawTransparent(nt)}D.bindFramebuffer(D.FRAMEBUFFER,null),D.blendFunc(D.ONE,D.ONE_MINUS_SRC_ALPHA),D.disable(D.DEPTH_TEST),R.bind(),B.color[0].bind(0),R.uniforms.accumBuffer=0,v(D),D.disable(D.BLEND)}st=!1;for(var Ut=0;Ut<gt;++Ut)ct[Ut].dirty=!1}}}function Qt(){it._stopped||it.contextLost||(Jt(),requestAnimationFrame(Qt))}return it.enableMouseListeners(),Qt(),it.redraw=function(){it._stopped||(st=!0,Jt())},it}function u(f,k){var _=f.bounds,D=f.cameraParams,I=D.projection,O=D.model,B=f.gl.drawingBufferWidth,R=f.gl.drawingBufferHeight,L=f.zNear,F=f.zFar,N=f.fovy,j=B/R;k?(y(I,-j,j,-1,1,L,F),D._ortho=!0):(p(I,N,j,L,F),D._ortho=!1);for(var G=0;G<16;++G)O[G]=0;O[15]=1;for(var rt=0,G=0;G<3;++G)rt=Math.max(rt,_[1][G]-_[0][G]);for(var G=0;G<3;++G)f.autoScale?O[5*G]=f.aspect[G]/(_[1][G]-_[0][G]):O[5*G]=1/rt,f.autoCenter&&(O[12+G]=-O[5*G]*.5*(_[0][G]+_[1][G]))}},783:function(t){t.exports=e;function e(r,i,n,o){var a=i[0],s=i[1],h=i[2],v=i[3],m=n[0],p=n[1],y=n[2],l=n[3],x,b,S,T,M;return b=a*m+s*p+h*y+v*l,b<0&&(b=-b,m=-m,p=-p,y=-y,l=-l),1-b>1e-6?(x=Math.acos(b),S=Math.sin(x),T=Math.sin((1-o)*x)/S,M=Math.sin(o*x)/S):(T=1-o,M=o),r[0]=T*a+M*m,r[1]=T*s+M*p,r[2]=T*h+M*y,r[3]=T*v+M*l,r}},5964:function(t){t.exports=function(e){return!e&&e!==0?"":e.toString()}},9366:function(t,e,r){var i=r(4359);t.exports=o;var n={};function o(a,s,h){var v=[s.style,s.weight,s.variant,s.family].join("_"),m=n[v];if(m||(m=n[v]={}),a in m)return m[a];var p={textAlign:"center",textBaseline:"middle",lineHeight:1,font:s.family,fontStyle:s.style,fontWeight:s.weight,fontVariant:s.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};p.triangles=!0;var y=i(a,p);p.triangles=!1;var l=i(a,p),x,b;if(h&&h!==1){for(x=0;x<y.positions.length;++x)for(b=0;b<y.positions[x].length;++b)y.positions[x][b]/=h;for(x=0;x<l.positions.length;++x)for(b=0;b<l.positions[x].length;++b)l.positions[x][b]/=h}var S=[[1/0,1/0],[-1/0,-1/0]],T=l.positions.length;for(x=0;x<T;++x){var M=l.positions[x];for(b=0;b<2;++b)S[0][b]=Math.min(S[0][b],M[b]),S[1][b]=Math.max(S[1][b],M[b])}return m[a]=[y,l,S]}},1283:function(t,e,r){var i=r(9405),n=r(3236),o=n([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
attribute vec3 position;
|
||
attribute vec4 color;
|
||
attribute vec2 glyph;
|
||
attribute vec4 id;
|
||
|
||
uniform vec4 highlightId;
|
||
uniform float highlightScale;
|
||
uniform mat4 model, view, projection;
|
||
uniform vec3 clipBounds[2];
|
||
|
||
varying vec4 interpColor;
|
||
varying vec4 pickId;
|
||
varying vec3 dataCoordinate;
|
||
|
||
void main() {
|
||
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
|
||
|
||
gl_Position = vec4(0,0,0,0);
|
||
} else {
|
||
float scale = 1.0;
|
||
if(distance(highlightId, id) < 0.0001) {
|
||
scale = highlightScale;
|
||
}
|
||
|
||
vec4 worldPosition = model * vec4(position, 1);
|
||
vec4 viewPosition = view * worldPosition;
|
||
viewPosition = viewPosition / viewPosition.w;
|
||
vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));
|
||
|
||
gl_Position = clipPosition;
|
||
interpColor = color;
|
||
pickId = id;
|
||
dataCoordinate = position;
|
||
}
|
||
}`]),a=n([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
attribute vec3 position;
|
||
attribute vec4 color;
|
||
attribute vec2 glyph;
|
||
attribute vec4 id;
|
||
|
||
uniform mat4 model, view, projection;
|
||
uniform vec2 screenSize;
|
||
uniform vec3 clipBounds[2];
|
||
uniform float highlightScale, pixelRatio;
|
||
uniform vec4 highlightId;
|
||
|
||
varying vec4 interpColor;
|
||
varying vec4 pickId;
|
||
varying vec3 dataCoordinate;
|
||
|
||
void main() {
|
||
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
|
||
|
||
gl_Position = vec4(0,0,0,0);
|
||
} else {
|
||
float scale = pixelRatio;
|
||
if(distance(highlightId.bgr, id.bgr) < 0.001) {
|
||
scale *= highlightScale;
|
||
}
|
||
|
||
vec4 worldPosition = model * vec4(position, 1.0);
|
||
vec4 viewPosition = view * worldPosition;
|
||
vec4 clipPosition = projection * viewPosition;
|
||
clipPosition /= clipPosition.w;
|
||
|
||
gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);
|
||
interpColor = color;
|
||
pickId = id;
|
||
dataCoordinate = position;
|
||
}
|
||
}`]),s=n([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
attribute vec3 position;
|
||
attribute vec4 color;
|
||
attribute vec2 glyph;
|
||
attribute vec4 id;
|
||
|
||
uniform float highlightScale;
|
||
uniform vec4 highlightId;
|
||
uniform vec3 axes[2];
|
||
uniform mat4 model, view, projection;
|
||
uniform vec2 screenSize;
|
||
uniform vec3 clipBounds[2];
|
||
uniform float scale, pixelRatio;
|
||
|
||
varying vec4 interpColor;
|
||
varying vec4 pickId;
|
||
varying vec3 dataCoordinate;
|
||
|
||
void main() {
|
||
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
|
||
|
||
gl_Position = vec4(0,0,0,0);
|
||
} else {
|
||
float lscale = pixelRatio * scale;
|
||
if(distance(highlightId, id) < 0.0001) {
|
||
lscale *= highlightScale;
|
||
}
|
||
|
||
vec4 clipCenter = projection * (view * (model * vec4(position, 1)));
|
||
vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;
|
||
vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));
|
||
|
||
gl_Position = clipPosition;
|
||
interpColor = color;
|
||
pickId = id;
|
||
dataCoordinate = dataPosition;
|
||
}
|
||
}
|
||
`]),h=n([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec3 fragClipBounds[2];
|
||
uniform float opacity;
|
||
|
||
varying vec4 interpColor;
|
||
varying vec3 dataCoordinate;
|
||
|
||
void main() {
|
||
if (
|
||
outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||
|
||
interpColor.a * opacity == 0.
|
||
) discard;
|
||
gl_FragColor = interpColor * opacity;
|
||
}
|
||
`]),v=n([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec3 fragClipBounds[2];
|
||
uniform float pickGroup;
|
||
|
||
varying vec4 pickId;
|
||
varying vec3 dataCoordinate;
|
||
|
||
void main() {
|
||
if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;
|
||
|
||
gl_FragColor = vec4(pickGroup, pickId.bgr);
|
||
}`]),m=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],p={vertex:o,fragment:h,attributes:m},y={vertex:a,fragment:h,attributes:m},l={vertex:s,fragment:h,attributes:m},x={vertex:o,fragment:v,attributes:m},b={vertex:a,fragment:v,attributes:m},S={vertex:s,fragment:v,attributes:m};function T(M,w){var u=i(M,w),f=u.attributes;return f.position.location=0,f.color.location=1,f.glyph.location=2,f.id.location=3,u}e.createPerspective=function(M){return T(M,p)},e.createOrtho=function(M){return T(M,y)},e.createProject=function(M){return T(M,l)},e.createPickPerspective=function(M){return T(M,x)},e.createPickOrtho=function(M){return T(M,b)},e.createPickProject=function(M){return T(M,S)}},8418:function(t,e,r){var i=r(5219),n=r(2762),o=r(8116),a=r(1888),s=r(6760),h=r(1283),v=r(9366),m=r(5964),p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=ArrayBuffer,l=DataView;function x(Q){return y.isView(Q)&&!(Q instanceof l)}function b(Q){return Array.isArray(Q)||x(Q)}t.exports=$;function S(Q,nt){var Y=Q[0],q=Q[1],ot=Q[2],it=Q[3];return Q[0]=nt[0]*Y+nt[4]*q+nt[8]*ot+nt[12]*it,Q[1]=nt[1]*Y+nt[5]*q+nt[9]*ot+nt[13]*it,Q[2]=nt[2]*Y+nt[6]*q+nt[10]*ot+nt[14]*it,Q[3]=nt[3]*Y+nt[7]*q+nt[11]*ot+nt[15]*it,Q}function T(Q,nt,Y,q){return S(q,q),S(q,q),S(q,q)}function M(Q,nt){this.index=Q,this.dataCoordinate=this.position=nt}function w(Q){return Q===!0||Q>1?1:Q}function u(Q,nt,Y,q,ot,it,dt,wt,xt,Ft,Et,Nt){this.gl=Q,this.pixelRatio=1,this.shader=nt,this.orthoShader=Y,this.projectShader=q,this.pointBuffer=ot,this.colorBuffer=it,this.glyphBuffer=dt,this.idBuffer=wt,this.vao=xt,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Ft,this.pickOrthoShader=Et,this.pickProjectShader=Nt,this.points=[],this._selectResult=new M(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var f=u.prototype;f.pickSlots=1,f.setPickBase=function(Q){this.pickId=Q},f.isTransparent=function(){if(this.hasAlpha)return!0;for(var Q=0;Q<3;++Q)if(this.axesProject[Q]&&this.projectHasAlpha)return!0;return!1},f.isOpaque=function(){if(!this.hasAlpha)return!0;for(var Q=0;Q<3;++Q)if(this.axesProject[Q]&&!this.projectHasAlpha)return!0;return!1};var k=[0,0],_=[0,0,0],D=[0,0,0],I=[0,0,0,1],O=[0,0,0,1],B=p.slice(),R=[0,0,0],L=[[0,0,0],[0,0,0]];function F(Q){return Q[0]=Q[1]=Q[2]=0,Q}function N(Q,nt){return Q[0]=nt[0],Q[1]=nt[1],Q[2]=nt[2],Q[3]=1,Q}function j(Q,nt,Y,q){return Q[0]=nt[0],Q[1]=nt[1],Q[2]=nt[2],Q[Y]=q,Q}function G(Q){for(var nt=L,Y=0;Y<2;++Y)for(var q=0;q<3;++q)nt[Y][q]=Math.max(Math.min(Q[Y][q],1e8),-1e8);return nt}function rt(Q,nt,Y,q){var ot=nt.axesProject,it=nt.gl,dt=Q.uniforms,wt=Y.model||p,xt=Y.view||p,Ft=Y.projection||p,Et=nt.axesBounds,Nt=G(nt.clipBounds),te;nt.axes&&nt.axes.lastCubeProps?te=nt.axes.lastCubeProps.axis:te=[1,1,1],k[0]=2/it.drawingBufferWidth,k[1]=2/it.drawingBufferHeight,Q.bind(),dt.view=xt,dt.projection=Ft,dt.screenSize=k,dt.highlightId=nt.highlightId,dt.highlightScale=nt.highlightScale,dt.clipBounds=Nt,dt.pickGroup=nt.pickId/255,dt.pixelRatio=q;for(var Jt=0;Jt<3;++Jt)if(ot[Jt]){dt.scale=nt.projectScale[Jt],dt.opacity=nt.projectOpacity[Jt];for(var Qt=B,Wt=0;Wt<16;++Wt)Qt[Wt]=0;for(var Wt=0;Wt<4;++Wt)Qt[5*Wt]=1;Qt[5*Jt]=0,te[Jt]<0?Qt[12+Jt]=Et[0][Jt]:Qt[12+Jt]=Et[1][Jt],s(Qt,wt,Qt),dt.model=Qt;var gt=(Jt+1)%3,bt=(Jt+2)%3,vt=F(_),Ut=F(D);vt[gt]=1,Ut[bt]=1;var Kt=T(Ft,xt,wt,N(I,vt)),Zt=T(Ft,xt,wt,N(O,Ut));if(Math.abs(Kt[1])>Math.abs(Zt[1])){var le=Kt;Kt=Zt,Zt=le,le=vt,vt=Ut,Ut=le;var Te=gt;gt=bt,bt=Te}Kt[0]<0&&(vt[gt]=-1),Zt[1]>0&&(Ut[bt]=-1);for(var Se=0,Fe=0,Wt=0;Wt<4;++Wt)Se+=Math.pow(wt[4*gt+Wt],2),Fe+=Math.pow(wt[4*bt+Wt],2);vt[gt]/=Math.sqrt(Se),Ut[bt]/=Math.sqrt(Fe),dt.axes[0]=vt,dt.axes[1]=Ut,dt.fragClipBounds[0]=j(R,Nt[0],Jt,-1e8),dt.fragClipBounds[1]=j(R,Nt[1],Jt,1e8),nt.vao.bind(),nt.vao.draw(it.TRIANGLES,nt.vertexCount),nt.lineWidth>0&&(it.lineWidth(nt.lineWidth*q),nt.vao.draw(it.LINES,nt.lineVertexCount,nt.vertexCount)),nt.vao.unbind()}}var ct=[-1e8,-1e8,-1e8],lt=[1e8,1e8,1e8],tt=[ct,lt];function Z(Q,nt,Y,q,ot,it,dt){var wt=Y.gl;if((it===Y.projectHasAlpha||dt)&&rt(nt,Y,q,ot),it===Y.hasAlpha||dt){Q.bind();var xt=Q.uniforms;xt.model=q.model||p,xt.view=q.view||p,xt.projection=q.projection||p,k[0]=2/wt.drawingBufferWidth,k[1]=2/wt.drawingBufferHeight,xt.screenSize=k,xt.highlightId=Y.highlightId,xt.highlightScale=Y.highlightScale,xt.fragClipBounds=tt,xt.clipBounds=Y.axes.bounds,xt.opacity=Y.opacity,xt.pickGroup=Y.pickId/255,xt.pixelRatio=ot,Y.vao.bind(),Y.vao.draw(wt.TRIANGLES,Y.vertexCount),Y.lineWidth>0&&(wt.lineWidth(Y.lineWidth*ot),Y.vao.draw(wt.LINES,Y.lineVertexCount,Y.vertexCount)),Y.vao.unbind()}}f.draw=function(Q){var nt=this.useOrtho?this.orthoShader:this.shader;Z(nt,this.projectShader,this,Q,this.pixelRatio,!1,!1)},f.drawTransparent=function(Q){var nt=this.useOrtho?this.orthoShader:this.shader;Z(nt,this.projectShader,this,Q,this.pixelRatio,!0,!1)},f.drawPick=function(Q){var nt=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;Z(nt,this.pickProjectShader,this,Q,1,!0,!0)},f.pick=function(Q){if(!Q||Q.id!==this.pickId)return null;var nt=Q.value[2]+(Q.value[1]<<8)+(Q.value[0]<<16);if(nt>=this.pointCount||nt<0)return null;var Y=this.points[nt],q=this._selectResult;q.index=nt;for(var ot=0;ot<3;++ot)q.position[ot]=q.dataCoordinate[ot]=Y[ot];return q},f.highlight=function(Q){if(!Q)this.highlightId=[1,1,1,1];else{var nt=Q.index,Y=nt&255,q=nt>>8&255,ot=nt>>16&255;this.highlightId=[Y/255,q/255,ot/255,0]}};function st(Q,nt,Y,q){var ot;b(Q)?nt<Q.length?ot=Q[nt]:ot=void 0:ot=Q,ot=m(ot);var it=!0;i(ot)&&(ot="▼",it=!1),Y||(Y={});var dt=Y.family;b(dt)&&(dt=dt[nt]),dt||(dt="normal");var wt=Y.weight;b(wt)&&(wt=wt[nt]),wt||(wt="normal");var xt=Y.style;b(xt)&&(xt=xt[nt]),xt||(xt="normal");var Ft=Y.variant;b(Ft)&&(Ft=Ft[nt]),Ft||(Ft="normal");var Et=v(ot,{family:dt,weight:wt,style:xt,variant:Ft},q),Et=v(ot,Y,q);return{mesh:Et[0],lines:Et[1],bounds:Et[2],visible:it}}f.update=function(Q){if(Q=Q||{},"perspective"in Q&&(this.useOrtho=!Q.perspective),"orthographic"in Q&&(this.useOrtho=!!Q.orthographic),"lineWidth"in Q&&(this.lineWidth=Q.lineWidth),"project"in Q)if(b(Q.project))this.axesProject=Q.project;else{var nt=!!Q.project;this.axesProject=[nt,nt,nt]}if("projectScale"in Q)if(b(Q.projectScale))this.projectScale=Q.projectScale.slice();else{var Y=+Q.projectScale;this.projectScale=[Y,Y,Y]}if(this.projectHasAlpha=!1,"projectOpacity"in Q){if(b(Q.projectOpacity))this.projectOpacity=Q.projectOpacity.slice();else{var Y=+Q.projectOpacity;this.projectOpacity=[Y,Y,Y]}for(var q=0;q<3;++q)this.projectOpacity[q]=w(this.projectOpacity[q]),this.projectOpacity[q]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in Q&&(this.opacity=w(Q.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var ot=Q.position,it={family:Q.font||"normal",style:Q.fontStyle||"normal",weight:Q.fontWeight||"normal",variant:Q.fontVariant||"normal"},dt=Q.alignment||[0,0],wt,xt;if(dt.length===2)wt=dt[0],xt=dt[1];else{wt=[],xt=[];for(var q=0;q<dt.length;++q)wt[q]=dt[q][0],xt[q]=dt[q][1]}var Ft=[1/0,1/0,1/0],Et=[-1/0,-1/0,-1/0],Nt=Q.glyph,te=Q.color,Jt=Q.size,Qt=Q.angle,Wt=Q.lineColor,gt=-1,bt=0,vt=0,Ut=0;if(ot.length){Ut=ot.length;t:for(var q=0;q<Ut;++q){for(var Kt=ot[q],Zt=0;Zt<3;++Zt)if(isNaN(Kt[Zt])||!isFinite(Kt[Zt]))continue t;var le=st(Nt,q,it,this.pixelRatio),Te=le.mesh,Se=le.lines,Fe=le.bounds;bt+=Te.cells.length*3,vt+=Se.edges.length*2}}var Oe=bt+vt,ur=a.mallocFloat(3*Oe),fr=a.mallocFloat(4*Oe),We=a.mallocFloat(2*Oe),Lr=a.mallocUint32(Oe);if(Oe>0){var kr=0,he=bt,Dt=[0,0,0,1],qt=[0,0,0,1],zt=b(te)&&b(te[0]),ut=b(Wt)&&b(Wt[0]);t:for(var q=0;q<Ut;++q){gt+=1;for(var Kt=ot[q],Zt=0;Zt<3;++Zt){if(isNaN(Kt[Zt])||!isFinite(Kt[Zt]))continue t;Et[Zt]=Math.max(Et[Zt],Kt[Zt]),Ft[Zt]=Math.min(Ft[Zt],Kt[Zt])}var le=st(Nt,q,it,this.pixelRatio),Te=le.mesh,Se=le.lines,Fe=le.bounds,yt=le.visible;if(!yt)Dt=[1,1,1,0];else if(b(te)){var Mt;if(zt?q<te.length?Mt=te[q]:Mt=[0,0,0,0]:Mt=te,Mt.length===3){for(var Zt=0;Zt<3;++Zt)Dt[Zt]=Mt[Zt];Dt[3]=1}else if(Mt.length===4){for(var Zt=0;Zt<4;++Zt)Dt[Zt]=Mt[Zt];!this.hasAlpha&&Mt[3]<1&&(this.hasAlpha=!0)}}else Dt[0]=Dt[1]=Dt[2]=0,Dt[3]=1;if(!yt)qt=[1,1,1,0];else if(b(Wt)){var Mt;if(ut?q<Wt.length?Mt=Wt[q]:Mt=[0,0,0,0]:Mt=Wt,Mt.length===3){for(var Zt=0;Zt<3;++Zt)qt[Zt]=Mt[Zt];qt[Zt]=1}else if(Mt.length===4){for(var Zt=0;Zt<4;++Zt)qt[Zt]=Mt[Zt];!this.hasAlpha&&Mt[3]<1&&(this.hasAlpha=!0)}}else qt[0]=qt[1]=qt[2]=0,qt[3]=1;var Ot=.5;yt?b(Jt)?q<Jt.length?Ot=+Jt[q]:Ot=12:Jt?Ot=+Jt:this.useOrtho&&(Ot=12):Ot=0;var $t=0;b(Qt)?q<Qt.length?$t=+Qt[q]:$t=0:Qt&&($t=+Qt);for(var ee=Math.cos($t),we=Math.sin($t),Kt=ot[q],Zt=0;Zt<3;++Zt)Et[Zt]=Math.max(Et[Zt],Kt[Zt]),Ft[Zt]=Math.min(Ft[Zt],Kt[Zt]);var Me=wt,Re=xt,Me=0;b(wt)?q<wt.length?Me=wt[q]:Me=0:wt&&(Me=wt);var Re=0;b(xt)?q<xt.length?Re=xt[q]:Re=0:xt&&(Re=xt),Me*=Me>0?1-Fe[0][0]:Me<0?1+Fe[1][0]:1,Re*=Re>0?1-Fe[0][1]:Re<0?1+Fe[1][1]:1;for(var Be=[Me,Re],Ze=Te.cells||[],Ue=Te.positions||[],Zt=0;Zt<Ze.length;++Zt)for(var mr=Ze[Zt],ln=0;ln<3;++ln){for(var an=0;an<3;++an)ur[3*kr+an]=Kt[an];for(var an=0;an<4;++an)fr[4*kr+an]=Dt[an];Lr[kr]=gt;var vn=Ue[mr[ln]];We[2*kr]=Ot*(ee*vn[0]-we*vn[1]+Be[0]),We[2*kr+1]=Ot*(we*vn[0]+ee*vn[1]+Be[1]),kr+=1}for(var Ze=Se.edges,Ue=Se.positions,Zt=0;Zt<Ze.length;++Zt)for(var mr=Ze[Zt],ln=0;ln<2;++ln){for(var an=0;an<3;++an)ur[3*he+an]=Kt[an];for(var an=0;an<4;++an)fr[4*he+an]=qt[an];Lr[he]=gt;var vn=Ue[mr[ln]];We[2*he]=Ot*(ee*vn[0]-we*vn[1]+Be[0]),We[2*he+1]=Ot*(we*vn[0]+ee*vn[1]+Be[1]),he+=1}}}this.bounds=[Ft,Et],this.points=ot,this.pointCount=ot.length,this.vertexCount=bt,this.lineVertexCount=vt,this.pointBuffer.update(ur),this.colorBuffer.update(fr),this.glyphBuffer.update(We),this.idBuffer.update(Lr),a.free(ur),a.free(fr),a.free(We),a.free(Lr)},f.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()};function $(Q){var nt=Q.gl,Y=h.createPerspective(nt),q=h.createOrtho(nt),ot=h.createProject(nt),it=h.createPickPerspective(nt),dt=h.createPickOrtho(nt),wt=h.createPickProject(nt),xt=n(nt),Ft=n(nt),Et=n(nt),Nt=n(nt),te=o(nt,[{buffer:xt,size:3,type:nt.FLOAT},{buffer:Ft,size:4,type:nt.FLOAT},{buffer:Et,size:2,type:nt.FLOAT},{buffer:Nt,size:4,type:nt.UNSIGNED_BYTE,normalized:!0}]),Jt=new u(nt,Y,q,ot,xt,Ft,Et,Nt,te,it,dt,wt);return Jt.update(Q),Jt}},3589:function(t,e,r){t.exports=p;var i=r(2260),n=r(1888),o=r(9618),a=r(8828).nextPow2,s=function(y,l,x){for(var b=1e8,S=-1,T=-1,M=y.shape[0],w=y.shape[1],u=0;u<M;u++)for(var f=0;f<w;f++){var k=y.get(u,f,0),_=y.get(u,f,1),D=y.get(u,f,2),I=y.get(u,f,3);if(k<255||_<255||D<255||I<255){var O=l-u,B=x-f,R=O*O+B*B;R<b&&(b=R,S=u,T=f)}}return[S,T,b]};function h(y,l,x,b,S){this.coord=[y,l],this.id=x,this.value=b,this.distance=S}function v(y,l,x){this.gl=y,this.fbo=l,this.buffer=x,this._readTimeout=null;var b=this;this._readCallback=function(){b.gl&&(l.bind(),y.readPixels(0,0,l.shape[0],l.shape[1],y.RGBA,y.UNSIGNED_BYTE,b.buffer),b._readTimeout=null)}}var m=v.prototype;Object.defineProperty(m,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(y){if(this.gl){this.fbo.shape=y;var l=this.fbo.shape[0],x=this.fbo.shape[1];if(x*l*4>this.buffer.length){n.free(this.buffer);for(var b=this.buffer=n.mallocUint8(a(x*l*4)),S=0;S<x*l*4;++S)b[S]=255}return y}}}),m.begin=function(){var y=this.gl;this.shape,y&&(this.fbo.bind(),y.clearColor(1,1,1,1),y.clear(y.COLOR_BUFFER_BIT|y.DEPTH_BUFFER_BIT))},m.end=function(){var y=this.gl;y&&(y.bindFramebuffer(y.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},m.query=function(y,l,x){if(!this.gl)return null;var b=this.fbo.shape.slice();y=y|0,l=l|0,typeof x!="number"&&(x=1);var S=Math.min(Math.max(y-x,0),b[0])|0,T=Math.min(Math.max(y+x,0),b[0])|0,M=Math.min(Math.max(l-x,0),b[1])|0,w=Math.min(Math.max(l+x,0),b[1])|0;if(T<=S||w<=M)return null;var u=[T-S,w-M],f=o(this.buffer,[u[0],u[1],4],[4,b[0]*4,1],4*(S+b[0]*M)),k=s(f.hi(u[0],u[1],1),x,x),_=k[0],D=k[1];if(_<0||Math.pow(this.radius,2)<k[2])return null;var I=f.get(_,D,0),O=f.get(_,D,1),B=f.get(_,D,2),R=f.get(_,D,3);return new h(_+S|0,D+M|0,I,[O,B,R],Math.sqrt(k[2]))},m.dispose=function(){this.gl&&(this.fbo.dispose(),n.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))};function p(y,l){var x=l[0],b=l[1],S={},T=i(y,x,b,S),M=n.mallocUint8(x*b*4);return new v(y,T,M)}},9405:function(t,e,r){var i=r(3327),n=r(8731),o=r(216),a=r(5091),s=r(2145),h=r(8866);function v(l){this.gl=l,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var m=v.prototype;m.bind=function(){this.program||this._relink();var l,x=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),b=this.gl.lastAttribCount;if(x>b)for(l=b;l<x;l++)this.gl.enableVertexAttribArray(l);else if(b>x)for(l=x;l<b;l++)this.gl.disableVertexAttribArray(l);this.gl.lastAttribCount=x,this.gl.useProgram(this.program)},m.dispose=function(){for(var l=this.gl.lastAttribCount,x=0;x<l;x++)this.gl.disableVertexAttribArray(x);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null};function p(l,x){return l.name<x.name?-1:1}m.update=function(l,x,b,S){if(!x||arguments.length===1){var T=l;l=T.vertex,x=T.fragment,b=T.uniforms,S=T.attributes}var M=this,w=M.gl,u=M._vref;M._vref=a.shader(w,w.VERTEX_SHADER,l),u&&u.dispose(),M.vertShader=M._vref.shader;var f=this._fref;if(M._fref=a.shader(w,w.FRAGMENT_SHADER,x),f&&f.dispose(),M.fragShader=M._fref.shader,!b||!S){var k=w.createProgram();if(w.attachShader(k,M.fragShader),w.attachShader(k,M.vertShader),w.linkProgram(k),!w.getProgramParameter(k,w.LINK_STATUS)){var _=w.getProgramInfoLog(k);throw new h(_,"Error linking program:"+_)}b=b||s.uniforms(w,k),S=S||s.attributes(w,k),w.deleteProgram(k)}S=S.slice(),S.sort(p);var D=[],I=[],O=[],B;for(B=0;B<S.length;++B){var R=S[B];if(R.type.indexOf("mat")>=0){for(var L=R.type.charAt(R.type.length-1)|0,F=new Array(L),N=0;N<L;++N)F[N]=O.length,I.push(R.name+"["+N+"]"),typeof R.location=="number"?O.push(R.location+N):Array.isArray(R.location)&&R.location.length===L&&typeof R.location[N]=="number"?O.push(R.location[N]|0):O.push(-1);D.push({name:R.name,type:R.type,locations:F})}else D.push({name:R.name,type:R.type,locations:[O.length]}),I.push(R.name),typeof R.location=="number"?O.push(R.location|0):O.push(-1)}var j=0;for(B=0;B<O.length;++B)if(O[B]<0){for(;O.indexOf(j)>=0;)j+=1;O[B]=j}var G=new Array(b.length);function rt(){M.program=a.program(w,M._vref,M._fref,I,O);for(var ct=0;ct<b.length;++ct)G[ct]=w.getUniformLocation(M.program,b[ct].name)}rt(),M._relink=rt,M.types={uniforms:o(b),attributes:o(S)},M.attributes=n(w,M,D,O),Object.defineProperty(M,"uniforms",i(w,M,b,G))};function y(l,x,b,S,T){var M=new v(l);return M.update(x,b,S,T),M}t.exports=y},8866:function(t){function e(r,i,n){this.shortMessage=i||"",this.longMessage=n||"",this.rawError=r||"",this.message="gl-shader: "+(i||r||"")+(n?`
|
||
`+n:""),this.stack=new Error().stack}e.prototype=new Error,e.prototype.name="GLError",e.prototype.constructor=e,t.exports=e},8731:function(t,e,r){t.exports=v;var i=r(8866);function n(m,p,y,l,x,b){this._gl=m,this._wrapper=p,this._index=y,this._locations=l,this._dimension=x,this._constFunc=b}var o=n.prototype;o.pointer=function(m,p,y,l){var x=this,b=x._gl,S=x._locations[x._index];b.vertexAttribPointer(S,x._dimension,m||b.FLOAT,!!p,y||0,l||0),b.enableVertexAttribArray(S)},o.set=function(m,p,y,l){return this._constFunc(this._locations[this._index],m,p,y,l)},Object.defineProperty(o,"location",{get:function(){return this._locations[this._index]},set:function(m){return m!==this._locations[this._index]&&(this._locations[this._index]=m|0,this._wrapper.program=null),m|0}});var a=[function(m,p,y){return y.length===void 0?m.vertexAttrib1f(p,y):m.vertexAttrib1fv(p,y)},function(m,p,y,l){return y.length===void 0?m.vertexAttrib2f(p,y,l):m.vertexAttrib2fv(p,y)},function(m,p,y,l,x){return y.length===void 0?m.vertexAttrib3f(p,y,l,x):m.vertexAttrib3fv(p,y)},function(m,p,y,l,x,b){return y.length===void 0?m.vertexAttrib4f(p,y,l,x,b):m.vertexAttrib4fv(p,y)}];function s(m,p,y,l,x,b,S){var T=a[x],M=new n(m,p,y,l,x,T);Object.defineProperty(b,S,{set:function(w){return m.disableVertexAttribArray(l[y]),T(m,l[y],w),w},get:function(){return M},enumerable:!0})}function h(m,p,y,l,x,b,S){for(var T=new Array(x),M=new Array(x),w=0;w<x;++w)s(m,p,y[w],l,x,T,w),M[w]=T[w];Object.defineProperty(T,"location",{set:function(k){if(Array.isArray(k))for(var _=0;_<x;++_)M[_].location=k[_];else for(var _=0;_<x;++_)M[_].location=k+_;return k},get:function(){for(var k=new Array(x),_=0;_<x;++_)k[_]=l[y[_]];return k},enumerable:!0}),T.pointer=function(k,_,D,I){k=k||m.FLOAT,_=!!_,D=D||x*x,I=I||0;for(var O=0;O<x;++O){var B=l[y[O]];m.vertexAttribPointer(B,x,k,_,D,I+O*x),m.enableVertexAttribArray(B)}};var u=new Array(x),f=m["vertexAttrib"+x+"fv"];Object.defineProperty(b,S,{set:function(k){for(var _=0;_<x;++_){var D=l[y[_]];if(m.disableVertexAttribArray(D),Array.isArray(k[0]))f.call(m,D,k[_]);else{for(var I=0;I<x;++I)u[I]=k[x*_+I];f.call(m,D,u)}}return k},get:function(){return T},enumerable:!0})}function v(m,p,y,l){for(var x={},b=0,S=y.length;b<S;++b){var T=y[b],M=T.name,w=T.type,u=T.locations;switch(w){case"bool":case"int":case"float":s(m,p,u[0],l,1,x,M);break;default:if(w.indexOf("vec")>=0){var f=w.charCodeAt(w.length-1)-48;if(f<2||f>4)throw new i("","Invalid data type for attribute "+M+": "+w);s(m,p,u[0],l,f,x,M)}else if(w.indexOf("mat")>=0){var f=w.charCodeAt(w.length-1)-48;if(f<2||f>4)throw new i("","Invalid data type for attribute "+M+": "+w);h(m,p,u,l,f,x,M)}else throw new i("","Unknown data type for attribute "+M+": "+w);break}}return x}},3327:function(t,e,r){var i=r(216),n=r(8866);t.exports=s;function o(h){return function(){return h}}function a(h,v){for(var m=new Array(h),p=0;p<h;++p)m[p]=v;return m}function s(h,v,m,p){function y(w){return function(u,f,k){return u.getUniform(f.program,k[w])}}function l(w){return function(u){for(var f=x("",w),k=0;k<f.length;++k){var _=f[k],D=_[0],I=_[1];if(p[I]){var O=u;if(typeof D=="string"&&(D.indexOf(".")===0||D.indexOf("[")===0)){var B=D;if(D.indexOf(".")===0&&(B=D.slice(1)),B.indexOf("]")===B.length-1){var R=B.indexOf("["),L=B.slice(0,R),F=B.slice(R+1,B.length-1);O=L?u[L][F]:u[F]}else O=u[B]}var N=m[I].type,j;switch(N){case"bool":case"int":case"sampler2D":case"samplerCube":h.uniform1i(p[I],O);break;case"float":h.uniform1f(p[I],O);break;default:var G=N.indexOf("vec");if(0<=G&&G<=1&&N.length===4+G){if(j=N.charCodeAt(N.length-1)-48,j<2||j>4)throw new n("","Invalid data type");switch(N.charAt(0)){case"b":case"i":h["uniform"+j+"iv"](p[I],O);break;case"v":h["uniform"+j+"fv"](p[I],O);break;default:throw new n("","Unrecognized data type for vector "+name+": "+N)}}else if(N.indexOf("mat")===0&&N.length===4){if(j=N.charCodeAt(N.length-1)-48,j<2||j>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+N);h["uniformMatrix"+j+"fv"](p[I],!1,O);break}else throw new n("","Unknown uniform data type for "+name+": "+N)}}}}}function x(w,u){if(typeof u!="object")return[[w,u]];var f=[];for(var k in u){var _=u[k],D=w;parseInt(k)+""===k?D+="["+k+"]":D+="."+k,typeof _=="object"?f.push.apply(f,x(D,_)):f.push([D,_])}return f}function b(w){switch(w){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var u=w.indexOf("vec");if(0<=u&&u<=1&&w.length===4+u){var f=w.charCodeAt(w.length-1)-48;if(f<2||f>4)throw new n("","Invalid data type");return w.charAt(0)==="b"?a(f,!1):a(f,0)}else if(w.indexOf("mat")===0&&w.length===4){var f=w.charCodeAt(w.length-1)-48;if(f<2||f>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+w);return a(f*f,0)}else throw new n("","Unknown uniform data type for "+name+": "+w)}}function S(w,u,f){if(typeof f=="object"){var k=T(f);Object.defineProperty(w,u,{get:o(k),set:l(f),enumerable:!0,configurable:!1})}else p[f]?Object.defineProperty(w,u,{get:y(f),set:l(f),enumerable:!0,configurable:!1}):w[u]=b(m[f].type)}function T(w){var u;if(Array.isArray(w)){u=new Array(w.length);for(var f=0;f<w.length;++f)S(u,f,w[f])}else{u={};for(var k in w)S(u,k,w[k])}return u}var M=i(m,!0);return{get:o(T(M)),set:l(M),enumerable:!0,configurable:!0}}},216:function(t){t.exports=e;function e(r,i){for(var n={},o=0;o<r.length;++o)for(var a=r[o].name,s=a.split("."),h=n,v=0;v<s.length;++v){var m=s[v].split("[");if(m.length>1){m[0]in h||(h[m[0]]=[]),h=h[m[0]];for(var p=1;p<m.length;++p){var y=parseInt(m[p]);p<m.length-1||v<s.length-1?(y in h||(p<m.length-1?h[y]=[]:h[y]={}),h=h[y]):i?h[y]=o:h[y]=r[o].type}}else v<s.length-1?(m[0]in h||(h[m[0]]={}),h=h[m[0]]):i?h[m[0]]=o:h[m[0]]=r[o].type}return n}},2145:function(t,e){e.uniforms=o,e.attributes=a;var r={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},i=null;function n(s,h){if(!i){var v=Object.keys(r);i={};for(var m=0;m<v.length;++m){var p=v[m];i[s[p]]=r[p]}}return i[h]}function o(s,h){for(var v=s.getProgramParameter(h,s.ACTIVE_UNIFORMS),m=[],p=0;p<v;++p){var y=s.getActiveUniform(h,p);if(y){var l=n(s,y.type);if(y.size>1)for(var x=0;x<y.size;++x)m.push({name:y.name.replace("[0]","["+x+"]"),type:l});else m.push({name:y.name,type:l})}}return m}function a(s,h){for(var v=s.getProgramParameter(h,s.ACTIVE_ATTRIBUTES),m=[],p=0;p<v;++p){var y=s.getActiveAttrib(h,p);y&&m.push({name:y.name,type:n(s,y.type)})}return m}},5091:function(t,e,r){e.shader=x,e.program=b;var i=r(8866),n=r(2992),o=typeof WeakMap>"u"?r(606):WeakMap,a=new o,s=0;function h(S,T,M,w,u,f,k){this.id=S,this.src=T,this.type=M,this.shader=w,this.count=f,this.programs=[],this.cache=k}h.prototype.dispose=function(){if(--this.count===0){for(var S=this.cache,T=S.gl,M=this.programs,w=0,u=M.length;w<u;++w){var f=S.programs[M[w]];f&&(delete S.programs[w],T.deleteProgram(f))}T.deleteShader(this.shader),delete S.shaders[this.type===T.FRAGMENT_SHADER|0][this.src]}};function v(S){this.gl=S,this.shaders=[{},{}],this.programs={}}var m=v.prototype;function p(S,T,M){var w=S.createShader(T);if(S.shaderSource(w,M),S.compileShader(w),!S.getShaderParameter(w,S.COMPILE_STATUS)){var u=S.getShaderInfoLog(w);try{var f=n(u,M,T)}catch(k){throw console.warn("Failed to format compiler error: "+k),new i(u,`Error compiling shader:
|
||
`+u)}throw new i(u,f.short,f.long)}return w}m.getShaderReference=function(S,T){var M=this.gl,w=this.shaders[S===M.FRAGMENT_SHADER|0],u=w[T];if(!u||!M.isShader(u.shader)){var f=p(M,S,T);u=w[T]=new h(s++,T,S,f,[],1,this)}else u.count+=1;return u};function y(S,T,M,w,u){var f=S.createProgram();S.attachShader(f,T),S.attachShader(f,M);for(var k=0;k<w.length;++k)S.bindAttribLocation(f,u[k],w[k]);if(S.linkProgram(f),!S.getProgramParameter(f,S.LINK_STATUS)){var _=S.getProgramInfoLog(f);throw new i(_,"Error linking program: "+_)}return f}m.getProgram=function(S,T,M,w){var u=[S.id,T.id,M.join(":"),w.join(":")].join("@"),f=this.programs[u];return(!f||!this.gl.isProgram(f))&&(this.programs[u]=f=y(this.gl,S.shader,T.shader,M,w),S.programs.push(u),T.programs.push(u)),f};function l(S){var T=a.get(S);return T||(T=new v(S),a.set(S,T)),T}function x(S,T,M){return l(S).getShaderReference(T,M)}function b(S,T,M,w,u){return l(S).getProgram(T,M,w,u)}},1493:function(t,e,r){var i=r(3236),n=r(9405),o=i([`precision mediump float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position, color;
|
||
attribute float weight;
|
||
|
||
uniform mat4 model, view, projection;
|
||
uniform vec3 coordinates[3];
|
||
uniform vec4 colors[3];
|
||
uniform vec2 screenShape;
|
||
uniform float lineWidth;
|
||
|
||
varying vec4 fragColor;
|
||
|
||
void main() {
|
||
vec3 vertexPosition = mix(coordinates[0],
|
||
mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));
|
||
|
||
vec4 clipPos = projection * (view * (model * vec4(vertexPosition, 1.0)));
|
||
vec2 clipOffset = (projection * (view * (model * vec4(color, 0.0)))).xy;
|
||
vec2 delta = weight * clipOffset * screenShape;
|
||
vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;
|
||
|
||
gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);
|
||
fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];
|
||
}
|
||
`]),a=i([`precision mediump float;
|
||
#define GLSLIFY 1
|
||
|
||
varying vec4 fragColor;
|
||
|
||
void main() {
|
||
gl_FragColor = fragColor;
|
||
}`]);t.exports=function(s){return n(s,o,a,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},4449:function(t,e,r){var i=r(2762),n=r(8116),o=r(1493);t.exports=y;var a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,x,b,S){this.gl=l,this.buffer=x,this.vao=b,this.shader=S,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var h=s.prototype,v=[0,0,0],m=[0,0,0],p=[0,0];h.isTransparent=function(){return!1},h.drawTransparent=function(l){},h.draw=function(l){var x=this.gl,b=this.vao,S=this.shader;b.bind(),S.bind();var T=l.model||a,M=l.view||a,w=l.projection||a,u;this.axes&&(u=this.axes.lastCubeProps.axis);for(var f=v,k=m,_=0;_<3;++_)u&&u[_]<0?(f[_]=this.bounds[0][_],k[_]=this.bounds[1][_]):(f[_]=this.bounds[1][_],k[_]=this.bounds[0][_]);p[0]=x.drawingBufferWidth,p[1]=x.drawingBufferHeight,S.uniforms.model=T,S.uniforms.view=M,S.uniforms.projection=w,S.uniforms.coordinates=[this.position,f,k],S.uniforms.colors=this.colors,S.uniforms.screenShape=p;for(var _=0;_<3;++_)S.uniforms.lineWidth=this.lineWidth[_]*this.pixelRatio,this.enabled[_]&&(b.draw(x.TRIANGLES,6,6*_),this.drawSides[_]&&b.draw(x.TRIANGLES,12,18+12*_));b.unbind()},h.update=function(l){l&&("bounds"in l&&(this.bounds=l.bounds),"position"in l&&(this.position=l.position),"lineWidth"in l&&(this.lineWidth=l.lineWidth),"colors"in l&&(this.colors=l.colors),"enabled"in l&&(this.enabled=l.enabled),"drawSides"in l&&(this.drawSides=l.drawSides))},h.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function y(l,x){var b=[];function S(f,k,_,D,I,O){var B=[f,k,_,0,0,0,1];B[D+3]=1,B[D]=I,b.push.apply(b,B),B[6]=-1,b.push.apply(b,B),B[D]=O,b.push.apply(b,B),b.push.apply(b,B),B[6]=1,b.push.apply(b,B),B[D]=I,b.push.apply(b,B)}S(0,0,0,0,0,1),S(0,0,0,1,0,1),S(0,0,0,2,0,1),S(1,0,0,1,-1,1),S(1,0,0,2,-1,1),S(0,1,0,0,-1,1),S(0,1,0,2,-1,1),S(0,0,1,0,-1,1),S(0,0,1,1,-1,1);var T=i(l,b),M=n(l,[{type:l.FLOAT,buffer:T,size:3,offset:0,stride:28},{type:l.FLOAT,buffer:T,size:3,offset:12,stride:28},{type:l.FLOAT,buffer:T,size:1,offset:24,stride:28}]),w=o(l);w.attributes.position.location=0,w.attributes.color.location=1,w.attributes.weight.location=2;var u=new s(l,T,M,w);return u.update(x),u}},6740:function(t,e,r){var i=r(3236),n=i([`precision highp float;
|
||
|
||
precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
vec3 getOrthogonalVector(vec3 v) {
|
||
// Return up-vector for only-z vector.
|
||
// Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
|
||
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
|
||
// Assign z = 0, x = -b, y = a:
|
||
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
|
||
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
|
||
return normalize(vec3(-v.y, v.x, 0.0));
|
||
} else {
|
||
return normalize(vec3(0.0, v.z, -v.y));
|
||
}
|
||
}
|
||
|
||
// Calculate the tube vertex and normal at the given index.
|
||
//
|
||
// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.
|
||
//
|
||
// Each tube segment is made up of a ring of vertices.
|
||
// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.
|
||
// The indexes of tube segments run from 0 to 8.
|
||
//
|
||
vec3 getTubePosition(vec3 d, float index, out vec3 normal) {
|
||
float segmentCount = 8.0;
|
||
|
||
float angle = 2.0 * 3.14159 * (index / segmentCount);
|
||
|
||
vec3 u = getOrthogonalVector(d);
|
||
vec3 v = normalize(cross(u, d));
|
||
|
||
vec3 x = u * cos(angle) * length(d);
|
||
vec3 y = v * sin(angle) * length(d);
|
||
vec3 v3 = x + y;
|
||
|
||
normal = normalize(v3);
|
||
|
||
return v3;
|
||
}
|
||
|
||
attribute vec4 vector;
|
||
attribute vec4 color, position;
|
||
attribute vec2 uv;
|
||
|
||
uniform float vectorScale, tubeScale;
|
||
uniform mat4 model, view, projection, inverseModel;
|
||
uniform vec3 eyePosition, lightPosition;
|
||
|
||
varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
|
||
varying vec4 f_color;
|
||
varying vec2 f_uv;
|
||
|
||
void main() {
|
||
// Scale the vector magnitude to stay constant with
|
||
// model & view changes.
|
||
vec3 normal;
|
||
vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);
|
||
vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
|
||
|
||
//Lighting geometry parameters
|
||
vec4 cameraCoordinate = view * tubePosition;
|
||
cameraCoordinate.xyz /= cameraCoordinate.w;
|
||
f_lightDirection = lightPosition - cameraCoordinate.xyz;
|
||
f_eyeDirection = eyePosition - cameraCoordinate.xyz;
|
||
f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);
|
||
|
||
// vec4 m_position = model * vec4(tubePosition, 1.0);
|
||
vec4 t_position = view * tubePosition;
|
||
gl_Position = projection * t_position;
|
||
|
||
f_color = color;
|
||
f_data = tubePosition.xyz;
|
||
f_position = position.xyz;
|
||
f_uv = uv;
|
||
}
|
||
`]),o=i([`#extension GL_OES_standard_derivatives : enable
|
||
|
||
precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
float beckmannDistribution(float x, float roughness) {
|
||
float NdotH = max(x, 0.0001);
|
||
float cos2Alpha = NdotH * NdotH;
|
||
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
|
||
float roughness2 = roughness * roughness;
|
||
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
|
||
return exp(tan2Alpha / roughness2) / denom;
|
||
}
|
||
|
||
float cookTorranceSpecular(
|
||
vec3 lightDirection,
|
||
vec3 viewDirection,
|
||
vec3 surfaceNormal,
|
||
float roughness,
|
||
float fresnel) {
|
||
|
||
float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);
|
||
float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);
|
||
|
||
//Half angle vector
|
||
vec3 H = normalize(lightDirection + viewDirection);
|
||
|
||
//Geometric term
|
||
float NdotH = max(dot(surfaceNormal, H), 0.0);
|
||
float VdotH = max(dot(viewDirection, H), 0.000001);
|
||
float LdotH = max(dot(lightDirection, H), 0.000001);
|
||
float G1 = (2.0 * NdotH * VdotN) / VdotH;
|
||
float G2 = (2.0 * NdotH * LdotN) / LdotH;
|
||
float G = min(1.0, min(G1, G2));
|
||
|
||
//Distribution term
|
||
float D = beckmannDistribution(NdotH, roughness);
|
||
|
||
//Fresnel term
|
||
float F = pow(1.0 - VdotN, fresnel);
|
||
|
||
//Multiply terms and done
|
||
return G * F * D / max(3.14159265 * VdotN, 0.000001);
|
||
}
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec3 clipBounds[2];
|
||
uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;
|
||
uniform sampler2D texture;
|
||
|
||
varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
|
||
varying vec4 f_color;
|
||
varying vec2 f_uv;
|
||
|
||
void main() {
|
||
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
|
||
vec3 N = normalize(f_normal);
|
||
vec3 L = normalize(f_lightDirection);
|
||
vec3 V = normalize(f_eyeDirection);
|
||
|
||
if(gl_FrontFacing) {
|
||
N = -N;
|
||
}
|
||
|
||
float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));
|
||
float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
|
||
|
||
vec4 surfaceColor = f_color * texture2D(texture, f_uv);
|
||
vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
|
||
|
||
gl_FragColor = litColor * opacity;
|
||
}
|
||
`]),a=i([`precision highp float;
|
||
|
||
precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
vec3 getOrthogonalVector(vec3 v) {
|
||
// Return up-vector for only-z vector.
|
||
// Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
|
||
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
|
||
// Assign z = 0, x = -b, y = a:
|
||
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
|
||
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
|
||
return normalize(vec3(-v.y, v.x, 0.0));
|
||
} else {
|
||
return normalize(vec3(0.0, v.z, -v.y));
|
||
}
|
||
}
|
||
|
||
// Calculate the tube vertex and normal at the given index.
|
||
//
|
||
// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.
|
||
//
|
||
// Each tube segment is made up of a ring of vertices.
|
||
// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.
|
||
// The indexes of tube segments run from 0 to 8.
|
||
//
|
||
vec3 getTubePosition(vec3 d, float index, out vec3 normal) {
|
||
float segmentCount = 8.0;
|
||
|
||
float angle = 2.0 * 3.14159 * (index / segmentCount);
|
||
|
||
vec3 u = getOrthogonalVector(d);
|
||
vec3 v = normalize(cross(u, d));
|
||
|
||
vec3 x = u * cos(angle) * length(d);
|
||
vec3 y = v * sin(angle) * length(d);
|
||
vec3 v3 = x + y;
|
||
|
||
normal = normalize(v3);
|
||
|
||
return v3;
|
||
}
|
||
|
||
attribute vec4 vector;
|
||
attribute vec4 position;
|
||
attribute vec4 id;
|
||
|
||
uniform mat4 model, view, projection;
|
||
uniform float tubeScale;
|
||
|
||
varying vec3 f_position;
|
||
varying vec4 f_id;
|
||
|
||
void main() {
|
||
vec3 normal;
|
||
vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);
|
||
vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
|
||
|
||
gl_Position = projection * (view * tubePosition);
|
||
f_id = id;
|
||
f_position = position.xyz;
|
||
}
|
||
`]),s=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec3 clipBounds[2];
|
||
uniform float pickId;
|
||
|
||
varying vec3 f_position;
|
||
varying vec4 f_id;
|
||
|
||
void main() {
|
||
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
|
||
|
||
gl_FragColor = vec4(pickId, f_id.xyz);
|
||
}`]);e.meshShader={vertex:n,fragment:o,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},e.pickShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(t,e,r){var i=r(2931),n=r(9970),o=["xyz","xzy","yxz","yzx","zxy","zyx"],a=function(b,S,T,M){for(var w=b.points,u=b.velocities,f=b.divergences,k=[],_=[],D=[],I=[],O=[],B=[],R=0,L=0,F=n.create(),N=n.create(),j=8,G=0;G<w.length;G++){var rt=w[G],ct=u[G],lt=f[G];S===0&&(lt=T*.05),L=i.length(ct)/M,F=n.create(),i.copy(F,ct),F[3]=lt;for(var tt=0;tt<j;tt++)O[tt]=[rt[0],rt[1],rt[2],tt];if(I.length>0)for(var tt=0;tt<j;tt++){var Z=(tt+1)%j;k.push(I[tt],O[tt],O[Z],O[Z],I[Z],I[tt]),D.push(N,F,F,F,N,N),B.push(R,L,L,L,R,R);var st=k.length;_.push([st-6,st-5,st-4],[st-3,st-2,st-1])}var $=I;I=O,O=$;var Q=N;N=F,F=Q;var nt=R;R=L,L=nt}return{positions:k,cells:_,vectors:D,vertexIntensity:B}},s=function(b,S,T,M){for(var w=0,u=0;u<b.length;u++)for(var f=b[u].velocities,k=0;k<f.length;k++)w=Math.max(w,i.length(f[k]));for(var _=b.map(function(rt){return a(rt,T,M,w)}),D=[],I=[],O=[],B=[],u=0;u<_.length;u++){var R=_[u],L=D.length;D=D.concat(R.positions),O=O.concat(R.vectors),B=B.concat(R.vertexIntensity);for(var k=0;k<R.cells.length;k++){var F=R.cells[k],N=[];I.push(N);for(var j=0;j<F.length;j++)N.push(F[j]+L)}}return{positions:D,cells:I,vectors:O,vertexIntensity:B,colormap:S}},h=function(b,S){var T=b.length,M;for(M=0;M<T;M++){var w=b[M];if(w===S)return M;if(w>S)return M-1}return M},v=function(b,S,T){return b<S?S:b>T?T:b},m=function(b,S,T){var M=S.vectors,w=S.meshgrid,u=b[0],f=b[1],k=b[2],_=w[0].length,D=w[1].length,I=w[2].length,O=h(w[0],u),B=h(w[1],f),R=h(w[2],k),L=O+1,F=B+1,N=R+1;if(O=v(O,0,_-1),L=v(L,0,_-1),B=v(B,0,D-1),F=v(F,0,D-1),R=v(R,0,I-1),N=v(N,0,I-1),O<0||B<0||R<0||L>_-1||F>D-1||N>I-1)return i.create();var j=w[0][O],G=w[0][L],rt=w[1][B],ct=w[1][F],lt=w[2][R],tt=w[2][N],Z=(u-j)/(G-j),st=(f-rt)/(ct-rt),$=(k-lt)/(tt-lt);isFinite(Z)||(Z=.5),isFinite(st)||(st=.5),isFinite($)||($=.5);var Q,nt,Y,q,ot,it;switch(T.reversedX&&(O=_-1-O,L=_-1-L),T.reversedY&&(B=D-1-B,F=D-1-F),T.reversedZ&&(R=I-1-R,N=I-1-N),T.filled){case 5:ot=R,it=N,Y=B*I,q=F*I,Q=O*I*D,nt=L*I*D;break;case 4:ot=R,it=N,Q=O*I,nt=L*I,Y=B*I*_,q=F*I*_;break;case 3:Y=B,q=F,ot=R*D,it=N*D,Q=O*D*I,nt=L*D*I;break;case 2:Y=B,q=F,Q=O*D,nt=L*D,ot=R*D*_,it=N*D*_;break;case 1:Q=O,nt=L,ot=R*_,it=N*_,Y=B*_*I,q=F*_*I;break;default:Q=O,nt=L,Y=B*_,q=F*_,ot=R*_*D,it=N*_*D;break}var dt=M[Q+Y+ot],wt=M[Q+Y+it],xt=M[Q+q+ot],Ft=M[Q+q+it],Et=M[nt+Y+ot],Nt=M[nt+Y+it],te=M[nt+q+ot],Jt=M[nt+q+it],Qt=i.create(),Wt=i.create(),gt=i.create(),bt=i.create();i.lerp(Qt,dt,Et,Z),i.lerp(Wt,wt,Nt,Z),i.lerp(gt,xt,te,Z),i.lerp(bt,Ft,Jt,Z);var vt=i.create(),Ut=i.create();i.lerp(vt,Qt,gt,st),i.lerp(Ut,Wt,bt,st);var Kt=i.create();return i.lerp(Kt,vt,Ut,$),Kt},p=function(b){var S=1/0;b.sort(function(u,f){return u-f});for(var T=b.length,M=1;M<T;M++){var w=Math.abs(b[M]-b[M-1]);w<S&&(S=w)}return S},y=function(b){for(var S=[],T=[],M=[],w={},u={},f={},k=b.length,_=0;_<k;_++){var D=b[_],I=D[0],O=D[1],B=D[2];w[I]||(S.push(I),w[I]=!0),u[O]||(T.push(O),u[O]=!0),f[B]||(M.push(B),f[B]=!0)}var R=p(S),L=p(T),F=p(M),N=Math.min(R,L,F);return isFinite(N)?N:1};t.exports=function(b,S){var T=b.startingPositions,M=b.maxLength||1e3,w=b.tubeSize||1,u=b.absoluteTubeSize,f=b.gridFill||"+x+y+z",k={};f.indexOf("-x")!==-1&&(k.reversedX=!0),f.indexOf("-y")!==-1&&(k.reversedY=!0),f.indexOf("-z")!==-1&&(k.reversedZ=!0),k.filled=o.indexOf(f.replace(/-/g,"").replace(/\+/g,""));var _=b.getVelocity||function(Nt){return m(Nt,b,k)},D=b.getDivergence||function(Nt,te){var Jt=i.create(),Qt=1e-4;i.add(Jt,Nt,[Qt,0,0]);var Wt=_(Jt);i.subtract(Wt,Wt,te),i.scale(Wt,Wt,1/Qt),i.add(Jt,Nt,[0,Qt,0]);var gt=_(Jt);i.subtract(gt,gt,te),i.scale(gt,gt,1/Qt),i.add(Jt,Nt,[0,0,Qt]);var bt=_(Jt);return i.subtract(bt,bt,te),i.scale(bt,bt,1/Qt),i.add(Jt,Wt,gt),i.add(Jt,Jt,bt),Jt},I=[],O=S[0][0],B=S[0][1],R=S[0][2],L=S[1][0],F=S[1][1],N=S[1][2],j=function(Nt){var te=Nt[0],Jt=Nt[1],Qt=Nt[2];return!(te<O||te>L||Jt<B||Jt>F||Qt<R||Qt>N)},G=i.distance(S[0],S[1]),rt=10*G/M,ct=rt*rt,lt=1,tt=0,Z=T.length;Z>1&&(lt=y(T));for(var st=0;st<Z;st++){var $=i.create();i.copy($,T[st]);var Q=[$],nt=[],Y=_($),q=$;nt.push(Y);var ot=[],it=D($,Y),dt=i.length(it);isFinite(dt)&&dt>tt&&(tt=dt),ot.push(dt),I.push({points:Q,velocities:nt,divergences:ot});for(var wt=0;wt<M*100&&Q.length<M&&j($);){wt++;var xt=i.clone(Y),Ft=i.squaredLength(xt);if(Ft===0)break;if(Ft>ct&&i.scale(xt,xt,rt/Math.sqrt(Ft)),i.add(xt,xt,$),Y=_(xt),i.squaredDistance(q,xt)-ct>-1e-4*ct){Q.push(xt),q=xt,nt.push(Y);var it=D(xt,Y),dt=i.length(it);isFinite(dt)&&dt>tt&&(tt=dt),ot.push(dt)}$=xt}}var Et=s(I,b.colormap,tt,lt);return u?Et.tubeScale=u:(tt===0&&(tt=1),Et.tubeScale=w*.5*lt/tt),Et};var l=r(6740),x=r(6405).createMesh;t.exports.createTubeMesh=function(b,S){return x(b,S,{shaders:l,traceType:"streamtube"})}},990:function(t,e,r){var i=r(9405),n=r(3236),o=n([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec4 uv;
|
||
attribute vec3 f;
|
||
attribute vec3 normal;
|
||
|
||
uniform vec3 objectOffset;
|
||
uniform mat4 model, view, projection, inverseModel;
|
||
uniform vec3 lightPosition, eyePosition;
|
||
uniform sampler2D colormap;
|
||
|
||
varying float value, kill;
|
||
varying vec3 worldCoordinate;
|
||
varying vec2 planeCoordinate;
|
||
varying vec3 lightDirection, eyeDirection, surfaceNormal;
|
||
varying vec4 vColor;
|
||
|
||
void main() {
|
||
vec3 localCoordinate = vec3(uv.zw, f.x);
|
||
worldCoordinate = objectOffset + localCoordinate;
|
||
mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));
|
||
vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0);
|
||
vec4 clipPosition = projection * (view * worldPosition);
|
||
gl_Position = clipPosition;
|
||
kill = f.y;
|
||
value = f.z;
|
||
planeCoordinate = uv.xy;
|
||
|
||
vColor = texture2D(colormap, vec2(value, value));
|
||
|
||
//Lighting geometry parameters
|
||
vec4 cameraCoordinate = view * worldPosition;
|
||
cameraCoordinate.xyz /= cameraCoordinate.w;
|
||
lightDirection = lightPosition - cameraCoordinate.xyz;
|
||
eyeDirection = eyePosition - cameraCoordinate.xyz;
|
||
surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);
|
||
}
|
||
`]),a=n([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
float beckmannDistribution(float x, float roughness) {
|
||
float NdotH = max(x, 0.0001);
|
||
float cos2Alpha = NdotH * NdotH;
|
||
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
|
||
float roughness2 = roughness * roughness;
|
||
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
|
||
return exp(tan2Alpha / roughness2) / denom;
|
||
}
|
||
|
||
float beckmannSpecular(
|
||
vec3 lightDirection,
|
||
vec3 viewDirection,
|
||
vec3 surfaceNormal,
|
||
float roughness) {
|
||
return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);
|
||
}
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec3 lowerBound, upperBound;
|
||
uniform float contourTint;
|
||
uniform vec4 contourColor;
|
||
uniform sampler2D colormap;
|
||
uniform vec3 clipBounds[2];
|
||
uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;
|
||
uniform float vertexColor;
|
||
|
||
varying float value, kill;
|
||
varying vec3 worldCoordinate;
|
||
varying vec3 lightDirection, eyeDirection, surfaceNormal;
|
||
varying vec4 vColor;
|
||
|
||
void main() {
|
||
if (
|
||
kill > 0.0 ||
|
||
vColor.a == 0.0 ||
|
||
outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)
|
||
) discard;
|
||
|
||
vec3 N = normalize(surfaceNormal);
|
||
vec3 V = normalize(eyeDirection);
|
||
vec3 L = normalize(lightDirection);
|
||
|
||
if(gl_FrontFacing) {
|
||
N = -N;
|
||
}
|
||
|
||
float specular = max(beckmannSpecular(L, V, N, roughness), 0.);
|
||
float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
|
||
|
||
//decide how to interpolate color — in vertex or in fragment
|
||
vec4 surfaceColor =
|
||
step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +
|
||
step(.5, vertexColor) * vColor;
|
||
|
||
vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
|
||
|
||
gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;
|
||
}
|
||
`]),s=n([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec4 uv;
|
||
attribute float f;
|
||
|
||
uniform vec3 objectOffset;
|
||
uniform mat3 permutation;
|
||
uniform mat4 model, view, projection;
|
||
uniform float height, zOffset;
|
||
uniform sampler2D colormap;
|
||
|
||
varying float value, kill;
|
||
varying vec3 worldCoordinate;
|
||
varying vec2 planeCoordinate;
|
||
varying vec3 lightDirection, eyeDirection, surfaceNormal;
|
||
varying vec4 vColor;
|
||
|
||
void main() {
|
||
vec3 dataCoordinate = permutation * vec3(uv.xy, height);
|
||
worldCoordinate = objectOffset + dataCoordinate;
|
||
mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));
|
||
vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0);
|
||
|
||
vec4 clipPosition = projection * (view * worldPosition);
|
||
clipPosition.z += zOffset;
|
||
|
||
gl_Position = clipPosition;
|
||
value = f + objectOffset.z;
|
||
kill = -1.0;
|
||
planeCoordinate = uv.zw;
|
||
|
||
vColor = texture2D(colormap, vec2(value, value));
|
||
|
||
//Don't do lighting for contours
|
||
surfaceNormal = vec3(1,0,0);
|
||
eyeDirection = vec3(0,1,0);
|
||
lightDirection = vec3(0,0,1);
|
||
}
|
||
`]),h=n([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
uniform vec2 shape;
|
||
uniform vec3 clipBounds[2];
|
||
uniform float pickId;
|
||
|
||
varying float value, kill;
|
||
varying vec3 worldCoordinate;
|
||
varying vec2 planeCoordinate;
|
||
varying vec3 surfaceNormal;
|
||
|
||
vec2 splitFloat(float v) {
|
||
float vh = 255.0 * v;
|
||
float upper = floor(vh);
|
||
float lower = fract(vh);
|
||
return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);
|
||
}
|
||
|
||
void main() {
|
||
if ((kill > 0.0) ||
|
||
(outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;
|
||
|
||
vec2 ux = splitFloat(planeCoordinate.x / shape.x);
|
||
vec2 uy = splitFloat(planeCoordinate.y / shape.y);
|
||
gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));
|
||
}
|
||
`]);e.createShader=function(v){var m=i(v,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m.attributes.normal.location=2,m},e.createPickShader=function(v){var m=i(v,o,h,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m.attributes.normal.location=2,m},e.createContourShader=function(v){var m=i(v,s,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m},e.createPickContourShader=function(v){var m=i(v,s,h,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m}},9499:function(t,e,r){t.exports=nt;var i=r(8828),n=r(2762),o=r(8116),a=r(7766),s=r(1888),h=r(6729),v=r(5298),m=r(9994),p=r(9618),y=r(3711),l=r(6760),x=r(7608),b=r(2478),S=r(6199),T=r(990),M=T.createShader,w=T.createContourShader,u=T.createPickShader,f=T.createPickContourShader,k=4*10,_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],D=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],I=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];(function(){for(var Y=0;Y<3;++Y){var q=I[Y],ot=(Y+1)%3,it=(Y+2)%3;q[ot+0]=1,q[it+3]=1,q[Y+6]=1}})();function O(Y,q,ot,it,dt){this.position=Y,this.index=q,this.uv=ot,this.level=it,this.dataCoordinate=dt}var B=256;function R(Y,q,ot,it,dt,wt,xt,Ft,Et,Nt,te,Jt,Qt,Wt,gt){this.gl=Y,this.shape=q,this.bounds=ot,this.objectOffset=gt,this.intensityBounds=[],this._shader=it,this._pickShader=dt,this._coordinateBuffer=wt,this._vao=xt,this._colorMap=Ft,this._contourShader=Et,this._contourPickShader=Nt,this._contourBuffer=te,this._contourVAO=Jt,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new O([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=Qt,this._dynamicVAO=Wt,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[p(s.mallocFloat(1024),[0,0]),p(s.mallocFloat(1024),[0,0]),p(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var L=R.prototype;L.genColormap=function(Y,q){var ot=!1,it=m([h({colormap:Y,nshades:B,format:"rgba"}).map(function(dt,wt){var xt=q?F(wt/255,q):dt[3];return xt<1&&(ot=!0),[dt[0],dt[1],dt[2],255*xt]})]);return v.divseq(it,255),this.hasAlphaScale=ot,it},L.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},L.isOpaque=function(){return!this.isTransparent()},L.pickSlots=1,L.setPickBase=function(Y){this.pickId=Y};function F(Y,q){if(!q||!q.length)return 1;for(var ot=0;ot<q.length;++ot){if(q.length<2)return 1;if(q[ot][0]===Y)return q[ot][1];if(q[ot][0]>Y&&ot>0){var it=(q[ot][0]-Y)/(q[ot][0]-q[ot-1][0]);return q[ot][1]*(1-it)+it*q[ot-1][1]}}return 1}var N=[0,0,0],j={showSurface:!1,showContour:!1,projections:[_.slice(),_.slice(),_.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function G(Y,q){var ot,it,dt,wt=q.axes&&q.axes.lastCubeProps.axis||N,xt=q.showSurface,Ft=q.showContour;for(ot=0;ot<3;++ot)for(xt=xt||q.surfaceProject[ot],it=0;it<3;++it)Ft=Ft||q.contourProject[ot][it];for(ot=0;ot<3;++ot){var Et=j.projections[ot];for(it=0;it<16;++it)Et[it]=0;for(it=0;it<4;++it)Et[5*it]=1;Et[5*ot]=0,Et[12+ot]=q.axesBounds[+(wt[ot]>0)][ot],l(Et,Y.model,Et);var Nt=j.clipBounds[ot];for(dt=0;dt<2;++dt)for(it=0;it<3;++it)Nt[dt][it]=Y.clipBounds[dt][it];Nt[0][ot]=-1e8,Nt[1][ot]=1e8}return j.showSurface=xt,j.showContour=Ft,j}var rt={model:_,view:_,projection:_,inverseModel:_.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},ct=_.slice(),lt=[1,0,0,0,1,0,0,0,1];function tt(Y,q){Y=Y||{};var ot=this.gl;ot.disable(ot.CULL_FACE),this._colorMap.bind(0);var it=rt;it.model=Y.model||_,it.view=Y.view||_,it.projection=Y.projection||_,it.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],it.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],it.objectOffset=this.objectOffset,it.contourColor=this.contourColor[0],it.inverseModel=x(it.inverseModel,it.model);for(var dt=0;dt<2;++dt)for(var wt=it.clipBounds[dt],xt=0;xt<3;++xt)wt[xt]=Math.min(Math.max(this.clipBounds[dt][xt],-1e8),1e8);it.kambient=this.ambientLight,it.kdiffuse=this.diffuseLight,it.kspecular=this.specularLight,it.roughness=this.roughness,it.fresnel=this.fresnel,it.opacity=this.opacity,it.height=0,it.permutation=lt,it.vertexColor=this.vertexColor;var Ft=ct;for(l(Ft,it.view,it.model),l(Ft,it.projection,Ft),x(Ft,Ft),dt=0;dt<3;++dt)it.eyePosition[dt]=Ft[12+dt]/Ft[15];var Et=Ft[15];for(dt=0;dt<3;++dt)Et+=this.lightPosition[dt]*Ft[4*dt+3];for(dt=0;dt<3;++dt){var Nt=Ft[12+dt];for(xt=0;xt<3;++xt)Nt+=Ft[4*xt+dt]*this.lightPosition[xt];it.lightPosition[dt]=Nt/Et}var te=G(it,this);if(te.showSurface){for(this._shader.bind(),this._shader.uniforms=it,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(ot.TRIANGLES,this._vertexCount),dt=0;dt<3;++dt)!this.surfaceProject[dt]||!this.vertexCount||(this._shader.uniforms.model=te.projections[dt],this._shader.uniforms.clipBounds=te.clipBounds[dt],this._vao.draw(ot.TRIANGLES,this._vertexCount));this._vao.unbind()}if(te.showContour){var Jt=this._contourShader;it.kambient=1,it.kdiffuse=0,it.kspecular=0,it.opacity=1,Jt.bind(),Jt.uniforms=it;var Qt=this._contourVAO;for(Qt.bind(),dt=0;dt<3;++dt)for(Jt.uniforms.permutation=I[dt],ot.lineWidth(this.contourWidth[dt]*this.pixelRatio),xt=0;xt<this.contourLevels[dt].length;++xt)xt===this.highlightLevel[dt]?(Jt.uniforms.contourColor=this.highlightColor[dt],Jt.uniforms.contourTint=this.highlightTint[dt]):(xt===0||xt-1===this.highlightLevel[dt])&&(Jt.uniforms.contourColor=this.contourColor[dt],Jt.uniforms.contourTint=this.contourTint[dt]),this._contourCounts[dt][xt]&&(Jt.uniforms.height=this.contourLevels[dt][xt],Qt.draw(ot.LINES,this._contourCounts[dt][xt],this._contourOffsets[dt][xt]));for(dt=0;dt<3;++dt)for(Jt.uniforms.model=te.projections[dt],Jt.uniforms.clipBounds=te.clipBounds[dt],xt=0;xt<3;++xt)if(this.contourProject[dt][xt]){Jt.uniforms.permutation=I[xt],ot.lineWidth(this.contourWidth[xt]*this.pixelRatio);for(var Wt=0;Wt<this.contourLevels[xt].length;++Wt)Wt===this.highlightLevel[xt]?(Jt.uniforms.contourColor=this.highlightColor[xt],Jt.uniforms.contourTint=this.highlightTint[xt]):(Wt===0||Wt-1===this.highlightLevel[xt])&&(Jt.uniforms.contourColor=this.contourColor[xt],Jt.uniforms.contourTint=this.contourTint[xt]),this._contourCounts[xt][Wt]&&(Jt.uniforms.height=this.contourLevels[xt][Wt],Qt.draw(ot.LINES,this._contourCounts[xt][Wt],this._contourOffsets[xt][Wt]))}for(Qt.unbind(),Qt=this._dynamicVAO,Qt.bind(),dt=0;dt<3;++dt)if(this._dynamicCounts[dt]!==0)for(Jt.uniforms.model=it.model,Jt.uniforms.clipBounds=it.clipBounds,Jt.uniforms.permutation=I[dt],ot.lineWidth(this.dynamicWidth[dt]*this.pixelRatio),Jt.uniforms.contourColor=this.dynamicColor[dt],Jt.uniforms.contourTint=this.dynamicTint[dt],Jt.uniforms.height=this.dynamicLevel[dt],Qt.draw(ot.LINES,this._dynamicCounts[dt],this._dynamicOffsets[dt]),xt=0;xt<3;++xt)this.contourProject[xt][dt]&&(Jt.uniforms.model=te.projections[xt],Jt.uniforms.clipBounds=te.clipBounds[xt],Qt.draw(ot.LINES,this._dynamicCounts[dt],this._dynamicOffsets[dt]));Qt.unbind()}}L.draw=function(Y){return tt.call(this,Y,!1)},L.drawTransparent=function(Y){return tt.call(this,Y,!0)};var Z={model:_,view:_,projection:_,inverseModel:_,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,objectOffset:[0,0,0],permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};L.drawPick=function(Y){Y=Y||{};var q=this.gl;q.disable(q.CULL_FACE);var ot=Z;ot.model=Y.model||_,ot.view=Y.view||_,ot.projection=Y.projection||_,ot.shape=this._field[2].shape,ot.pickId=this.pickId/255,ot.lowerBound=this.bounds[0],ot.upperBound=this.bounds[1],ot.objectOffset=this.objectOffset,ot.permutation=lt;for(var it=0;it<2;++it)for(var dt=ot.clipBounds[it],wt=0;wt<3;++wt)dt[wt]=Math.min(Math.max(this.clipBounds[it][wt],-1e8),1e8);var xt=G(ot,this);if(xt.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=ot,this._vao.bind(),this._vao.draw(q.TRIANGLES,this._vertexCount),it=0;it<3;++it)this.surfaceProject[it]&&(this._pickShader.uniforms.model=xt.projections[it],this._pickShader.uniforms.clipBounds=xt.clipBounds[it],this._vao.draw(q.TRIANGLES,this._vertexCount));this._vao.unbind()}if(xt.showContour){var Ft=this._contourPickShader;Ft.bind(),Ft.uniforms=ot;var Et=this._contourVAO;for(Et.bind(),wt=0;wt<3;++wt)for(q.lineWidth(this.contourWidth[wt]*this.pixelRatio),Ft.uniforms.permutation=I[wt],it=0;it<this.contourLevels[wt].length;++it)this._contourCounts[wt][it]&&(Ft.uniforms.height=this.contourLevels[wt][it],Et.draw(q.LINES,this._contourCounts[wt][it],this._contourOffsets[wt][it]));for(it=0;it<3;++it)for(Ft.uniforms.model=xt.projections[it],Ft.uniforms.clipBounds=xt.clipBounds[it],wt=0;wt<3;++wt)if(this.contourProject[it][wt]){Ft.uniforms.permutation=I[wt],q.lineWidth(this.contourWidth[wt]*this.pixelRatio);for(var Nt=0;Nt<this.contourLevels[wt].length;++Nt)this._contourCounts[wt][Nt]&&(Ft.uniforms.height=this.contourLevels[wt][Nt],Et.draw(q.LINES,this._contourCounts[wt][Nt],this._contourOffsets[wt][Nt]))}Et.unbind()}},L.pick=function(Y){if(!Y||Y.id!==this.pickId)return null;var q=this._field[2].shape,ot=this._pickResult,it=q[0]*(Y.value[0]+(Y.value[2]>>4)/16)/255,dt=Math.floor(it),wt=it-dt,xt=q[1]*(Y.value[1]+(Y.value[2]&15)/16)/255,Ft=Math.floor(xt),Et=xt-Ft;dt+=1,Ft+=1;var Nt=ot.position;Nt[0]=Nt[1]=Nt[2]=0;for(var te=0;te<2;++te)for(var Jt=te?wt:1-wt,Qt=0;Qt<2;++Qt)for(var Wt=Qt?Et:1-Et,gt=dt+te,bt=Ft+Qt,vt=Jt*Wt,Ut=0;Ut<3;++Ut)Nt[Ut]+=this._field[Ut].get(gt,bt)*vt;for(var Kt=this._pickResult.level,Zt=0;Zt<3;++Zt)if(Kt[Zt]=b.le(this.contourLevels[Zt],Nt[Zt]),Kt[Zt]<0)this.contourLevels[Zt].length>0&&(Kt[Zt]=0);else if(Kt[Zt]<this.contourLevels[Zt].length-1){var le=this.contourLevels[Zt][Kt[Zt]],Te=this.contourLevels[Zt][Kt[Zt]+1];Math.abs(le-Nt[Zt])>Math.abs(Te-Nt[Zt])&&(Kt[Zt]+=1)}for(ot.index[0]=wt<.5?dt:dt+1,ot.index[1]=Et<.5?Ft:Ft+1,ot.uv[0]=it/q[0],ot.uv[1]=xt/q[1],Ut=0;Ut<3;++Ut)ot.dataCoordinate[Ut]=this._field[Ut].get(ot.index[0],ot.index[1]);return ot},L.padField=function(Y,q){var ot=q.shape.slice(),it=Y.shape.slice();v.assign(Y.lo(1,1).hi(ot[0],ot[1]),q),v.assign(Y.lo(1).hi(ot[0],1),q.hi(ot[0],1)),v.assign(Y.lo(1,it[1]-1).hi(ot[0],1),q.lo(0,ot[1]-1).hi(ot[0],1)),v.assign(Y.lo(0,1).hi(1,ot[1]),q.hi(1)),v.assign(Y.lo(it[0]-1,1).hi(1,ot[1]),q.lo(ot[0]-1)),Y.set(0,0,q.get(0,0)),Y.set(0,it[1]-1,q.get(0,ot[1]-1)),Y.set(it[0]-1,0,q.get(ot[0]-1,0)),Y.set(it[0]-1,it[1]-1,q.get(ot[0]-1,ot[1]-1))};function st(Y,q){return Array.isArray(Y)?[q(Y[0]),q(Y[1]),q(Y[2])]:[q(Y),q(Y),q(Y)]}function $(Y){return Array.isArray(Y)?Y.length===3?[Y[0],Y[1],Y[2],1]:[Y[0],Y[1],Y[2],Y[3]]:[0,0,0,1]}function Q(Y){if(Array.isArray(Y)){if(Array.isArray(Y))return[$(Y[0]),$(Y[1]),$(Y[2])];var q=$(Y);return[q.slice(),q.slice(),q.slice()]}}L.update=function(Y){Y=Y||{},this.objectOffset=Y.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in Y&&(this.contourWidth=st(Y.contourWidth,Number)),"showContour"in Y&&(this.showContour=st(Y.showContour,Boolean)),"showSurface"in Y&&(this.showSurface=!!Y.showSurface),"contourTint"in Y&&(this.contourTint=st(Y.contourTint,Boolean)),"contourColor"in Y&&(this.contourColor=Q(Y.contourColor)),"contourProject"in Y&&(this.contourProject=st(Y.contourProject,function(Bn){return st(Bn,Boolean)})),"surfaceProject"in Y&&(this.surfaceProject=Y.surfaceProject),"dynamicColor"in Y&&(this.dynamicColor=Q(Y.dynamicColor)),"dynamicTint"in Y&&(this.dynamicTint=st(Y.dynamicTint,Number)),"dynamicWidth"in Y&&(this.dynamicWidth=st(Y.dynamicWidth,Number)),"opacity"in Y&&(this.opacity=Y.opacity),"opacityscale"in Y&&(this.opacityscale=Y.opacityscale),"colorBounds"in Y&&(this.colorBounds=Y.colorBounds),"vertexColor"in Y&&(this.vertexColor=Y.vertexColor?1:0),"colormap"in Y&&this._colorMap.setPixels(this.genColormap(Y.colormap,this.opacityscale));var q=Y.field||Y.coords&&Y.coords[2]||null,ot=!1;if(q||(this._field[2].shape[0]||this._field[2].shape[2]?q=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):q=this._field[2].hi(0,0)),"field"in Y||"coords"in Y){var it=(q.shape[0]+2)*(q.shape[1]+2);it>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(i.nextPow2(it))),this._field[2]=p(this._field[2].data,[q.shape[0]+2,q.shape[1]+2]),this.padField(this._field[2],q),this.shape=q.shape.slice();for(var dt=this.shape,wt=0;wt<2;++wt)this._field[2].size>this._field[wt].data.length&&(s.freeFloat(this._field[wt].data),this._field[wt].data=s.mallocFloat(this._field[2].size)),this._field[wt]=p(this._field[wt].data,[dt[0]+2,dt[1]+2]);if(Y.coords){var xt=Y.coords;if(!Array.isArray(xt)||xt.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(wt=0;wt<2;++wt){var Ft=xt[wt];for(Qt=0;Qt<2;++Qt)if(Ft.shape[Qt]!==dt[Qt])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[wt],Ft)}}else if(Y.ticks){var Et=Y.ticks;if(!Array.isArray(Et)||Et.length!==2)throw new Error("gl-surface: invalid ticks");for(wt=0;wt<2;++wt){var Nt=Et[wt];if((Array.isArray(Nt)||Nt.length)&&(Nt=p(Nt)),Nt.shape[0]!==dt[wt])throw new Error("gl-surface: invalid tick length");var te=p(Nt.data,dt);te.stride[wt]=Nt.stride[0],te.stride[wt^1]=0,this.padField(this._field[wt],te)}}else{for(wt=0;wt<2;++wt){var Jt=[0,0];Jt[wt]=1,this._field[wt]=p(this._field[wt].data,[dt[0]+2,dt[1]+2],Jt,0)}this._field[0].set(0,0,0);for(var Qt=0;Qt<dt[0];++Qt)this._field[0].set(Qt+1,0,Qt);for(this._field[0].set(dt[0]+1,0,dt[0]-1),this._field[1].set(0,0,0),Qt=0;Qt<dt[1];++Qt)this._field[1].set(0,Qt+1,Qt);this._field[1].set(0,dt[1]+1,dt[1]-1)}var Wt=this._field,gt=p(s.mallocFloat(Wt[2].size*3*2),[3,dt[0]+2,dt[1]+2,2]);for(wt=0;wt<3;++wt)S(gt.pick(wt),Wt[wt],"mirror");var bt=p(s.mallocFloat(Wt[2].size*3),[dt[0]+2,dt[1]+2,3]);for(wt=0;wt<dt[0]+2;++wt)for(Qt=0;Qt<dt[1]+2;++Qt){var vt=gt.get(0,wt,Qt,0),Ut=gt.get(0,wt,Qt,1),Kt=gt.get(1,wt,Qt,0),Zt=gt.get(1,wt,Qt,1),le=gt.get(2,wt,Qt,0),Te=gt.get(2,wt,Qt,1),Se=Kt*Te-Zt*le,Fe=le*Ut-Te*vt,Oe=vt*Zt-Ut*Kt,ur=Math.sqrt(Se*Se+Fe*Fe+Oe*Oe);ur<1e-8?(ur=Math.max(Math.abs(Se),Math.abs(Fe),Math.abs(Oe)),ur<1e-8?(Oe=1,Fe=Se=0,ur=1):ur=1/ur):ur=1/Math.sqrt(ur),bt.set(wt,Qt,0,Se*ur),bt.set(wt,Qt,1,Fe*ur),bt.set(wt,Qt,2,Oe*ur)}s.free(gt.data);var fr=[1/0,1/0,1/0],We=[-1/0,-1/0,-1/0],Lr=1/0,kr=-1/0,he=(dt[0]-1)*(dt[1]-1)*6,Dt=s.mallocFloat(i.nextPow2(10*he)),qt=0,zt=0;for(wt=0;wt<dt[0]-1;++wt)t:for(Qt=0;Qt<dt[1]-1;++Qt){for(var ut=0;ut<2;++ut)for(var yt=0;yt<2;++yt)for(var Mt=0;Mt<3;++Mt){var Ot=this._field[Mt].get(1+wt+ut,1+Qt+yt);if(isNaN(Ot)||!isFinite(Ot))continue t}for(Mt=0;Mt<6;++Mt){var $t=wt+D[Mt][0],ee=Qt+D[Mt][1],we=this._field[0].get($t+1,ee+1),Me=this._field[1].get($t+1,ee+1);Ot=this._field[2].get($t+1,ee+1),Se=bt.get($t+1,ee+1,0),Fe=bt.get($t+1,ee+1,1),Oe=bt.get($t+1,ee+1,2),Y.intensity&&(Re=Y.intensity.get($t,ee));var Re=Y.intensity?Y.intensity.get($t,ee):Ot+this.objectOffset[2];Dt[qt++]=$t,Dt[qt++]=ee,Dt[qt++]=we,Dt[qt++]=Me,Dt[qt++]=Ot,Dt[qt++]=0,Dt[qt++]=Re,Dt[qt++]=Se,Dt[qt++]=Fe,Dt[qt++]=Oe,fr[0]=Math.min(fr[0],we+this.objectOffset[0]),fr[1]=Math.min(fr[1],Me+this.objectOffset[1]),fr[2]=Math.min(fr[2],Ot+this.objectOffset[2]),Lr=Math.min(Lr,Re),We[0]=Math.max(We[0],we+this.objectOffset[0]),We[1]=Math.max(We[1],Me+this.objectOffset[1]),We[2]=Math.max(We[2],Ot+this.objectOffset[2]),kr=Math.max(kr,Re),zt+=1}}for(Y.intensityBounds&&(Lr=+Y.intensityBounds[0],kr=+Y.intensityBounds[1]),wt=6;wt<qt;wt+=10)Dt[wt]=(Dt[wt]-Lr)/(kr-Lr);this._vertexCount=zt,this._coordinateBuffer.update(Dt.subarray(0,qt)),s.freeFloat(Dt),s.free(bt.data),this.bounds=[fr,We],this.intensity=Y.intensity||this._field[2],(this.intensityBounds[0]!==Lr||this.intensityBounds[1]!==kr)&&(ot=!0),this.intensityBounds=[Lr,kr]}if("levels"in Y){var Be=Y.levels;for(Array.isArray(Be[0])?Be=Be.slice():Be=[[],[],Be],wt=0;wt<3;++wt)Be[wt]=Be[wt].slice(),Be[wt].sort(function(Bn,ue){return Bn-ue});for(wt=0;wt<3;++wt)for(Qt=0;Qt<Be[wt].length;++Qt)Be[wt][Qt]-=this.objectOffset[wt];t:for(wt=0;wt<3;++wt){if(Be[wt].length!==this.contourLevels[wt].length){ot=!0;break}for(Qt=0;Qt<Be[wt].length;++Qt)if(Be[wt][Qt]!==this.contourLevels[wt][Qt]){ot=!0;break t}}this.contourLevels=Be}if(ot){Wt=this._field,dt=this.shape;for(var Ze=[],Ue=0;Ue<3;++Ue){var mr=this.contourLevels[Ue],ln=[],an=[],vn=[0,0,0];for(wt=0;wt<mr.length;++wt){var Sn=y(this._field[Ue],mr[wt]);ln.push(Ze.length/5|0),zt=0;t:for(Qt=0;Qt<Sn.cells.length;++Qt){var An=Sn.cells[Qt];for(Mt=0;Mt<2;++Mt){var pn=Sn.positions[An[Mt]],On=pn[0],Nn=Math.floor(On)|0,ke=On-Nn,ze=pn[1],je=Math.floor(ze)|0,Ne=ze-je,_r=!1;e:for(var Xr=0;Xr<3;++Xr){vn[Xr]=0;var rn=(Ue+Xr+1)%3;for(ut=0;ut<2;++ut){var Br=ut?ke:1-ke;for($t=Math.min(Math.max(Nn+ut,0),dt[0])|0,yt=0;yt<2;++yt){var _n=yt?Ne:1-Ne;if(ee=Math.min(Math.max(je+yt,0),dt[1])|0,Xr<2?Ot=this._field[rn].get($t,ee):Ot=(this.intensity.get($t,ee)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(Ot)||isNaN(Ot)){_r=!0;break e}var bn=Br*_n;vn[Xr]+=bn*Ot}}}if(!_r)Ze.push(vn[0],vn[1],pn[0],pn[1],vn[2]),zt+=1;else{if(Mt>0){for(var Fn=0;Fn<5;++Fn)Ze.pop();zt-=1}continue t}}}an.push(zt)}this._contourOffsets[Ue]=ln,this._contourCounts[Ue]=an}var on=s.mallocFloat(Ze.length);for(wt=0;wt<Ze.length;++wt)on[wt]=Ze[wt];this._contourBuffer.update(on),s.freeFloat(on)}},L.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var Y=0;Y<3;++Y)s.freeFloat(this._field[Y].data)},L.highlight=function(Y){var q;if(!Y){this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],this.highlightLevel=[-1,-1,-1];return}for(q=0;q<3;++q)this.enableHighlight[q]?this.highlightLevel[q]=Y.level[q]:this.highlightLevel[q]=-1;var ot;for(this.snapToData?ot=Y.dataCoordinate:ot=Y.position,q=0;q<3;++q)ot[q]-=this.objectOffset[q];if(!((!this.enableDynamic[0]||ot[0]===this.dynamicLevel[0])&&(!this.enableDynamic[1]||ot[1]===this.dynamicLevel[1])&&(!this.enableDynamic[2]||ot[2]===this.dynamicLevel[2]))){for(var it=0,dt=this.shape,wt=s.mallocFloat(12*dt[0]*dt[1]),xt=0;xt<3;++xt){if(!this.enableDynamic[xt]){this.dynamicLevel[xt]=NaN,this._dynamicCounts[xt]=0;continue}this.dynamicLevel[xt]=ot[xt];var Ft=(xt+1)%3,Et=(xt+2)%3,Nt=this._field[xt],te=this._field[Ft],Jt=this._field[Et],Qt=y(Nt,ot[xt]),Wt=Qt.cells,gt=Qt.positions;for(this._dynamicOffsets[xt]=it,q=0;q<Wt.length;++q)for(var bt=Wt[q],vt=0;vt<2;++vt){var Ut=gt[bt[vt]],Kt=+Ut[0],Zt=Kt|0,le=Math.min(Zt+1,dt[0])|0,Te=Kt-Zt,Se=1-Te,Fe=+Ut[1],Oe=Fe|0,ur=Math.min(Oe+1,dt[1])|0,fr=Fe-Oe,We=1-fr,Lr=Se*We,kr=Se*fr,he=Te*We,Dt=Te*fr,qt=Lr*te.get(Zt,Oe)+kr*te.get(Zt,ur)+he*te.get(le,Oe)+Dt*te.get(le,ur),zt=Lr*Jt.get(Zt,Oe)+kr*Jt.get(Zt,ur)+he*Jt.get(le,Oe)+Dt*Jt.get(le,ur);if(isNaN(qt)||isNaN(zt)){vt&&(it-=1);break}wt[2*it+0]=qt,wt[2*it+1]=zt,it+=1}this._dynamicCounts[xt]=it-this._dynamicOffsets[xt]}this._dynamicBuffer.update(wt.subarray(0,2*it)),s.freeFloat(wt)}};function nt(Y){var q=Y.gl,ot=M(q),it=u(q),dt=w(q),wt=f(q),xt=n(q),Ft=o(q,[{buffer:xt,size:4,stride:k,offset:0},{buffer:xt,size:3,stride:k,offset:16},{buffer:xt,size:3,stride:k,offset:28}]),Et=n(q),Nt=o(q,[{buffer:Et,size:4,stride:20,offset:0},{buffer:Et,size:1,stride:20,offset:16}]),te=n(q),Jt=o(q,[{buffer:te,size:2,type:q.FLOAT}]),Qt=a(q,1,B,q.RGBA,q.UNSIGNED_BYTE);Qt.minFilter=q.LINEAR,Qt.magFilter=q.LINEAR;var Wt=new R(q,[0,0],[[0,0,0],[0,0,0]],ot,it,xt,Ft,Qt,dt,wt,Et,Nt,te,Jt,[0,0,0]),gt={levels:[[],[],[]]};for(var bt in Y)gt[bt]=Y[bt];return gt.colormap=gt.colormap||"jet",Wt.update(gt),Wt}},7766:function(t,e,r){var i=r(9618),n=r(5298),o=r(1888);t.exports=f;var a=null,s=null,h=null;function v(k){a=[k.LINEAR,k.NEAREST_MIPMAP_LINEAR,k.LINEAR_MIPMAP_NEAREST,k.LINEAR_MIPMAP_NEAREST],s=[k.NEAREST,k.LINEAR,k.NEAREST_MIPMAP_NEAREST,k.NEAREST_MIPMAP_LINEAR,k.LINEAR_MIPMAP_NEAREST,k.LINEAR_MIPMAP_LINEAR],h=[k.REPEAT,k.CLAMP_TO_EDGE,k.MIRRORED_REPEAT]}function m(k){return typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&k instanceof HTMLVideoElement||typeof ImageData<"u"&&k instanceof ImageData}var p=function(k,_){n.muls(k,_,255)};function y(k,_,D){var I=k.gl,O=I.getParameter(I.MAX_TEXTURE_SIZE);if(_<0||_>O||D<0||D>O)throw new Error("gl-texture2d: Invalid texture size");return k._shape=[_,D],k.bind(),I.texImage2D(I.TEXTURE_2D,0,k.format,_,D,0,k.format,k.type,null),k._mipLevels=[0],k}function l(k,_,D,I,O,B){this.gl=k,this.handle=_,this.format=O,this.type=B,this._shape=[D,I],this._mipLevels=[0],this._magFilter=k.NEAREST,this._minFilter=k.NEAREST,this._wrapS=k.CLAMP_TO_EDGE,this._wrapT=k.CLAMP_TO_EDGE,this._anisoSamples=1;var R=this,L=[this._wrapS,this._wrapT];Object.defineProperties(L,[{get:function(){return R._wrapS},set:function(N){return R.wrapS=N}},{get:function(){return R._wrapT},set:function(N){return R.wrapT=N}}]),this._wrapVector=L;var F=[this._shape[0],this._shape[1]];Object.defineProperties(F,[{get:function(){return R._shape[0]},set:function(N){return R.width=N}},{get:function(){return R._shape[1]},set:function(N){return R.height=N}}]),this._shapeVector=F}var x=l.prototype;Object.defineProperties(x,{minFilter:{get:function(){return this._minFilter},set:function(k){this.bind();var _=this.gl;if(this.type===_.FLOAT&&a.indexOf(k)>=0&&(_.getExtension("OES_texture_float_linear")||(k=_.NEAREST)),s.indexOf(k)<0)throw new Error("gl-texture2d: Unknown filter mode "+k);return _.texParameteri(_.TEXTURE_2D,_.TEXTURE_MIN_FILTER,k),this._minFilter=k}},magFilter:{get:function(){return this._magFilter},set:function(k){this.bind();var _=this.gl;if(this.type===_.FLOAT&&a.indexOf(k)>=0&&(_.getExtension("OES_texture_float_linear")||(k=_.NEAREST)),s.indexOf(k)<0)throw new Error("gl-texture2d: Unknown filter mode "+k);return _.texParameteri(_.TEXTURE_2D,_.TEXTURE_MAG_FILTER,k),this._magFilter=k}},mipSamples:{get:function(){return this._anisoSamples},set:function(k){var _=this._anisoSamples;if(this._anisoSamples=Math.max(k,1)|0,_!==this._anisoSamples){var D=this.gl.getExtension("EXT_texture_filter_anisotropic");D&&this.gl.texParameterf(this.gl.TEXTURE_2D,D.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(k){if(this.bind(),h.indexOf(k)<0)throw new Error("gl-texture2d: Unknown wrap mode "+k);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,k),this._wrapS=k}},wrapT:{get:function(){return this._wrapT},set:function(k){if(this.bind(),h.indexOf(k)<0)throw new Error("gl-texture2d: Unknown wrap mode "+k);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,k),this._wrapT=k}},wrap:{get:function(){return this._wrapVector},set:function(k){if(Array.isArray(k)||(k=[k,k]),k.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var _=0;_<2;++_)if(h.indexOf(k[_])<0)throw new Error("gl-texture2d: Unknown wrap mode "+k);this._wrapS=k[0],this._wrapT=k[1];var D=this.gl;return this.bind(),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_S,this._wrapS),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_T,this._wrapT),k}},shape:{get:function(){return this._shapeVector},set:function(k){if(!Array.isArray(k))k=[k|0,k|0];else if(k.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return y(this,k[0]|0,k[1]|0),[k[0]|0,k[1]|0]}},width:{get:function(){return this._shape[0]},set:function(k){return k=k|0,y(this,k,this._shape[1]),k}},height:{get:function(){return this._shape[1]},set:function(k){return k=k|0,y(this,this._shape[0],k),k}}}),x.bind=function(k){var _=this.gl;return k!==void 0&&_.activeTexture(_.TEXTURE0+(k|0)),_.bindTexture(_.TEXTURE_2D,this.handle),k!==void 0?k|0:_.getParameter(_.ACTIVE_TEXTURE)-_.TEXTURE0},x.dispose=function(){this.gl.deleteTexture(this.handle)},x.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var k=Math.min(this._shape[0],this._shape[1]),_=0;k>0;++_,k>>>=1)this._mipLevels.indexOf(_)<0&&this._mipLevels.push(_)},x.setPixels=function(k,_,D,I){var O=this.gl;this.bind(),Array.isArray(_)?(I=D,D=_[1]|0,_=_[0]|0):(_=_||0,D=D||0),I=I||0;var B=m(k)?k:k.raw;if(B){var R=this._mipLevels.indexOf(I)<0;R?(O.texImage2D(O.TEXTURE_2D,0,this.format,this.format,this.type,B),this._mipLevels.push(I)):O.texSubImage2D(O.TEXTURE_2D,I,_,D,this.format,this.type,B)}else if(k.shape&&k.stride&&k.data){if(k.shape.length<2||_+k.shape[1]>this._shape[1]>>>I||D+k.shape[0]>this._shape[0]>>>I||_<0||D<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");S(O,_,D,I,this.format,this.type,this._mipLevels,k)}else throw new Error("gl-texture2d: Unsupported data type")};function b(k,_){return k.length===3?_[2]===1&&_[1]===k[0]*k[2]&&_[0]===k[2]:_[0]===1&&_[1]===k[0]}function S(k,_,D,I,O,B,R,L){var F=L.dtype,N=L.shape.slice();if(N.length<2||N.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var j=0,G=0,rt=b(N,L.stride.slice());if(F==="float32"?j=k.FLOAT:F==="float64"?(j=k.FLOAT,rt=!1,F="float32"):F==="uint8"?j=k.UNSIGNED_BYTE:(j=k.UNSIGNED_BYTE,rt=!1,F="uint8"),N.length===2)G=k.LUMINANCE,N=[N[0],N[1],1],L=i(L.data,N,[L.stride[0],L.stride[1],1],L.offset);else if(N.length===3){if(N[2]===1)G=k.ALPHA;else if(N[2]===2)G=k.LUMINANCE_ALPHA;else if(N[2]===3)G=k.RGB;else if(N[2]===4)G=k.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");N[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((G===k.LUMINANCE||G===k.ALPHA)&&(O===k.LUMINANCE||O===k.ALPHA)&&(G=O),G!==O)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var ct=L.size,lt=R.indexOf(I)<0;if(lt&&R.push(I),j===B&&rt)L.offset===0&&L.data.length===ct?lt?k.texImage2D(k.TEXTURE_2D,I,O,N[0],N[1],0,O,B,L.data):k.texSubImage2D(k.TEXTURE_2D,I,_,D,N[0],N[1],O,B,L.data):lt?k.texImage2D(k.TEXTURE_2D,I,O,N[0],N[1],0,O,B,L.data.subarray(L.offset,L.offset+ct)):k.texSubImage2D(k.TEXTURE_2D,I,_,D,N[0],N[1],O,B,L.data.subarray(L.offset,L.offset+ct));else{var tt;B===k.FLOAT?tt=o.mallocFloat32(ct):tt=o.mallocUint8(ct);var Z=i(tt,N,[N[2],N[2]*N[0],1]);j===k.FLOAT&&B===k.UNSIGNED_BYTE?p(Z,L):n.assign(Z,L),lt?k.texImage2D(k.TEXTURE_2D,I,O,N[0],N[1],0,O,B,tt.subarray(0,ct)):k.texSubImage2D(k.TEXTURE_2D,I,_,D,N[0],N[1],O,B,tt.subarray(0,ct)),B===k.FLOAT?o.freeFloat32(tt):o.freeUint8(tt)}}function T(k){var _=k.createTexture();return k.bindTexture(k.TEXTURE_2D,_),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MIN_FILTER,k.NEAREST),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MAG_FILTER,k.NEAREST),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_S,k.CLAMP_TO_EDGE),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_T,k.CLAMP_TO_EDGE),_}function M(k,_,D,I,O){var B=k.getParameter(k.MAX_TEXTURE_SIZE);if(_<0||_>B||D<0||D>B)throw new Error("gl-texture2d: Invalid texture shape");if(O===k.FLOAT&&!k.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var R=T(k);return k.texImage2D(k.TEXTURE_2D,0,I,_,D,0,I,O,null),new l(k,R,_,D,I,O)}function w(k,_,D,I,O,B){var R=T(k);return k.texImage2D(k.TEXTURE_2D,0,O,O,B,_),new l(k,R,D,I,O,B)}function u(k,_){var D=_.dtype,I=_.shape.slice(),O=k.getParameter(k.MAX_TEXTURE_SIZE);if(I[0]<0||I[0]>O||I[1]<0||I[1]>O)throw new Error("gl-texture2d: Invalid texture size");var B=b(I,_.stride.slice()),R=0;D==="float32"?R=k.FLOAT:D==="float64"?(R=k.FLOAT,B=!1,D="float32"):D==="uint8"?R=k.UNSIGNED_BYTE:(R=k.UNSIGNED_BYTE,B=!1,D="uint8");var L=0;if(I.length===2)L=k.LUMINANCE,I=[I[0],I[1],1],_=i(_.data,I,[_.stride[0],_.stride[1],1],_.offset);else if(I.length===3)if(I[2]===1)L=k.ALPHA;else if(I[2]===2)L=k.LUMINANCE_ALPHA;else if(I[2]===3)L=k.RGB;else if(I[2]===4)L=k.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");R===k.FLOAT&&!k.getExtension("OES_texture_float")&&(R=k.UNSIGNED_BYTE,B=!1);var F,N,j=_.size;if(B)_.offset===0&&_.data.length===j?F=_.data:F=_.data.subarray(_.offset,_.offset+j);else{var G=[I[2],I[2]*I[0],1];N=o.malloc(j,D);var rt=i(N,I,G,0);(D==="float32"||D==="float64")&&R===k.UNSIGNED_BYTE?p(rt,_):n.assign(rt,_),F=N.subarray(0,j)}var ct=T(k);return k.texImage2D(k.TEXTURE_2D,0,L,I[0],I[1],0,L,R,F),B||o.free(N),new l(k,ct,I[0],I[1],L,R)}function f(k){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(a||v(k),typeof arguments[1]=="number")return M(k,arguments[1],arguments[2],arguments[3]||k.RGBA,arguments[4]||k.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return M(k,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||k.RGBA,arguments[3]||k.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var _=arguments[1],D=m(_)?_:_.raw;if(D)return w(k,D,_.width|0,_.height|0,arguments[2]||k.RGBA,arguments[3]||k.UNSIGNED_BYTE);if(_.shape&&_.data&&_.stride)return u(k,_)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},1433:function(t){function e(r,i,n){i?i.bind():r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null);var o=r.getParameter(r.MAX_VERTEX_ATTRIBS)|0;if(n){if(n.length>o)throw new Error("gl-vao: Too many vertex attributes");for(var a=0;a<n.length;++a){var s=n[a];if(s.buffer){var h=s.buffer,v=s.size||4,m=s.type||r.FLOAT,p=!!s.normalized,y=s.stride||0,l=s.offset||0;h.bind(),r.enableVertexAttribArray(a),r.vertexAttribPointer(a,v,m,p,y,l)}else{if(typeof s=="number")r.vertexAttrib1f(a,s);else if(s.length===1)r.vertexAttrib1f(a,s[0]);else if(s.length===2)r.vertexAttrib2f(a,s[0],s[1]);else if(s.length===3)r.vertexAttrib3f(a,s[0],s[1],s[2]);else if(s.length===4)r.vertexAttrib4f(a,s[0],s[1],s[2],s[3]);else throw new Error("gl-vao: Invalid vertex attribute");r.disableVertexAttribArray(a)}}for(;a<o;++a)r.disableVertexAttribArray(a)}else{r.bindBuffer(r.ARRAY_BUFFER,null);for(var a=0;a<o;++a)r.disableVertexAttribArray(a)}}t.exports=e},870:function(t,e,r){var i=r(1433);function n(a){this.gl=a,this._elements=null,this._attributes=null,this._elementsType=a.UNSIGNED_SHORT}n.prototype.bind=function(){i(this.gl,this._elements,this._attributes)},n.prototype.update=function(a,s,h){this._elements=s,this._attributes=a,this._elementsType=h||this.gl.UNSIGNED_SHORT},n.prototype.dispose=function(){},n.prototype.unbind=function(){},n.prototype.draw=function(a,s,h){h=h||0;var v=this.gl;this._elements?v.drawElements(a,s,this._elementsType,h):v.drawArrays(a,h,s)};function o(a){return new n(a)}t.exports=o},7518:function(t,e,r){var i=r(1433);function n(s,h,v,m,p,y){this.location=s,this.dimension=h,this.a=v,this.b=m,this.c=p,this.d=y}n.prototype.bind=function(s){switch(this.dimension){case 1:s.vertexAttrib1f(this.location,this.a);break;case 2:s.vertexAttrib2f(this.location,this.a,this.b);break;case 3:s.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:s.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d);break}};function o(s,h,v){this.gl=s,this._ext=h,this.handle=v,this._attribs=[],this._useElements=!1,this._elementsType=s.UNSIGNED_SHORT}o.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var s=0;s<this._attribs.length;++s)this._attribs[s].bind(this.gl)},o.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},o.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},o.prototype.update=function(s,h,v){if(this.bind(),i(this.gl,h,s),this.unbind(),this._attribs.length=0,s)for(var m=0;m<s.length;++m){var p=s[m];typeof p=="number"?this._attribs.push(new n(m,1,p)):Array.isArray(p)&&this._attribs.push(new n(m,p.length,p[0],p[1],p[2],p[3]))}this._useElements=!!h,this._elementsType=v||this.gl.UNSIGNED_SHORT},o.prototype.draw=function(s,h,v){v=v||0;var m=this.gl;this._useElements?m.drawElements(s,h,this._elementsType,v):m.drawArrays(s,v,h)};function a(s,h){return new o(s,h,h.createVertexArrayOES())}t.exports=a},8116:function(t,e,r){var i=r(7518),n=r(870);function o(s){this.bindVertexArrayOES=s.bindVertexArray.bind(s),this.createVertexArrayOES=s.createVertexArray.bind(s),this.deleteVertexArrayOES=s.deleteVertexArray.bind(s)}function a(s,h,v,m){var p=s.createVertexArray?new o(s):s.getExtension("OES_vertex_array_object"),y;return p?y=i(s,p):y=n(s),y.update(h,v,m),y}t.exports=a},5632:function(t){t.exports=e;function e(r,i,n){return r[0]=i[0]+n[0],r[1]=i[1]+n[1],r[2]=i[2]+n[2],r}},8192:function(t,e,r){t.exports=a;var i=r(2825),n=r(3536),o=r(244);function a(s,h){var v=i(s[0],s[1],s[2]),m=i(h[0],h[1],h[2]);n(v,v),n(m,m);var p=o(v,m);return p>1?0:Math.acos(p)}},9226:function(t){t.exports=e;function e(r,i){return r[0]=Math.ceil(i[0]),r[1]=Math.ceil(i[1]),r[2]=Math.ceil(i[2]),r}},3126:function(t){t.exports=e;function e(r){var i=new Float32Array(3);return i[0]=r[0],i[1]=r[1],i[2]=r[2],i}},3990:function(t){t.exports=e;function e(r,i){return r[0]=i[0],r[1]=i[1],r[2]=i[2],r}},1091:function(t){t.exports=e;function e(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}},5911:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],h=n[0],v=n[1],m=n[2];return r[0]=a*m-s*v,r[1]=s*h-o*m,r[2]=o*v-a*h,r}},5455:function(t,e,r){t.exports=r(7056)},7056:function(t){t.exports=e;function e(r,i){var n=i[0]-r[0],o=i[1]-r[1],a=i[2]-r[2];return Math.sqrt(n*n+o*o+a*a)}},4008:function(t,e,r){t.exports=r(6690)},6690:function(t){t.exports=e;function e(r,i,n){return r[0]=i[0]/n[0],r[1]=i[1]/n[1],r[2]=i[2]/n[2],r}},244:function(t){t.exports=e;function e(r,i){return r[0]*i[0]+r[1]*i[1]+r[2]*i[2]}},2613:function(t){t.exports=1e-6},9922:function(t,e,r){t.exports=n;var i=r(2613);function n(o,a){var s=o[0],h=o[1],v=o[2],m=a[0],p=a[1],y=a[2];return Math.abs(s-m)<=i*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(h-p)<=i*Math.max(1,Math.abs(h),Math.abs(p))&&Math.abs(v-y)<=i*Math.max(1,Math.abs(v),Math.abs(y))}},9265:function(t){t.exports=e;function e(r,i){return r[0]===i[0]&&r[1]===i[1]&&r[2]===i[2]}},2681:function(t){t.exports=e;function e(r,i){return r[0]=Math.floor(i[0]),r[1]=Math.floor(i[1]),r[2]=Math.floor(i[2]),r}},5137:function(t,e,r){t.exports=n;var i=r(1091)();function n(o,a,s,h,v,m){var p,y;for(a||(a=3),s||(s=0),h?y=Math.min(h*a+s,o.length):y=o.length,p=s;p<y;p+=a)i[0]=o[p],i[1]=o[p+1],i[2]=o[p+2],v(i,i,m),o[p]=i[0],o[p+1]=i[1],o[p+2]=i[2];return o}},2825:function(t){t.exports=e;function e(r,i,n){var o=new Float32Array(3);return o[0]=r,o[1]=i,o[2]=n,o}},2931:function(t,e,r){t.exports={EPSILON:r(2613),create:r(1091),clone:r(3126),angle:r(8192),fromValues:r(2825),copy:r(3990),set:r(1463),equals:r(9922),exactEquals:r(9265),add:r(5632),subtract:r(6843),sub:r(2229),multiply:r(5847),mul:r(4505),divide:r(6690),div:r(4008),min:r(8107),max:r(7417),floor:r(2681),ceil:r(9226),round:r(2447),scale:r(6621),scaleAndAdd:r(8489),distance:r(7056),dist:r(5455),squaredDistance:r(2953),sqrDist:r(6141),length:r(1387),len:r(868),squaredLength:r(3066),sqrLen:r(5486),negate:r(5093),inverse:r(811),normalize:r(3536),dot:r(244),cross:r(5911),lerp:r(6658),random:r(7636),transformMat4:r(5673),transformMat3:r(492),transformQuat:r(264),rotateX:r(6894),rotateY:r(109),rotateZ:r(8692),forEach:r(5137)}},811:function(t){t.exports=e;function e(r,i){return r[0]=1/i[0],r[1]=1/i[1],r[2]=1/i[2],r}},868:function(t,e,r){t.exports=r(1387)},1387:function(t){t.exports=e;function e(r){var i=r[0],n=r[1],o=r[2];return Math.sqrt(i*i+n*n+o*o)}},6658:function(t){t.exports=e;function e(r,i,n,o){var a=i[0],s=i[1],h=i[2];return r[0]=a+o*(n[0]-a),r[1]=s+o*(n[1]-s),r[2]=h+o*(n[2]-h),r}},7417:function(t){t.exports=e;function e(r,i,n){return r[0]=Math.max(i[0],n[0]),r[1]=Math.max(i[1],n[1]),r[2]=Math.max(i[2],n[2]),r}},8107:function(t){t.exports=e;function e(r,i,n){return r[0]=Math.min(i[0],n[0]),r[1]=Math.min(i[1],n[1]),r[2]=Math.min(i[2],n[2]),r}},4505:function(t,e,r){t.exports=r(5847)},5847:function(t){t.exports=e;function e(r,i,n){return r[0]=i[0]*n[0],r[1]=i[1]*n[1],r[2]=i[2]*n[2],r}},5093:function(t){t.exports=e;function e(r,i){return r[0]=-i[0],r[1]=-i[1],r[2]=-i[2],r}},3536:function(t){t.exports=e;function e(r,i){var n=i[0],o=i[1],a=i[2],s=n*n+o*o+a*a;return s>0&&(s=1/Math.sqrt(s),r[0]=i[0]*s,r[1]=i[1]*s,r[2]=i[2]*s),r}},7636:function(t){t.exports=e;function e(r,i){i=i||1;var n=Math.random()*2*Math.PI,o=Math.random()*2-1,a=Math.sqrt(1-o*o)*i;return r[0]=Math.cos(n)*a,r[1]=Math.sin(n)*a,r[2]=o*i,r}},6894:function(t){t.exports=e;function e(r,i,n,o){var a=n[1],s=n[2],h=i[1]-a,v=i[2]-s,m=Math.sin(o),p=Math.cos(o);return r[0]=i[0],r[1]=a+h*p-v*m,r[2]=s+h*m+v*p,r}},109:function(t){t.exports=e;function e(r,i,n,o){var a=n[0],s=n[2],h=i[0]-a,v=i[2]-s,m=Math.sin(o),p=Math.cos(o);return r[0]=a+v*m+h*p,r[1]=i[1],r[2]=s+v*p-h*m,r}},8692:function(t){t.exports=e;function e(r,i,n,o){var a=n[0],s=n[1],h=i[0]-a,v=i[1]-s,m=Math.sin(o),p=Math.cos(o);return r[0]=a+h*p-v*m,r[1]=s+h*m+v*p,r[2]=i[2],r}},2447:function(t){t.exports=e;function e(r,i){return r[0]=Math.round(i[0]),r[1]=Math.round(i[1]),r[2]=Math.round(i[2]),r}},6621:function(t){t.exports=e;function e(r,i,n){return r[0]=i[0]*n,r[1]=i[1]*n,r[2]=i[2]*n,r}},8489:function(t){t.exports=e;function e(r,i,n,o){return r[0]=i[0]+n[0]*o,r[1]=i[1]+n[1]*o,r[2]=i[2]+n[2]*o,r}},1463:function(t){t.exports=e;function e(r,i,n,o){return r[0]=i,r[1]=n,r[2]=o,r}},6141:function(t,e,r){t.exports=r(2953)},5486:function(t,e,r){t.exports=r(3066)},2953:function(t){t.exports=e;function e(r,i){var n=i[0]-r[0],o=i[1]-r[1],a=i[2]-r[2];return n*n+o*o+a*a}},3066:function(t){t.exports=e;function e(r){var i=r[0],n=r[1],o=r[2];return i*i+n*n+o*o}},2229:function(t,e,r){t.exports=r(6843)},6843:function(t){t.exports=e;function e(r,i,n){return r[0]=i[0]-n[0],r[1]=i[1]-n[1],r[2]=i[2]-n[2],r}},492:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2];return r[0]=o*n[0]+a*n[3]+s*n[6],r[1]=o*n[1]+a*n[4]+s*n[7],r[2]=o*n[2]+a*n[5]+s*n[8],r}},5673:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],h=n[3]*o+n[7]*a+n[11]*s+n[15];return h=h||1,r[0]=(n[0]*o+n[4]*a+n[8]*s+n[12])/h,r[1]=(n[1]*o+n[5]*a+n[9]*s+n[13])/h,r[2]=(n[2]*o+n[6]*a+n[10]*s+n[14])/h,r}},264:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],h=n[0],v=n[1],m=n[2],p=n[3],y=p*o+v*s-m*a,l=p*a+m*o-h*s,x=p*s+h*a-v*o,b=-h*o-v*a-m*s;return r[0]=y*p+b*-h+l*-m-x*-v,r[1]=l*p+b*-v+x*-h-y*-m,r[2]=x*p+b*-m+y*-v-l*-h,r}},4361:function(t){t.exports=e;function e(r,i,n){return r[0]=i[0]+n[0],r[1]=i[1]+n[1],r[2]=i[2]+n[2],r[3]=i[3]+n[3],r}},2335:function(t){t.exports=e;function e(r){var i=new Float32Array(4);return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i}},2933:function(t){t.exports=e;function e(r,i){return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r}},7536:function(t){t.exports=e;function e(){var r=new Float32Array(4);return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}},4691:function(t){t.exports=e;function e(r,i){var n=i[0]-r[0],o=i[1]-r[1],a=i[2]-r[2],s=i[3]-r[3];return Math.sqrt(n*n+o*o+a*a+s*s)}},1373:function(t){t.exports=e;function e(r,i,n){return r[0]=i[0]/n[0],r[1]=i[1]/n[1],r[2]=i[2]/n[2],r[3]=i[3]/n[3],r}},3750:function(t){t.exports=e;function e(r,i){return r[0]*i[0]+r[1]*i[1]+r[2]*i[2]+r[3]*i[3]}},3390:function(t){t.exports=e;function e(r,i,n,o){var a=new Float32Array(4);return a[0]=r,a[1]=i,a[2]=n,a[3]=o,a}},9970:function(t,e,r){t.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(t){t.exports=e;function e(r,i){return r[0]=1/i[0],r[1]=1/i[1],r[2]=1/i[2],r[3]=1/i[3],r}},6808:function(t){t.exports=e;function e(r){var i=r[0],n=r[1],o=r[2],a=r[3];return Math.sqrt(i*i+n*n+o*o+a*a)}},2573:function(t){t.exports=e;function e(r,i,n,o){var a=i[0],s=i[1],h=i[2],v=i[3];return r[0]=a+o*(n[0]-a),r[1]=s+o*(n[1]-s),r[2]=h+o*(n[2]-h),r[3]=v+o*(n[3]-v),r}},160:function(t){t.exports=e;function e(r,i,n){return r[0]=Math.max(i[0],n[0]),r[1]=Math.max(i[1],n[1]),r[2]=Math.max(i[2],n[2]),r[3]=Math.max(i[3],n[3]),r}},2334:function(t){t.exports=e;function e(r,i,n){return r[0]=Math.min(i[0],n[0]),r[1]=Math.min(i[1],n[1]),r[2]=Math.min(i[2],n[2]),r[3]=Math.min(i[3],n[3]),r}},3576:function(t){t.exports=e;function e(r,i,n){return r[0]=i[0]*n[0],r[1]=i[1]*n[1],r[2]=i[2]*n[2],r[3]=i[3]*n[3],r}},1498:function(t){t.exports=e;function e(r,i){return r[0]=-i[0],r[1]=-i[1],r[2]=-i[2],r[3]=-i[3],r}},5177:function(t){t.exports=e;function e(r,i){var n=i[0],o=i[1],a=i[2],s=i[3],h=n*n+o*o+a*a+s*s;return h>0&&(h=1/Math.sqrt(h),r[0]=n*h,r[1]=o*h,r[2]=a*h,r[3]=s*h),r}},9131:function(t,e,r){var i=r(5177),n=r(9288);t.exports=o;function o(a,s){return s=s||1,a[0]=Math.random(),a[1]=Math.random(),a[2]=Math.random(),a[3]=Math.random(),i(a,a),n(a,a,s),a}},9288:function(t){t.exports=e;function e(r,i,n){return r[0]=i[0]*n,r[1]=i[1]*n,r[2]=i[2]*n,r[3]=i[3]*n,r}},4844:function(t){t.exports=e;function e(r,i,n,o){return r[0]=i[0]+n[0]*o,r[1]=i[1]+n[1]*o,r[2]=i[2]+n[2]*o,r[3]=i[3]+n[3]*o,r}},4578:function(t){t.exports=e;function e(r,i,n,o,a){return r[0]=i,r[1]=n,r[2]=o,r[3]=a,r}},7960:function(t){t.exports=e;function e(r,i){var n=i[0]-r[0],o=i[1]-r[1],a=i[2]-r[2],s=i[3]-r[3];return n*n+o*o+a*a+s*s}},483:function(t){t.exports=e;function e(r){var i=r[0],n=r[1],o=r[2],a=r[3];return i*i+n*n+o*o+a*a}},6860:function(t){t.exports=e;function e(r,i,n){return r[0]=i[0]-n[0],r[1]=i[1]-n[1],r[2]=i[2]-n[2],r[3]=i[3]-n[3],r}},5352:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],h=i[3];return r[0]=n[0]*o+n[4]*a+n[8]*s+n[12]*h,r[1]=n[1]*o+n[5]*a+n[9]*s+n[13]*h,r[2]=n[2]*o+n[6]*a+n[10]*s+n[14]*h,r[3]=n[3]*o+n[7]*a+n[11]*s+n[15]*h,r}},4041:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],h=n[0],v=n[1],m=n[2],p=n[3],y=p*o+v*s-m*a,l=p*a+m*o-h*s,x=p*s+h*a-v*o,b=-h*o-v*a-m*s;return r[0]=y*p+b*-h+l*-m-x*-v,r[1]=l*p+b*-v+x*-h-y*-m,r[2]=x*p+b*-m+y*-v-l*-h,r[3]=i[3],r}},1848:function(t,e,r){var i=r(4905),n=r(6468);t.exports=o;function o(a){for(var s=Array.isArray(a)?a:i(a),h=0;h<s.length;h++){var v=s[h];if(v.type==="preprocessor"){var m=v.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(m&&m[2]){var p=m[1],y=m[2];return(p?n(y):y).trim()}}}}},5874:function(t,e,r){t.exports=_;var i=r(620),n=r(7827),o=r(6852),a=r(7932),s=r(3508),h=999,v=9999,m=0,p=1,y=2,l=3,x=4,b=5,S=6,T=7,M=8,w=9,u=10,f=11,k=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function _(D){var I=0,O=0,B=h,R,L,F=[],N=[],j=1,G=0,rt=0,ct=!1,lt=!1,tt="",Z;D=D||{};var st=o,$=i;D.version==="300 es"&&(st=s,$=a);for(var Q={},nt={},I=0;I<st.length;I++)Q[st[I]]=!0;for(var I=0;I<$.length;I++)nt[$[I]]=!0;return function(gt){return N=[],gt!==null?q(gt):ot()};function Y(gt){gt.length&&N.push({type:k[B],data:gt,position:rt,line:j,column:G})}function q(gt){I=0,gt.toString&&(gt=gt.toString()),tt+=gt.replace(/\r\n/g,`
|
||
`),Z=tt.length;for(var bt;R=tt[I],I<Z;){switch(bt=I,B){case m:I=Ft();break;case p:I=xt();break;case y:I=wt();break;case l:I=Et();break;case x:I=Jt();break;case f:I=te();break;case b:I=Qt();break;case v:I=Wt();break;case w:I=dt();break;case h:I=it();break}if(bt!==I)switch(tt[bt]){case`
|
||
`:G=0,++j;break;default:++G;break}}return O+=I,tt=tt.slice(I),N}function ot(gt){return F.length&&Y(F.join("")),B=u,Y("(eof)"),N}function it(){return F=F.length?[]:F,L==="/"&&R==="*"?(rt=O+I-1,B=m,L=R,I+1):L==="/"&&R==="/"?(rt=O+I-1,B=p,L=R,I+1):R==="#"?(B=y,rt=O+I,I):/\s/.test(R)?(B=w,rt=O+I,I):(ct=/\d/.test(R),lt=/[^\w_]/.test(R),rt=O+I,B=ct?x:lt?l:v,I)}function dt(){return/[^\s]/g.test(R)?(Y(F.join("")),B=h,I):(F.push(R),L=R,I+1)}function wt(){return(R==="\r"||R===`
|
||
`)&&L!=="\\"?(Y(F.join("")),B=h,I):(F.push(R),L=R,I+1)}function xt(){return wt()}function Ft(){return R==="/"&&L==="*"?(F.push(R),Y(F.join("")),B=h,I+1):(F.push(R),L=R,I+1)}function Et(){if(L==="."&&/\d/.test(R))return B=b,I;if(L==="/"&&R==="*")return B=m,I;if(L==="/"&&R==="/")return B=p,I;if(R==="."&&F.length){for(;Nt(F););return B=b,I}if(R===";"||R===")"||R==="("){if(F.length)for(;Nt(F););return Y(R),B=h,I+1}var gt=F.length===2&&R!=="=";if(/[\w_\d\s]/.test(R)||gt){for(;Nt(F););return B=h,I}return F.push(R),L=R,I+1}function Nt(gt){var bt=0,vt,Ut;do{if(vt=n.indexOf(gt.slice(0,gt.length+bt).join("")),Ut=n[vt],vt===-1){if(bt--+gt.length>0)continue;Ut=gt.slice(0,1).join("")}return Y(Ut),rt+=Ut.length,F=F.slice(Ut.length),F.length}while(!0)}function te(){return/[^a-fA-F0-9]/.test(R)?(Y(F.join("")),B=h,I):(F.push(R),L=R,I+1)}function Jt(){return R==="."||/[eE]/.test(R)?(F.push(R),B=b,L=R,I+1):R==="x"&&F.length===1&&F[0]==="0"?(B=f,F.push(R),L=R,I+1):/[^\d]/.test(R)?(Y(F.join("")),B=h,I):(F.push(R),L=R,I+1)}function Qt(){return R==="f"&&(F.push(R),L=R,I+=1),/[eE]/.test(R)||(R==="-"||R==="+")&&/[eE]/.test(L)?(F.push(R),L=R,I+1):/[^\d]/.test(R)?(Y(F.join("")),B=h,I):(F.push(R),L=R,I+1)}function Wt(){if(/[^\d\w_]/.test(R)){var gt=F.join("");return nt[gt]?B=M:Q[gt]?B=T:B=S,Y(F.join("")),B=h,I}return F.push(R),L=R,I+1}}},3508:function(t,e,r){var i=r(6852);i=i.slice().filter(function(n){return!/^(gl\_|texture)/.test(n)}),t.exports=i.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(t){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(t,e,r){var i=r(620);t.exports=i.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(t){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(t,e,r){var i=r(5874);t.exports=n;function n(o,a){var s=i(a),h=[];return h=h.concat(s(o)),h=h.concat(s(null)),h}},3236:function(t){t.exports=function(e){typeof e=="string"&&(e=[e]);for(var r=[].slice.call(arguments,1),i=[],n=0;n<e.length-1;n++)i.push(e[n],r[n]||"");return i.push(e[n]),i.join("")}},7520:function(t,e,r){var i=r(9507);function n(){var o=!1;try{var a=Object.defineProperty({},"passive",{get:function(){o=!0}});window.addEventListener("test",null,a),window.removeEventListener("test",null,a)}catch{o=!1}return o}t.exports=i&&n()},3778:function(t,e){e.read=function(r,i,n,o,a){var s,h,v=a*8-o-1,m=(1<<v)-1,p=m>>1,y=-7,l=n?a-1:0,x=n?-1:1,b=r[i+l];for(l+=x,s=b&(1<<-y)-1,b>>=-y,y+=v;y>0;s=s*256+r[i+l],l+=x,y-=8);for(h=s&(1<<-y)-1,s>>=-y,y+=o;y>0;h=h*256+r[i+l],l+=x,y-=8);if(s===0)s=1-p;else{if(s===m)return h?NaN:(b?-1:1)*(1/0);h=h+Math.pow(2,o),s=s-p}return(b?-1:1)*h*Math.pow(2,s-o)},e.write=function(r,i,n,o,a,s){var h,v,m,p=s*8-a-1,y=(1<<p)-1,l=y>>1,x=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=o?0:s-1,S=o?1:-1,T=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(v=isNaN(i)?1:0,h=y):(h=Math.floor(Math.log(i)/Math.LN2),i*(m=Math.pow(2,-h))<1&&(h--,m*=2),h+l>=1?i+=x/m:i+=x*Math.pow(2,1-l),i*m>=2&&(h++,m/=2),h+l>=y?(v=0,h=y):h+l>=1?(v=(i*m-1)*Math.pow(2,a),h=h+l):(v=i*Math.pow(2,l-1)*Math.pow(2,a),h=0));a>=8;r[n+b]=v&255,b+=S,v/=256,a-=8);for(h=h<<a|v,p+=a;p>0;r[n+b]=h&255,b+=S,h/=256,p-=8);r[n+b-S]|=T*128}},8954:function(t,e,r){t.exports=l;var i=r(3250),n=r(6803).Fw;function o(x,b,S){this.vertices=x,this.adjacent=b,this.boundary=S,this.lastVisited=-1}o.prototype.flip=function(){var x=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=x;var b=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=b};function a(x,b,S){this.vertices=x,this.cell=b,this.index=S}function s(x,b){return n(x.vertices,b.vertices)}function h(x){return function(){var b=this.tuple;return x.apply(this,b)}}function v(x){var b=i[x+1];return b||(b=i),h(b)}var m=[];function p(x,b,S){this.dimension=x,this.vertices=b,this.simplices=S,this.interior=S.filter(function(w){return!w.boundary}),this.tuple=new Array(x+1);for(var T=0;T<=x;++T)this.tuple[T]=this.vertices[T];var M=m[x];M||(M=m[x]=v(x)),this.orient=M}var y=p.prototype;y.handleBoundaryDegeneracy=function(x,b){var S=this.dimension,T=this.vertices.length-1,M=this.tuple,w=this.vertices,u=[x];for(x.lastVisited=-T;u.length>0;){x=u.pop();for(var f=x.adjacent,k=0;k<=S;++k){var _=f[k];if(!(!_.boundary||_.lastVisited<=-T)){for(var D=_.vertices,I=0;I<=S;++I){var O=D[I];O<0?M[I]=b:M[I]=w[O]}var B=this.orient();if(B>0)return _;_.lastVisited=-T,B===0&&u.push(_)}}}return null},y.walk=function(x,b){var S=this.vertices.length-1,T=this.dimension,M=this.vertices,w=this.tuple,u=b?this.interior.length*Math.random()|0:this.interior.length-1,f=this.interior[u];t:for(;!f.boundary;){for(var k=f.vertices,_=f.adjacent,D=0;D<=T;++D)w[D]=M[k[D]];f.lastVisited=S;for(var D=0;D<=T;++D){var I=_[D];if(!(I.lastVisited>=S)){var O=w[D];w[D]=x;var B=this.orient();if(w[D]=O,B<0){f=I;continue t}else I.boundary?I.lastVisited=-S:I.lastVisited=S}}return}return f},y.addPeaks=function(x,b){var S=this.vertices.length-1,T=this.dimension,M=this.vertices,w=this.tuple,u=this.interior,f=this.simplices,k=[b];b.lastVisited=S,b.vertices[b.vertices.indexOf(-1)]=S,b.boundary=!1,u.push(b);for(var _=[];k.length>0;){var b=k.pop(),D=b.vertices,I=b.adjacent,O=D.indexOf(S);if(!(O<0)){for(var B=0;B<=T;++B)if(B!==O){var R=I[B];if(!(!R.boundary||R.lastVisited>=S)){var L=R.vertices;if(R.lastVisited!==-S){for(var F=0,N=0;N<=T;++N)L[N]<0?(F=N,w[N]=x):w[N]=M[L[N]];var j=this.orient();if(j>0){L[F]=S,R.boundary=!1,u.push(R),k.push(R),R.lastVisited=S;continue}else R.lastVisited=-S}var G=R.adjacent,rt=D.slice(),ct=I.slice(),lt=new o(rt,ct,!0);f.push(lt);var tt=G.indexOf(b);if(!(tt<0)){G[tt]=lt,ct[O]=R,rt[B]=-1,ct[B]=b,I[B]=lt,lt.flip();for(var N=0;N<=T;++N){var Z=rt[N];if(!(Z<0||Z===S)){for(var st=new Array(T-1),$=0,Q=0;Q<=T;++Q){var nt=rt[Q];nt<0||Q===N||(st[$++]=nt)}_.push(new a(st,lt,N))}}}}}}}_.sort(s);for(var B=0;B+1<_.length;B+=2){var Y=_[B],q=_[B+1],ot=Y.index,it=q.index;ot<0||it<0||(Y.cell.adjacent[Y.index]=q.cell,q.cell.adjacent[q.index]=Y.cell)}},y.insert=function(x,b){var S=this.vertices;S.push(x);var T=this.walk(x,b);if(T){for(var M=this.dimension,w=this.tuple,u=0;u<=M;++u){var f=T.vertices[u];f<0?w[u]=x:w[u]=S[f]}var k=this.orient(w);k<0||k===0&&(T=this.handleBoundaryDegeneracy(T,x),!T)||this.addPeaks(x,T)}},y.boundary=function(){for(var x=this.dimension,b=[],S=this.simplices,T=S.length,M=0;M<T;++M){var w=S[M];if(w.boundary){for(var u=new Array(x),f=w.vertices,k=0,_=0,D=0;D<=x;++D)f[D]>=0?u[k++]=f[D]:_=D&1;if(_===(x&1)){var I=u[0];u[0]=u[1],u[1]=I}b.push(u)}}return b};function l(x,b){var S=x.length;if(S===0)throw new Error("Must have at least d+1 points");var T=x[0].length;if(S<=T)throw new Error("Must input at least d+1 points");var M=x.slice(0,T+1),w=i.apply(void 0,M);if(w===0)throw new Error("Input not in general position");for(var u=new Array(T+1),f=0;f<=T;++f)u[f]=f;w<0&&(u[0]=1,u[1]=0);for(var k=new o(u,new Array(T+1),!1),_=k.adjacent,D=new Array(T+2),f=0;f<=T;++f){for(var I=u.slice(),O=0;O<=T;++O)O===f&&(I[O]=-1);var B=I[0];I[0]=I[1],I[1]=B;var R=new o(I,new Array(T+1),!0);_[f]=R,D[f]=R}D[T+1]=k;for(var f=0;f<=T;++f)for(var I=_[f].vertices,L=_[f].adjacent,O=0;O<=T;++O){var F=I[O];if(F<0){L[O]=k;continue}for(var N=0;N<=T;++N)_[N].vertices.indexOf(F)<0&&(L[O]=_[N])}for(var j=new p(T,M,D),G=!!b,f=T+1;f<S;++f)j.insert(x[f],G);return j.boundary()}},3352:function(t,e,r){var i=r(2478),n=0,o=1,a=2;t.exports=k;function s(_,D,I,O,B){this.mid=_,this.left=D,this.right=I,this.leftPoints=O,this.rightPoints=B,this.count=(D?D.count:0)+(I?I.count:0)+O.length}var h=s.prototype;function v(_,D){_.mid=D.mid,_.left=D.left,_.right=D.right,_.leftPoints=D.leftPoints,_.rightPoints=D.rightPoints,_.count=D.count}function m(_,D){var I=w(D);_.mid=I.mid,_.left=I.left,_.right=I.right,_.leftPoints=I.leftPoints,_.rightPoints=I.rightPoints,_.count=I.count}function p(_,D){var I=_.intervals([]);I.push(D),m(_,I)}function y(_,D){var I=_.intervals([]),O=I.indexOf(D);return O<0?n:(I.splice(O,1),m(_,I),o)}h.intervals=function(_){return _.push.apply(_,this.leftPoints),this.left&&this.left.intervals(_),this.right&&this.right.intervals(_),_},h.insert=function(_){var D=this.count-this.leftPoints.length;if(this.count+=1,_[1]<this.mid)this.left?4*(this.left.count+1)>3*(D+1)?p(this,_):this.left.insert(_):this.left=w([_]);else if(_[0]>this.mid)this.right?4*(this.right.count+1)>3*(D+1)?p(this,_):this.right.insert(_):this.right=w([_]);else{var I=i.ge(this.leftPoints,_,T),O=i.ge(this.rightPoints,_,M);this.leftPoints.splice(I,0,_),this.rightPoints.splice(O,0,_)}},h.remove=function(_){var D=this.count-this.leftPoints;if(_[1]<this.mid){if(!this.left)return n;var I=this.right?this.right.count:0;if(4*I>3*(D-1))return y(this,_);var O=this.left.remove(_);return O===a?(this.left=null,this.count-=1,o):(O===o&&(this.count-=1),O)}else if(_[0]>this.mid){if(!this.right)return n;var B=this.left?this.left.count:0;if(4*B>3*(D-1))return y(this,_);var O=this.right.remove(_);return O===a?(this.right=null,this.count-=1,o):(O===o&&(this.count-=1),O)}else{if(this.count===1)return this.leftPoints[0]===_?a:n;if(this.leftPoints.length===1&&this.leftPoints[0]===_){if(this.left&&this.right){for(var R=this,L=this.left;L.right;)R=L,L=L.right;if(R===this)L.right=this.right;else{var F=this.left,O=this.right;R.count-=L.count,R.right=L.left,L.left=F,L.right=O}v(this,L),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?v(this,this.left):v(this,this.right);return o}for(var F=i.ge(this.leftPoints,_,T);F<this.leftPoints.length&&this.leftPoints[F][0]===_[0];++F)if(this.leftPoints[F]===_){this.count-=1,this.leftPoints.splice(F,1);for(var O=i.ge(this.rightPoints,_,M);O<this.rightPoints.length&&this.rightPoints[O][1]===_[1];++O)if(this.rightPoints[O]===_)return this.rightPoints.splice(O,1),o}return n}};function l(_,D,I){for(var O=0;O<_.length&&_[O][0]<=D;++O){var B=I(_[O]);if(B)return B}}function x(_,D,I){for(var O=_.length-1;O>=0&&_[O][1]>=D;--O){var B=I(_[O]);if(B)return B}}function b(_,D){for(var I=0;I<_.length;++I){var O=D(_[I]);if(O)return O}}h.queryPoint=function(_,D){if(_<this.mid){if(this.left){var I=this.left.queryPoint(_,D);if(I)return I}return l(this.leftPoints,_,D)}else if(_>this.mid){if(this.right){var I=this.right.queryPoint(_,D);if(I)return I}return x(this.rightPoints,_,D)}else return b(this.leftPoints,D)},h.queryInterval=function(_,D,I){if(_<this.mid&&this.left){var O=this.left.queryInterval(_,D,I);if(O)return O}if(D>this.mid&&this.right){var O=this.right.queryInterval(_,D,I);if(O)return O}return D<this.mid?l(this.leftPoints,D,I):_>this.mid?x(this.rightPoints,_,I):b(this.leftPoints,I)};function S(_,D){return _-D}function T(_,D){var I=_[0]-D[0];return I||_[1]-D[1]}function M(_,D){var I=_[1]-D[1];return I||_[0]-D[0]}function w(_){if(_.length===0)return null;for(var D=[],I=0;I<_.length;++I)D.push(_[I][0],_[I][1]);D.sort(S);for(var O=D[D.length>>1],B=[],R=[],L=[],I=0;I<_.length;++I){var F=_[I];F[1]<O?B.push(F):O<F[0]?R.push(F):L.push(F)}var N=L,j=L.slice();return N.sort(T),j.sort(M),new s(O,w(B),w(R),N,j)}function u(_){this.root=_}var f=u.prototype;f.insert=function(_){this.root?this.root.insert(_):this.root=new s(_[0],null,null,[_],[_])},f.remove=function(_){if(this.root){var D=this.root.remove(_);return D===a&&(this.root=null),D!==n}return!1},f.queryPoint=function(_,D){if(this.root)return this.root.queryPoint(_,D)},f.queryInterval=function(_,D,I){if(_<=D&&this.root)return this.root.queryInterval(_,D,I)},Object.defineProperty(f,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(f,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function k(_){return!_||_.length===0?new u(null):new u(w(_))}},9507:function(t){t.exports=!0},7163:function(t){t.exports=function(i){return i!=null&&(e(i)||r(i)||!!i._isBuffer)};function e(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function r(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&e(i.slice(0,0))}},5219:function(t){t.exports=function(e){for(var r=e.length,i,n=0;n<r;n++)if(i=e.charCodeAt(n),(i<9||i>13)&&i!==32&&i!==133&&i!==160&&i!==5760&&i!==6158&&(i<8192||i>8205)&&i!==8232&&i!==8233&&i!==8239&&i!==8287&&i!==8288&&i!==12288&&i!==65279)return!1;return!0}},395:function(t){function e(r,i,n){return r*(1-n)+i*n}t.exports=e},2652:function(t,e,r){var i=r(4335),n=r(6864),o=r(1903),a=r(9921),s=r(7608),h=r(5665),v={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},m=n(),p=n(),y=[0,0,0,0],l=[[0,0,0],[0,0,0],[0,0,0]],x=[0,0,0];t.exports=function(M,w,u,f,k,_){if(w||(w=[0,0,0]),u||(u=[0,0,0]),f||(f=[0,0,0]),k||(k=[0,0,0,1]),_||(_=[0,0,0,1]),!i(m,M)||(o(p,m),p[3]=0,p[7]=0,p[11]=0,p[15]=1,Math.abs(a(p)<1e-8)))return!1;var D=m[3],I=m[7],O=m[11],B=m[12],R=m[13],L=m[14],F=m[15];if(D!==0||I!==0||O!==0){y[0]=D,y[1]=I,y[2]=O,y[3]=F;var N=s(p,p);if(!N)return!1;h(p,p),b(k,y,p)}else k[0]=k[1]=k[2]=0,k[3]=1;if(w[0]=B,w[1]=R,w[2]=L,S(l,m),u[0]=v.length(l[0]),v.normalize(l[0],l[0]),f[0]=v.dot(l[0],l[1]),T(l[1],l[1],l[0],1,-f[0]),u[1]=v.length(l[1]),v.normalize(l[1],l[1]),f[0]/=u[1],f[1]=v.dot(l[0],l[2]),T(l[2],l[2],l[0],1,-f[1]),f[2]=v.dot(l[1],l[2]),T(l[2],l[2],l[1],1,-f[2]),u[2]=v.length(l[2]),v.normalize(l[2],l[2]),f[1]/=u[2],f[2]/=u[2],v.cross(x,l[1],l[2]),v.dot(l[0],x)<0)for(var j=0;j<3;j++)u[j]*=-1,l[j][0]*=-1,l[j][1]*=-1,l[j][2]*=-1;return _[0]=.5*Math.sqrt(Math.max(1+l[0][0]-l[1][1]-l[2][2],0)),_[1]=.5*Math.sqrt(Math.max(1-l[0][0]+l[1][1]-l[2][2],0)),_[2]=.5*Math.sqrt(Math.max(1-l[0][0]-l[1][1]+l[2][2],0)),_[3]=.5*Math.sqrt(Math.max(1+l[0][0]+l[1][1]+l[2][2],0)),l[2][1]>l[1][2]&&(_[0]=-_[0]),l[0][2]>l[2][0]&&(_[1]=-_[1]),l[1][0]>l[0][1]&&(_[2]=-_[2]),!0};function b(M,w,u){var f=w[0],k=w[1],_=w[2],D=w[3];return M[0]=u[0]*f+u[4]*k+u[8]*_+u[12]*D,M[1]=u[1]*f+u[5]*k+u[9]*_+u[13]*D,M[2]=u[2]*f+u[6]*k+u[10]*_+u[14]*D,M[3]=u[3]*f+u[7]*k+u[11]*_+u[15]*D,M}function S(M,w){M[0][0]=w[0],M[0][1]=w[1],M[0][2]=w[2],M[1][0]=w[4],M[1][1]=w[5],M[1][2]=w[6],M[2][0]=w[8],M[2][1]=w[9],M[2][2]=w[10]}function T(M,w,u,f,k){M[0]=w[0]*f+u[0]*k,M[1]=w[1]*f+u[1]*k,M[2]=w[2]*f+u[2]*k}},4335:function(t){t.exports=function(e,r){var i=r[15];if(i===0)return!1;for(var n=1/i,o=0;o<16;o++)e[o]=r[o]*n;return!0}},7442:function(t,e,r){var i=r(6658),n=r(7182),o=r(2652),a=r(9921),s=r(8648),h=y(),v=y(),m=y();t.exports=p;function p(b,S,T,M){if(a(S)===0||a(T)===0)return!1;var w=o(S,h.translate,h.scale,h.skew,h.perspective,h.quaternion),u=o(T,v.translate,v.scale,v.skew,v.perspective,v.quaternion);return!w||!u?!1:(i(m.translate,h.translate,v.translate,M),i(m.skew,h.skew,v.skew,M),i(m.scale,h.scale,v.scale,M),i(m.perspective,h.perspective,v.perspective,M),s(m.quaternion,h.quaternion,v.quaternion,M),n(b,m.translate,m.scale,m.skew,m.perspective,m.quaternion),!0)}function y(){return{translate:l(),scale:l(1),skew:l(),perspective:x(),quaternion:x()}}function l(b){return[b||0,b||0,b||0]}function x(){return[0,0,0,1]}},7182:function(t,e,r){var i={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)};i.create();var n=i.create();t.exports=function(o,a,s,h,v,m){return i.identity(o),i.fromRotationTranslation(o,m,a),o[3]=v[0],o[7]=v[1],o[11]=v[2],o[15]=v[3],i.identity(n),h[2]!==0&&(n[9]=h[2],i.multiply(o,o,n)),h[1]!==0&&(n[9]=0,n[8]=h[1],i.multiply(o,o,n)),h[0]!==0&&(n[8]=0,n[4]=h[0],i.multiply(o,o,n)),i.scale(o,o,s),o}},1811:function(t,e,r){var i=r(2478),n=r(7442),o=r(7608),a=r(5567),s=r(2408),h=r(7089),v=r(6582),m=r(7656);r(2504);var p=r(3536),y=[0,0,0];t.exports=S;function l(T){this._components=T.slice(),this._time=[0],this.prevMatrix=T.slice(),this.nextMatrix=T.slice(),this.computedMatrix=T.slice(),this.computedInverse=T.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}var x=l.prototype;x.recalcMatrix=function(T){var M=this._time,w=i.le(M,T),u=this.computedMatrix;if(!(w<0)){var f=this._components;if(w===M.length-1)for(var k=16*w,_=0;_<16;++_)u[_]=f[k++];else{for(var D=M[w+1]-M[w],k=16*w,I=this.prevMatrix,O=!0,_=0;_<16;++_)I[_]=f[k++];for(var B=this.nextMatrix,_=0;_<16;++_)B[_]=f[k++],O=O&&I[_]===B[_];if(D<1e-6||O)for(var _=0;_<16;++_)u[_]=I[_];else n(u,I,B,(T-M[w])/D)}var R=this.computedUp;R[0]=u[1],R[1]=u[5],R[2]=u[9],p(R,R);var L=this.computedInverse;o(L,u);var F=this.computedEye,N=L[15];F[0]=L[12]/N,F[1]=L[13]/N,F[2]=L[14]/N;for(var j=this.computedCenter,G=Math.exp(this.computedRadius[0]),_=0;_<3;++_)j[_]=F[_]-u[2+4*_]*G}},x.idle=function(T){if(!(T<this.lastT())){for(var M=this._components,w=M.length-16,u=0;u<16;++u)M.push(M[w++]);this._time.push(T)}},x.flush=function(T){var M=i.gt(this._time,T)-2;M<0||(this._time.splice(0,M),this._components.splice(0,16*M))},x.lastT=function(){return this._time[this._time.length-1]},x.lookAt=function(T,M,w,u){this.recalcMatrix(T),M=M||this.computedEye,w=w||y,u=u||this.computedUp,this.setMatrix(T,v(this.computedMatrix,M,w,u));for(var f=0,k=0;k<3;++k)f+=Math.pow(w[k]-M[k],2);f=Math.log(Math.sqrt(f)),this.computedRadius[0]=f},x.rotate=function(T,M,w,u){this.recalcMatrix(T);var f=this.computedInverse;M&&s(f,f,M),w&&a(f,f,w),u&&h(f,f,u),this.setMatrix(T,o(this.computedMatrix,f))};var b=[0,0,0];x.pan=function(T,M,w,u){b[0]=-(M||0),b[1]=-(w||0),b[2]=-(u||0),this.recalcMatrix(T);var f=this.computedInverse;m(f,f,b),this.setMatrix(T,o(f,f))},x.translate=function(T,M,w,u){b[0]=M||0,b[1]=w||0,b[2]=u||0,this.recalcMatrix(T);var f=this.computedMatrix;m(f,f,b),this.setMatrix(T,f)},x.setMatrix=function(T,M){if(!(T<this.lastT())){this._time.push(T);for(var w=0;w<16;++w)this._components.push(M[w])}},x.setDistance=function(T,M){this.computedRadius[0]=M},x.setDistanceLimits=function(T,M){var w=this._limits;w[0]=T,w[1]=M},x.getDistanceLimits=function(T){var M=this._limits;return T?(T[0]=M[0],T[1]=M[1],T):M};function S(T){T=T||{};var M=T.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new l(M)}},3090:function(t,e,r){t.exports=n;var i=r(3250)[3];function n(o){var a=o.length;if(a<3){for(var s=new Array(a),h=0;h<a;++h)s[h]=h;return a===2&&o[0][0]===o[1][0]&&o[0][1]===o[1][1]?[0]:s}for(var v=new Array(a),h=0;h<a;++h)v[h]=h;v.sort(function(M,w){var u=o[M][0]-o[w][0];return u||o[M][1]-o[w][1]});for(var m=[v[0],v[1]],p=[v[0],v[1]],h=2;h<a;++h){for(var y=v[h],l=o[y],x=m.length;x>1&&i(o[m[x-2]],o[m[x-1]],l)<=0;)x-=1,m.pop();for(m.push(y),x=p.length;x>1&&i(o[p[x-2]],o[p[x-1]],l)>=0;)x-=1,p.pop();p.push(y)}for(var s=new Array(p.length+m.length-2),b=0,h=0,S=m.length;h<S;++h)s[b++]=m[h];for(var T=p.length-2;T>0;--T)s[b++]=p[T];return s}},351:function(t,e,r){t.exports=n;var i=r(4687);function n(o,a){a||(a=o,o=window);var s=0,h=0,v=0,m={shift:!1,alt:!1,control:!1,meta:!1},p=!1;function y(_){var D=!1;return"altKey"in _&&(D=D||_.altKey!==m.alt,m.alt=!!_.altKey),"shiftKey"in _&&(D=D||_.shiftKey!==m.shift,m.shift=!!_.shiftKey),"ctrlKey"in _&&(D=D||_.ctrlKey!==m.control,m.control=!!_.ctrlKey),"metaKey"in _&&(D=D||_.metaKey!==m.meta,m.meta=!!_.metaKey),D}function l(_,D){var I=i.x(D),O=i.y(D);"buttons"in D&&(_=D.buttons|0),(_!==s||I!==h||O!==v||y(D))&&(s=_|0,h=I||0,v=O||0,a&&a(s,h,v,m))}function x(_){l(0,_)}function b(){(s||h||v||m.shift||m.alt||m.meta||m.control)&&(h=v=0,s=0,m.shift=m.alt=m.control=m.meta=!1,a&&a(0,0,0,m))}function S(_){y(_)&&a&&a(s,h,v,m)}function T(_){i.buttons(_)===0?l(0,_):l(s,_)}function M(_){l(s|i.buttons(_),_)}function w(_){l(s&~i.buttons(_),_)}function u(){p||(p=!0,o.addEventListener("mousemove",T),o.addEventListener("mousedown",M),o.addEventListener("mouseup",w),o.addEventListener("mouseleave",x),o.addEventListener("mouseenter",x),o.addEventListener("mouseout",x),o.addEventListener("mouseover",x),o.addEventListener("blur",b),o.addEventListener("keyup",S),o.addEventListener("keydown",S),o.addEventListener("keypress",S),o!==window&&(window.addEventListener("blur",b),window.addEventListener("keyup",S),window.addEventListener("keydown",S),window.addEventListener("keypress",S)))}function f(){p&&(p=!1,o.removeEventListener("mousemove",T),o.removeEventListener("mousedown",M),o.removeEventListener("mouseup",w),o.removeEventListener("mouseleave",x),o.removeEventListener("mouseenter",x),o.removeEventListener("mouseout",x),o.removeEventListener("mouseover",x),o.removeEventListener("blur",b),o.removeEventListener("keyup",S),o.removeEventListener("keydown",S),o.removeEventListener("keypress",S),o!==window&&(window.removeEventListener("blur",b),window.removeEventListener("keyup",S),window.removeEventListener("keydown",S),window.removeEventListener("keypress",S)))}u();var k={element:o};return Object.defineProperties(k,{enabled:{get:function(){return p},set:function(_){_?u():f()},enumerable:!0},buttons:{get:function(){return s},enumerable:!0},x:{get:function(){return h},enumerable:!0},y:{get:function(){return v},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),k}},24:function(t){var e={left:0,top:0};t.exports=r;function r(n,o,a){o=o||n.currentTarget||n.srcElement,Array.isArray(a)||(a=[0,0]);var s=n.clientX||0,h=n.clientY||0,v=i(o);return a[0]=s-v.left,a[1]=h-v.top,a}function i(n){return n===window||n===document||n===document.body?e:n.getBoundingClientRect()}},4687:function(t,e){function r(a){if(typeof a=="object"){if("buttons"in a)return a.buttons;if("which"in a){var s=a.which;if(s===2)return 4;if(s===3)return 2;if(s>0)return 1<<s-1}else if("button"in a){var s=a.button;if(s===1)return 4;if(s===2)return 2;if(s>=0)return 1<<s}}return 0}e.buttons=r;function i(a){return a.target||a.srcElement||window}e.element=i;function n(a){if(typeof a=="object"){if("offsetX"in a)return a.offsetX;var s=i(a),h=s.getBoundingClientRect();return a.clientX-h.left}return 0}e.x=n;function o(a){if(typeof a=="object"){if("offsetY"in a)return a.offsetY;var s=i(a),h=s.getBoundingClientRect();return a.clientY-h.top}return 0}e.y=o},8512:function(t,e,r){var i=r(665);t.exports=n;function n(o,a,s){typeof o=="function"&&(s=!!a,a=o,o=window);var h=i("ex",o),v=function(m){s&&m.preventDefault();var p=m.deltaX||0,y=m.deltaY||0,l=m.deltaZ||0,x=m.deltaMode,b=1;switch(x){case 1:b=h;break;case 2:b=window.innerHeight;break}if(p*=b,y*=b,l*=b,p||y||l)return a(p,y,l,m)};return o.addEventListener("wheel",v),v}},2640:function(t,e,r){var i=r(1888);t.exports=a;var n={"false,0,1":function(s,h,v,m,p){return function(y,l,x,b){var S=y.shape[0]|0,T=y.shape[1]|0,M=y.data,w=y.offset|0,u=y.stride[0]|0,f=y.stride[1]|0,k=w,_,D=-u|0,I=0,O=-f|0,B=0,R=-u-f|0,L=0,F=u|0,N=f-u*S|0,j=0,G=0,rt=0,ct=2*S|0,lt=m(ct),tt=m(ct),Z=0,st=0,$=-1,Q=-1,nt=0,Y=-S|0,q=S|0,ot=0,it=-S-1|0,dt=S-1|0,wt=0,xt=0,Ft=0;for(j=0;j<S;++j)lt[Z++]=v(M[k],l,x,b),k+=F;if(k+=N,T>0){if(G=1,lt[Z++]=v(M[k],l,x,b),k+=F,S>0)for(j=1,_=M[k],st=lt[Z]=v(_,l,x,b),nt=lt[Z+$],ot=lt[Z+Y],wt=lt[Z+it],(st!==nt||st!==ot||st!==wt)&&(I=M[k+D],B=M[k+O],L=M[k+R],s(j,G,_,I,B,L,st,nt,ot,wt,l,x,b),xt=tt[Z]=rt++),Z+=1,k+=F,j=2;j<S;++j)_=M[k],st=lt[Z]=v(_,l,x,b),nt=lt[Z+$],ot=lt[Z+Y],wt=lt[Z+it],(st!==nt||st!==ot||st!==wt)&&(I=M[k+D],B=M[k+O],L=M[k+R],s(j,G,_,I,B,L,st,nt,ot,wt,l,x,b),xt=tt[Z]=rt++,wt!==nt&&h(tt[Z+$],xt,L,I,wt,nt,l,x,b)),Z+=1,k+=F;for(k+=N,Z=0,Ft=$,$=Q,Q=Ft,Ft=Y,Y=q,q=Ft,Ft=it,it=dt,dt=Ft,G=2;G<T;++G){if(lt[Z++]=v(M[k],l,x,b),k+=F,S>0)for(j=1,_=M[k],st=lt[Z]=v(_,l,x,b),nt=lt[Z+$],ot=lt[Z+Y],wt=lt[Z+it],(st!==nt||st!==ot||st!==wt)&&(I=M[k+D],B=M[k+O],L=M[k+R],s(j,G,_,I,B,L,st,nt,ot,wt,l,x,b),xt=tt[Z]=rt++,wt!==ot&&h(tt[Z+Y],xt,B,L,ot,wt,l,x,b)),Z+=1,k+=F,j=2;j<S;++j)_=M[k],st=lt[Z]=v(_,l,x,b),nt=lt[Z+$],ot=lt[Z+Y],wt=lt[Z+it],(st!==nt||st!==ot||st!==wt)&&(I=M[k+D],B=M[k+O],L=M[k+R],s(j,G,_,I,B,L,st,nt,ot,wt,l,x,b),xt=tt[Z]=rt++,wt!==ot&&h(tt[Z+Y],xt,B,L,ot,wt,l,x,b),wt!==nt&&h(tt[Z+$],xt,L,I,wt,nt,l,x,b)),Z+=1,k+=F;G&1&&(Z=0),Ft=$,$=Q,Q=Ft,Ft=Y,Y=q,q=Ft,Ft=it,it=dt,dt=Ft,k+=N}}p(tt),p(lt)}},"false,1,0":function(s,h,v,m,p){return function(y,l,x,b){var S=y.shape[0]|0,T=y.shape[1]|0,M=y.data,w=y.offset|0,u=y.stride[0]|0,f=y.stride[1]|0,k=w,_,D=-u|0,I=0,O=-f|0,B=0,R=-u-f|0,L=0,F=f|0,N=u-f*T|0,j=0,G=0,rt=0,ct=2*T|0,lt=m(ct),tt=m(ct),Z=0,st=0,$=-1,Q=-1,nt=0,Y=-T|0,q=T|0,ot=0,it=-T-1|0,dt=T-1|0,wt=0,xt=0,Ft=0;for(G=0;G<T;++G)lt[Z++]=v(M[k],l,x,b),k+=F;if(k+=N,S>0){if(j=1,lt[Z++]=v(M[k],l,x,b),k+=F,T>0)for(G=1,_=M[k],st=lt[Z]=v(_,l,x,b),ot=lt[Z+Y],nt=lt[Z+$],wt=lt[Z+it],(st!==ot||st!==nt||st!==wt)&&(I=M[k+D],B=M[k+O],L=M[k+R],s(j,G,_,I,B,L,st,ot,nt,wt,l,x,b),xt=tt[Z]=rt++),Z+=1,k+=F,G=2;G<T;++G)_=M[k],st=lt[Z]=v(_,l,x,b),ot=lt[Z+Y],nt=lt[Z+$],wt=lt[Z+it],(st!==ot||st!==nt||st!==wt)&&(I=M[k+D],B=M[k+O],L=M[k+R],s(j,G,_,I,B,L,st,ot,nt,wt,l,x,b),xt=tt[Z]=rt++,wt!==nt&&h(tt[Z+$],xt,B,L,nt,wt,l,x,b)),Z+=1,k+=F;for(k+=N,Z=0,Ft=Y,Y=q,q=Ft,Ft=$,$=Q,Q=Ft,Ft=it,it=dt,dt=Ft,j=2;j<S;++j){if(lt[Z++]=v(M[k],l,x,b),k+=F,T>0)for(G=1,_=M[k],st=lt[Z]=v(_,l,x,b),ot=lt[Z+Y],nt=lt[Z+$],wt=lt[Z+it],(st!==ot||st!==nt||st!==wt)&&(I=M[k+D],B=M[k+O],L=M[k+R],s(j,G,_,I,B,L,st,ot,nt,wt,l,x,b),xt=tt[Z]=rt++,wt!==ot&&h(tt[Z+Y],xt,L,I,wt,ot,l,x,b)),Z+=1,k+=F,G=2;G<T;++G)_=M[k],st=lt[Z]=v(_,l,x,b),ot=lt[Z+Y],nt=lt[Z+$],wt=lt[Z+it],(st!==ot||st!==nt||st!==wt)&&(I=M[k+D],B=M[k+O],L=M[k+R],s(j,G,_,I,B,L,st,ot,nt,wt,l,x,b),xt=tt[Z]=rt++,wt!==nt&&h(tt[Z+$],xt,B,L,nt,wt,l,x,b),wt!==ot&&h(tt[Z+Y],xt,L,I,wt,ot,l,x,b)),Z+=1,k+=F;j&1&&(Z=0),Ft=Y,Y=q,q=Ft,Ft=$,$=Q,Q=Ft,Ft=it,it=dt,dt=Ft,k+=N}}p(tt),p(lt)}}};function o(s,h,v,m,p,y){var l=[y,p].join(","),x=n[l];return x(s,h,v,i.mallocUint32,i.freeUint32)}function a(s){function h(b){throw new Error("ndarray-extract-contour: "+b)}typeof s!="object"&&h("Must specify arguments");var v=s.order;Array.isArray(v)||h("Must specify order");var m=s.arrayArguments||1;m<1&&h("Must have at least one array argument");var p=s.scalarArguments||0;p<0&&h("Scalar arg count must be > 0"),typeof s.vertex!="function"&&h("Must specify vertex creation function"),typeof s.cell!="function"&&h("Must specify cell creation function"),typeof s.phase!="function"&&h("Must specify phase function");for(var y=s.getters||[],l=new Array(m),x=0;x<m;++x)y.indexOf(x)>=0?l[x]=!0:l[x]=!1;return o(s.vertex,s.cell,s.phase,p,v,l)}},6199:function(t,e,r){var i=r(1338),n={zero:function(S,T,M,w){var u=S[0],f=M[0];w|=0;var k=0,_=f;for(k=0;k<u;++k)T[w]=0,w+=_},fdTemplate1:function(S,T,M,w,u,f,k){var _=S[0],D=M[0],I=f[0],O=-1*D,B=D;w|=0,k|=0;var R=0,L=D,F=I;for(R=0;R<_;++R)u[k]=.5*(T[w+O]-T[w+B]),w+=L,k+=F},fdTemplate2:function(S,T,M,w,u,f,k,_,D,I){var O=S[0],B=S[1],R=M[0],L=M[1],F=f[0],N=f[1],j=D[0],G=D[1],rt=-1*R,ct=R,lt=-1*L,tt=L;w|=0,k|=0,I|=0;var Z=0,st=0,$=L,Q=R-B*L,nt=N,Y=F-B*N,q=G,ot=j-B*G;for(st=0;st<O;++st){for(Z=0;Z<B;++Z)u[k]=.5*(T[w+rt]-T[w+ct]),_[I]=.5*(T[w+lt]-T[w+tt]),w+=$,k+=nt,I+=q;w+=Q,k+=Y,I+=ot}}},o={cdiff:function(S){var T={};return function(M,w,u){var f=M.dtype,k=M.order,_=w.dtype,D=w.order,I=u.dtype,O=u.order,B=[f,k.join(),_,D.join(),I,O.join()].join(),R=T[B];return R||(T[B]=R=S([f,k,_,D,I,O])),R(M.shape.slice(0),M.data,M.stride,M.offset|0,w.data,w.stride,w.offset|0,u.data,u.stride,u.offset|0)}},zero:function(S){var T={};return function(M){var w=M.dtype,u=M.order,f=[w,u.join()].join(),k=T[f];return k||(T[f]=k=S([w,u])),k(M.shape.slice(0),M.data,M.stride,M.offset|0)}},fdTemplate1:function(S){var T={};return function(M,w){var u=M.dtype,f=M.order,k=w.dtype,_=w.order,D=[u,f.join(),k,_.join()].join(),I=T[D];return I||(T[D]=I=S([u,f,k,_])),I(M.shape.slice(0),M.data,M.stride,M.offset|0,w.data,w.stride,w.offset|0)}},fdTemplate2:function(S){var T={};return function(M,w,u){var f=M.dtype,k=M.order,_=w.dtype,D=w.order,I=u.dtype,O=u.order,B=[f,k.join(),_,D.join(),I,O.join()].join(),R=T[B];return R||(T[B]=R=S([f,k,_,D,I,O])),R(M.shape.slice(0),M.data,M.stride,M.offset|0,w.data,w.stride,w.offset|0,u.data,u.stride,u.offset|0)}}};function a(S){var T=o[S.funcName];return T(s.bind(void 0,S))}function s(S){return n[S.funcName]}function h(S){return a({funcName:S.funcName})}var v={},m={},p=h({funcName:"cdiff"}),y=h({funcName:"zero"});function l(S){return S in v?v[S]:v[S]=h({funcName:"fdTemplate"+S})}function x(S,T,M,w){return function(u,f){var k=f.shape.slice();return k[0]>2&&k[1]>2&&w(f.pick(-1,-1).lo(1,1).hi(k[0]-2,k[1]-2),u.pick(-1,-1,0).lo(1,1).hi(k[0]-2,k[1]-2),u.pick(-1,-1,1).lo(1,1).hi(k[0]-2,k[1]-2)),k[1]>2&&(M(f.pick(0,-1).lo(1).hi(k[1]-2),u.pick(0,-1,1).lo(1).hi(k[1]-2)),T(u.pick(0,-1,0).lo(1).hi(k[1]-2))),k[1]>2&&(M(f.pick(k[0]-1,-1).lo(1).hi(k[1]-2),u.pick(k[0]-1,-1,1).lo(1).hi(k[1]-2)),T(u.pick(k[0]-1,-1,0).lo(1).hi(k[1]-2))),k[0]>2&&(M(f.pick(-1,0).lo(1).hi(k[0]-2),u.pick(-1,0,0).lo(1).hi(k[0]-2)),T(u.pick(-1,0,1).lo(1).hi(k[0]-2))),k[0]>2&&(M(f.pick(-1,k[1]-1).lo(1).hi(k[0]-2),u.pick(-1,k[1]-1,0).lo(1).hi(k[0]-2)),T(u.pick(-1,k[1]-1,1).lo(1).hi(k[0]-2))),u.set(0,0,0,0),u.set(0,0,1,0),u.set(k[0]-1,0,0,0),u.set(k[0]-1,0,1,0),u.set(0,k[1]-1,0,0),u.set(0,k[1]-1,1,0),u.set(k[0]-1,k[1]-1,0,0),u.set(k[0]-1,k[1]-1,1,0),u}}function b(S){var T=S.join(),k=m[T];if(k)return k;for(var M=S.length,w=[p,y],u=1;u<=M;++u)w.push(l(u));var f=x,k=f.apply(void 0,w);return m[T]=k,k}t.exports=function(S,T,M){if(Array.isArray(M)||(typeof M=="string"?M=i(T.dimension,M):M=i(T.dimension,"clamp")),T.size===0)return S;if(T.dimension===0)return S.set(0),S;var w=b(M);return w(S,T)}},4317:function(t){function e(a,s){var h=Math.floor(s),v=s-h,m=0<=h&&h<a.shape[0],p=0<=h+1&&h+1<a.shape[0],y=m?+a.get(h):0,l=p?+a.get(h+1):0;return(1-v)*y+v*l}function r(a,s,h){var v=Math.floor(s),m=s-v,p=0<=v&&v<a.shape[0],y=0<=v+1&&v+1<a.shape[0],l=Math.floor(h),x=h-l,b=0<=l&&l<a.shape[1],S=0<=l+1&&l+1<a.shape[1],T=p&&b?a.get(v,l):0,M=p&&S?a.get(v,l+1):0,w=y&&b?a.get(v+1,l):0,u=y&&S?a.get(v+1,l+1):0;return(1-x)*((1-m)*T+m*w)+x*((1-m)*M+m*u)}function i(a,s,h,v){var m=Math.floor(s),p=s-m,y=0<=m&&m<a.shape[0],l=0<=m+1&&m+1<a.shape[0],x=Math.floor(h),b=h-x,S=0<=x&&x<a.shape[1],T=0<=x+1&&x+1<a.shape[1],M=Math.floor(v),w=v-M,u=0<=M&&M<a.shape[2],f=0<=M+1&&M+1<a.shape[2],k=y&&S&&u?a.get(m,x,M):0,_=y&&T&&u?a.get(m,x+1,M):0,D=l&&S&&u?a.get(m+1,x,M):0,I=l&&T&&u?a.get(m+1,x+1,M):0,O=y&&S&&f?a.get(m,x,M+1):0,B=y&&T&&f?a.get(m,x+1,M+1):0,R=l&&S&&f?a.get(m+1,x,M+1):0,L=l&&T&&f?a.get(m+1,x+1,M+1):0;return(1-w)*((1-b)*((1-p)*k+p*D)+b*((1-p)*_+p*I))+w*((1-b)*((1-p)*O+p*R)+b*((1-p)*B+p*L))}function n(a){var s=a.shape.length|0,h=new Array(s),v=new Array(s),m=new Array(s),p=new Array(s),y,l;for(y=0;y<s;++y)l=+arguments[y+1],h[y]=Math.floor(l),v[y]=l-h[y],m[y]=0<=h[y]&&h[y]<a.shape[y],p[y]=0<=h[y]+1&&h[y]+1<a.shape[y];var x=0,b,S,T;t:for(y=0;y<1<<s;++y){for(S=1,T=a.offset,b=0;b<s;++b)if(y&1<<b){if(!p[b])continue t;S*=v[b],T+=a.stride[b]*(h[b]+1)}else{if(!m[b])continue t;S*=1-v[b],T+=a.stride[b]*h[b]}x+=S*a.data[T]}return x}function o(a,s,h,v){switch(a.shape.length){case 0:return 0;case 1:return e(a,s);case 2:return r(a,s,h);case 3:return i(a,s,h,v);default:return n.apply(void 0,arguments)}}t.exports=o,t.exports.d1=e,t.exports.d2=r,t.exports.d3=i},5298:function(t,e){var r={"float64,2,1,0":function(){return function(v,m,p,y,l){var x=v[0],b=v[1],S=v[2],T=p[0],M=p[1],w=p[2];y|=0;var u=0,f=0,k=0,_=w,D=M-S*w,I=T-b*M;for(k=0;k<x;++k){for(f=0;f<b;++f){for(u=0;u<S;++u)m[y]/=l,y+=_;y+=D}y+=I}}},"uint8,2,0,1,float64,2,1,0":function(){return function(v,m,p,y,l,x,b,S){var T=v[0],M=v[1],w=v[2],u=p[0],f=p[1],k=p[2],_=x[0],D=x[1],I=x[2];y|=0,b|=0;for(var O=y,B=b,R=v[0]|0;R>0;){R<64?(T=R,R=0):(T=64,R-=64);for(var L=v[1]|0;L>0;){L<64?(M=L,L=0):(M=64,L-=64),y=O+R*u+L*f,b=B+R*_+L*D;var F=0,N=0,j=0,G=k,rt=u-w*k,ct=f-T*u,lt=I,tt=_-w*I,Z=D-T*_;for(j=0;j<M;++j){for(N=0;N<T;++N){for(F=0;F<w;++F)m[y]=l[b]*S,y+=G,b+=lt;y+=rt,b+=tt}y+=ct,b+=Z}}}}},"float32,1,0,float32,1,0":function(){return function(v,m,p,y,l,x,b){var S=v[0],T=v[1],M=p[0],w=p[1],u=x[0],f=x[1];y|=0,b|=0;var k=0,_=0,D=w,I=M-T*w,O=f,B=u-T*f;for(_=0;_<S;++_){for(k=0;k<T;++k)m[y]=l[b],y+=D,b+=O;y+=I,b+=B}}},"float32,1,0,float32,0,1":function(){return function(v,m,p,y,l,x,b){var S=v[0],T=v[1],M=p[0],w=p[1],u=x[0],f=x[1];y|=0,b|=0;for(var k=y,_=b,D=v[1]|0;D>0;){D<64?(T=D,D=0):(T=64,D-=64);for(var I=v[0]|0;I>0;){I<64?(S=I,I=0):(S=64,I-=64),y=k+D*w+I*M,b=_+D*f+I*u;var O=0,B=0,R=w,L=M-T*w,F=f,N=u-T*f;for(B=0;B<S;++B){for(O=0;O<T;++O)m[y]=l[b],y+=R,b+=F;y+=L,b+=N}}}}},"uint8,2,0,1,uint8,1,2,0":function(){return function(v,m,p,y,l,x,b){var S=v[0],T=v[1],M=v[2],w=p[0],u=p[1],f=p[2],k=x[0],_=x[1],D=x[2];y|=0,b|=0;for(var I=y,O=b,B=v[2]|0;B>0;){B<64?(M=B,B=0):(M=64,B-=64);for(var R=v[0]|0;R>0;){R<64?(S=R,R=0):(S=64,R-=64);for(var L=v[1]|0;L>0;){L<64?(T=L,L=0):(T=64,L-=64),y=I+B*f+R*w+L*u,b=O+B*D+R*k+L*_;var F=0,N=0,j=0,G=f,rt=w-M*f,ct=u-S*w,lt=D,tt=k-M*D,Z=_-S*k;for(j=0;j<T;++j){for(N=0;N<S;++N){for(F=0;F<M;++F)m[y]=l[b],y+=G,b+=lt;y+=rt,b+=tt}y+=ct,b+=Z}}}}}},"uint8,2,0,1,array,2,0,1":function(){return function(v,m,p,y,l,x,b){var S=v[0],T=v[1],M=v[2],w=p[0],u=p[1],f=p[2],k=x[0],_=x[1],D=x[2];y|=0,b|=0;var I=0,O=0,B=0,R=f,L=w-M*f,F=u-S*w,N=D,j=k-M*D,G=_-S*k;for(B=0;B<T;++B){for(O=0;O<S;++O){for(I=0;I<M;++I)m[y]=l[b],y+=R,b+=N;y+=L,b+=j}y+=F,b+=G}}}};function i(v,m){var p=m.join(","),y=r[p];return y()}var n=i,o={mul:function(v){var m={};return function(p,y,l){var x=p.dtype,b=p.order,S=y.dtype,T=y.order,M=l.dtype,w=l.order,u=[x,b.join(),S,T.join(),M,w.join()].join(),f=m[u];return f||(m[u]=f=v([x,b,S,T,M,w])),f(p.shape.slice(0),p.data,p.stride,p.offset|0,y.data,y.stride,y.offset|0,l.data,l.stride,l.offset|0)}},muls:function(v){var m={};return function(p,y,l){var x=p.dtype,b=p.order,S=y.dtype,T=y.order,M=[x,b.join(),S,T.join()].join(),w=m[M];return w||(m[M]=w=v([x,b,S,T])),w(p.shape.slice(0),p.data,p.stride,p.offset|0,y.data,y.stride,y.offset|0,l)}},mulseq:function(v){var m={};return function(p,y){var l=p.dtype,x=p.order,b=[l,x.join()].join(),S=m[b];return S||(m[b]=S=v([l,x])),S(p.shape.slice(0),p.data,p.stride,p.offset|0,y)}},div:function(v){var m={};return function(p,y,l){var x=p.dtype,b=p.order,S=y.dtype,T=y.order,M=l.dtype,w=l.order,u=[x,b.join(),S,T.join(),M,w.join()].join(),f=m[u];return f||(m[u]=f=v([x,b,S,T,M,w])),f(p.shape.slice(0),p.data,p.stride,p.offset|0,y.data,y.stride,y.offset|0,l.data,l.stride,l.offset|0)}},divs:function(v){var m={};return function(p,y,l){var x=p.dtype,b=p.order,S=y.dtype,T=y.order,M=[x,b.join(),S,T.join()].join(),w=m[M];return w||(m[M]=w=v([x,b,S,T])),w(p.shape.slice(0),p.data,p.stride,p.offset|0,y.data,y.stride,y.offset|0,l)}},divseq:function(v){var m={};return function(p,y){var l=p.dtype,x=p.order,b=[l,x.join()].join(),S=m[b];return S||(m[b]=S=v([l,x])),S(p.shape.slice(0),p.data,p.stride,p.offset|0,y)}},assign:function(v){var m={};return function(p,y){var l=p.dtype,x=p.order,b=y.dtype,S=y.order,T=[l,x.join(),b,S.join()].join(),M=m[T];return M||(m[T]=M=v([l,x,b,S])),M(p.shape.slice(0),p.data,p.stride,p.offset|0,y.data,y.stride,y.offset|0)}}};function a(v){var m=o[v.funcName];return m(n.bind(void 0,v))}function s(v){return a({funcName:v.funcName})}var h={mul:"*",div:"/"};(function(){for(var v in h)e[v]=s({funcName:v}),e[v+"s"]=s({funcName:v+"s"}),e[v+"seq"]=s({funcName:v+"seq"})})(),e.assign=s({funcName:"assign"})},9994:function(t,e,r){var i=r(9618),n=r(8277);t.exports=function(o,a){for(var s=[],h=o,v=1;Array.isArray(h);)s.push(h.length),v*=h.length,h=h[0];return s.length===0?i():(a||(a=i(new Float64Array(v),s)),n(a,o),a)}},8277:function(t){function e(){return function(s,h,v,m,p){var y=s[0],l=s[1],x=s[2],b=v[0],S=v[1],T=v[2],M=[0,0,0];m|=0;var w=0,u=0,f=0,k=T,_=S-x*T,D=b-l*S;for(f=0;f<y;++f){for(u=0;u<l;++u){for(w=0;w<x;++w){{var I=p,O;for(O=0;O<M.length-1;++O)I=I[M[O]];h[m]=I[M[M.length-1]]}m+=k,++M[2]}m+=_,M[2]-=x,++M[1]}m+=D,M[1]-=l,++M[0]}}}function r(){return e()}var i=r;function n(s){var h={};return function(v,m){var p=v.dtype,y=v.order,l=[p,y.join()].join(),x=h[l];return x||(h[l]=x=s([p,y])),x(v.shape.slice(0),v.data,v.stride,v.offset|0,m)}}function o(s){return n(i.bind(void 0,s))}function a(s){return o({funcName:s.funcName})}t.exports=a({funcName:"convert"})},7640:function(t,e,r){var i=r(1888);function n(p){switch(p){case"uint32":return[i.mallocUint32,i.freeUint32];default:return null}}var o={"uint32,1,0":function(p,y){return function(l,x,b,S,T,M,w,u,f,k,_){var D,I,O,B=l*T+S,R,L=p(u),F,N,j,G;for(D=l+1;D<=x;++D){for(I=D,B+=T,O=B,F=0,N=B,R=0;R<u;++R)L[F++]=b[N],N+=f;t:for(;I-- >l;){F=0,N=O-T;e:for(R=0;R<u;++R){if(j=b[N],G=L[F],j<G)break t;if(j>G)break e;N+=k,F+=_}for(F=O,N=O-T,R=0;R<u;++R)b[F]=b[N],F+=f,N+=f;O-=T}for(F=O,N=0,R=0;R<u;++R)b[F]=L[N++],F+=f}y(L)}}};function a(p,y){var l=n(y),x=[y,p].join(","),b=o[x];return l?b(l[0],l[1]):b()}var s={"uint32,1,0":function(p,y,l){return function x(b,S,T,M,w,u,f,k,_,D,I){var O=(S-b+1)/6|0,B=b+O,R=S-O,L=b+S>>1,F=L-O,N=L+O,j=B,G=F,rt=L,ct=N,lt=R,tt=b+1,Z=S-1,st=!0,$,Q,nt,Y,q,ot,it,dt,wt,xt=0,Ft=0,Et=0,Nt,te,Jt,Qt,Wt,gt,bt,vt,Ut,Kt,Zt,le,Te,Se,Fe,Oe,ur=k,fr=y(ur),We=y(ur);te=w*j,Jt=w*G,Oe=M;t:for(Nt=0;Nt<k;++Nt){if(it=te+Oe,dt=Jt+Oe,Et=T[it]-T[dt],Et>0){Q=j,j=G,G=Q;break t}if(Et<0)break t;Oe+=D}te=w*ct,Jt=w*lt,Oe=M;t:for(Nt=0;Nt<k;++Nt){if(it=te+Oe,dt=Jt+Oe,Et=T[it]-T[dt],Et>0){Q=ct,ct=lt,lt=Q;break t}if(Et<0)break t;Oe+=D}te=w*j,Jt=w*rt,Oe=M;t:for(Nt=0;Nt<k;++Nt){if(it=te+Oe,dt=Jt+Oe,Et=T[it]-T[dt],Et>0){Q=j,j=rt,rt=Q;break t}if(Et<0)break t;Oe+=D}te=w*G,Jt=w*rt,Oe=M;t:for(Nt=0;Nt<k;++Nt){if(it=te+Oe,dt=Jt+Oe,Et=T[it]-T[dt],Et>0){Q=G,G=rt,rt=Q;break t}if(Et<0)break t;Oe+=D}te=w*j,Jt=w*ct,Oe=M;t:for(Nt=0;Nt<k;++Nt){if(it=te+Oe,dt=Jt+Oe,Et=T[it]-T[dt],Et>0){Q=j,j=ct,ct=Q;break t}if(Et<0)break t;Oe+=D}te=w*rt,Jt=w*ct,Oe=M;t:for(Nt=0;Nt<k;++Nt){if(it=te+Oe,dt=Jt+Oe,Et=T[it]-T[dt],Et>0){Q=rt,rt=ct,ct=Q;break t}if(Et<0)break t;Oe+=D}te=w*G,Jt=w*lt,Oe=M;t:for(Nt=0;Nt<k;++Nt){if(it=te+Oe,dt=Jt+Oe,Et=T[it]-T[dt],Et>0){Q=G,G=lt,lt=Q;break t}if(Et<0)break t;Oe+=D}te=w*G,Jt=w*rt,Oe=M;t:for(Nt=0;Nt<k;++Nt){if(it=te+Oe,dt=Jt+Oe,Et=T[it]-T[dt],Et>0){Q=G,G=rt,rt=Q;break t}if(Et<0)break t;Oe+=D}te=w*ct,Jt=w*lt,Oe=M;t:for(Nt=0;Nt<k;++Nt){if(it=te+Oe,dt=Jt+Oe,Et=T[it]-T[dt],Et>0){Q=ct,ct=lt,lt=Q;break t}if(Et<0)break t;Oe+=D}for(te=w*j,Jt=w*G,Qt=w*rt,Wt=w*ct,gt=w*lt,bt=w*B,vt=w*L,Ut=w*R,Fe=0,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,wt=Qt+Oe,Kt=Wt+Oe,Zt=gt+Oe,le=bt+Oe,Te=vt+Oe,Se=Ut+Oe,fr[Fe]=T[dt],We[Fe]=T[Kt],st=st&&fr[Fe]===We[Fe],nt=T[it],Y=T[wt],q=T[Zt],T[le]=nt,T[Te]=Y,T[Se]=q,++Fe,Oe+=_;for(te=w*F,Jt=w*b,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,T[it]=T[dt],Oe+=_;for(te=w*N,Jt=w*S,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,T[it]=T[dt],Oe+=_;if(st)for(ot=tt;ot<=Z;++ot){it=M+ot*w,Fe=0;t:for(Nt=0;Nt<k;++Nt){if(Et=T[it]-fr[Fe],Et!==0)break t;Fe+=I,it+=D}if(Et!==0)if(Et<0){if(ot!==tt)for(te=w*ot,Jt=w*tt,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,$=T[it],T[it]=T[dt],T[dt]=$,Oe+=_;++tt}else for(;;){it=M+Z*w,Fe=0;t:for(Nt=0;Nt<k;++Nt){if(Et=T[it]-fr[Fe],Et!==0)break t;Fe+=I,it+=D}if(Et>0)Z--;else if(Et<0){for(te=w*ot,Jt=w*tt,Qt=w*Z,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,wt=Qt+Oe,$=T[it],T[it]=T[dt],T[dt]=T[wt],T[wt]=$,Oe+=_;++tt,--Z;break}else{for(te=w*ot,Jt=w*Z,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,$=T[it],T[it]=T[dt],T[dt]=$,Oe+=_;--Z;break}}}else for(ot=tt;ot<=Z;++ot){it=M+ot*w,Fe=0;t:for(Nt=0;Nt<k;++Nt){if(xt=T[it]-fr[Fe],xt!==0)break t;Fe+=I,it+=D}if(xt<0){if(ot!==tt)for(te=w*ot,Jt=w*tt,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,$=T[it],T[it]=T[dt],T[dt]=$,Oe+=_;++tt}else{it=M+ot*w,Fe=0;t:for(Nt=0;Nt<k;++Nt){if(Ft=T[it]-We[Fe],Ft!==0)break t;Fe+=I,it+=D}if(Ft>0)for(;;){it=M+Z*w,Fe=0;t:for(Nt=0;Nt<k;++Nt){if(Et=T[it]-We[Fe],Et!==0)break t;Fe+=I,it+=D}if(Et>0){if(--Z<ot)break;continue}else{it=M+Z*w,Fe=0;t:for(Nt=0;Nt<k;++Nt){if(Et=T[it]-fr[Fe],Et!==0)break t;Fe+=I,it+=D}if(Et<0){for(te=w*ot,Jt=w*tt,Qt=w*Z,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,wt=Qt+Oe,$=T[it],T[it]=T[dt],T[dt]=T[wt],T[wt]=$,Oe+=_;++tt,--Z}else{for(te=w*ot,Jt=w*Z,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,$=T[it],T[it]=T[dt],T[dt]=$,Oe+=_;--Z}break}}}}for(te=w*b,Jt=w*(tt-1),Fe=0,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,T[it]=T[dt],T[dt]=fr[Fe],++Fe,Oe+=_;for(te=w*S,Jt=w*(Z+1),Fe=0,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,T[it]=T[dt],T[dt]=We[Fe],++Fe,Oe+=_;if(tt-2-b<=32?p(b,tt-2,T,M,w,u,f,k,_,D,I):x(b,tt-2,T,M,w,u,f,k,_,D,I),S-(Z+2)<=32?p(Z+2,S,T,M,w,u,f,k,_,D,I):x(Z+2,S,T,M,w,u,f,k,_,D,I),st){l(fr),l(We);return}if(tt<B&&Z>R){t:for(;;){for(it=M+tt*w,Fe=0,Oe=M,Nt=0;Nt<k;++Nt){if(T[it]!==fr[Fe])break t;++Fe,it+=_}++tt}t:for(;;){for(it=M+Z*w,Fe=0,Oe=M,Nt=0;Nt<k;++Nt){if(T[it]!==We[Fe])break t;++Fe,it+=_}--Z}for(ot=tt;ot<=Z;++ot){it=M+ot*w,Fe=0;t:for(Nt=0;Nt<k;++Nt){if(xt=T[it]-fr[Fe],xt!==0)break t;Fe+=I,it+=D}if(xt===0){if(ot!==tt)for(te=w*ot,Jt=w*tt,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,$=T[it],T[it]=T[dt],T[dt]=$,Oe+=_;++tt}else{it=M+ot*w,Fe=0;t:for(Nt=0;Nt<k;++Nt){if(Ft=T[it]-We[Fe],Ft!==0)break t;Fe+=I,it+=D}if(Ft===0)for(;;){it=M+Z*w,Fe=0;t:for(Nt=0;Nt<k;++Nt){if(Et=T[it]-We[Fe],Et!==0)break t;Fe+=I,it+=D}if(Et===0){if(--Z<ot)break;continue}else{it=M+Z*w,Fe=0;t:for(Nt=0;Nt<k;++Nt){if(Et=T[it]-fr[Fe],Et!==0)break t;Fe+=I,it+=D}if(Et<0){for(te=w*ot,Jt=w*tt,Qt=w*Z,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,wt=Qt+Oe,$=T[it],T[it]=T[dt],T[dt]=T[wt],T[wt]=$,Oe+=_;++tt,--Z}else{for(te=w*ot,Jt=w*Z,Oe=M,Nt=0;Nt<k;++Nt)it=te+Oe,dt=Jt+Oe,$=T[it],T[it]=T[dt],T[dt]=$,Oe+=_;--Z}break}}}}}l(fr),l(We),Z-tt<=32?p(tt,Z,T,M,w,u,f,k,_,D,I):x(tt,Z,T,M,w,u,f,k,_,D,I)}}};function h(p,y,l){var x=n(y),b=[y,p].join(","),S=s[b];return p.length>1&&x?S(l,x[0],x[1]):S(l)}var v={"uint32,1,0":function(p,y){return function(l){var x=l.data,b=l.offset|0,S=l.shape,T=l.stride,M=T[0]|0,w=S[0]|0,u=T[1]|0,f=S[1]|0,k=u,_=u,D=1;w<=32?p(0,w-1,x,b,M,u,w,f,k,_,D):y(0,w-1,x,b,M,u,w,f,k,_,D)}}};function m(p,y){var l=[y,p].join(","),x=v[l],b=a(p,y),S=h(p,y,b);return x(b,S)}t.exports=m},446:function(t,e,r){var i=r(7640),n={};function o(a){var s=a.order,h=a.dtype,v=[s,h],m=v.join(":"),p=n[m];return p||(n[m]=p=i(s,h)),p(a),a}t.exports=o},9618:function(t,e,r){var i=r(7163),n=typeof Float64Array<"u";function o(y,l){return y[0]-l[0]}function a(){var y=this.stride,l=new Array(y.length),x;for(x=0;x<l.length;++x)l[x]=[Math.abs(y[x]),x];l.sort(o);var b=new Array(l.length);for(x=0;x<b.length;++x)b[x]=l[x][1];return b}var s={T:function(y){function l(b){this.data=b}var x=l.prototype;return x.dtype=y,x.index=function(){return-1},x.size=0,x.dimension=-1,x.shape=x.stride=x.order=[],x.lo=x.hi=x.transpose=x.step=function(){return new l(this.data)},x.get=x.set=function(){},x.pick=function(){return null},function(b){return new l(b)}},0:function(y,l){function x(S,T){this.data=S,this.offset=T}var b=x.prototype;return b.dtype=y,b.index=function(){return this.offset},b.dimension=0,b.size=1,b.shape=b.stride=b.order=[],b.lo=b.hi=b.transpose=b.step=function(){return new x(this.data,this.offset)},b.pick=function(){return l(this.data)},b.valueOf=b.get=function(){return y==="generic"?this.data.get(this.offset):this.data[this.offset]},b.set=function(S){return y==="generic"?this.data.set(this.offset,S):this.data[this.offset]=S},function(S,T,M,w){return new x(S,w)}},1:function(y,l,x){function b(T,M,w,u){this.data=T,this.shape=[M],this.stride=[w],this.offset=u|0}var S=b.prototype;return S.dtype=y,S.dimension=1,Object.defineProperty(S,"size",{get:function(){return this.shape[0]}}),S.order=[0],S.set=function(T,M){return y==="generic"?this.data.set(this.offset+this.stride[0]*T,M):this.data[this.offset+this.stride[0]*T]=M},S.get=function(T){return y==="generic"?this.data.get(this.offset+this.stride[0]*T):this.data[this.offset+this.stride[0]*T]},S.index=function(T){return this.offset+this.stride[0]*T},S.hi=function(T){return new b(this.data,typeof T!="number"||T<0?this.shape[0]:T|0,this.stride[0],this.offset)},S.lo=function(T){var M=this.offset,w=0,u=this.shape[0],f=this.stride[0];return typeof T=="number"&&T>=0&&(w=T|0,M+=f*w,u-=w),new b(this.data,u,f,M)},S.step=function(T){var M=this.shape[0],w=this.stride[0],u=this.offset,f=0,k=Math.ceil;return typeof T=="number"&&(f=T|0,f<0?(u+=w*(M-1),M=k(-M/f)):M=k(M/f),w*=f),new b(this.data,M,w,u)},S.transpose=function(T){T=T===void 0?0:T|0;var M=this.shape,w=this.stride;return new b(this.data,M[T],w[T],this.offset)},S.pick=function(T){var M=[],w=[],u=this.offset;typeof T=="number"&&T>=0?u=u+this.stride[0]*T|0:(M.push(this.shape[0]),w.push(this.stride[0]));var f=l[M.length+1];return f(this.data,M,w,u)},function(T,M,w,u){return new b(T,M[0],w[0],u)}},2:function(y,l,x){function b(T,M,w,u,f,k){this.data=T,this.shape=[M,w],this.stride=[u,f],this.offset=k|0}var S=b.prototype;return S.dtype=y,S.dimension=2,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(S,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),S.set=function(T,M,w){return y==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*M,w):this.data[this.offset+this.stride[0]*T+this.stride[1]*M]=w},S.get=function(T,M){return y==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*M):this.data[this.offset+this.stride[0]*T+this.stride[1]*M]},S.index=function(T,M){return this.offset+this.stride[0]*T+this.stride[1]*M},S.hi=function(T,M){return new b(this.data,typeof T!="number"||T<0?this.shape[0]:T|0,typeof M!="number"||M<0?this.shape[1]:M|0,this.stride[0],this.stride[1],this.offset)},S.lo=function(T,M){var w=this.offset,u=0,f=this.shape[0],k=this.shape[1],_=this.stride[0],D=this.stride[1];return typeof T=="number"&&T>=0&&(u=T|0,w+=_*u,f-=u),typeof M=="number"&&M>=0&&(u=M|0,w+=D*u,k-=u),new b(this.data,f,k,_,D,w)},S.step=function(T,M){var w=this.shape[0],u=this.shape[1],f=this.stride[0],k=this.stride[1],_=this.offset,D=0,I=Math.ceil;return typeof T=="number"&&(D=T|0,D<0?(_+=f*(w-1),w=I(-w/D)):w=I(w/D),f*=D),typeof M=="number"&&(D=M|0,D<0?(_+=k*(u-1),u=I(-u/D)):u=I(u/D),k*=D),new b(this.data,w,u,f,k,_)},S.transpose=function(T,M){T=T===void 0?0:T|0,M=M===void 0?1:M|0;var w=this.shape,u=this.stride;return new b(this.data,w[T],w[M],u[T],u[M],this.offset)},S.pick=function(T,M){var w=[],u=[],f=this.offset;typeof T=="number"&&T>=0?f=f+this.stride[0]*T|0:(w.push(this.shape[0]),u.push(this.stride[0])),typeof M=="number"&&M>=0?f=f+this.stride[1]*M|0:(w.push(this.shape[1]),u.push(this.stride[1]));var k=l[w.length+1];return k(this.data,w,u,f)},function(T,M,w,u){return new b(T,M[0],M[1],w[0],w[1],u)}},3:function(y,l,x){function b(T,M,w,u,f,k,_,D){this.data=T,this.shape=[M,w,u],this.stride=[f,k,_],this.offset=D|0}var S=b.prototype;return S.dtype=y,S.dimension=3,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(S,"order",{get:function(){var T=Math.abs(this.stride[0]),M=Math.abs(this.stride[1]),w=Math.abs(this.stride[2]);return T>M?M>w?[2,1,0]:T>w?[1,2,0]:[1,0,2]:T>w?[2,0,1]:w>M?[0,1,2]:[0,2,1]}}),S.set=function(T,M,w,u){return y==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w,u):this.data[this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w]=u},S.get=function(T,M,w){return y==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w):this.data[this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w]},S.index=function(T,M,w){return this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w},S.hi=function(T,M,w){return new b(this.data,typeof T!="number"||T<0?this.shape[0]:T|0,typeof M!="number"||M<0?this.shape[1]:M|0,typeof w!="number"||w<0?this.shape[2]:w|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},S.lo=function(T,M,w){var u=this.offset,f=0,k=this.shape[0],_=this.shape[1],D=this.shape[2],I=this.stride[0],O=this.stride[1],B=this.stride[2];return typeof T=="number"&&T>=0&&(f=T|0,u+=I*f,k-=f),typeof M=="number"&&M>=0&&(f=M|0,u+=O*f,_-=f),typeof w=="number"&&w>=0&&(f=w|0,u+=B*f,D-=f),new b(this.data,k,_,D,I,O,B,u)},S.step=function(T,M,w){var u=this.shape[0],f=this.shape[1],k=this.shape[2],_=this.stride[0],D=this.stride[1],I=this.stride[2],O=this.offset,B=0,R=Math.ceil;return typeof T=="number"&&(B=T|0,B<0?(O+=_*(u-1),u=R(-u/B)):u=R(u/B),_*=B),typeof M=="number"&&(B=M|0,B<0?(O+=D*(f-1),f=R(-f/B)):f=R(f/B),D*=B),typeof w=="number"&&(B=w|0,B<0?(O+=I*(k-1),k=R(-k/B)):k=R(k/B),I*=B),new b(this.data,u,f,k,_,D,I,O)},S.transpose=function(T,M,w){T=T===void 0?0:T|0,M=M===void 0?1:M|0,w=w===void 0?2:w|0;var u=this.shape,f=this.stride;return new b(this.data,u[T],u[M],u[w],f[T],f[M],f[w],this.offset)},S.pick=function(T,M,w){var u=[],f=[],k=this.offset;typeof T=="number"&&T>=0?k=k+this.stride[0]*T|0:(u.push(this.shape[0]),f.push(this.stride[0])),typeof M=="number"&&M>=0?k=k+this.stride[1]*M|0:(u.push(this.shape[1]),f.push(this.stride[1])),typeof w=="number"&&w>=0?k=k+this.stride[2]*w|0:(u.push(this.shape[2]),f.push(this.stride[2]));var _=l[u.length+1];return _(this.data,u,f,k)},function(T,M,w,u){return new b(T,M[0],M[1],M[2],w[0],w[1],w[2],u)}},4:function(y,l,x){function b(T,M,w,u,f,k,_,D,I,O){this.data=T,this.shape=[M,w,u,f],this.stride=[k,_,D,I],this.offset=O|0}var S=b.prototype;return S.dtype=y,S.dimension=4,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(S,"order",{get:x}),S.set=function(T,M,w,u,f){return y==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w+this.stride[3]*u,f):this.data[this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w+this.stride[3]*u]=f},S.get=function(T,M,w,u){return y==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w+this.stride[3]*u):this.data[this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w+this.stride[3]*u]},S.index=function(T,M,w,u){return this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w+this.stride[3]*u},S.hi=function(T,M,w,u){return new b(this.data,typeof T!="number"||T<0?this.shape[0]:T|0,typeof M!="number"||M<0?this.shape[1]:M|0,typeof w!="number"||w<0?this.shape[2]:w|0,typeof u!="number"||u<0?this.shape[3]:u|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},S.lo=function(T,M,w,u){var f=this.offset,k=0,_=this.shape[0],D=this.shape[1],I=this.shape[2],O=this.shape[3],B=this.stride[0],R=this.stride[1],L=this.stride[2],F=this.stride[3];return typeof T=="number"&&T>=0&&(k=T|0,f+=B*k,_-=k),typeof M=="number"&&M>=0&&(k=M|0,f+=R*k,D-=k),typeof w=="number"&&w>=0&&(k=w|0,f+=L*k,I-=k),typeof u=="number"&&u>=0&&(k=u|0,f+=F*k,O-=k),new b(this.data,_,D,I,O,B,R,L,F,f)},S.step=function(T,M,w,u){var f=this.shape[0],k=this.shape[1],_=this.shape[2],D=this.shape[3],I=this.stride[0],O=this.stride[1],B=this.stride[2],R=this.stride[3],L=this.offset,F=0,N=Math.ceil;return typeof T=="number"&&(F=T|0,F<0?(L+=I*(f-1),f=N(-f/F)):f=N(f/F),I*=F),typeof M=="number"&&(F=M|0,F<0?(L+=O*(k-1),k=N(-k/F)):k=N(k/F),O*=F),typeof w=="number"&&(F=w|0,F<0?(L+=B*(_-1),_=N(-_/F)):_=N(_/F),B*=F),typeof u=="number"&&(F=u|0,F<0?(L+=R*(D-1),D=N(-D/F)):D=N(D/F),R*=F),new b(this.data,f,k,_,D,I,O,B,R,L)},S.transpose=function(T,M,w,u){T=T===void 0?0:T|0,M=M===void 0?1:M|0,w=w===void 0?2:w|0,u=u===void 0?3:u|0;var f=this.shape,k=this.stride;return new b(this.data,f[T],f[M],f[w],f[u],k[T],k[M],k[w],k[u],this.offset)},S.pick=function(T,M,w,u){var f=[],k=[],_=this.offset;typeof T=="number"&&T>=0?_=_+this.stride[0]*T|0:(f.push(this.shape[0]),k.push(this.stride[0])),typeof M=="number"&&M>=0?_=_+this.stride[1]*M|0:(f.push(this.shape[1]),k.push(this.stride[1])),typeof w=="number"&&w>=0?_=_+this.stride[2]*w|0:(f.push(this.shape[2]),k.push(this.stride[2])),typeof u=="number"&&u>=0?_=_+this.stride[3]*u|0:(f.push(this.shape[3]),k.push(this.stride[3]));var D=l[f.length+1];return D(this.data,f,k,_)},function(T,M,w,u){return new b(T,M[0],M[1],M[2],M[3],w[0],w[1],w[2],w[3],u)}},5:function(y,l,x){function b(T,M,w,u,f,k,_,D,I,O,B,R){this.data=T,this.shape=[M,w,u,f,k],this.stride=[_,D,I,O,B],this.offset=R|0}var S=b.prototype;return S.dtype=y,S.dimension=5,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(S,"order",{get:x}),S.set=function(T,M,w,u,f,k){return y==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w+this.stride[3]*u+this.stride[4]*f,k):this.data[this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w+this.stride[3]*u+this.stride[4]*f]=k},S.get=function(T,M,w,u,f){return y==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w+this.stride[3]*u+this.stride[4]*f):this.data[this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w+this.stride[3]*u+this.stride[4]*f]},S.index=function(T,M,w,u,f){return this.offset+this.stride[0]*T+this.stride[1]*M+this.stride[2]*w+this.stride[3]*u+this.stride[4]*f},S.hi=function(T,M,w,u,f){return new b(this.data,typeof T!="number"||T<0?this.shape[0]:T|0,typeof M!="number"||M<0?this.shape[1]:M|0,typeof w!="number"||w<0?this.shape[2]:w|0,typeof u!="number"||u<0?this.shape[3]:u|0,typeof f!="number"||f<0?this.shape[4]:f|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},S.lo=function(T,M,w,u,f){var k=this.offset,_=0,D=this.shape[0],I=this.shape[1],O=this.shape[2],B=this.shape[3],R=this.shape[4],L=this.stride[0],F=this.stride[1],N=this.stride[2],j=this.stride[3],G=this.stride[4];return typeof T=="number"&&T>=0&&(_=T|0,k+=L*_,D-=_),typeof M=="number"&&M>=0&&(_=M|0,k+=F*_,I-=_),typeof w=="number"&&w>=0&&(_=w|0,k+=N*_,O-=_),typeof u=="number"&&u>=0&&(_=u|0,k+=j*_,B-=_),typeof f=="number"&&f>=0&&(_=f|0,k+=G*_,R-=_),new b(this.data,D,I,O,B,R,L,F,N,j,G,k)},S.step=function(T,M,w,u,f){var k=this.shape[0],_=this.shape[1],D=this.shape[2],I=this.shape[3],O=this.shape[4],B=this.stride[0],R=this.stride[1],L=this.stride[2],F=this.stride[3],N=this.stride[4],j=this.offset,G=0,rt=Math.ceil;return typeof T=="number"&&(G=T|0,G<0?(j+=B*(k-1),k=rt(-k/G)):k=rt(k/G),B*=G),typeof M=="number"&&(G=M|0,G<0?(j+=R*(_-1),_=rt(-_/G)):_=rt(_/G),R*=G),typeof w=="number"&&(G=w|0,G<0?(j+=L*(D-1),D=rt(-D/G)):D=rt(D/G),L*=G),typeof u=="number"&&(G=u|0,G<0?(j+=F*(I-1),I=rt(-I/G)):I=rt(I/G),F*=G),typeof f=="number"&&(G=f|0,G<0?(j+=N*(O-1),O=rt(-O/G)):O=rt(O/G),N*=G),new b(this.data,k,_,D,I,O,B,R,L,F,N,j)},S.transpose=function(T,M,w,u,f){T=T===void 0?0:T|0,M=M===void 0?1:M|0,w=w===void 0?2:w|0,u=u===void 0?3:u|0,f=f===void 0?4:f|0;var k=this.shape,_=this.stride;return new b(this.data,k[T],k[M],k[w],k[u],k[f],_[T],_[M],_[w],_[u],_[f],this.offset)},S.pick=function(T,M,w,u,f){var k=[],_=[],D=this.offset;typeof T=="number"&&T>=0?D=D+this.stride[0]*T|0:(k.push(this.shape[0]),_.push(this.stride[0])),typeof M=="number"&&M>=0?D=D+this.stride[1]*M|0:(k.push(this.shape[1]),_.push(this.stride[1])),typeof w=="number"&&w>=0?D=D+this.stride[2]*w|0:(k.push(this.shape[2]),_.push(this.stride[2])),typeof u=="number"&&u>=0?D=D+this.stride[3]*u|0:(k.push(this.shape[3]),_.push(this.stride[3])),typeof f=="number"&&f>=0?D=D+this.stride[4]*f|0:(k.push(this.shape[4]),_.push(this.stride[4]));var I=l[k.length+1];return I(this.data,k,_,D)},function(T,M,w,u){return new b(T,M[0],M[1],M[2],M[3],M[4],w[0],w[1],w[2],w[3],w[4],u)}}};function h(y,l){var x=l===-1?"T":String(l),b=s[x];return l===-1?b(y):l===0?b(y,m[y][0]):b(y,m[y],a)}function v(y){if(i(y))return"buffer";if(n)switch(Object.prototype.toString.call(y)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(y)?"array":"generic"}var m={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function p(y,l,x,b){if(y===void 0){var f=m.array[0];return f([])}else typeof y=="number"&&(y=[y]);l===void 0&&(l=[y.length]);var S=l.length;if(x===void 0){x=new Array(S);for(var T=S-1,M=1;T>=0;--T)x[T]=M,M*=l[T]}if(b===void 0){b=0;for(var T=0;T<S;++T)x[T]<0&&(b-=(l[T]-1)*x[T])}for(var w=v(y),u=m[w];u.length<=S+1;)u.push(h(w,u.length-1));var f=u[S+1];return f(y,l,x,b)}t.exports=p},1278:function(t,e,r){var i=r(2361),n=Math.pow(2,-1074),o=-1>>>0;t.exports=a;function a(s,h){if(isNaN(s)||isNaN(h))return NaN;if(s===h)return s;if(s===0)return h<0?-n:n;var v=i.hi(s),m=i.lo(s);return h>s==s>0?m===o?(v+=1,m=0):m+=1:m===0?(m=o,v-=1):m-=1,i.pack(m,v)}},8406:function(t,e){var r=1e-6,i=1e-6;e.vertexNormals=function(n,o,a){for(var s=o.length,h=new Array(s),v=a===void 0?r:a,m=0;m<s;++m)h[m]=[0,0,0];for(var m=0;m<n.length;++m)for(var p=n[m],y=0,l=p[p.length-1],x=p[0],b=0;b<p.length;++b){y=l,l=x,x=p[(b+1)%p.length];for(var S=o[y],T=o[l],M=o[x],w=new Array(3),u=0,f=new Array(3),k=0,_=0;_<3;++_)w[_]=S[_]-T[_],u+=w[_]*w[_],f[_]=M[_]-T[_],k+=f[_]*f[_];if(u*k>v)for(var D=h[l],I=1/Math.sqrt(u*k),_=0;_<3;++_){var O=(_+1)%3,B=(_+2)%3;D[_]+=I*(f[O]*w[B]-f[B]*w[O])}}for(var m=0;m<s;++m){for(var D=h[m],R=0,_=0;_<3;++_)R+=D[_]*D[_];if(R>v)for(var I=1/Math.sqrt(R),_=0;_<3;++_)D[_]*=I;else for(var _=0;_<3;++_)D[_]=0}return h},e.faceNormals=function(n,o,a){for(var s=n.length,h=new Array(s),v=a===void 0?i:a,m=0;m<s;++m){for(var p=n[m],y=new Array(3),l=0;l<3;++l)y[l]=o[p[l]];for(var x=new Array(3),b=new Array(3),l=0;l<3;++l)x[l]=y[1][l]-y[0][l],b[l]=y[2][l]-y[0][l];for(var S=new Array(3),T=0,l=0;l<3;++l){var M=(l+1)%3,w=(l+2)%3;S[l]=x[M]*b[w]-x[w]*b[M],T+=S[l]*S[l]}T>v?T=1/Math.sqrt(T):T=0;for(var l=0;l<3;++l)S[l]*=T;h[m]=S}return h}},4081:function(t){t.exports=e;function e(r,i,n,o,a,s,h,v,m,p){var y=i+s+p;if(l>0){var l=Math.sqrt(y+1);r[0]=.5*(h-m)/l,r[1]=.5*(v-o)/l,r[2]=.5*(n-s)/l,r[3]=.5*l}else{var x=Math.max(i,s,p),l=Math.sqrt(2*x-y+1);i>=x?(r[0]=.5*l,r[1]=.5*(a+n)/l,r[2]=.5*(v+o)/l,r[3]=.5*(h-m)/l):s>=x?(r[0]=.5*(n+a)/l,r[1]=.5*l,r[2]=.5*(m+h)/l,r[3]=.5*(v-o)/l):(r[0]=.5*(o+v)/l,r[1]=.5*(h+m)/l,r[2]=.5*l,r[3]=.5*(n-a)/l)}return r}},9977:function(t,e,r){t.exports=l;var i=r(9215),n=r(6582),o=r(7399),a=r(7608),s=r(4081);function h(x,b,S){return Math.sqrt(Math.pow(x,2)+Math.pow(b,2)+Math.pow(S,2))}function v(x,b,S,T){return Math.sqrt(Math.pow(x,2)+Math.pow(b,2)+Math.pow(S,2)+Math.pow(T,2))}function m(x,b){var S=b[0],T=b[1],M=b[2],w=b[3],u=v(S,T,M,w);u>1e-6?(x[0]=S/u,x[1]=T/u,x[2]=M/u,x[3]=w/u):(x[0]=x[1]=x[2]=0,x[3]=1)}function p(x,b,S){this.radius=i([S]),this.center=i(b),this.rotation=i(x),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var y=p.prototype;y.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},y.recalcMatrix=function(x){this.radius.curve(x),this.center.curve(x),this.rotation.curve(x);var b=this.computedRotation;m(b,b);var S=this.computedMatrix;o(S,b);var T=this.computedCenter,M=this.computedEye,w=this.computedUp,u=Math.exp(this.computedRadius[0]);M[0]=T[0]+u*S[2],M[1]=T[1]+u*S[6],M[2]=T[2]+u*S[10],w[0]=S[1],w[1]=S[5],w[2]=S[9];for(var f=0;f<3;++f){for(var k=0,_=0;_<3;++_)k+=S[f+4*_]*M[_];S[12+f]=-k}},y.getMatrix=function(x,b){this.recalcMatrix(x);var S=this.computedMatrix;if(b){for(var T=0;T<16;++T)b[T]=S[T];return b}return S},y.idle=function(x){this.center.idle(x),this.radius.idle(x),this.rotation.idle(x)},y.flush=function(x){this.center.flush(x),this.radius.flush(x),this.rotation.flush(x)},y.pan=function(x,b,S,T){b=b||0,S=S||0,T=T||0,this.recalcMatrix(x);var M=this.computedMatrix,w=M[1],u=M[5],f=M[9],k=h(w,u,f);w/=k,u/=k,f/=k;var _=M[0],D=M[4],I=M[8],O=_*w+D*u+I*f;_-=w*O,D-=u*O,I-=f*O;var B=h(_,D,I);_/=B,D/=B,I/=B,M[2],M[6],M[10];var R=_*b+w*S,L=D*b+u*S,F=I*b+f*S;this.center.move(x,R,L,F);var N=Math.exp(this.computedRadius[0]);N=Math.max(1e-4,N+T),this.radius.set(x,Math.log(N))},y.rotate=function(x,b,S,T){this.recalcMatrix(x),b=b||0,S=S||0;var M=this.computedMatrix,w=M[0],u=M[4],f=M[8],k=M[1],_=M[5],D=M[9],I=M[2],O=M[6],B=M[10],R=b*w+S*k,L=b*u+S*_,F=b*f+S*D,N=-(O*F-B*L),j=-(B*R-I*F),G=-(I*L-O*R),rt=Math.sqrt(Math.max(0,1-Math.pow(N,2)-Math.pow(j,2)-Math.pow(G,2))),ct=v(N,j,G,rt);ct>1e-6?(N/=ct,j/=ct,G/=ct,rt/=ct):(N=j=G=0,rt=1);var lt=this.computedRotation,tt=lt[0],Z=lt[1],st=lt[2],$=lt[3],Q=tt*rt+$*N+Z*G-st*j,nt=Z*rt+$*j+st*N-tt*G,Y=st*rt+$*G+tt*j-Z*N,q=$*rt-tt*N-Z*j-st*G;if(T){N=I,j=O,G=B;var ot=Math.sin(T)/h(N,j,G);N*=ot,j*=ot,G*=ot,rt=Math.cos(b),Q=Q*rt+q*N+nt*G-Y*j,nt=nt*rt+q*j+Y*N-Q*G,Y=Y*rt+q*G+Q*j-nt*N,q=q*rt-Q*N-nt*j-Y*G}var it=v(Q,nt,Y,q);it>1e-6?(Q/=it,nt/=it,Y/=it,q/=it):(Q=nt=Y=0,q=1),this.rotation.set(x,Q,nt,Y,q)},y.lookAt=function(x,b,S,T){this.recalcMatrix(x),S=S||this.computedCenter,b=b||this.computedEye,T=T||this.computedUp;var M=this.computedMatrix;n(M,b,S,T);var w=this.computedRotation;s(w,M[0],M[1],M[2],M[4],M[5],M[6],M[8],M[9],M[10]),m(w,w),this.rotation.set(x,w[0],w[1],w[2],w[3]);for(var u=0,f=0;f<3;++f)u+=Math.pow(S[f]-b[f],2);this.radius.set(x,.5*Math.log(Math.max(u,1e-6))),this.center.set(x,S[0],S[1],S[2])},y.translate=function(x,b,S,T){this.center.move(x,b||0,S||0,T||0)},y.setMatrix=function(x,b){var S=this.computedRotation;s(S,b[0],b[1],b[2],b[4],b[5],b[6],b[8],b[9],b[10]),m(S,S),this.rotation.set(x,S[0],S[1],S[2],S[3]);var T=this.computedMatrix;a(T,b);var M=T[15];if(Math.abs(M)>1e-6){var w=T[12]/M,u=T[13]/M,f=T[14]/M;this.recalcMatrix(x);var k=Math.exp(this.computedRadius[0]);this.center.set(x,w-T[2]*k,u-T[6]*k,f-T[10]*k),this.radius.idle(x)}else this.center.idle(x),this.radius.idle(x)},y.setDistance=function(x,b){b>0&&this.radius.set(x,Math.log(b))},y.setDistanceLimits=function(x,b){x>0?x=Math.log(x):x=-1/0,b>0?b=Math.log(b):b=1/0,b=Math.max(b,x),this.radius.bounds[0][0]=x,this.radius.bounds[1][0]=b},y.getDistanceLimits=function(x){var b=this.radius.bounds;return x?(x[0]=Math.exp(b[0][0]),x[1]=Math.exp(b[1][0]),x):[Math.exp(b[0][0]),Math.exp(b[1][0])]},y.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},y.fromJSON=function(x){var b=this.lastT(),S=x.center;S&&this.center.set(b,S[0],S[1],S[2]);var T=x.rotation;T&&this.rotation.set(b,T[0],T[1],T[2],T[3]);var M=x.distance;M&&M>0&&this.radius.set(b,Math.log(M)),this.setDistanceLimits(x.zoomMin,x.zoomMax)};function l(x){x=x||{};var b=x.center||[0,0,0],S=x.rotation||[0,0,0,1],T=x.radius||1;b=[].slice.call(b,0,3),S=[].slice.call(S,0,4),m(S,S);var M=new p(S,b,Math.log(T));return M.setDistanceLimits(x.zoomMin,x.zoomMax),("eye"in x||"up"in x)&&M.lookAt(0,x.eye,x.center,x.up),M}},1371:function(t,e,r){var i=r(3233);t.exports=function(n,o,a){return a=typeof a<"u"?a+"":" ",i(a,o)+n}},3202:function(t){t.exports=function(e,r){r||(r=[0,""]),e=String(e);var i=parseFloat(e,10);return r[0]=i,r[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",r}},3088:function(t,e,r){t.exports=n;var i=r(3140);function n(o,a){for(var s=a.length|0,h=o.length,v=[new Array(s),new Array(s)],m=0;m<s;++m)v[0][m]=[],v[1][m]=[];for(var m=0;m<h;++m){var p=o[m];v[0][p[0]].push(p),v[1][p[1]].push(p)}for(var y=[],m=0;m<s;++m)v[0][m].length+v[1][m].length===0&&y.push([m]);function l(u,f){var k=v[f][u[f]];k.splice(k.indexOf(u),1)}function x(u,f,k){for(var _,D,I,O=0;O<2;++O)if(v[O][f].length>0){_=v[O][f][0],I=O;break}D=_[I^1];for(var B=0;B<2;++B)for(var R=v[B][f],L=0;L<R.length;++L){var F=R[L],N=F[B^1],j=i(a[u],a[f],a[D],a[N]);j>0&&(_=F,D=N,I=B)}return k||_&&l(_,I),D}function b(u,f){var k=v[f][u][0],_=[u];l(k,f);for(var D=k[f^1],I=f;;){for(;D!==u;)_.push(D),D=x(_[_.length-2],D,!1);if(v[0][u].length+v[1][u].length===0)break;var O=_[_.length-1],B=u,R=_[1],L=x(O,B,!0);if(i(a[O],a[B],a[R],a[L])<0)break;_.push(u),D=x(O,B)}return _}function S(u,f){return f[1]===f[f.length-1]}for(var m=0;m<s;++m)for(var T=0;T<2;++T){for(var M=[];v[T][m].length>0;){v[0][m].length;var w=b(m,T);S(M,w)?M.push.apply(M,w):(M.length>0&&y.push(M),M=w)}M.length>0&&y.push(M)}return y}},5609:function(t,e,r){t.exports=n;var i=r(3134);function n(o,a){for(var s=i(o,a.length),h=new Array(a.length),v=new Array(a.length),m=[],p=0;p<a.length;++p){var y=s[p].length;v[p]=y,h[p]=!0,y<=1&&m.push(p)}for(;m.length>0;){var l=m.pop();h[l]=!1;for(var x=s[l],p=0;p<x.length;++p){var b=x[p];--v[b]===0&&m.push(b)}}for(var S=new Array(a.length),T=[],p=0;p<a.length;++p)if(h[p]){var l=T.length;S[p]=l,T.push(a[p])}else S[p]=-1;for(var M=[],p=0;p<o.length;++p){var w=o[p];h[w[0]]&&h[w[1]]&&M.push([S[w[0]],S[w[1]]])}return[M,T]}},2095:function(t,e,r){t.exports=y;var i=r(3134),n=r(3088),o=r(5085),a=r(5250),s=r(8210),h=r(1682),v=r(5609);function m(l,x){for(var b=new Array(l),S=0;S<l;++S)b[S]=x;return b}function p(l){for(var x=new Array(l),b=0;b<l;++b)x[b]=[];return x}function y(l,x){var b=v(l,x);l=b[0],x=b[1];for(var S=x.length,T=l.length,M=i(l,x.length),w=0;w<S;++w)if(M[w].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var u=n(l,x);function f(Nt){for(var te=Nt.length,Jt=[0],Qt=0;Qt<te;++Qt){var Wt=x[Nt[Qt]],gt=x[Nt[(Qt+1)%te]],bt=a(-Wt[0],Wt[1]),vt=a(-Wt[0],gt[1]),Ut=a(gt[0],Wt[1]),Kt=a(gt[0],gt[1]);Jt=s(Jt,s(s(bt,vt),s(Ut,Kt)))}return Jt[Jt.length-1]>0}u=u.filter(f);for(var k=u.length,_=new Array(k),D=new Array(k),w=0;w<k;++w){_[w]=w;var I=new Array(k),O=u[w].map(function(te){return x[te]}),B=o([O]),R=0;t:for(var L=0;L<k;++L)if(I[L]=0,w!==L){for(var F=u[L],N=F.length,j=0;j<N;++j){var G=B(x[F[j]]);if(G!==0){G<0&&(I[L]=1,R+=1);continue t}}I[L]=1,R+=1}D[w]=[R,w,I]}D.sort(function(Nt,te){return te[0]-Nt[0]});for(var w=0;w<k;++w)for(var I=D[w],rt=I[1],ct=I[2],L=0;L<k;++L)ct[L]&&(_[L]=rt);for(var lt=p(k),w=0;w<k;++w)lt[w].push(_[w]),lt[_[w]].push(w);for(var tt={},Z=m(S,!1),w=0;w<k;++w)for(var F=u[w],N=F.length,L=0;L<N;++L){var st=F[L],$=F[(L+1)%N],Q=Math.min(st,$)+":"+Math.max(st,$);if(Q in tt){var nt=tt[Q];lt[nt].push(w),lt[w].push(nt),Z[st]=Z[$]=!0}else tt[Q]=w}function Y(Nt){for(var te=Nt.length,Jt=0;Jt<te;++Jt)if(!Z[Nt[Jt]])return!1;return!0}for(var q=[],ot=m(k,-1),w=0;w<k;++w)_[w]===w&&!Y(u[w])?(q.push(w),ot[w]=0):ot[w]=-1;for(var b=[];q.length>0;){var it=q.pop(),dt=lt[it];h(dt,function(te,Jt){return te-Jt});var wt=dt.length,xt=ot[it],Ft;if(xt===0){var F=u[it];Ft=[F]}for(var w=0;w<wt;++w){var Et=dt[w];if(!(ot[Et]>=0)&&(ot[Et]=xt^1,q.push(Et),xt===0)){var F=u[Et];Y(F)||(F.reverse(),Ft.push(F))}}xt===0&&b.push(Ft)}return b}},5085:function(t,e,r){t.exports=x;var i=r(3250)[3],n=r(4209),o=r(3352),a=r(2478);function s(){return!0}function h(b){return function(S,T){var M=b[S];return M?!!M.queryPoint(T,s):!1}}function v(b){for(var S={},T=0;T<b.length;++T){var M=b[T],w=M[0][0],u=M[0][1],f=M[1][1],k=[Math.min(u,f),Math.max(u,f)];w in S?S[w].push(k):S[w]=[k]}for(var _={},D=Object.keys(S),T=0;T<D.length;++T){var I=S[D[T]];_[D[T]]=o(I)}return h(_)}function m(b,S){return function(T){var M=a.le(S,T[0]);if(M<0)return 1;var w=b[M];if(!w)if(M>0&&S[M]===T[0])w=b[M-1];else return 1;for(var u=1;w;){var f=w.key,k=i(T,f[0],f[1]);if(f[0][0]<f[1][0])if(k<0)w=w.left;else if(k>0)u=-1,w=w.right;else return 0;else if(k>0)w=w.left;else if(k<0)u=1,w=w.right;else return 0}return u}}function p(b){return 1}function y(b){return function(S){return b(S[0],S[1])?0:1}}function l(b,S){return function(T){return b(T[0],T[1])?0:S(T)}}function x(b){for(var S=b.length,T=[],M=[],w=0,u=0;u<S;++u)for(var f=b[u],k=f.length,_=k-1,D=0;D<k;_=D++){var I=f[_],O=f[D];I[0]===O[0]?M.push([I,O]):T.push([I,O])}if(T.length===0)return M.length===0?p:y(v(M));var B=n(T),R=m(B.slabs,B.coordinates);return M.length===0?R:l(v(M),R)}},9346:function(t){var e=new Float64Array(4),r=new Float64Array(4),i=new Float64Array(4);function n(o,a,s,h,v){e.length<h.length&&(e=new Float64Array(h.length),r=new Float64Array(h.length),i=new Float64Array(h.length));for(var m=0;m<h.length;++m)e[m]=o[m]-h[m],r[m]=a[m]-o[m],i[m]=s[m]-o[m];for(var p=0,y=0,l=0,x=0,b=0,S=0,m=0;m<h.length;++m){var T=r[m],M=i[m],w=e[m];p+=T*T,y+=T*M,l+=M*M,x+=w*T,b+=w*M,S+=w*w}var u=Math.abs(p*l-y*y),f=y*b-l*x,k=y*x-p*b,_;if(f+k<=u)if(f<0)k<0&&x<0?(k=0,-x>=p?(f=1,_=p+2*x+S):(f=-x/p,_=x*f+S)):(f=0,b>=0?(k=0,_=S):-b>=l?(k=1,_=l+2*b+S):(k=-b/l,_=b*k+S));else if(k<0)k=0,x>=0?(f=0,_=S):-x>=p?(f=1,_=p+2*x+S):(f=-x/p,_=x*f+S);else{var D=1/u;f*=D,k*=D,_=f*(p*f+y*k+2*x)+k*(y*f+l*k+2*b)+S}else{var I,O,B,R;f<0?(I=y+x,O=l+b,O>I?(B=O-I,R=p-2*y+l,B>=R?(f=1,k=0,_=p+2*x+S):(f=B/R,k=1-f,_=f*(p*f+y*k+2*x)+k*(y*f+l*k+2*b)+S)):(f=0,O<=0?(k=1,_=l+2*b+S):b>=0?(k=0,_=S):(k=-b/l,_=b*k+S))):k<0?(I=y+b,O=p+x,O>I?(B=O-I,R=p-2*y+l,B>=R?(k=1,f=0,_=l+2*b+S):(k=B/R,f=1-k,_=f*(p*f+y*k+2*x)+k*(y*f+l*k+2*b)+S)):(k=0,O<=0?(f=1,_=p+2*x+S):x>=0?(f=0,_=S):(f=-x/p,_=x*f+S))):(B=l+b-y-x,B<=0?(f=0,k=1,_=l+2*b+S):(R=p-2*y+l,B>=R?(f=1,k=0,_=p+2*x+S):(f=B/R,k=1-f,_=f*(p*f+y*k+2*x)+k*(y*f+l*k+2*b)+S)))}for(var L=1-f-k,m=0;m<h.length;++m)v[m]=L*o[m]+f*a[m]+k*s[m];return _<0?0:_}t.exports=n},8648:function(t,e,r){t.exports=r(783)},2653:function(t,e,r){var i=r(3865);t.exports=n;function n(o,a){for(var s=o.length,h=new Array(s),v=0;v<s;++v)h[v]=i(o[v],a[v]);return h}},5838:function(t,e,r){t.exports=n;var i=r(7842);function n(o){for(var a=new Array(o.length),s=0;s<o.length;++s)a[s]=i(o[s]);return a}},8987:function(t,e,r){var i=r(7842),n=r(6504);t.exports=o;function o(a,s){for(var h=i(s),v=a.length,m=new Array(v),p=0;p<v;++p)m[p]=n(a[p],h);return m}},544:function(t,e,r){var i=r(5572);t.exports=n;function n(o,a){for(var s=o.length,h=new Array(s),v=0;v<s;++v)h[v]=i(o[v],a[v]);return h}},5771:function(t,e,r){var i=r(8507),n=r(3788),o=r(2419);t.exports=a;function a(s){s.sort(n);for(var h=s.length,v=0,m=0;m<h;++m){var p=s[m],y=o(p);if(y!==0){if(v>0){var l=s[v-1];if(i(p,l)===0&&o(l)!==y){v-=1;continue}}s[v++]=p}}return s.length=v,s}},3233:function(t){var e="",r;t.exports=i;function i(n,o){if(typeof n!="string")throw new TypeError("expected a string");if(o===1)return n;if(o===2)return n+n;var a=n.length*o;if(r!==n||typeof r>"u")r=n,e="";else if(e.length>=a)return e.substr(0,a);for(;a>e.length&&o>1;)o&1&&(e+=n),o>>=1,n+=n;return e+=n,e=e.substr(0,a),e}},3025:function(t,e,r){t.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(t){t.exports=e;function e(r){for(var i=r.length,n=r[r.length-1],o=i,a=i-2;a>=0;--a){var s=n,h=r[a];n=s+h;var v=n-s,m=h-v;m&&(r[--o]=n,n=m)}for(var p=0,a=o;a<i;++a){var s=r[a],h=n;n=s+h;var v=n-s,m=h-v;m&&(r[p++]=m)}return r[p++]=n,r.length=p,r}},2962:function(t,e,r){var i=r(5250),n=r(8210),o=r(3012),a=r(7004),s=6;function h(S,T,M,w){return function(u){return w(S(M(u[0][0],u[1][1]),M(-u[0][1],u[1][0])))}}function v(S,T,M,w){return function(u){return w(S(T(S(M(u[1][1],u[2][2]),M(-u[1][2],u[2][1])),u[0][0]),S(T(S(M(u[1][0],u[2][2]),M(-u[1][2],u[2][0])),-u[0][1]),T(S(M(u[1][0],u[2][1]),M(-u[1][1],u[2][0])),u[0][2]))))}}function m(S,T,M,w){return function(u){return w(S(S(T(S(T(S(M(u[2][2],u[3][3]),M(-u[2][3],u[3][2])),u[1][1]),S(T(S(M(u[2][1],u[3][3]),M(-u[2][3],u[3][1])),-u[1][2]),T(S(M(u[2][1],u[3][2]),M(-u[2][2],u[3][1])),u[1][3]))),u[0][0]),T(S(T(S(M(u[2][2],u[3][3]),M(-u[2][3],u[3][2])),u[1][0]),S(T(S(M(u[2][0],u[3][3]),M(-u[2][3],u[3][0])),-u[1][2]),T(S(M(u[2][0],u[3][2]),M(-u[2][2],u[3][0])),u[1][3]))),-u[0][1])),S(T(S(T(S(M(u[2][1],u[3][3]),M(-u[2][3],u[3][1])),u[1][0]),S(T(S(M(u[2][0],u[3][3]),M(-u[2][3],u[3][0])),-u[1][1]),T(S(M(u[2][0],u[3][1]),M(-u[2][1],u[3][0])),u[1][3]))),u[0][2]),T(S(T(S(M(u[2][1],u[3][2]),M(-u[2][2],u[3][1])),u[1][0]),S(T(S(M(u[2][0],u[3][2]),M(-u[2][2],u[3][0])),-u[1][1]),T(S(M(u[2][0],u[3][1]),M(-u[2][1],u[3][0])),u[1][2]))),-u[0][3]))))}}function p(S,T,M,w){return function(u){return w(S(S(T(S(S(T(S(T(S(M(u[3][3],u[4][4]),M(-u[3][4],u[4][3])),u[2][2]),S(T(S(M(u[3][2],u[4][4]),M(-u[3][4],u[4][2])),-u[2][3]),T(S(M(u[3][2],u[4][3]),M(-u[3][3],u[4][2])),u[2][4]))),u[1][1]),T(S(T(S(M(u[3][3],u[4][4]),M(-u[3][4],u[4][3])),u[2][1]),S(T(S(M(u[3][1],u[4][4]),M(-u[3][4],u[4][1])),-u[2][3]),T(S(M(u[3][1],u[4][3]),M(-u[3][3],u[4][1])),u[2][4]))),-u[1][2])),S(T(S(T(S(M(u[3][2],u[4][4]),M(-u[3][4],u[4][2])),u[2][1]),S(T(S(M(u[3][1],u[4][4]),M(-u[3][4],u[4][1])),-u[2][2]),T(S(M(u[3][1],u[4][2]),M(-u[3][2],u[4][1])),u[2][4]))),u[1][3]),T(S(T(S(M(u[3][2],u[4][3]),M(-u[3][3],u[4][2])),u[2][1]),S(T(S(M(u[3][1],u[4][3]),M(-u[3][3],u[4][1])),-u[2][2]),T(S(M(u[3][1],u[4][2]),M(-u[3][2],u[4][1])),u[2][3]))),-u[1][4]))),u[0][0]),T(S(S(T(S(T(S(M(u[3][3],u[4][4]),M(-u[3][4],u[4][3])),u[2][2]),S(T(S(M(u[3][2],u[4][4]),M(-u[3][4],u[4][2])),-u[2][3]),T(S(M(u[3][2],u[4][3]),M(-u[3][3],u[4][2])),u[2][4]))),u[1][0]),T(S(T(S(M(u[3][3],u[4][4]),M(-u[3][4],u[4][3])),u[2][0]),S(T(S(M(u[3][0],u[4][4]),M(-u[3][4],u[4][0])),-u[2][3]),T(S(M(u[3][0],u[4][3]),M(-u[3][3],u[4][0])),u[2][4]))),-u[1][2])),S(T(S(T(S(M(u[3][2],u[4][4]),M(-u[3][4],u[4][2])),u[2][0]),S(T(S(M(u[3][0],u[4][4]),M(-u[3][4],u[4][0])),-u[2][2]),T(S(M(u[3][0],u[4][2]),M(-u[3][2],u[4][0])),u[2][4]))),u[1][3]),T(S(T(S(M(u[3][2],u[4][3]),M(-u[3][3],u[4][2])),u[2][0]),S(T(S(M(u[3][0],u[4][3]),M(-u[3][3],u[4][0])),-u[2][2]),T(S(M(u[3][0],u[4][2]),M(-u[3][2],u[4][0])),u[2][3]))),-u[1][4]))),-u[0][1])),S(T(S(S(T(S(T(S(M(u[3][3],u[4][4]),M(-u[3][4],u[4][3])),u[2][1]),S(T(S(M(u[3][1],u[4][4]),M(-u[3][4],u[4][1])),-u[2][3]),T(S(M(u[3][1],u[4][3]),M(-u[3][3],u[4][1])),u[2][4]))),u[1][0]),T(S(T(S(M(u[3][3],u[4][4]),M(-u[3][4],u[4][3])),u[2][0]),S(T(S(M(u[3][0],u[4][4]),M(-u[3][4],u[4][0])),-u[2][3]),T(S(M(u[3][0],u[4][3]),M(-u[3][3],u[4][0])),u[2][4]))),-u[1][1])),S(T(S(T(S(M(u[3][1],u[4][4]),M(-u[3][4],u[4][1])),u[2][0]),S(T(S(M(u[3][0],u[4][4]),M(-u[3][4],u[4][0])),-u[2][1]),T(S(M(u[3][0],u[4][1]),M(-u[3][1],u[4][0])),u[2][4]))),u[1][3]),T(S(T(S(M(u[3][1],u[4][3]),M(-u[3][3],u[4][1])),u[2][0]),S(T(S(M(u[3][0],u[4][3]),M(-u[3][3],u[4][0])),-u[2][1]),T(S(M(u[3][0],u[4][1]),M(-u[3][1],u[4][0])),u[2][3]))),-u[1][4]))),u[0][2]),S(T(S(S(T(S(T(S(M(u[3][2],u[4][4]),M(-u[3][4],u[4][2])),u[2][1]),S(T(S(M(u[3][1],u[4][4]),M(-u[3][4],u[4][1])),-u[2][2]),T(S(M(u[3][1],u[4][2]),M(-u[3][2],u[4][1])),u[2][4]))),u[1][0]),T(S(T(S(M(u[3][2],u[4][4]),M(-u[3][4],u[4][2])),u[2][0]),S(T(S(M(u[3][0],u[4][4]),M(-u[3][4],u[4][0])),-u[2][2]),T(S(M(u[3][0],u[4][2]),M(-u[3][2],u[4][0])),u[2][4]))),-u[1][1])),S(T(S(T(S(M(u[3][1],u[4][4]),M(-u[3][4],u[4][1])),u[2][0]),S(T(S(M(u[3][0],u[4][4]),M(-u[3][4],u[4][0])),-u[2][1]),T(S(M(u[3][0],u[4][1]),M(-u[3][1],u[4][0])),u[2][4]))),u[1][2]),T(S(T(S(M(u[3][1],u[4][2]),M(-u[3][2],u[4][1])),u[2][0]),S(T(S(M(u[3][0],u[4][2]),M(-u[3][2],u[4][0])),-u[2][1]),T(S(M(u[3][0],u[4][1]),M(-u[3][1],u[4][0])),u[2][2]))),-u[1][4]))),-u[0][3]),T(S(S(T(S(T(S(M(u[3][2],u[4][3]),M(-u[3][3],u[4][2])),u[2][1]),S(T(S(M(u[3][1],u[4][3]),M(-u[3][3],u[4][1])),-u[2][2]),T(S(M(u[3][1],u[4][2]),M(-u[3][2],u[4][1])),u[2][3]))),u[1][0]),T(S(T(S(M(u[3][2],u[4][3]),M(-u[3][3],u[4][2])),u[2][0]),S(T(S(M(u[3][0],u[4][3]),M(-u[3][3],u[4][0])),-u[2][2]),T(S(M(u[3][0],u[4][2]),M(-u[3][2],u[4][0])),u[2][3]))),-u[1][1])),S(T(S(T(S(M(u[3][1],u[4][3]),M(-u[3][3],u[4][1])),u[2][0]),S(T(S(M(u[3][0],u[4][3]),M(-u[3][3],u[4][0])),-u[2][1]),T(S(M(u[3][0],u[4][1]),M(-u[3][1],u[4][0])),u[2][3]))),u[1][2]),T(S(T(S(M(u[3][1],u[4][2]),M(-u[3][2],u[4][1])),u[2][0]),S(T(S(M(u[3][0],u[4][2]),M(-u[3][2],u[4][0])),-u[2][1]),T(S(M(u[3][0],u[4][1]),M(-u[3][1],u[4][0])),u[2][2]))),-u[1][3]))),u[0][4])))))}}function y(S){var T=S===2?h:S===3?v:S===4?m:S===5?p:void 0;return T(n,o,i,a)}var l=[function(){return[0]},function(S){return[S[0][0]]}];function x(S,T,M,w,u,f,k,_){return function(D){switch(D.length){case 0:return S(D);case 1:return T(D);case 2:return M(D);case 3:return w(D);case 4:return u(D);case 5:return f(D)}var I=k[D.length];return I||(I=k[D.length]=_(D.length)),I(D)}}function b(){for(;l.length<s;)l.push(y(l.length));t.exports=x.apply(void 0,l.concat([l,y]));for(var S=0;S<l.length;++S)t.exports[S]=l[S]}b()},1944:function(t,e,r){var i=r(5250),n=r(8210);t.exports=o;function o(a,s){for(var h=i(a[0],s[0]),v=1;v<a.length;++v)h=n(h,i(a[v],s[v]));return h}},2646:function(t,e,r){var i=r(5250),n=r(8210),o=r(8545),a=r(3012),s=6;function h(u){var f=u===3?y:u===4?l:u===5?x:b;return f(n,o,i,a)}function v(){return 0}function m(){return 0}function p(){return 0}function y(u,f,k,_){function D(I,O,B){var R=k(I[0],I[0]),L=_(R,O[0]),F=_(R,B[0]),N=k(O[0],O[0]),j=_(N,I[0]),G=_(N,B[0]),rt=k(B[0],B[0]),ct=_(rt,I[0]),lt=_(rt,O[0]),tt=u(f(lt,G),f(j,L)),Z=f(ct,F),st=f(tt,Z);return st[st.length-1]}return D}function l(u,f,k,_){function D(I,O,B,R){var L=u(k(I[0],I[0]),k(I[1],I[1])),F=_(L,O[0]),N=_(L,B[0]),j=_(L,R[0]),G=u(k(O[0],O[0]),k(O[1],O[1])),rt=_(G,I[0]),ct=_(G,B[0]),lt=_(G,R[0]),tt=u(k(B[0],B[0]),k(B[1],B[1])),Z=_(tt,I[0]),st=_(tt,O[0]),$=_(tt,R[0]),Q=u(k(R[0],R[0]),k(R[1],R[1])),nt=_(Q,I[0]),Y=_(Q,O[0]),q=_(Q,B[0]),ot=u(u(_(f(q,$),O[1]),u(_(f(Y,lt),-B[1]),_(f(st,ct),R[1]))),u(_(f(Y,lt),I[1]),u(_(f(nt,j),-O[1]),_(f(rt,F),R[1])))),it=u(u(_(f(q,$),I[1]),u(_(f(nt,j),-B[1]),_(f(Z,N),R[1]))),u(_(f(st,ct),I[1]),u(_(f(Z,N),-O[1]),_(f(rt,F),B[1])))),dt=f(ot,it);return dt[dt.length-1]}return D}function x(u,f,k,_){function D(I,O,B,R,L){var F=u(k(I[0],I[0]),u(k(I[1],I[1]),k(I[2],I[2]))),N=_(F,O[0]),j=_(F,B[0]),G=_(F,R[0]),rt=_(F,L[0]),ct=u(k(O[0],O[0]),u(k(O[1],O[1]),k(O[2],O[2]))),lt=_(ct,I[0]),tt=_(ct,B[0]),Z=_(ct,R[0]),st=_(ct,L[0]),$=u(k(B[0],B[0]),u(k(B[1],B[1]),k(B[2],B[2]))),Q=_($,I[0]),nt=_($,O[0]),Y=_($,R[0]),q=_($,L[0]),ot=u(k(R[0],R[0]),u(k(R[1],R[1]),k(R[2],R[2]))),it=_(ot,I[0]),dt=_(ot,O[0]),wt=_(ot,B[0]),xt=_(ot,L[0]),Ft=u(k(L[0],L[0]),u(k(L[1],L[1]),k(L[2],L[2]))),Et=_(Ft,I[0]),Nt=_(Ft,O[0]),te=_(Ft,B[0]),Jt=_(Ft,R[0]),Qt=u(u(u(_(u(_(f(Jt,xt),B[1]),u(_(f(te,q),-R[1]),_(f(wt,Y),L[1]))),O[2]),u(_(u(_(f(Jt,xt),O[1]),u(_(f(Nt,st),-R[1]),_(f(dt,Z),L[1]))),-B[2]),_(u(_(f(te,q),O[1]),u(_(f(Nt,st),-B[1]),_(f(nt,tt),L[1]))),R[2]))),u(_(u(_(f(wt,Y),O[1]),u(_(f(dt,Z),-B[1]),_(f(nt,tt),R[1]))),-L[2]),u(_(u(_(f(Jt,xt),O[1]),u(_(f(Nt,st),-R[1]),_(f(dt,Z),L[1]))),I[2]),_(u(_(f(Jt,xt),I[1]),u(_(f(Et,rt),-R[1]),_(f(it,G),L[1]))),-O[2])))),u(u(_(u(_(f(Nt,st),I[1]),u(_(f(Et,rt),-O[1]),_(f(lt,N),L[1]))),R[2]),u(_(u(_(f(dt,Z),I[1]),u(_(f(it,G),-O[1]),_(f(lt,N),R[1]))),-L[2]),_(u(_(f(wt,Y),O[1]),u(_(f(dt,Z),-B[1]),_(f(nt,tt),R[1]))),I[2]))),u(_(u(_(f(wt,Y),I[1]),u(_(f(it,G),-B[1]),_(f(Q,j),R[1]))),-O[2]),u(_(u(_(f(dt,Z),I[1]),u(_(f(it,G),-O[1]),_(f(lt,N),R[1]))),B[2]),_(u(_(f(nt,tt),I[1]),u(_(f(Q,j),-O[1]),_(f(lt,N),B[1]))),-R[2]))))),Wt=u(u(u(_(u(_(f(Jt,xt),B[1]),u(_(f(te,q),-R[1]),_(f(wt,Y),L[1]))),I[2]),_(u(_(f(Jt,xt),I[1]),u(_(f(Et,rt),-R[1]),_(f(it,G),L[1]))),-B[2])),u(_(u(_(f(te,q),I[1]),u(_(f(Et,rt),-B[1]),_(f(Q,j),L[1]))),R[2]),_(u(_(f(wt,Y),I[1]),u(_(f(it,G),-B[1]),_(f(Q,j),R[1]))),-L[2]))),u(u(_(u(_(f(te,q),O[1]),u(_(f(Nt,st),-B[1]),_(f(nt,tt),L[1]))),I[2]),_(u(_(f(te,q),I[1]),u(_(f(Et,rt),-B[1]),_(f(Q,j),L[1]))),-O[2])),u(_(u(_(f(Nt,st),I[1]),u(_(f(Et,rt),-O[1]),_(f(lt,N),L[1]))),B[2]),_(u(_(f(nt,tt),I[1]),u(_(f(Q,j),-O[1]),_(f(lt,N),B[1]))),-L[2])))),gt=f(Qt,Wt);return gt[gt.length-1]}return D}function b(u,f,k,_){function D(I,O,B,R,L,F){var N=u(u(k(I[0],I[0]),k(I[1],I[1])),u(k(I[2],I[2]),k(I[3],I[3]))),j=_(N,O[0]),G=_(N,B[0]),rt=_(N,R[0]),ct=_(N,L[0]),lt=_(N,F[0]),tt=u(u(k(O[0],O[0]),k(O[1],O[1])),u(k(O[2],O[2]),k(O[3],O[3]))),Z=_(tt,I[0]),st=_(tt,B[0]),$=_(tt,R[0]),Q=_(tt,L[0]),nt=_(tt,F[0]),Y=u(u(k(B[0],B[0]),k(B[1],B[1])),u(k(B[2],B[2]),k(B[3],B[3]))),q=_(Y,I[0]),ot=_(Y,O[0]),it=_(Y,R[0]),dt=_(Y,L[0]),wt=_(Y,F[0]),xt=u(u(k(R[0],R[0]),k(R[1],R[1])),u(k(R[2],R[2]),k(R[3],R[3]))),Ft=_(xt,I[0]),Et=_(xt,O[0]),Nt=_(xt,B[0]),te=_(xt,L[0]),Jt=_(xt,F[0]),Qt=u(u(k(L[0],L[0]),k(L[1],L[1])),u(k(L[2],L[2]),k(L[3],L[3]))),Wt=_(Qt,I[0]),gt=_(Qt,O[0]),bt=_(Qt,B[0]),vt=_(Qt,R[0]),Ut=_(Qt,F[0]),Kt=u(u(k(F[0],F[0]),k(F[1],F[1])),u(k(F[2],F[2]),k(F[3],F[3]))),Zt=_(Kt,I[0]),le=_(Kt,O[0]),Te=_(Kt,B[0]),Se=_(Kt,R[0]),Fe=_(Kt,L[0]),Oe=u(u(u(_(u(u(_(u(_(f(Fe,Ut),R[1]),u(_(f(Se,Jt),-L[1]),_(f(vt,te),F[1]))),B[2]),_(u(_(f(Fe,Ut),B[1]),u(_(f(Te,wt),-L[1]),_(f(bt,dt),F[1]))),-R[2])),u(_(u(_(f(Se,Jt),B[1]),u(_(f(Te,wt),-R[1]),_(f(Nt,it),F[1]))),L[2]),_(u(_(f(vt,te),B[1]),u(_(f(bt,dt),-R[1]),_(f(Nt,it),L[1]))),-F[2]))),O[3]),u(_(u(u(_(u(_(f(Fe,Ut),R[1]),u(_(f(Se,Jt),-L[1]),_(f(vt,te),F[1]))),O[2]),_(u(_(f(Fe,Ut),O[1]),u(_(f(le,nt),-L[1]),_(f(gt,Q),F[1]))),-R[2])),u(_(u(_(f(Se,Jt),O[1]),u(_(f(le,nt),-R[1]),_(f(Et,$),F[1]))),L[2]),_(u(_(f(vt,te),O[1]),u(_(f(gt,Q),-R[1]),_(f(Et,$),L[1]))),-F[2]))),-B[3]),_(u(u(_(u(_(f(Fe,Ut),B[1]),u(_(f(Te,wt),-L[1]),_(f(bt,dt),F[1]))),O[2]),_(u(_(f(Fe,Ut),O[1]),u(_(f(le,nt),-L[1]),_(f(gt,Q),F[1]))),-B[2])),u(_(u(_(f(Te,wt),O[1]),u(_(f(le,nt),-B[1]),_(f(ot,st),F[1]))),L[2]),_(u(_(f(bt,dt),O[1]),u(_(f(gt,Q),-B[1]),_(f(ot,st),L[1]))),-F[2]))),R[3]))),u(u(_(u(u(_(u(_(f(Se,Jt),B[1]),u(_(f(Te,wt),-R[1]),_(f(Nt,it),F[1]))),O[2]),_(u(_(f(Se,Jt),O[1]),u(_(f(le,nt),-R[1]),_(f(Et,$),F[1]))),-B[2])),u(_(u(_(f(Te,wt),O[1]),u(_(f(le,nt),-B[1]),_(f(ot,st),F[1]))),R[2]),_(u(_(f(Nt,it),O[1]),u(_(f(Et,$),-B[1]),_(f(ot,st),R[1]))),-F[2]))),-L[3]),_(u(u(_(u(_(f(vt,te),B[1]),u(_(f(bt,dt),-R[1]),_(f(Nt,it),L[1]))),O[2]),_(u(_(f(vt,te),O[1]),u(_(f(gt,Q),-R[1]),_(f(Et,$),L[1]))),-B[2])),u(_(u(_(f(bt,dt),O[1]),u(_(f(gt,Q),-B[1]),_(f(ot,st),L[1]))),R[2]),_(u(_(f(Nt,it),O[1]),u(_(f(Et,$),-B[1]),_(f(ot,st),R[1]))),-L[2]))),F[3])),u(_(u(u(_(u(_(f(Fe,Ut),R[1]),u(_(f(Se,Jt),-L[1]),_(f(vt,te),F[1]))),O[2]),_(u(_(f(Fe,Ut),O[1]),u(_(f(le,nt),-L[1]),_(f(gt,Q),F[1]))),-R[2])),u(_(u(_(f(Se,Jt),O[1]),u(_(f(le,nt),-R[1]),_(f(Et,$),F[1]))),L[2]),_(u(_(f(vt,te),O[1]),u(_(f(gt,Q),-R[1]),_(f(Et,$),L[1]))),-F[2]))),I[3]),_(u(u(_(u(_(f(Fe,Ut),R[1]),u(_(f(Se,Jt),-L[1]),_(f(vt,te),F[1]))),I[2]),_(u(_(f(Fe,Ut),I[1]),u(_(f(Zt,lt),-L[1]),_(f(Wt,ct),F[1]))),-R[2])),u(_(u(_(f(Se,Jt),I[1]),u(_(f(Zt,lt),-R[1]),_(f(Ft,rt),F[1]))),L[2]),_(u(_(f(vt,te),I[1]),u(_(f(Wt,ct),-R[1]),_(f(Ft,rt),L[1]))),-F[2]))),-O[3])))),u(u(u(_(u(u(_(u(_(f(Fe,Ut),O[1]),u(_(f(le,nt),-L[1]),_(f(gt,Q),F[1]))),I[2]),_(u(_(f(Fe,Ut),I[1]),u(_(f(Zt,lt),-L[1]),_(f(Wt,ct),F[1]))),-O[2])),u(_(u(_(f(le,nt),I[1]),u(_(f(Zt,lt),-O[1]),_(f(Z,j),F[1]))),L[2]),_(u(_(f(gt,Q),I[1]),u(_(f(Wt,ct),-O[1]),_(f(Z,j),L[1]))),-F[2]))),R[3]),_(u(u(_(u(_(f(Se,Jt),O[1]),u(_(f(le,nt),-R[1]),_(f(Et,$),F[1]))),I[2]),_(u(_(f(Se,Jt),I[1]),u(_(f(Zt,lt),-R[1]),_(f(Ft,rt),F[1]))),-O[2])),u(_(u(_(f(le,nt),I[1]),u(_(f(Zt,lt),-O[1]),_(f(Z,j),F[1]))),R[2]),_(u(_(f(Et,$),I[1]),u(_(f(Ft,rt),-O[1]),_(f(Z,j),R[1]))),-F[2]))),-L[3])),u(_(u(u(_(u(_(f(vt,te),O[1]),u(_(f(gt,Q),-R[1]),_(f(Et,$),L[1]))),I[2]),_(u(_(f(vt,te),I[1]),u(_(f(Wt,ct),-R[1]),_(f(Ft,rt),L[1]))),-O[2])),u(_(u(_(f(gt,Q),I[1]),u(_(f(Wt,ct),-O[1]),_(f(Z,j),L[1]))),R[2]),_(u(_(f(Et,$),I[1]),u(_(f(Ft,rt),-O[1]),_(f(Z,j),R[1]))),-L[2]))),F[3]),_(u(u(_(u(_(f(Se,Jt),B[1]),u(_(f(Te,wt),-R[1]),_(f(Nt,it),F[1]))),O[2]),_(u(_(f(Se,Jt),O[1]),u(_(f(le,nt),-R[1]),_(f(Et,$),F[1]))),-B[2])),u(_(u(_(f(Te,wt),O[1]),u(_(f(le,nt),-B[1]),_(f(ot,st),F[1]))),R[2]),_(u(_(f(Nt,it),O[1]),u(_(f(Et,$),-B[1]),_(f(ot,st),R[1]))),-F[2]))),I[3]))),u(u(_(u(u(_(u(_(f(Se,Jt),B[1]),u(_(f(Te,wt),-R[1]),_(f(Nt,it),F[1]))),I[2]),_(u(_(f(Se,Jt),I[1]),u(_(f(Zt,lt),-R[1]),_(f(Ft,rt),F[1]))),-B[2])),u(_(u(_(f(Te,wt),I[1]),u(_(f(Zt,lt),-B[1]),_(f(q,G),F[1]))),R[2]),_(u(_(f(Nt,it),I[1]),u(_(f(Ft,rt),-B[1]),_(f(q,G),R[1]))),-F[2]))),-O[3]),_(u(u(_(u(_(f(Se,Jt),O[1]),u(_(f(le,nt),-R[1]),_(f(Et,$),F[1]))),I[2]),_(u(_(f(Se,Jt),I[1]),u(_(f(Zt,lt),-R[1]),_(f(Ft,rt),F[1]))),-O[2])),u(_(u(_(f(le,nt),I[1]),u(_(f(Zt,lt),-O[1]),_(f(Z,j),F[1]))),R[2]),_(u(_(f(Et,$),I[1]),u(_(f(Ft,rt),-O[1]),_(f(Z,j),R[1]))),-F[2]))),B[3])),u(_(u(u(_(u(_(f(Te,wt),O[1]),u(_(f(le,nt),-B[1]),_(f(ot,st),F[1]))),I[2]),_(u(_(f(Te,wt),I[1]),u(_(f(Zt,lt),-B[1]),_(f(q,G),F[1]))),-O[2])),u(_(u(_(f(le,nt),I[1]),u(_(f(Zt,lt),-O[1]),_(f(Z,j),F[1]))),B[2]),_(u(_(f(ot,st),I[1]),u(_(f(q,G),-O[1]),_(f(Z,j),B[1]))),-F[2]))),-R[3]),_(u(u(_(u(_(f(Nt,it),O[1]),u(_(f(Et,$),-B[1]),_(f(ot,st),R[1]))),I[2]),_(u(_(f(Nt,it),I[1]),u(_(f(Ft,rt),-B[1]),_(f(q,G),R[1]))),-O[2])),u(_(u(_(f(Et,$),I[1]),u(_(f(Ft,rt),-O[1]),_(f(Z,j),R[1]))),B[2]),_(u(_(f(ot,st),I[1]),u(_(f(q,G),-O[1]),_(f(Z,j),B[1]))),-R[2]))),F[3]))))),ur=u(u(u(_(u(u(_(u(_(f(Fe,Ut),R[1]),u(_(f(Se,Jt),-L[1]),_(f(vt,te),F[1]))),B[2]),_(u(_(f(Fe,Ut),B[1]),u(_(f(Te,wt),-L[1]),_(f(bt,dt),F[1]))),-R[2])),u(_(u(_(f(Se,Jt),B[1]),u(_(f(Te,wt),-R[1]),_(f(Nt,it),F[1]))),L[2]),_(u(_(f(vt,te),B[1]),u(_(f(bt,dt),-R[1]),_(f(Nt,it),L[1]))),-F[2]))),I[3]),u(_(u(u(_(u(_(f(Fe,Ut),R[1]),u(_(f(Se,Jt),-L[1]),_(f(vt,te),F[1]))),I[2]),_(u(_(f(Fe,Ut),I[1]),u(_(f(Zt,lt),-L[1]),_(f(Wt,ct),F[1]))),-R[2])),u(_(u(_(f(Se,Jt),I[1]),u(_(f(Zt,lt),-R[1]),_(f(Ft,rt),F[1]))),L[2]),_(u(_(f(vt,te),I[1]),u(_(f(Wt,ct),-R[1]),_(f(Ft,rt),L[1]))),-F[2]))),-B[3]),_(u(u(_(u(_(f(Fe,Ut),B[1]),u(_(f(Te,wt),-L[1]),_(f(bt,dt),F[1]))),I[2]),_(u(_(f(Fe,Ut),I[1]),u(_(f(Zt,lt),-L[1]),_(f(Wt,ct),F[1]))),-B[2])),u(_(u(_(f(Te,wt),I[1]),u(_(f(Zt,lt),-B[1]),_(f(q,G),F[1]))),L[2]),_(u(_(f(bt,dt),I[1]),u(_(f(Wt,ct),-B[1]),_(f(q,G),L[1]))),-F[2]))),R[3]))),u(u(_(u(u(_(u(_(f(Se,Jt),B[1]),u(_(f(Te,wt),-R[1]),_(f(Nt,it),F[1]))),I[2]),_(u(_(f(Se,Jt),I[1]),u(_(f(Zt,lt),-R[1]),_(f(Ft,rt),F[1]))),-B[2])),u(_(u(_(f(Te,wt),I[1]),u(_(f(Zt,lt),-B[1]),_(f(q,G),F[1]))),R[2]),_(u(_(f(Nt,it),I[1]),u(_(f(Ft,rt),-B[1]),_(f(q,G),R[1]))),-F[2]))),-L[3]),_(u(u(_(u(_(f(vt,te),B[1]),u(_(f(bt,dt),-R[1]),_(f(Nt,it),L[1]))),I[2]),_(u(_(f(vt,te),I[1]),u(_(f(Wt,ct),-R[1]),_(f(Ft,rt),L[1]))),-B[2])),u(_(u(_(f(bt,dt),I[1]),u(_(f(Wt,ct),-B[1]),_(f(q,G),L[1]))),R[2]),_(u(_(f(Nt,it),I[1]),u(_(f(Ft,rt),-B[1]),_(f(q,G),R[1]))),-L[2]))),F[3])),u(_(u(u(_(u(_(f(Fe,Ut),B[1]),u(_(f(Te,wt),-L[1]),_(f(bt,dt),F[1]))),O[2]),_(u(_(f(Fe,Ut),O[1]),u(_(f(le,nt),-L[1]),_(f(gt,Q),F[1]))),-B[2])),u(_(u(_(f(Te,wt),O[1]),u(_(f(le,nt),-B[1]),_(f(ot,st),F[1]))),L[2]),_(u(_(f(bt,dt),O[1]),u(_(f(gt,Q),-B[1]),_(f(ot,st),L[1]))),-F[2]))),I[3]),_(u(u(_(u(_(f(Fe,Ut),B[1]),u(_(f(Te,wt),-L[1]),_(f(bt,dt),F[1]))),I[2]),_(u(_(f(Fe,Ut),I[1]),u(_(f(Zt,lt),-L[1]),_(f(Wt,ct),F[1]))),-B[2])),u(_(u(_(f(Te,wt),I[1]),u(_(f(Zt,lt),-B[1]),_(f(q,G),F[1]))),L[2]),_(u(_(f(bt,dt),I[1]),u(_(f(Wt,ct),-B[1]),_(f(q,G),L[1]))),-F[2]))),-O[3])))),u(u(u(_(u(u(_(u(_(f(Fe,Ut),O[1]),u(_(f(le,nt),-L[1]),_(f(gt,Q),F[1]))),I[2]),_(u(_(f(Fe,Ut),I[1]),u(_(f(Zt,lt),-L[1]),_(f(Wt,ct),F[1]))),-O[2])),u(_(u(_(f(le,nt),I[1]),u(_(f(Zt,lt),-O[1]),_(f(Z,j),F[1]))),L[2]),_(u(_(f(gt,Q),I[1]),u(_(f(Wt,ct),-O[1]),_(f(Z,j),L[1]))),-F[2]))),B[3]),_(u(u(_(u(_(f(Te,wt),O[1]),u(_(f(le,nt),-B[1]),_(f(ot,st),F[1]))),I[2]),_(u(_(f(Te,wt),I[1]),u(_(f(Zt,lt),-B[1]),_(f(q,G),F[1]))),-O[2])),u(_(u(_(f(le,nt),I[1]),u(_(f(Zt,lt),-O[1]),_(f(Z,j),F[1]))),B[2]),_(u(_(f(ot,st),I[1]),u(_(f(q,G),-O[1]),_(f(Z,j),B[1]))),-F[2]))),-L[3])),u(_(u(u(_(u(_(f(bt,dt),O[1]),u(_(f(gt,Q),-B[1]),_(f(ot,st),L[1]))),I[2]),_(u(_(f(bt,dt),I[1]),u(_(f(Wt,ct),-B[1]),_(f(q,G),L[1]))),-O[2])),u(_(u(_(f(gt,Q),I[1]),u(_(f(Wt,ct),-O[1]),_(f(Z,j),L[1]))),B[2]),_(u(_(f(ot,st),I[1]),u(_(f(q,G),-O[1]),_(f(Z,j),B[1]))),-L[2]))),F[3]),_(u(u(_(u(_(f(vt,te),B[1]),u(_(f(bt,dt),-R[1]),_(f(Nt,it),L[1]))),O[2]),_(u(_(f(vt,te),O[1]),u(_(f(gt,Q),-R[1]),_(f(Et,$),L[1]))),-B[2])),u(_(u(_(f(bt,dt),O[1]),u(_(f(gt,Q),-B[1]),_(f(ot,st),L[1]))),R[2]),_(u(_(f(Nt,it),O[1]),u(_(f(Et,$),-B[1]),_(f(ot,st),R[1]))),-L[2]))),I[3]))),u(u(_(u(u(_(u(_(f(vt,te),B[1]),u(_(f(bt,dt),-R[1]),_(f(Nt,it),L[1]))),I[2]),_(u(_(f(vt,te),I[1]),u(_(f(Wt,ct),-R[1]),_(f(Ft,rt),L[1]))),-B[2])),u(_(u(_(f(bt,dt),I[1]),u(_(f(Wt,ct),-B[1]),_(f(q,G),L[1]))),R[2]),_(u(_(f(Nt,it),I[1]),u(_(f(Ft,rt),-B[1]),_(f(q,G),R[1]))),-L[2]))),-O[3]),_(u(u(_(u(_(f(vt,te),O[1]),u(_(f(gt,Q),-R[1]),_(f(Et,$),L[1]))),I[2]),_(u(_(f(vt,te),I[1]),u(_(f(Wt,ct),-R[1]),_(f(Ft,rt),L[1]))),-O[2])),u(_(u(_(f(gt,Q),I[1]),u(_(f(Wt,ct),-O[1]),_(f(Z,j),L[1]))),R[2]),_(u(_(f(Et,$),I[1]),u(_(f(Ft,rt),-O[1]),_(f(Z,j),R[1]))),-L[2]))),B[3])),u(_(u(u(_(u(_(f(bt,dt),O[1]),u(_(f(gt,Q),-B[1]),_(f(ot,st),L[1]))),I[2]),_(u(_(f(bt,dt),I[1]),u(_(f(Wt,ct),-B[1]),_(f(q,G),L[1]))),-O[2])),u(_(u(_(f(gt,Q),I[1]),u(_(f(Wt,ct),-O[1]),_(f(Z,j),L[1]))),B[2]),_(u(_(f(ot,st),I[1]),u(_(f(q,G),-O[1]),_(f(Z,j),B[1]))),-L[2]))),-R[3]),_(u(u(_(u(_(f(Nt,it),O[1]),u(_(f(Et,$),-B[1]),_(f(ot,st),R[1]))),I[2]),_(u(_(f(Nt,it),I[1]),u(_(f(Ft,rt),-B[1]),_(f(q,G),R[1]))),-O[2])),u(_(u(_(f(Et,$),I[1]),u(_(f(Ft,rt),-O[1]),_(f(Z,j),R[1]))),B[2]),_(u(_(f(ot,st),I[1]),u(_(f(q,G),-O[1]),_(f(Z,j),B[1]))),-R[2]))),L[3]))))),fr=f(Oe,ur);return fr[fr.length-1]}return D}var S=[v,m,p];function T(u){var f=S[u.length];return f||(f=S[u.length]=h(u.length)),f.apply(void 0,u)}function M(u,f,k,_,D,I,O,B){function R(L,F,N,j,G,rt){switch(arguments.length){case 0:case 1:return 0;case 2:return _(L,F);case 3:return D(L,F,N);case 4:return I(L,F,N,j);case 5:return O(L,F,N,j,G);case 6:return B(L,F,N,j,G,rt)}for(var ct=new Array(arguments.length),lt=0;lt<arguments.length;++lt)ct[lt]=arguments[lt];return u(ct)}return R}function w(){for(;S.length<=s;)S.push(h(S.length));t.exports=M.apply(void 0,[T].concat(S));for(var u=0;u<=s;++u)t.exports[u]=S[u]}w()},727:function(t,e,r){var i=r(2962),n=6;function o(S){var T=S===2?h:S===3?v:S===4?m:S===5?p:y;return S<6?T(i[S]):T(i)}function a(){return[[0]]}function s(S,T){return[[T[0]],[S[0][0]]]}function h(S){return function(T,M){return[S([[+M[0],+T[0][1]],[+M[1],+T[1][1]]]),S([[+T[0][0],+M[0]],[+T[1][0],+M[1]]]),S(T)]}}function v(S){return function(T,M){return[S([[+M[0],+T[0][1],+T[0][2]],[+M[1],+T[1][1],+T[1][2]],[+M[2],+T[2][1],+T[2][2]]]),S([[+T[0][0],+M[0],+T[0][2]],[+T[1][0],+M[1],+T[1][2]],[+T[2][0],+M[2],+T[2][2]]]),S([[+T[0][0],+T[0][1],+M[0]],[+T[1][0],+T[1][1],+M[1]],[+T[2][0],+T[2][1],+M[2]]]),S(T)]}}function m(S){return function(T,M){return[S([[+M[0],+T[0][1],+T[0][2],+T[0][3]],[+M[1],+T[1][1],+T[1][2],+T[1][3]],[+M[2],+T[2][1],+T[2][2],+T[2][3]],[+M[3],+T[3][1],+T[3][2],+T[3][3]]]),S([[+T[0][0],+M[0],+T[0][2],+T[0][3]],[+T[1][0],+M[1],+T[1][2],+T[1][3]],[+T[2][0],+M[2],+T[2][2],+T[2][3]],[+T[3][0],+M[3],+T[3][2],+T[3][3]]]),S([[+T[0][0],+T[0][1],+M[0],+T[0][3]],[+T[1][0],+T[1][1],+M[1],+T[1][3]],[+T[2][0],+T[2][1],+M[2],+T[2][3]],[+T[3][0],+T[3][1],+M[3],+T[3][3]]]),S([[+T[0][0],+T[0][1],+T[0][2],+M[0]],[+T[1][0],+T[1][1],+T[1][2],+M[1]],[+T[2][0],+T[2][1],+T[2][2],+M[2]],[+T[3][0],+T[3][1],+T[3][2],+M[3]]]),S(T)]}}function p(S){return function(T,M){return[S([[+M[0],+T[0][1],+T[0][2],+T[0][3],+T[0][4]],[+M[1],+T[1][1],+T[1][2],+T[1][3],+T[1][4]],[+M[2],+T[2][1],+T[2][2],+T[2][3],+T[2][4]],[+M[3],+T[3][1],+T[3][2],+T[3][3],+T[3][4]],[+M[4],+T[4][1],+T[4][2],+T[4][3],+T[4][4]]]),S([[+T[0][0],+M[0],+T[0][2],+T[0][3],+T[0][4]],[+T[1][0],+M[1],+T[1][2],+T[1][3],+T[1][4]],[+T[2][0],+M[2],+T[2][2],+T[2][3],+T[2][4]],[+T[3][0],+M[3],+T[3][2],+T[3][3],+T[3][4]],[+T[4][0],+M[4],+T[4][2],+T[4][3],+T[4][4]]]),S([[+T[0][0],+T[0][1],+M[0],+T[0][3],+T[0][4]],[+T[1][0],+T[1][1],+M[1],+T[1][3],+T[1][4]],[+T[2][0],+T[2][1],+M[2],+T[2][3],+T[2][4]],[+T[3][0],+T[3][1],+M[3],+T[3][3],+T[3][4]],[+T[4][0],+T[4][1],+M[4],+T[4][3],+T[4][4]]]),S([[+T[0][0],+T[0][1],+T[0][2],+M[0],+T[0][4]],[+T[1][0],+T[1][1],+T[1][2],+M[1],+T[1][4]],[+T[2][0],+T[2][1],+T[2][2],+M[2],+T[2][4]],[+T[3][0],+T[3][1],+T[3][2],+M[3],+T[3][4]],[+T[4][0],+T[4][1],+T[4][2],+M[4],+T[4][4]]]),S([[+T[0][0],+T[0][1],+T[0][2],+T[0][3],+M[0]],[+T[1][0],+T[1][1],+T[1][2],+T[1][3],+M[1]],[+T[2][0],+T[2][1],+T[2][2],+T[2][3],+M[2]],[+T[3][0],+T[3][1],+T[3][2],+T[3][3],+M[3]],[+T[4][0],+T[4][1],+T[4][2],+T[4][3],+M[4]]]),S(T)]}}function y(S){return function(T,M){return[S([[+M[0],+T[0][1],+T[0][2],+T[0][3],+T[0][4],+T[0][5]],[+M[1],+T[1][1],+T[1][2],+T[1][3],+T[1][4],+T[1][5]],[+M[2],+T[2][1],+T[2][2],+T[2][3],+T[2][4],+T[2][5]],[+M[3],+T[3][1],+T[3][2],+T[3][3],+T[3][4],+T[3][5]],[+M[4],+T[4][1],+T[4][2],+T[4][3],+T[4][4],+T[4][5]],[+M[5],+T[5][1],+T[5][2],+T[5][3],+T[5][4],+T[5][5]]]),S([[+T[0][0],+M[0],+T[0][2],+T[0][3],+T[0][4],+T[0][5]],[+T[1][0],+M[1],+T[1][2],+T[1][3],+T[1][4],+T[1][5]],[+T[2][0],+M[2],+T[2][2],+T[2][3],+T[2][4],+T[2][5]],[+T[3][0],+M[3],+T[3][2],+T[3][3],+T[3][4],+T[3][5]],[+T[4][0],+M[4],+T[4][2],+T[4][3],+T[4][4],+T[4][5]],[+T[5][0],+M[5],+T[5][2],+T[5][3],+T[5][4],+T[5][5]]]),S([[+T[0][0],+T[0][1],+M[0],+T[0][3],+T[0][4],+T[0][5]],[+T[1][0],+T[1][1],+M[1],+T[1][3],+T[1][4],+T[1][5]],[+T[2][0],+T[2][1],+M[2],+T[2][3],+T[2][4],+T[2][5]],[+T[3][0],+T[3][1],+M[3],+T[3][3],+T[3][4],+T[3][5]],[+T[4][0],+T[4][1],+M[4],+T[4][3],+T[4][4],+T[4][5]],[+T[5][0],+T[5][1],+M[5],+T[5][3],+T[5][4],+T[5][5]]]),S([[+T[0][0],+T[0][1],+T[0][2],+M[0],+T[0][4],+T[0][5]],[+T[1][0],+T[1][1],+T[1][2],+M[1],+T[1][4],+T[1][5]],[+T[2][0],+T[2][1],+T[2][2],+M[2],+T[2][4],+T[2][5]],[+T[3][0],+T[3][1],+T[3][2],+M[3],+T[3][4],+T[3][5]],[+T[4][0],+T[4][1],+T[4][2],+M[4],+T[4][4],+T[4][5]],[+T[5][0],+T[5][1],+T[5][2],+M[5],+T[5][4],+T[5][5]]]),S([[+T[0][0],+T[0][1],+T[0][2],+T[0][3],+M[0],+T[0][5]],[+T[1][0],+T[1][1],+T[1][2],+T[1][3],+M[1],+T[1][5]],[+T[2][0],+T[2][1],+T[2][2],+T[2][3],+M[2],+T[2][5]],[+T[3][0],+T[3][1],+T[3][2],+T[3][3],+M[3],+T[3][5]],[+T[4][0],+T[4][1],+T[4][2],+T[4][3],+M[4],+T[4][5]],[+T[5][0],+T[5][1],+T[5][2],+T[5][3],+M[5],+T[5][5]]]),S([[+T[0][0],+T[0][1],+T[0][2],+T[0][3],+T[0][4],+M[0]],[+T[1][0],+T[1][1],+T[1][2],+T[1][3],+T[1][4],+M[1]],[+T[2][0],+T[2][1],+T[2][2],+T[2][3],+T[2][4],+M[2]],[+T[3][0],+T[3][1],+T[3][2],+T[3][3],+T[3][4],+M[3]],[+T[4][0],+T[4][1],+T[4][2],+T[4][3],+T[4][4],+M[4]],[+T[5][0],+T[5][1],+T[5][2],+T[5][3],+T[5][4],+M[5]]]),S(T)]}}var l=[a,s];function x(S,T,M,w,u,f,k,_){return function(D,I){switch(D.length){case 0:return S(D,I);case 1:return T(D,I);case 2:return M(D,I);case 3:return w(D,I);case 4:return u(D,I);case 5:return f(D,I)}var O=k[D.length];return O||(O=k[D.length]=_(D.length)),O(D,I)}}function b(){for(;l.length<n;)l.push(o(l.length));t.exports=x.apply(void 0,l.concat([l,o]));for(var S=0;S<n;++S)t.exports[S]=l[S]}b()},3250:function(t,e,r){var i=r(5250),n=r(8210),o=r(3012),a=r(8545),s=5,h=11102230246251565e-32,v=(3+16*h)*h,m=(7+56*h)*h;function p(f,k,_,D){return function(I,O,B){var R=f(f(k(O[1],B[0]),k(-B[1],O[0])),f(k(I[1],O[0]),k(-O[1],I[0]))),L=f(k(I[1],B[0]),k(-B[1],I[0])),F=D(R,L);return F[F.length-1]}}function y(f,k,_,D){return function(I,O,B,R){var L=f(f(_(f(k(B[1],R[0]),k(-R[1],B[0])),O[2]),f(_(f(k(O[1],R[0]),k(-R[1],O[0])),-B[2]),_(f(k(O[1],B[0]),k(-B[1],O[0])),R[2]))),f(_(f(k(O[1],R[0]),k(-R[1],O[0])),I[2]),f(_(f(k(I[1],R[0]),k(-R[1],I[0])),-O[2]),_(f(k(I[1],O[0]),k(-O[1],I[0])),R[2])))),F=f(f(_(f(k(B[1],R[0]),k(-R[1],B[0])),I[2]),f(_(f(k(I[1],R[0]),k(-R[1],I[0])),-B[2]),_(f(k(I[1],B[0]),k(-B[1],I[0])),R[2]))),f(_(f(k(O[1],B[0]),k(-B[1],O[0])),I[2]),f(_(f(k(I[1],B[0]),k(-B[1],I[0])),-O[2]),_(f(k(I[1],O[0]),k(-O[1],I[0])),B[2])))),N=D(L,F);return N[N.length-1]}}function l(f,k,_,D){return function(I,O,B,R,L){var F=f(f(f(_(f(_(f(k(R[1],L[0]),k(-L[1],R[0])),B[2]),f(_(f(k(B[1],L[0]),k(-L[1],B[0])),-R[2]),_(f(k(B[1],R[0]),k(-R[1],B[0])),L[2]))),O[3]),f(_(f(_(f(k(R[1],L[0]),k(-L[1],R[0])),O[2]),f(_(f(k(O[1],L[0]),k(-L[1],O[0])),-R[2]),_(f(k(O[1],R[0]),k(-R[1],O[0])),L[2]))),-B[3]),_(f(_(f(k(B[1],L[0]),k(-L[1],B[0])),O[2]),f(_(f(k(O[1],L[0]),k(-L[1],O[0])),-B[2]),_(f(k(O[1],B[0]),k(-B[1],O[0])),L[2]))),R[3]))),f(_(f(_(f(k(B[1],R[0]),k(-R[1],B[0])),O[2]),f(_(f(k(O[1],R[0]),k(-R[1],O[0])),-B[2]),_(f(k(O[1],B[0]),k(-B[1],O[0])),R[2]))),-L[3]),f(_(f(_(f(k(R[1],L[0]),k(-L[1],R[0])),O[2]),f(_(f(k(O[1],L[0]),k(-L[1],O[0])),-R[2]),_(f(k(O[1],R[0]),k(-R[1],O[0])),L[2]))),I[3]),_(f(_(f(k(R[1],L[0]),k(-L[1],R[0])),I[2]),f(_(f(k(I[1],L[0]),k(-L[1],I[0])),-R[2]),_(f(k(I[1],R[0]),k(-R[1],I[0])),L[2]))),-O[3])))),f(f(_(f(_(f(k(O[1],L[0]),k(-L[1],O[0])),I[2]),f(_(f(k(I[1],L[0]),k(-L[1],I[0])),-O[2]),_(f(k(I[1],O[0]),k(-O[1],I[0])),L[2]))),R[3]),f(_(f(_(f(k(O[1],R[0]),k(-R[1],O[0])),I[2]),f(_(f(k(I[1],R[0]),k(-R[1],I[0])),-O[2]),_(f(k(I[1],O[0]),k(-O[1],I[0])),R[2]))),-L[3]),_(f(_(f(k(B[1],R[0]),k(-R[1],B[0])),O[2]),f(_(f(k(O[1],R[0]),k(-R[1],O[0])),-B[2]),_(f(k(O[1],B[0]),k(-B[1],O[0])),R[2]))),I[3]))),f(_(f(_(f(k(B[1],R[0]),k(-R[1],B[0])),I[2]),f(_(f(k(I[1],R[0]),k(-R[1],I[0])),-B[2]),_(f(k(I[1],B[0]),k(-B[1],I[0])),R[2]))),-O[3]),f(_(f(_(f(k(O[1],R[0]),k(-R[1],O[0])),I[2]),f(_(f(k(I[1],R[0]),k(-R[1],I[0])),-O[2]),_(f(k(I[1],O[0]),k(-O[1],I[0])),R[2]))),B[3]),_(f(_(f(k(O[1],B[0]),k(-B[1],O[0])),I[2]),f(_(f(k(I[1],B[0]),k(-B[1],I[0])),-O[2]),_(f(k(I[1],O[0]),k(-O[1],I[0])),B[2]))),-R[3]))))),N=f(f(f(_(f(_(f(k(R[1],L[0]),k(-L[1],R[0])),B[2]),f(_(f(k(B[1],L[0]),k(-L[1],B[0])),-R[2]),_(f(k(B[1],R[0]),k(-R[1],B[0])),L[2]))),I[3]),_(f(_(f(k(R[1],L[0]),k(-L[1],R[0])),I[2]),f(_(f(k(I[1],L[0]),k(-L[1],I[0])),-R[2]),_(f(k(I[1],R[0]),k(-R[1],I[0])),L[2]))),-B[3])),f(_(f(_(f(k(B[1],L[0]),k(-L[1],B[0])),I[2]),f(_(f(k(I[1],L[0]),k(-L[1],I[0])),-B[2]),_(f(k(I[1],B[0]),k(-B[1],I[0])),L[2]))),R[3]),_(f(_(f(k(B[1],R[0]),k(-R[1],B[0])),I[2]),f(_(f(k(I[1],R[0]),k(-R[1],I[0])),-B[2]),_(f(k(I[1],B[0]),k(-B[1],I[0])),R[2]))),-L[3]))),f(f(_(f(_(f(k(B[1],L[0]),k(-L[1],B[0])),O[2]),f(_(f(k(O[1],L[0]),k(-L[1],O[0])),-B[2]),_(f(k(O[1],B[0]),k(-B[1],O[0])),L[2]))),I[3]),_(f(_(f(k(B[1],L[0]),k(-L[1],B[0])),I[2]),f(_(f(k(I[1],L[0]),k(-L[1],I[0])),-B[2]),_(f(k(I[1],B[0]),k(-B[1],I[0])),L[2]))),-O[3])),f(_(f(_(f(k(O[1],L[0]),k(-L[1],O[0])),I[2]),f(_(f(k(I[1],L[0]),k(-L[1],I[0])),-O[2]),_(f(k(I[1],O[0]),k(-O[1],I[0])),L[2]))),B[3]),_(f(_(f(k(O[1],B[0]),k(-B[1],O[0])),I[2]),f(_(f(k(I[1],B[0]),k(-B[1],I[0])),-O[2]),_(f(k(I[1],O[0]),k(-O[1],I[0])),B[2]))),-L[3])))),j=D(F,N);return j[j.length-1]}}function x(f){var k=f===3?p:f===4?y:l;return k(n,i,o,a)}var b=x(3),S=x(4),T=[function(){return 0},function(){return 0},function(f,k){return k[0]-f[0]},function(f,k,_){var D=(f[1]-_[1])*(k[0]-_[0]),I=(f[0]-_[0])*(k[1]-_[1]),O=D-I,B;if(D>0){if(I<=0)return O;B=D+I}else if(D<0){if(I>=0)return O;B=-(D+I)}else return O;var R=v*B;return O>=R||O<=-R?O:b(f,k,_)},function(f,k,_,D){var I=f[0]-D[0],O=k[0]-D[0],B=_[0]-D[0],R=f[1]-D[1],L=k[1]-D[1],F=_[1]-D[1],N=f[2]-D[2],j=k[2]-D[2],G=_[2]-D[2],rt=O*F,ct=B*L,lt=B*R,tt=I*F,Z=I*L,st=O*R,$=N*(rt-ct)+j*(lt-tt)+G*(Z-st),Q=(Math.abs(rt)+Math.abs(ct))*Math.abs(N)+(Math.abs(lt)+Math.abs(tt))*Math.abs(j)+(Math.abs(Z)+Math.abs(st))*Math.abs(G),nt=m*Q;return $>nt||-$>nt?$:S(f,k,_,D)}];function M(f){var k=T[f.length];return k||(k=T[f.length]=x(f.length)),k.apply(void 0,f)}function w(f,k,_,D,I,O,B){return function(R,L,F,N,j){switch(arguments.length){case 0:case 1:return 0;case 2:return D(R,L);case 3:return I(R,L,F);case 4:return O(R,L,F,N);case 5:return B(R,L,F,N,j)}for(var G=new Array(arguments.length),rt=0;rt<arguments.length;++rt)G[rt]=arguments[rt];return f(G)}}function u(){for(;T.length<=s;)T.push(x(T.length));t.exports=w.apply(void 0,[M].concat(T));for(var f=0;f<=s;++f)t.exports[f]=T[f]}u()},5382:function(t,e,r){var i=r(8210),n=r(3012);t.exports=o;function o(a,s){if(a.length===1)return n(s,a[0]);if(s.length===1)return n(a,s[0]);if(a.length===0||s.length===0)return[0];var h=[0];if(a.length<s.length)for(var v=0;v<a.length;++v)h=i(h,n(s,a[v]));else for(var v=0;v<s.length;++v)h=i(h,n(a,s[v]));return h}},3012:function(t,e,r){var i=r(5250),n=r(9362);t.exports=o;function o(a,s){var h=a.length;if(h===1){var v=i(a[0],s);return v[0]?v:[v[1]]}var m=new Array(2*h),p=[.1,.1],y=[.1,.1],l=0;i(a[0],s,p),p[0]&&(m[l++]=p[0]);for(var x=1;x<h;++x){i(a[x],s,y);var b=p[1];n(b,y[0],p),p[0]&&(m[l++]=p[0]);var S=y[1],T=p[1],M=S+T,w=M-S,u=T-w;p[1]=M,u&&(m[l++]=u)}return p[1]&&(m[l++]=p[1]),l===0&&(m[l++]=0),m.length=l,m}},1125:function(t,e,r){t.exports=o;var i=r(3250)[3];function n(a,s,h,v){for(var m=0;m<2;++m){var p=a[m],y=s[m],l=Math.min(p,y),x=Math.max(p,y),b=h[m],S=v[m],T=Math.min(b,S),M=Math.max(b,S);if(M<l||x<T)return!1}return!0}function o(a,s,h,v){var m=i(a,h,v),p=i(s,h,v);if(m>0&&p>0||m<0&&p<0)return!1;var y=i(h,a,s),l=i(v,a,s);return y>0&&l>0||y<0&&l<0?!1:m===0&&p===0&&y===0&&l===0?n(a,s,h,v):!0}},8545:function(t){t.exports=r;function e(i,n){var o=i+n,a=o-i,s=o-a,h=n-a,v=i-s,m=v+h;return m?[m,o]:[o]}function r(i,n){var o=i.length|0,a=n.length|0;if(o===1&&a===1)return e(i[0],-n[0]);var s=o+a,h=new Array(s),v=0,m=0,p=0,y=Math.abs,l=i[m],x=y(l),b=-n[p],S=y(b),T,M;x<S?(M=l,m+=1,m<o&&(l=i[m],x=y(l))):(M=b,p+=1,p<a&&(b=-n[p],S=y(b))),m<o&&x<S||p>=a?(T=l,m+=1,m<o&&(l=i[m],x=y(l))):(T=b,p+=1,p<a&&(b=-n[p],S=y(b)));for(var w=T+M,u=w-T,f=M-u,k=f,_=w,D,I,O,B,R;m<o&&p<a;)x<S?(T=l,m+=1,m<o&&(l=i[m],x=y(l))):(T=b,p+=1,p<a&&(b=-n[p],S=y(b))),M=k,w=T+M,u=w-T,f=M-u,f&&(h[v++]=f),D=_+w,I=D-_,O=D-I,B=w-I,R=_-O,k=R+B,_=D;for(;m<o;)T=l,M=k,w=T+M,u=w-T,f=M-u,f&&(h[v++]=f),D=_+w,I=D-_,O=D-I,B=w-I,R=_-O,k=R+B,_=D,m+=1,m<o&&(l=i[m]);for(;p<a;)T=b,M=k,w=T+M,u=w-T,f=M-u,f&&(h[v++]=f),D=_+w,I=D-_,O=D-I,B=w-I,R=_-O,k=R+B,_=D,p+=1,p<a&&(b=-n[p]);return k&&(h[v++]=k),_&&(h[v++]=_),v||(h[v++]=0),h.length=v,h}},8210:function(t){t.exports=r;function e(i,n){var o=i+n,a=o-i,s=o-a,h=n-a,v=i-s,m=v+h;return m?[m,o]:[o]}function r(i,n){var o=i.length|0,a=n.length|0;if(o===1&&a===1)return e(i[0],n[0]);var s=o+a,h=new Array(s),v=0,m=0,p=0,y=Math.abs,l=i[m],x=y(l),b=n[p],S=y(b),T,M;x<S?(M=l,m+=1,m<o&&(l=i[m],x=y(l))):(M=b,p+=1,p<a&&(b=n[p],S=y(b))),m<o&&x<S||p>=a?(T=l,m+=1,m<o&&(l=i[m],x=y(l))):(T=b,p+=1,p<a&&(b=n[p],S=y(b)));for(var w=T+M,u=w-T,f=M-u,k=f,_=w,D,I,O,B,R;m<o&&p<a;)x<S?(T=l,m+=1,m<o&&(l=i[m],x=y(l))):(T=b,p+=1,p<a&&(b=n[p],S=y(b))),M=k,w=T+M,u=w-T,f=M-u,f&&(h[v++]=f),D=_+w,I=D-_,O=D-I,B=w-I,R=_-O,k=R+B,_=D;for(;m<o;)T=l,M=k,w=T+M,u=w-T,f=M-u,f&&(h[v++]=f),D=_+w,I=D-_,O=D-I,B=w-I,R=_-O,k=R+B,_=D,m+=1,m<o&&(l=i[m]);for(;p<a;)T=b,M=k,w=T+M,u=w-T,f=M-u,f&&(h[v++]=f),D=_+w,I=D-_,O=D-I,B=w-I,R=_-O,k=R+B,_=D,p+=1,p<a&&(b=n[p]);return k&&(h[v++]=k),_&&(h[v++]=_),v||(h[v++]=0),h.length=v,h}},9127:function(t,e,r){t.exports=o;var i=r(6204),n=r(5771);function o(a){return n(i(a))}},7765:function(t,e,r){t.exports=l;var i=r(9618),n=r(1888),o=r(446),a=r(1570);function s(x){for(var b=x.length,S=0,T=0;T<b;++T)S=Math.max(S,x[T].length)|0;return S-1}function h(x,b){for(var S=x.length,T=n.mallocUint8(S),M=0;M<S;++M)T[M]=x[M]<b|0;return T}function v(x,b){for(var S=x.length,T=b*(b+1)/2*S|0,M=n.mallocUint32(T*2),w=0,u=0;u<S;++u)for(var f=x[u],b=f.length,k=0;k<b;++k)for(var _=0;_<k;++_){var D=f[_],I=f[k];M[w++]=Math.min(D,I)|0,M[w++]=Math.max(D,I)|0}var O=w/2|0;o(i(M,[O,2]));for(var B=2,u=2;u<w;u+=2)M[u-2]===M[u]&&M[u-1]===M[u+1]||(M[B++]=M[u],M[B++]=M[u+1]);return i(M,[B/2|0,2])}function m(x,b,S,T){for(var M=x.data,w=x.shape[0],u=n.mallocDouble(w),f=0,k=0;k<w;++k){var _=M[2*k],D=M[2*k+1];if(S[_]!==S[D]){var I=b[_],O=b[D];M[2*f]=_,M[2*f+1]=D,u[f++]=(O-T)/(O-I)}}return x.shape[0]=f,i(u,[f])}function p(x,b){var S=n.mallocInt32(b*2),T=x.shape[0],M=x.data;S[0]=0;for(var w=0,u=0;u<T;++u){var f=M[2*u];if(f!==w){for(S[2*w+1]=u;++w<f;)S[2*w]=u,S[2*w+1]=u;S[2*w]=u}}for(S[2*w+1]=T;++w<b;)S[2*w]=S[2*w+1]=T;return S}function y(x){for(var b=x.shape[0]|0,S=x.data,T=new Array(b),M=0;M<b;++M)T[M]=[S[2*M],S[2*M+1]];return T}function l(x,b,S,T){S=S||0,typeof T>"u"&&(T=s(x));var M=x.length;if(M===0||T<1)return{cells:[],vertexIds:[],vertexWeights:[]};var w=h(b,+S),u=v(x,T),f=m(u,b,w,+S),k=p(u,b.length|0),_=a(T)(x,u.data,k,w),D=y(u),I=[].slice.call(f.data,0,f.shape[0]);return n.free(w),n.free(u.data),n.free(f.data),n.free(k),{cells:_,vertexIds:D,vertexWeights:I}}},1570:function(t){t.exports=r;var e=[function(){function i(n,o,a,s){for(var h=n.length,v=[],m=0;m<h;++m)var p=n[m],y=p.length;return v}return i},function(){function i(o,a,s,h){for(var v=Math.min(s,h)|0,m=Math.max(s,h)|0,p=o[2*v],y=o[2*v+1];p<y;){var l=p+y>>1,x=a[2*l+1];if(x===m)return l;m<x?y=l:p=l+1}return p}function n(o,a,s,h){for(var v=o.length,m=[],p=0;p<v;++p){var y=o[p],l=y.length;if(l===2){var x=(h[y[0]]<<0)+(h[y[1]]<<1);if(x===0||x===3)continue;switch(x){case 0:break;case 1:m.push([i(s,a,y[0],y[1])]);break;case 2:m.push([i(s,a,y[1],y[0])]);break}}}return m}return n},function(){function i(o,a,s,h){for(var v=Math.min(s,h)|0,m=Math.max(s,h)|0,p=o[2*v],y=o[2*v+1];p<y;){var l=p+y>>1,x=a[2*l+1];if(x===m)return l;m<x?y=l:p=l+1}return p}function n(o,a,s,h){for(var v=o.length,m=[],p=0;p<v;++p){var y=o[p],l=y.length;if(l===3){var x=(h[y[0]]<<0)+(h[y[1]]<<1)+(h[y[2]]<<2);if(x===0||x===7)continue;switch(x){case 0:break;case 1:m.push([i(s,a,y[0],y[2]),i(s,a,y[0],y[1])]);break;case 2:m.push([i(s,a,y[1],y[0]),i(s,a,y[1],y[2])]);break;case 3:m.push([i(s,a,y[0],y[2]),i(s,a,y[1],y[2])]);break;case 4:m.push([i(s,a,y[2],y[1]),i(s,a,y[2],y[0])]);break;case 5:m.push([i(s,a,y[2],y[1]),i(s,a,y[0],y[1])]);break;case 6:m.push([i(s,a,y[1],y[0]),i(s,a,y[2],y[0])]);break}}else if(l===2){var x=(h[y[0]]<<0)+(h[y[1]]<<1);if(x===0||x===3)continue;switch(x){case 0:break;case 1:m.push([i(s,a,y[0],y[1])]);break;case 2:m.push([i(s,a,y[1],y[0])]);break}}}return m}return n},function(){function i(o,a,s,h){for(var v=Math.min(s,h)|0,m=Math.max(s,h)|0,p=o[2*v],y=o[2*v+1];p<y;){var l=p+y>>1,x=a[2*l+1];if(x===m)return l;m<x?y=l:p=l+1}return p}function n(o,a,s,h){for(var v=o.length,m=[],p=0;p<v;++p){var y=o[p],l=y.length;if(l===4){var x=(h[y[0]]<<0)+(h[y[1]]<<1)+(h[y[2]]<<2)+(h[y[3]]<<3);if(x===0||x===15)continue;switch(x){case 0:break;case 1:m.push([i(s,a,y[0],y[1]),i(s,a,y[0],y[2]),i(s,a,y[0],y[3])]);break;case 2:m.push([i(s,a,y[1],y[2]),i(s,a,y[1],y[0]),i(s,a,y[1],y[3])]);break;case 3:m.push([i(s,a,y[1],y[2]),i(s,a,y[0],y[2]),i(s,a,y[0],y[3])],[i(s,a,y[1],y[3]),i(s,a,y[1],y[2]),i(s,a,y[0],y[3])]);break;case 4:m.push([i(s,a,y[2],y[0]),i(s,a,y[2],y[1]),i(s,a,y[2],y[3])]);break;case 5:m.push([i(s,a,y[0],y[1]),i(s,a,y[2],y[1]),i(s,a,y[0],y[3])],[i(s,a,y[2],y[1]),i(s,a,y[2],y[3]),i(s,a,y[0],y[3])]);break;case 6:m.push([i(s,a,y[2],y[0]),i(s,a,y[1],y[0]),i(s,a,y[1],y[3])],[i(s,a,y[2],y[3]),i(s,a,y[2],y[0]),i(s,a,y[1],y[3])]);break;case 7:m.push([i(s,a,y[0],y[3]),i(s,a,y[1],y[3]),i(s,a,y[2],y[3])]);break;case 8:m.push([i(s,a,y[3],y[1]),i(s,a,y[3],y[0]),i(s,a,y[3],y[2])]);break;case 9:m.push([i(s,a,y[3],y[1]),i(s,a,y[0],y[1]),i(s,a,y[0],y[2])],[i(s,a,y[3],y[2]),i(s,a,y[3],y[1]),i(s,a,y[0],y[2])]);break;case 10:m.push([i(s,a,y[1],y[0]),i(s,a,y[3],y[0]),i(s,a,y[1],y[2])],[i(s,a,y[3],y[0]),i(s,a,y[3],y[2]),i(s,a,y[1],y[2])]);break;case 11:m.push([i(s,a,y[1],y[2]),i(s,a,y[0],y[2]),i(s,a,y[3],y[2])]);break;case 12:m.push([i(s,a,y[3],y[0]),i(s,a,y[2],y[0]),i(s,a,y[2],y[1])],[i(s,a,y[3],y[1]),i(s,a,y[3],y[0]),i(s,a,y[2],y[1])]);break;case 13:m.push([i(s,a,y[0],y[1]),i(s,a,y[2],y[1]),i(s,a,y[3],y[1])]);break;case 14:m.push([i(s,a,y[2],y[0]),i(s,a,y[1],y[0]),i(s,a,y[3],y[0])]);break}}else if(l===3){var x=(h[y[0]]<<0)+(h[y[1]]<<1)+(h[y[2]]<<2);if(x===0||x===7)continue;switch(x){case 0:break;case 1:m.push([i(s,a,y[0],y[2]),i(s,a,y[0],y[1])]);break;case 2:m.push([i(s,a,y[1],y[0]),i(s,a,y[1],y[2])]);break;case 3:m.push([i(s,a,y[0],y[2]),i(s,a,y[1],y[2])]);break;case 4:m.push([i(s,a,y[2],y[1]),i(s,a,y[2],y[0])]);break;case 5:m.push([i(s,a,y[2],y[1]),i(s,a,y[0],y[1])]);break;case 6:m.push([i(s,a,y[1],y[0]),i(s,a,y[2],y[0])]);break}}else if(l===2){var x=(h[y[0]]<<0)+(h[y[1]]<<1);if(x===0||x===3)continue;switch(x){case 0:break;case 1:m.push([i(s,a,y[0],y[1])]);break;case 2:m.push([i(s,a,y[1],y[0])]);break}}}return m}return n}];function r(i){return e[i]()}},6803:function(t,e,r){r(8828),r(1755);function i(n,o){var a=n.length,s=n.length-o.length,h=Math.min;if(s)return s;switch(a){case 0:return 0;case 1:return n[0]-o[0];case 2:var l=n[0]+n[1]-o[0]-o[1];return l||h(n[0],n[1])-h(o[0],o[1]);case 3:var v=n[0]+n[1],m=o[0]+o[1];if(l=v+n[2]-(m+o[2]),l)return l;var p=h(n[0],n[1]),y=h(o[0],o[1]),l=h(p,n[2])-h(y,o[2]);return l||h(p+n[2],v)-h(y+o[2],m);default:var x=n.slice(0);x.sort();var b=o.slice(0);b.sort();for(var S=0;S<a;++S)if(s=x[S]-b[S],s)return s;return 0}}e.Fw=i},3105:function(t,e){"use restrict";var r=32;e.INT_BITS=r,e.INT_MAX=2147483647,e.INT_MIN=-1<<r-1,e.sign=function(o){return(o>0)-(o<0)},e.abs=function(o){var a=o>>r-1;return(o^a)-a},e.min=function(o,a){return a^(o^a)&-(o<a)},e.max=function(o,a){return o^(o^a)&-(o<a)},e.isPow2=function(o){return!(o&o-1)&&!!o},e.log2=function(o){var a,s;return a=(o>65535)<<4,o>>>=a,s=(o>255)<<3,o>>>=s,a|=s,s=(o>15)<<2,o>>>=s,a|=s,s=(o>3)<<1,o>>>=s,a|=s,a|o>>1},e.log10=function(o){return o>=1e9?9:o>=1e8?8:o>=1e7?7:o>=1e6?6:o>=1e5?5:o>=1e4?4:o>=1e3?3:o>=100?2:o>=10?1:0},e.popCount=function(o){return o=o-(o>>>1&1431655765),o=(o&858993459)+(o>>>2&858993459),(o+(o>>>4)&252645135)*16843009>>>24};function i(o){var a=32;return o&=-o,o&&a--,o&65535&&(a-=16),o&16711935&&(a-=8),o&252645135&&(a-=4),o&858993459&&(a-=2),o&1431655765&&(a-=1),a}e.countTrailingZeros=i,e.nextPow2=function(o){return o+=o===0,--o,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o+1},e.prevPow2=function(o){return o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o-(o>>>1)},e.parity=function(o){return o^=o>>>16,o^=o>>>8,o^=o>>>4,o&=15,27030>>>o&1};var n=new Array(256);(function(o){for(var a=0;a<256;++a){var s=a,h=a,v=7;for(s>>>=1;s;s>>>=1)h<<=1,h|=s&1,--v;o[a]=h<<v&255}})(n),e.reverse=function(o){return n[o&255]<<24|n[o>>>8&255]<<16|n[o>>>16&255]<<8|n[o>>>24&255]},e.interleave2=function(o,a){return o&=65535,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,a&=65535,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,o|a<<1},e.deinterleave2=function(o,a){return o=o>>>a&1431655765,o=(o|o>>>1)&858993459,o=(o|o>>>2)&252645135,o=(o|o>>>4)&16711935,o=(o|o>>>16)&65535,o<<16>>16},e.interleave3=function(o,a,s){return o&=1023,o=(o|o<<16)&4278190335,o=(o|o<<8)&251719695,o=(o|o<<4)&3272356035,o=(o|o<<2)&1227133513,a&=1023,a=(a|a<<16)&4278190335,a=(a|a<<8)&251719695,a=(a|a<<4)&3272356035,a=(a|a<<2)&1227133513,o|=a<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,o|s<<2},e.deinterleave3=function(o,a){return o=o>>>a&1227133513,o=(o|o>>>2)&3272356035,o=(o|o>>>4)&251719695,o=(o|o>>>8)&4278190335,o=(o|o>>>16)&1023,o<<22>>22},e.nextCombination=function(o){var a=o|o-1;return a+1|(~a&-~a)-1>>>i(o)+1}},2014:function(t,e,r){"use restrict";var i=r(3105),n=r(4623);function o(f){for(var k=0,_=Math.max,D=0,I=f.length;D<I;++D)k=_(k,f[D].length);return k-1}e.dimension=o;function a(f){for(var k=-1,_=Math.max,D=0,I=f.length;D<I;++D)for(var O=f[D],B=0,R=O.length;B<R;++B)k=_(k,O[B]);return k+1}e.countVertices=a;function s(f){for(var k=new Array(f.length),_=0,D=f.length;_<D;++_)k[_]=f[_].slice(0);return k}e.cloneCells=s;function h(f,k){var _=f.length,D=f.length-k.length,I=Math.min;if(D)return D;switch(_){case 0:return 0;case 1:return f[0]-k[0];case 2:var F=f[0]+f[1]-k[0]-k[1];return F||I(f[0],f[1])-I(k[0],k[1]);case 3:var O=f[0]+f[1],B=k[0]+k[1];if(F=O+f[2]-(B+k[2]),F)return F;var R=I(f[0],f[1]),L=I(k[0],k[1]),F=I(R,f[2])-I(L,k[2]);return F||I(R+f[2],O)-I(L+k[2],B);default:var N=f.slice(0);N.sort();var j=k.slice(0);j.sort();for(var G=0;G<_;++G)if(D=N[G]-j[G],D)return D;return 0}}e.compareCells=h;function v(f,k){return h(f[0],k[0])}function m(f,k){if(k){for(var _=f.length,D=new Array(_),I=0;I<_;++I)D[I]=[f[I],k[I]];D.sort(v);for(var I=0;I<_;++I)f[I]=D[I][0],k[I]=D[I][1];return f}else return f.sort(h),f}e.normalize=m;function p(f){if(f.length===0)return[];for(var k=1,_=f.length,D=1;D<_;++D){var I=f[D];if(h(I,f[D-1])){if(D===k){k++;continue}f[k++]=I}}return f.length=k,f}e.unique=p;function y(f,k){for(var _=0,D=f.length-1,I=-1;_<=D;){var O=_+D>>1,B=h(f[O],k);B<=0?(B===0&&(I=O),_=O+1):B>0&&(D=O-1)}return I}e.findCell=y;function l(f,k){for(var _=new Array(f.length),D=0,I=_.length;D<I;++D)_[D]=[];for(var O=[],D=0,B=k.length;D<B;++D)for(var R=k[D],L=R.length,F=1,N=1<<L;F<N;++F){O.length=i.popCount(F);for(var j=0,G=0;G<L;++G)F&1<<G&&(O[j++]=R[G]);var rt=y(f,O);if(!(rt<0))for(;_[rt++].push(D),!(rt>=f.length||h(f[rt],O)!==0););}return _}e.incidence=l;function x(f,k){if(!k)return l(p(S(f,0)),f);for(var _=new Array(k),D=0;D<k;++D)_[D]=[];for(var D=0,I=f.length;D<I;++D)for(var O=f[D],B=0,R=O.length;B<R;++B)_[O[B]].push(D);return _}e.dual=x;function b(f){for(var k=[],_=0,D=f.length;_<D;++_)for(var I=f[_],O=I.length|0,B=1,R=1<<O;B<R;++B){for(var L=[],F=0;F<O;++F)B>>>F&1&&L.push(I[F]);k.push(L)}return m(k)}e.explode=b;function S(f,k){if(k<0)return[];for(var _=[],D=(1<<k+1)-1,I=0;I<f.length;++I)for(var O=f[I],B=D;B<1<<O.length;B=i.nextCombination(B)){for(var R=new Array(k+1),L=0,F=0;F<O.length;++F)B&1<<F&&(R[L++]=O[F]);_.push(R)}return m(_)}e.skeleton=S;function T(f){for(var k=[],_=0,D=f.length;_<D;++_)for(var I=f[_],O=0,B=I.length;O<B;++O){for(var R=new Array(I.length-1),L=0,F=0;L<B;++L)L!==O&&(R[F++]=I[L]);k.push(R)}return m(k)}e.boundary=T;function M(f,k){for(var _=new n(k),D=0;D<f.length;++D)for(var I=f[D],O=0;O<I.length;++O)for(var B=O+1;B<I.length;++B)_.link(I[O],I[B]);for(var R=[],L=_.ranks,D=0;D<L.length;++D)L[D]=-1;for(var D=0;D<f.length;++D){var F=_.find(f[D][0]);L[F]<0?(L[F]=R.length,R.push([f[D].slice(0)])):R[L[F]].push(f[D].slice(0))}return R}function w(f){for(var k=p(m(S(f,0))),_=new n(k.length),D=0;D<f.length;++D)for(var I=f[D],O=0;O<I.length;++O)for(var B=y(k,[I[O]]),R=O+1;R<I.length;++R)_.link(B,y(k,[I[R]]));for(var L=[],F=_.ranks,D=0;D<F.length;++D)F[D]=-1;for(var D=0;D<f.length;++D){var N=_.find(y(k,[f[D][0]]));F[N]<0?(F[N]=L.length,L.push([f[D].slice(0)])):L[F[N]].push(f[D].slice(0))}return L}function u(f,k){return k?M(f,k):w(f)}e.connectedComponents=u},4623:function(t){"use restrict";t.exports=e;function e(r){this.roots=new Array(r),this.ranks=new Array(r);for(var i=0;i<r;++i)this.roots[i]=i,this.ranks[i]=0}e.prototype.length=function(){return this.roots.length},e.prototype.makeSet=function(){var r=this.roots.length;return this.roots.push(r),this.ranks.push(0),r},e.prototype.find=function(r){for(var i=this.roots;i[r]!==r;){var n=i[r];i[r]=i[n],r=n}return r},e.prototype.link=function(r,i){var n=this.find(r),o=this.find(i);if(n!==o){var a=this.ranks,s=this.roots,h=a[n],v=a[o];h<v?s[n]=o:v<h?s[o]=n:(s[o]=n,++a[n])}}},5878:function(t,e,r){t.exports=a;var i=r(3250),n=r(2014);function o(s,h,v){var m=Math.abs(i(s,h,v)),p=Math.sqrt(Math.pow(h[0]-v[0],2)+Math.pow(h[1]-v[1],2));return m/p}function a(s,h,v){for(var m=h.length,p=s.length,y=new Array(m),l=new Array(m),x=new Array(m),b=new Array(m),S=0;S<m;++S)y[S]=l[S]=-1,x[S]=1/0,b[S]=!1;for(var S=0;S<p;++S){var T=s[S];if(T.length!==2)throw new Error("Input must be a graph");var M=T[1],w=T[0];l[w]!==-1?l[w]=-2:l[w]=M,y[M]!==-1?y[M]=-2:y[M]=w}function u(tt){if(b[tt])return 1/0;var Z=y[tt],st=l[tt];return Z<0||st<0?1/0:o(h[tt],h[Z],h[st])}function f(tt,Z){var st=L[tt],$=L[Z];L[tt]=$,L[Z]=st,F[st]=Z,F[$]=tt}function k(tt){return x[L[tt]]}function _(tt){return tt&1?tt-1>>1:(tt>>1)-1}function D(tt){for(var Z=k(tt);;){var st=Z,$=2*tt+1,Q=2*(tt+1),nt=tt;if($<j){var Y=k($);Y<st&&(nt=$,st=Y)}if(Q<j){var q=k(Q);q<st&&(nt=Q)}if(nt===tt)return tt;f(tt,nt),tt=nt}}function I(tt){for(var Z=k(tt);tt>0;){var st=_(tt);if(st>=0){var $=k(st);if(Z<$){f(tt,st),tt=st;continue}}return tt}}function O(){if(j>0){var tt=L[0];return f(0,j-1),j-=1,D(0),tt}return-1}function B(tt,Z){var st=L[tt];return x[st]===Z?tt:(x[st]=-1/0,I(tt),O(),x[st]=Z,j+=1,I(j-1))}function R(tt){if(!b[tt]){b[tt]=!0;var Z=y[tt],st=l[tt];y[st]>=0&&(y[st]=Z),l[Z]>=0&&(l[Z]=st),F[Z]>=0&&B(F[Z],u(Z)),F[st]>=0&&B(F[st],u(st))}}for(var L=[],F=new Array(m),S=0;S<m;++S){var N=x[S]=u(S);N<1/0?(F[S]=L.length,L.push(S)):F[S]=-1}for(var j=L.length,S=j>>1;S>=0;--S)D(S);for(;;){var G=O();if(G<0||x[G]>v)break;R(G)}for(var rt=[],S=0;S<m;++S)b[S]||(F[S]=rt.length,rt.push(h[S].slice()));rt.length;function ct(tt,Z){if(tt[Z]<0)return Z;var st=Z,$=Z;do{var Q=tt[$];if(!b[$]||Q<0||Q===$||($=Q,Q=tt[$],!b[$]||Q<0||Q===$))break;$=Q,st=tt[st]}while(st!==$);for(var nt=Z;nt!==$;nt=tt[nt])tt[nt]=$;return $}var lt=[];return s.forEach(function(tt){var Z=ct(y,tt[0]),st=ct(l,tt[1]);if(Z>=0&&st>=0&&Z!==st){var $=F[Z],Q=F[st];$!==Q&<.push([$,Q])}}),n.unique(n.normalize(lt)),{positions:rt,edges:lt}}},1303:function(t,e,r){t.exports=o;var i=r(3250);function n(a,s){var h,v;if(s[0][0]<s[1][0])h=s[0],v=s[1];else if(s[0][0]>s[1][0])h=s[1],v=s[0];else{var m=Math.min(a[0][1],a[1][1]),p=Math.max(a[0][1],a[1][1]),y=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return p<y?p-y:m>l?m-l:p-l}var x,b;a[0][1]<a[1][1]?(x=a[0],b=a[1]):(x=a[1],b=a[0]);var S=i(v,h,x);return S||(S=i(v,h,b),S)?S:b-v}function o(a,s){var h,v;if(s[0][0]<s[1][0])h=s[0],v=s[1];else if(s[0][0]>s[1][0])h=s[1],v=s[0];else return n(s,a);var m,p;if(a[0][0]<a[1][0])m=a[0],p=a[1];else if(a[0][0]>a[1][0])m=a[1],p=a[0];else return-n(a,s);var y=i(h,v,p),l=i(h,v,m);if(y<0){if(l<=0)return y}else if(y>0){if(l>=0)return y}else if(l)return l;if(y=i(p,m,v),l=i(p,m,h),y<0){if(l<=0)return y}else if(y>0){if(l>=0)return y}else if(l)return l;return v[0]-p[0]}},4209:function(t,e,r){t.exports=l;var i=r(2478),n=r(3840),o=r(3250),a=r(1303);function s(x,b,S){this.slabs=x,this.coordinates=b,this.horizontal=S}var h=s.prototype;function v(x,b){return x.y-b}function m(x,b){for(var S=null;x;){var T=x.key,M,w;T[0][0]<T[1][0]?(M=T[0],w=T[1]):(M=T[1],w=T[0]);var u=o(M,w,b);if(u<0)x=x.left;else if(u>0)if(b[0]!==T[1][0])S=x,x=x.right;else{var f=m(x.right,b);if(f)return f;x=x.left}else{if(b[0]!==T[1][0])return x;var f=m(x.right,b);if(f)return f;x=x.left}}return S}h.castUp=function(x){var b=i.le(this.coordinates,x[0]);if(b<0)return-1;this.slabs[b];var S=m(this.slabs[b],x),T=-1;if(S&&(T=S.value),this.coordinates[b]===x[0]){var M=null;if(S&&(M=S.key),b>0){var w=m(this.slabs[b-1],x);w&&(M?a(w.key,M)>0&&(M=w.key,T=w.value):(T=w.value,M=w.key))}var u=this.horizontal[b];if(u.length>0){var f=i.ge(u,x[1],v);if(f<u.length){var k=u[f];if(x[1]===k.y){if(k.closed)return k.index;for(;f<u.length-1&&u[f+1].y===x[1];)if(f=f+1,k=u[f],k.closed)return k.index;if(k.y===x[1]&&!k.start){if(f=f+1,f>=u.length)return T;k=u[f]}}if(k.start)if(M){var _=o(M[0],M[1],[x[0],k.y]);M[0][0]>M[1][0]&&(_=-_),_>0&&(T=k.index)}else T=k.index;else k.y!==x[1]&&(T=k.index)}}}return T};function p(x,b,S,T){this.y=x,this.index=b,this.start=S,this.closed=T}function y(x,b,S,T){this.x=x,this.segment=b,this.create=S,this.index=T}function l(x){for(var b=x.length,S=2*b,T=new Array(S),M=0;M<b;++M){var w=x[M],u=w[0][0]<w[1][0];T[2*M]=new y(w[0][0],w,u,M),T[2*M+1]=new y(w[1][0],w,!u,M)}T.sort(function(L,F){var N=L.x-F.x;return N||(N=L.create-F.create,N)?N:Math.min(L.segment[0][1],L.segment[1][1])-Math.min(F.segment[0][1],F.segment[1][1])});for(var f=n(a),k=[],_=[],D=[],I=-1/0,M=0;M<S;){for(var O=T[M].x,B=[];M<S;){var R=T[M];if(R.x!==O)break;M+=1,R.segment[0][0]===R.x&&R.segment[1][0]===R.x?R.create&&(R.segment[0][1]<R.segment[1][1]?(B.push(new p(R.segment[0][1],R.index,!0,!0)),B.push(new p(R.segment[1][1],R.index,!1,!1))):(B.push(new p(R.segment[1][1],R.index,!0,!1)),B.push(new p(R.segment[0][1],R.index,!1,!0)))):R.create?f=f.insert(R.segment,R.index):f=f.remove(R.segment)}k.push(f.root),_.push(O),D.push(B)}return new s(k,_,D)}},5202:function(t,e,r){var i=r(1944),n=r(8210);t.exports=s,t.exports.positive=h,t.exports.negative=v;function o(m,p){var y=n(i(m,p),[p[p.length-1]]);return y[y.length-1]}function a(m,p,y,l){var x=l-p,b=-p/x;b<0?b=0:b>1&&(b=1);for(var S=1-b,T=m.length,M=new Array(T),w=0;w<T;++w)M[w]=b*m[w]+S*y[w];return M}function s(m,p){for(var y=[],l=[],x=o(m[m.length-1],p),b=m[m.length-1],S=m[0],T=0;T<m.length;++T,b=S){S=m[T];var M=o(S,p);if(x<0&&M>0||x>0&&M<0){var w=a(b,M,S,x);y.push(w),l.push(w.slice())}M<0?l.push(S.slice()):M>0?y.push(S.slice()):(y.push(S.slice()),l.push(S.slice())),x=M}return{positive:y,negative:l}}function h(m,p){for(var y=[],l=o(m[m.length-1],p),x=m[m.length-1],b=m[0],S=0;S<m.length;++S,x=b){b=m[S];var T=o(b,p);(l<0&&T>0||l>0&&T<0)&&y.push(a(x,T,b,l)),T>=0&&y.push(b.slice()),l=T}return y}function v(m,p){for(var y=[],l=o(m[m.length-1],p),x=m[m.length-1],b=m[0],S=0;S<m.length;++S,x=b){b=m[S];var T=o(b,p);(l<0&&T>0||l>0&&T<0)&&y.push(a(x,T,b,l)),T<=0&&y.push(b.slice()),l=T}return y}},3387:function(t,e,r){var i;(function(){var n={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(m){return s(v(m),arguments)}function a(m,p){return o.apply(null,[m].concat(p||[]))}function s(m,p){var y=1,l=m.length,x,b="",S,T,M,w,u,f,k,_;for(S=0;S<l;S++)if(typeof m[S]=="string")b+=m[S];else if(typeof m[S]=="object"){if(M=m[S],M.keys)for(x=p[y],T=0;T<M.keys.length;T++){if(x==null)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',M.keys[T],M.keys[T-1]));x=x[M.keys[T]]}else M.param_no?x=p[M.param_no]:x=p[y++];if(n.not_type.test(M.type)&&n.not_primitive.test(M.type)&&x instanceof Function&&(x=x()),n.numeric_arg.test(M.type)&&typeof x!="number"&&isNaN(x))throw new TypeError(o("[sprintf] expecting number but found %T",x));switch(n.number.test(M.type)&&(k=x>=0),M.type){case"b":x=parseInt(x,10).toString(2);break;case"c":x=String.fromCharCode(parseInt(x,10));break;case"d":case"i":x=parseInt(x,10);break;case"j":x=JSON.stringify(x,null,M.width?parseInt(M.width):0);break;case"e":x=M.precision?parseFloat(x).toExponential(M.precision):parseFloat(x).toExponential();break;case"f":x=M.precision?parseFloat(x).toFixed(M.precision):parseFloat(x);break;case"g":x=M.precision?String(Number(x.toPrecision(M.precision))):parseFloat(x);break;case"o":x=(parseInt(x,10)>>>0).toString(8);break;case"s":x=String(x),x=M.precision?x.substring(0,M.precision):x;break;case"t":x=String(!!x),x=M.precision?x.substring(0,M.precision):x;break;case"T":x=Object.prototype.toString.call(x).slice(8,-1).toLowerCase(),x=M.precision?x.substring(0,M.precision):x;break;case"u":x=parseInt(x,10)>>>0;break;case"v":x=x.valueOf(),x=M.precision?x.substring(0,M.precision):x;break;case"x":x=(parseInt(x,10)>>>0).toString(16);break;case"X":x=(parseInt(x,10)>>>0).toString(16).toUpperCase();break}n.json.test(M.type)?b+=x:(n.number.test(M.type)&&(!k||M.sign)?(_=k?"+":"-",x=x.toString().replace(n.sign,"")):_="",u=M.pad_char?M.pad_char==="0"?"0":M.pad_char.charAt(1):" ",f=M.width-(_+x).length,w=M.width&&f>0?u.repeat(f):"",b+=M.align?_+x+w:u==="0"?_+w+x:w+_+x)}return b}var h=Object.create(null);function v(m){if(h[m])return h[m];for(var p=m,y,l=[],x=0;p;){if((y=n.text.exec(p))!==null)l.push(y[0]);else if((y=n.modulo.exec(p))!==null)l.push("%");else if((y=n.placeholder.exec(p))!==null){if(y[2]){x|=1;var b=[],S=y[2],T=[];if((T=n.key.exec(S))!==null)for(b.push(T[1]);(S=S.substring(T[0].length))!=="";)if((T=n.key_access.exec(S))!==null)b.push(T[1]);else if((T=n.index_access.exec(S))!==null)b.push(T[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");y[2]=b}else x|=2;if(x===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");l.push({placeholder:y[0],param_no:y[1],keys:y[2],sign:y[3],pad_char:y[4],align:y[5],width:y[6],precision:y[7],type:y[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");p=p.substring(y[0].length)}return h[m]=l}e.sprintf=o,e.vsprintf=a,typeof window<"u"&&(window.sprintf=o,window.vsprintf=a,i=function(){return{sprintf:o,vsprintf:a}}.call(e,r,e,t),i!==void 0&&(t.exports=i))})()},3711:function(t,e,r){t.exports=v;var i=r(2640),n=r(781),o={"2d":function(m,p,y){var l=m({order:p,scalarArguments:3,getters:y==="generic"?[0]:void 0,phase:function(x,b,S,T){return x>T|0},vertex:function(x,b,S,T,M,w,u,f,k,_,D,I,O){var B=(u<<0)+(f<<1)+(k<<2)+(_<<3)|0;if(!(B===0||B===15))switch(B){case 0:D.push([x-.5,b-.5]);break;case 1:D.push([x-.25-.25*(T+S-2*O)/(S-T),b-.25-.25*(M+S-2*O)/(S-M)]);break;case 2:D.push([x-.75-.25*(-T-S+2*O)/(T-S),b-.25-.25*(w+T-2*O)/(T-w)]);break;case 3:D.push([x-.5,b-.5-.5*(M+S+w+T-4*O)/(S-M+T-w)]);break;case 4:D.push([x-.25-.25*(w+M-2*O)/(M-w),b-.75-.25*(-M-S+2*O)/(M-S)]);break;case 5:D.push([x-.5-.5*(T+S+w+M-4*O)/(S-T+M-w),b-.5]);break;case 6:D.push([x-.5-.25*(-T-S+w+M)/(T-S+M-w),b-.5-.25*(-M-S+w+T)/(M-S+T-w)]);break;case 7:D.push([x-.75-.25*(w+M-2*O)/(M-w),b-.75-.25*(w+T-2*O)/(T-w)]);break;case 8:D.push([x-.75-.25*(-w-M+2*O)/(w-M),b-.75-.25*(-w-T+2*O)/(w-T)]);break;case 9:D.push([x-.5-.25*(T+S+-w-M)/(S-T+w-M),b-.5-.25*(M+S+-w-T)/(S-M+w-T)]);break;case 10:D.push([x-.5-.5*(-T-S+-w-M+4*O)/(T-S+w-M),b-.5]);break;case 11:D.push([x-.25-.25*(-w-M+2*O)/(w-M),b-.75-.25*(M+S-2*O)/(S-M)]);break;case 12:D.push([x-.5,b-.5-.5*(-M-S+-w-T+4*O)/(M-S+w-T)]);break;case 13:D.push([x-.75-.25*(T+S-2*O)/(S-T),b-.25-.25*(-w-T+2*O)/(w-T)]);break;case 14:D.push([x-.25-.25*(-T-S+2*O)/(T-S),b-.25-.25*(-M-S+2*O)/(M-S)]);break;case 15:D.push([x-.5,b-.5]);break}},cell:function(x,b,S,T,M,w,u,f,k){M?f.push([x,b]):f.push([b,x])}});return function(x,b){var S=[],T=[];return l(x,S,T,b),{positions:S,cells:T}}}};function a(m,p){var y=m.length+"d",l=o[y];if(l)return l(i,m,p)}function s(m,p){for(var y=n(m,p),l=y.length,x=new Array(l),b=new Array(l),S=0;S<l;++S)x[S]=[y[S]],b[S]=[S];return{positions:x,cells:b}}var h={};function v(m,x){if(m.dimension<=0)return{positions:[],cells:[]};if(m.dimension===1)return s(m,x);var y=m.order.join()+"-"+m.dtype,l=h[y],x=+x||0;return l||(l=h[y]=a(m.order,m.dtype)),l(m,x)}},665:function(t,e,r){var i=r(3202);t.exports=s;var n=96;function o(h,v){var m=i(getComputedStyle(h).getPropertyValue(v));return m[0]*s(m[1],h)}function a(h,v){var m=document.createElement("div");m.style["font-size"]="128"+h,v.appendChild(m);var p=o(m,"font-size")/128;return v.removeChild(m),p}function s(h,v){switch(v=v||document.body,h=(h||"px").trim().toLowerCase(),(v===window||v===document)&&(v=document.body),h){case"%":return v.clientHeight/100;case"ch":case"ex":return a(h,v);case"em":return o(v,"font-size");case"rem":return o(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return n;case"cm":return n/2.54;case"mm":return n/25.4;case"pt":return n/72;case"pc":return n/6}return 1}},7261:function(t,e,r){t.exports=b;var i=r(9215),n=r(7608),o=r(6079),a=r(5911),s=r(3536),h=r(244);function v(S,T,M){return Math.sqrt(Math.pow(S,2)+Math.pow(T,2)+Math.pow(M,2))}function m(S){return Math.min(1,Math.max(-1,S))}function p(S){var T=Math.abs(S[0]),M=Math.abs(S[1]),w=Math.abs(S[2]),u=[0,0,0];T>Math.max(M,w)?u[2]=1:M>Math.max(T,w)?u[0]=1:u[1]=1;for(var f=0,k=0,_=0;_<3;++_)f+=S[_]*S[_],k+=u[_]*S[_];for(var _=0;_<3;++_)u[_]-=k/f*S[_];return s(u,u),u}function y(S,T,M,w,u,f,k,_){this.center=i(M),this.up=i(w),this.right=i(u),this.radius=i([f]),this.angle=i([k,_]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(S,T),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var D=0;D<16;++D)this.computedMatrix[D]=.5;this.recalcMatrix(0)}var l=y.prototype;l.setDistanceLimits=function(S,T){S>0?S=Math.log(S):S=-1/0,T>0?T=Math.log(T):T=1/0,T=Math.max(T,S),this.radius.bounds[0][0]=S,this.radius.bounds[1][0]=T},l.getDistanceLimits=function(S){var T=this.radius.bounds[0];return S?(S[0]=Math.exp(T[0][0]),S[1]=Math.exp(T[1][0]),S):[Math.exp(T[0][0]),Math.exp(T[1][0])]},l.recalcMatrix=function(S){this.center.curve(S),this.up.curve(S),this.right.curve(S),this.radius.curve(S),this.angle.curve(S);for(var T=this.computedUp,M=this.computedRight,w=0,u=0,f=0;f<3;++f)u+=T[f]*M[f],w+=T[f]*T[f];for(var k=Math.sqrt(w),_=0,f=0;f<3;++f)M[f]-=T[f]*u/w,_+=M[f]*M[f],T[f]/=k;for(var D=Math.sqrt(_),f=0;f<3;++f)M[f]/=D;var I=this.computedToward;a(I,T,M),s(I,I);for(var O=Math.exp(this.computedRadius[0]),B=this.computedAngle[0],R=this.computedAngle[1],L=Math.cos(B),F=Math.sin(B),N=Math.cos(R),j=Math.sin(R),G=this.computedCenter,rt=L*N,ct=F*N,lt=j,tt=-L*j,Z=-F*j,st=N,$=this.computedEye,Q=this.computedMatrix,f=0;f<3;++f){var nt=rt*M[f]+ct*I[f]+lt*T[f];Q[4*f+1]=tt*M[f]+Z*I[f]+st*T[f],Q[4*f+2]=nt,Q[4*f+3]=0}var Y=Q[1],q=Q[5],ot=Q[9],it=Q[2],dt=Q[6],wt=Q[10],xt=q*wt-ot*dt,Ft=ot*it-Y*wt,Et=Y*dt-q*it,Nt=v(xt,Ft,Et);xt/=Nt,Ft/=Nt,Et/=Nt,Q[0]=xt,Q[4]=Ft,Q[8]=Et;for(var f=0;f<3;++f)$[f]=G[f]+Q[2+4*f]*O;for(var f=0;f<3;++f){for(var _=0,te=0;te<3;++te)_+=Q[f+4*te]*$[te];Q[12+f]=-_}Q[15]=1},l.getMatrix=function(S,T){this.recalcMatrix(S);var M=this.computedMatrix;if(T){for(var w=0;w<16;++w)T[w]=M[w];return T}return M};var x=[0,0,0];l.rotate=function(S,T,M,w){if(this.angle.move(S,T,M),w){this.recalcMatrix(S);var u=this.computedMatrix;x[0]=u[2],x[1]=u[6],x[2]=u[10];for(var f=this.computedUp,k=this.computedRight,_=this.computedToward,D=0;D<3;++D)u[4*D]=f[D],u[4*D+1]=k[D],u[4*D+2]=_[D];o(u,u,w,x);for(var D=0;D<3;++D)f[D]=u[4*D],k[D]=u[4*D+1];this.up.set(S,f[0],f[1],f[2]),this.right.set(S,k[0],k[1],k[2])}},l.pan=function(S,T,M,w){T=T||0,M=M||0,w=w||0,this.recalcMatrix(S);var u=this.computedMatrix;Math.exp(this.computedRadius[0]);var f=u[1],k=u[5],_=u[9],D=v(f,k,_);f/=D,k/=D,_/=D;var I=u[0],O=u[4],B=u[8],R=I*f+O*k+B*_;I-=f*R,O-=k*R,B-=_*R;var L=v(I,O,B);I/=L,O/=L,B/=L;var F=I*T+f*M,N=O*T+k*M,j=B*T+_*M;this.center.move(S,F,N,j);var G=Math.exp(this.computedRadius[0]);G=Math.max(1e-4,G+w),this.radius.set(S,Math.log(G))},l.translate=function(S,T,M,w){this.center.move(S,T||0,M||0,w||0)},l.setMatrix=function(S,T,M,w){var u=1;typeof M=="number"&&(u=M|0),(u<0||u>3)&&(u=1);var f=(u+2)%3;T||(this.recalcMatrix(S),T=this.computedMatrix);var k=T[u],_=T[u+4],D=T[u+8];if(w){var I=Math.abs(k),O=Math.abs(_),B=Math.abs(D),R=Math.max(I,O,B);I===R?(k=k<0?-1:1,_=D=0):B===R?(D=D<0?-1:1,k=_=0):(_=_<0?-1:1,k=D=0)}else{var L=v(k,_,D);k/=L,_/=L,D/=L}var F=T[f],N=T[f+4],j=T[f+8],G=F*k+N*_+j*D;F-=k*G,N-=_*G,j-=D*G;var rt=v(F,N,j);F/=rt,N/=rt,j/=rt;var ct=_*j-D*N,lt=D*F-k*j,tt=k*N-_*F,Z=v(ct,lt,tt);ct/=Z,lt/=Z,tt/=Z,this.center.jump(S,gt,bt,vt),this.radius.idle(S),this.up.jump(S,k,_,D),this.right.jump(S,F,N,j);var st,$;if(u===2){var Q=T[1],nt=T[5],Y=T[9],q=Q*F+nt*N+Y*j,ot=Q*ct+nt*lt+Y*tt;xt<0?st=-Math.PI/2:st=Math.PI/2,$=Math.atan2(ot,q)}else{var it=T[2],dt=T[6],wt=T[10],xt=it*k+dt*_+wt*D,Ft=it*F+dt*N+wt*j,Et=it*ct+dt*lt+wt*tt;st=Math.asin(m(xt)),$=Math.atan2(Et,Ft)}this.angle.jump(S,$,st),this.recalcMatrix(S);var Nt=T[2],te=T[6],Jt=T[10],Qt=this.computedMatrix;n(Qt,T);var Wt=Qt[15],gt=Qt[12]/Wt,bt=Qt[13]/Wt,vt=Qt[14]/Wt,Ut=Math.exp(this.computedRadius[0]);this.center.jump(S,gt-Nt*Ut,bt-te*Ut,vt-Jt*Ut)},l.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},l.idle=function(S){this.center.idle(S),this.up.idle(S),this.right.idle(S),this.radius.idle(S),this.angle.idle(S)},l.flush=function(S){this.center.flush(S),this.up.flush(S),this.right.flush(S),this.radius.flush(S),this.angle.flush(S)},l.setDistance=function(S,T){T>0&&this.radius.set(S,Math.log(T))},l.lookAt=function(S,T,M,w){this.recalcMatrix(S),T=T||this.computedEye,M=M||this.computedCenter,w=w||this.computedUp;var u=w[0],f=w[1],k=w[2],_=v(u,f,k);if(!(_<1e-6)){u/=_,f/=_,k/=_;var D=T[0]-M[0],I=T[1]-M[1],O=T[2]-M[2],B=v(D,I,O);if(!(B<1e-6)){D/=B,I/=B,O/=B;var R=this.computedRight,L=R[0],F=R[1],N=R[2],j=u*L+f*F+k*N;L-=j*u,F-=j*f,N-=j*k;var G=v(L,F,N);if(!(G<.01&&(L=f*O-k*I,F=k*D-u*O,N=u*I-f*D,G=v(L,F,N),G<1e-6))){L/=G,F/=G,N/=G,this.up.set(S,u,f,k),this.right.set(S,L,F,N),this.center.set(S,M[0],M[1],M[2]),this.radius.set(S,Math.log(B));var rt=f*N-k*F,ct=k*L-u*N,lt=u*F-f*L,tt=v(rt,ct,lt);rt/=tt,ct/=tt,lt/=tt;var Z=u*D+f*I+k*O,st=L*D+F*I+N*O,$=rt*D+ct*I+lt*O,Q=Math.asin(m(Z)),nt=Math.atan2($,st),Y=this.angle._state,q=Y[Y.length-1],ot=Y[Y.length-2];q=q%(2*Math.PI);var it=Math.abs(q+2*Math.PI-nt),dt=Math.abs(q-nt),wt=Math.abs(q-2*Math.PI-nt);it<dt&&(q+=2*Math.PI),wt<dt&&(q-=2*Math.PI),this.angle.jump(this.angle.lastT(),q,ot),this.angle.set(S,nt,Q)}}}};function b(S){S=S||{};var T=S.center||[0,0,0],M=S.up||[0,1,0],w=S.right||p(M),u=S.radius||1,f=S.theta||0,k=S.phi||0;if(T=[].slice.call(T,0,3),M=[].slice.call(M,0,3),s(M,M),w=[].slice.call(w,0,3),s(w,w),"eye"in S){var _=S.eye,D=[_[0]-T[0],_[1]-T[1],_[2]-T[2]];a(w,D,M),v(w[0],w[1],w[2])<1e-6?w=p(M):s(w,w),u=v(D[0],D[1],D[2]);var I=h(M,D)/u,O=h(w,D)/u;k=Math.acos(I),f=Math.acos(O)}return u=Math.log(u),new y(S.zoomMin,S.zoomMax,T,M,w,u,f,k)}},5250:function(t){t.exports=r;var e=+(Math.pow(2,27)+1);function r(i,n,o){var a=i*n,s=e*i,h=s-i,v=s-h,m=i-v,p=e*n,y=p-n,l=p-y,x=n-l,b=a-v*l,S=b-m*l,T=S-v*x,M=m*x-T;return o?(o[0]=M,o[1]=a,o):[M,a]}},9362:function(t){t.exports=e;function e(r,i,n){var o=r+i,a=o-r,s=o-a,h=i-a,v=r-s;return n?(n[0]=v+h,n[1]=o,n):[v+h,o]}},1888:function(t,e,r){var i=r(8828),n=r(1338),o=r(4793).hp;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:n([32,0]),UINT16:n([32,0]),UINT32:n([32,0]),BIGUINT64:n([32,0]),INT8:n([32,0]),INT16:n([32,0]),INT32:n([32,0]),BIGINT64:n([32,0]),FLOAT:n([32,0]),DOUBLE:n([32,0]),DATA:n([32,0]),UINT8C:n([32,0]),BUFFER:n([32,0])});var a=typeof Uint8ClampedArray<"u",s=typeof BigUint64Array<"u",h=typeof BigInt64Array<"u",v=r.g.__TYPEDARRAY_POOL;v.UINT8C||(v.UINT8C=n([32,0])),v.BIGUINT64||(v.BIGUINT64=n([32,0])),v.BIGINT64||(v.BIGINT64=n([32,0])),v.BUFFER||(v.BUFFER=n([32,0]));var m=v.DATA,p=v.BUFFER;e.free=function(R){if(o.isBuffer(R))p[i.log2(R.length)].push(R);else{if(Object.prototype.toString.call(R)!=="[object ArrayBuffer]"&&(R=R.buffer),!R)return;var L=R.length||R.byteLength,F=i.log2(L)|0;m[F].push(R)}};function y(R){if(R){var L=R.length||R.byteLength,F=i.log2(L);m[F].push(R)}}function l(R){y(R.buffer)}e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=l,e.freeArrayBuffer=y,e.freeBuffer=function(R){p[i.log2(R.length)].push(R)},e.malloc=function(R,L){if(L===void 0||L==="arraybuffer")return x(R);switch(L){case"uint8":return b(R);case"uint16":return S(R);case"uint32":return T(R);case"int8":return M(R);case"int16":return w(R);case"int32":return u(R);case"float":case"float32":return f(R);case"double":case"float64":return k(R);case"uint8_clamped":return _(R);case"bigint64":return I(R);case"biguint64":return D(R);case"buffer":return B(R);case"data":case"dataview":return O(R);default:return null}return null};function x(L){var L=i.nextPow2(L),F=i.log2(L),N=m[F];return N.length>0?N.pop():new ArrayBuffer(L)}e.mallocArrayBuffer=x;function b(R){return new Uint8Array(x(R),0,R)}e.mallocUint8=b;function S(R){return new Uint16Array(x(2*R),0,R)}e.mallocUint16=S;function T(R){return new Uint32Array(x(4*R),0,R)}e.mallocUint32=T;function M(R){return new Int8Array(x(R),0,R)}e.mallocInt8=M;function w(R){return new Int16Array(x(2*R),0,R)}e.mallocInt16=w;function u(R){return new Int32Array(x(4*R),0,R)}e.mallocInt32=u;function f(R){return new Float32Array(x(4*R),0,R)}e.mallocFloat32=e.mallocFloat=f;function k(R){return new Float64Array(x(8*R),0,R)}e.mallocFloat64=e.mallocDouble=k;function _(R){return a?new Uint8ClampedArray(x(R),0,R):b(R)}e.mallocUint8Clamped=_;function D(R){return s?new BigUint64Array(x(8*R),0,R):null}e.mallocBigUint64=D;function I(R){return h?new BigInt64Array(x(8*R),0,R):null}e.mallocBigInt64=I;function O(R){return new DataView(x(R),0,R)}e.mallocDataView=O;function B(R){R=i.nextPow2(R);var L=i.log2(R),F=p[L];return F.length>0?F.pop():new o(R)}e.mallocBuffer=B,e.clearCache=function(){for(var R=0;R<32;++R)v.UINT8[R].length=0,v.UINT16[R].length=0,v.UINT32[R].length=0,v.INT8[R].length=0,v.INT16[R].length=0,v.INT32[R].length=0,v.FLOAT[R].length=0,v.DOUBLE[R].length=0,v.BIGUINT64[R].length=0,v.BIGINT64[R].length=0,v.UINT8C[R].length=0,m[R].length=0,p[R].length=0}},1755:function(t){"use restrict";t.exports=e;function e(i){this.roots=new Array(i),this.ranks=new Array(i);for(var n=0;n<i;++n)this.roots[n]=n,this.ranks[n]=0}var r=e.prototype;Object.defineProperty(r,"length",{get:function(){return this.roots.length}}),r.makeSet=function(){var i=this.roots.length;return this.roots.push(i),this.ranks.push(0),i},r.find=function(i){for(var n=i,o=this.roots;o[i]!==i;)i=o[i];for(;o[n]!==i;){var a=o[n];o[n]=i,n=a}return i},r.link=function(i,n){var o=this.find(i),a=this.find(n);if(o!==a){var s=this.ranks,h=this.roots,v=s[o],m=s[a];v<m?h[o]=a:m<v?h[a]=o:(h[a]=o,++s[o])}}},1682:function(t){function e(n,o){for(var a=1,s=n.length,h=n[0],v=n[0],m=1;m<s;++m)if(v=h,h=n[m],o(h,v)){if(m===a){a++;continue}n[a++]=h}return n.length=a,n}function r(n){for(var o=1,a=n.length,s=n[0],h=n[0],v=1;v<a;++v,h=s)if(h=s,s=n[v],s!==h){if(v===o){o++;continue}n[o++]=s}return n.length=o,n}function i(n,o,a){return n.length===0?n:o?(a||n.sort(o),e(n,o)):(a||n.sort(),r(n))}t.exports=i},4359:function(t,e,r){t.exports=a;var i=r(7718),n=null,o=null;typeof document<"u"&&(n=document.createElement("canvas"),n.width=8192,n.height=1024,o=n.getContext("2d"));function a(s,h){return(typeof h!="object"||h===null)&&(h={}),i(s,h.canvas||n,h.context||o,h)}},7718:function(t,e,r){t.exports=I,t.exports.processPixels=D;var i=r(3711),n=r(9618),o=r(5878),a=r(332),s=r(2538),h=r(2095),v="b",m="b|",p="i",y="i|",l="sup",x="+",b="+1",S="sub",T="-",M="-1";function w(O,B,R,L){for(var F="<"+O+">",N="</"+O+">",j=F.length,G=N.length,rt=B[0]===x||B[0]===T,ct=0,lt=-G;ct>-1&&(ct=R.indexOf(F,ct),!(ct===-1||(lt=R.indexOf(N,ct+j),lt===-1)||lt<=ct));){for(var tt=ct;tt<lt+G;++tt)if(tt<ct+j||tt>=lt)L[tt]=null,R=R.substr(0,tt)+" "+R.substr(tt+1);else if(L[tt]!==null){var Z=L[tt].indexOf(B[0]);Z===-1?L[tt]+=B:rt&&(L[tt]=L[tt].substr(0,Z+1)+(1+parseInt(L[tt][Z+1]))+L[tt].substr(Z+2))}var st=ct+j,$=R.substr(st,lt-st),Q=$.indexOf(F);Q!==-1?ct=Q:ct=lt+G}return L}function u(O,B,R){for(var L=B.textAlign||"start",F=B.textBaseline||"alphabetic",N=[1073741824,1073741824],j=[0,0],G=O.length,rt=0;rt<G;++rt)for(var ct=O[rt],lt=0;lt<2;++lt)N[lt]=Math.min(N[lt],ct[lt])|0,j[lt]=Math.max(j[lt],ct[lt])|0;var tt=0;switch(L){case"center":tt=-.5*(N[0]+j[0]);break;case"right":case"end":tt=-j[0];break;case"left":case"start":tt=-N[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+L+"'")}var Z=0;switch(F){case"hanging":case"top":Z=-N[1];break;case"middle":Z=-.5*(N[1]+j[1]);break;case"alphabetic":case"ideographic":Z=-3*R;break;case"bottom":Z=-j[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+F+"'")}var st=1/R;return"lineHeight"in B?st*=+B.lineHeight:"width"in B?st=B.width/(j[0]-N[0]):"height"in B&&(st=B.height/(j[1]-N[1])),O.map(function($){return[st*($[0]+tt),st*($[1]+Z)]})}function f(O,B,R,L,F,N){R=R.replace(/\n/g,""),N.breaklines===!0?R=R.replace(/\<br\>/g,`
|
||
`):R=R.replace(/\<br\>/g," ");var j="",G=[];for(q=0;q<R.length;++q)G[q]=j;N.bolds===!0&&(G=w(v,m,R,G)),N.italics===!0&&(G=w(p,y,R,G)),N.superscripts===!0&&(G=w(l,b,R,G)),N.subscripts===!0&&(G=w(S,M,R,G));var rt=[],ct="";for(q=0;q<R.length;++q)G[q]!==null&&(ct+=R[q],rt.push(G[q]));var lt=ct.split(`
|
||
`),tt=lt.length,Z=Math.round(F*L),st=L,$=L*2,Q=0,nt=tt*Z+$;O.height<nt&&(O.height=nt),B.fillStyle="#000",B.fillRect(0,0,O.width,O.height),B.fillStyle="#fff";var Y,q,ot,it,dt,wt=0,xt="";function Ft(){if(xt!==""){var vt=B.measureText(xt).width;B.fillText(xt,st+ot,$+it),ot+=vt}}function Et(){return""+Math.round(dt)+"px "}function Nt(vt,Ut){var Kt=""+B.font;if(N.subscripts===!0){var Zt=vt.indexOf(T),le=Ut.indexOf(T),Te=Zt>-1?parseInt(vt[1+Zt]):0,Se=le>-1?parseInt(Ut[1+le]):0;Te!==Se&&(Kt=Kt.replace(Et(),"?px "),dt*=Math.pow(.75,Se-Te),Kt=Kt.replace("?px ",Et())),it+=.25*Z*(Se-Te)}if(N.superscripts===!0){var Fe=vt.indexOf(x),Oe=Ut.indexOf(x),ur=Fe>-1?parseInt(vt[1+Fe]):0,fr=Oe>-1?parseInt(Ut[1+Oe]):0;ur!==fr&&(Kt=Kt.replace(Et(),"?px "),dt*=Math.pow(.75,fr-ur),Kt=Kt.replace("?px ",Et())),it-=.25*Z*(fr-ur)}if(N.bolds===!0){var We=vt.indexOf(m)>-1,Lr=Ut.indexOf(m)>-1;!We&&Lr&&(kr?Kt=Kt.replace("italic ","italic bold "):Kt="bold "+Kt),We&&!Lr&&(Kt=Kt.replace("bold ",""))}if(N.italics===!0){var kr=vt.indexOf(y)>-1,he=Ut.indexOf(y)>-1;!kr&&he&&(Kt="italic "+Kt),kr&&!he&&(Kt=Kt.replace("italic ",""))}B.font=Kt}for(Y=0;Y<tt;++Y){var te=lt[Y]+`
|
||
`;for(ot=0,it=Y*Z,dt=L,xt="",q=0;q<te.length;++q){var Jt=q+wt<rt.length?rt[q+wt]:rt[rt.length-1];j===Jt?xt+=te[q]:(Ft(),xt=te[q],Jt!==void 0&&(Nt(j,Jt),j=Jt))}Ft(),wt+=te.length;var Qt=Math.round(ot+2*st)|0;Q<Qt&&(Q=Qt)}var Wt=Q,gt=$+Z*tt,bt=n(B.getImageData(0,0,Wt,gt).data,[gt,Wt,4]);return bt.pick(-1,-1,0).transpose(1,0)}function k(O,B){var R=i(O,128);return B?o(R.cells,R.positions,.25):{edges:R.cells,positions:R.positions}}function _(O,B,R,L){var F=k(O,L),N=u(F.positions,B,R),j=F.edges,G=B.orientation==="ccw";if(a(N,j),B.polygons||B.polygon||B.polyline){for(var rt=h(j,N),ct=new Array(rt.length),lt=0;lt<rt.length;++lt){for(var tt=rt[lt],Z=new Array(tt.length),st=0;st<tt.length;++st){for(var $=tt[st],Q=new Array($.length),nt=0;nt<$.length;++nt)Q[nt]=N[$[nt]].slice();G&&Q.reverse(),Z[st]=Q}ct[lt]=Z}return ct}else return B.triangles||B.triangulate||B.triangle?{cells:s(N,j,{delaunay:!1,exterior:!1,interior:!0}),positions:N}:{edges:j,positions:N}}function D(O,B,R){try{return _(O,B,R,!0)}catch{}try{return _(O,B,R,!1)}catch{}return B.polygons||B.polyline||B.polygon?[]:B.triangles||B.triangulate||B.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function I(O,B,R,L){var F=64,N=1.25,j={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};L&&(L.size&&L.size>0&&(F=L.size),L.lineSpacing&&L.lineSpacing>0&&(N=L.lineSpacing),L.styletags&&L.styletags.breaklines&&(j.breaklines=!!L.styletags.breaklines),L.styletags&&L.styletags.bolds&&(j.bolds=!!L.styletags.bolds),L.styletags&&L.styletags.italics&&(j.italics=!!L.styletags.italics),L.styletags&&L.styletags.subscripts&&(j.subscripts=!!L.styletags.subscripts),L.styletags&&L.styletags.superscripts&&(j.superscripts=!!L.styletags.superscripts)),R.font=[L.fontStyle,L.fontVariant,L.fontWeight,F+"px",L.font].filter(function(rt){return rt}).join(" "),R.textAlign="start",R.textBaseline="alphabetic",R.direction="ltr";var G=f(B,R,O,F,N,j);return D(G,L,F)}},1538:function(t){(function(){if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function e(f){f.permitHostObjects___&&f.permitHostObjects___(e)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=e);var r=!1;if(typeof WeakMap=="function"){var i=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var n=new i,o=Object.freeze({});if(n.set(o,1),n.get(o)!==1)r=!0;else{t.exports=WeakMap;return}}}var a=Object.getOwnPropertyNames,s=Object.defineProperty,h=Object.isExtensible,v="weakmap:",m=v+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var p=new ArrayBuffer(25),y=new Uint8Array(p);crypto.getRandomValues(y),m=v+"rand:"+Array.prototype.map.call(y,function(f){return(f%36).toString(36)}).join("")+"___"}function l(f){return!(f.substr(0,v.length)==v&&f.substr(f.length-3)==="___")}if(s(Object,"getOwnPropertyNames",{value:function(f){return a(f).filter(l)}}),"getPropertyNames"in Object){var x=Object.getPropertyNames;s(Object,"getPropertyNames",{value:function(f){return x(f).filter(l)}})}function b(f){if(f!==Object(f))throw new TypeError("Not an object: "+f);var k=f[m];if(k&&k.key===f)return k;if(h(f)){k={key:f};try{return s(f,m,{value:k,writable:!1,enumerable:!1,configurable:!1}),k}catch{return}}}(function(){var f=Object.freeze;s(Object,"freeze",{value:function(D){return b(D),f(D)}});var k=Object.seal;s(Object,"seal",{value:function(D){return b(D),k(D)}});var _=Object.preventExtensions;s(Object,"preventExtensions",{value:function(D){return b(D),_(D)}})})();function S(f){return f.prototype=null,Object.freeze(f)}var T=!1;function M(){!T&&typeof console<"u"&&(T=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var w=0,u=function(){this instanceof u||M();var f=[],k=[],_=w++;function D(R,L){var F,N=b(R);return N?_ in N?N[_]:L:(F=f.indexOf(R),F>=0?k[F]:L)}function I(R){var L=b(R);return L?_ in L:f.indexOf(R)>=0}function O(R,L){var F,N=b(R);return N?N[_]=L:(F=f.indexOf(R),F>=0?k[F]=L:(F=f.length,k[F]=L,f[F]=R)),this}function B(R){var L=b(R),F,N;return L?_ in L&&delete L[_]:(F=f.indexOf(R),F<0?!1:(N=f.length-1,f[F]=void 0,k[F]=k[N],f[F]=f[N],f.length=N,k.length=N,!0))}return Object.create(u.prototype,{get___:{value:S(D)},has___:{value:S(I)},set___:{value:S(O)},delete___:{value:S(B)}})};u.prototype=Object.create(Object.prototype,{get:{value:function(f,k){return this.get___(f,k)},writable:!0,configurable:!0},has:{value:function(f){return this.has___(f)},writable:!0,configurable:!0},set:{value:function(f,k){return this.set___(f,k)},writable:!0,configurable:!0},delete:{value:function(f){return this.delete___(f)},writable:!0,configurable:!0}}),typeof i=="function"?function(){r&&typeof Proxy<"u"&&(Proxy=void 0);function f(){this instanceof u||M();var k=new i,_=void 0,D=!1;function I(L,F){return _?k.has(L)?k.get(L):_.get___(L,F):k.get(L,F)}function O(L){return k.has(L)||(_?_.has___(L):!1)}var B;r?B=function(L,F){return k.set(L,F),k.has(L)||(_||(_=new u),_.set(L,F)),this}:B=function(L,F){if(D)try{k.set(L,F)}catch{_||(_=new u),_.set___(L,F)}else k.set(L,F);return this};function R(L){var F=!!k.delete(L);return _&&_.delete___(L)||F}return Object.create(u.prototype,{get___:{value:S(I)},has___:{value:S(O)},set___:{value:S(B)},delete___:{value:S(R)},permitHostObjects___:{value:S(function(L){if(L===e)D=!0;else throw new Error("bogus call to permitHostObjects___")})}})}f.prototype=u.prototype,t.exports=f,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),t.exports=u)})()},236:function(t,e,r){var i=r(8284);t.exports=n;function n(){var o={};return function(a){if((typeof a!="object"||a===null)&&typeof a!="function")throw new Error("Weakmap-shim: Key must be object");var s=a.valueOf(o);return s&&s.identity===o?s:i(a,o)}}},8284:function(t){t.exports=e;function e(r,i){var n={identity:i},o=r.valueOf;return Object.defineProperty(r,"valueOf",{value:function(a){return a!==i?o.apply(this,arguments):n},writable:!0}),n}},606:function(t,e,r){var i=r(236);t.exports=n;function n(){var o=i();return{get:function(a,s){var h=o(a);return h.hasOwnProperty("value")?h.value:s},set:function(a,s){return o(a).value=s,this},has:function(a){return"value"in o(a)},delete:function(a){return delete o(a).value}}}},3349:function(t){function e(){return function(s,h,v,m,p,y){var l=s[0],x=v[0],b=[0],S=x;m|=0;var T=0,M=x;for(T=0;T<l;++T){{var w=h[m]-y,u=h[m+S]-y;w>=0!=u>=0&&p.push(b[0]+.5+.5*(w+u)/(w-u))}m+=M,++b[0]}}}function r(){return e()}var i=r;function n(s){var h={};return function(v,m,p){var y=v.dtype,l=v.order,x=[y,l.join()].join(),b=h[x];return b||(h[x]=b=s([y,l])),b(v.shape.slice(0),v.data,v.stride,v.offset|0,m,p)}}function o(s){return n(i.bind(void 0,s))}function a(s){return o({funcName:s.funcName})}t.exports=a({funcName:"zeroCrossings"})},781:function(t,e,r){t.exports=n;var i=r(3349);function n(o,a){var s=[];return a=+a||0,i(o.hi(o.shape[0]-1),s,a),s}},7790:function(){}},g={};function E(t){var e=g[t];if(e!==void 0)return e.exports;var r=g[t]={id:t,loaded:!1,exports:{}};return c[t].call(r.exports,r,r.exports,E),r.loaded=!0,r.exports}(function(){E.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}()})(),function(){E.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t}}();var A=E(1964);V.exports=A})()}),rE=Vt((X,V)=>{V.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),nE=Vt((X,V)=>{var c=rE();V.exports=E;var g={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function E(A){var t,e=[],r=1,i;if(typeof A=="string")if(A=A.toLowerCase(),c[A])e=c[A].slice(),i="rgb";else if(A==="transparent")r=0,i="rgb",e=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(A)){var n=A.slice(1),o=n.length,a=o<=4;r=1,a?(e=[parseInt(n[0]+n[0],16),parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16)],o===4&&(r=parseInt(n[3]+n[3],16)/255)):(e=[parseInt(n[0]+n[1],16),parseInt(n[2]+n[3],16),parseInt(n[4]+n[5],16)],o===8&&(r=parseInt(n[6]+n[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),i="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(A)){var s=t[1],h=s==="rgb",n=s.replace(/a$/,"");i=n;var o=n==="cmyk"?4:n==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(p,y){if(/%$/.test(p))return y===o?parseFloat(p)/100:n==="rgb"?parseFloat(p)*255/100:parseFloat(p);if(n[y]==="h"){if(/deg$/.test(p))return parseFloat(p);if(g[p]!==void 0)return g[p]}return parseFloat(p)}),s===n&&e.push(1),r=h||e[o]===void 0?1:e[o],e=e.slice(0,o)}else A.length>10&&/[0-9](?:\s|\/)/.test(A)&&(e=A.match(/([0-9]+)/g).map(function(v){return parseFloat(v)}),i=A.match(/([a-z])/ig).join("").toLowerCase());else isNaN(A)?Array.isArray(A)||A.length?(e=[A[0],A[1],A[2]],i="rgb",r=A.length===4?A[3]:1):A instanceof Object&&(A.r!=null||A.red!=null||A.R!=null?(i="rgb",e=[A.r||A.red||A.R||0,A.g||A.green||A.G||0,A.b||A.blue||A.B||0]):(i="hsl",e=[A.h||A.hue||A.H||0,A.s||A.saturation||A.S||0,A.l||A.lightness||A.L||A.b||A.brightness]),r=A.a||A.alpha||A.opacity||1,A.opacity!=null&&(r/=100)):(i="rgb",e=[A>>>16,(A&65280)>>>8,A&255]);return{space:i,values:e,alpha:r}}}),aE=Vt((X,V)=>{V.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}),iE=Vt((X,V)=>{var c=aE();V.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(g){var E=g[0]/360,A=g[1]/100,t=g[2]/100,e,r,i,n,o;if(A===0)return o=t*255,[o,o,o];t<.5?r=t*(1+A):r=t+A-t*A,e=2*t-r,n=[0,0,0];for(var a=0;a<3;a++)i=E+1/3*-(a-1),i<0?i++:i>1&&i--,6*i<1?o=e+(r-e)*6*i:2*i<1?o=r:3*i<2?o=e+(r-e)*(2/3-i)*6:o=e,n[a]=o*255;return n}},c.hsl=function(g){var E=g[0]/255,A=g[1]/255,t=g[2]/255,e=Math.min(E,A,t),r=Math.max(E,A,t),i=r-e,n,o,a;return r===e?n=0:E===r?n=(A-t)/i:A===r?n=2+(t-E)/i:t===r&&(n=4+(E-A)/i),n=Math.min(n*60,360),n<0&&(n+=360),a=(e+r)/2,r===e?o=0:a<=.5?o=i/(r+e):o=i/(2-r-e),[n,o*100,a*100]}}),qg=Vt((X,V)=>{V.exports=c;function c(g,E,A){return E<A?g<E?E:g>A?A:g:g<A?A:g>E?E:g}}),c3=Vt((X,V)=>{var c=nE(),g=iE(),E=qg();V.exports=function(A){var t,e=c(A);return e.space?(t=Array(3),t[0]=E(e.values[0],0,255),t[1]=E(e.values[1],0,255),t[2]=E(e.values[2],0,255),e.space[0]==="h"&&(t=g.rgb(t)),t.push(E(e.alpha,0,1)),t):[]}}),xx=Vt((X,V)=>{V.exports=function(c){switch(c){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}),jd=Vt((X,V)=>{var c=c3(),g=qg(),E=xx();V.exports=function(t,e){(e==="float"||!e)&&(e="array"),e==="uint"&&(e="uint8"),e==="uint_clamped"&&(e="uint8_clamped");var r=E(e),i=new r(4),n=e!=="uint8"&&e!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=c(t),t[0]/=255,t[1]/=255,t[2]/=255),A(t)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3]!=null?t[3]:255,n&&(i[0]/=255,i[1]/=255,i[2]/=255,i[3]/=255),i):(n?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3]!=null?t[3]:1):(i[0]=g(Math.floor(t[0]*255),0,255),i[1]=g(Math.floor(t[1]*255),0,255),i[2]=g(Math.floor(t[2]*255),0,255),i[3]=t[3]==null?255:g(Math.floor(t[3]*255),0,255)),i)};function A(t){return!!(t instanceof Uint8Array||t instanceof Uint8ClampedArray||Array.isArray(t)&&(t[0]>1||t[0]===0)&&(t[1]>1||t[1]===0)&&(t[2]>1||t[2]===0)&&(!t[3]||t[3]>1))}}),Gp=Vt((X,V)=>{var c=jd();function g(E){return E?c(E):[0,0,0,1]}V.exports=g}),Wp=Vt((X,V)=>{var c=vo(),g=yh(),E=jd(),A=Ul(),t=Hc().defaultLine,e=nf().isArrayOrTypedArray,r=E(t),i=1;function n(v,m){var p=v;return p[3]*=m,p}function o(v){if(c(v))return r;var m=E(v);return m.length?m:r}function a(v){return c(v)?v:i}function s(v,m,p){var y=v.color;y&&y._inputArray&&(y=y._inputArray);var l=e(y),x=e(m),b=A.extractOpts(v),S=[],T,M,w,u,f;if(b.colorscale!==void 0?T=A.makeColorScaleFuncFromTrace(v):T=o,l?M=function(_,D){return _[D]===void 0?r:E(T(_[D]))}:M=o,x?w=function(_,D){return _[D]===void 0?i:a(_[D])}:w=a,l||x)for(var k=0;k<p;k++)u=M(y,k),f=w(m,k),S[k]=n(u,f);else S=n(E(y),m);return S}function h(v){var m=A.extractOpts(v),p=m.colorscale;return m.reversescale&&(p=A.flipScale(m.colorscale)),p.map(function(y){var l=y[0],x=g(y[1]),b=x.toRgb();return{index:l,rgb:[b.r,b.g,b.b,b.a]}})}V.exports={formatColor:s,parseColorScale:h}}),h3=Vt((X,V)=>{V.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}}),_x=Vt((X,V)=>{V.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}}),oE=Vt((X,V)=>{var c=Mi();function g(t,e,r,i){if(!e||!e.visible)return null;for(var n=c.getComponentMethod("errorbars","makeComputeError")(e),o=new Array(t.length),a=0;a<t.length;a++){var s=n(+t[a],a);if(i.type==="log"){var h=i.c2l(t[a]),v=t[a]-s[0],m=t[a]+s[1];if(o[a]=[(i.c2l(v,!0)-h)*r,(i.c2l(m,!0)-h)*r],v>0){var p=i.c2l(v);i._lowerLogErrorBound||(i._lowerLogErrorBound=p),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,p)}}else o[a]=[-s[0]*r,s[1]*r]}return o}function E(t){for(var e=0;e<t.length;e++)if(t[e])return t[e].length;return 0}function A(t,e,r){var i=[g(t.x,t.error_x,e[0],r.xaxis),g(t.y,t.error_y,e[1],r.yaxis),g(t.z,t.error_z,e[2],r.zaxis)],n=E(i);if(n===0)return null;for(var o=new Array(n),a=0;a<n;a++){for(var s=[[0,0,0],[0,0,0]],h=0;h<3;h++)if(i[h])for(var v=0;v<2;v++)s[v][h]=i[h][a][v];o[a]=s}return o}V.exports=A}),sE=Vt((X,V)=>{var c=Dh().gl_line3d,g=Dh().gl_scatter3d,E=Dh().gl_error3d,A=Dh().gl_mesh3d,t=Dh().delaunay_triangulate,e=qr(),r=Gp(),i=Wp().formatColor,n=_g(),o=h3(),a=_x(),s=ao(),h=vf().appendArrayPointValue,v=oE();function m(D,I){this.scene=D,this.uid=I,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}var p=m.prototype;p.handlePick=function(D){if(D.object&&(D.object===this.linePlot||D.object===this.delaunayMesh||D.object===this.textMarkers||D.object===this.scatterPlot)){var I=D.index=D.data.index;return D.object.highlight&&D.object.highlight(null),this.scatterPlot&&(D.object=this.scatterPlot,this.scatterPlot.highlight(D.data)),D.textLabel="",this.textLabels&&(e.isArrayOrTypedArray(this.textLabels)?(this.textLabels[I]||this.textLabels[I]===0)&&(D.textLabel=this.textLabels[I]):D.textLabel=this.textLabels),D.traceCoordinate=[this.data.x[I],this.data.y[I],this.data.z[I]],!0}};function y(D,I,O){var B=(O+1)%3,R=(O+2)%3,L=[],F=[],N;for(N=0;N<D.length;++N){var j=D[N];isNaN(j[B])||!isFinite(j[B])||isNaN(j[R])||!isFinite(j[R])||(L.push([j[B],j[R]]),F.push(N))}var G=t(L);for(N=0;N<G.length;++N)for(var rt=G[N],ct=0;ct<rt.length;++ct)rt[ct]=F[rt[ct]];return{positions:D,cells:G,meshColor:I}}function l(D){for(var I=[0,0,0],O=[[0,0,0],[0,0,0],[0,0,0]],B=[1,1,1],R=0;R<3;R++){var L=D[R];L&&L.copy_zstyle!==!1&&D[2].visible!==!1&&(L=D[2]),!(!L||!L.visible)&&(I[R]=L.width/2,O[R]=r(L.color),B[R]=L.thickness)}return{capSize:I,color:O,lineWidth:B}}function x(D){return D==null?0:D.indexOf("left")>-1?-1:D.indexOf("right")>-1?1:0}function b(D){return D==null?0:D.indexOf("top")>-1?-1:D.indexOf("bottom")>-1?1:0}function S(D){var I=0,O=0,B=[I,O];if(Array.isArray(D))for(var R=0;R<D.length;R++)B[R]=[I,O],D[R]&&(B[R][0]=x(D[R]),B[R][1]=b(D[R]));else B[0]=x(D),B[1]=b(D);return B}function T(D,I){return I(D*4)}function M(D){return a[D]}function w(D,I,O,B,R){var L=null;if(e.isArrayOrTypedArray(D)){L=[];for(var F=0;F<I;F++)D[F]===void 0?L[F]=B:L[F]=O(D[F],R)}else L=O(D,e.identity);return L}function u(D,I){var O=[],B=D.fullSceneLayout,R=D.dataScale,L=B.xaxis,F=B.yaxis,N=B.zaxis,j=I.marker,G=I.line,rt=I.x||[],ct=I.y||[],lt=I.z||[],tt=rt.length,Z=I.xcalendar,st=I.ycalendar,$=I.zcalendar,Q,nt,Y,q,ot,it;for(ot=0;ot<tt;ot++)Q=L.d2l(rt[ot],0,Z)*R[0],nt=F.d2l(ct[ot],0,st)*R[1],Y=N.d2l(lt[ot],0,$)*R[2],O[ot]=[Q,nt,Y];if(Array.isArray(I.text))it=I.text;else if(e.isTypedArray(I.text))it=Array.from(I.text);else if(I.text!==void 0)for(it=new Array(tt),ot=0;ot<tt;ot++)it[ot]=I.text;function dt(Zt,le){var Te=B[Zt];return s.tickText(Te,Te.d2l(le),!0).text}var wt=I.texttemplate;if(wt){var xt=D.fullLayout,Ft=xt._d3locale,Et=Array.isArray(wt),Nt=Et?Math.min(wt.length,tt):tt,te=Et?function(Zt){return wt[Zt]}:function(){return wt};for(it=new Array(Nt),ot=0;ot<Nt;ot++){var Jt={x:rt[ot],y:ct[ot],z:lt[ot]},Qt={xLabel:dt("xaxis",rt[ot]),yLabel:dt("yaxis",ct[ot]),zLabel:dt("zaxis",lt[ot])},Wt={};h(Wt,I,ot);var gt=I._meta||{};it[ot]=e.texttemplateString(te(ot),Qt,Ft,Wt,Jt,gt)}}if(q={position:O,mode:I.mode,text:it},"line"in I&&(q.lineColor=i(G,1,tt),q.lineWidth=G.width,q.lineDashes=G.dash),"marker"in I){var bt=n(I);q.scatterColor=i(j,1,tt),q.scatterSize=w(j.size,tt,T,20,bt),q.scatterMarker=w(j.symbol,tt,M,"●"),q.scatterLineWidth=j.line.width,q.scatterLineColor=i(j.line,1,tt),q.scatterAngle=0}"textposition"in I&&(q.textOffset=S(I.textposition),q.textColor=i(I.textfont,1,tt),q.textSize=w(I.textfont.size,tt,e.identity,12),q.textFontFamily=I.textfont.family,q.textFontWeight=I.textfont.weight,q.textFontStyle=I.textfont.style,q.textFontVariant=I.textfont.variant,q.textAngle=0);var vt=["x","y","z"];for(q.project=[!1,!1,!1],q.projectScale=[1,1,1],q.projectOpacity=[1,1,1],ot=0;ot<3;++ot){var Ut=I.projection[vt[ot]];(q.project[ot]=Ut.show)&&(q.projectOpacity[ot]=Ut.opacity,q.projectScale[ot]=Ut.scale)}q.errorBounds=v(I,R,B);var Kt=l([I.error_x,I.error_y,I.error_z]);return q.errorColor=Kt.color,q.errorLineWidth=Kt.lineWidth,q.errorCapSize=Kt.capSize,q.delaunayAxis=I.surfaceaxis,q.delaunayColor=r(I.surfacecolor),q}function f(D){if(e.isArrayOrTypedArray(D)){var I=D[0];return e.isArrayOrTypedArray(I)&&(D=I),"rgb("+D.slice(0,3).map(function(O){return Math.round(O*255)})+")"}return null}function k(D){return e.isArrayOrTypedArray(D)?D.length===4&&typeof D[0]=="number"?f(D):D.map(f):null}p.update=function(D){var I=this.scene.glplot.gl,O,B,R,L,F=o.solid;this.data=D;var N=u(this.scene,D);"mode"in N&&(this.mode=N.mode),"lineDashes"in N&&N.lineDashes in o&&(F=o[N.lineDashes]),this.color=k(N.scatterColor)||k(N.lineColor),this.dataPoints=N.position,O={gl:this.scene.glplot.gl,position:N.position,color:N.lineColor,lineWidth:N.lineWidth||1,dashes:F[0],dashScale:F[1],opacity:D.opacity,connectGaps:D.connectgaps},this.mode.indexOf("lines")!==-1?this.linePlot?this.linePlot.update(O):(this.linePlot=c(O),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var j=D.opacity;if(D.marker&&D.marker.opacity!==void 0&&(j*=D.marker.opacity),B={gl:this.scene.glplot.gl,position:N.position,color:N.scatterColor,size:N.scatterSize,glyph:N.scatterMarker,opacity:j,orthographic:!0,lineWidth:N.scatterLineWidth,lineColor:N.scatterLineColor,project:N.project,projectScale:N.projectScale,projectOpacity:N.projectOpacity},this.mode.indexOf("markers")!==-1?this.scatterPlot?this.scatterPlot.update(B):(this.scatterPlot=g(B),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),L={gl:this.scene.glplot.gl,position:N.position,glyph:N.text,color:N.textColor,size:N.textSize,angle:N.textAngle,alignment:N.textOffset,font:N.textFontFamily,fontWeight:N.textFontWeight,fontStyle:N.textFontStyle,fontVariant:N.textFontVariant,orthographic:!0,lineWidth:0,project:!1,opacity:D.opacity},this.textLabels=D.hovertext||D.text,this.mode.indexOf("text")!==-1?this.textMarkers?this.textMarkers.update(L):(this.textMarkers=g(L),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),R={gl:this.scene.glplot.gl,position:N.position,color:N.errorColor,error:N.errorBounds,lineWidth:N.errorLineWidth,capSize:N.errorCapSize,opacity:D.opacity},this.errorBars?N.errorBounds?this.errorBars.update(R):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):N.errorBounds&&(this.errorBars=E(R),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),N.delaunayAxis>=0){var G=y(N.position,N.delaunayColor,N.delaunayAxis);G.opacity=D.opacity,this.delaunayMesh?this.delaunayMesh.update(G):(G.gl=I,this.delaunayMesh=A(G),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},p.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function _(D,I){var O=new m(D,I.uid);return O.update(I),O}V.exports=_}),f3=Vt((X,V)=>{var c=Gu(),g=Nl(),E=wl(),A=qu().axisHoverFormat,t=Zo().hovertemplateAttrs,e=Zo().texttemplateAttrs,r=Ks(),i=h3(),n=_x(),o=po().extendFlat,a=su().overrideAll,s=Td(),h=c.line,v=c.marker,m=v.line,p=o({width:h.width,dash:{valType:"enumerated",values:s(i),dflt:"solid"}},E("line"));function y(x){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var l=V.exports=a({x:c.x,y:c.y,z:{valType:"data_array"},text:o({},c.text,{}),texttemplate:e({},{}),hovertext:o({},c.hovertext,{}),hovertemplate:t(),xhoverformat:A("x"),yhoverformat:A("y"),zhoverformat:A("z"),mode:o({},c.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:y(),y:y(),z:y()},connectgaps:c.connectgaps,line:p,marker:o({symbol:{valType:"enumerated",values:s(n),dflt:"circle",arrayOk:!0},size:o({},v.size,{dflt:8}),sizeref:v.sizeref,sizemin:v.sizemin,sizemode:v.sizemode,opacity:o({},v.opacity,{arrayOk:!1}),colorbar:v.colorbar,line:o({width:o({},m.width,{arrayOk:!1})},E("marker.line"))},E("marker")),textposition:o({},c.textposition,{dflt:"top center"}),textfont:g({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:r.opacity,hoverinfo:o({},r.hoverinfo)},"calc","nested");l.x.editType=l.y.editType=l.z.editType="calc+clearAxisTypes"}),lE=Vt((X,V)=>{var c=Mi(),g=qr(),E=Sl(),A=Df(),t=Nf(),e=Uf(),r=f3();V.exports=function(n,o,a,s){function h(S,T){return g.coerce(n,o,r,S,T)}var v=i(n,o,h,s);if(!v){o.visible=!1;return}h("text"),h("hovertext"),h("hovertemplate"),h("xhoverformat"),h("yhoverformat"),h("zhoverformat"),h("mode"),E.hasMarkers(o)&&A(n,o,a,s,h,{noSelect:!0,noAngle:!0}),E.hasLines(o)&&(h("connectgaps"),t(n,o,a,s,h)),E.hasText(o)&&(h("texttemplate"),e(n,o,s,h,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var m=(o.line||{}).color,p=(o.marker||{}).color;h("surfaceaxis")>=0&&h("surfacecolor",m||p);for(var y=["x","y","z"],l=0;l<3;++l){var x="projection."+y[l];h(x+".show")&&(h(x+".opacity"),h(x+".scale"))}var b=c.getComponentMethod("errorbars","supplyDefaults");b(n,o,m||p||a,{axis:"z"}),b(n,o,m||p||a,{axis:"y",inherit:"z"}),b(n,o,m||p||a,{axis:"x",inherit:"z"})};function i(n,o,a,s){var h=0,v=a("x"),m=a("y"),p=a("z"),y=c.getComponentMethod("calendars","handleTraceDefaults");return y(n,o,["x","y","z"],s),v&&m&&p&&(h=Math.min(v.length,m.length,p.length),o._length=o._xlength=o._ylength=o._zlength=h),h}}),uE=Vt((X,V)=>{var c=bp(),g=Vf();V.exports=function(E,A){var t=[{x:!1,y:!1,trace:A,t:{}}];return c(t,A),g(E,A),t}}),cE=Vt((X,V)=>{V.exports=c;function c(g,E){if(typeof g!="string")throw new TypeError("must specify type string");if(E=E||{},typeof document>"u"&&!E.canvas)return null;var A=E.canvas||document.createElement("canvas");typeof E.width=="number"&&(A.width=E.width),typeof E.height=="number"&&(A.height=E.height);var t=E,e;try{var r=[g];g.indexOf("webgl")===0&&r.push("experimental-"+g);for(var i=0;i<r.length;i++)if(e=A.getContext(r[i],t),e)return e}catch{e=null}return e||null}}),hE=Vt((X,V)=>{var c=cE();V.exports=function(g){return c("webgl",g)}}),p3=Vt((X,V)=>{var c=vi(),g=function(){};V.exports=function(E){for(var A in E)typeof E[A]=="function"&&(E[A]=g);E.destroy=function(){E.container.parentNode.removeChild(E.container)};var t=document.createElement("div");t.className="no-webgl",t.style.cursor="pointer",t.style.fontSize="24px",t.style.color=c.defaults[0],t.style.position="absolute",t.style.left=t.style.top="0px",t.style.width=t.style.height="100%",t.style["background-color"]=c.lightLine,t.style["z-index"]=30;var e=document.createElement("p");return e.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",e.style.position="relative",e.style.top="50%",e.style.left="50%",e.style.height="30%",e.style.width="50%",e.style.margin="-15% 0 0 -25%",t.appendChild(e),E.container.appendChild(t),E.container.style.background="#FFFFFF",E.container.onclick=function(){window.open("https://get.webgl.org")},!1}}),fE=Vt((X,V)=>{var c=Gp(),g=qr(),E=["xaxis","yaxis","zaxis"];function A(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickFontWeight=["normal","normal","normal","normal"],this.tickFontStyle=["normal","normal","normal","normal"],this.tickFontVariant=["normal","normal","normal","normal"],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelFontWeight=["normal","normal","normal","normal"],this.labelFontStyle=["normal","normal","normal","normal"],this.labelFontVariant=["normal","normal","normal","normal"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}var t=A.prototype;t.merge=function(r,i){for(var n=this,o=0;o<3;++o){var a=i[E[o]];if(!a.visible){n.tickEnable[o]=!1,n.labelEnable[o]=!1,n.lineEnable[o]=!1,n.lineTickEnable[o]=!1,n.gridEnable[o]=!1,n.zeroEnable[o]=!1,n.backgroundEnable[o]=!1;continue}n.labels[o]=r._meta?g.templateString(a.title.text,r._meta):a.title.text,"font"in a.title&&(a.title.font.color&&(n.labelColor[o]=c(a.title.font.color)),a.title.font.family&&(n.labelFont[o]=a.title.font.family),a.title.font.size&&(n.labelSize[o]=a.title.font.size),a.title.font.weight&&(n.labelFontWeight[o]=a.title.font.weight),a.title.font.style&&(n.labelFontStyle[o]=a.title.font.style),a.title.font.variant&&(n.labelFontVariant[o]=a.title.font.variant)),"showline"in a&&(n.lineEnable[o]=a.showline),"linecolor"in a&&(n.lineColor[o]=c(a.linecolor)),"linewidth"in a&&(n.lineWidth[o]=a.linewidth),"showgrid"in a&&(n.gridEnable[o]=a.showgrid),"gridcolor"in a&&(n.gridColor[o]=c(a.gridcolor)),"gridwidth"in a&&(n.gridWidth[o]=a.gridwidth),a.type==="log"?n.zeroEnable[o]=!1:"zeroline"in a&&(n.zeroEnable[o]=a.zeroline),"zerolinecolor"in a&&(n.zeroLineColor[o]=c(a.zerolinecolor)),"zerolinewidth"in a&&(n.zeroLineWidth[o]=a.zerolinewidth),"ticks"in a&&a.ticks?n.lineTickEnable[o]=!0:n.lineTickEnable[o]=!1,"ticklen"in a&&(n.lineTickLength[o]=n._defaultLineTickLength[o]=a.ticklen),"tickcolor"in a&&(n.lineTickColor[o]=c(a.tickcolor)),"tickwidth"in a&&(n.lineTickWidth[o]=a.tickwidth),"tickangle"in a&&(n.tickAngle[o]=a.tickangle==="auto"?-3600:Math.PI*-a.tickangle/180),"showticklabels"in a&&(n.tickEnable[o]=a.showticklabels),"tickfont"in a&&(a.tickfont.color&&(n.tickColor[o]=c(a.tickfont.color)),a.tickfont.family&&(n.tickFont[o]=a.tickfont.family),a.tickfont.size&&(n.tickSize[o]=a.tickfont.size),a.tickfont.weight&&(n.tickFontWeight[o]=a.tickfont.weight),a.tickfont.style&&(n.tickFontStyle[o]=a.tickfont.style),a.tickfont.variant&&(n.tickFontVariant[o]=a.tickfont.variant)),"mirror"in a?["ticks","all","allticks"].indexOf(a.mirror)!==-1?(n.lineTickMirror[o]=!0,n.lineMirror[o]=!0):a.mirror===!0?(n.lineTickMirror[o]=!1,n.lineMirror[o]=!0):(n.lineTickMirror[o]=!1,n.lineMirror[o]=!1):n.lineMirror[o]=!1,"showbackground"in a&&a.showbackground!==!1?(n.backgroundEnable[o]=!0,n.backgroundColor[o]=c(a.backgroundcolor)):n.backgroundEnable[o]=!1}};function e(r,i){var n=new A;return n.merge(r,i),n}V.exports=e}),pE=Vt((X,V)=>{var c=Gp(),g=["xaxis","yaxis","zaxis"];function E(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}var A=E.prototype;A.merge=function(e){for(var r=0;r<3;++r){var i=e[g[r]];if(!i.visible){this.enabled[r]=!1,this.drawSides[r]=!1;continue}this.enabled[r]=i.showspikes,this.colors[r]=c(i.spikecolor),this.drawSides[r]=i.spikesides,this.lineWidth[r]=i.spikethickness}};function t(e){var r=new E;return r.merge(e),r}V.exports=t}),dE=Vt((X,V)=>{V.exports=t;var c=ao(),g=qr(),E=["xaxis","yaxis","zaxis"];function A(e){for(var r=new Array(3),i=0;i<3;++i){for(var n=e[i],o=new Array(n.length),a=0;a<n.length;++a)o[a]=n[a].x;r[i]=o}return r}function t(e){for(var r=e.axesOptions,i=e.glplot.axesPixels,n=e.fullSceneLayout,o=[[],[],[]],a=0;a<3;++a){var s=n[E[a]];if(s._length=(i[a].hi-i[a].lo)*i[a].pixelsPerDataUnit/e.dataScale[a],Math.abs(s._length)===1/0||isNaN(s._length))o[a]=[];else{s._input_range=s.range.slice(),s.range[0]=i[a].lo/e.dataScale[a],s.range[1]=i[a].hi/e.dataScale[a],s._m=1/(e.dataScale[a]*i[a].pixelsPerDataUnit),s.range[0]===s.range[1]&&(s.range[0]-=1,s.range[1]+=1);var h=s.tickmode;if(s.tickmode==="auto"){s.tickmode="linear";var v=s.nticks||g.constrain(s._length/40,4,9);c.autoTicks(s,Math.abs(s.range[1]-s.range[0])/v)}for(var m=c.calcTicks(s,{msUTC:!0}),p=0;p<m.length;++p)m[p].x=m[p].x*e.dataScale[a],s.type==="date"&&(m[p].text=m[p].text.replace(/\<br\>/g," "));o[a]=m,s.tickmode=h}}r.ticks=o;for(var a=0;a<3;++a){.5*(e.glplot.bounds[0][a]+e.glplot.bounds[1][a]);for(var p=0;p<2;++p)r.bounds[p][a]=e.glplot.bounds[p][a]}e.contourLevels=A(o)}}),gE=Vt((X,V)=>{var c=Dh().gl_plot3d,g=c.createCamera,E=c.createScene,A=hE(),t=Ny(),e=Mi(),r=qr(),i=r.preserveDrawingBuffer(),n=ao(),o=Hu(),a=Gp(),s=p3(),h=zb(),v=fE(),m=pE(),p=dE(),y=Kf().applyAutorangeOptions,l,x,b=!1;function S(O,B){var R=document.createElement("div"),L=O.container;this.graphDiv=O.graphDiv;var F=document.createElementNS("http://www.w3.org/2000/svg","svg");F.style.position="absolute",F.style.top=F.style.left="0px",F.style.width=F.style.height="100%",F.style["z-index"]=20,F.style["pointer-events"]="none",R.appendChild(F),this.svgContainer=F,R.id=O.id,R.style.position="absolute",R.style.top=R.style.left="0px",R.style.width=R.style.height="100%",L.appendChild(R),this.fullLayout=B,this.id=O.id||"scene",this.fullSceneLayout=B[this.id],this.plotArgs=[[],{},{}],this.axesOptions=v(B,B[this.id]),this.spikeOptions=m(B[this.id]),this.container=R,this.staticMode=!!O.staticPlot,this.pixelRatio=this.pixelRatio||O.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=e.getComponentMethod("annotations3d","convert"),this.drawAnnotations=e.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var T=S.prototype;T.prepareOptions=function(){var O=this,B={canvas:O.canvas,gl:O.gl,glOptions:{preserveDrawingBuffer:i,premultipliedAlpha:!0,antialias:!0},container:O.container,axes:O.axesOptions,spikes:O.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:O.camera,pixelRatio:O.pixelRatio};if(O.staticMode){if(!x&&(l=document.createElement("canvas"),x=A({canvas:l,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!x))throw new Error("error creating static canvas/context for image server");B.gl=x,B.canvas=l}return B};var M=!0;T.tryCreatePlot=function(){var O=this,B=O.prepareOptions(),R=!0;try{O.glplot=E(B)}catch{if(O.staticMode||!M||i)R=!1;else{r.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{i=B.glOptions.preserveDrawingBuffer=!0,O.glplot=E(B)}catch{i=B.glOptions.preserveDrawingBuffer=!1,R=!1}}}return M=!1,R},T.initializeGLCamera=function(){var O=this,B=O.fullSceneLayout.camera,R=B.projection.type==="orthographic";O.camera=g(O.container,{center:[B.center.x,B.center.y,B.center.z],eye:[B.eye.x,B.eye.y,B.eye.z],up:[B.up.x,B.up.y,B.up.z],_ortho:R,zoomMin:.01,zoomMax:100,mode:"orbit"})},T.initializeGLPlot=function(){var O=this;O.initializeGLCamera();var B=O.tryCreatePlot();if(!B)return s(O);O.traces={},O.make4thDimension();var R=O.graphDiv,L=R.layout,F=function(){var j={};return O.isCameraChanged(L)&&(j[O.id+".camera"]=O.getCamera()),O.isAspectChanged(L)&&(j[O.id+".aspectratio"]=O.glplot.getAspectratio(),L[O.id].aspectmode!=="manual"&&(O.fullSceneLayout.aspectmode=L[O.id].aspectmode=j[O.id+".aspectmode"]="manual")),j},N=function(j){if(j.fullSceneLayout.dragmode!==!1){var G=F();j.saveLayout(L),j.graphDiv.emit("plotly_relayout",G)}};return O.glplot.canvas&&(O.glplot.canvas.addEventListener("mouseup",function(){N(O)}),O.glplot.canvas.addEventListener("touchstart",function(){b=!0}),O.glplot.canvas.addEventListener("wheel",function(j){if(R._context._scrollZoom.gl3d){if(O.camera._ortho){var G=j.deltaX>j.deltaY?1.1:.9090909090909091,rt=O.glplot.getAspectratio();O.glplot.setAspectratio({x:G*rt.x,y:G*rt.y,z:G*rt.z})}N(O)}},t?{passive:!1}:!1),O.glplot.canvas.addEventListener("mousemove",function(){if(O.fullSceneLayout.dragmode!==!1&&O.camera.mouseListener.buttons!==0){var j=F();O.graphDiv.emit("plotly_relayouting",j)}}),O.staticMode||O.glplot.canvas.addEventListener("webglcontextlost",function(j){R&&R.emit&&R.emit("plotly_webglcontextlost",{event:j,layer:O.id})},!1)),O.glplot.oncontextloss=function(){O.recoverContext()},O.glplot.onrender=function(){O.render()},!0},T.render=function(){var O=this,B=O.graphDiv,R,L=O.svgContainer,F=O.container.getBoundingClientRect();B._fullLayout._calcInverseTransform(B);var N=B._fullLayout._invScaleX,j=B._fullLayout._invScaleY,G=F.width*N,rt=F.height*j;L.setAttributeNS(null,"viewBox","0 0 "+G+" "+rt),L.setAttributeNS(null,"width",G),L.setAttributeNS(null,"height",rt),p(O),O.glplot.axes.update(O.axesOptions);for(var ct=Object.keys(O.traces),lt=null,tt=O.glplot.selection,Z=0;Z<ct.length;++Z)R=O.traces[ct[Z]],R.data.hoverinfo!=="skip"&&R.handlePick(tt)&&(lt=R),R.setContourLevels&&R.setContourLevels();function st(Nt,te,Jt){var Qt=O.fullSceneLayout[Nt+"axis"];return Qt.type!=="log"&&(te=Qt.d2l(te)),n.hoverLabelText(Qt,te,Jt)}if(lt!==null){var $=h(O.glplot.cameraParams,tt.dataCoordinate);R=lt.data;var Q=B._fullData[R.index],nt=tt.index,Y={xLabel:st("x",tt.traceCoordinate[0],R.xhoverformat),yLabel:st("y",tt.traceCoordinate[1],R.yhoverformat),zLabel:st("z",tt.traceCoordinate[2],R.zhoverformat)},q=o.castHoverinfo(Q,O.fullLayout,nt),ot=(q||"").split("+"),it=q&&q==="all";!Q.hovertemplate&&!it&&(ot.indexOf("x")===-1&&(Y.xLabel=void 0),ot.indexOf("y")===-1&&(Y.yLabel=void 0),ot.indexOf("z")===-1&&(Y.zLabel=void 0),ot.indexOf("text")===-1&&(tt.textLabel=void 0),ot.indexOf("name")===-1&&(lt.name=void 0));var dt,wt=[];R.type==="cone"||R.type==="streamtube"?(Y.uLabel=st("x",tt.traceCoordinate[3],R.uhoverformat),(it||ot.indexOf("u")!==-1)&&wt.push("u: "+Y.uLabel),Y.vLabel=st("y",tt.traceCoordinate[4],R.vhoverformat),(it||ot.indexOf("v")!==-1)&&wt.push("v: "+Y.vLabel),Y.wLabel=st("z",tt.traceCoordinate[5],R.whoverformat),(it||ot.indexOf("w")!==-1)&&wt.push("w: "+Y.wLabel),Y.normLabel=tt.traceCoordinate[6].toPrecision(3),(it||ot.indexOf("norm")!==-1)&&wt.push("norm: "+Y.normLabel),R.type==="streamtube"&&(Y.divergenceLabel=tt.traceCoordinate[7].toPrecision(3),(it||ot.indexOf("divergence")!==-1)&&wt.push("divergence: "+Y.divergenceLabel)),tt.textLabel&&wt.push(tt.textLabel),dt=wt.join("<br>")):R.type==="isosurface"||R.type==="volume"?(Y.valueLabel=n.hoverLabelText(O._mockAxis,O._mockAxis.d2l(tt.traceCoordinate[3]),R.valuehoverformat),wt.push("value: "+Y.valueLabel),tt.textLabel&&wt.push(tt.textLabel),dt=wt.join("<br>")):dt=tt.textLabel;var xt={x:tt.traceCoordinate[0],y:tt.traceCoordinate[1],z:tt.traceCoordinate[2],data:Q._input,fullData:Q,curveNumber:Q.index,pointNumber:nt};o.appendArrayPointValue(xt,Q,nt),R._module.eventData&&(xt=Q._module.eventData(xt,tt,Q,{},nt));var Ft={points:[xt]};if(O.fullSceneLayout.hovermode){var Et=[];o.loneHover({trace:Q,x:(.5+.5*$[0]/$[3])*G,y:(.5-.5*$[1]/$[3])*rt,xLabel:Y.xLabel,yLabel:Y.yLabel,zLabel:Y.zLabel,text:dt,name:lt.name,color:o.castHoverOption(Q,nt,"bgcolor")||lt.color,borderColor:o.castHoverOption(Q,nt,"bordercolor"),fontFamily:o.castHoverOption(Q,nt,"font.family"),fontSize:o.castHoverOption(Q,nt,"font.size"),fontColor:o.castHoverOption(Q,nt,"font.color"),nameLength:o.castHoverOption(Q,nt,"namelength"),textAlign:o.castHoverOption(Q,nt,"align"),hovertemplate:r.castOption(Q,nt,"hovertemplate"),hovertemplateLabels:r.extendFlat({},xt,Y),eventData:[xt]},{container:L,gd:B,inOut_bbox:Et}),xt.bbox=Et[0]}tt.distance<5&&(tt.buttons||b)?B.emit("plotly_click",Ft):B.emit("plotly_hover",Ft),this.oldEventData=Ft}else o.loneUnhover(L),this.oldEventData&&B.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;O.drawAnnotations(O)},T.recoverContext=function(){var O=this;O.glplot.dispose();var B=function(){if(O.glplot.gl.isContextLost()){requestAnimationFrame(B);return}if(!O.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}O.plot.apply(O,O.plotArgs)};requestAnimationFrame(B)};var w=["xaxis","yaxis","zaxis"];function u(O,B,R){for(var L=O.fullSceneLayout,F=0;F<3;F++){var N=w[F],j=N.charAt(0),G=L[N],rt=B[j],ct=B[j+"calendar"],lt=B["_"+j+"length"];if(!r.isArrayOrTypedArray(rt))R[0][F]=Math.min(R[0][F],0),R[1][F]=Math.max(R[1][F],lt-1);else for(var tt,Z=0;Z<(lt||rt.length);Z++)if(r.isArrayOrTypedArray(rt[Z]))for(var st=0;st<rt[Z].length;++st)tt=G.d2l(rt[Z][st],0,ct),!isNaN(tt)&&isFinite(tt)&&(R[0][F]=Math.min(R[0][F],tt),R[1][F]=Math.max(R[1][F],tt));else tt=G.d2l(rt[Z],0,ct),!isNaN(tt)&&isFinite(tt)&&(R[0][F]=Math.min(R[0][F],tt),R[1][F]=Math.max(R[1][F],tt))}}function f(O,B){for(var R=O.fullSceneLayout,L=R.annotations||[],F=0;F<3;F++)for(var N=w[F],j=N.charAt(0),G=R[N],rt=0;rt<L.length;rt++){var ct=L[rt];if(ct.visible){var lt=G.r2l(ct[j]);!isNaN(lt)&&isFinite(lt)&&(B[0][F]=Math.min(B[0][F],lt),B[1][F]=Math.max(B[1][F],lt))}}}T.plot=function(O,B,R){var L=this;if(L.plotArgs=[O,B,R],!L.glplot.contextLost){var F,N,j,G,rt,ct,lt=B[L.id],tt=R[L.id];L.fullLayout=B,L.fullSceneLayout=lt,L.axesOptions.merge(B,lt),L.spikeOptions.merge(lt),L.setViewport(lt),L.updateFx(lt.dragmode,lt.hovermode),L.camera.enableWheel=L.graphDiv._context._scrollZoom.gl3d,L.glplot.setClearColor(a(lt.bgcolor)),L.setConvert(rt),O?Array.isArray(O)||(O=[O]):O=[];var Z=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(j=0;j<O.length;++j)F=O[j],!(F.visible!==!0||F._length===0)&&u(this,F,Z);f(this,Z);var st=[1,1,1];for(G=0;G<3;++G)Z[1][G]===Z[0][G]?st[G]=1:st[G]=1/(Z[1][G]-Z[0][G]);for(L.dataScale=st,L.convertAnnotations(this),j=0;j<O.length;++j)F=O[j],!(F.visible!==!0||F._length===0)&&(N=L.traces[F.uid],N?N.data.type===F.type?N.update(F):(N.dispose(),N=F._module.plot(this,F),L.traces[F.uid]=N):(N=F._module.plot(this,F),L.traces[F.uid]=N),N.name=F.name);var $=Object.keys(L.traces);t:for(j=0;j<$.length;++j){for(G=0;G<O.length;++G)if(O[G].uid===$[j]&&O[G].visible===!0&&O[G]._length!==0)continue t;N=L.traces[$[j]],N.dispose(),delete L.traces[$[j]]}L.glplot.objects.sort(function(le,Te){return le._trace.data.index-Te._trace.data.index});var Q=[[0,0,0],[0,0,0]],nt=[],Y={};for(j=0;j<3;++j){rt=lt[w[j]],ct=rt.type,ct in Y?(Y[ct].acc*=st[j],Y[ct].count+=1):Y[ct]={acc:st[j],count:1};var q;if(rt.autorange){Q[0][j]=1/0,Q[1][j]=-1/0;var ot=L.glplot.objects,it=L.fullSceneLayout.annotations||[],dt=rt._name.charAt(0);for(G=0;G<ot.length;G++){var wt=ot[G],xt=wt.bounds,Ft=wt._trace.data._pad||0;wt.constructor.name==="ErrorBars"&&rt._lowerLogErrorBound?Q[0][j]=Math.min(Q[0][j],rt._lowerLogErrorBound):Q[0][j]=Math.min(Q[0][j],xt[0][j]/st[j]-Ft),Q[1][j]=Math.max(Q[1][j],xt[1][j]/st[j]+Ft)}for(G=0;G<it.length;G++){var Et=it[G];if(Et.visible){var Nt=rt.r2l(Et[dt]);Q[0][j]=Math.min(Q[0][j],Nt),Q[1][j]=Math.max(Q[1][j],Nt)}}if("rangemode"in rt&&rt.rangemode==="tozero"&&(Q[0][j]=Math.min(Q[0][j],0),Q[1][j]=Math.max(Q[1][j],0)),Q[0][j]>Q[1][j])Q[0][j]=-1,Q[1][j]=1;else{var te=Q[1][j]-Q[0][j];Q[0][j]-=te/32,Q[1][j]+=te/32}if(q=[Q[0][j],Q[1][j]],q=y(q,rt),Q[0][j]=q[0],Q[1][j]=q[1],rt.isReversed()){var Jt=Q[0][j];Q[0][j]=Q[1][j],Q[1][j]=Jt}}else q=rt.range,Q[0][j]=rt.r2l(q[0]),Q[1][j]=rt.r2l(q[1]);Q[0][j]===Q[1][j]&&(Q[0][j]-=1,Q[1][j]+=1),nt[j]=Q[1][j]-Q[0][j],rt.range=[Q[0][j],Q[1][j]],rt.limitRange(),L.glplot.setBounds(j,{min:rt.range[0]*st[j],max:rt.range[1]*st[j]})}var Qt,Wt=lt.aspectmode;if(Wt==="cube")Qt=[1,1,1];else if(Wt==="manual"){var gt=lt.aspectratio;Qt=[gt.x,gt.y,gt.z]}else if(Wt==="auto"||Wt==="data"){var bt=[1,1,1];for(j=0;j<3;++j){rt=lt[w[j]],ct=rt.type;var vt=Y[ct];bt[j]=Math.pow(vt.acc,1/vt.count)/st[j]}Wt==="data"||Math.max.apply(null,bt)/Math.min.apply(null,bt)<=4?Qt=bt:Qt=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");lt.aspectratio.x=tt.aspectratio.x=Qt[0],lt.aspectratio.y=tt.aspectratio.y=Qt[1],lt.aspectratio.z=tt.aspectratio.z=Qt[2],L.glplot.setAspectratio(lt.aspectratio),L.viewInitial.aspectratio||(L.viewInitial.aspectratio={x:lt.aspectratio.x,y:lt.aspectratio.y,z:lt.aspectratio.z}),L.viewInitial.aspectmode||(L.viewInitial.aspectmode=lt.aspectmode);var Ut=lt.domain||null,Kt=B._size||null;if(Ut&&Kt){var Zt=L.container.style;Zt.position="absolute",Zt.left=Kt.l+Ut.x[0]*Kt.w+"px",Zt.top=Kt.t+(1-Ut.y[1])*Kt.h+"px",Zt.width=Kt.w*(Ut.x[1]-Ut.x[0])+"px",Zt.height=Kt.h*(Ut.y[1]-Ut.y[0])+"px"}L.glplot.redraw()}},T.destroy=function(){var O=this;O.glplot&&(O.camera.mouseListener.enabled=!1,O.container.removeEventListener("wheel",O.camera.wheelListener),O.camera=null,O.glplot.dispose(),O.container.parentNode.removeChild(O.container),O.glplot=null)};function k(O){return[[O.eye.x,O.eye.y,O.eye.z],[O.center.x,O.center.y,O.center.z],[O.up.x,O.up.y,O.up.z]]}function _(O){return{up:{x:O.up[0],y:O.up[1],z:O.up[2]},center:{x:O.center[0],y:O.center[1],z:O.center[2]},eye:{x:O.eye[0],y:O.eye[1],z:O.eye[2]},projection:{type:O._ortho===!0?"orthographic":"perspective"}}}T.getCamera=function(){var O=this;return O.camera.view.recalcMatrix(O.camera.view.lastT()),_(O.camera)},T.setViewport=function(O){var B=this,R=O.camera;B.camera.lookAt.apply(this,k(R)),B.glplot.setAspectratio(O.aspectratio);var L=R.projection.type==="orthographic",F=B.camera._ortho;L!==F&&(B.glplot.redraw(),B.glplot.clearRGBA(),B.glplot.dispose(),B.initializeGLPlot())},T.isCameraChanged=function(O){var B=this,R=B.getCamera(),L=r.nestedProperty(O,B.id+".camera"),F=L.get();function N(ct,lt,tt,Z){var st=["up","center","eye"],$=["x","y","z"];return lt[st[tt]]&&ct[st[tt]][$[Z]]===lt[st[tt]][$[Z]]}var j=!1;if(F===void 0)j=!0;else{for(var G=0;G<3;G++)for(var rt=0;rt<3;rt++)if(!N(R,F,G,rt)){j=!0;break}(!F.projection||R.projection&&R.projection.type!==F.projection.type)&&(j=!0)}return j},T.isAspectChanged=function(O){var B=this,R=B.glplot.getAspectratio(),L=r.nestedProperty(O,B.id+".aspectratio"),F=L.get();return F===void 0||F.x!==R.x||F.y!==R.y||F.z!==R.z},T.saveLayout=function(O){var B=this,R=B.fullLayout,L,F,N,j,G,rt,ct=B.isCameraChanged(O),lt=B.isAspectChanged(O),tt=ct||lt;if(tt){var Z={};if(ct&&(L=B.getCamera(),F=r.nestedProperty(O,B.id+".camera"),N=F.get(),Z[B.id+".camera"]=N),lt&&(j=B.glplot.getAspectratio(),G=r.nestedProperty(O,B.id+".aspectratio"),rt=G.get(),Z[B.id+".aspectratio"]=rt),e.call("_storeDirectGUIEdit",O,R._preGUI,Z),ct){F.set(L);var st=r.nestedProperty(R,B.id+".camera");st.set(L)}if(lt){G.set(j);var $=r.nestedProperty(R,B.id+".aspectratio");$.set(j),B.glplot.redraw()}}return tt},T.updateFx=function(O,B){var R=this,L=R.camera;if(L)if(O==="orbit")L.mode="orbit",L.keyBindingMode="rotate";else if(O==="turntable"){L.up=[0,0,1],L.mode="turntable",L.keyBindingMode="rotate";var F=R.graphDiv,N=F._fullLayout,j=R.fullSceneLayout.camera,G=j.up.x,rt=j.up.y,ct=j.up.z;if(ct/Math.sqrt(G*G+rt*rt+ct*ct)<.999){var lt=R.id+".camera.up",tt={x:0,y:0,z:1},Z={};Z[lt]=tt;var st=F.layout;e.call("_storeDirectGUIEdit",st,N._preGUI,Z),j.up=tt,r.nestedProperty(st,lt).set(tt)}}else L.keyBindingMode=O;R.fullSceneLayout.hovermode=B};function D(O,B,R){for(var L=0,F=R-1;L<F;++L,--F)for(var N=0;N<B;++N)for(var j=0;j<4;++j){var G=4*(B*L+N)+j,rt=4*(B*F+N)+j,ct=O[G];O[G]=O[rt],O[rt]=ct}}function I(O,B,R){for(var L=0;L<R;++L)for(var F=0;F<B;++F){var N=4*(B*L+F),j=O[N+3];if(j>0)for(var G=255/j,rt=0;rt<3;++rt)O[N+rt]=Math.min(G*O[N+rt],255)}}T.toImage=function(O){var B=this;O||(O="png"),B.staticMode&&B.container.appendChild(l),B.glplot.redraw();var R=B.glplot.gl,L=R.drawingBufferWidth,F=R.drawingBufferHeight;R.bindFramebuffer(R.FRAMEBUFFER,null);var N=new Uint8Array(L*F*4);R.readPixels(0,0,L,F,R.RGBA,R.UNSIGNED_BYTE,N),D(N,L,F),I(N,L,F);var j=document.createElement("canvas");j.width=L,j.height=F;var G=j.getContext("2d",{willReadFrequently:!0}),rt=G.createImageData(L,F);rt.data.set(N),G.putImageData(rt,0,0);var ct;switch(O){case"jpeg":ct=j.toDataURL("image/jpeg");break;case"webp":ct=j.toDataURL("image/webp");break;default:ct=j.toDataURL("image/png")}return B.staticMode&&B.container.removeChild(l),ct},T.setConvert=function(){for(var O=this,B=0;B<3;B++){var R=O.fullSceneLayout[w[B]];n.setConvert(R,O.fullLayout),R.setScale=r.noop}},T.make4thDimension=function(){var O=this,B=O.graphDiv,R=B._fullLayout;O._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},n.setConvert(O._mockAxis,R)},V.exports=S}),mE=Vt((X,V)=>{V.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}),d3=Vt((X,V)=>{var c=vi(),g=Ih(),E=po().extendFlat,A=su().overrideAll;V.exports=A({visible:g.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:c.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:g.color,categoryorder:g.categoryorder,categoryarray:g.categoryarray,title:{text:g.title.text,font:g.title.font},type:E({},g.type,{values:["-","linear","log","date","category"]}),autotypenumbers:g.autotypenumbers,autorange:g.autorange,autorangeoptions:{minallowed:g.autorangeoptions.minallowed,maxallowed:g.autorangeoptions.maxallowed,clipmin:g.autorangeoptions.clipmin,clipmax:g.autorangeoptions.clipmax,include:g.autorangeoptions.include,editType:"plot"},rangemode:g.rangemode,minallowed:g.minallowed,maxallowed:g.maxallowed,range:E({},g.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:g.minor.tickmode,nticks:g.nticks,tick0:g.tick0,dtick:g.dtick,tickvals:g.tickvals,ticktext:g.ticktext,ticks:g.ticks,mirror:g.mirror,ticklen:g.ticklen,tickwidth:g.tickwidth,tickcolor:g.tickcolor,showticklabels:g.showticklabels,labelalias:g.labelalias,tickfont:g.tickfont,tickangle:g.tickangle,tickprefix:g.tickprefix,showtickprefix:g.showtickprefix,ticksuffix:g.ticksuffix,showticksuffix:g.showticksuffix,showexponent:g.showexponent,exponentformat:g.exponentformat,minexponent:g.minexponent,separatethousands:g.separatethousands,tickformat:g.tickformat,tickformatstops:g.tickformatstops,hoverformat:g.hoverformat,showline:g.showline,linecolor:g.linecolor,linewidth:g.linewidth,showgrid:g.showgrid,gridcolor:E({},g.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:g.gridwidth,zeroline:g.zeroline,zerolinecolor:g.zerolinecolor,zerolinewidth:g.zerolinewidth},"plot","from-root")}),g3=Vt((X,V)=>{var c=d3(),g=pu().attributes,E=po().extendFlat,A=qr().counterRegex;function t(e,r,i){return{x:{valType:"number",dflt:e,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:i,editType:"camera"},editType:"camera"}}V.exports={_arrayAttrRegexps:[A("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:E(t(0,0,1),{}),center:E(t(0,0,0),{}),eye:E(t(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:g({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:c,yaxis:c,zaxis:c,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}),vE=Vt((X,V)=>{var c=yh().mix,g=qr(),E=Ns(),A=d3(),t=Cb(),e=Hm(),r=["xaxis","yaxis","zaxis"],i=100*136/187;V.exports=function(n,o,a){var s,h;function v(y,l){return g.coerce(s,h,A,y,l)}for(var m=0;m<r.length;m++){var p=r[m];s=n[p]||{},h=E.newContainer(o,p),h._id=p[0]+a.scene,h._name=p,t(s,h,v,a),e(s,h,v,{font:a.font,letter:p[0],data:a.data,showGrid:!0,noAutotickangles:!0,noTicklabelindex:!0,noTickson:!0,noTicklabelmode:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noTicklabelposition:!0,noTicklabeloverflow:!0,noInsiderange:!0,bgColor:a.bgColor,calendar:a.calendar},a.fullLayout),v("gridcolor",c(h.color,a.bgColor,i).toRgbString()),v("title.text",p[0]),h.setScale=g.noop,v("showspikes")&&(v("spikesides"),v("spikethickness"),v("spikecolor",h.color)),v("showaxeslabels"),v("showbackground")&&v("backgroundcolor")}}}),yE=Vt((X,V)=>{var c=qr(),g=vi(),E=Mi(),A=Ld(),t=vE(),e=g3(),r=Ph().getSubplotData,i="gl3d";V.exports=function(o,a,s){var h=a._basePlotModules.length>1;function v(m){if(!h){var p=c.validate(o[m],e[m]);if(p)return o[m]}}A(o,a,s,{type:i,attributes:e,handleDefaults:n,fullLayout:a,font:a.font,fullData:s,getDfltFromLayout:v,autotypenumbersDflt:a.autotypenumbers,paper_bgcolor:a.paper_bgcolor,calendar:a.calendar})};function n(o,a,s,h){for(var v=s("bgcolor"),m=g.combine(v,h.paper_bgcolor),p=["up","center","eye"],y=0;y<p.length;y++)s("camera."+p[y]+".x"),s("camera."+p[y]+".y"),s("camera."+p[y]+".z");s("camera.projection.type");var l=!!s("aspectratio.x")&&!!s("aspectratio.y")&&!!s("aspectratio.z"),x=l?"manual":"auto",b=s("aspectmode",x);l||(o.aspectratio=a.aspectratio={x:1,y:1,z:1},b==="manual"&&(a.aspectmode="auto"),o.aspectmode=a.aspectmode);var S=r(h.fullData,i,h.id);t(o,a,{font:h.font,scene:h.id,data:S,bgColor:m,calendar:h.calendar,autotypenumbersDflt:h.autotypenumbersDflt,fullLayout:h.fullLayout}),E.getComponentMethod("annotations3d","handleDefaults")(o,a,h);var T=h.getDfltFromLayout("dragmode");if(T!==!1&&!T)if(T="orbit",o.camera&&o.camera.up){var M=o.camera.up.x,w=o.camera.up.y,u=o.camera.up.z;u!==0&&(!M||!w||!u||u/Math.sqrt(M*M+w*w+u*u)>.999)&&(T="turntable")}else T="turntable";s("dragmode",T),s("hovermode",h.getDfltFromLayout("hovermode"))}}),Nd=Vt(X=>{var V=su().overrideAll,c=_d(),g=gE(),E=Ph().getSubplotData,A=qr(),t=Cf(),e="gl3d",r="scene";X.name=e,X.attr=r,X.idRoot=r,X.idRegex=X.attrRegex=A.counterRegex("scene"),X.attributes=mE(),X.layoutAttributes=g3(),X.baseLayoutAttrOverrides=V({hoverlabel:c.hoverlabel},"plot","nested"),X.supplyLayoutDefaults=yE(),X.plot=function(i){for(var n=i._fullLayout,o=i._fullData,a=n._subplots[e],s=0;s<a.length;s++){var h=a[s],v=E(o,e,h),m=n[h],p=m.camera,y=m._scene;y||(y=new g({id:h,graphDiv:i,container:i.querySelector(".gl-container"),staticPlot:i._context.staticPlot,plotGlPixelRatio:i._context.plotGlPixelRatio,camera:p},n),m._scene=y),y.viewInitial||(y.viewInitial={up:{x:p.up.x,y:p.up.y,z:p.up.z},eye:{x:p.eye.x,y:p.eye.y,z:p.eye.z},center:{x:p.center.x,y:p.center.y,z:p.center.z}}),y.plot(v,n,i.layout)}},X.clean=function(i,n,o,a){for(var s=a._subplots[e]||[],h=0;h<s.length;h++){var v=s[h];!n[v]&&a[v]._scene&&(a[v]._scene.destroy(),a._infolayer&&a._infolayer.selectAll(".annotation-"+v).remove())}},X.toSVG=function(i){for(var n=i._fullLayout,o=n._subplots[e],a=n._size,s=0;s<o.length;s++){var h=n[o[s]],v=h.domain,m=h._scene,p=m.toImage("png"),y=n._glimages.append("svg:image");y.attr({xmlns:t.svg,"xlink:href":p,x:a.l+a.w*v.x[0],y:a.t+a.h*(1-v.y[1]),width:a.w*(v.x[1]-v.x[0]),height:a.h*(v.y[1]-v.y[0]),preserveAspectRatio:"none"}),m.destroy()}},X.cleanId=function(i){if(i.match(/^scene[0-9]*$/)){var n=i.substr(5);return n==="1"&&(n=""),r+n}},X.updateFx=function(i){for(var n=i._fullLayout,o=n._subplots[e],a=0;a<o.length;a++){var s=n[o[a]]._scene;s.updateFx(n.dragmode,n.hovermode)}}}),xE=Vt((X,V)=>{V.exports={plot:sE(),attributes:f3(),markerSymbols:_x(),supplyDefaults:lE(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:uE(),moduleType:"trace",name:"scatter3d",basePlotModule:Nd(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}),_E=Vt((X,V)=>{V.exports=xE()}),Av=Vt((X,V)=>{var c=vi(),g=wl(),E=qu().axisHoverFormat,A=Zo().hovertemplateAttrs,t=Ks(),e=po().extendFlat,r=su().overrideAll;function i(a){return{valType:"boolean",dflt:!1}}function n(a){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:i(),y:i(),z:i()},color:{valType:"color",dflt:c.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:c.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var o=V.exports=r(e({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:A(),xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},g("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:n(),y:n(),z:n()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},hoverinfo:e({},t.hoverinfo),showlegend:e({},t.showlegend,{dflt:!1})}),"calc","nested");o.x.editType=o.y.editType=o.z.editType="calc+clearAxisTypes"}),m3=Vt((X,V)=>{var c=Mi(),g=qr(),E=ah(),A=Av(),t=.1;function e(o,a){for(var s=[],h=32,v=0;v<h;v++){var m=v/(h-1),p=a+(1-a)*(1-Math.pow(Math.sin(o*m*Math.PI),2));s.push([m,Math.max(0,Math.min(1,p))])}return s}function r(o){var a=0;if(!Array.isArray(o)||o.length<2||!o[0]||!o[o.length-1]||+o[0][0]!=0||+o[o.length-1][0]!=1)return!1;for(var s=0;s<o.length;s++){var h=o[s];if(h.length!==2||+h[0]<a)return!1;a=+h[0]}return!0}function i(o,a,s,h){var v,m;function p(u,f){return g.coerce(o,a,A,u,f)}var y=p("x"),l=p("y"),x=p("z");if(!x||!x.length||y&&y.length<1||l&&l.length<1){a.visible=!1;return}a._xlength=Array.isArray(y)&&g.isArrayOrTypedArray(y[0])?x.length:x[0].length,a._ylength=x.length;var b=c.getComponentMethod("calendars","handleTraceDefaults");b(o,a,["x","y","z"],h),p("text"),p("hovertext"),p("hovertemplate"),p("xhoverformat"),p("yhoverformat"),p("zhoverformat"),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","connectgaps","opacity"].forEach(function(u){p(u)}),p("surfacecolor");var S=["x","y","z"];for(v=0;v<3;++v){var T="contours."+S[v],M=p(T+".show"),w=p(T+".highlight");if(M||w)for(m=0;m<3;++m)p(T+".project."+S[m]);M&&(p(T+".color"),p(T+".width"),p(T+".usecolormap")),w&&(p(T+".highlightcolor"),p(T+".highlightwidth")),p(T+".start"),p(T+".end"),p(T+".size")}E(o,a,h,p,{prefix:"",cLetter:"c"}),n(o,a,h,p),a._length=null}function n(o,a,s,h){var v=h("opacityscale");v==="max"?a.opacityscale=[[0,t],[1,1]]:v==="min"?a.opacityscale=[[0,1],[1,t]]:v==="extremes"?a.opacityscale=e(1,t):r(v)||(a.opacityscale=void 0)}V.exports={supplyDefaults:i,opacityscaleDefaults:n}}),bE=Vt((X,V)=>{var c=df();V.exports=function(g,E){E.surfacecolor?c(g,E,{vals:E.surfacecolor,containerStr:"",cLetter:"c"}):c(g,E,{vals:E.z,containerStr:"",cLetter:"c"})}}),wE=Vt((X,V)=>{var c=Dh().gl_surface3d,g=Dh().ndarray,E=Dh().ndarray_linear_interpolate.d2,A=m1(),t=v1(),e=qr().isArrayOrTypedArray,r=Wp().parseColorScale,i=Gp(),n=Ul().extractOpts;function o(k,_,D){this.scene=k,this.uid=D,this.surface=_,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var a=o.prototype;a.getXat=function(k,_,D,I){var O=e(this.data.x)?e(this.data.x[0])?this.data.x[_][k]:this.data.x[k]:k;return D===void 0?O:I.d2l(O,0,D)},a.getYat=function(k,_,D,I){var O=e(this.data.y)?e(this.data.y[0])?this.data.y[_][k]:this.data.y[_]:_;return D===void 0?O:I.d2l(O,0,D)},a.getZat=function(k,_,D,I){var O=this.data.z[_][k];return O===null&&this.data.connectgaps&&this.data._interpolatedZ&&(O=this.data._interpolatedZ[_][k]),D===void 0?O:I.d2l(O,0,D)},a.handlePick=function(k){if(k.object===this.surface){var _=(k.data.index[0]-1)/this.dataScaleX-1,D=(k.data.index[1]-1)/this.dataScaleY-1,I=Math.max(Math.min(Math.round(_),this.data.z[0].length-1),0),O=Math.max(Math.min(Math.round(D),this.data._ylength-1),0);k.index=[I,O],k.traceCoordinate=[this.getXat(I,O),this.getYat(I,O),this.getZat(I,O)],k.dataCoordinate=[this.getXat(I,O,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(I,O,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(I,O,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var B=0;B<3;B++){var R=k.dataCoordinate[B];R!=null&&(k.dataCoordinate[B]*=this.scene.dataScale[B])}var L=this.data.hovertext||this.data.text;return e(L)&&L[O]&&L[O][I]!==void 0?k.textLabel=L[O][I]:L?k.textLabel=L:k.textLabel="",k.data.dataCoordinate=k.dataCoordinate.slice(),this.surface.highlight(k.data),this.scene.glplot.spikes.position=k.dataCoordinate,!0}};function s(k){var _=k[0].rgb,D=k[k.length-1].rgb;return _[0]===D[0]&&_[1]===D[1]&&_[2]===D[2]&&_[3]===D[3]}var h=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function v(k,_){if(k<_)return 0;for(var D=0;Math.floor(k%_)===0;)k/=_,D++;return D}function m(k){for(var _=[],D=0;D<h.length;D++){var I=h[D];_.push(v(k,I))}return _}function p(k){for(var _=m(k),D=k,I=0;I<h.length;I++)if(_[I]>0){D=h[I];break}return D}function y(k,_){if(!(k<1||_<1)){for(var D=m(k),I=m(_),O=1,B=0;B<h.length;B++)O*=Math.pow(h[B],Math.max(D[B],I[B]));return O}}function l(k){if(k.length!==0){for(var _=1,D=0;D<k.length;D++)_=y(_,k[D]);return _}}a.calcXnums=function(k){var _,D=[];for(_=1;_<k;_++){var I=this.getXat(_-1,0),O=this.getXat(_,0);O!==I&&I!==void 0&&I!==null&&O!==void 0&&O!==null?D[_-1]=Math.abs(O-I):D[_-1]=0}var B=0;for(_=1;_<k;_++)B+=D[_-1];for(_=1;_<k;_++)D[_-1]===0?D[_-1]=1:D[_-1]=Math.round(B/D[_-1]);return D},a.calcYnums=function(k){var _,D=[];for(_=1;_<k;_++){var I=this.getYat(0,_-1),O=this.getYat(0,_);O!==I&&I!==void 0&&I!==null&&O!==void 0&&O!==null?D[_-1]=Math.abs(O-I):D[_-1]=0}var B=0;for(_=1;_<k;_++)B+=D[_-1];for(_=1;_<k;_++)D[_-1]===0?D[_-1]=1:D[_-1]=Math.round(B/D[_-1]);return D};var x=[1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260],b=x[9],S=x[13];a.estimateScale=function(k,_){for(var D=_===0?this.calcXnums(k):this.calcYnums(k),I=1+l(D);I<b;)I*=2;for(;I>S;)I--,I/=p(I),I++,I<b&&(I=S);var O=Math.round(I/k);return O>1?O:1};function T(k,_,D){var I=D[8]+D[2]*_[0]+D[5]*_[1];return k[0]=(D[6]+D[0]*_[0]+D[3]*_[1])/I,k[1]=(D[7]+D[1]*_[0]+D[4]*_[1])/I,k}function M(k,_,D){return w(k,_,T,D),k}function w(k,_,D,I){for(var O=[0,0],B=k.shape[0],R=k.shape[1],L=0;L<B;L++)for(var F=0;F<R;F++)D(O,[L,F],I),k.set(L,F,E(_,O[0],O[1]));return k}a.refineCoords=function(k){for(var _=this.dataScaleX,D=this.dataScaleY,I=k[0].shape[0],O=k[0].shape[1],B=Math.floor(k[0].shape[0]*_+1)|0,R=Math.floor(k[0].shape[1]*D+1)|0,L=1+I+1,F=1+O+1,N=g(new Float32Array(L*F),[L,F]),j=[1/_,0,0,0,1/D,0,0,0,1],G=0;G<k.length;++G){this.surface.padField(N,k[G]);var rt=g(new Float32Array(B*R),[B,R]);M(rt,N,j),k[G]=rt}};function u(k,_){for(var D=!1,I=0;I<k.length;I++)if(_===k[I]){D=!0;break}D===!1&&k.push(_)}a.setContourLevels=function(){var k=[[],[],[]],_=[!1,!1,!1],D=!1,I,O,B;for(I=0;I<3;++I)if(this.showContour[I]&&(D=!0,this.contourSize[I]>0&&this.contourStart[I]!==null&&this.contourEnd[I]!==null&&this.contourEnd[I]>this.contourStart[I]))for(_[I]=!0,O=this.contourStart[I];O<this.contourEnd[I];O+=this.contourSize[I])B=O*this.scene.dataScale[I],u(k[I],B);if(D){var R=[[],[],[]];for(I=0;I<3;++I)this.showContour[I]&&(R[I]=_[I]?k[I]:this.scene.contourLevels[I]);this.surface.update({levels:R})}},a.update=function(k){var _=this.scene,D=_.fullSceneLayout,I=this.surface,O=r(k),B=_.dataScale,R=k.z[0].length,L=k._ylength,F=_.contourLevels;this.data=k;var N,j,G,rt,ct=[];for(N=0;N<3;N++)for(ct[N]=[],j=0;j<R;j++)ct[N][j]=[];for(j=0;j<R;j++)for(G=0;G<L;G++)ct[0][j][G]=this.getXat(j,G,k.xcalendar,D.xaxis),ct[1][j][G]=this.getYat(j,G,k.ycalendar,D.yaxis),ct[2][j][G]=this.getZat(j,G,k.zcalendar,D.zaxis);if(k.connectgaps)for(k._emptypoints=t(ct[2]),A(ct[2],k._emptypoints),k._interpolatedZ=[],j=0;j<R;j++)for(k._interpolatedZ[j]=[],G=0;G<L;G++)k._interpolatedZ[j][G]=ct[2][j][G];for(N=0;N<3;N++)for(j=0;j<R;j++)for(G=0;G<L;G++)rt=ct[N][j][G],rt==null?ct[N][j][G]=NaN:rt=ct[N][j][G]*=B[N];for(N=0;N<3;N++)for(j=0;j<R;j++)for(G=0;G<L;G++)rt=ct[N][j][G],rt!=null&&(this.minValues[N]>rt&&(this.minValues[N]=rt),this.maxValues[N]<rt&&(this.maxValues[N]=rt));for(N=0;N<3;N++)this.objectOffset[N]=.5*(this.minValues[N]+this.maxValues[N]);for(N=0;N<3;N++)for(j=0;j<R;j++)for(G=0;G<L;G++)rt=ct[N][j][G],rt!=null&&(ct[N][j][G]-=this.objectOffset[N]);var lt=[g(new Float32Array(R*L),[R,L]),g(new Float32Array(R*L),[R,L]),g(new Float32Array(R*L),[R,L])];for(N=0;N<3;N++)for(j=0;j<R;j++)for(G=0;G<L;G++)lt[N].set(j,G,ct[N][j][G]);ct=[];var tt={colormap:O,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!k.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacityscale:k.opacityscale,opacity:k.opacity},Z=n(k);if(tt.intensityBounds=[Z.min,Z.max],k.surfacecolor){var st=g(new Float32Array(R*L),[R,L]);for(j=0;j<R;j++)for(G=0;G<L;G++)st.set(j,G,k.surfacecolor[G][j]);lt.push(st)}else tt.intensityBounds[0]*=B[2],tt.intensityBounds[1]*=B[2];(S<lt[0].shape[0]||S<lt[0].shape[1])&&(this.refineData=!1),this.refineData===!0&&(this.dataScaleX=this.estimateScale(lt[0].shape[0],0),this.dataScaleY=this.estimateScale(lt[0].shape[1],1),(this.dataScaleX!==1||this.dataScaleY!==1)&&this.refineCoords(lt)),k.surfacecolor&&(tt.intensity=lt.pop());var $=[!0,!0,!0],Q=["x","y","z"];for(N=0;N<3;++N){var nt=k.contours[Q[N]];$[N]=nt.highlight,tt.showContour[N]=nt.show||nt.highlight,tt.showContour[N]&&(tt.contourProject[N]=[nt.project.x,nt.project.y,nt.project.z],nt.show?(this.showContour[N]=!0,tt.levels[N]=F[N],I.highlightColor[N]=tt.contourColor[N]=i(nt.color),nt.usecolormap?I.highlightTint[N]=tt.contourTint[N]=0:I.highlightTint[N]=tt.contourTint[N]=1,tt.contourWidth[N]=nt.width,this.contourStart[N]=nt.start,this.contourEnd[N]=nt.end,this.contourSize[N]=nt.size):(this.showContour[N]=!1,this.contourStart[N]=null,this.contourEnd[N]=null,this.contourSize[N]=0),nt.highlight&&(tt.dynamicColor[N]=i(nt.highlightcolor),tt.dynamicWidth[N]=nt.highlightwidth))}s(O)&&(tt.vertexColor=!0),tt.objectOffset=this.objectOffset,tt.coords=lt,I.update(tt),I.visible=k.visible,I.enableDynamic=$,I.enableHighlight=$,I.snapToData=!0,"lighting"in k&&(I.ambientLight=k.lighting.ambient,I.diffuseLight=k.lighting.diffuse,I.specularLight=k.lighting.specular,I.roughness=k.lighting.roughness,I.fresnel=k.lighting.fresnel),"lightposition"in k&&(I.lightPosition=[k.lightposition.x,k.lightposition.y,k.lightposition.z])},a.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()};function f(k,_){var D=k.glplot.gl,I=c({gl:D}),O=new o(k,I,_.uid);return I._trace=O,O.update(_),k.glplot.add(I),O}V.exports=f}),TE=Vt((X,V)=>{V.exports={attributes:Av(),supplyDefaults:m3().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:bE(),plot:wE(),moduleType:"trace",name:"surface",basePlotModule:Nd(),categories:["gl3d","2dMap","showLegend"],meta:{}}}),kE=Vt((X,V)=>{V.exports=TE()}),Hg=Vt((X,V)=>{var c=wl(),g=qu().axisHoverFormat,E=Zo().hovertemplateAttrs,A=Av(),t=Ks(),e=po().extendFlat;V.exports=e({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:E({editType:"calc"}),xhoverformat:g("x"),yhoverformat:g("y"),zhoverformat:g("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"}},c("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:A.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:e({},A.contours.x.show,{}),color:A.contours.x.color,width:A.contours.x.width,editType:"calc"},lightposition:{x:e({},A.lightposition.x,{dflt:1e5}),y:e({},A.lightposition.y,{dflt:1e5}),z:e({},A.lightposition.z,{dflt:0}),editType:"calc"},lighting:e({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},A.lighting),hoverinfo:e({},t.hoverinfo,{editType:"calc"}),showlegend:e({},t.showlegend,{dflt:!1})})}),bx=Vt((X,V)=>{var c=wl(),g=qu().axisHoverFormat,E=Zo().hovertemplateAttrs,A=Hg(),t=Ks(),e=po().extendFlat,r=su().overrideAll;function i(a){return{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}}function n(a){return{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}}var o=V.exports=r(e({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:i(),y:i(),z:i()},caps:{x:n(),y:n(),z:n()},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:E(),xhoverformat:g("x"),yhoverformat:g("y"),zhoverformat:g("z"),valuehoverformat:g("value",1),showlegend:e({},t.showlegend,{dflt:!1})},c("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:A.opacity,lightposition:A.lightposition,lighting:A.lighting,flatshading:A.flatshading,contour:A.contour,hoverinfo:e({},t.hoverinfo)}),"calc","nested");o.flatshading.dflt=!0,o.lighting.facenormalsepsilon.dflt=0,o.x.editType=o.y.editType=o.z.editType=o.value.editType="calc+clearAxisTypes"}),v3=Vt((X,V)=>{var c=qr(),g=Mi(),E=bx(),A=ah();function t(r,i,n,o){function a(s,h){return c.coerce(r,i,E,s,h)}e(r,i,n,o,a)}function e(r,i,n,o,a){var s=a("isomin"),h=a("isomax");h!=null&&s!==void 0&&s!==null&&s>h&&(i.isomin=null,i.isomax=null);var v=a("x"),m=a("y"),p=a("z"),y=a("value");if(!v||!v.length||!m||!m.length||!p||!p.length||!y||!y.length){i.visible=!1;return}var l=g.getComponentMethod("calendars","handleTraceDefaults");l(r,i,["x","y","z"],o),a("valuehoverformat"),["x","y","z"].forEach(function(T){a(T+"hoverformat");var M="caps."+T,w=a(M+".show");w&&a(M+".fill");var u="slices."+T,f=a(u+".show");f&&(a(u+".fill"),a(u+".locations"))});var x=a("spaceframe.show");x&&a("spaceframe.fill");var b=a("surface.show");b&&(a("surface.count"),a("surface.fill"),a("surface.pattern"));var S=a("contour.show");S&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(T){a(T)}),A(r,i,o,a,{prefix:"",cLetter:"c"}),i._length=null}V.exports={supplyDefaults:t,supplyIsoDefaults:e}}),wx=Vt((X,V)=>{var c=qr(),g=df();function E(r,i){i._len=Math.min(i.u.length,i.v.length,i.w.length,i.x.length,i.y.length,i.z.length),i._u=e(i.u,i._len),i._v=e(i.v,i._len),i._w=e(i.w,i._len),i._x=e(i.x,i._len),i._y=e(i.y,i._len),i._z=e(i.z,i._len);var n=A(i);i._gridFill=n.fill,i._Xs=n.Xs,i._Ys=n.Ys,i._Zs=n.Zs,i._len=n.len;var o=0,a,s,h;i.starts&&(a=e(i.starts.x||[]),s=e(i.starts.y||[]),h=e(i.starts.z||[]),o=Math.min(a.length,s.length,h.length)),i._startsX=a||[],i._startsY=s||[],i._startsZ=h||[];var v=0,m=1/0,p;for(p=0;p<i._len;p++){var y=i._u[p],l=i._v[p],x=i._w[p],b=Math.sqrt(y*y+l*l+x*x);v=Math.max(v,b),m=Math.min(m,b)}for(g(r,i,{vals:[m,v],containerStr:"",cLetter:"c"}),p=0;p<o;p++){var S=a[p];n.xMax=Math.max(n.xMax,S),n.xMin=Math.min(n.xMin,S);var T=s[p];n.yMax=Math.max(n.yMax,T),n.yMin=Math.min(n.yMin,T);var M=h[p];n.zMax=Math.max(n.zMax,M),n.zMin=Math.min(n.zMin,M)}i._slen=o,i._normMax=v,i._xbnds=[n.xMin,n.xMax],i._ybnds=[n.yMin,n.yMax],i._zbnds=[n.zMin,n.zMax]}function A(r){var i=r._x,n=r._y,o=r._z,a=r._len,s,h,v,m=-1/0,p=1/0,y=-1/0,l=1/0,x=-1/0,b=1/0,S="",T,M,w,u,f,k,_,D,I;for(a&&(u=i[0],k=n[0],D=o[0]),a>1&&(f=i[a-1],_=n[a-1],I=o[a-1]),s=0;s<a;s++)m=Math.max(m,i[s]),p=Math.min(p,i[s]),y=Math.max(y,n[s]),l=Math.min(l,n[s]),x=Math.max(x,o[s]),b=Math.min(b,o[s]),!T&&i[s]!==u&&(T=!0,S+="x"),!M&&n[s]!==k&&(M=!0,S+="y"),!w&&o[s]!==D&&(w=!0,S+="z");T||(S+="x"),M||(S+="y"),w||(S+="z");var O=t(r._x),B=t(r._y),R=t(r._z);S=S.replace("x",(u>f?"-":"+")+"x"),S=S.replace("y",(k>_?"-":"+")+"y"),S=S.replace("z",(D>I?"-":"+")+"z");var L=function(){a=0,O=[],B=[],R=[]};(!a||a<O.length*B.length*R.length)&&L();var F=function(wt){return wt==="x"?i:wt==="y"?n:o},N=function(wt){return wt==="x"?O:wt==="y"?B:R},j=function(wt){return wt[a-1]<wt[0]?-1:1},G=F(S[1]),rt=F(S[3]),ct=F(S[5]),lt=N(S[1]).length,tt=N(S[3]).length,Z=N(S[5]).length,st=!1,$=function(wt,xt,Ft){return lt*(tt*wt+xt)+Ft},Q=j(F(S[1])),nt=j(F(S[3])),Y=j(F(S[5]));for(s=0;s<Z-1;s++){for(h=0;h<tt-1;h++){for(v=0;v<lt-1;v++){var q=$(s,h,v),ot=$(s,h,v+1),it=$(s,h+1,v),dt=$(s+1,h,v);if((!(G[q]*Q<G[ot]*Q)||!(rt[q]*nt<rt[it]*nt)||!(ct[q]*Y<ct[dt]*Y))&&(st=!0),st)break}if(st)break}if(st)break}return st&&(c.warn("Encountered arbitrary coordinates! Unable to input data grid."),L()),{xMin:p,yMin:l,zMin:b,xMax:m,yMax:y,zMax:x,Xs:O,Ys:B,Zs:R,len:a,fill:S}}function t(r){return c.distinctVals(r).vals}function e(r,i){if(i===void 0&&(i=r.length),c.isTypedArray(r))return r.subarray(0,i);for(var n=[],o=0;o<i;o++)n[o]=+r[o];return n}V.exports={calc:E,filter:e,processGrid:A}}),y3=Vt((X,V)=>{var c=df(),g=wx().processGrid,E=wx().filter;V.exports=function(A,t){t._len=Math.min(t.x.length,t.y.length,t.z.length,t.value.length),t._x=E(t.x,t._len),t._y=E(t.y,t._len),t._z=E(t.z,t._len),t._value=E(t.value,t._len);var e=g(t);t._gridFill=e.fill,t._Xs=e.Xs,t._Ys=e.Ys,t._Zs=e.Zs,t._len=e.len;for(var r=1/0,i=-1/0,n=0;n<t._len;n++){var o=t._value[n];r=Math.min(r,o),i=Math.max(i,o)}t._minValues=r,t._maxValues=i,t._vMin=t.isomin===void 0||t.isomin===null?r:t.isomin,t._vMax=t.isomax===void 0||t.isomax===null?i:t.isomax,c(A,t,{vals:[t._vMin,t._vMax],containerStr:"",cLetter:"c"})}}),Gg=Vt((X,V)=>{V.exports=function(c,g,E,A){A=A||c.length;for(var t=new Array(A),e=0;e<A;e++)t[e]=[c[e],g[e],E[e]];return t}}),Tx=Vt((X,V)=>{var c=Dh().gl_mesh3d,g=Wp().parseColorScale,E=qr().isArrayOrTypedArray,A=Gp(),t=Ul().extractOpts,e=Gg(),r=function(h,v){for(var m=v.length-1;m>0;m--){var p=Math.min(v[m],v[m-1]),y=Math.max(v[m],v[m-1]);if(y>p&&p<h&&h<=y)return{id:m,distRatio:(y-h)/(y-p)}}return{id:0,distRatio:0}};function i(h,v,m){this.scene=h,this.uid=m,this.mesh=v,this.name="",this.data=null,this.showContour=!1}var n=i.prototype;n.handlePick=function(h){if(h.object===this.mesh){var v=h.data.index,m=this.data._meshX[v],p=this.data._meshY[v],y=this.data._meshZ[v],l=this.data._Ys.length,x=this.data._Zs.length,b=r(m,this.data._Xs).id,S=r(p,this.data._Ys).id,T=r(y,this.data._Zs).id,M=h.index=T+x*S+x*l*b;h.traceCoordinate=[this.data._meshX[M],this.data._meshY[M],this.data._meshZ[M],this.data._value[M]];var w=this.data.hovertext||this.data.text;return E(w)&&w[M]!==void 0?h.textLabel=w[M]:w&&(h.textLabel=w),!0}},n.update=function(h){var v=this.scene,m=v.fullSceneLayout;this.data=a(h);function p(S,T,M,w){return T.map(function(u){return S.d2l(u,0,w)*M})}var y=e(p(m.xaxis,h._meshX,v.dataScale[0],h.xcalendar),p(m.yaxis,h._meshY,v.dataScale[1],h.ycalendar),p(m.zaxis,h._meshZ,v.dataScale[2],h.zcalendar)),l=e(h._meshI,h._meshJ,h._meshK),x={positions:y,cells:l,lightPosition:[h.lightposition.x,h.lightposition.y,h.lightposition.z],ambient:h.lighting.ambient,diffuse:h.lighting.diffuse,specular:h.lighting.specular,roughness:h.lighting.roughness,fresnel:h.lighting.fresnel,vertexNormalsEpsilon:h.lighting.vertexnormalsepsilon,faceNormalsEpsilon:h.lighting.facenormalsepsilon,opacity:h.opacity,contourEnable:h.contour.show,contourColor:A(h.contour.color).slice(0,3),contourWidth:h.contour.width,useFacetNormals:h.flatshading},b=t(h);x.vertexIntensity=h._meshIntensity,x.vertexIntensityBounds=[b.min,b.max],x.colormap=g(h),this.mesh.update(x)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};var o=["xyz","xzy","yxz","yzx","zxy","zyx"];function a(h){h._meshI=[],h._meshJ=[],h._meshK=[];var v=h.surface.show,m=h.spaceframe.show,p=h.surface.fill,y=h.spaceframe.fill,l=!1,x=!1,b=0,S,T,M=h._Xs,w=h._Ys,u=h._Zs,f=M.length,k=w.length,_=u.length,D=o.indexOf(h._gridFill.replace(/-/g,"").replace(/\+/g,"")),I=function(he,Dt,qt){switch(D){case 5:return qt+_*Dt+_*k*he;case 4:return qt+_*he+_*f*Dt;case 3:return Dt+k*qt+k*_*he;case 2:return Dt+k*he+k*f*qt;case 1:return he+f*qt+f*_*Dt;default:return he+f*Dt+f*k*qt}},O=h._minValues,B=h._maxValues,R=h._vMin,L=h._vMax,F,N,j,G;function rt(he,Dt,qt){for(var zt=G.length,ut=T;ut<zt;ut++)if(he===F[ut]&&Dt===N[ut]&&qt===j[ut])return ut;return-1}function ct(){T=S}function lt(){F=[],N=[],j=[],G=[],S=0,ct()}function tt(he,Dt,qt,zt){return F.push(he),N.push(Dt),j.push(qt),G.push(zt),S++,S-1}function Z(he,Dt,qt){return h._meshI.push(he),h._meshJ.push(Dt),h._meshK.push(qt),b++,b-1}function st(he,Dt,qt){for(var zt=[],ut=0;ut<he.length;ut++)zt[ut]=(he[ut]+Dt[ut]+qt[ut])/3;return zt}function $(he,Dt,qt){for(var zt=[],ut=0;ut<he.length;ut++)zt[ut]=he[ut]*(1-qt)+qt*Dt[ut];return zt}var Q;function nt(he){Q=he}function Y(he,Dt){var qt=he[0],zt=he[1],ut=he[2],yt=st(qt,zt,ut),Mt=Math.sqrt(1-Q),Ot=$(yt,qt,Mt),$t=$(yt,zt,Mt),ee=$(yt,ut,Mt),we=Dt[0],Me=Dt[1],Re=Dt[2];return{xyzv:[[qt,zt,$t],[$t,Ot,qt],[zt,ut,ee],[ee,$t,zt],[ut,qt,Ot],[Ot,ee,ut]],abc:[[we,Me,-1],[-1,-1,we],[Me,Re,-1],[-1,-1,Me],[Re,we,-1],[-1,-1,Re]]}}function q(he,Dt){return he==="all"||he===null?!0:he.indexOf(Dt)>-1}function ot(he,Dt){return he===null?Dt:he}function it(he,Dt,qt){ct();var zt=[Dt],ut=[qt];if(Q>=1)zt=[Dt],ut=[qt];else if(Q>0){var yt=Y(Dt,qt);zt=yt.xyzv,ut=yt.abc}for(var Mt=0;Mt<zt.length;Mt++){Dt=zt[Mt],qt=ut[Mt];for(var Ot=[],$t=0;$t<3;$t++){var ee=Dt[$t][0],we=Dt[$t][1],Me=Dt[$t][2],Re=Dt[$t][3],Be=qt[$t]>-1?qt[$t]:rt(ee,we,Me);Be>-1?Ot[$t]=Be:Ot[$t]=tt(ee,we,Me,ot(he,Re))}Z(Ot[0],Ot[1],Ot[2])}}function dt(he,Dt,qt){var zt=function(ut,yt,Mt){it(he,[Dt[ut],Dt[yt],Dt[Mt]],[qt[ut],qt[yt],qt[Mt]])};zt(0,1,2),zt(2,3,0)}function wt(he,Dt,qt){var zt=function(ut,yt,Mt){it(he,[Dt[ut],Dt[yt],Dt[Mt]],[qt[ut],qt[yt],qt[Mt]])};zt(0,1,2),zt(3,0,1),zt(2,3,0),zt(1,2,3)}function xt(he,Dt,qt,zt){var ut=he[3];ut<qt&&(ut=qt),ut>zt&&(ut=zt);for(var yt=(he[3]-ut)/(he[3]-Dt[3]+1e-9),Mt=[],Ot=0;Ot<4;Ot++)Mt[Ot]=(1-yt)*he[Ot]+yt*Dt[Ot];return Mt}function Ft(he,Dt,qt){return he>=Dt&&he<=qt}function Et(he){var Dt=.001*(L-R);return he>=R-Dt&&he<=L+Dt}function Nt(he){for(var Dt=[],qt=0;qt<4;qt++){var zt=he[qt];Dt.push([h._x[zt],h._y[zt],h._z[zt],h._value[zt]])}return Dt}var te=3;function Jt(he,Dt,qt,zt,ut,yt){yt||(yt=1),qt=[-1,-1,-1];var Mt=!1,Ot=[Ft(Dt[0][3],zt,ut),Ft(Dt[1][3],zt,ut),Ft(Dt[2][3],zt,ut)];if(!Ot[0]&&!Ot[1]&&!Ot[2])return!1;var $t=function(we,Me,Re){return Et(Me[0][3])&&Et(Me[1][3])&&Et(Me[2][3])?(it(we,Me,Re),!0):yt<te?Jt(we,Me,Re,R,L,++yt):!1};if(Ot[0]&&Ot[1]&&Ot[2])return $t(he,Dt,qt)||Mt;var ee=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach(function(we){if(Ot[we[0]]&&Ot[we[1]]&&!Ot[we[2]]){var Me=Dt[we[0]],Re=Dt[we[1]],Be=Dt[we[2]],Ze=xt(Be,Me,zt,ut),Ue=xt(Be,Re,zt,ut);Mt=$t(he,[Ue,Ze,Me],[-1,-1,qt[we[0]]])||Mt,Mt=$t(he,[Me,Re,Ue],[qt[we[0]],qt[we[1]],-1])||Mt,ee=!0}}),ee||[[0,1,2],[1,2,0],[2,0,1]].forEach(function(we){if(Ot[we[0]]&&!Ot[we[1]]&&!Ot[we[2]]){var Me=Dt[we[0]],Re=Dt[we[1]],Be=Dt[we[2]],Ze=xt(Re,Me,zt,ut),Ue=xt(Be,Me,zt,ut);Mt=$t(he,[Ue,Ze,Me],[-1,-1,qt[we[0]]])||Mt,ee=!0}}),Mt}function Qt(he,Dt,qt,zt){var ut=!1,yt=Nt(Dt),Mt=[Ft(yt[0][3],qt,zt),Ft(yt[1][3],qt,zt),Ft(yt[2][3],qt,zt),Ft(yt[3][3],qt,zt)];if(!Mt[0]&&!Mt[1]&&!Mt[2]&&!Mt[3])return ut;if(Mt[0]&&Mt[1]&&Mt[2]&&Mt[3])return x&&(ut=wt(he,yt,Dt)||ut),ut;var Ot=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach(function($t){if(Mt[$t[0]]&&Mt[$t[1]]&&Mt[$t[2]]&&!Mt[$t[3]]){var ee=yt[$t[0]],we=yt[$t[1]],Me=yt[$t[2]],Re=yt[$t[3]];if(x)ut=it(he,[ee,we,Me],[Dt[$t[0]],Dt[$t[1]],Dt[$t[2]]])||ut;else{var Be=xt(Re,ee,qt,zt),Ze=xt(Re,we,qt,zt),Ue=xt(Re,Me,qt,zt);ut=it(null,[Be,Ze,Ue],[-1,-1,-1])||ut}Ot=!0}}),Ot||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach(function($t){if(Mt[$t[0]]&&Mt[$t[1]]&&!Mt[$t[2]]&&!Mt[$t[3]]){var ee=yt[$t[0]],we=yt[$t[1]],Me=yt[$t[2]],Re=yt[$t[3]],Be=xt(Me,ee,qt,zt),Ze=xt(Me,we,qt,zt),Ue=xt(Re,we,qt,zt),mr=xt(Re,ee,qt,zt);x?(ut=it(he,[ee,mr,Be],[Dt[$t[0]],-1,-1])||ut,ut=it(he,[we,Ze,Ue],[Dt[$t[1]],-1,-1])||ut):ut=dt(null,[Be,Ze,Ue,mr],[-1,-1,-1,-1])||ut,Ot=!0}}),Ot)||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach(function($t){if(Mt[$t[0]]&&!Mt[$t[1]]&&!Mt[$t[2]]&&!Mt[$t[3]]){var ee=yt[$t[0]],we=yt[$t[1]],Me=yt[$t[2]],Re=yt[$t[3]],Be=xt(we,ee,qt,zt),Ze=xt(Me,ee,qt,zt),Ue=xt(Re,ee,qt,zt);x?(ut=it(he,[ee,Be,Ze],[Dt[$t[0]],-1,-1])||ut,ut=it(he,[ee,Ze,Ue],[Dt[$t[0]],-1,-1])||ut,ut=it(he,[ee,Ue,Be],[Dt[$t[0]],-1,-1])||ut):ut=it(null,[Be,Ze,Ue],[-1,-1,-1])||ut,Ot=!0}}),ut}function Wt(he,Dt,qt,zt,ut,yt,Mt,Ot,$t,ee,we){var Me=!1;return l&&(q(he,"A")&&(Me=Qt(null,[Dt,qt,zt,yt],ee,we)||Me),q(he,"B")&&(Me=Qt(null,[qt,zt,ut,$t],ee,we)||Me),q(he,"C")&&(Me=Qt(null,[qt,yt,Mt,$t],ee,we)||Me),q(he,"D")&&(Me=Qt(null,[zt,yt,Ot,$t],ee,we)||Me),q(he,"E")&&(Me=Qt(null,[qt,zt,yt,$t],ee,we)||Me)),x&&(Me=Qt(he,[qt,zt,yt,$t],ee,we)||Me),Me}function gt(he,Dt,qt,zt,ut,yt,Mt,Ot){return[Ot[0]===!0?!0:Jt(he,Nt([Dt,qt,zt]),[Dt,qt,zt],yt,Mt),Ot[1]===!0?!0:Jt(he,Nt([zt,ut,Dt]),[zt,ut,Dt],yt,Mt)]}function bt(he,Dt,qt,zt,ut,yt,Mt,Ot,$t){return Ot?gt(he,Dt,qt,ut,zt,yt,Mt,$t):gt(he,qt,ut,zt,Dt,yt,Mt,$t)}function vt(he,Dt,qt,zt,ut,yt,Mt){var Ot=!1,$t,ee,we,Me,Re=function(){Ot=Jt(he,[$t,ee,we],[-1,-1,-1],ut,yt)||Ot,Ot=Jt(he,[we,Me,$t],[-1,-1,-1],ut,yt)||Ot},Be=Mt[0],Ze=Mt[1],Ue=Mt[2];return Be&&($t=$(Nt([I(Dt,qt-0,zt-0)])[0],Nt([I(Dt-1,qt-0,zt-0)])[0],Be),ee=$(Nt([I(Dt,qt-0,zt-1)])[0],Nt([I(Dt-1,qt-0,zt-1)])[0],Be),we=$(Nt([I(Dt,qt-1,zt-1)])[0],Nt([I(Dt-1,qt-1,zt-1)])[0],Be),Me=$(Nt([I(Dt,qt-1,zt-0)])[0],Nt([I(Dt-1,qt-1,zt-0)])[0],Be),Re()),Ze&&($t=$(Nt([I(Dt-0,qt,zt-0)])[0],Nt([I(Dt-0,qt-1,zt-0)])[0],Ze),ee=$(Nt([I(Dt-0,qt,zt-1)])[0],Nt([I(Dt-0,qt-1,zt-1)])[0],Ze),we=$(Nt([I(Dt-1,qt,zt-1)])[0],Nt([I(Dt-1,qt-1,zt-1)])[0],Ze),Me=$(Nt([I(Dt-1,qt,zt-0)])[0],Nt([I(Dt-1,qt-1,zt-0)])[0],Ze),Re()),Ue&&($t=$(Nt([I(Dt-0,qt-0,zt)])[0],Nt([I(Dt-0,qt-0,zt-1)])[0],Ue),ee=$(Nt([I(Dt-0,qt-1,zt)])[0],Nt([I(Dt-0,qt-1,zt-1)])[0],Ue),we=$(Nt([I(Dt-1,qt-1,zt)])[0],Nt([I(Dt-1,qt-1,zt-1)])[0],Ue),Me=$(Nt([I(Dt-1,qt-0,zt)])[0],Nt([I(Dt-1,qt-0,zt-1)])[0],Ue),Re()),Ot}function Ut(he,Dt,qt,zt,ut,yt,Mt,Ot,$t,ee,we,Me){var Re=he;return Me?(l&&he==="even"&&(Re=null),Wt(Re,Dt,qt,zt,ut,yt,Mt,Ot,$t,ee,we)):(l&&he==="odd"&&(Re=null),Wt(Re,$t,Ot,Mt,yt,ut,zt,qt,Dt,ee,we))}function Kt(he,Dt,qt,zt,ut){for(var yt=[],Mt=0,Ot=0;Ot<Dt.length;Ot++)for(var $t=Dt[Ot],ee=1;ee<_;ee++)for(var we=1;we<k;we++)yt.push(bt(he,I($t,we-1,ee-1),I($t,we-1,ee),I($t,we,ee-1),I($t,we,ee),qt,zt,($t+we+ee)%2,ut&&ut[Mt]?ut[Mt]:[])),Mt++;return yt}function Zt(he,Dt,qt,zt,ut){for(var yt=[],Mt=0,Ot=0;Ot<Dt.length;Ot++)for(var $t=Dt[Ot],ee=1;ee<f;ee++)for(var we=1;we<_;we++)yt.push(bt(he,I(ee-1,$t,we-1),I(ee,$t,we-1),I(ee-1,$t,we),I(ee,$t,we),qt,zt,(ee+$t+we)%2,ut&&ut[Mt]?ut[Mt]:[])),Mt++;return yt}function le(he,Dt,qt,zt,ut){for(var yt=[],Mt=0,Ot=0;Ot<Dt.length;Ot++)for(var $t=Dt[Ot],ee=1;ee<k;ee++)for(var we=1;we<f;we++)yt.push(bt(he,I(we-1,ee-1,$t),I(we-1,ee,$t),I(we,ee-1,$t),I(we,ee,$t),qt,zt,(we+ee+$t)%2,ut&&ut[Mt]?ut[Mt]:[])),Mt++;return yt}function Te(he,Dt,qt){for(var zt=1;zt<_;zt++)for(var ut=1;ut<k;ut++)for(var yt=1;yt<f;yt++)Ut(he,I(yt-1,ut-1,zt-1),I(yt-1,ut-1,zt),I(yt-1,ut,zt-1),I(yt-1,ut,zt),I(yt,ut-1,zt-1),I(yt,ut-1,zt),I(yt,ut,zt-1),I(yt,ut,zt),Dt,qt,(yt+ut+zt)%2)}function Se(he,Dt,qt){x=!0,Te(he,Dt,qt),x=!1}function Fe(he,Dt,qt){l=!0,Te(he,Dt,qt),l=!1}function Oe(he,Dt,qt,zt,ut,yt){for(var Mt=[],Ot=0,$t=0;$t<Dt.length;$t++)for(var ee=Dt[$t],we=1;we<_;we++)for(var Me=1;Me<k;Me++)Mt.push(vt(he,ee,Me,we,qt,zt,ut[$t],yt&&yt[Ot]?yt[Ot]:[])),Ot++;return Mt}function ur(he,Dt,qt,zt,ut,yt){for(var Mt=[],Ot=0,$t=0;$t<Dt.length;$t++)for(var ee=Dt[$t],we=1;we<f;we++)for(var Me=1;Me<_;Me++)Mt.push(vt(he,we,ee,Me,qt,zt,ut[$t],yt&&yt[Ot]?yt[Ot]:[])),Ot++;return Mt}function fr(he,Dt,qt,zt,ut,yt){for(var Mt=[],Ot=0,$t=0;$t<Dt.length;$t++)for(var ee=Dt[$t],we=1;we<k;we++)for(var Me=1;Me<f;Me++)Mt.push(vt(he,Me,we,ee,qt,zt,ut[$t],yt&&yt[Ot]?yt[Ot]:[])),Ot++;return Mt}function We(he,Dt){for(var qt=[],zt=he;zt<Dt;zt++)qt.push(zt);return qt}function Lr(){for(var he=0;he<f;he++)for(var Dt=0;Dt<k;Dt++)for(var qt=0;qt<_;qt++){var zt=I(he,Dt,qt);tt(h._x[zt],h._y[zt],h._z[zt],h._value[zt])}}function kr(){lt(),Lr();var he=null;if(m&&y&&(nt(y),Se(he,R,L)),v&&p){nt(p);for(var Dt=h.surface.pattern,qt=h.surface.count,zt=0;zt<qt;zt++){var ut=qt===1?.5:zt/(qt-1),yt=(1-ut)*R+ut*L,Mt=Math.abs(yt-O),Ot=Math.abs(yt-B),$t=Mt>Ot?[O,yt]:[yt,B];Fe(Dt,$t[0],$t[1])}}var ee=[[Math.min(R,B),Math.max(R,B)],[Math.min(O,L),Math.max(O,L)]];["x","y","z"].forEach(function(we){for(var Me=[],Re=0;Re<ee.length;Re++){var Be=0,Ze=ee[Re][0],Ue=ee[Re][1],mr=h.slices[we];if(mr.show&&mr.fill){nt(mr.fill);var ln=[],an=[],vn=[];if(mr.locations.length)for(var Sn=0;Sn<mr.locations.length;Sn++){var An=r(mr.locations[Sn],we==="x"?M:we==="y"?w:u);An.distRatio===0?ln.push(An.id):An.id>0&&(an.push(An.id),we==="x"?vn.push([An.distRatio,0,0]):we==="y"?vn.push([0,An.distRatio,0]):vn.push([0,0,An.distRatio]))}else we==="x"?ln=We(1,f-1):we==="y"?ln=We(1,k-1):ln=We(1,_-1);an.length>0&&(we==="x"?Me[Be]=Oe(he,an,Ze,Ue,vn,Me[Be]):we==="y"?Me[Be]=ur(he,an,Ze,Ue,vn,Me[Be]):Me[Be]=fr(he,an,Ze,Ue,vn,Me[Be]),Be++),ln.length>0&&(we==="x"?Me[Be]=Kt(he,ln,Ze,Ue,Me[Be]):we==="y"?Me[Be]=Zt(he,ln,Ze,Ue,Me[Be]):Me[Be]=le(he,ln,Ze,Ue,Me[Be]),Be++)}var pn=h.caps[we];pn.show&&pn.fill&&(nt(pn.fill),we==="x"?Me[Be]=Kt(he,[0,f-1],Ze,Ue,Me[Be]):we==="y"?Me[Be]=Zt(he,[0,k-1],Ze,Ue,Me[Be]):Me[Be]=le(he,[0,_-1],Ze,Ue,Me[Be]),Be++)}}),b===0&<(),h._meshX=F,h._meshY=N,h._meshZ=j,h._meshIntensity=G,h._Xs=M,h._Ys=w,h._Zs=u}return kr(),h}function s(h,v){var m=h.glplot.gl,p=c({gl:m}),y=new i(h,p,v.uid);return p._trace=y,y.update(v),h.glplot.add(p),y}V.exports={findNearestOnAxis:r,generateIsoMeshes:a,createIsosurfaceTrace:s}}),AE=Vt((X,V)=>{V.exports={attributes:bx(),supplyDefaults:v3().supplyDefaults,calc:y3(),colorbar:{min:"cmin",max:"cmax"},plot:Tx().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:Nd(),categories:["gl3d","showLegend"],meta:{}}}),ME=Vt((X,V)=>{V.exports=AE()}),x3=Vt((X,V)=>{var c=wl(),g=bx(),E=Av(),A=Ks(),t=po().extendFlat,e=su().overrideAll,r=V.exports=e(t({x:g.x,y:g.y,z:g.z,value:g.value,isomin:g.isomin,isomax:g.isomax,surface:g.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:g.slices,caps:g.caps,text:g.text,hovertext:g.hovertext,xhoverformat:g.xhoverformat,yhoverformat:g.yhoverformat,zhoverformat:g.zhoverformat,valuehoverformat:g.valuehoverformat,hovertemplate:g.hovertemplate},c("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:g.colorbar,opacity:g.opacity,opacityscale:E.opacityscale,lightposition:g.lightposition,lighting:g.lighting,flatshading:g.flatshading,contour:g.contour,hoverinfo:t({},A.hoverinfo),showlegend:t({},A.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}),SE=Vt((X,V)=>{var c=qr(),g=x3(),E=v3().supplyIsoDefaults,A=m3().opacityscaleDefaults;V.exports=function(t,e,r,i){function n(o,a){return c.coerce(t,e,g,o,a)}E(t,e,r,i,n),A(t,e,i,n)}}),EE=Vt((X,V)=>{var c=Dh().gl_mesh3d,g=Wp().parseColorScale,E=qr().isArrayOrTypedArray,A=Gp(),t=Ul().extractOpts,e=Gg(),r=Tx().findNearestOnAxis,i=Tx().generateIsoMeshes;function n(s,h,v){this.scene=s,this.uid=v,this.mesh=h,this.name="",this.data=null,this.showContour=!1}var o=n.prototype;o.handlePick=function(s){if(s.object===this.mesh){var h=s.data.index,v=this.data._meshX[h],m=this.data._meshY[h],p=this.data._meshZ[h],y=this.data._Ys.length,l=this.data._Zs.length,x=r(v,this.data._Xs).id,b=r(m,this.data._Ys).id,S=r(p,this.data._Zs).id,T=s.index=S+l*b+l*y*x;s.traceCoordinate=[this.data._meshX[T],this.data._meshY[T],this.data._meshZ[T],this.data._value[T]];var M=this.data.hovertext||this.data.text;return E(M)&&M[T]!==void 0?s.textLabel=M[T]:M&&(s.textLabel=M),!0}},o.update=function(s){var h=this.scene,v=h.fullSceneLayout;this.data=i(s);function m(b,S,T,M){return S.map(function(w){return b.d2l(w,0,M)*T})}var p=e(m(v.xaxis,s._meshX,h.dataScale[0],s.xcalendar),m(v.yaxis,s._meshY,h.dataScale[1],s.ycalendar),m(v.zaxis,s._meshZ,h.dataScale[2],s.zcalendar)),y=e(s._meshI,s._meshJ,s._meshK),l={positions:p,cells:y,lightPosition:[s.lightposition.x,s.lightposition.y,s.lightposition.z],ambient:s.lighting.ambient,diffuse:s.lighting.diffuse,specular:s.lighting.specular,roughness:s.lighting.roughness,fresnel:s.lighting.fresnel,vertexNormalsEpsilon:s.lighting.vertexnormalsepsilon,faceNormalsEpsilon:s.lighting.facenormalsepsilon,opacity:s.opacity,opacityscale:s.opacityscale,contourEnable:s.contour.show,contourColor:A(s.contour.color).slice(0,3),contourWidth:s.contour.width,useFacetNormals:s.flatshading},x=t(s);l.vertexIntensity=s._meshIntensity,l.vertexIntensityBounds=[x.min,x.max],l.colormap=g(s),this.mesh.update(l)},o.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function a(s,h){var v=s.glplot.gl,m=c({gl:v}),p=new n(s,m,h.uid);return m._trace=p,p.update(h),s.glplot.add(m),p}V.exports=a}),PE=Vt((X,V)=>{V.exports={attributes:x3(),supplyDefaults:SE(),calc:y3(),colorbar:{min:"cmin",max:"cmax"},plot:EE(),moduleType:"trace",name:"volume",basePlotModule:Nd(),categories:["gl3d","showLegend"],meta:{}}}),IE=Vt((X,V)=>{V.exports=PE()}),LE=Vt((X,V)=>{var c=Mi(),g=qr(),E=ah(),A=Hg();V.exports=function(t,e,r,i){function n(v,m){return g.coerce(t,e,A,v,m)}function o(v){var m=v.map(function(p){var y=n(p);return y&&g.isArrayOrTypedArray(y)?y:null});return m.every(function(p){return p&&p.length===m[0].length})&&m}var a=o(["x","y","z"]);if(!a){e.visible=!1;return}if(o(["i","j","k"]),e.i&&(!e.j||!e.k)||e.j&&(!e.k||!e.i)||e.k&&(!e.i||!e.j)){e.visible=!1;return}var s=c.getComponentMethod("calendars","handleTraceDefaults");s(t,e,["x","y","z"],i),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(v){n(v)});var h=n("contour.show");h&&(n("contour.color"),n("contour.width")),"intensity"in t?(n("intensity"),n("intensitymode"),E(t,e,i,n,{prefix:"",cLetter:"c"})):(e.showscale=!1,"facecolor"in t?n("facecolor"):"vertexcolor"in t?n("vertexcolor"):n("color",r)),n("text"),n("hovertext"),n("hovertemplate"),n("xhoverformat"),n("yhoverformat"),n("zhoverformat"),e._length=null}}),CE=Vt((X,V)=>{var c=df();V.exports=function(g,E){E.intensity&&c(g,E,{vals:E.intensity,containerStr:"",cLetter:"c"})}}),DE=Vt((X,V)=>{var c=Dh().gl_mesh3d,g=Dh().delaunay_triangulate,E=Dh().alpha_shape,A=Dh().convex_hull,t=Wp().parseColorScale,e=qr().isArrayOrTypedArray,r=Gp(),i=Ul().extractOpts,n=Gg();function o(l,x,b){this.scene=l,this.uid=b,this.mesh=x,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var a=o.prototype;a.handlePick=function(l){if(l.object===this.mesh){var x=l.index=l.data.index;l.data._cellCenter?l.traceCoordinate=l.data.dataCoordinate:l.traceCoordinate=[this.data.x[x],this.data.y[x],this.data.z[x]];var b=this.data.hovertext||this.data.text;return e(b)&&b[x]!==void 0?l.textLabel=b[x]:b&&(l.textLabel=b),!0}};function s(l){for(var x=[],b=l.length,S=0;S<b;S++)x[S]=r(l[S]);return x}function h(l,x,b,S){for(var T=[],M=x.length,w=0;w<M;w++)T[w]=l.d2l(x[w],0,S)*b;return T}function v(l){for(var x=[],b=l.length,S=0;S<b;S++)x[S]=Math.round(l[S]);return x}function m(l,x){for(var b=["x","y","z"].indexOf(l),S=[],T=x.length,M=0;M<T;M++)S[M]=[x[M][(b+1)%3],x[M][(b+2)%3]];return g(S)}function p(l,x){for(var b=l.length,S=0;S<b;S++)if(l[S]<=-.5||l[S]>=x-.5)return!1;return!0}a.update=function(l){var x=this.scene,b=x.fullSceneLayout;this.data=l;var S=l.x.length,T=n(h(b.xaxis,l.x,x.dataScale[0],l.xcalendar),h(b.yaxis,l.y,x.dataScale[1],l.ycalendar),h(b.zaxis,l.z,x.dataScale[2],l.zcalendar)),M;if(l.i&&l.j&&l.k){if(l.i.length!==l.j.length||l.j.length!==l.k.length||!p(l.i,S)||!p(l.j,S)||!p(l.k,S))return;M=n(v(l.i),v(l.j),v(l.k))}else l.alphahull===0?M=A(T):l.alphahull>0?M=E(l.alphahull,T):M=m(l.delaunayaxis,T);var w={positions:T,cells:M,lightPosition:[l.lightposition.x,l.lightposition.y,l.lightposition.z],ambient:l.lighting.ambient,diffuse:l.lighting.diffuse,specular:l.lighting.specular,roughness:l.lighting.roughness,fresnel:l.lighting.fresnel,vertexNormalsEpsilon:l.lighting.vertexnormalsepsilon,faceNormalsEpsilon:l.lighting.facenormalsepsilon,opacity:l.opacity,contourEnable:l.contour.show,contourColor:r(l.contour.color).slice(0,3),contourWidth:l.contour.width,useFacetNormals:l.flatshading};if(l.intensity){var u=i(l);this.color="#fff";var f=l.intensitymode;w[f+"Intensity"]=l.intensity,w[f+"IntensityBounds"]=[u.min,u.max],w.colormap=t(l)}else l.vertexcolor?(this.color=l.vertexcolor[0],w.vertexColors=s(l.vertexcolor)):l.facecolor?(this.color=l.facecolor[0],w.cellColors=s(l.facecolor)):(this.color=l.color,w.meshColor=r(l.color));this.mesh.update(w)},a.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function y(l,x){var b=l.glplot.gl,S=c({gl:b}),T=new o(l,S,x.uid);return S._trace=T,T.update(x),l.glplot.add(S),T}V.exports=y}),zE=Vt((X,V)=>{V.exports={attributes:Hg(),supplyDefaults:LE(),calc:CE(),colorbar:{min:"cmin",max:"cmax"},plot:DE(),moduleType:"trace",name:"mesh3d",basePlotModule:Nd(),categories:["gl3d","showLegend"],meta:{}}}),OE=Vt((X,V)=>{V.exports=zE()}),_3=Vt((X,V)=>{var c=wl(),g=qu().axisHoverFormat,E=Zo().hovertemplateAttrs,A=Hg(),t=Ks(),e=po().extendFlat,r={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:E({editType:"calc"},{keys:["norm"]}),uhoverformat:g("u",1),vhoverformat:g("v",1),whoverformat:g("w",1),xhoverformat:g("x"),yhoverformat:g("y"),zhoverformat:g("z"),showlegend:e({},t.showlegend,{dflt:!1})};e(r,c("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var i=["opacity","lightposition","lighting"];i.forEach(function(n){r[n]=A[n]}),r.hoverinfo=e({},t.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),V.exports=r}),FE=Vt((X,V)=>{var c=qr(),g=ah(),E=_3();V.exports=function(A,t,e,r){function i(p,y){return c.coerce(A,t,E,p,y)}var n=i("u"),o=i("v"),a=i("w"),s=i("x"),h=i("y"),v=i("z");if(!n||!n.length||!o||!o.length||!a||!a.length||!s||!s.length||!h||!h.length||!v||!v.length){t.visible=!1;return}var m=i("sizemode");i("sizeref",m==="raw"?1:.5),i("anchor"),i("lighting.ambient"),i("lighting.diffuse"),i("lighting.specular"),i("lighting.roughness"),i("lighting.fresnel"),i("lightposition.x"),i("lightposition.y"),i("lightposition.z"),g(A,t,r,i,{prefix:"",cLetter:"c"}),i("text"),i("hovertext"),i("hovertemplate"),i("uhoverformat"),i("vhoverformat"),i("whoverformat"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),t._length=null}}),BE=Vt((X,V)=>{var c=df();V.exports=function(g,E){for(var A=E.u,t=E.v,e=E.w,r=Math.min(E.x.length,E.y.length,E.z.length,A.length,t.length,e.length),i=-1/0,n=1/0,o=0;o<r;o++){var a=A[o],s=t[o],h=e[o],v=Math.sqrt(a*a+s*s+h*h);i=Math.max(i,v),n=Math.min(n,v)}E._len=r,E._normMax=i,c(g,E,{vals:[n,i],containerStr:"",cLetter:"c"})}}),RE=Vt((X,V)=>{var c=Dh().gl_cone3d,g=Dh().gl_cone3d.createConeMesh,E=qr().simpleMap,A=Wp().parseColorScale,t=Ul().extractOpts,e=qr().isArrayOrTypedArray,r=Gg();function i(m,p){this.scene=m,this.uid=p,this.mesh=null,this.data=null}var n=i.prototype;n.handlePick=function(m){if(m.object===this.mesh){var p=m.index=m.data.index,y=this.data.x[p],l=this.data.y[p],x=this.data.z[p],b=this.data.u[p],S=this.data.v[p],T=this.data.w[p];m.traceCoordinate=[y,l,x,b,S,T,Math.sqrt(b*b+S*S+T*T)];var M=this.data.hovertext||this.data.text;return e(M)&&M[p]!==void 0?m.textLabel=M[p]:M&&(m.textLabel=M),!0}};var o={xaxis:0,yaxis:1,zaxis:2},a={tip:1,tail:0,cm:.25,center:.5},s={tip:1,tail:1,cm:.75,center:.5};function h(m,p){var y=m.fullSceneLayout,l=m.dataScale,x={};function b(u,f){var k=y[f],_=l[o[f]];return E(u,function(D){return k.d2l(D)*_})}x.vectors=r(b(p.u,"xaxis"),b(p.v,"yaxis"),b(p.w,"zaxis"),p._len),x.positions=r(b(p.x,"xaxis"),b(p.y,"yaxis"),b(p.z,"zaxis"),p._len);var S=t(p);x.colormap=A(p),x.vertexIntensityBounds=[S.min/p._normMax,S.max/p._normMax],x.coneOffset=a[p.anchor];var T=p.sizemode;T==="scaled"?x.coneSize=p.sizeref||.5:T==="absolute"?x.coneSize=p.sizeref&&p._normMax?p.sizeref/p._normMax:.5:T==="raw"&&(x.coneSize=p.sizeref),x.coneSizemode=T;var M=c(x),w=p.lightposition;return M.lightPosition=[w.x,w.y,w.z],M.ambient=p.lighting.ambient,M.diffuse=p.lighting.diffuse,M.specular=p.lighting.specular,M.roughness=p.lighting.roughness,M.fresnel=p.lighting.fresnel,M.opacity=p.opacity,p._pad=s[p.anchor]*M.vectorScale*M.coneScale*p._normMax,M}n.update=function(m){this.data=m;var p=h(this.scene,m);this.mesh.update(p)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function v(m,p){var y=m.glplot.gl,l=h(m,p),x=g(y,l),b=new i(m,p.uid);return b.mesh=x,b.data=p,x._trace=b,m.glplot.add(x),b}V.exports=v}),jE=Vt((X,V)=>{V.exports={moduleType:"trace",name:"cone",basePlotModule:Nd(),categories:["gl3d","showLegend"],attributes:_3(),supplyDefaults:FE(),colorbar:{min:"cmin",max:"cmax"},calc:BE(),plot:RE(),eventData:function(c,g){return c.norm=g.traceCoordinate[6],c},meta:{}}}),NE=Vt((X,V)=>{V.exports=jE()}),b3=Vt((X,V)=>{var c=wl(),g=qu().axisHoverFormat,E=Zo().hovertemplateAttrs,A=Hg(),t=Ks(),e=po().extendFlat,r={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:E({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),uhoverformat:g("u",1),vhoverformat:g("v",1),whoverformat:g("w",1),xhoverformat:g("x"),yhoverformat:g("y"),zhoverformat:g("z"),showlegend:e({},t.showlegend,{dflt:!1})};e(r,c("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var i=["opacity","lightposition","lighting"];i.forEach(function(n){r[n]=A[n]}),r.hoverinfo=e({},t.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),V.exports=r}),UE=Vt((X,V)=>{var c=qr(),g=ah(),E=b3();V.exports=function(A,t,e,r){function i(m,p){return c.coerce(A,t,E,m,p)}var n=i("u"),o=i("v"),a=i("w"),s=i("x"),h=i("y"),v=i("z");if(!n||!n.length||!o||!o.length||!a||!a.length||!s||!s.length||!h||!h.length||!v||!v.length){t.visible=!1;return}i("starts.x"),i("starts.y"),i("starts.z"),i("maxdisplayed"),i("sizeref"),i("lighting.ambient"),i("lighting.diffuse"),i("lighting.specular"),i("lighting.roughness"),i("lighting.fresnel"),i("lightposition.x"),i("lightposition.y"),i("lightposition.z"),g(A,t,r,i,{prefix:"",cLetter:"c"}),i("text"),i("hovertext"),i("hovertemplate"),i("uhoverformat"),i("vhoverformat"),i("whoverformat"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),t._length=null}}),VE=Vt((X,V)=>{var c=Dh().gl_streamtube3d,g=c.createTubeMesh,E=qr(),A=Wp().parseColorScale,t=Ul().extractOpts,e=Gg(),r={xaxis:0,yaxis:1,zaxis:2};function i(v,m){this.scene=v,this.uid=m,this.mesh=null,this.data=null}var n=i.prototype;n.handlePick=function(v){var m=this.scene.fullSceneLayout,p=this.scene.dataScale;function y(b,S){var T=m[S],M=p[r[S]];return T.l2c(b)/M}if(v.object===this.mesh){var l=v.data.position,x=v.data.velocity;return v.traceCoordinate=[y(l[0],"xaxis"),y(l[1],"yaxis"),y(l[2],"zaxis"),y(x[0],"xaxis"),y(x[1],"yaxis"),y(x[2],"zaxis"),v.data.intensity*this.data._normMax,v.data.divergence],v.textLabel=this.data.hovertext||this.data.text,!0}};function o(v){var m=v.length,p;return m>2?p=v.slice(1,m-1):m===2?p=[(v[0]+v[1])/2]:p=v,p}function a(v){var m=v.length;return m===1?[.5,.5]:[v[1]-v[0],v[m-1]-v[m-2]]}function s(v,m){var p=v.fullSceneLayout,y=v.dataScale,l=m._len,x={};function b(tt,Z){var st=p[Z],$=y[r[Z]];return E.simpleMap(tt,function(Q){return st.d2l(Q)*$})}if(x.vectors=e(b(m._u,"xaxis"),b(m._v,"yaxis"),b(m._w,"zaxis"),l),!l)return{positions:[],cells:[]};var S=b(m._Xs,"xaxis"),T=b(m._Ys,"yaxis"),M=b(m._Zs,"zaxis");x.meshgrid=[S,T,M],x.gridFill=m._gridFill;var w=m._slen;if(w)x.startingPositions=e(b(m._startsX,"xaxis"),b(m._startsY,"yaxis"),b(m._startsZ,"zaxis"));else{for(var u=T[0],f=o(S),k=o(M),_=new Array(f.length*k.length),D=0,I=0;I<f.length;I++)for(var O=0;O<k.length;O++)_[D++]=[f[I],u,k[O]];x.startingPositions=_}x.colormap=A(m),x.tubeSize=m.sizeref,x.maxLength=m.maxdisplayed;var B=b(m._xbnds,"xaxis"),R=b(m._ybnds,"yaxis"),L=b(m._zbnds,"zaxis"),F=a(S),N=a(T),j=a(M),G=[[B[0]-F[0],R[0]-N[0],L[0]-j[0]],[B[1]+F[1],R[1]+N[1],L[1]+j[1]]],rt=c(x,G),ct=t(m);rt.vertexIntensityBounds=[ct.min/m._normMax,ct.max/m._normMax];var lt=m.lightposition;return rt.lightPosition=[lt.x,lt.y,lt.z],rt.ambient=m.lighting.ambient,rt.diffuse=m.lighting.diffuse,rt.specular=m.lighting.specular,rt.roughness=m.lighting.roughness,rt.fresnel=m.lighting.fresnel,rt.opacity=m.opacity,m._pad=rt.tubeScale*m.sizeref*2,rt}n.update=function(v){this.data=v;var m=s(this.scene,v);this.mesh.update(m)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function h(v,m){var p=v.glplot.gl,y=s(v,m),l=g(p,y),x=new i(v,m.uid);return x.mesh=l,x.data=m,l._trace=x,v.glplot.add(l),x}V.exports=h}),qE=Vt((X,V)=>{V.exports={moduleType:"trace",name:"streamtube",basePlotModule:Nd(),categories:["gl3d","showLegend"],attributes:b3(),supplyDefaults:UE(),colorbar:{min:"cmin",max:"cmax"},calc:wx().calc,plot:VE(),eventData:function(c,g){return c.tubex=c.x,c.tubey=c.y,c.tubez=c.z,c.tubeu=g.traceCoordinate[3],c.tubev=g.traceCoordinate[4],c.tubew=g.traceCoordinate[5],c.norm=g.traceCoordinate[6],c.divergence=g.traceCoordinate[7],delete c.x,delete c.y,delete c.z,c},meta:{}}}),HE=Vt((X,V)=>{V.exports=qE()}),E0=Vt((X,V)=>{var c=Zo().hovertemplateAttrs,g=Zo().texttemplateAttrs,E=rp(),A=Gu(),t=Ks(),e=wl(),r=Eh().dash,i=po().extendFlat,n=su().overrideAll,o=A.marker,a=A.line,s=o.line;V.exports=n({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:i({},A.mode,{dflt:"markers"}),text:i({},A.text,{}),texttemplate:g({editType:"plot"},{keys:["lat","lon","location","text"]}),hovertext:i({},A.hovertext,{}),textfont:A.textfont,textposition:A.textposition,line:{color:a.color,width:a.width,dash:r},connectgaps:A.connectgaps,marker:i({symbol:o.symbol,opacity:o.opacity,angle:o.angle,angleref:i({},o.angleref,{values:["previous","up","north"]}),standoff:o.standoff,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,colorbar:o.colorbar,line:i({width:s.width},e("marker.line")),gradient:o.gradient},e("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:E(),selected:A.selected,unselected:A.unselected,hoverinfo:i({},t.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:c()},"calc","nested")}),GE=Vt((X,V)=>{var c=qr(),g=Sl(),E=Df(),A=Nf(),t=Uf(),e=ap(),r=E0();V.exports=function(i,n,o,a){function s(b,S){return c.coerce(i,n,r,b,S)}var h=s("locations"),v;if(h&&h.length){var m=s("geojson"),p;(typeof m=="string"&&m!==""||c.isPlainObject(m))&&(p="geojson-id");var y=s("locationmode",p);y==="geojson-id"&&s("featureidkey"),v=h.length}else{var l=s("lon")||[],x=s("lat")||[];v=Math.min(l.length,x.length)}if(!v){n.visible=!1;return}n._length=v,s("text"),s("hovertext"),s("hovertemplate"),s("mode"),g.hasMarkers(n)&&E(i,n,o,a,s,{gradient:!0}),g.hasLines(n)&&(A(i,n,o,a,s),s("connectgaps")),g.hasText(n)&&(s("texttemplate"),t(i,n,a,s)),s("fill"),n.fill!=="none"&&e(i,n,o,s),c.coerceSelectionMarkerOpacity(n,s)}}),WE=Vt((X,V)=>{var c=ao();V.exports=function(g,E,A){var t={},e=A[E.geo]._subplot,r=e.mockAxis,i=g.lonlat;return t.lonLabel=c.tickText(r,r.c2l(i[0]),!0).text,t.latLabel=c.tickText(r,r.c2l(i[1]),!0).text,t}}),kx=Vt((X,V)=>{var c=vo(),g=ts().BADNUM,E=Vf(),A=bp(),t=qf(),e=qr().isArrayOrTypedArray,r=qr()._;function i(n){return n&&typeof n=="string"}V.exports=function(n,o){var a=e(o.locations),s=a?o.locations.length:o._length,h=new Array(s),v;o.geojson?v=function(b){return i(b)||c(b)}:v=i;for(var m=0;m<s;m++){var p=h[m]={};if(a){var y=o.locations[m];p.loc=v(y)?y:null}else{var l=o.lon[m],x=o.lat[m];c(l)&&c(x)?p.lonlat=[+l,+x]:p.lonlat=[g,g]}}return A(h,o),E(n,o),t(h,o),s&&(h[0].t={labels:{lat:r(n,"lat:")+" ",lon:r(n,"lon:")+" "}}),h}}),Mv=Vt(X=>{X.projNames={airy:"airy",aitoff:"aitoff","albers usa":"albersUsa",albers:"albers",august:"august","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant",baker:"baker",bertin1953:"bertin1953",boggs:"boggs",bonne:"bonne",bottomley:"bottomley",bromley:"bromley",collignon:"collignon","conic conformal":"conicConformal","conic equal area":"conicEqualArea","conic equidistant":"conicEquidistant",craig:"craig",craster:"craster","cylindrical equal area":"cylindricalEqualArea","cylindrical stereographic":"cylindricalStereographic",eckert1:"eckert1",eckert2:"eckert2",eckert3:"eckert3",eckert4:"eckert4",eckert5:"eckert5",eckert6:"eckert6",eisenlohr:"eisenlohr","equal earth":"equalEarth",equirectangular:"equirectangular",fahey:"fahey","foucaut sinusoidal":"foucautSinusoidal",foucaut:"foucaut",ginzburg4:"ginzburg4",ginzburg5:"ginzburg5",ginzburg6:"ginzburg6",ginzburg8:"ginzburg8",ginzburg9:"ginzburg9",gnomonic:"gnomonic","gringorten quincuncial":"gringortenQuincuncial",gringorten:"gringorten",guyou:"guyou",hammer:"hammer",hill:"hill",homolosine:"homolosine",hufnagel:"hufnagel",hyperelliptical:"hyperelliptical",kavrayskiy7:"kavrayskiy7",lagrange:"lagrange",larrivee:"larrivee",laskowski:"laskowski",loximuthal:"loximuthal",mercator:"mercator",miller:"miller",mollweide:"mollweide","mt flat polar parabolic":"mtFlatPolarParabolic","mt flat polar quartic":"mtFlatPolarQuartic","mt flat polar sinusoidal":"mtFlatPolarSinusoidal","natural earth":"naturalEarth","natural earth1":"naturalEarth1","natural earth2":"naturalEarth2","nell hammer":"nellHammer",nicolosi:"nicolosi",orthographic:"orthographic",patterson:"patterson","peirce quincuncial":"peirceQuincuncial",polyconic:"polyconic","rectangular polyconic":"rectangularPolyconic",robinson:"robinson",satellite:"satellite","sinu mollweide":"sinuMollweide",sinusoidal:"sinusoidal",stereographic:"stereographic",times:"times","transverse mercator":"transverseMercator","van der grinten":"vanDerGrinten","van der grinten2":"vanDerGrinten2","van der grinten3":"vanDerGrinten3","van der grinten4":"vanDerGrinten4",wagner4:"wagner4",wagner6:"wagner6",wiechel:"wiechel","winkel tripel":"winkel3",winkel3:"winkel3"},X.axesNames=["lonaxis","lataxis"],X.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},X.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},X.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},X.clipPad=.001,X.precision=.1,X.landColor="#F0DC82",X.waterColor="#3399FF",X.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},X.sphereSVG={type:"Sphere"},X.fillLayers={ocean:1,land:1,lakes:1},X.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},X.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],X.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],X.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}}),w3=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X):(c=c||self,g(c.topojson=c.topojson||{}))})(X,function(c){function g(b){return b}function E(b){if(b==null)return g;var S,T,M=b.scale[0],w=b.scale[1],u=b.translate[0],f=b.translate[1];return function(k,_){_||(S=T=0);var D=2,I=k.length,O=new Array(I);for(O[0]=(S+=k[0])*M+u,O[1]=(T+=k[1])*w+f;D<I;)O[D]=k[D],++D;return O}}function A(b){var S=E(b.transform),T,M=1/0,w=M,u=-M,f=-M;function k(D){D=S(D),D[0]<M&&(M=D[0]),D[0]>u&&(u=D[0]),D[1]<w&&(w=D[1]),D[1]>f&&(f=D[1])}function _(D){switch(D.type){case"GeometryCollection":D.geometries.forEach(_);break;case"Point":k(D.coordinates);break;case"MultiPoint":D.coordinates.forEach(k);break}}b.arcs.forEach(function(D){for(var I=-1,O=D.length,B;++I<O;)B=S(D[I],I),B[0]<M&&(M=B[0]),B[0]>u&&(u=B[0]),B[1]<w&&(w=B[1]),B[1]>f&&(f=B[1])});for(T in b.objects)_(b.objects[T]);return[M,w,u,f]}function t(b,S){for(var T,M=b.length,w=M-S;w<--M;)T=b[w],b[w++]=b[M],b[M]=T}function e(b,S){return typeof S=="string"&&(S=b.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(T){return r(b,T)})}:r(b,S)}function r(b,S){var T=S.id,M=S.bbox,w=S.properties==null?{}:S.properties,u=i(b,S);return T==null&&M==null?{type:"Feature",properties:w,geometry:u}:M==null?{type:"Feature",id:T,properties:w,geometry:u}:{type:"Feature",id:T,bbox:M,properties:w,geometry:u}}function i(b,S){var T=E(b.transform),M=b.arcs;function w(I,O){O.length&&O.pop();for(var B=M[I<0?~I:I],R=0,L=B.length;R<L;++R)O.push(T(B[R],R));I<0&&t(O,L)}function u(I){return T(I)}function f(I){for(var O=[],B=0,R=I.length;B<R;++B)w(I[B],O);return O.length<2&&O.push(O[0]),O}function k(I){for(var O=f(I);O.length<4;)O.push(O[0]);return O}function _(I){return I.map(k)}function D(I){var O=I.type,B;switch(O){case"GeometryCollection":return{type:O,geometries:I.geometries.map(D)};case"Point":B=u(I.coordinates);break;case"MultiPoint":B=I.coordinates.map(u);break;case"LineString":B=f(I.arcs);break;case"MultiLineString":B=I.arcs.map(f);break;case"Polygon":B=_(I.arcs);break;case"MultiPolygon":B=I.arcs.map(_);break;default:return null}return{type:O,coordinates:B}}return D(S)}function n(b,S){var T={},M={},w={},u=[],f=-1;S.forEach(function(D,I){var O=b.arcs[D<0?~D:D],B;O.length<3&&!O[1][0]&&!O[1][1]&&(B=S[++f],S[f]=D,S[I]=B)}),S.forEach(function(D){var I=k(D),O=I[0],B=I[1],R,L;if(R=w[O])if(delete w[R.end],R.push(D),R.end=B,L=M[B]){delete M[L.start];var F=L===R?R:R.concat(L);M[F.start=R.start]=w[F.end=L.end]=F}else M[R.start]=w[R.end]=R;else if(R=M[B])if(delete M[R.start],R.unshift(D),R.start=O,L=w[O]){delete w[L.end];var N=L===R?R:L.concat(R);M[N.start=L.start]=w[N.end=R.end]=N}else M[R.start]=w[R.end]=R;else R=[D],M[R.start=O]=w[R.end=B]=R});function k(D){var I=b.arcs[D<0?~D:D],O=I[0],B;return b.transform?(B=[0,0],I.forEach(function(R){B[0]+=R[0],B[1]+=R[1]})):B=I[I.length-1],D<0?[B,O]:[O,B]}function _(D,I){for(var O in D){var B=D[O];delete I[B.start],delete B.start,delete B.end,B.forEach(function(R){T[R<0?~R:R]=1}),u.push(B)}}return _(w,M),_(M,w),S.forEach(function(D){T[D<0?~D:D]||u.push([D])}),u}function o(b){return i(b,a.apply(this,arguments))}function a(b,S,T){var M,w,u;if(arguments.length>1)M=s(b,S,T);else for(w=0,M=new Array(u=b.arcs.length);w<u;++w)M[w]=w;return{type:"MultiLineString",arcs:n(b,M)}}function s(b,S,T){var M=[],w=[],u;function f(O){var B=O<0?~O:O;(w[B]||(w[B]=[])).push({i:O,g:u})}function k(O){O.forEach(f)}function _(O){O.forEach(k)}function D(O){O.forEach(_)}function I(O){switch(u=O,O.type){case"GeometryCollection":O.geometries.forEach(I);break;case"LineString":k(O.arcs);break;case"MultiLineString":case"Polygon":_(O.arcs);break;case"MultiPolygon":D(O.arcs);break}}return I(S),w.forEach(T==null?function(O){M.push(O[0].i)}:function(O){T(O[0].g,O[O.length-1].g)&&M.push(O[0].i)}),M}function h(b){for(var S=-1,T=b.length,M,w=b[T-1],u=0;++S<T;)M=w,w=b[S],u+=M[0]*w[1]-M[1]*w[0];return Math.abs(u)}function v(b){return i(b,m.apply(this,arguments))}function m(b,S){var T={},M=[],w=[];S.forEach(u);function u(_){switch(_.type){case"GeometryCollection":_.geometries.forEach(u);break;case"Polygon":f(_.arcs);break;case"MultiPolygon":_.arcs.forEach(f);break}}function f(_){_.forEach(function(D){D.forEach(function(I){(T[I=I<0?~I:I]||(T[I]=[])).push(_)})}),M.push(_)}function k(_){return h(i(b,{type:"Polygon",arcs:[_]}).coordinates[0])}return M.forEach(function(_){if(!_._){var D=[],I=[_];for(_._=1,w.push(D);_=I.pop();)D.push(_),_.forEach(function(O){O.forEach(function(B){T[B<0?~B:B].forEach(function(R){R._||(R._=1,I.push(R))})})})}}),M.forEach(function(_){delete _._}),{type:"MultiPolygon",arcs:w.map(function(_){var D=[],I;if(_.forEach(function(F){F.forEach(function(N){N.forEach(function(j){T[j<0?~j:j].length<2&&D.push(j)})})}),D=n(b,D),(I=D.length)>1)for(var O=1,B=k(D[0]),R,L;O<I;++O)(R=k(D[O]))>B&&(L=D[0],D[0]=D[O],D[O]=L,B=R);return D}).filter(function(_){return _.length>0})}}function p(b,S){for(var T=0,M=b.length;T<M;){var w=T+M>>>1;b[w]<S?T=w+1:M=w}return T}function y(b){var S={},T=b.map(function(){return[]});function M(F,N){F.forEach(function(j){j<0&&(j=~j);var G=S[j];G?G.push(N):S[j]=[N]})}function w(F,N){F.forEach(function(j){M(j,N)})}function u(F,N){F.type==="GeometryCollection"?F.geometries.forEach(function(j){u(j,N)}):F.type in f&&f[F.type](F.arcs,N)}var f={LineString:M,MultiLineString:w,Polygon:w,MultiPolygon:function(F,N){F.forEach(function(j){w(j,N)})}};b.forEach(u);for(var k in S)for(var _=S[k],D=_.length,I=0;I<D;++I)for(var O=I+1;O<D;++O){var B=_[I],R=_[O],L;(L=T[B])[k=p(L,R)]!==R&&L.splice(k,0,R),(L=T[R])[k=p(L,B)]!==B&&L.splice(k,0,B)}return T}function l(b){if(b==null)return g;var S,T,M=b.scale[0],w=b.scale[1],u=b.translate[0],f=b.translate[1];return function(k,_){_||(S=T=0);var D=2,I=k.length,O=new Array(I),B=Math.round((k[0]-u)/M),R=Math.round((k[1]-f)/w);for(O[0]=B-S,S=B,O[1]=R-T,T=R;D<I;)O[D]=k[D],++D;return O}}function x(b,S){if(b.transform)throw new Error("already quantized");if(!S||!S.scale){if(!((f=Math.floor(S))>=2))throw new Error("n must be ≥2");_=b.bbox||A(b);var T=_[0],M=_[1],w=_[2],u=_[3],f;S={scale:[w-T?(w-T)/(f-1):1,u-M?(u-M)/(f-1):1],translate:[T,M]}}else _=b.bbox;var k=l(S),_,D,I=b.objects,O={};function B(F){return k(F)}function R(F){var N;switch(F.type){case"GeometryCollection":N={type:"GeometryCollection",geometries:F.geometries.map(R)};break;case"Point":N={type:"Point",coordinates:B(F.coordinates)};break;case"MultiPoint":N={type:"MultiPoint",coordinates:F.coordinates.map(B)};break;default:return F}return F.id!=null&&(N.id=F.id),F.bbox!=null&&(N.bbox=F.bbox),F.properties!=null&&(N.properties=F.properties),N}function L(F){var N=0,j=1,G=F.length,rt,ct=new Array(G);for(ct[0]=k(F[0],0);++N<G;)((rt=k(F[N],N))[0]||rt[1])&&(ct[j++]=rt);return j===1&&(ct[j++]=[0,0]),ct.length=j,ct}for(D in I)O[D]=R(I[D]);return{type:"Topology",bbox:_,transform:S,objects:O,arcs:b.arcs.map(L)}}c.bbox=A,c.feature=e,c.merge=v,c.mergeArcs=m,c.mesh=o,c.meshArcs=a,c.neighbors=y,c.quantize=x,c.transform=E,c.untransform=l,Object.defineProperty(c,"__esModule",{value:!0})})}),Ax=Vt((X,V)=>{var c=V.exports={},g=Mv().locationmodeToLayer,E=w3().feature;c.getTopojsonName=function(A){return[A.scope.replace(/ /g,"-"),"_",A.resolution.toString(),"m"].join("")},c.getTopojsonPath=function(A,t){return A+t+".json"},c.getTopojsonFeatures=function(A,t){var e=g[A.locationmode],r=t.objects[e];return E(t,r).features}}),Ud=Vt(X=>{var V=ts().BADNUM;X.calcTraceToLineCoords=function(c){for(var g=c[0].trace,E=g.connectgaps,A=[],t=[],e=0;e<c.length;e++){var r=c[e],i=r.lonlat;i[0]!==V?t.push(i):!E&&t.length>0&&(A.push(t),t=[])}return t.length>0&&A.push(t),A},X.makeLine=function(c){return c.length===1?{type:"LineString",coordinates:c[0]}:{type:"MultiLineString",coordinates:c}},X.makePolygon=function(c){if(c.length===1)return{type:"Polygon",coordinates:c};for(var g=new Array(c.length),E=0;E<c.length;E++)g[E]=[c[E]];return{type:"MultiPolygon",coordinates:g}},X.makeBlank=function(){return{type:"Point",coordinates:[]}}}),ZE=Vt((X,V)=>{V.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}}),Mx=Vt(X=>{Object.defineProperty(X,"__esModule",{value:!0});var V=63710088e-1,c={centimeters:V*100,centimetres:V*100,degrees:360/(2*Math.PI),feet:V*3.28084,inches:V*39.37,kilometers:V/1e3,kilometres:V/1e3,meters:V,metres:V,miles:V/1609.344,millimeters:V*1e3,millimetres:V*1e3,nauticalmiles:V/1852,radians:1,yards:V*1.0936},g={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function E(I,O,B={}){let R={type:"Feature"};return(B.id===0||B.id)&&(R.id=B.id),B.bbox&&(R.bbox=B.bbox),R.properties=O||{},R.geometry=I,R}function A(I,O,B={}){switch(I){case"Point":return t(O).geometry;case"LineString":return n(O).geometry;case"Polygon":return r(O).geometry;case"MultiPoint":return h(O).geometry;case"MultiLineString":return s(O).geometry;case"MultiPolygon":return v(O).geometry;default:throw new Error(I+" is invalid")}}function t(I,O,B={}){if(!I)throw new Error("coordinates is required");if(!Array.isArray(I))throw new Error("coordinates must be an Array");if(I.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!f(I[0])||!f(I[1]))throw new Error("coordinates must contain numbers");return E({type:"Point",coordinates:I},O,B)}function e(I,O,B={}){return a(I.map(R=>t(R,O)),B)}function r(I,O,B={}){for(let R of I){if(R.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(R[R.length-1].length!==R[0].length)throw new Error("First and last Position are not equivalent.");for(let L=0;L<R[R.length-1].length;L++)if(R[R.length-1][L]!==R[0][L])throw new Error("First and last Position are not equivalent.")}return E({type:"Polygon",coordinates:I},O,B)}function i(I,O,B={}){return a(I.map(R=>r(R,O)),B)}function n(I,O,B={}){if(I.length<2)throw new Error("coordinates must be an array of two or more positions");return E({type:"LineString",coordinates:I},O,B)}function o(I,O,B={}){return a(I.map(R=>n(R,O)),B)}function a(I,O={}){let B={type:"FeatureCollection"};return O.id&&(B.id=O.id),O.bbox&&(B.bbox=O.bbox),B.features=I,B}function s(I,O,B={}){return E({type:"MultiLineString",coordinates:I},O,B)}function h(I,O,B={}){return E({type:"MultiPoint",coordinates:I},O,B)}function v(I,O,B={}){return E({type:"MultiPolygon",coordinates:I},O,B)}function m(I,O,B={}){return E({type:"GeometryCollection",geometries:I},O,B)}function p(I,O=0){if(O&&!(O>=0))throw new Error("precision must be a positive number");let B=Math.pow(10,O||0);return Math.round(I*B)/B}function y(I,O="kilometers"){let B=c[O];if(!B)throw new Error(O+" units is invalid");return I*B}function l(I,O="kilometers"){let B=c[O];if(!B)throw new Error(O+" units is invalid");return I/B}function x(I,O){return T(l(I,O))}function b(I){let O=I%360;return O<0&&(O+=360),O}function S(I){return I=I%360,I>0?I>180?I-360:I:I<-180?I+360:I}function T(I){return I%(2*Math.PI)*180/Math.PI}function M(I){return I%360*Math.PI/180}function w(I,O="kilometers",B="kilometers"){if(!(I>=0))throw new Error("length must be a positive number");return y(l(I,O),B)}function u(I,O="meters",B="kilometers"){if(!(I>=0))throw new Error("area must be a positive number");let R=g[O];if(!R)throw new Error("invalid original units");let L=g[B];if(!L)throw new Error("invalid final units");return I/R*L}function f(I){return!isNaN(I)&&I!==null&&!Array.isArray(I)}function k(I){return I!==null&&typeof I=="object"&&!Array.isArray(I)}function _(I){if(!I)throw new Error("bbox is required");if(!Array.isArray(I))throw new Error("bbox must be an Array");if(I.length!==4&&I.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");I.forEach(O=>{if(!f(O))throw new Error("bbox must only contain numbers")})}function D(I){if(!I)throw new Error("id is required");if(["string","number"].indexOf(typeof I)===-1)throw new Error("id must be a number or a string")}X.areaFactors=g,X.azimuthToBearing=S,X.bearingToAzimuth=b,X.convertArea=u,X.convertLength=w,X.degreesToRadians=M,X.earthRadius=V,X.factors=c,X.feature=E,X.featureCollection=a,X.geometry=A,X.geometryCollection=m,X.isNumber=f,X.isObject=k,X.lengthToDegrees=x,X.lengthToRadians=l,X.lineString=n,X.lineStrings=o,X.multiLineString=s,X.multiPoint=h,X.multiPolygon=v,X.point=t,X.points=e,X.polygon=r,X.polygons=i,X.radiansToDegrees=T,X.radiansToLength=y,X.round=p,X.validateBBox=_,X.validateId=D}),Sx=Vt(X=>{Object.defineProperty(X,"__esModule",{value:!0});var V=Mx();function c(l,x,b){if(l!==null)for(var S,T,M,w,u,f,k,_=0,D=0,I,O=l.type,B=O==="FeatureCollection",R=O==="Feature",L=B?l.features.length:1,F=0;F<L;F++){k=B?l.features[F].geometry:R?l.geometry:l,I=k?k.type==="GeometryCollection":!1,u=I?k.geometries.length:1;for(var N=0;N<u;N++){var j=0,G=0;if(w=I?k.geometries[N]:k,w!==null){f=w.coordinates;var rt=w.type;switch(_=b&&(rt==="Polygon"||rt==="MultiPolygon")?1:0,rt){case null:break;case"Point":if(x(f,D,F,j,G)===!1)return!1;D++,j++;break;case"LineString":case"MultiPoint":for(S=0;S<f.length;S++){if(x(f[S],D,F,j,G)===!1)return!1;D++,rt==="MultiPoint"&&j++}rt==="LineString"&&j++;break;case"Polygon":case"MultiLineString":for(S=0;S<f.length;S++){for(T=0;T<f[S].length-_;T++){if(x(f[S][T],D,F,j,G)===!1)return!1;D++}rt==="MultiLineString"&&j++,rt==="Polygon"&&G++}rt==="Polygon"&&j++;break;case"MultiPolygon":for(S=0;S<f.length;S++){for(G=0,T=0;T<f[S].length;T++){for(M=0;M<f[S][T].length-_;M++){if(x(f[S][T][M],D,F,j,G)===!1)return!1;D++}G++}j++}break;case"GeometryCollection":for(S=0;S<w.geometries.length;S++)if(c(w.geometries[S],x,b)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function g(l,x,b,S){var T=b;return c(l,function(M,w,u,f,k){w===0&&b===void 0?T=M:T=x(T,M,w,u,f,k)},S),T}function E(l,x){var b;switch(l.type){case"FeatureCollection":for(b=0;b<l.features.length&&x(l.features[b].properties,b)!==!1;b++);break;case"Feature":x(l.properties,0);break}}function A(l,x,b){var S=b;return E(l,function(T,M){M===0&&b===void 0?S=T:S=x(S,T,M)}),S}function t(l,x){if(l.type==="Feature")x(l,0);else if(l.type==="FeatureCollection")for(var b=0;b<l.features.length&&x(l.features[b],b)!==!1;b++);}function e(l,x,b){var S=b;return t(l,function(T,M){M===0&&b===void 0?S=T:S=x(S,T,M)}),S}function r(l){var x=[];return c(l,function(b){x.push(b)}),x}function i(l,x){var b,S,T,M,w,u,f,k,_,D,I=0,O=l.type==="FeatureCollection",B=l.type==="Feature",R=O?l.features.length:1;for(b=0;b<R;b++){for(u=O?l.features[b].geometry:B?l.geometry:l,k=O?l.features[b].properties:B?l.properties:{},_=O?l.features[b].bbox:B?l.bbox:void 0,D=O?l.features[b].id:B?l.id:void 0,f=u?u.type==="GeometryCollection":!1,w=f?u.geometries.length:1,T=0;T<w;T++){if(M=f?u.geometries[T]:u,M===null){if(x(null,I,k,_,D)===!1)return!1;continue}switch(M.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(x(M,I,k,_,D)===!1)return!1;break}case"GeometryCollection":{for(S=0;S<M.geometries.length;S++)if(x(M.geometries[S],I,k,_,D)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}I++}}function n(l,x,b){var S=b;return i(l,function(T,M,w,u,f){M===0&&b===void 0?S=T:S=x(S,T,M,w,u,f)}),S}function o(l,x){i(l,function(b,S,T,M,w){var u=b===null?null:b.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return x(V.feature.call(void 0,b,T,{bbox:M,id:w}),S,0)===!1?!1:void 0}var f;switch(u){case"MultiPoint":f="Point";break;case"MultiLineString":f="LineString";break;case"MultiPolygon":f="Polygon";break}for(var k=0;k<b.coordinates.length;k++){var _=b.coordinates[k],D={type:f,coordinates:_};if(x(V.feature.call(void 0,D,T),S,k)===!1)return!1}})}function a(l,x,b){var S=b;return o(l,function(T,M,w){M===0&&w===0&&b===void 0?S=T:S=x(S,T,M,w)}),S}function s(l,x){o(l,function(b,S,T){var M=0;if(b.geometry){var w=b.geometry.type;if(!(w==="Point"||w==="MultiPoint")){var u,f=0,k=0,_=0;if(c(b,function(D,I,O,B,R){if(u===void 0||S>f||B>k||R>_){u=D,f=S,k=B,_=R,M=0;return}var L=V.lineString.call(void 0,[u,D],b.properties);if(x(L,S,T,R,M)===!1)return!1;M++,u=D})===!1)return!1}}})}function h(l,x,b){var S=b,T=!1;return s(l,function(M,w,u,f,k){T===!1&&b===void 0?S=M:S=x(S,M,w,u,f,k),T=!0}),S}function v(l,x){if(!l)throw new Error("geojson is required");o(l,function(b,S,T){if(b.geometry!==null){var M=b.geometry.type,w=b.geometry.coordinates;switch(M){case"LineString":if(x(b,S,T,0,0)===!1)return!1;break;case"Polygon":for(var u=0;u<w.length;u++)if(x(V.lineString.call(void 0,w[u],b.properties),S,T,u)===!1)return!1;break}}})}function m(l,x,b){var S=b;return v(l,function(T,M,w,u){M===0&&b===void 0?S=T:S=x(S,T,M,w,u)}),S}function p(l,x){if(x=x||{},!V.isObject.call(void 0,x))throw new Error("options is invalid");var b=x.featureIndex||0,S=x.multiFeatureIndex||0,T=x.geometryIndex||0,M=x.segmentIndex||0,w=x.properties,u;switch(l.type){case"FeatureCollection":b<0&&(b=l.features.length+b),w=w||l.features[b].properties,u=l.features[b].geometry;break;case"Feature":w=w||l.properties,u=l.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":u=l;break;default:throw new Error("geojson is invalid")}if(u===null)return null;var f=u.coordinates;switch(u.type){case"Point":case"MultiPoint":return null;case"LineString":return M<0&&(M=f.length+M-1),V.lineString.call(void 0,[f[M],f[M+1]],w,x);case"Polygon":return T<0&&(T=f.length+T),M<0&&(M=f[T].length+M-1),V.lineString.call(void 0,[f[T][M],f[T][M+1]],w,x);case"MultiLineString":return S<0&&(S=f.length+S),M<0&&(M=f[S].length+M-1),V.lineString.call(void 0,[f[S][M],f[S][M+1]],w,x);case"MultiPolygon":return S<0&&(S=f.length+S),T<0&&(T=f[S].length+T),M<0&&(M=f[S][T].length-M-1),V.lineString.call(void 0,[f[S][T][M],f[S][T][M+1]],w,x)}throw new Error("geojson is invalid")}function y(l,x){if(x=x||{},!V.isObject.call(void 0,x))throw new Error("options is invalid");var b=x.featureIndex||0,S=x.multiFeatureIndex||0,T=x.geometryIndex||0,M=x.coordIndex||0,w=x.properties,u;switch(l.type){case"FeatureCollection":b<0&&(b=l.features.length+b),w=w||l.features[b].properties,u=l.features[b].geometry;break;case"Feature":w=w||l.properties,u=l.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":u=l;break;default:throw new Error("geojson is invalid")}if(u===null)return null;var f=u.coordinates;switch(u.type){case"Point":return V.point.call(void 0,f,w,x);case"MultiPoint":return S<0&&(S=f.length+S),V.point.call(void 0,f[S],w,x);case"LineString":return M<0&&(M=f.length+M),V.point.call(void 0,f[M],w,x);case"Polygon":return T<0&&(T=f.length+T),M<0&&(M=f[T].length+M),V.point.call(void 0,f[T][M],w,x);case"MultiLineString":return S<0&&(S=f.length+S),M<0&&(M=f[S].length+M),V.point.call(void 0,f[S][M],w,x);case"MultiPolygon":return S<0&&(S=f.length+S),T<0&&(T=f[S].length+T),M<0&&(M=f[S][T].length-M),V.point.call(void 0,f[S][T][M],w,x)}throw new Error("geojson is invalid")}X.coordAll=r,X.coordEach=c,X.coordReduce=g,X.featureEach=t,X.featureReduce=e,X.findPoint=y,X.findSegment=p,X.flattenEach=o,X.flattenReduce=a,X.geomEach=i,X.geomReduce=n,X.lineEach=v,X.lineReduce=m,X.propEach=E,X.propReduce=A,X.segmentEach=s,X.segmentReduce=h}),XE=Vt(X=>{Object.defineProperty(X,"__esModule",{value:!0});var V=Mx(),c=Sx();function g(n){return c.geomReduce.call(void 0,n,(o,a)=>o+E(a),0)}function E(n){let o=0,a;switch(n.type){case"Polygon":return A(n.coordinates);case"MultiPolygon":for(a=0;a<n.coordinates.length;a++)o+=A(n.coordinates[a]);return o;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function A(n){let o=0;if(n&&n.length>0){o+=Math.abs(r(n[0]));for(let a=1;a<n.length;a++)o-=Math.abs(r(n[a]))}return o}var t=V.earthRadius*V.earthRadius/2,e=Math.PI/180;function r(n){let o=n.length-1;if(o<=2)return 0;let a=0,s=0;for(;s<o;){let h=n[s],v=n[s+1===o?0:s+1],m=n[s+2>=o?(s+2)%o:s+2],p=h[0]*e,y=v[1]*e,l=m[0]*e;a+=(l-p)*Math.sin(y),s++}return a*t}var i=g;X.area=g,X.default=i}),$E=Vt(X=>{Object.defineProperty(X,"__esModule",{value:!0});var V=Mx(),c=Sx();function g(A,t={}){let e=0,r=0,i=0;return c.coordEach.call(void 0,A,function(n){e+=n[0],r+=n[1],i++},!0),V.point.call(void 0,[e/i,r/i],t.properties)}var E=g;X.centroid=g,X.default=E}),JE=Vt(X=>{Object.defineProperty(X,"__esModule",{value:!0});var V=Sx();function c(E,A={}){if(E.bbox!=null&&A.recompute!==!0)return E.bbox;let t=[1/0,1/0,-1/0,-1/0];return V.coordEach.call(void 0,E,e=>{t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}var g=c;X.bbox=c,X.default=g}),Vd=Vt((X,V)=>{var c=Ai(),g=ZE(),{area:E}=XE(),{centroid:A}=$E(),{bbox:t}=JE(),e=zm(),r=wd(),i=jp(),n=Im(),o=Nm(),a=Object.keys(g),s={"ISO-3":e,"USA-states":e,"country names":h};function h(S){for(var T=0;T<a.length;T++){var M=a[T],w=new RegExp(g[M]);if(w.test(S.trim().toLowerCase()))return M}return r.log("Unrecognized country name: "+S+"."),!1}function v(S,T,M){if(!T||typeof T!="string")return!1;var w=s[S](T),u,f,k;if(w){if(S==="USA-states")for(u=[],k=0;k<M.length;k++)f=M[k],f.properties&&f.properties.gu&&f.properties.gu==="USA"&&u.push(f);else u=M;for(k=0;k<u.length;k++)if(f=u[k],f.id===w)return f;r.log(["Location with id",w,"does not have a matching topojson feature at this resolution."].join(" "))}return!1}function m(S){var T=S.geometry,M=T.coordinates,w=S.id,u=[],f,k,_,D;function I(O){for(var B=0;B<O.length-1;B++)if(O[B][0]>0&&O[B+1][0]<0)return B;return null}switch(w==="RUS"||w==="FJI"?f=function(O){var B;if(I(O)===null)B=O;else for(B=new Array(O.length),D=0;D<O.length;D++)B[D]=[O[D][0]<0?O[D][0]+360:O[D][0],O[D][1]];u.push(o.tester(B))}:w==="ATA"?f=function(O){var B=I(O);if(B===null)return u.push(o.tester(O));var R=new Array(O.length+1),L=0;for(D=0;D<O.length;D++)D>B?R[L++]=[O[D][0]+360,O[D][1]]:D===B?(R[L++]=O[D],R[L++]=[O[D][0],-90]):R[L++]=O[D];var F=o.tester(R);F.pts.pop(),u.push(F)}:f=function(O){u.push(o.tester(O))},T.type){case"MultiPolygon":for(k=0;k<M.length;k++)for(_=0;_<M[k].length;_++)f(M[k][_]);break;case"Polygon":for(k=0;k<M.length;k++)f(M[k]);break}return u}function p(S){var T=S.geojson,M=window.PlotlyGeoAssets||{},w=typeof T=="string"?M[T]:T;return i(w)?w:(r.error("Oops ... something went wrong when fetching "+T),!1)}function y(S){var T=S[0].trace,M=p(T);if(!M)return!1;var w={},u=[],f;for(f=0;f<T._length;f++){var k=S[f];(k.loc||k.loc===0)&&(w[k.loc]=k)}function _(O){var B=n(O,T.featureidkey||"id").get(),R=w[B];if(R){var L=O.geometry;if(L.type==="Polygon"||L.type==="MultiPolygon"){var F={type:"Feature",id:B,geometry:L,properties:{}};F.geometry.coordinates.length>0?F.properties.ct=l(F):F.properties.ct=[NaN,NaN],R.fIn=O,R.fOut=F,u.push(F)}else r.log(["Location",R.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete w[B]}switch(M.type){case"FeatureCollection":var D=M.features;for(f=0;f<D.length;f++)_(D[f]);break;case"Feature":_(M);break;default:return r.warn(["Invalid GeoJSON type",(M.type||"none")+".","Traces with locationmode *geojson-id* only support","*FeatureCollection* and *Feature* types."].join(" ")),!1}for(var I in w)r.log(["Location *"+I+"*","does not have a matching feature with id-key","*"+T.featureidkey+"*."].join(" "));return u}function l(S){var T=S.geometry,M;if(T.type==="MultiPolygon")for(var w=T.coordinates,u=0,f=0;f<w.length;f++){var k={type:"Polygon",coordinates:w[f]},_=E(k);_>u&&(u=_,M=k)}else M=T;return A(M).geometry.coordinates}function x(S){var T=window.PlotlyGeoAssets||{},M=[];function w(D){return new Promise(function(I,O){c.json(D,function(B,R){if(B){delete T[D];var L=B.status===404?'GeoJSON at URL "'+D+'" does not exist.':"Unexpected error while fetching from "+D;return O(new Error(L))}return T[D]=R,I(R)})})}function u(D){return new Promise(function(I,O){var B=0,R=setInterval(function(){if(T[D]&&T[D]!=="pending")return clearInterval(R),I(T[D]);if(B>100)return clearInterval(R),O("Unexpected error while fetching from "+D);B++},50)})}for(var f=0;f<S.length;f++){var k=S[f][0].trace,_=k.geojson;typeof _=="string"&&(T[_]?T[_]==="pending"&&M.push(u(_)):(T[_]="pending",M.push(w(_))))}return M}function b(S){return t(S)}V.exports={locationToFeature:v,feature2polygons:m,getTraceGeojson:p,extractTraceFeature:y,fetchTraceGeoData:x,computeBbox:b}}),T3=Vt((X,V)=>{var c=Ai(),g=go(),E=vi(),A=yf(),t=A.stylePoints,e=A.styleText;V.exports=function(i,n){n&&r(i,n)};function r(i,n){var o=n[0].trace,a=n[0].node3;a.style("opacity",n[0].trace.opacity),t(a,o,i),e(a,o,i),a.selectAll("path.js-line").style("fill","none").each(function(s){var h=c.select(this),v=s.trace,m=v.line||{};h.call(E.stroke,m.color).call(g.dashLine,m.dash||"",m.width||0),v.fill!=="none"&&h.call(E.fill,v.fillcolor)})}}),k3=Vt((X,V)=>{var c=Ai(),g=qr(),E=Ax().getTopojsonFeatures,A=Ud(),t=Vd(),e=Kf().findExtremes,r=ts().BADNUM,i=Hf().calcMarkerSize,n=Sl(),o=T3();function a(h,v,m){var p=v.layers.frontplot.select(".scatterlayer"),y=g.makeTraceGroups(p,m,"trace scattergeo");function l(x,b){x.lonlat[0]===r&&c.select(b).remove()}y.selectAll("*").remove(),y.each(function(x){var b=c.select(this),S=x[0].trace;if(n.hasLines(S)||S.fill!=="none"){var T=A.calcTraceToLineCoords(x),M=S.fill!=="none"?A.makePolygon(T):A.makeLine(T);b.selectAll("path.js-line").data([{geojson:M,trace:S}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}n.hasMarkers(S)&&b.selectAll("path.point").data(g.identity).enter().append("path").classed("point",!0).each(function(w){l(w,this)}),n.hasText(S)&&b.selectAll("g").data(g.identity).enter().append("g").append("text").each(function(w){l(w,this)}),o(h,x)})}function s(h,v){var m=h[0].trace,p=v[m.geo],y=p._subplot,l=m._length,x,b;if(g.isArrayOrTypedArray(m.locations)){var S=m.locationmode,T=S==="geojson-id"?t.extractTraceFeature(h):E(m,y.topojson);for(x=0;x<l;x++){b=h[x];var M=S==="geojson-id"?b.fOut:t.locationToFeature(S,b.loc,T);b.lonlat=M?M.properties.ct:[r,r]}}var w={padded:!0},u,f;if(p.fitbounds==="geojson"&&m.locationmode==="geojson-id"){var k=t.computeBbox(t.getTraceGeojson(m));u=[k[0],k[2]],f=[k[1],k[3]]}else{for(u=new Array(l),f=new Array(l),x=0;x<l;x++)b=h[x],u[x]=b.lonlat[0],f[x]=b.lonlat[1];w.ppad=i(m,l)}m._extremes.lon=e(p.lonaxis._ax,u,w),m._extremes.lat=e(p.lataxis._ax,f,w)}V.exports={calcGeoJSON:s,plot:a}}),QE=Vt((X,V)=>{var c=Hu(),g=ts().BADNUM,E=Mg(),A=qr().fillText,t=E0();V.exports=function(r,i,n){var o=r.cd,a=o[0].trace,s=r.xa,h=r.ya,v=r.subplot,m=v.projection.isLonLatOverEdges,p=v.project;function y(w){var u=w.lonlat;if(u[0]===g||m(u))return 1/0;var f=p(u),k=p([i,n]),_=Math.abs(f[0]-k[0]),D=Math.abs(f[1]-k[1]),I=Math.max(3,w.mrc||0);return Math.max(Math.sqrt(_*_+D*D)-I,1-3/I)}if(c.getClosest(o,y,r),r.index!==!1){var l=o[r.index],x=l.lonlat,b=[s.c2p(x),h.c2p(x)],S=l.mrc||1;r.x0=b[0]-S,r.x1=b[0]+S,r.y0=b[1]-S,r.y1=b[1]+S,r.loc=l.loc,r.lon=x[0],r.lat=x[1];var T={};T[a.geo]={_subplot:v};var M=a._module.formatLabels(l,a,T);return r.lonLabel=M.lonLabel,r.latLabel=M.latLabel,r.color=E(a,l),r.extraText=e(a,l,r,o[0].t.labels),r.hovertemplate=a.hovertemplate,[r]}};function e(r,i,n,o){if(r.hovertemplate)return;var a=i.hi||r.hoverinfo,s=a==="all"?t.hoverinfo.flags:a.split("+"),h=s.indexOf("location")!==-1&&Array.isArray(r.locations),v=s.indexOf("lon")!==-1,m=s.indexOf("lat")!==-1,p=s.indexOf("text")!==-1,y=[];function l(x){return x+"°"}return h?y.push(i.loc):v&&m?y.push("("+l(n.latLabel)+", "+l(n.lonLabel)+")"):v?y.push(o.lon+l(n.lonLabel)):m&&y.push(o.lat+l(n.latLabel)),p&&A(i,r,y),y.join("<br>")}}),YE=Vt((X,V)=>{V.exports=function(c,g,E,A,t){c.lon=g.lon,c.lat=g.lat,c.location=g.loc?g.loc:null;var e=A[t];return e.fIn&&e.fIn.properties&&(c.properties=e.fIn.properties),c}}),KE=Vt((X,V)=>{var c=Sl(),g=ts().BADNUM;V.exports=function(E,A){var t=E.cd,e=E.xaxis,r=E.yaxis,i=[],n=t[0].trace,o,a,s,h,v,m=!c.hasMarkers(n)&&!c.hasText(n);if(m)return[];if(A===!1)for(v=0;v<t.length;v++)t[v].selected=0;else for(v=0;v<t.length;v++)o=t[v],a=o.lonlat,a[0]!==g&&(s=e.c2p(a),h=r.c2p(a),A.contains([s,h],null,v,E)?(i.push({pointNumber:v,lon:a[0],lat:a[1]}),o.selected=1):o.selected=0);return i}}),Sv=Vt((X,V)=>{(function(c,g){g(typeof X=="object"&&typeof V<"u"?X:c.d3=c.d3||{})})(X,function(c){function g($,Q){return $<Q?-1:$>Q?1:$>=Q?0:NaN}function E($){return $.length===1&&($=A($)),{left:function(Q,nt,Y,q){for(Y==null&&(Y=0),q==null&&(q=Q.length);Y<q;){var ot=Y+q>>>1;$(Q[ot],nt)<0?Y=ot+1:q=ot}return Y},right:function(Q,nt,Y,q){for(Y==null&&(Y=0),q==null&&(q=Q.length);Y<q;){var ot=Y+q>>>1;$(Q[ot],nt)>0?q=ot:Y=ot+1}return Y}}}function A($){return function(Q,nt){return g($(Q),nt)}}var t=E(g),e=t.right,r=t.left;function i($,Q){Q==null&&(Q=n);for(var nt=0,Y=$.length-1,q=$[0],ot=new Array(Y<0?0:Y);nt<Y;)ot[nt]=Q(q,q=$[++nt]);return ot}function n($,Q){return[$,Q]}function o($,Q,nt){var Y=$.length,q=Q.length,ot=new Array(Y*q),it,dt,wt,xt;for(nt==null&&(nt=n),it=wt=0;it<Y;++it)for(xt=$[it],dt=0;dt<q;++dt,++wt)ot[wt]=nt(xt,Q[dt]);return ot}function a($,Q){return Q<$?-1:Q>$?1:Q>=$?0:NaN}function s($){return $===null?NaN:+$}function h($,Q){var nt=$.length,Y=0,q=-1,ot=0,it,dt,wt=0;if(Q==null)for(;++q<nt;)isNaN(it=s($[q]))||(dt=it-ot,ot+=dt/++Y,wt+=dt*(it-ot));else for(;++q<nt;)isNaN(it=s(Q($[q],q,$)))||(dt=it-ot,ot+=dt/++Y,wt+=dt*(it-ot));if(Y>1)return wt/(Y-1)}function v($,Q){var nt=h($,Q);return nt&&Math.sqrt(nt)}function m($,Q){var nt=$.length,Y=-1,q,ot,it;if(Q==null){for(;++Y<nt;)if((q=$[Y])!=null&&q>=q)for(ot=it=q;++Y<nt;)(q=$[Y])!=null&&(ot>q&&(ot=q),it<q&&(it=q))}else for(;++Y<nt;)if((q=Q($[Y],Y,$))!=null&&q>=q)for(ot=it=q;++Y<nt;)(q=Q($[Y],Y,$))!=null&&(ot>q&&(ot=q),it<q&&(it=q));return[ot,it]}var p=Array.prototype,y=p.slice,l=p.map;function x($){return function(){return $}}function b($){return $}function S($,Q,nt){$=+$,Q=+Q,nt=(q=arguments.length)<2?(Q=$,$=0,1):q<3?1:+nt;for(var Y=-1,q=Math.max(0,Math.ceil((Q-$)/nt))|0,ot=new Array(q);++Y<q;)ot[Y]=$+Y*nt;return ot}var T=Math.sqrt(50),M=Math.sqrt(10),w=Math.sqrt(2);function u($,Q,nt){var Y,q=-1,ot,it,dt;if(Q=+Q,$=+$,nt=+nt,$===Q&&nt>0)return[$];if((Y=Q<$)&&(ot=$,$=Q,Q=ot),(dt=f($,Q,nt))===0||!isFinite(dt))return[];if(dt>0)for($=Math.ceil($/dt),Q=Math.floor(Q/dt),it=new Array(ot=Math.ceil(Q-$+1));++q<ot;)it[q]=($+q)*dt;else for($=Math.floor($*dt),Q=Math.ceil(Q*dt),it=new Array(ot=Math.ceil($-Q+1));++q<ot;)it[q]=($-q)/dt;return Y&&it.reverse(),it}function f($,Q,nt){var Y=(Q-$)/Math.max(0,nt),q=Math.floor(Math.log(Y)/Math.LN10),ot=Y/Math.pow(10,q);return q>=0?(ot>=T?10:ot>=M?5:ot>=w?2:1)*Math.pow(10,q):-Math.pow(10,-q)/(ot>=T?10:ot>=M?5:ot>=w?2:1)}function k($,Q,nt){var Y=Math.abs(Q-$)/Math.max(0,nt),q=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10)),ot=Y/q;return ot>=T?q*=10:ot>=M?q*=5:ot>=w&&(q*=2),Q<$?-q:q}function _($){return Math.ceil(Math.log($.length)/Math.LN2)+1}function D(){var $=b,Q=m,nt=_;function Y(q){var ot,it=q.length,dt,wt=new Array(it);for(ot=0;ot<it;++ot)wt[ot]=$(q[ot],ot,q);var xt=Q(wt),Ft=xt[0],Et=xt[1],Nt=nt(wt,Ft,Et);Array.isArray(Nt)||(Nt=k(Ft,Et,Nt),Nt=S(Math.ceil(Ft/Nt)*Nt,Et,Nt));for(var te=Nt.length;Nt[0]<=Ft;)Nt.shift(),--te;for(;Nt[te-1]>Et;)Nt.pop(),--te;var Jt=new Array(te+1),Qt;for(ot=0;ot<=te;++ot)Qt=Jt[ot]=[],Qt.x0=ot>0?Nt[ot-1]:Ft,Qt.x1=ot<te?Nt[ot]:Et;for(ot=0;ot<it;++ot)dt=wt[ot],Ft<=dt&&dt<=Et&&Jt[e(Nt,dt,0,te)].push(q[ot]);return Jt}return Y.value=function(q){return arguments.length?($=typeof q=="function"?q:x(q),Y):$},Y.domain=function(q){return arguments.length?(Q=typeof q=="function"?q:x([q[0],q[1]]),Y):Q},Y.thresholds=function(q){return arguments.length?(nt=typeof q=="function"?q:Array.isArray(q)?x(y.call(q)):x(q),Y):nt},Y}function I($,Q,nt){if(nt==null&&(nt=s),!!(Y=$.length)){if((Q=+Q)<=0||Y<2)return+nt($[0],0,$);if(Q>=1)return+nt($[Y-1],Y-1,$);var Y,q=(Y-1)*Q,ot=Math.floor(q),it=+nt($[ot],ot,$),dt=+nt($[ot+1],ot+1,$);return it+(dt-it)*(q-ot)}}function O($,Q,nt){return $=l.call($,s).sort(g),Math.ceil((nt-Q)/(2*(I($,.75)-I($,.25))*Math.pow($.length,-1/3)))}function B($,Q,nt){return Math.ceil((nt-Q)/(3.5*v($)*Math.pow($.length,-1/3)))}function R($,Q){var nt=$.length,Y=-1,q,ot;if(Q==null){for(;++Y<nt;)if((q=$[Y])!=null&&q>=q)for(ot=q;++Y<nt;)(q=$[Y])!=null&&q>ot&&(ot=q)}else for(;++Y<nt;)if((q=Q($[Y],Y,$))!=null&&q>=q)for(ot=q;++Y<nt;)(q=Q($[Y],Y,$))!=null&&q>ot&&(ot=q);return ot}function L($,Q){var nt=$.length,Y=nt,q=-1,ot,it=0;if(Q==null)for(;++q<nt;)isNaN(ot=s($[q]))?--Y:it+=ot;else for(;++q<nt;)isNaN(ot=s(Q($[q],q,$)))?--Y:it+=ot;if(Y)return it/Y}function F($,Q){var nt=$.length,Y=-1,q,ot=[];if(Q==null)for(;++Y<nt;)isNaN(q=s($[Y]))||ot.push(q);else for(;++Y<nt;)isNaN(q=s(Q($[Y],Y,$)))||ot.push(q);return I(ot.sort(g),.5)}function N($){for(var Q=$.length,nt,Y=-1,q=0,ot,it;++Y<Q;)q+=$[Y].length;for(ot=new Array(q);--Q>=0;)for(it=$[Q],nt=it.length;--nt>=0;)ot[--q]=it[nt];return ot}function j($,Q){var nt=$.length,Y=-1,q,ot;if(Q==null){for(;++Y<nt;)if((q=$[Y])!=null&&q>=q)for(ot=q;++Y<nt;)(q=$[Y])!=null&&ot>q&&(ot=q)}else for(;++Y<nt;)if((q=Q($[Y],Y,$))!=null&&q>=q)for(ot=q;++Y<nt;)(q=Q($[Y],Y,$))!=null&&ot>q&&(ot=q);return ot}function G($,Q){for(var nt=Q.length,Y=new Array(nt);nt--;)Y[nt]=$[Q[nt]];return Y}function rt($,Q){if(nt=$.length){var nt,Y=0,q=0,ot,it=$[q];for(Q==null&&(Q=g);++Y<nt;)(Q(ot=$[Y],it)<0||Q(it,it)!==0)&&(it=ot,q=Y);if(Q(it,it)===0)return q}}function ct($,Q,nt){for(var Y=(nt??$.length)-(Q=Q==null?0:+Q),q,ot;Y;)ot=Math.random()*Y--|0,q=$[Y+Q],$[Y+Q]=$[ot+Q],$[ot+Q]=q;return $}function lt($,Q){var nt=$.length,Y=-1,q,ot=0;if(Q==null)for(;++Y<nt;)(q=+$[Y])&&(ot+=q);else for(;++Y<nt;)(q=+Q($[Y],Y,$))&&(ot+=q);return ot}function tt($){if(!(ot=$.length))return[];for(var Q=-1,nt=j($,Z),Y=new Array(nt);++Q<nt;)for(var q=-1,ot,it=Y[Q]=new Array(ot);++q<ot;)it[q]=$[q][Q];return Y}function Z($){return $.length}function st(){return tt(arguments)}c.bisect=e,c.bisectRight=e,c.bisectLeft=r,c.ascending=g,c.bisector=E,c.cross=o,c.descending=a,c.deviation=v,c.extent=m,c.histogram=D,c.thresholdFreedmanDiaconis=O,c.thresholdScott=B,c.thresholdSturges=_,c.max=R,c.mean=L,c.median=F,c.merge=N,c.min=j,c.pairs=i,c.permute=G,c.quantile=I,c.range=S,c.scan=rt,c.shuffle=ct,c.sum=lt,c.ticks=u,c.tickIncrement=f,c.tickStep=k,c.transpose=tt,c.variance=h,c.zip=st,Object.defineProperty(c,"__esModule",{value:!0})})}),A3=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X,Sv()):(c=c||self,g(c.d3=c.d3||{},c.d3))})(X,function(c,g){function E(){return new A}function A(){this.reset()}A.prototype={constructor:A,reset:function(){this.s=this.t=0},add:function(Ve){e(t,Ve,this.t),e(this,t.s,this.s),this.s?this.t+=t.t:this.s=t.t},valueOf:function(){return this.s}};var t=new A;function e(Ve,lr,Ur){var Or=Ve.s=lr+Ur,un=Or-lr,Ln=Or-un;Ve.t=lr-Ln+(Ur-un)}var r=1e-6,i=1e-12,n=Math.PI,o=n/2,a=n/4,s=n*2,h=180/n,v=n/180,m=Math.abs,p=Math.atan,y=Math.atan2,l=Math.cos,x=Math.ceil,b=Math.exp,S=Math.log,T=Math.pow,M=Math.sin,w=Math.sign||function(Ve){return Ve>0?1:Ve<0?-1:0},u=Math.sqrt,f=Math.tan;function k(Ve){return Ve>1?0:Ve<-1?n:Math.acos(Ve)}function _(Ve){return Ve>1?o:Ve<-1?-o:Math.asin(Ve)}function D(Ve){return(Ve=M(Ve/2))*Ve}function I(){}function O(Ve,lr){Ve&&R.hasOwnProperty(Ve.type)&&R[Ve.type](Ve,lr)}var B={Feature:function(Ve,lr){O(Ve.geometry,lr)},FeatureCollection:function(Ve,lr){for(var Ur=Ve.features,Or=-1,un=Ur.length;++Or<un;)O(Ur[Or].geometry,lr)}},R={Sphere:function(Ve,lr){lr.sphere()},Point:function(Ve,lr){Ve=Ve.coordinates,lr.point(Ve[0],Ve[1],Ve[2])},MultiPoint:function(Ve,lr){for(var Ur=Ve.coordinates,Or=-1,un=Ur.length;++Or<un;)Ve=Ur[Or],lr.point(Ve[0],Ve[1],Ve[2])},LineString:function(Ve,lr){L(Ve.coordinates,lr,0)},MultiLineString:function(Ve,lr){for(var Ur=Ve.coordinates,Or=-1,un=Ur.length;++Or<un;)L(Ur[Or],lr,0)},Polygon:function(Ve,lr){F(Ve.coordinates,lr)},MultiPolygon:function(Ve,lr){for(var Ur=Ve.coordinates,Or=-1,un=Ur.length;++Or<un;)F(Ur[Or],lr)},GeometryCollection:function(Ve,lr){for(var Ur=Ve.geometries,Or=-1,un=Ur.length;++Or<un;)O(Ur[Or],lr)}};function L(Ve,lr,Ur){var Or=-1,un=Ve.length-Ur,Ln;for(lr.lineStart();++Or<un;)Ln=Ve[Or],lr.point(Ln[0],Ln[1],Ln[2]);lr.lineEnd()}function F(Ve,lr){var Ur=-1,Or=Ve.length;for(lr.polygonStart();++Ur<Or;)L(Ve[Ur],lr,1);lr.polygonEnd()}function N(Ve,lr){Ve&&B.hasOwnProperty(Ve.type)?B[Ve.type](Ve,lr):O(Ve,lr)}var j=E(),G=E(),rt,ct,lt,tt,Z,st={point:I,lineStart:I,lineEnd:I,polygonStart:function(){j.reset(),st.lineStart=$,st.lineEnd=Q},polygonEnd:function(){var Ve=+j;G.add(Ve<0?s+Ve:Ve),this.lineStart=this.lineEnd=this.point=I},sphere:function(){G.add(s)}};function $(){st.point=nt}function Q(){Y(rt,ct)}function nt(Ve,lr){st.point=Y,rt=Ve,ct=lr,Ve*=v,lr*=v,lt=Ve,tt=l(lr=lr/2+a),Z=M(lr)}function Y(Ve,lr){Ve*=v,lr*=v,lr=lr/2+a;var Ur=Ve-lt,Or=Ur>=0?1:-1,un=Or*Ur,Ln=l(lr),Gn=M(lr),oa=Z*Gn,ya=tt*Ln+oa*l(un),Pa=oa*Or*M(un);j.add(y(Pa,ya)),lt=Ve,tt=Ln,Z=Gn}function q(Ve){return G.reset(),N(Ve,st),G*2}function ot(Ve){return[y(Ve[1],Ve[0]),_(Ve[2])]}function it(Ve){var lr=Ve[0],Ur=Ve[1],Or=l(Ur);return[Or*l(lr),Or*M(lr),M(Ur)]}function dt(Ve,lr){return Ve[0]*lr[0]+Ve[1]*lr[1]+Ve[2]*lr[2]}function wt(Ve,lr){return[Ve[1]*lr[2]-Ve[2]*lr[1],Ve[2]*lr[0]-Ve[0]*lr[2],Ve[0]*lr[1]-Ve[1]*lr[0]]}function xt(Ve,lr){Ve[0]+=lr[0],Ve[1]+=lr[1],Ve[2]+=lr[2]}function Ft(Ve,lr){return[Ve[0]*lr,Ve[1]*lr,Ve[2]*lr]}function Et(Ve){var lr=u(Ve[0]*Ve[0]+Ve[1]*Ve[1]+Ve[2]*Ve[2]);Ve[0]/=lr,Ve[1]/=lr,Ve[2]/=lr}var Nt,te,Jt,Qt,Wt,gt,bt,vt,Ut=E(),Kt,Zt,le={point:Te,lineStart:Fe,lineEnd:Oe,polygonStart:function(){le.point=ur,le.lineStart=fr,le.lineEnd=We,Ut.reset(),st.polygonStart()},polygonEnd:function(){st.polygonEnd(),le.point=Te,le.lineStart=Fe,le.lineEnd=Oe,j<0?(Nt=-(Jt=180),te=-(Qt=90)):Ut>r?Qt=90:Ut<-r&&(te=-90),Zt[0]=Nt,Zt[1]=Jt},sphere:function(){Nt=-(Jt=180),te=-(Qt=90)}};function Te(Ve,lr){Kt.push(Zt=[Nt=Ve,Jt=Ve]),lr<te&&(te=lr),lr>Qt&&(Qt=lr)}function Se(Ve,lr){var Ur=it([Ve*v,lr*v]);if(vt){var Or=wt(vt,Ur),un=[Or[1],-Or[0],0],Ln=wt(un,Or);Et(Ln),Ln=ot(Ln);var Gn=Ve-Wt,oa=Gn>0?1:-1,ya=Ln[0]*h*oa,Pa,Jn=m(Gn)>180;Jn^(oa*Wt<ya&&ya<oa*Ve)?(Pa=Ln[1]*h,Pa>Qt&&(Qt=Pa)):(ya=(ya+360)%360-180,Jn^(oa*Wt<ya&&ya<oa*Ve)?(Pa=-Ln[1]*h,Pa<te&&(te=Pa)):(lr<te&&(te=lr),lr>Qt&&(Qt=lr))),Jn?Ve<Wt?Lr(Nt,Ve)>Lr(Nt,Jt)&&(Jt=Ve):Lr(Ve,Jt)>Lr(Nt,Jt)&&(Nt=Ve):Jt>=Nt?(Ve<Nt&&(Nt=Ve),Ve>Jt&&(Jt=Ve)):Ve>Wt?Lr(Nt,Ve)>Lr(Nt,Jt)&&(Jt=Ve):Lr(Ve,Jt)>Lr(Nt,Jt)&&(Nt=Ve)}else Kt.push(Zt=[Nt=Ve,Jt=Ve]);lr<te&&(te=lr),lr>Qt&&(Qt=lr),vt=Ur,Wt=Ve}function Fe(){le.point=Se}function Oe(){Zt[0]=Nt,Zt[1]=Jt,le.point=Te,vt=null}function ur(Ve,lr){if(vt){var Ur=Ve-Wt;Ut.add(m(Ur)>180?Ur+(Ur>0?360:-360):Ur)}else gt=Ve,bt=lr;st.point(Ve,lr),Se(Ve,lr)}function fr(){st.lineStart()}function We(){ur(gt,bt),st.lineEnd(),m(Ut)>r&&(Nt=-(Jt=180)),Zt[0]=Nt,Zt[1]=Jt,vt=null}function Lr(Ve,lr){return(lr-=Ve)<0?lr+360:lr}function kr(Ve,lr){return Ve[0]-lr[0]}function he(Ve,lr){return Ve[0]<=Ve[1]?Ve[0]<=lr&&lr<=Ve[1]:lr<Ve[0]||Ve[1]<lr}function Dt(Ve){var lr,Ur,Or,un,Ln,Gn,oa;if(Qt=Jt=-(Nt=te=1/0),Kt=[],N(Ve,le),Ur=Kt.length){for(Kt.sort(kr),lr=1,Or=Kt[0],Ln=[Or];lr<Ur;++lr)un=Kt[lr],he(Or,un[0])||he(Or,un[1])?(Lr(Or[0],un[1])>Lr(Or[0],Or[1])&&(Or[1]=un[1]),Lr(un[0],Or[1])>Lr(Or[0],Or[1])&&(Or[0]=un[0])):Ln.push(Or=un);for(Gn=-1/0,Ur=Ln.length-1,lr=0,Or=Ln[Ur];lr<=Ur;Or=un,++lr)un=Ln[lr],(oa=Lr(Or[1],un[0]))>Gn&&(Gn=oa,Nt=un[0],Jt=Or[1])}return Kt=Zt=null,Nt===1/0||te===1/0?[[NaN,NaN],[NaN,NaN]]:[[Nt,te],[Jt,Qt]]}var qt,zt,ut,yt,Mt,Ot,$t,ee,we,Me,Re,Be,Ze,Ue,mr,ln,an={sphere:I,point:vn,lineStart:An,lineEnd:Nn,polygonStart:function(){an.lineStart=ke,an.lineEnd=ze},polygonEnd:function(){an.lineStart=An,an.lineEnd=Nn}};function vn(Ve,lr){Ve*=v,lr*=v;var Ur=l(lr);Sn(Ur*l(Ve),Ur*M(Ve),M(lr))}function Sn(Ve,lr,Ur){++qt,ut+=(Ve-ut)/qt,yt+=(lr-yt)/qt,Mt+=(Ur-Mt)/qt}function An(){an.point=pn}function pn(Ve,lr){Ve*=v,lr*=v;var Ur=l(lr);Ue=Ur*l(Ve),mr=Ur*M(Ve),ln=M(lr),an.point=On,Sn(Ue,mr,ln)}function On(Ve,lr){Ve*=v,lr*=v;var Ur=l(lr),Or=Ur*l(Ve),un=Ur*M(Ve),Ln=M(lr),Gn=y(u((Gn=mr*Ln-ln*un)*Gn+(Gn=ln*Or-Ue*Ln)*Gn+(Gn=Ue*un-mr*Or)*Gn),Ue*Or+mr*un+ln*Ln);zt+=Gn,Ot+=Gn*(Ue+(Ue=Or)),$t+=Gn*(mr+(mr=un)),ee+=Gn*(ln+(ln=Ln)),Sn(Ue,mr,ln)}function Nn(){an.point=vn}function ke(){an.point=je}function ze(){Ne(Be,Ze),an.point=vn}function je(Ve,lr){Be=Ve,Ze=lr,Ve*=v,lr*=v,an.point=Ne;var Ur=l(lr);Ue=Ur*l(Ve),mr=Ur*M(Ve),ln=M(lr),Sn(Ue,mr,ln)}function Ne(Ve,lr){Ve*=v,lr*=v;var Ur=l(lr),Or=Ur*l(Ve),un=Ur*M(Ve),Ln=M(lr),Gn=mr*Ln-ln*un,oa=ln*Or-Ue*Ln,ya=Ue*un-mr*Or,Pa=u(Gn*Gn+oa*oa+ya*ya),Jn=_(Pa),va=Pa&&-Jn/Pa;we+=va*Gn,Me+=va*oa,Re+=va*ya,zt+=Jn,Ot+=Jn*(Ue+(Ue=Or)),$t+=Jn*(mr+(mr=un)),ee+=Jn*(ln+(ln=Ln)),Sn(Ue,mr,ln)}function _r(Ve){qt=zt=ut=yt=Mt=Ot=$t=ee=we=Me=Re=0,N(Ve,an);var lr=we,Ur=Me,Or=Re,un=lr*lr+Ur*Ur+Or*Or;return un<i&&(lr=Ot,Ur=$t,Or=ee,zt<r&&(lr=ut,Ur=yt,Or=Mt),un=lr*lr+Ur*Ur+Or*Or,un<i)?[NaN,NaN]:[y(Ur,lr)*h,_(Or/u(un))*h]}function Xr(Ve){return function(){return Ve}}function rn(Ve,lr){function Ur(Or,un){return Or=Ve(Or,un),lr(Or[0],Or[1])}return Ve.invert&&lr.invert&&(Ur.invert=function(Or,un){return Or=lr.invert(Or,un),Or&&Ve.invert(Or[0],Or[1])}),Ur}function Br(Ve,lr){return[m(Ve)>n?Ve+Math.round(-Ve/s)*s:Ve,lr]}Br.invert=Br;function _n(Ve,lr,Ur){return(Ve%=s)?lr||Ur?rn(Fn(Ve),on(lr,Ur)):Fn(Ve):lr||Ur?on(lr,Ur):Br}function bn(Ve){return function(lr,Ur){return lr+=Ve,[lr>n?lr-s:lr<-n?lr+s:lr,Ur]}}function Fn(Ve){var lr=bn(Ve);return lr.invert=bn(-Ve),lr}function on(Ve,lr){var Ur=l(Ve),Or=M(Ve),un=l(lr),Ln=M(lr);function Gn(oa,ya){var Pa=l(ya),Jn=l(oa)*Pa,va=M(oa)*Pa,sa=M(ya),qn=sa*Ur+Jn*Or;return[y(va*un-qn*Ln,Jn*Ur-sa*Or),_(qn*un+va*Ln)]}return Gn.invert=function(oa,ya){var Pa=l(ya),Jn=l(oa)*Pa,va=M(oa)*Pa,sa=M(ya),qn=sa*un-va*Ln;return[y(va*un+sa*Ln,Jn*Ur+qn*Or),_(qn*Ur-Jn*Or)]},Gn}function Bn(Ve){Ve=_n(Ve[0]*v,Ve[1]*v,Ve.length>2?Ve[2]*v:0);function lr(Ur){return Ur=Ve(Ur[0]*v,Ur[1]*v),Ur[0]*=h,Ur[1]*=h,Ur}return lr.invert=function(Ur){return Ur=Ve.invert(Ur[0]*v,Ur[1]*v),Ur[0]*=h,Ur[1]*=h,Ur},lr}function ue(Ve,lr,Ur,Or,un,Ln){if(Ur){var Gn=l(lr),oa=M(lr),ya=Or*Ur;un==null?(un=lr+Or*s,Ln=lr-ya/2):(un=xe(Gn,un),Ln=xe(Gn,Ln),(Or>0?un<Ln:un>Ln)&&(un+=Or*s));for(var Pa,Jn=un;Or>0?Jn>Ln:Jn<Ln;Jn-=ya)Pa=ot([Gn,-oa*l(Jn),-oa*M(Jn)]),Ve.point(Pa[0],Pa[1])}}function xe(Ve,lr){lr=it(lr),lr[0]-=Ve,Et(lr);var Ur=k(-lr[1]);return((-lr[2]<0?-Ur:Ur)+s-r)%s}function Pr(){var Ve=Xr([0,0]),lr=Xr(90),Ur=Xr(6),Or,un,Ln={point:Gn};function Gn(ya,Pa){Or.push(ya=un(ya,Pa)),ya[0]*=h,ya[1]*=h}function oa(){var ya=Ve.apply(this,arguments),Pa=lr.apply(this,arguments)*v,Jn=Ur.apply(this,arguments)*v;return Or=[],un=_n(-ya[0]*v,-ya[1]*v,0).invert,ue(Ln,Pa,Jn,1),ya={type:"Polygon",coordinates:[Or]},Or=un=null,ya}return oa.center=function(ya){return arguments.length?(Ve=typeof ya=="function"?ya:Xr([+ya[0],+ya[1]]),oa):Ve},oa.radius=function(ya){return arguments.length?(lr=typeof ya=="function"?ya:Xr(+ya),oa):lr},oa.precision=function(ya){return arguments.length?(Ur=typeof ya=="function"?ya:Xr(+ya),oa):Ur},oa}function Sr(){var Ve=[],lr;return{point:function(Ur,Or,un){lr.push([Ur,Or,un])},lineStart:function(){Ve.push(lr=[])},lineEnd:I,rejoin:function(){Ve.length>1&&Ve.push(Ve.pop().concat(Ve.shift()))},result:function(){var Ur=Ve;return Ve=[],lr=null,Ur}}}function gr(Ve,lr){return m(Ve[0]-lr[0])<r&&m(Ve[1]-lr[1])<r}function dr(Ve,lr,Ur,Or){this.x=Ve,this.z=lr,this.o=Ur,this.e=Or,this.v=!1,this.n=this.p=null}function Er(Ve,lr,Ur,Or,un){var Ln=[],Gn=[],oa,ya;if(Ve.forEach(function(Fa){if(!((Fi=Fa.length-1)<=0)){var Fi,Ei=Fa[0],Ni=Fa[Fi],Hi;if(gr(Ei,Ni)){if(!Ei[2]&&!Ni[2]){for(un.lineStart(),oa=0;oa<Fi;++oa)un.point((Ei=Fa[oa])[0],Ei[1]);un.lineEnd();return}Ni[0]+=2*r}Ln.push(Hi=new dr(Ei,Fa,null,!0)),Gn.push(Hi.o=new dr(Ei,null,Hi,!1)),Ln.push(Hi=new dr(Ni,Fa,null,!1)),Gn.push(Hi.o=new dr(Ni,null,Hi,!0))}}),!!Ln.length){for(Gn.sort(lr),Dr(Ln),Dr(Gn),oa=0,ya=Gn.length;oa<ya;++oa)Gn[oa].e=Ur=!Ur;for(var Pa=Ln[0],Jn,va;;){for(var sa=Pa,qn=!0;sa.v;)if((sa=sa.n)===Pa)return;Jn=sa.z,un.lineStart();do{if(sa.v=sa.o.v=!0,sa.e){if(qn)for(oa=0,ya=Jn.length;oa<ya;++oa)un.point((va=Jn[oa])[0],va[1]);else Or(sa.x,sa.n.x,1,un);sa=sa.n}else{if(qn)for(Jn=sa.p.z,oa=Jn.length-1;oa>=0;--oa)un.point((va=Jn[oa])[0],va[1]);else Or(sa.x,sa.p.x,-1,un);sa=sa.p}sa=sa.o,Jn=sa.z,qn=!qn}while(!sa.v);un.lineEnd()}}}function Dr(Ve){if(lr=Ve.length){for(var lr,Ur=0,Or=Ve[0],un;++Ur<lr;)Or.n=un=Ve[Ur],un.p=Or,Or=un;Or.n=un=Ve[0],un.p=Or}}var Ar=E();function Gr(Ve){return m(Ve[0])<=n?Ve[0]:w(Ve[0])*((m(Ve[0])+n)%s-n)}function Wr(Ve,lr){var Ur=Gr(lr),Or=lr[1],un=M(Or),Ln=[M(Ur),-l(Ur),0],Gn=0,oa=0;Ar.reset(),un===1?Or=o+r:un===-1&&(Or=-o-r);for(var ya=0,Pa=Ve.length;ya<Pa;++ya)if(va=(Jn=Ve[ya]).length)for(var Jn,va,sa=Jn[va-1],qn=Gr(sa),Fa=sa[1]/2+a,Fi=M(Fa),Ei=l(Fa),Ni=0;Ni<va;++Ni,qn=Ba,Fi=$i,Ei=So,sa=Hi){var Hi=Jn[Ni],Ba=Gr(Hi),ba=Hi[1]/2+a,$i=M(ba),So=l(ba),Jo=Ba-qn,As=Jo>=0?1:-1,os=As*Jo,xs=os>n,No=Fi*$i;if(Ar.add(y(No*As*M(os),Ei*So+No*l(os))),Gn+=xs?Jo+As*s:Jo,xs^qn>=Ur^Ba>=Ur){var Qs=wt(it(sa),it(Hi));Et(Qs);var Hs=wt(Ln,Qs);Et(Hs);var Ms=(xs^Jo>=0?-1:1)*_(Hs[2]);(Or>Ms||Or===Ms&&(Qs[0]||Qs[1]))&&(oa+=xs^Jo>=0?1:-1)}}return(Gn<-r||Gn<r&&Ar<-r)^oa&1}function Jr(Ve,lr,Ur,Or){return function(un){var Ln=lr(un),Gn=Sr(),oa=lr(Gn),ya=!1,Pa,Jn,va,sa={point:qn,lineStart:Fi,lineEnd:Ei,polygonStart:function(){sa.point=Ni,sa.lineStart=Hi,sa.lineEnd=Ba,Jn=[],Pa=[]},polygonEnd:function(){sa.point=qn,sa.lineStart=Fi,sa.lineEnd=Ei,Jn=g.merge(Jn);var ba=Wr(Pa,Or);Jn.length?(ya||(un.polygonStart(),ya=!0),Er(Jn,Je,ba,Ur,un)):ba&&(ya||(un.polygonStart(),ya=!0),un.lineStart(),Ur(null,null,1,un),un.lineEnd()),ya&&(un.polygonEnd(),ya=!1),Jn=Pa=null},sphere:function(){un.polygonStart(),un.lineStart(),Ur(null,null,1,un),un.lineEnd(),un.polygonEnd()}};function qn(ba,$i){Ve(ba,$i)&&un.point(ba,$i)}function Fa(ba,$i){Ln.point(ba,$i)}function Fi(){sa.point=Fa,Ln.lineStart()}function Ei(){sa.point=qn,Ln.lineEnd()}function Ni(ba,$i){va.push([ba,$i]),oa.point(ba,$i)}function Hi(){oa.lineStart(),va=[]}function Ba(){Ni(va[0][0],va[0][1]),oa.lineEnd();var ba=oa.clean(),$i=Gn.result(),So,Jo=$i.length,As,os,xs;if(va.pop(),Pa.push(va),va=null,!!Jo){if(ba&1){if(os=$i[0],(As=os.length-1)>0){for(ya||(un.polygonStart(),ya=!0),un.lineStart(),So=0;So<As;++So)un.point((xs=os[So])[0],xs[1]);un.lineEnd()}return}Jo>1&&ba&2&&$i.push($i.pop().concat($i.shift())),Jn.push($i.filter(_e))}}return sa}}function _e(Ve){return Ve.length>1}function Je(Ve,lr){return((Ve=Ve.x)[0]<0?Ve[1]-o-r:o-Ve[1])-((lr=lr.x)[0]<0?lr[1]-o-r:o-lr[1])}var yr=Jr(function(){return!0},Hr,En,[-n,-o]);function Hr(Ve){var lr=NaN,Ur=NaN,Or=NaN,un;return{lineStart:function(){Ve.lineStart(),un=1},point:function(Ln,Gn){var oa=Ln>0?n:-n,ya=m(Ln-lr);m(ya-n)<r?(Ve.point(lr,Ur=(Ur+Gn)/2>0?o:-o),Ve.point(Or,Ur),Ve.lineEnd(),Ve.lineStart(),Ve.point(oa,Ur),Ve.point(Ln,Ur),un=0):Or!==oa&&ya>=n&&(m(lr-Or)<r&&(lr-=Or*r),m(Ln-oa)<r&&(Ln-=oa*r),Ur=hn(lr,Ur,Ln,Gn),Ve.point(Or,Ur),Ve.lineEnd(),Ve.lineStart(),Ve.point(oa,Ur),un=0),Ve.point(lr=Ln,Ur=Gn),Or=oa},lineEnd:function(){Ve.lineEnd(),lr=Ur=NaN},clean:function(){return 2-un}}}function hn(Ve,lr,Ur,Or){var un,Ln,Gn=M(Ve-Ur);return m(Gn)>r?p((M(lr)*(Ln=l(Or))*M(Ur)-M(Or)*(un=l(lr))*M(Ve))/(un*Ln*Gn)):(lr+Or)/2}function En(Ve,lr,Ur,Or){var un;if(Ve==null)un=Ur*o,Or.point(-n,un),Or.point(0,un),Or.point(n,un),Or.point(n,0),Or.point(n,-un),Or.point(0,-un),Or.point(-n,-un),Or.point(-n,0),Or.point(-n,un);else if(m(Ve[0]-lr[0])>r){var Ln=Ve[0]<lr[0]?n:-n;un=Ur*Ln/2,Or.point(-Ln,un),Or.point(0,un),Or.point(Ln,un)}else Or.point(lr[0],lr[1])}function dn(Ve){var lr=l(Ve),Ur=6*v,Or=lr>0,un=m(lr)>r;function Ln(Jn,va,sa,qn){ue(qn,Ve,Ur,sa,Jn,va)}function Gn(Jn,va){return l(Jn)*l(va)>lr}function oa(Jn){var va,sa,qn,Fa,Fi;return{lineStart:function(){Fa=qn=!1,Fi=1},point:function(Ei,Ni){var Hi=[Ei,Ni],Ba,ba=Gn(Ei,Ni),$i=Or?ba?0:Pa(Ei,Ni):ba?Pa(Ei+(Ei<0?n:-n),Ni):0;if(!va&&(Fa=qn=ba)&&Jn.lineStart(),ba!==qn&&(Ba=ya(va,Hi),(!Ba||gr(va,Ba)||gr(Hi,Ba))&&(Hi[2]=1)),ba!==qn)Fi=0,ba?(Jn.lineStart(),Ba=ya(Hi,va),Jn.point(Ba[0],Ba[1])):(Ba=ya(va,Hi),Jn.point(Ba[0],Ba[1],2),Jn.lineEnd()),va=Ba;else if(un&&va&&Or^ba){var So;!($i&sa)&&(So=ya(Hi,va,!0))&&(Fi=0,Or?(Jn.lineStart(),Jn.point(So[0][0],So[0][1]),Jn.point(So[1][0],So[1][1]),Jn.lineEnd()):(Jn.point(So[1][0],So[1][1]),Jn.lineEnd(),Jn.lineStart(),Jn.point(So[0][0],So[0][1],3)))}ba&&(!va||!gr(va,Hi))&&Jn.point(Hi[0],Hi[1]),va=Hi,qn=ba,sa=$i},lineEnd:function(){qn&&Jn.lineEnd(),va=null},clean:function(){return Fi|(Fa&&qn)<<1}}}function ya(Jn,va,sa){var qn=it(Jn),Fa=it(va),Fi=[1,0,0],Ei=wt(qn,Fa),Ni=dt(Ei,Ei),Hi=Ei[0],Ba=Ni-Hi*Hi;if(!Ba)return!sa&&Jn;var ba=lr*Ni/Ba,$i=-lr*Hi/Ba,So=wt(Fi,Ei),Jo=Ft(Fi,ba),As=Ft(Ei,$i);xt(Jo,As);var os=So,xs=dt(Jo,os),No=dt(os,os),Qs=xs*xs-No*(dt(Jo,Jo)-1);if(!(Qs<0)){var Hs=u(Qs),Ms=Ft(os,(-xs-Hs)/No);if(xt(Ms,Jo),Ms=ot(Ms),!sa)return Ms;var ni=Jn[0],to=va[0],ds=Jn[1],Qo=va[1],Tl;to<ni&&(Tl=ni,ni=to,to=Tl);var Kl=to-ni,Fl=m(Kl-n)<r,tc=Fl||Kl<r;if(!Fl&&Qo<ds&&(Tl=ds,ds=Qo,Qo=Tl),tc?Fl?ds+Qo>0^Ms[1]<(m(Ms[0]-ni)<r?ds:Qo):ds<=Ms[1]&&Ms[1]<=Qo:Kl>n^(ni<=Ms[0]&&Ms[0]<=to)){var tu=Ft(os,(-xs+Hs)/No);return xt(tu,Jo),[Ms,ot(tu)]}}}function Pa(Jn,va){var sa=Or?Ve:n-Ve,qn=0;return Jn<-sa?qn|=1:Jn>sa&&(qn|=2),va<-sa?qn|=4:va>sa&&(qn|=8),qn}return Jr(Gn,oa,Ln,Or?[0,-Ve]:[-n,Ve-n])}function Kr(Ve,lr,Ur,Or,un,Ln){var Gn=Ve[0],oa=Ve[1],ya=lr[0],Pa=lr[1],Jn=0,va=1,sa=ya-Gn,qn=Pa-oa,Fa;if(Fa=Ur-Gn,!(!sa&&Fa>0)){if(Fa/=sa,sa<0){if(Fa<Jn)return;Fa<va&&(va=Fa)}else if(sa>0){if(Fa>va)return;Fa>Jn&&(Jn=Fa)}if(Fa=un-Gn,!(!sa&&Fa<0)){if(Fa/=sa,sa<0){if(Fa>va)return;Fa>Jn&&(Jn=Fa)}else if(sa>0){if(Fa<Jn)return;Fa<va&&(va=Fa)}if(Fa=Or-oa,!(!qn&&Fa>0)){if(Fa/=qn,qn<0){if(Fa<Jn)return;Fa<va&&(va=Fa)}else if(qn>0){if(Fa>va)return;Fa>Jn&&(Jn=Fa)}if(Fa=Ln-oa,!(!qn&&Fa<0)){if(Fa/=qn,qn<0){if(Fa>va)return;Fa>Jn&&(Jn=Fa)}else if(qn>0){if(Fa<Jn)return;Fa<va&&(va=Fa)}return Jn>0&&(Ve[0]=Gn+Jn*sa,Ve[1]=oa+Jn*qn),va<1&&(lr[0]=Gn+va*sa,lr[1]=oa+va*qn),!0}}}}}var Tn=1e9,ta=-Tn;function Qn(Ve,lr,Ur,Or){function un(Pa,Jn){return Ve<=Pa&&Pa<=Ur&&lr<=Jn&&Jn<=Or}function Ln(Pa,Jn,va,sa){var qn=0,Fa=0;if(Pa==null||(qn=Gn(Pa,va))!==(Fa=Gn(Jn,va))||ya(Pa,Jn)<0^va>0)do sa.point(qn===0||qn===3?Ve:Ur,qn>1?Or:lr);while((qn=(qn+va+4)%4)!==Fa);else sa.point(Jn[0],Jn[1])}function Gn(Pa,Jn){return m(Pa[0]-Ve)<r?Jn>0?0:3:m(Pa[0]-Ur)<r?Jn>0?2:1:m(Pa[1]-lr)<r?Jn>0?1:0:Jn>0?3:2}function oa(Pa,Jn){return ya(Pa.x,Jn.x)}function ya(Pa,Jn){var va=Gn(Pa,1),sa=Gn(Jn,1);return va!==sa?va-sa:va===0?Jn[1]-Pa[1]:va===1?Pa[0]-Jn[0]:va===2?Pa[1]-Jn[1]:Jn[0]-Pa[0]}return function(Pa){var Jn=Pa,va=Sr(),sa,qn,Fa,Fi,Ei,Ni,Hi,Ba,ba,$i,So,Jo={point:As,lineStart:Qs,lineEnd:Hs,polygonStart:xs,polygonEnd:No};function As(ni,to){un(ni,to)&&Jn.point(ni,to)}function os(){for(var ni=0,to=0,ds=qn.length;to<ds;++to)for(var Qo=qn[to],Tl=1,Kl=Qo.length,Fl=Qo[0],tc,tu,Uu=Fl[0],$s=Fl[1];Tl<Kl;++Tl)tc=Uu,tu=$s,Fl=Qo[Tl],Uu=Fl[0],$s=Fl[1],tu<=Or?$s>Or&&(Uu-tc)*(Or-tu)>($s-tu)*(Ve-tc)&&++ni:$s<=Or&&(Uu-tc)*(Or-tu)<($s-tu)*(Ve-tc)&&--ni;return ni}function xs(){Jn=va,sa=[],qn=[],So=!0}function No(){var ni=os(),to=So&&ni,ds=(sa=g.merge(sa)).length;(to||ds)&&(Pa.polygonStart(),to&&(Pa.lineStart(),Ln(null,null,1,Pa),Pa.lineEnd()),ds&&Er(sa,oa,ni,Ln,Pa),Pa.polygonEnd()),Jn=Pa,sa=qn=Fa=null}function Qs(){Jo.point=Ms,qn&&qn.push(Fa=[]),$i=!0,ba=!1,Hi=Ba=NaN}function Hs(){sa&&(Ms(Fi,Ei),Ni&&ba&&va.rejoin(),sa.push(va.result())),Jo.point=As,ba&&Jn.lineEnd()}function Ms(ni,to){var ds=un(ni,to);if(qn&&Fa.push([ni,to]),$i)Fi=ni,Ei=to,Ni=ds,$i=!1,ds&&(Jn.lineStart(),Jn.point(ni,to));else if(ds&&ba)Jn.point(ni,to);else{var Qo=[Hi=Math.max(ta,Math.min(Tn,Hi)),Ba=Math.max(ta,Math.min(Tn,Ba))],Tl=[ni=Math.max(ta,Math.min(Tn,ni)),to=Math.max(ta,Math.min(Tn,to))];Kr(Qo,Tl,Ve,lr,Ur,Or)?(ba||(Jn.lineStart(),Jn.point(Qo[0],Qo[1])),Jn.point(Tl[0],Tl[1]),ds||Jn.lineEnd(),So=!1):ds&&(Jn.lineStart(),Jn.point(ni,to),So=!1)}Hi=ni,Ba=to,ba=ds}return Jo}}function Va(){var Ve=0,lr=0,Ur=960,Or=500,un,Ln,Gn;return Gn={stream:function(oa){return un&&Ln===oa?un:un=Qn(Ve,lr,Ur,Or)(Ln=oa)},extent:function(oa){return arguments.length?(Ve=+oa[0][0],lr=+oa[0][1],Ur=+oa[1][0],Or=+oa[1][1],un=Ln=null,Gn):[[Ve,lr],[Ur,Or]]}}}var ja=E(),ci,pi,bi,ri={sphere:I,point:I,lineStart:Da,lineEnd:I,polygonStart:I,polygonEnd:I};function Da(){ri.point=lo,ri.lineEnd=Ui}function Ui(){ri.point=ri.lineEnd=I}function lo(Ve,lr){Ve*=v,lr*=v,ci=Ve,pi=M(lr),bi=l(lr),ri.point=Co}function Co(Ve,lr){Ve*=v,lr*=v;var Ur=M(lr),Or=l(lr),un=m(Ve-ci),Ln=l(un),Gn=M(un),oa=Or*Gn,ya=bi*Ur-pi*Or*Ln,Pa=pi*Ur+bi*Or*Ln;ja.add(y(u(oa*oa+ya*ya),Pa)),ci=Ve,pi=Ur,bi=Or}function Bo(Ve){return ja.reset(),N(Ve,ri),+ja}var ai=[null,null],yi={type:"LineString",coordinates:ai};function Si(Ve,lr){return ai[0]=Ve,ai[1]=lr,Bo(yi)}var ko={Feature:function(Ve,lr){return Do(Ve.geometry,lr)},FeatureCollection:function(Ve,lr){for(var Ur=Ve.features,Or=-1,un=Ur.length;++Or<un;)if(Do(Ur[Or].geometry,lr))return!0;return!1}},Ao={Sphere:function(){return!0},Point:function(Ve,lr){return Pi(Ve.coordinates,lr)},MultiPoint:function(Ve,lr){for(var Ur=Ve.coordinates,Or=-1,un=Ur.length;++Or<un;)if(Pi(Ur[Or],lr))return!0;return!1},LineString:function(Ve,lr){return Yi(Ve.coordinates,lr)},MultiLineString:function(Ve,lr){for(var Ur=Ve.coordinates,Or=-1,un=Ur.length;++Or<un;)if(Yi(Ur[Or],lr))return!0;return!1},Polygon:function(Ve,lr){return vs(Ve.coordinates,lr)},MultiPolygon:function(Ve,lr){for(var Ur=Ve.coordinates,Or=-1,un=Ur.length;++Or<un;)if(vs(Ur[Or],lr))return!0;return!1},GeometryCollection:function(Ve,lr){for(var Ur=Ve.geometries,Or=-1,un=Ur.length;++Or<un;)if(Do(Ur[Or],lr))return!0;return!1}};function Do(Ve,lr){return Ve&&Ao.hasOwnProperty(Ve.type)?Ao[Ve.type](Ve,lr):!1}function Pi(Ve,lr){return Si(Ve,lr)===0}function Yi(Ve,lr){for(var Ur,Or,un,Ln=0,Gn=Ve.length;Ln<Gn;Ln++){if(Or=Si(Ve[Ln],lr),Or===0||Ln>0&&(un=Si(Ve[Ln],Ve[Ln-1]),un>0&&Ur<=un&&Or<=un&&(Ur+Or-un)*(1-Math.pow((Ur-Or)/un,2))<i*un))return!0;Ur=Or}return!1}function vs(Ve,lr){return!!Wr(Ve.map(es),ls(lr))}function es(Ve){return Ve=Ve.map(ls),Ve.pop(),Ve}function ls(Ve){return[Ve[0]*v,Ve[1]*v]}function Xi(Ve,lr){return(Ve&&ko.hasOwnProperty(Ve.type)?ko[Ve.type]:Do)(Ve,lr)}function ga(Ve,lr,Ur){var Or=g.range(Ve,lr-r,Ur).concat(lr);return function(un){return Or.map(function(Ln){return[un,Ln]})}}function Xa(Ve,lr,Ur){var Or=g.range(Ve,lr-r,Ur).concat(lr);return function(un){return Or.map(function(Ln){return[Ln,un]})}}function Ls(){var Ve,lr,Ur,Or,un,Ln,Gn,oa,ya=10,Pa=ya,Jn=90,va=360,sa,qn,Fa,Fi,Ei=2.5;function Ni(){return{type:"MultiLineString",coordinates:Hi()}}function Hi(){return g.range(x(Or/Jn)*Jn,Ur,Jn).map(Fa).concat(g.range(x(oa/va)*va,Gn,va).map(Fi)).concat(g.range(x(lr/ya)*ya,Ve,ya).filter(function(Ba){return m(Ba%Jn)>r}).map(sa)).concat(g.range(x(Ln/Pa)*Pa,un,Pa).filter(function(Ba){return m(Ba%va)>r}).map(qn))}return Ni.lines=function(){return Hi().map(function(Ba){return{type:"LineString",coordinates:Ba}})},Ni.outline=function(){return{type:"Polygon",coordinates:[Fa(Or).concat(Fi(Gn).slice(1),Fa(Ur).reverse().slice(1),Fi(oa).reverse().slice(1))]}},Ni.extent=function(Ba){return arguments.length?Ni.extentMajor(Ba).extentMinor(Ba):Ni.extentMinor()},Ni.extentMajor=function(Ba){return arguments.length?(Or=+Ba[0][0],Ur=+Ba[1][0],oa=+Ba[0][1],Gn=+Ba[1][1],Or>Ur&&(Ba=Or,Or=Ur,Ur=Ba),oa>Gn&&(Ba=oa,oa=Gn,Gn=Ba),Ni.precision(Ei)):[[Or,oa],[Ur,Gn]]},Ni.extentMinor=function(Ba){return arguments.length?(lr=+Ba[0][0],Ve=+Ba[1][0],Ln=+Ba[0][1],un=+Ba[1][1],lr>Ve&&(Ba=lr,lr=Ve,Ve=Ba),Ln>un&&(Ba=Ln,Ln=un,un=Ba),Ni.precision(Ei)):[[lr,Ln],[Ve,un]]},Ni.step=function(Ba){return arguments.length?Ni.stepMajor(Ba).stepMinor(Ba):Ni.stepMinor()},Ni.stepMajor=function(Ba){return arguments.length?(Jn=+Ba[0],va=+Ba[1],Ni):[Jn,va]},Ni.stepMinor=function(Ba){return arguments.length?(ya=+Ba[0],Pa=+Ba[1],Ni):[ya,Pa]},Ni.precision=function(Ba){return arguments.length?(Ei=+Ba,sa=ga(Ln,un,90),qn=Xa(lr,Ve,Ei),Fa=ga(oa,Gn,90),Fi=Xa(Or,Ur,Ei),Ni):Ei},Ni.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function fs(){return Ls()()}function qi(Ve,lr){var Ur=Ve[0]*v,Or=Ve[1]*v,un=lr[0]*v,Ln=lr[1]*v,Gn=l(Or),oa=M(Or),ya=l(Ln),Pa=M(Ln),Jn=Gn*l(Ur),va=Gn*M(Ur),sa=ya*l(un),qn=ya*M(un),Fa=2*_(u(D(Ln-Or)+Gn*ya*D(un-Ur))),Fi=M(Fa),Ei=Fa?function(Ni){var Hi=M(Ni*=Fa)/Fi,Ba=M(Fa-Ni)/Fi,ba=Ba*Jn+Hi*sa,$i=Ba*va+Hi*qn,So=Ba*oa+Hi*Pa;return[y($i,ba)*h,y(So,u(ba*ba+$i*$i))*h]}:function(){return[Ur*h,Or*h]};return Ei.distance=Fa,Ei}function ms(Ve){return Ve}var Po=E(),rs=E(),hl,za,Oi,Bi,Ro={point:I,lineStart:I,lineEnd:I,polygonStart:function(){Ro.lineStart=Fo,Ro.lineEnd=ql},polygonEnd:function(){Ro.lineStart=Ro.lineEnd=Ro.point=I,Po.add(m(rs)),rs.reset()},result:function(){var Ve=Po/2;return Po.reset(),Ve}};function Fo(){Ro.point=Ci}function Ci(Ve,lr){Ro.point=fl,hl=Oi=Ve,za=Bi=lr}function fl(Ve,lr){rs.add(Bi*Ve-Oi*lr),Oi=Ve,Bi=lr}function ql(){fl(hl,za)}var Zs=1/0,Hl=Zs,Us=-Zs,Es=Us,El={point:Wu,lineStart:I,lineEnd:I,polygonStart:I,polygonEnd:I,result:function(){var Ve=[[Zs,Hl],[Us,Es]];return Us=Es=-(Hl=Zs=1/0),Ve}};function Wu(Ve,lr){Ve<Zs&&(Zs=Ve),Ve>Us&&(Us=Ve),lr<Hl&&(Hl=lr),lr>Es&&(Es=lr)}var Mu=0,Fu=0,_h=0,ih=0,ns=0,du=0,Ic=0,ll=0,el=0,ul,Zu,ys,pl,$o={point:ks,lineStart:Bu,lineEnd:Cs,polygonStart:function(){$o.lineStart=zh,$o.lineEnd=Mo},polygonEnd:function(){$o.point=ks,$o.lineStart=Bu,$o.lineEnd=Cs},result:function(){var Ve=el?[Ic/el,ll/el]:du?[ih/du,ns/du]:_h?[Mu/_h,Fu/_h]:[NaN,NaN];return Mu=Fu=_h=ih=ns=du=Ic=ll=el=0,Ve}};function ks(Ve,lr){Mu+=Ve,Fu+=lr,++_h}function Bu(){$o.point=Ol}function Ol(Ve,lr){$o.point=Xu,ks(ys=Ve,pl=lr)}function Xu(Ve,lr){var Ur=Ve-ys,Or=lr-pl,un=u(Ur*Ur+Or*Or);ih+=un*(ys+Ve)/2,ns+=un*(pl+lr)/2,du+=un,ks(ys=Ve,pl=lr)}function Cs(){$o.point=ks}function zh(){$o.point=Oh}function Mo(){as(ul,Zu)}function Oh(Ve,lr){$o.point=as,ks(ul=ys=Ve,Zu=pl=lr)}function as(Ve,lr){var Ur=Ve-ys,Or=lr-pl,un=u(Ur*Ur+Or*Or);ih+=un*(ys+Ve)/2,ns+=un*(pl+lr)/2,du+=un,un=pl*Ve-ys*lr,Ic+=un*(ys+Ve),ll+=un*(pl+lr),el+=un*3,ks(ys=Ve,pl=lr)}function io(Ve){this._context=Ve}io.prototype={_radius:4.5,pointRadius:function(Ve){return this._radius=Ve,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(Ve,lr){switch(this._point){case 0:{this._context.moveTo(Ve,lr),this._point=1;break}case 1:{this._context.lineTo(Ve,lr);break}default:{this._context.moveTo(Ve+this._radius,lr),this._context.arc(Ve,lr,this._radius,0,s);break}}},result:I};var pc=E(),gu,Pl,Wc,$u,dc,rl={point:I,lineStart:function(){rl.point=oh},lineEnd:function(){gu&&Zc(Pl,Wc),rl.point=I},polygonStart:function(){gu=!0},polygonEnd:function(){gu=null},result:function(){var Ve=+pc;return pc.reset(),Ve}};function oh(Ve,lr){rl.point=Zc,Pl=$u=Ve,Wc=dc=lr}function Zc(Ve,lr){$u-=Ve,dc-=lr,pc.add(u($u*$u+dc*dc)),$u=Ve,dc=lr}function Lc(){this._string=[]}Lc.prototype={_radius:4.5,_circle:Ju(4.5),pointRadius:function(Ve){return(Ve=+Ve)!==this._radius&&(this._radius=Ve,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(Ve,lr){switch(this._point){case 0:{this._string.push("M",Ve,",",lr),this._point=1;break}case 1:{this._string.push("L",Ve,",",lr);break}default:{this._circle==null&&(this._circle=Ju(this._radius)),this._string.push("M",Ve,",",lr,this._circle);break}}},result:function(){if(this._string.length){var Ve=this._string.join("");return this._string=[],Ve}else return null}};function Ju(Ve){return"m0,"+Ve+"a"+Ve+","+Ve+" 0 1,1 0,"+-2*Ve+"a"+Ve+","+Ve+" 0 1,1 0,"+2*Ve+"z"}function Cc(Ve,lr){var Ur=4.5,Or,un;function Ln(Gn){return Gn&&(typeof Ur=="function"&&un.pointRadius(+Ur.apply(this,arguments)),N(Gn,Or(un))),un.result()}return Ln.area=function(Gn){return N(Gn,Or(Ro)),Ro.result()},Ln.measure=function(Gn){return N(Gn,Or(rl)),rl.result()},Ln.bounds=function(Gn){return N(Gn,Or(El)),El.result()},Ln.centroid=function(Gn){return N(Gn,Or($o)),$o.result()},Ln.projection=function(Gn){return arguments.length?(Or=Gn==null?(Ve=null,ms):(Ve=Gn).stream,Ln):Ve},Ln.context=function(Gn){return arguments.length?(un=Gn==null?(lr=null,new Lc):new io(lr=Gn),typeof Ur!="function"&&un.pointRadius(Ur),Ln):lr},Ln.pointRadius=function(Gn){return arguments.length?(Ur=typeof Gn=="function"?Gn:(un.pointRadius(+Gn),+Gn),Ln):Ur},Ln.projection(Ve).context(lr)}function Xc(Ve){return{stream:mu(Ve)}}function mu(Ve){return function(lr){var Ur=new $c;for(var Or in Ve)Ur[Or]=Ve[Or];return Ur.stream=lr,Ur}}function $c(){}$c.prototype={constructor:$c,point:function(Ve,lr){this.stream.point(Ve,lr)},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()}};function nc(Ve,lr,Ur){var Or=Ve.clipExtent&&Ve.clipExtent();return Ve.scale(150).translate([0,0]),Or!=null&&Ve.clipExtent(null),N(Ur,Ve.stream(El)),lr(El.result()),Or!=null&&Ve.clipExtent(Or),Ve}function vu(Ve,lr,Ur){return nc(Ve,function(Or){var un=lr[1][0]-lr[0][0],Ln=lr[1][1]-lr[0][1],Gn=Math.min(un/(Or[1][0]-Or[0][0]),Ln/(Or[1][1]-Or[0][1])),oa=+lr[0][0]+(un-Gn*(Or[1][0]+Or[0][0]))/2,ya=+lr[0][1]+(Ln-Gn*(Or[1][1]+Or[0][1]))/2;Ve.scale(150*Gn).translate([oa,ya])},Ur)}function Gl(Ve,lr,Ur){return vu(Ve,[[0,0],lr],Ur)}function yc(Ve,lr,Ur){return nc(Ve,function(Or){var un=+lr,Ln=un/(Or[1][0]-Or[0][0]),Gn=(un-Ln*(Or[1][0]+Or[0][0]))/2,oa=-Ln*Or[0][1];Ve.scale(150*Ln).translate([Gn,oa])},Ur)}function Jc(Ve,lr,Ur){return nc(Ve,function(Or){var un=+lr,Ln=un/(Or[1][1]-Or[0][1]),Gn=-Ln*Or[0][0],oa=(un-Ln*(Or[1][1]+Or[0][1]))/2;Ve.scale(150*Ln).translate([Gn,oa])},Ur)}var ps=16,Dc=l(30*v);function Fh(Ve,lr){return+lr?xc(Ve,lr):sh(Ve)}function sh(Ve){return mu({point:function(lr,Ur){lr=Ve(lr,Ur),this.stream.point(lr[0],lr[1])}})}function xc(Ve,lr){function Ur(Or,un,Ln,Gn,oa,ya,Pa,Jn,va,sa,qn,Fa,Fi,Ei){var Ni=Pa-Or,Hi=Jn-un,Ba=Ni*Ni+Hi*Hi;if(Ba>4*lr&&Fi--){var ba=Gn+sa,$i=oa+qn,So=ya+Fa,Jo=u(ba*ba+$i*$i+So*So),As=_(So/=Jo),os=m(m(So)-1)<r||m(Ln-va)<r?(Ln+va)/2:y($i,ba),xs=Ve(os,As),No=xs[0],Qs=xs[1],Hs=No-Or,Ms=Qs-un,ni=Hi*Hs-Ni*Ms;(ni*ni/Ba>lr||m((Ni*Hs+Hi*Ms)/Ba-.5)>.3||Gn*sa+oa*qn+ya*Fa<Dc)&&(Ur(Or,un,Ln,Gn,oa,ya,No,Qs,os,ba/=Jo,$i/=Jo,So,Fi,Ei),Ei.point(No,Qs),Ur(No,Qs,os,ba,$i,So,Pa,Jn,va,sa,qn,Fa,Fi,Ei))}}return function(Or){var un,Ln,Gn,oa,ya,Pa,Jn,va,sa,qn,Fa,Fi,Ei={point:Ni,lineStart:Hi,lineEnd:ba,polygonStart:function(){Or.polygonStart(),Ei.lineStart=$i},polygonEnd:function(){Or.polygonEnd(),Ei.lineStart=Hi}};function Ni(As,os){As=Ve(As,os),Or.point(As[0],As[1])}function Hi(){va=NaN,Ei.point=Ba,Or.lineStart()}function Ba(As,os){var xs=it([As,os]),No=Ve(As,os);Ur(va,sa,Jn,qn,Fa,Fi,va=No[0],sa=No[1],Jn=As,qn=xs[0],Fa=xs[1],Fi=xs[2],ps,Or),Or.point(va,sa)}function ba(){Ei.point=Ni,Or.lineEnd()}function $i(){Hi(),Ei.point=So,Ei.lineEnd=Jo}function So(As,os){Ba(un=As,os),Ln=va,Gn=sa,oa=qn,ya=Fa,Pa=Fi,Ei.point=Ba}function Jo(){Ur(va,sa,Jn,qn,Fa,Fi,Ln,Gn,un,oa,ya,Pa,ps,Or),Ei.lineEnd=ba,ba()}return Ei}}var lh=mu({point:function(Ve,lr){this.stream.point(Ve*v,lr*v)}});function Wl(Ve){return mu({point:function(lr,Ur){var Or=Ve(lr,Ur);return this.stream.point(Or[0],Or[1])}})}function uh(Ve,lr,Ur,Or,un){function Ln(Gn,oa){return Gn*=Or,oa*=un,[lr+Ve*Gn,Ur-Ve*oa]}return Ln.invert=function(Gn,oa){return[(Gn-lr)/Ve*Or,(Ur-oa)/Ve*un]},Ln}function Il(Ve,lr,Ur,Or,un,Ln){var Gn=l(Ln),oa=M(Ln),ya=Gn*Ve,Pa=oa*Ve,Jn=Gn/Ve,va=oa/Ve,sa=(oa*Ur-Gn*lr)/Ve,qn=(oa*lr+Gn*Ur)/Ve;function Fa(Fi,Ei){return Fi*=Or,Ei*=un,[ya*Fi-Pa*Ei+lr,Ur-Pa*Fi-ya*Ei]}return Fa.invert=function(Fi,Ei){return[Or*(Jn*Fi-va*Ei+sa),un*(qn-va*Fi-Jn*Ei)]},Fa}function Zl(Ve){return Ru(function(){return Ve})()}function Ru(Ve){var lr,Ur=150,Or=480,un=250,Ln=0,Gn=0,oa=0,ya=0,Pa=0,Jn,va=0,sa=1,qn=1,Fa=null,Fi=yr,Ei=null,Ni,Hi,Ba,ba=ms,$i=.5,So,Jo,As,os,xs;function No(ni){return As(ni[0]*v,ni[1]*v)}function Qs(ni){return ni=As.invert(ni[0],ni[1]),ni&&[ni[0]*h,ni[1]*h]}No.stream=function(ni){return os&&xs===ni?os:os=lh(Wl(Jn)(Fi(So(ba(xs=ni)))))},No.preclip=function(ni){return arguments.length?(Fi=ni,Fa=void 0,Ms()):Fi},No.postclip=function(ni){return arguments.length?(ba=ni,Ei=Ni=Hi=Ba=null,Ms()):ba},No.clipAngle=function(ni){return arguments.length?(Fi=+ni?dn(Fa=ni*v):(Fa=null,yr),Ms()):Fa*h},No.clipExtent=function(ni){return arguments.length?(ba=ni==null?(Ei=Ni=Hi=Ba=null,ms):Qn(Ei=+ni[0][0],Ni=+ni[0][1],Hi=+ni[1][0],Ba=+ni[1][1]),Ms()):Ei==null?null:[[Ei,Ni],[Hi,Ba]]},No.scale=function(ni){return arguments.length?(Ur=+ni,Hs()):Ur},No.translate=function(ni){return arguments.length?(Or=+ni[0],un=+ni[1],Hs()):[Or,un]},No.center=function(ni){return arguments.length?(Ln=ni[0]%360*v,Gn=ni[1]%360*v,Hs()):[Ln*h,Gn*h]},No.rotate=function(ni){return arguments.length?(oa=ni[0]%360*v,ya=ni[1]%360*v,Pa=ni.length>2?ni[2]%360*v:0,Hs()):[oa*h,ya*h,Pa*h]},No.angle=function(ni){return arguments.length?(va=ni%360*v,Hs()):va*h},No.reflectX=function(ni){return arguments.length?(sa=ni?-1:1,Hs()):sa<0},No.reflectY=function(ni){return arguments.length?(qn=ni?-1:1,Hs()):qn<0},No.precision=function(ni){return arguments.length?(So=Fh(Jo,$i=ni*ni),Ms()):u($i)},No.fitExtent=function(ni,to){return vu(No,ni,to)},No.fitSize=function(ni,to){return Gl(No,ni,to)},No.fitWidth=function(ni,to){return yc(No,ni,to)},No.fitHeight=function(ni,to){return Jc(No,ni,to)};function Hs(){var ni=Il(Ur,0,0,sa,qn,va).apply(null,lr(Ln,Gn)),to=(va?Il:uh)(Ur,Or-ni[0],un-ni[1],sa,qn,va);return Jn=_n(oa,ya,Pa),Jo=rn(lr,to),As=rn(Jn,Jo),So=Fh(Jo,$i),Ms()}function Ms(){return os=xs=null,No}return function(){return lr=Ve.apply(this,arguments),No.invert=lr.invert&&Qs,Hs()}}function Xs(Ve){var lr=0,Ur=n/3,Or=Ru(Ve),un=Or(lr,Ur);return un.parallels=function(Ln){return arguments.length?Or(lr=Ln[0]*v,Ur=Ln[1]*v):[lr*h,Ur*h]},un}function Qu(Ve){var lr=l(Ve);function Ur(Or,un){return[Or*lr,M(un)/lr]}return Ur.invert=function(Or,un){return[Or/lr,_(un*lr)]},Ur}function yu(Ve,lr){var Ur=M(Ve),Or=(Ur+M(lr))/2;if(m(Or)<r)return Qu(Ve);var un=1+Ur*(2*Or-Ur),Ln=u(un)/Or;function Gn(oa,ya){var Pa=u(un-2*Or*M(ya))/Or;return[Pa*M(oa*=Or),Ln-Pa*l(oa)]}return Gn.invert=function(oa,ya){var Pa=Ln-ya,Jn=y(oa,m(Pa))*w(Pa);return Pa*Or<0&&(Jn-=n*w(oa)*w(Pa)),[Jn/Or,_((un-(oa*oa+Pa*Pa)*Or*Or)/(2*Or))]},Gn}function Xl(){return Xs(yu).scale(155.424).center([0,33.6442])}function Ds(){return Xl().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function gc(Ve){var lr=Ve.length;return{point:function(Ur,Or){for(var un=-1;++un<lr;)Ve[un].point(Ur,Or)},sphere:function(){for(var Ur=-1;++Ur<lr;)Ve[Ur].sphere()},lineStart:function(){for(var Ur=-1;++Ur<lr;)Ve[Ur].lineStart()},lineEnd:function(){for(var Ur=-1;++Ur<lr;)Ve[Ur].lineEnd()},polygonStart:function(){for(var Ur=-1;++Ur<lr;)Ve[Ur].polygonStart()},polygonEnd:function(){for(var Ur=-1;++Ur<lr;)Ve[Ur].polygonEnd()}}}function Su(){var Ve,lr,Ur=Ds(),Or,un=Xl().rotate([154,0]).center([-2,58.5]).parallels([55,65]),Ln,Gn=Xl().rotate([157,0]).center([-3,19.9]).parallels([8,18]),oa,ya,Pa={point:function(sa,qn){ya=[sa,qn]}};function Jn(sa){var qn=sa[0],Fa=sa[1];return ya=null,Or.point(qn,Fa),ya||(Ln.point(qn,Fa),ya)||(oa.point(qn,Fa),ya)}Jn.invert=function(sa){var qn=Ur.scale(),Fa=Ur.translate(),Fi=(sa[0]-Fa[0])/qn,Ei=(sa[1]-Fa[1])/qn;return(Ei>=.12&&Ei<.234&&Fi>=-.425&&Fi<-.214?un:Ei>=.166&&Ei<.234&&Fi>=-.214&&Fi<-.115?Gn:Ur).invert(sa)},Jn.stream=function(sa){return Ve&&lr===sa?Ve:Ve=gc([Ur.stream(lr=sa),un.stream(sa),Gn.stream(sa)])},Jn.precision=function(sa){return arguments.length?(Ur.precision(sa),un.precision(sa),Gn.precision(sa),va()):Ur.precision()},Jn.scale=function(sa){return arguments.length?(Ur.scale(sa),un.scale(sa*.35),Gn.scale(sa),Jn.translate(Ur.translate())):Ur.scale()},Jn.translate=function(sa){if(!arguments.length)return Ur.translate();var qn=Ur.scale(),Fa=+sa[0],Fi=+sa[1];return Or=Ur.translate(sa).clipExtent([[Fa-.455*qn,Fi-.238*qn],[Fa+.455*qn,Fi+.238*qn]]).stream(Pa),Ln=un.translate([Fa-.307*qn,Fi+.201*qn]).clipExtent([[Fa-.425*qn+r,Fi+.12*qn+r],[Fa-.214*qn-r,Fi+.234*qn-r]]).stream(Pa),oa=Gn.translate([Fa-.205*qn,Fi+.212*qn]).clipExtent([[Fa-.214*qn+r,Fi+.166*qn+r],[Fa-.115*qn-r,Fi+.234*qn-r]]).stream(Pa),va()},Jn.fitExtent=function(sa,qn){return vu(Jn,sa,qn)},Jn.fitSize=function(sa,qn){return Gl(Jn,sa,qn)},Jn.fitWidth=function(sa,qn){return yc(Jn,sa,qn)},Jn.fitHeight=function(sa,qn){return Jc(Jn,sa,qn)};function va(){return Ve=lr=null,Jn}return Jn.scale(1070)}function Yu(Ve){return function(lr,Ur){var Or=l(lr),un=l(Ur),Ln=Ve(Or*un);return[Ln*un*M(lr),Ln*M(Ur)]}}function _c(Ve){return function(lr,Ur){var Or=u(lr*lr+Ur*Ur),un=Ve(Or),Ln=M(un),Gn=l(un);return[y(lr*Ln,Or*Gn),_(Or&&Ur*Ln/Or)]}}var bh=Yu(function(Ve){return u(2/(1+Ve))});bh.invert=_c(function(Ve){return 2*_(Ve/2)});function Zh(){return Zl(bh).scale(124.75).clipAngle(180-.001)}var ac=Yu(function(Ve){return(Ve=k(Ve))&&Ve/M(Ve)});ac.invert=_c(function(Ve){return Ve});function bc(){return Zl(ac).scale(79.4188).clipAngle(180-.001)}function Ll(Ve,lr){return[Ve,S(f((o+lr)/2))]}Ll.invert=function(Ve,lr){return[Ve,2*p(b(lr))-o]};function zc(){return $l(Ll).scale(961/s)}function $l(Ve){var lr=Zl(Ve),Ur=lr.center,Or=lr.scale,un=lr.translate,Ln=lr.clipExtent,Gn=null,oa,ya,Pa;lr.scale=function(va){return arguments.length?(Or(va),Jn()):Or()},lr.translate=function(va){return arguments.length?(un(va),Jn()):un()},lr.center=function(va){return arguments.length?(Ur(va),Jn()):Ur()},lr.clipExtent=function(va){return arguments.length?(va==null?Gn=oa=ya=Pa=null:(Gn=+va[0][0],oa=+va[0][1],ya=+va[1][0],Pa=+va[1][1]),Jn()):Gn==null?null:[[Gn,oa],[ya,Pa]]};function Jn(){var va=n*Or(),sa=lr(Bn(lr.rotate()).invert([0,0]));return Ln(Gn==null?[[sa[0]-va,sa[1]-va],[sa[0]+va,sa[1]+va]]:Ve===Ll?[[Math.max(sa[0]-va,Gn),oa],[Math.min(sa[0]+va,ya),Pa]]:[[Gn,Math.max(sa[1]-va,oa)],[ya,Math.min(sa[1]+va,Pa)]])}return Jn()}function ic(Ve){return f((o+Ve)/2)}function Oc(Ve,lr){var Ur=l(Ve),Or=Ve===lr?M(Ve):S(Ur/l(lr))/S(ic(lr)/ic(Ve)),un=Ur*T(ic(Ve),Or)/Or;if(!Or)return Ll;function Ln(Gn,oa){un>0?oa<-o+r&&(oa=-o+r):oa>o-r&&(oa=o-r);var ya=un/T(ic(oa),Or);return[ya*M(Or*Gn),un-ya*l(Or*Gn)]}return Ln.invert=function(Gn,oa){var ya=un-oa,Pa=w(Or)*u(Gn*Gn+ya*ya),Jn=y(Gn,m(ya))*w(ya);return ya*Or<0&&(Jn-=n*w(Gn)*w(ya)),[Jn/Or,2*p(T(un/Pa,1/Or))-o]},Ln}function Ku(){return Xs(Oc).scale(109.5).parallels([30,30])}function Os(Ve,lr){return[Ve,lr]}Os.invert=Os;function Eu(){return Zl(Os).scale(152.63)}function Jl(Ve,lr){var Ur=l(Ve),Or=Ve===lr?M(Ve):(Ur-l(lr))/(lr-Ve),un=Ur/Or+Ve;if(m(Or)<r)return Os;function Ln(Gn,oa){var ya=un-oa,Pa=Or*Gn;return[ya*M(Pa),un-ya*l(Pa)]}return Ln.invert=function(Gn,oa){var ya=un-oa,Pa=y(Gn,m(ya))*w(ya);return ya*Or<0&&(Pa-=n*w(Gn)*w(ya)),[Pa/Or,un-w(Or)*u(Gn*Gn+ya*ya)]},Ln}function ch(){return Xs(Jl).scale(131.154).center([0,13.9389])}var Ps=1.340264,mc=-.081106,ju=893e-6,Ql=.003796,oc=u(3)/2,Nu=12;function vc(Ve,lr){var Ur=_(oc*M(lr)),Or=Ur*Ur,un=Or*Or*Or;return[Ve*l(Ur)/(oc*(Ps+3*mc*Or+un*(7*ju+9*Ql*Or))),Ur*(Ps+mc*Or+un*(ju+Ql*Or))]}vc.invert=function(Ve,lr){for(var Ur=lr,Or=Ur*Ur,un=Or*Or*Or,Ln=0,Gn,oa,ya;Ln<Nu&&(oa=Ur*(Ps+mc*Or+un*(ju+Ql*Or))-lr,ya=Ps+3*mc*Or+un*(7*ju+9*Ql*Or),Ur-=Gn=oa/ya,Or=Ur*Ur,un=Or*Or*Or,!(m(Gn)<i));++Ln);return[oc*Ve*(Ps+3*mc*Or+un*(7*ju+9*Ql*Or))/l(Ur),_(M(Ur)/oc)]};function wh(){return Zl(vc).scale(177.158)}function cl(Ve,lr){var Ur=l(lr),Or=l(Ve)*Ur;return[Ur*M(Ve)/Or,M(lr)/Or]}cl.invert=_c(p);function Qc(){return Zl(cl).scale(144.049).clipAngle(60)}function Yl(){var Ve=1,lr=0,Ur=0,Or=1,un=1,Ln=0,Gn,oa,ya=null,Pa,Jn,va,sa=1,qn=1,Fa=mu({point:function(ba,$i){var So=Ba([ba,$i]);this.stream.point(So[0],So[1])}}),Fi=ms,Ei,Ni;function Hi(){return sa=Ve*Or,qn=Ve*un,Ei=Ni=null,Ba}function Ba(ba){var $i=ba[0]*sa,So=ba[1]*qn;if(Ln){var Jo=So*Gn-$i*oa;$i=$i*Gn+So*oa,So=Jo}return[$i+lr,So+Ur]}return Ba.invert=function(ba){var $i=ba[0]-lr,So=ba[1]-Ur;if(Ln){var Jo=So*Gn+$i*oa;$i=$i*Gn-So*oa,So=Jo}return[$i/sa,So/qn]},Ba.stream=function(ba){return Ei&&Ni===ba?Ei:Ei=Fa(Fi(Ni=ba))},Ba.postclip=function(ba){return arguments.length?(Fi=ba,ya=Pa=Jn=va=null,Hi()):Fi},Ba.clipExtent=function(ba){return arguments.length?(Fi=ba==null?(ya=Pa=Jn=va=null,ms):Qn(ya=+ba[0][0],Pa=+ba[0][1],Jn=+ba[1][0],va=+ba[1][1]),Hi()):ya==null?null:[[ya,Pa],[Jn,va]]},Ba.scale=function(ba){return arguments.length?(Ve=+ba,Hi()):Ve},Ba.translate=function(ba){return arguments.length?(lr=+ba[0],Ur=+ba[1],Hi()):[lr,Ur]},Ba.angle=function(ba){return arguments.length?(Ln=ba%360*v,oa=M(Ln),Gn=l(Ln),Hi()):Ln*h},Ba.reflectX=function(ba){return arguments.length?(Or=ba?-1:1,Hi()):Or<0},Ba.reflectY=function(ba){return arguments.length?(un=ba?-1:1,Hi()):un<0},Ba.fitExtent=function(ba,$i){return vu(Ba,ba,$i)},Ba.fitSize=function(ba,$i){return Gl(Ba,ba,$i)},Ba.fitWidth=function(ba,$i){return yc(Ba,ba,$i)},Ba.fitHeight=function(ba,$i){return Jc(Ba,ba,$i)},Ba}function Pu(Ve,lr){var Ur=lr*lr,Or=Ur*Ur;return[Ve*(.8707-.131979*Ur+Or*(-.013791+Or*(.003971*Ur-.001529*Or))),lr*(1.007226+Ur*(.015085+Or*(-.044475+.028874*Ur-.005916*Or)))]}Pu.invert=function(Ve,lr){var Ur=lr,Or=25,un;do{var Ln=Ur*Ur,Gn=Ln*Ln;Ur-=un=(Ur*(1.007226+Ln*(.015085+Gn*(-.044475+.028874*Ln-.005916*Gn)))-lr)/(1.007226+Ln*(.015085*3+Gn*(-.044475*7+.028874*9*Ln-.005916*11*Gn)))}while(m(un)>r&&--Or>0);return[Ve/(.8707+(Ln=Ur*Ur)*(-.131979+Ln*(-.013791+Ln*Ln*Ln*(.003971-.001529*Ln)))),Ur]};function xu(){return Zl(Pu).scale(175.295)}function Vs(Ve,lr){return[l(lr)*M(Ve),M(lr)]}Vs.invert=_c(_);function qs(){return Zl(Vs).scale(249.5).clipAngle(90+r)}function Iu(Ve,lr){var Ur=l(lr),Or=1+l(Ve)*Ur;return[Ur*M(Ve)/Or,M(lr)/Or]}Iu.invert=_c(function(Ve){return 2*p(Ve)});function sc(){return Zl(Iu).scale(250).clipAngle(142)}function _u(Ve,lr){return[S(f((o+lr)/2)),-Ve]}_u.invert=function(Ve,lr){return[-lr,2*p(b(Ve))-o]};function wc(){var Ve=$l(_u),lr=Ve.center,Ur=Ve.rotate;return Ve.center=function(Or){return arguments.length?lr([-Or[1],Or[0]]):(Or=lr(),[Or[1],-Or[0]])},Ve.rotate=function(Or){return arguments.length?Ur([Or[0],Or[1],Or.length>2?Or[2]+90:90]):(Or=Ur(),[Or[0],Or[1],Or[2]-90])},Ur([0,0,90]).scale(159.155)}c.geoAlbers=Ds,c.geoAlbersUsa=Su,c.geoArea=q,c.geoAzimuthalEqualArea=Zh,c.geoAzimuthalEqualAreaRaw=bh,c.geoAzimuthalEquidistant=bc,c.geoAzimuthalEquidistantRaw=ac,c.geoBounds=Dt,c.geoCentroid=_r,c.geoCircle=Pr,c.geoClipAntimeridian=yr,c.geoClipCircle=dn,c.geoClipExtent=Va,c.geoClipRectangle=Qn,c.geoConicConformal=Ku,c.geoConicConformalRaw=Oc,c.geoConicEqualArea=Xl,c.geoConicEqualAreaRaw=yu,c.geoConicEquidistant=ch,c.geoConicEquidistantRaw=Jl,c.geoContains=Xi,c.geoDistance=Si,c.geoEqualEarth=wh,c.geoEqualEarthRaw=vc,c.geoEquirectangular=Eu,c.geoEquirectangularRaw=Os,c.geoGnomonic=Qc,c.geoGnomonicRaw=cl,c.geoGraticule=Ls,c.geoGraticule10=fs,c.geoIdentity=Yl,c.geoInterpolate=qi,c.geoLength=Bo,c.geoMercator=zc,c.geoMercatorRaw=Ll,c.geoNaturalEarth1=xu,c.geoNaturalEarth1Raw=Pu,c.geoOrthographic=qs,c.geoOrthographicRaw=Vs,c.geoPath=Cc,c.geoProjection=Zl,c.geoProjectionMutator=Ru,c.geoRotation=Bn,c.geoStereographic=sc,c.geoStereographicRaw=Iu,c.geoStream=N,c.geoTransform=Xc,c.geoTransverseMercator=wc,c.geoTransverseMercatorRaw=_u,Object.defineProperty(c,"__esModule",{value:!0})})}),t8=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X,A3(),Sv()):g(c.d3=c.d3||{},c.d3,c.d3)})(X,function(c,g,E){var A=Math.abs,t=Math.atan,e=Math.atan2,r=Math.cos,i=Math.exp,n=Math.floor,o=Math.log,a=Math.max,s=Math.min,h=Math.pow,v=Math.round,m=Math.sign||function(Rt){return Rt>0?1:Rt<0?-1:0},p=Math.sin,y=Math.tan,l=1e-6,x=1e-12,b=Math.PI,S=b/2,T=b/4,M=Math.SQRT1_2,w=B(2),u=B(b),f=b*2,k=180/b,_=b/180;function D(Rt){return Rt?Rt/Math.sin(Rt):1}function I(Rt){return Rt>1?S:Rt<-1?-S:Math.asin(Rt)}function O(Rt){return Rt>1?0:Rt<-1?b:Math.acos(Rt)}function B(Rt){return Rt>0?Math.sqrt(Rt):0}function R(Rt){return Rt=i(2*Rt),(Rt-1)/(Rt+1)}function L(Rt){return(i(Rt)-i(-Rt))/2}function F(Rt){return(i(Rt)+i(-Rt))/2}function N(Rt){return o(Rt+B(Rt*Rt+1))}function j(Rt){return o(Rt+B(Rt*Rt-1))}function G(Rt){var Gt=y(Rt/2),ne=2*o(r(Rt/2))/(Gt*Gt);function oe(be,pe){var Ae=r(be),Xe=r(pe),nr=p(pe),or=Xe*Ae,Tr=-((1-or?o((1+or)/2)/(1-or):-.5)+ne/(1+or));return[Tr*Xe*p(be),Tr*nr]}return oe.invert=function(be,pe){var Ae=B(be*be+pe*pe),Xe=-Rt/2,nr=50,or;if(!Ae)return[0,0];do{var Tr=Xe/2,Rr=r(Tr),Qr=p(Tr),nn=Qr/Rr,mn=-o(A(Rr));Xe-=or=(2/nn*mn-ne*nn-Ae)/(-mn/(Qr*Qr)+1-ne/(2*Rr*Rr))*(Rr<0?.7:1)}while(A(or)>l&&--nr>0);var zn=p(Xe);return[e(be*zn,Ae*r(Xe)),I(pe*zn/Ae)]},oe}function rt(){var Rt=S,Gt=g.geoProjectionMutator(G),ne=Gt(Rt);return ne.radius=function(oe){return arguments.length?Gt(Rt=oe*_):Rt*k},ne.scale(179.976).clipAngle(147)}function ct(Rt,Gt){var ne=r(Gt),oe=D(O(ne*r(Rt/=2)));return[2*ne*p(Rt)*oe,p(Gt)*oe]}ct.invert=function(Rt,Gt){if(!(Rt*Rt+4*Gt*Gt>b*b+l)){var ne=Rt,oe=Gt,be=25;do{var pe=p(ne),Ae=p(ne/2),Xe=r(ne/2),nr=p(oe),or=r(oe),Tr=p(2*oe),Rr=nr*nr,Qr=or*or,nn=Ae*Ae,mn=1-Qr*Xe*Xe,zn=mn?O(or*Xe)*B(na=1/mn):na=0,na,Yn=2*zn*or*Ae-Rt,la=zn*nr-Gt,Na=na*(Qr*nn+zn*or*Xe*Rr),li=na*(.5*pe*Tr-zn*2*nr*Ae),Ka=na*.25*(Tr*Ae-zn*nr*Qr*pe),Gi=na*(Rr*Xe+zn*nn*or),jo=li*Ka-Gi*Na;if(!jo)break;var Uo=(la*li-Yn*Gi)/jo,ho=(Yn*Ka-la*Na)/jo;ne-=Uo,oe-=ho}while((A(Uo)>l||A(ho)>l)&&--be>0);return[ne,oe]}};function lt(){return g.geoProjection(ct).scale(152.63)}function tt(Rt){var Gt=p(Rt),ne=r(Rt),oe=Rt>=0?1:-1,be=y(oe*Rt),pe=(1+Gt-ne)/2;function Ae(Xe,nr){var or=r(nr),Tr=r(Xe/=2);return[(1+or)*p(Xe),(oe*nr>-e(Tr,be)-.001?0:-oe*10)+pe+p(nr)*ne-(1+or)*Gt*Tr]}return Ae.invert=function(Xe,nr){var or=0,Tr=0,Rr=50;do{var Qr=r(or),nn=p(or),mn=r(Tr),zn=p(Tr),na=1+mn,Yn=na*nn-Xe,la=pe+zn*ne-na*Gt*Qr-nr,Na=na*Qr/2,li=-nn*zn,Ka=Gt*na*nn/2,Gi=ne*mn+Gt*Qr*zn,jo=li*Ka-Gi*Na,Uo=(la*li-Yn*Gi)/jo/2,ho=(Yn*Ka-la*Na)/jo;A(ho)>2&&(ho/=2),or-=Uo,Tr-=ho}while((A(Uo)>l||A(ho)>l)&&--Rr>0);return oe*Tr>-e(r(or),be)-.001?[or*2,Tr]:null},Ae}function Z(){var Rt=20*_,Gt=Rt>=0?1:-1,ne=y(Gt*Rt),oe=g.geoProjectionMutator(tt),be=oe(Rt),pe=be.stream;return be.parallel=function(Ae){return arguments.length?(ne=y((Gt=(Rt=Ae*_)>=0?1:-1)*Rt),oe(Rt)):Rt*k},be.stream=function(Ae){var Xe=be.rotate(),nr=pe(Ae),or=(be.rotate([0,0]),pe(Ae)),Tr=be.precision();return be.rotate(Xe),nr.sphere=function(){or.polygonStart(),or.lineStart();for(var Rr=Gt*-180;Gt*Rr<180;Rr+=Gt*90)or.point(Rr,Gt*90);if(Rt)for(;Gt*(Rr-=3*Gt*Tr)>=-180;)or.point(Rr,Gt*-e(r(Rr*_/2),ne)*k);or.lineEnd(),or.polygonEnd()},nr},be.scale(218.695).center([0,28.0974])}function st(Rt,Gt){var ne=y(Gt/2),oe=B(1-ne*ne),be=1+oe*r(Rt/=2),pe=p(Rt)*oe/be,Ae=ne/be,Xe=pe*pe,nr=Ae*Ae;return[4/3*pe*(3+Xe-3*nr),4/3*Ae*(3+3*Xe-nr)]}st.invert=function(Rt,Gt){if(Rt*=3/8,Gt*=3/8,!Rt&&A(Gt)>1)return null;var ne=Rt*Rt,oe=Gt*Gt,be=1+ne+oe,pe=B((be-B(be*be-4*Gt*Gt))/2),Ae=I(pe)/3,Xe=pe?j(A(Gt/pe))/3:N(A(Rt))/3,nr=r(Ae),or=F(Xe),Tr=or*or-nr*nr;return[m(Rt)*2*e(L(Xe)*nr,.25-Tr),m(Gt)*2*e(or*p(Ae),.25+Tr)]};function $(){return g.geoProjection(st).scale(66.1603)}var Q=B(8),nt=o(1+w);function Y(Rt,Gt){var ne=A(Gt);return ne<T?[Rt,o(y(T+Gt/2))]:[Rt*r(ne)*(2*w-1/p(ne)),m(Gt)*(2*w*(ne-T)-o(y(ne/2)))]}Y.invert=function(Rt,Gt){if((pe=A(Gt))<nt)return[Rt,2*t(i(Gt))-S];var ne=T,oe=25,be,pe;do{var Ae=r(ne/2),Xe=y(ne/2);ne-=be=(Q*(ne-T)-o(Xe)-pe)/(Q-Ae*Ae/(2*Xe))}while(A(be)>x&&--oe>0);return[Rt/(r(ne)*(Q-1/p(ne))),m(Gt)*ne]};function q(){return g.geoProjection(Y).scale(112.314)}function ot(Rt){var Gt=2*b/Rt;function ne(oe,be){var pe=g.geoAzimuthalEquidistantRaw(oe,be);if(A(oe)>S){var Ae=e(pe[1],pe[0]),Xe=B(pe[0]*pe[0]+pe[1]*pe[1]),nr=Gt*v((Ae-S)/Gt)+S,or=e(p(Ae-=nr),2-r(Ae));Ae=nr+I(b/Xe*p(or))-or,pe[0]=Xe*r(Ae),pe[1]=Xe*p(Ae)}return pe}return ne.invert=function(oe,be){var pe=B(oe*oe+be*be);if(pe>S){var Ae=e(be,oe),Xe=Gt*v((Ae-S)/Gt)+S,nr=Ae>Xe?-1:1,or=pe*r(Xe-Ae),Tr=1/y(nr*O((or-b)/B(b*(b-2*or)+pe*pe)));Ae=Xe+2*t((Tr+nr*B(Tr*Tr-3))/3),oe=pe*r(Ae),be=pe*p(Ae)}return g.geoAzimuthalEquidistantRaw.invert(oe,be)},ne}function it(){var Rt=5,Gt=g.geoProjectionMutator(ot),ne=Gt(Rt),oe=ne.stream,be=.01,pe=-r(be*_),Ae=p(be*_);return ne.lobes=function(Xe){return arguments.length?Gt(Rt=+Xe):Rt},ne.stream=function(Xe){var nr=ne.rotate(),or=oe(Xe),Tr=(ne.rotate([0,0]),oe(Xe));return ne.rotate(nr),or.sphere=function(){Tr.polygonStart(),Tr.lineStart();for(var Rr=0,Qr=360/Rt,nn=2*b/Rt,mn=90-180/Rt,zn=S;Rr<Rt;++Rr,mn-=Qr,zn-=nn)Tr.point(e(Ae*r(zn),pe)*k,I(Ae*p(zn))*k),mn<-90?(Tr.point(-90,-180-mn-be),Tr.point(-90,-180-mn+be)):(Tr.point(90,mn+be),Tr.point(90,mn-be));Tr.lineEnd(),Tr.polygonEnd()},or},ne.scale(87.8076).center([0,17.1875]).clipAngle(180-.001)}function dt(Rt,Gt){if(arguments.length<2&&(Gt=Rt),Gt===1)return g.geoAzimuthalEqualAreaRaw;if(Gt===1/0)return wt;function ne(oe,be){var pe=g.geoAzimuthalEqualAreaRaw(oe/Gt,be);return pe[0]*=Rt,pe}return ne.invert=function(oe,be){var pe=g.geoAzimuthalEqualAreaRaw.invert(oe/Rt,be);return pe[0]*=Gt,pe},ne}function wt(Rt,Gt){return[Rt*r(Gt)/r(Gt/=2),2*p(Gt)]}wt.invert=function(Rt,Gt){var ne=2*I(Gt/2);return[Rt*r(ne/2)/r(ne),ne]};function xt(){var Rt=2,Gt=g.geoProjectionMutator(dt),ne=Gt(Rt);return ne.coefficient=function(oe){return arguments.length?Gt(Rt=+oe):Rt},ne.scale(169.529)}function Ft(Rt,Gt,ne){var oe=100,be,pe,Ae;ne=ne===void 0?0:+ne,Gt=+Gt;do pe=Rt(ne),Ae=Rt(ne+l),pe===Ae&&(Ae=pe+l),ne-=be=-1*l*(pe-Gt)/(pe-Ae);while(oe-- >0&&A(be)>l);return oe<0?NaN:ne}function Et(Rt,Gt,ne){return Gt===void 0&&(Gt=40),ne===void 0&&(ne=x),function(oe,be,pe,Ae){var Xe,nr,or;pe=pe===void 0?0:+pe,Ae=Ae===void 0?0:+Ae;for(var Tr=0;Tr<Gt;Tr++){var Rr=Rt(pe,Ae),Qr=Rr[0]-oe,nn=Rr[1]-be;if(A(Qr)<ne&&A(nn)<ne)break;var mn=Qr*Qr+nn*nn;if(mn>Xe){pe-=nr/=2,Ae-=or/=2;continue}Xe=mn;var zn=(pe>0?-1:1)*ne,na=(Ae>0?-1:1)*ne,Yn=Rt(pe+zn,Ae),la=Rt(pe,Ae+na),Na=(Yn[0]-Rr[0])/zn,li=(Yn[1]-Rr[1])/zn,Ka=(la[0]-Rr[0])/na,Gi=(la[1]-Rr[1])/na,jo=Gi*Na-li*Ka,Uo=(A(jo)<.5?.5:1)/jo;if(nr=(nn*Ka-Qr*Gi)*Uo,or=(Qr*li-nn*Na)*Uo,pe+=nr,Ae+=or,A(nr)<ne&&A(or)<ne)break}return[pe,Ae]}}function Nt(){var Rt=dt(1.68,2),Gt=1.4,ne=12;function oe(be,pe){if(be+pe<-Gt){var Ae=(be-pe+1.6)*(be+pe+Gt)/8;be+=Ae,pe-=.8*Ae*p(pe+b/2)}var Xe=Rt(be,pe),nr=(1-r(be*pe))/ne;return Xe[1]<0&&(Xe[0]*=1+nr),Xe[1]>0&&(Xe[1]*=1+nr/1.5*Xe[0]*Xe[0]),Xe}return oe.invert=Et(oe),oe}function te(){return g.geoProjection(Nt()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function Jt(Rt,Gt){var ne=Rt*p(Gt),oe=30,be;do Gt-=be=(Gt+p(Gt)-ne)/(1+r(Gt));while(A(be)>l&&--oe>0);return Gt/2}function Qt(Rt,Gt,ne){function oe(be,pe){return[Rt*be*r(pe=Jt(ne,pe)),Gt*p(pe)]}return oe.invert=function(be,pe){return pe=I(pe/Gt),[be/(Rt*r(pe)),I((2*pe+p(2*pe))/ne)]},oe}var Wt=Qt(w/S,w,b);function gt(){return g.geoProjection(Wt).scale(169.529)}var bt=2.00276,vt=1.11072;function Ut(Rt,Gt){var ne=Jt(b,Gt);return[bt*Rt/(1/r(Gt)+vt/r(ne)),(Gt+w*p(ne))/bt]}Ut.invert=function(Rt,Gt){var ne=bt*Gt,oe=Gt<0?-T:T,be=25,pe,Ae;do Ae=ne-w*p(oe),oe-=pe=(p(2*oe)+2*oe-b*p(Ae))/(2*r(2*oe)+2+b*r(Ae)*w*r(oe));while(A(pe)>l&&--be>0);return Ae=ne-w*p(oe),[Rt*(1/r(Ae)+vt/r(oe))/bt,Ae]};function Kt(){return g.geoProjection(Ut).scale(160.857)}function Zt(Rt){var Gt=0,ne=g.geoProjectionMutator(Rt),oe=ne(Gt);return oe.parallel=function(be){return arguments.length?ne(Gt=be*_):Gt*k},oe}function le(Rt,Gt){return[Rt*r(Gt),Gt]}le.invert=function(Rt,Gt){return[Rt/r(Gt),Gt]};function Te(){return g.geoProjection(le).scale(152.63)}function Se(Rt){if(!Rt)return le;var Gt=1/y(Rt);function ne(oe,be){var pe=Gt+Rt-be,Ae=pe&&oe*r(be)/pe;return[pe*p(Ae),Gt-pe*r(Ae)]}return ne.invert=function(oe,be){var pe=B(oe*oe+(be=Gt-be)*be),Ae=Gt+Rt-pe;return[pe/r(Ae)*e(oe,be),Ae]},ne}function Fe(){return Zt(Se).scale(123.082).center([0,26.1441]).parallel(45)}function Oe(Rt){function Gt(ne,oe){var be=S-oe,pe=be&&ne*Rt*p(be)/be;return[be*p(pe)/Rt,S-be*r(pe)]}return Gt.invert=function(ne,oe){var be=ne*Rt,pe=S-oe,Ae=B(be*be+pe*pe),Xe=e(be,pe);return[(Ae?Ae/p(Ae):1)*Xe/Rt,S-Ae]},Gt}function ur(){var Rt=.5,Gt=g.geoProjectionMutator(Oe),ne=Gt(Rt);return ne.fraction=function(oe){return arguments.length?Gt(Rt=+oe):Rt},ne.scale(158.837)}var fr=Qt(1,4/b,b);function We(){return g.geoProjection(fr).scale(152.63)}function Lr(Rt,Gt,ne,oe,be,pe){var Ae=r(pe),Xe;if(A(Rt)>1||A(pe)>1)Xe=O(ne*be+Gt*oe*Ae);else{var nr=p(Rt/2),or=p(pe/2);Xe=2*I(B(nr*nr+Gt*oe*or*or))}return A(Xe)>l?[Xe,e(oe*p(pe),Gt*be-ne*oe*Ae)]:[0,0]}function kr(Rt,Gt,ne){return O((Rt*Rt+Gt*Gt-ne*ne)/(2*Rt*Gt))}function he(Rt){return Rt-2*b*n((Rt+b)/(2*b))}function Dt(Rt,Gt,ne){for(var oe=[[Rt[0],Rt[1],p(Rt[1]),r(Rt[1])],[Gt[0],Gt[1],p(Gt[1]),r(Gt[1])],[ne[0],ne[1],p(ne[1]),r(ne[1])]],be=oe[2],pe,Ae=0;Ae<3;++Ae,be=pe)pe=oe[Ae],be.v=Lr(pe[1]-be[1],be[3],be[2],pe[3],pe[2],pe[0]-be[0]),be.point=[0,0];var Xe=kr(oe[0].v[0],oe[2].v[0],oe[1].v[0]),nr=kr(oe[0].v[0],oe[1].v[0],oe[2].v[0]),or=b-Xe;oe[2].point[1]=0,oe[0].point[0]=-(oe[1].point[0]=oe[0].v[0]/2);var Tr=[oe[2].point[0]=oe[0].point[0]+oe[2].v[0]*r(Xe),2*(oe[0].point[1]=oe[1].point[1]=oe[2].v[0]*p(Xe))];function Rr(Qr,nn){var mn=p(nn),zn=r(nn),na=new Array(3),Yn;for(Yn=0;Yn<3;++Yn){var la=oe[Yn];if(na[Yn]=Lr(nn-la[1],la[3],la[2],zn,mn,Qr-la[0]),!na[Yn][0])return la.point;na[Yn][1]=he(na[Yn][1]-la.v[1])}var Na=Tr.slice();for(Yn=0;Yn<3;++Yn){var li=Yn==2?0:Yn+1,Ka=kr(oe[Yn].v[0],na[Yn][0],na[li][0]);na[Yn][1]<0&&(Ka=-Ka),Yn?Yn==1?(Ka=nr-Ka,Na[0]-=na[Yn][0]*r(Ka),Na[1]-=na[Yn][0]*p(Ka)):(Ka=or-Ka,Na[0]+=na[Yn][0]*r(Ka),Na[1]+=na[Yn][0]*p(Ka)):(Na[0]+=na[Yn][0]*r(Ka),Na[1]-=na[Yn][0]*p(Ka))}return Na[0]/=3,Na[1]/=3,Na}return Rr}function qt(Rt){return Rt[0]*=_,Rt[1]*=_,Rt}function zt(){return ut([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function ut(Rt,Gt,ne){var oe=g.geoCentroid({type:"MultiPoint",coordinates:[Rt,Gt,ne]}),be=[-oe[0],-oe[1]],pe=g.geoRotation(be),Ae=Dt(qt(pe(Rt)),qt(pe(Gt)),qt(pe(ne)));Ae.invert=Et(Ae);var Xe=g.geoProjection(Ae).rotate(be),nr=Xe.center;return delete Xe.rotate,Xe.center=function(or){return arguments.length?nr(pe(or)):pe.invert(nr())},Xe.clipAngle(90)}function yt(Rt,Gt){var ne=B(1-p(Gt));return[2/u*Rt*ne,u*(1-ne)]}yt.invert=function(Rt,Gt){var ne=(ne=Gt/u-1)*ne;return[ne>0?Rt*B(b/ne)/2:0,I(1-ne)]};function Mt(){return g.geoProjection(yt).scale(95.6464).center([0,30])}function Ot(Rt){var Gt=y(Rt);function ne(oe,be){return[oe,(oe?oe/p(oe):1)*(p(be)*r(oe)-Gt*r(be))]}return ne.invert=Gt?function(oe,be){oe&&(be*=p(oe)/oe);var pe=r(oe);return[oe,2*e(B(pe*pe+Gt*Gt-be*be)-pe,Gt-be)]}:function(oe,be){return[oe,I(oe?be*y(oe)/oe:be)]},ne}function $t(){return Zt(Ot).scale(249.828).clipAngle(90)}var ee=B(3);function we(Rt,Gt){return[ee*Rt*(2*r(2*Gt/3)-1)/u,ee*u*p(Gt/3)]}we.invert=function(Rt,Gt){var ne=3*I(Gt/(ee*u));return[u*Rt/(ee*(2*r(2*ne/3)-1)),ne]};function Me(){return g.geoProjection(we).scale(156.19)}function Re(Rt){var Gt=r(Rt);function ne(oe,be){return[oe*Gt,p(be)/Gt]}return ne.invert=function(oe,be){return[oe/Gt,I(be*Gt)]},ne}function Be(){return Zt(Re).parallel(38.58).scale(195.044)}function Ze(Rt){var Gt=r(Rt);function ne(oe,be){return[oe*Gt,(1+Gt)*y(be/2)]}return ne.invert=function(oe,be){return[oe/Gt,t(be/(1+Gt))*2]},ne}function Ue(){return Zt(Ze).scale(124.75)}function mr(Rt,Gt){var ne=B(8/(3*b));return[ne*Rt*(1-A(Gt)/b),ne*Gt]}mr.invert=function(Rt,Gt){var ne=B(8/(3*b)),oe=Gt/ne;return[Rt/(ne*(1-A(oe)/b)),oe]};function ln(){return g.geoProjection(mr).scale(165.664)}function an(Rt,Gt){var ne=B(4-3*p(A(Gt)));return[2/B(6*b)*Rt*ne,m(Gt)*B(2*b/3)*(2-ne)]}an.invert=function(Rt,Gt){var ne=2-A(Gt)/B(2*b/3);return[Rt*B(6*b)/(2*ne),m(Gt)*I((4-ne*ne)/3)]};function vn(){return g.geoProjection(an).scale(165.664)}function Sn(Rt,Gt){var ne=B(b*(4+b));return[2/ne*Rt*(1+B(1-4*Gt*Gt/(b*b))),4/ne*Gt]}Sn.invert=function(Rt,Gt){var ne=B(b*(4+b))/2;return[Rt*ne/(1+B(1-Gt*Gt*(4+b)/(4*b))),Gt*ne/2]};function An(){return g.geoProjection(Sn).scale(180.739)}function pn(Rt,Gt){var ne=(2+S)*p(Gt);Gt/=2;for(var oe=0,be=1/0;oe<10&&A(be)>l;oe++){var pe=r(Gt);Gt-=be=(Gt+p(Gt)*(pe+2)-ne)/(2*pe*(1+pe))}return[2/B(b*(4+b))*Rt*(1+r(Gt)),2*B(b/(4+b))*p(Gt)]}pn.invert=function(Rt,Gt){var ne=Gt*B((4+b)/b)/2,oe=I(ne),be=r(oe);return[Rt/(2/B(b*(4+b))*(1+be)),I((oe+ne*(be+2))/(2+S))]};function On(){return g.geoProjection(pn).scale(180.739)}function Nn(Rt,Gt){return[Rt*(1+r(Gt))/B(2+b),2*Gt/B(2+b)]}Nn.invert=function(Rt,Gt){var ne=B(2+b),oe=Gt*ne/2;return[ne*Rt/(1+r(oe)),oe]};function ke(){return g.geoProjection(Nn).scale(173.044)}function ze(Rt,Gt){for(var ne=(1+S)*p(Gt),oe=0,be=1/0;oe<10&&A(be)>l;oe++)Gt-=be=(Gt+p(Gt)-ne)/(1+r(Gt));return ne=B(2+b),[Rt*(1+r(Gt))/ne,2*Gt/ne]}ze.invert=function(Rt,Gt){var ne=1+S,oe=B(ne/2);return[Rt*2*oe/(1+r(Gt*=oe)),I((Gt+p(Gt))/ne)]};function je(){return g.geoProjection(ze).scale(173.044)}var Ne=3+2*w;function _r(Rt,Gt){var ne=p(Rt/=2),oe=r(Rt),be=B(r(Gt)),pe=r(Gt/=2),Ae=p(Gt)/(pe+w*oe*be),Xe=B(2/(1+Ae*Ae)),nr=B((w*pe+(oe+ne)*be)/(w*pe+(oe-ne)*be));return[Ne*(Xe*(nr-1/nr)-2*o(nr)),Ne*(Xe*Ae*(nr+1/nr)-2*t(Ae))]}_r.invert=function(Rt,Gt){if(!(pe=st.invert(Rt/1.2,Gt*1.065)))return null;var ne=pe[0],oe=pe[1],be=20,pe;Rt/=Ne,Gt/=Ne;do{var Ae=ne/2,Xe=oe/2,nr=p(Ae),or=r(Ae),Tr=p(Xe),Rr=r(Xe),Qr=r(oe),nn=B(Qr),mn=Tr/(Rr+w*or*nn),zn=mn*mn,na=B(2/(1+zn)),Yn=w*Rr+(or+nr)*nn,la=w*Rr+(or-nr)*nn,Na=Yn/la,li=B(Na),Ka=li-1/li,Gi=li+1/li,jo=na*Ka-2*o(li)-Rt,Uo=na*mn*Gi-2*t(mn)-Gt,ho=Tr&&M*nn*nr*zn/Tr,Go=(w*or*Rr+nn)/(2*(Rr+w*or*nn)*(Rr+w*or*nn)*nn),js=-.5*mn*na*na*na,Is=js*ho,bo=js*Go,wo=(wo=2*Rr+w*nn*(or-nr))*wo*li,nl=(w*or*Rr*nn+Qr)/wo,dl=-(w*nr*Tr)/(nn*wo),lu=Ka*Is-2*nl/li+na*(nl+nl/Na),mt=Ka*bo-2*dl/li+na*(dl+dl/Na),St=mn*Gi*Is-2*ho/(1+zn)+na*Gi*ho+na*mn*(nl-nl/Na),Xt=mn*Gi*bo-2*Go/(1+zn)+na*Gi*Go+na*mn*(dl-dl/Na),se=mt*St-Xt*lu;if(!se)break;var fe=(Uo*mt-jo*Xt)/se,ve=(jo*St-Uo*lu)/se;ne-=fe,oe=a(-S,s(S,oe-ve))}while((A(fe)>l||A(ve)>l)&&--be>0);return A(A(oe)-S)<l?[0,oe]:be&&[ne,oe]};function Xr(){return g.geoProjection(_r).scale(62.5271)}var rn=r(35*_);function Br(Rt,Gt){var ne=y(Gt/2);return[Rt*rn*B(1-ne*ne),(1+rn)*ne]}Br.invert=function(Rt,Gt){var ne=Gt/(1+rn);return[Rt&&Rt/(rn*B(1-ne*ne)),2*t(ne)]};function _n(){return g.geoProjection(Br).scale(137.152)}function bn(Rt,Gt){var ne=Gt/2,oe=r(ne);return[2*Rt/u*r(Gt)*oe*oe,u*y(ne)]}bn.invert=function(Rt,Gt){var ne=t(Gt/u),oe=r(ne),be=2*ne;return[Rt*u/2/(r(be)*oe*oe),be]};function Fn(){return g.geoProjection(bn).scale(135.264)}function on(Rt){var Gt=1-Rt,ne=pe(b,0)[0]-pe(-b,0)[0],oe=pe(0,S)[1]-pe(0,-S)[1],be=B(2*oe/ne);function pe(nr,or){var Tr=r(or),Rr=p(or);return[Tr/(Gt+Rt*Tr)*nr,Gt*or+Rt*Rr]}function Ae(nr,or){var Tr=pe(nr,or);return[Tr[0]*be,Tr[1]/be]}function Xe(nr){return Ae(0,nr)[1]}return Ae.invert=function(nr,or){var Tr=Ft(Xe,or),Rr=nr/be*(Rt+Gt/r(Tr));return[Rr,Tr]},Ae}function Bn(){var Rt=.5,Gt=g.geoProjectionMutator(on),ne=Gt(Rt);return ne.alpha=function(oe){return arguments.length?Gt(Rt=+oe):Rt},ne.scale(168.725)}function ue(Rt){return[Rt[0]/2,I(y(Rt[1]/2*_))*k]}function xe(Rt){return[Rt[0]*2,2*t(p(Rt[1]*_))*k]}function Pr(Rt){Rt==null&&(Rt=g.geoOrthographic);var Gt=Rt(),ne=g.geoEquirectangular().scale(k).precision(0).clipAngle(null).translate([0,0]);function oe(pe){return Gt(ue(pe))}Gt.invert&&(oe.invert=function(pe){return xe(Gt.invert(pe))}),oe.stream=function(pe){var Ae=Gt.stream(pe),Xe=ne.stream({point:function(nr,or){Ae.point(nr/2,I(y(-or/2*_))*k)},lineStart:function(){Ae.lineStart()},lineEnd:function(){Ae.lineEnd()},polygonStart:function(){Ae.polygonStart()},polygonEnd:function(){Ae.polygonEnd()}});return Xe.sphere=Ae.sphere,Xe};function be(pe){oe[pe]=function(){return arguments.length?(Gt[pe].apply(Gt,arguments),oe):Gt[pe]()}}return oe.rotate=function(pe){return arguments.length?(ne.rotate(pe),oe):ne.rotate()},oe.center=function(pe){return arguments.length?(Gt.center(ue(pe)),oe):xe(Gt.center())},be("angle"),be("clipAngle"),be("clipExtent"),be("fitExtent"),be("fitHeight"),be("fitSize"),be("fitWidth"),be("scale"),be("translate"),be("precision"),oe.scale(249.5)}function Sr(Rt,Gt){var ne=2*b/Gt,oe=Rt*Rt;function be(pe,Ae){var Xe=g.geoAzimuthalEquidistantRaw(pe,Ae),nr=Xe[0],or=Xe[1],Tr=nr*nr+or*or;if(Tr>oe){var Rr=B(Tr),Qr=e(or,nr),nn=ne*v(Qr/ne),mn=Qr-nn,zn=Rt*r(mn),na=(Rt*p(mn)-mn*p(zn))/(S-zn),Yn=gr(mn,na),la=(b-Rt)/dr(Yn,zn,b);nr=Rr;var Na=50,li;do nr-=li=(Rt+dr(Yn,zn,nr)*la-Rr)/(Yn(nr)*la);while(A(li)>l&&--Na>0);or=mn*p(nr),nr<S&&(or-=na*(nr-S));var Ka=p(nn),Gi=r(nn);Xe[0]=nr*Gi-or*Ka,Xe[1]=nr*Ka+or*Gi}return Xe}return be.invert=function(pe,Ae){var Xe=pe*pe+Ae*Ae;if(Xe>oe){var nr=B(Xe),or=e(Ae,pe),Tr=ne*v(or/ne),Rr=or-Tr;pe=nr*r(Rr),Ae=nr*p(Rr);for(var Qr=pe-S,nn=p(pe),mn=Ae/nn,zn=pe<S?1/0:0,na=10;;){var Yn=Rt*p(mn),la=Rt*r(mn),Na=p(la),li=S-la,Ka=(Yn-mn*Na)/li,Gi=gr(mn,Ka);if(A(zn)<x||!--na)break;mn-=zn=(mn*nn-Ka*Qr-Ae)/(nn-Qr*2*(li*(la+mn*Yn*r(la)-Na)-Yn*(Yn-mn*Na))/(li*li))}nr=Rt+dr(Gi,la,pe)*(b-Rt)/dr(Gi,la,b),or=Tr+mn,pe=nr*r(or),Ae=nr*p(or)}return g.geoAzimuthalEquidistantRaw.invert(pe,Ae)},be}function gr(Rt,Gt){return function(ne){var oe=Rt*r(ne);return ne<S&&(oe-=Gt),B(1+oe*oe)}}function dr(Rt,Gt,ne){for(var oe=50,be=(ne-Gt)/oe,pe=Rt(Gt)+Rt(ne),Ae=1,Xe=Gt;Ae<oe;++Ae)pe+=2*Rt(Xe+=be);return pe*.5*be}function Er(){var Rt=6,Gt=30*_,ne=r(Gt),oe=p(Gt),be=g.geoProjectionMutator(Sr),pe=be(Gt,Rt),Ae=pe.stream,Xe=.01,nr=-r(Xe*_),or=p(Xe*_);return pe.radius=function(Tr){return arguments.length?(ne=r(Gt=Tr*_),oe=p(Gt),be(Gt,Rt)):Gt*k},pe.lobes=function(Tr){return arguments.length?be(Gt,Rt=+Tr):Rt},pe.stream=function(Tr){var Rr=pe.rotate(),Qr=Ae(Tr),nn=(pe.rotate([0,0]),Ae(Tr));return pe.rotate(Rr),Qr.sphere=function(){nn.polygonStart(),nn.lineStart();for(var mn=0,zn=2*b/Rt,na=0;mn<Rt;++mn,na-=zn)nn.point(e(or*r(na),nr)*k,I(or*p(na))*k),nn.point(e(oe*r(na-zn/2),ne)*k,I(oe*p(na-zn/2))*k);nn.lineEnd(),nn.polygonEnd()},Qr},pe.rotate([90,-40]).scale(91.7095).clipAngle(180-.001)}function Dr(Rt,Gt,ne,oe,be,pe,Ae,Xe){arguments.length<8&&(Xe=0);function nr(or,Tr){if(!Tr)return[Rt*or/b,0];var Rr=Tr*Tr,Qr=Rt+Rr*(Gt+Rr*(ne+Rr*oe)),nn=Tr*(be-1+Rr*(pe-Xe+Rr*Ae)),mn=(Qr*Qr+nn*nn)/(2*nn),zn=or*I(Qr/mn)/b;return[mn*p(zn),Tr*(1+Rr*Xe)+mn*(1-r(zn))]}return nr.invert=function(or,Tr){var Rr=b*or/Rt,Qr=Tr,nn,mn,zn=50;do{var na=Qr*Qr,Yn=Rt+na*(Gt+na*(ne+na*oe)),la=Qr*(be-1+na*(pe-Xe+na*Ae)),Na=Yn*Yn+la*la,li=2*la,Ka=Na/li,Gi=Ka*Ka,jo=I(Yn/Ka)/b,Uo=Rr*jo,ho=Yn*Yn,Go=(2*Gt+na*(4*ne+na*6*oe))*Qr,js=be+na*(3*pe+na*5*Ae),Is=2*(Yn*Go+la*(js-1)),bo=2*(js-1),wo=(Is*li-Na*bo)/(li*li),nl=r(Uo),dl=p(Uo),lu=Ka*nl,mt=Ka*dl,St=Rr/b*(1/B(1-ho/Gi))*(Go*Ka-Yn*wo)/Gi,Xt=mt-or,se=Qr*(1+na*Xe)+Ka-lu-Tr,fe=wo*dl+lu*St,ve=lu*jo,De=1+wo-(wo*nl-mt*St),Ce=mt*jo,Qe=fe*Ce-De*ve;if(!Qe)break;Rr-=nn=(se*fe-Xt*De)/Qe,Qr-=mn=(Xt*Ce-se*ve)/Qe}while((A(nn)>l||A(mn)>l)&&--zn>0);return[Rr,Qr]},nr}var Ar=Dr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function Gr(){return g.geoProjection(Ar).scale(149.995)}var Wr=Dr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Jr(){return g.geoProjection(Wr).scale(153.93)}var _e=Dr(5/6*b,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Je(){return g.geoProjection(_e).scale(130.945)}function yr(Rt,Gt){var ne=Rt*Rt,oe=Gt*Gt;return[Rt*(1-.162388*oe)*(.87-952426e-9*ne*ne),Gt*(1+oe/12)]}yr.invert=function(Rt,Gt){var ne=Rt,oe=Gt,be=50,pe;do{var Ae=oe*oe;oe-=pe=(oe*(1+Ae/12)-Gt)/(1+Ae/4)}while(A(pe)>l&&--be>0);be=50,Rt/=1-.162388*Ae;do{var Xe=(Xe=ne*ne)*Xe;ne-=pe=(ne*(.87-952426e-9*Xe)-Rt)/(.87-.00476213*Xe)}while(A(pe)>l&&--be>0);return[ne,oe]};function Hr(){return g.geoProjection(yr).scale(131.747)}var hn=Dr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function En(){return g.geoProjection(hn).scale(131.087)}function dn(Rt){var Gt=Rt(S,0)[0]-Rt(-S,0)[0];function ne(oe,be){var pe=oe>0?-.5:.5,Ae=Rt(oe+pe*b,be);return Ae[0]-=pe*Gt,Ae}return Rt.invert&&(ne.invert=function(oe,be){var pe=oe>0?-.5:.5,Ae=Rt.invert(oe+pe*Gt,be),Xe=Ae[0]-pe*b;return Xe<-b?Xe+=2*b:Xe>b&&(Xe-=2*b),Ae[0]=Xe,Ae}),ne}function Kr(Rt,Gt){var ne=m(Rt),oe=m(Gt),be=r(Gt),pe=r(Rt)*be,Ae=p(Rt)*be,Xe=p(oe*Gt);Rt=A(e(Ae,Xe)),Gt=I(pe),A(Rt-S)>l&&(Rt%=S);var nr=Tn(Rt>b/4?S-Rt:Rt,Gt);return Rt>b/4&&(Xe=nr[0],nr[0]=-nr[1],nr[1]=-Xe),nr[0]*=ne,nr[1]*=-oe,nr}Kr.invert=function(Rt,Gt){A(Rt)>1&&(Rt=m(Rt)*2-Rt),A(Gt)>1&&(Gt=m(Gt)*2-Gt);var ne=m(Rt),oe=m(Gt),be=-ne*Rt,pe=-oe*Gt,Ae=pe/be<1,Xe=ta(Ae?pe:be,Ae?be:pe),nr=Xe[0],or=Xe[1],Tr=r(or);return Ae&&(nr=-S-nr),[ne*(e(p(nr)*Tr,-p(or))+b),oe*I(r(nr)*Tr)]};function Tn(Rt,Gt){if(Gt===S)return[0,0];var ne=p(Gt),oe=ne*ne,be=oe*oe,pe=1+be,Ae=1+3*be,Xe=1-be,nr=I(1/B(pe)),or=Xe+oe*pe*nr,Tr=(1-ne)/or,Rr=B(Tr),Qr=Tr*pe,nn=B(Qr),mn=Rr*Xe,zn,na;if(Rt===0)return[0,-(mn+oe*nn)];var Yn=r(Gt),la=1/Yn,Na=2*ne*Yn,li=(-3*oe+nr*Ae)*Na,Ka=(-or*Yn-(1-ne)*li)/(or*or),Gi=.5*Ka/Rr,jo=Xe*Gi-2*oe*Rr*Na,Uo=oe*pe*Ka+Tr*Ae*Na,ho=-la*Na,Go=-la*Uo,js=-2*la*jo,Is=4*Rt/b,bo;if(Rt>.222*b||Gt<b/4&&Rt>.175*b){if(zn=(mn+oe*B(Qr*(1+be)-mn*mn))/(1+be),Rt>b/4)return[zn,zn];var wo=zn,nl=.5*zn;zn=.5*(nl+wo),na=50;do{var dl=B(Qr-zn*zn),lu=zn*(js+ho*dl)+Go*I(zn/nn)-Is;if(!lu)break;lu<0?nl=zn:wo=zn,zn=.5*(nl+wo)}while(A(wo-nl)>l&&--na>0)}else{zn=l,na=25;do{var mt=zn*zn,St=B(Qr-mt),Xt=js+ho*St,se=zn*Xt+Go*I(zn/nn)-Is,fe=Xt+(Go-ho*mt)/St;zn-=bo=St?se/fe:0}while(A(bo)>l&&--na>0)}return[zn,-mn-oe*B(Qr-zn*zn)]}function ta(Rt,Gt){for(var ne=0,oe=1,be=.5,pe=50;;){var Ae=be*be,Xe=B(be),nr=I(1/B(1+Ae)),or=1-Ae+be*(1+Ae)*nr,Tr=(1-Xe)/or,Rr=B(Tr),Qr=Tr*(1+Ae),nn=Rr*(1-Ae),mn=Qr-Rt*Rt,zn=B(mn),na=Gt+nn+be*zn;if(A(oe-ne)<x||--pe===0||na===0)break;na>0?ne=be:oe=be,be=.5*(ne+oe)}if(!pe)return null;var Yn=I(Xe),la=r(Yn),Na=1/la,li=2*Xe*la,Ka=(-3*be+nr*(1+3*Ae))*li,Gi=(-or*la-(1-Xe)*Ka)/(or*or),jo=.5*Gi/Rr,Uo=(1-Ae)*jo-2*be*Rr*li,ho=-2*Na*Uo,Go=-Na*li,js=-Na*(be*(1+Ae)*Gi+Tr*(1+3*Ae)*li);return[b/4*(Rt*(ho+Go*zn)+js*I(Rt/B(Qr))),Yn]}function Qn(){return g.geoProjection(dn(Kr)).scale(239.75)}function Va(Rt,Gt,ne){var oe,be,pe;return Rt?(oe=ja(Rt,ne),Gt?(be=ja(Gt,1-ne),pe=be[1]*be[1]+ne*oe[0]*oe[0]*be[0]*be[0],[[oe[0]*be[2]/pe,oe[1]*oe[2]*be[0]*be[1]/pe],[oe[1]*be[1]/pe,-oe[0]*oe[2]*be[0]*be[2]/pe],[oe[2]*be[1]*be[2]/pe,-ne*oe[0]*oe[1]*be[0]/pe]]):[[oe[0],0],[oe[1],0],[oe[2],0]]):(be=ja(Gt,1-ne),[[0,be[0]/be[1]],[1/be[1],0],[be[2]/be[1],0]])}function ja(Rt,Gt){var ne,oe,be,pe,Ae;if(Gt<l)return pe=p(Rt),oe=r(Rt),ne=Gt*(Rt-pe*oe)/4,[pe-ne*oe,oe+ne*pe,1-Gt*pe*pe/2,Rt-ne];if(Gt>=1-l)return ne=(1-Gt)/4,oe=F(Rt),pe=R(Rt),be=1/oe,Ae=oe*L(Rt),[pe+ne*(Ae-Rt)/(oe*oe),be-ne*pe*be*(Ae-Rt),be+ne*pe*be*(Ae+Rt),2*t(i(Rt))-S+ne*(Ae-Rt)/oe];var Xe=[1,0,0,0,0,0,0,0,0],nr=[B(Gt),0,0,0,0,0,0,0,0],or=0;for(oe=B(1-Gt),Ae=1;A(nr[or]/Xe[or])>l&&or<8;)ne=Xe[or++],nr[or]=(ne-oe)/2,Xe[or]=(ne+oe)/2,oe=B(ne*oe),Ae*=2;be=Ae*Xe[or]*Rt;do pe=nr[or]*p(oe=be)/Xe[or],be=(I(pe)+be)/2;while(--or);return[p(be),pe=r(be),pe/r(be-oe),be]}function ci(Rt,Gt,ne){var oe=A(Rt),be=A(Gt),pe=L(be);if(oe){var Ae=1/p(oe),Xe=1/(y(oe)*y(oe)),nr=-(Xe+ne*(pe*pe*Ae*Ae)-1+ne),or=(ne-1)*Xe,Tr=(-nr+B(nr*nr-4*or))/2;return[pi(t(1/B(Tr)),ne)*m(Rt),pi(t(B((Tr/Xe-1)/ne)),1-ne)*m(Gt)]}return[0,pi(t(pe),1-ne)*m(Gt)]}function pi(Rt,Gt){if(!Gt)return Rt;if(Gt===1)return o(y(Rt/2+T));for(var ne=1,oe=B(1-Gt),be=B(Gt),pe=0;A(be)>l;pe++){if(Rt%b){var Ae=t(oe*y(Rt)/ne);Ae<0&&(Ae+=b),Rt+=Ae+~~(Rt/b)*b}else Rt+=Rt;be=(ne+oe)/2,oe=B(ne*oe),be=((ne=be)-oe)/2}return Rt/(h(2,pe)*ne)}function bi(Rt,Gt){var ne=(w-1)/(w+1),oe=B(1-ne*ne),be=pi(S,oe*oe),pe=-1,Ae=o(y(b/4+A(Gt)/2)),Xe=i(pe*Ae)/B(ne),nr=ri(Xe*r(pe*Rt),Xe*p(pe*Rt)),or=ci(nr[0],nr[1],oe*oe);return[-or[1],(Gt>=0?1:-1)*(.5*be-or[0])]}function ri(Rt,Gt){var ne=Rt*Rt,oe=Gt+1,be=1-ne-Gt*Gt;return[.5*((Rt>=0?S:-S)-e(be,2*Rt)),-.25*o(be*be+4*ne)+.5*o(oe*oe+ne)]}function Da(Rt,Gt){var ne=Gt[0]*Gt[0]+Gt[1]*Gt[1];return[(Rt[0]*Gt[0]+Rt[1]*Gt[1])/ne,(Rt[1]*Gt[0]-Rt[0]*Gt[1])/ne]}bi.invert=function(Rt,Gt){var ne=(w-1)/(w+1),oe=B(1-ne*ne),be=pi(S,oe*oe),pe=-1,Ae=Va(.5*be-Gt,-Rt,oe*oe),Xe=Da(Ae[0],Ae[1]),nr=e(Xe[1],Xe[0])/pe;return[nr,2*t(i(.5/pe*o(ne*Xe[0]*Xe[0]+ne*Xe[1]*Xe[1])))-S]};function Ui(){return g.geoProjection(dn(bi)).scale(151.496)}function lo(Rt){var Gt=p(Rt),ne=r(Rt),oe=Co(Rt);oe.invert=Co(-Rt);function be(pe,Ae){var Xe=oe(pe,Ae);pe=Xe[0],Ae=Xe[1];var nr=p(Ae),or=r(Ae),Tr=r(pe),Rr=O(Gt*nr+ne*or*Tr),Qr=p(Rr),nn=A(Qr)>l?Rr/Qr:1;return[nn*ne*p(pe),(A(pe)>S?nn:-nn)*(Gt*or-ne*nr*Tr)]}return be.invert=function(pe,Ae){var Xe=B(pe*pe+Ae*Ae),nr=-p(Xe),or=r(Xe),Tr=Xe*or,Rr=-Ae*nr,Qr=Xe*Gt,nn=B(Tr*Tr+Rr*Rr-Qr*Qr),mn=e(Tr*Qr+Rr*nn,Rr*Qr-Tr*nn),zn=(Xe>S?-1:1)*e(pe*nr,Xe*r(mn)*or+Ae*p(mn)*nr);return oe.invert(zn,mn)},be}function Co(Rt){var Gt=p(Rt),ne=r(Rt);return function(oe,be){var pe=r(be),Ae=r(oe)*pe,Xe=p(oe)*pe,nr=p(be);return[e(Xe,Ae*ne-nr*Gt),I(nr*ne+Ae*Gt)]}}function Bo(){var Rt=0,Gt=g.geoProjectionMutator(lo),ne=Gt(Rt),oe=ne.rotate,be=ne.stream,pe=g.geoCircle();return ne.parallel=function(Ae){if(!arguments.length)return Rt*k;var Xe=ne.rotate();return Gt(Rt=Ae*_).rotate(Xe)},ne.rotate=function(Ae){return arguments.length?(oe.call(ne,[Ae[0],Ae[1]-Rt*k]),pe.center([-Ae[0],-Ae[1]]),ne):(Ae=oe.call(ne),Ae[1]+=Rt*k,Ae)},ne.stream=function(Ae){return Ae=be(Ae),Ae.sphere=function(){Ae.polygonStart();var Xe=.01,nr=pe.radius(90-Xe)().coordinates[0],or=nr.length-1,Tr=-1,Rr;for(Ae.lineStart();++Tr<or;)Ae.point((Rr=nr[Tr])[0],Rr[1]);for(Ae.lineEnd(),nr=pe.radius(90+Xe)().coordinates[0],or=nr.length-1,Ae.lineStart();--Tr>=0;)Ae.point((Rr=nr[Tr])[0],Rr[1]);Ae.lineEnd(),Ae.polygonEnd()},Ae},ne.scale(79.4187).parallel(45).clipAngle(180-.001)}var ai=3,yi=I(1-1/ai)*k,Si=Re(0);function ko(Rt){var Gt=yi*_,ne=yt(b,Gt)[0]-yt(-b,Gt)[0],oe=Si(0,Gt)[1],be=yt(0,Gt)[1],pe=u-be,Ae=f/Rt,Xe=4/f,nr=oe+pe*pe*4/f;function or(Tr,Rr){var Qr,nn=A(Rr);if(nn>Gt){var mn=s(Rt-1,a(0,n((Tr+b)/Ae)));Tr+=b*(Rt-1)/Rt-mn*Ae,Qr=yt(Tr,nn),Qr[0]=Qr[0]*f/ne-f*(Rt-1)/(2*Rt)+mn*f/Rt,Qr[1]=oe+(Qr[1]-be)*4*pe/f,Rr<0&&(Qr[1]=-Qr[1])}else Qr=Si(Tr,Rr);return Qr[0]*=Xe,Qr[1]/=nr,Qr}return or.invert=function(Tr,Rr){Tr/=Xe,Rr*=nr;var Qr=A(Rr);if(Qr>oe){var nn=s(Rt-1,a(0,n((Tr+b)/Ae)));Tr=(Tr+b*(Rt-1)/Rt-nn*Ae)*ne/f;var mn=yt.invert(Tr,.25*(Qr-oe)*f/pe+be);return mn[0]-=b*(Rt-1)/Rt-nn*Ae,Rr<0&&(mn[1]=-mn[1]),mn}return Si.invert(Tr,Rr)},or}function Ao(Rt,Gt){return[Rt,Gt&1?90-l:yi]}function Do(Rt,Gt){return[Rt,Gt&1?-90+l:-yi]}function Pi(Rt){return[Rt[0]*(1-l),Rt[1]]}function Yi(Rt){var Gt=[].concat(E.range(-180,180+Rt/2,Rt).map(Ao),E.range(180,-180-Rt/2,-Rt).map(Do));return{type:"Polygon",coordinates:[Rt===180?Gt.map(Pi):Gt]}}function vs(){var Rt=4,Gt=g.geoProjectionMutator(ko),ne=Gt(Rt),oe=ne.stream;return ne.lobes=function(be){return arguments.length?Gt(Rt=+be):Rt},ne.stream=function(be){var pe=ne.rotate(),Ae=oe(be),Xe=(ne.rotate([0,0]),oe(be));return ne.rotate(pe),Ae.sphere=function(){g.geoStream(Yi(180/Rt),Xe)},Ae},ne.scale(239.75)}function es(Rt){var Gt=1+Rt,ne=p(1/Gt),oe=I(ne),be=2*B(b/(pe=b+4*oe*Gt)),pe,Ae=.5*be*(Gt+B(Rt*(2+Rt))),Xe=Rt*Rt,nr=Gt*Gt;function or(Tr,Rr){var Qr=1-p(Rr),nn,mn;if(Qr&&Qr<2){var zn=S-Rr,na=25,Yn;do{var la=p(zn),Na=r(zn),li=oe+e(la,Gt-Na),Ka=1+nr-2*Gt*Na;zn-=Yn=(zn-Xe*oe-Gt*la+Ka*li-.5*Qr*pe)/(2*Gt*la*li)}while(A(Yn)>x&&--na>0);nn=be*B(Ka),mn=Tr*li/b}else nn=be*(Rt+Qr),mn=Tr*oe/b;return[nn*p(mn),Ae-nn*r(mn)]}return or.invert=function(Tr,Rr){var Qr=Tr*Tr+(Rr-=Ae)*Rr,nn=(1+nr-Qr/(be*be))/(2*Gt),mn=O(nn),zn=p(mn),na=oe+e(zn,Gt-nn);return[I(Tr/B(Qr))*b/na,I(1-2*(mn-Xe*oe-Gt*zn+(1+nr-2*Gt*nn)*na)/pe)]},or}function ls(){var Rt=1,Gt=g.geoProjectionMutator(es),ne=Gt(Rt);return ne.ratio=function(oe){return arguments.length?Gt(Rt=+oe):Rt},ne.scale(167.774).center([0,18.67])}var Xi=.7109889596207567,ga=.0528035274542;function Xa(Rt,Gt){return Gt>-Xi?(Rt=Wt(Rt,Gt),Rt[1]+=ga,Rt):le(Rt,Gt)}Xa.invert=function(Rt,Gt){return Gt>-Xi?Wt.invert(Rt,Gt-ga):le.invert(Rt,Gt)};function Ls(){return g.geoProjection(Xa).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function fs(Rt,Gt){return A(Gt)>Xi?(Rt=Wt(Rt,Gt),Rt[1]-=Gt>0?ga:-ga,Rt):le(Rt,Gt)}fs.invert=function(Rt,Gt){return A(Gt)>Xi?Wt.invert(Rt,Gt+(Gt>0?ga:-ga)):le.invert(Rt,Gt)};function qi(){return g.geoProjection(fs).scale(152.63)}function ms(Rt,Gt,ne,oe){var be=B(4*b/(2*ne+(1+Rt-Gt/2)*p(2*ne)+(Rt+Gt)/2*p(4*ne)+Gt/2*p(6*ne))),pe=B(oe*p(ne)*B((1+Rt*r(2*ne)+Gt*r(4*ne))/(1+Rt+Gt))),Ae=ne*nr(1);function Xe(Rr){return B(1+Rt*r(2*Rr)+Gt*r(4*Rr))}function nr(Rr){var Qr=Rr*ne;return(2*Qr+(1+Rt-Gt/2)*p(2*Qr)+(Rt+Gt)/2*p(4*Qr)+Gt/2*p(6*Qr))/ne}function or(Rr){return Xe(Rr)*p(Rr)}var Tr=function(Rr,Qr){var nn=ne*Ft(nr,Ae*p(Qr)/ne,Qr/b);isNaN(nn)&&(nn=ne*m(Qr));var mn=be*Xe(nn);return[mn*pe*Rr/b*r(nn),mn/pe*p(nn)]};return Tr.invert=function(Rr,Qr){var nn=Ft(or,Qr*pe/be);return[Rr*b/(r(nn)*be*pe*Xe(nn)),I(ne*nr(nn/ne)/Ae)]},ne===0&&(be=B(oe/b),Tr=function(Rr,Qr){return[Rr*be,p(Qr)/be]},Tr.invert=function(Rr,Qr){return[Rr/be,I(Qr*be)]}),Tr}function Po(){var Rt=1,Gt=0,ne=45*_,oe=2,be=g.geoProjectionMutator(ms),pe=be(Rt,Gt,ne,oe);return pe.a=function(Ae){return arguments.length?be(Rt=+Ae,Gt,ne,oe):Rt},pe.b=function(Ae){return arguments.length?be(Rt,Gt=+Ae,ne,oe):Gt},pe.psiMax=function(Ae){return arguments.length?be(Rt,Gt,ne=+Ae*_,oe):ne*k},pe.ratio=function(Ae){return arguments.length?be(Rt,Gt,ne,oe=+Ae):oe},pe.scale(180.739)}function rs(Rt,Gt,ne,oe,be,pe,Ae,Xe,nr,or,Tr){if(Tr.nanEncountered)return NaN;var Rr,Qr,nn,mn,zn,na,Yn,la,Na,li;if(Rr=ne-Gt,Qr=Rt(Gt+Rr*.25),nn=Rt(ne-Rr*.25),isNaN(Qr)){Tr.nanEncountered=!0;return}if(isNaN(nn)){Tr.nanEncountered=!0;return}return mn=Rr*(oe+4*Qr+be)/12,zn=Rr*(be+4*nn+pe)/12,na=mn+zn,li=(na-Ae)/15,or>nr?(Tr.maxDepthCount++,na+li):Math.abs(li)<Xe?na+li:(Yn=Gt+Rr*.5,la=rs(Rt,Gt,Yn,oe,Qr,be,mn,Xe*.5,nr,or+1,Tr),isNaN(la)?(Tr.nanEncountered=!0,NaN):(Na=rs(Rt,Yn,ne,be,nn,pe,zn,Xe*.5,nr,or+1,Tr),isNaN(Na)?(Tr.nanEncountered=!0,NaN):la+Na))}function hl(Rt,Gt,ne,oe,be){var pe={maxDepthCount:0,nanEncountered:!1};be===void 0&&(be=20);var Ae=Rt(Gt),Xe=Rt(.5*(Gt+ne)),nr=Rt(ne),or=(Ae+4*Xe+nr)*(ne-Gt)/6,Tr=rs(Rt,Gt,ne,Ae,Xe,nr,or,oe,be,1,pe);return Tr}function za(Rt,Gt,ne){function oe(nn){return Rt+(1-Rt)*h(1-h(nn,Gt),1/Gt)}function be(nn){return hl(oe,0,nn,1e-4)}for(var pe=1/be(1),Ae=1e3,Xe=(1+1e-8)*pe,nr=[],or=0;or<=Ae;or++)nr.push(be(or/Ae)*Xe);function Tr(nn){var mn=0,zn=Ae,na=Ae>>1;do nr[na]>nn?zn=na:mn=na,na=mn+zn>>1;while(na>mn);var Yn=nr[na+1]-nr[na];return Yn&&(Yn=(nn-nr[na+1])/Yn),(na+1+Yn)/Ae}var Rr=2*Tr(1)/b*pe/ne,Qr=function(nn,mn){var zn=Tr(A(p(mn))),na=oe(zn)*nn;return zn/=Rr,[na,mn>=0?zn:-zn]};return Qr.invert=function(nn,mn){var zn;return mn*=Rr,A(mn)<1&&(zn=m(mn)*I(be(A(mn))*pe)),[nn/oe(A(mn)),zn]},Qr}function Oi(){var Rt=0,Gt=2.5,ne=1.183136,oe=g.geoProjectionMutator(za),be=oe(Rt,Gt,ne);return be.alpha=function(pe){return arguments.length?oe(Rt=+pe,Gt,ne):Rt},be.k=function(pe){return arguments.length?oe(Rt,Gt=+pe,ne):Gt},be.gamma=function(pe){return arguments.length?oe(Rt,Gt,ne=+pe):ne},be.scale(152.63)}function Bi(Rt,Gt){return A(Rt[0]-Gt[0])<l&&A(Rt[1]-Gt[1])<l}function Ro(Rt,Gt){for(var ne=-1,oe=Rt.length,be=Rt[0],pe,Ae,Xe,nr=[];++ne<oe;){pe=Rt[ne],Ae=(pe[0]-be[0])/Gt,Xe=(pe[1]-be[1])/Gt;for(var or=0;or<Gt;++or)nr.push([be[0]+or*Ae,be[1]+or*Xe]);be=pe}return nr.push(pe),nr}function Fo(Rt){var Gt=[],ne,oe,be,pe,Ae,Xe,nr,or=Rt[0].length;for(nr=0;nr<or;++nr)ne=Rt[0][nr],oe=ne[0][0],be=ne[0][1],pe=ne[1][1],Ae=ne[2][0],Xe=ne[2][1],Gt.push(Ro([[oe+l,be+l],[oe+l,pe-l],[Ae-l,pe-l],[Ae-l,Xe+l]],30));for(nr=Rt[1].length-1;nr>=0;--nr)ne=Rt[1][nr],oe=ne[0][0],be=ne[0][1],pe=ne[1][1],Ae=ne[2][0],Xe=ne[2][1],Gt.push(Ro([[Ae-l,Xe-l],[Ae-l,pe+l],[oe+l,pe+l],[oe+l,be-l]],30));return{type:"Polygon",coordinates:[E.merge(Gt)]}}function Ci(Rt,Gt,ne){var oe,be;function pe(nr,or){for(var Tr=or<0?-1:1,Rr=Gt[+(or<0)],Qr=0,nn=Rr.length-1;Qr<nn&&nr>Rr[Qr][2][0];++Qr);var mn=Rt(nr-Rr[Qr][1][0],or);return mn[0]+=Rt(Rr[Qr][1][0],Tr*or>Tr*Rr[Qr][0][1]?Rr[Qr][0][1]:or)[0],mn}ne?pe.invert=ne(pe):Rt.invert&&(pe.invert=function(nr,or){for(var Tr=be[+(or<0)],Rr=Gt[+(or<0)],Qr=0,nn=Tr.length;Qr<nn;++Qr){var mn=Tr[Qr];if(mn[0][0]<=nr&&nr<mn[1][0]&&mn[0][1]<=or&&or<mn[1][1]){var zn=Rt.invert(nr-Rt(Rr[Qr][1][0],0)[0],or);return zn[0]+=Rr[Qr][1][0],Bi(pe(zn[0],zn[1]),[nr,or])?zn:null}}});var Ae=g.geoProjection(pe),Xe=Ae.stream;return Ae.stream=function(nr){var or=Ae.rotate(),Tr=Xe(nr),Rr=(Ae.rotate([0,0]),Xe(nr));return Ae.rotate(or),Tr.sphere=function(){g.geoStream(oe,Rr)},Tr},Ae.lobes=function(nr){return arguments.length?(oe=Fo(nr),Gt=nr.map(function(or){return or.map(function(Tr){return[[Tr[0][0]*_,Tr[0][1]*_],[Tr[1][0]*_,Tr[1][1]*_],[Tr[2][0]*_,Tr[2][1]*_]]})}),be=Gt.map(function(or){return or.map(function(Tr){var Rr=Rt(Tr[0][0],Tr[0][1])[0],Qr=Rt(Tr[2][0],Tr[2][1])[0],nn=Rt(Tr[1][0],Tr[0][1])[1],mn=Rt(Tr[1][0],Tr[1][1])[1],zn;return nn>mn&&(zn=nn,nn=mn,mn=zn),[[Rr,nn],[Qr,mn]]})}),Ae):Gt.map(function(or){return or.map(function(Tr){return[[Tr[0][0]*k,Tr[0][1]*k],[Tr[1][0]*k,Tr[1][1]*k],[Tr[2][0]*k,Tr[2][1]*k]]})})},Gt!=null&&Ae.lobes(Gt),Ae}var fl=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function ql(){return Ci(Ut,fl).scale(160.857)}var Zs=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Hl(){return Ci(fs,Zs).scale(152.63)}var Us=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Es(){return Ci(Wt,Us).scale(169.529)}var El=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Wu(){return Ci(Wt,El).scale(169.529).rotate([20,0])}var Mu=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function Fu(){return Ci(Xa,Mu,Et).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var _h=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function ih(){return Ci(le,_h).scale(152.63).rotate([-20,0])}function ns(Rt,Gt){return[3/f*Rt*B(b*b/3-Gt*Gt),Gt]}ns.invert=function(Rt,Gt){return[f/3*Rt/B(b*b/3-Gt*Gt),Gt]};function du(){return g.geoProjection(ns).scale(158.837)}function Ic(Rt){function Gt(ne,oe){if(A(A(oe)-S)<l)return[0,oe<0?-2:2];var be=p(oe),pe=h((1+be)/(1-be),Rt/2),Ae=.5*(pe+1/pe)+r(ne*=Rt);return[2*p(ne)/Ae,(pe-1/pe)/Ae]}return Gt.invert=function(ne,oe){var be=A(oe);if(A(be-2)<l)return ne?null:[0,m(oe)*S];if(be>2)return null;ne/=2,oe/=2;var pe=ne*ne,Ae=oe*oe,Xe=2*oe/(1+pe+Ae);return Xe=h((1+Xe)/(1-Xe),1/Rt),[e(2*ne,1-pe-Ae)/Rt,I((Xe-1)/(Xe+1))]},Gt}function ll(){var Rt=.5,Gt=g.geoProjectionMutator(Ic),ne=Gt(Rt);return ne.spacing=function(oe){return arguments.length?Gt(Rt=+oe):Rt},ne.scale(124.75)}var el=b/w;function ul(Rt,Gt){return[Rt*(1+B(r(Gt)))/2,Gt/(r(Gt/2)*r(Rt/6))]}ul.invert=function(Rt,Gt){var ne=A(Rt),oe=A(Gt),be=l,pe=S;oe<el?pe*=oe/el:be+=6*O(el/oe);for(var Ae=0;Ae<25;Ae++){var Xe=p(pe),nr=B(r(pe)),or=p(pe/2),Tr=r(pe/2),Rr=p(be/6),Qr=r(be/6),nn=.5*be*(1+nr)-ne,mn=pe/(Tr*Qr)-oe,zn=nr?-.25*be*Xe/nr:0,na=.5*(1+nr),Yn=(1+.5*pe*or/Tr)/(Tr*Qr),la=pe/Tr*(Rr/6)/(Qr*Qr),Na=zn*la-Yn*na,li=(nn*la-mn*na)/Na,Ka=(mn*zn-nn*Yn)/Na;if(pe-=li,be-=Ka,A(li)<l&&A(Ka)<l)break}return[Rt<0?-be:be,Gt<0?-pe:pe]};function Zu(){return g.geoProjection(ul).scale(97.2672)}function ys(Rt,Gt){var ne=Rt*Rt,oe=Gt*Gt;return[Rt*(.975534+oe*(-.119161+ne*-.0143059+oe*-.0547009)),Gt*(1.00384+ne*(.0802894+oe*-.02855+ne*199025e-9)+oe*(.0998909+oe*-.0491032))]}ys.invert=function(Rt,Gt){var ne=m(Rt)*b,oe=Gt/2,be=50;do{var pe=ne*ne,Ae=oe*oe,Xe=ne*oe,nr=ne*(.975534+Ae*(-.119161+pe*-.0143059+Ae*-.0547009))-Rt,or=oe*(1.00384+pe*(.0802894+Ae*-.02855+pe*199025e-9)+Ae*(.0998909+Ae*-.0491032))-Gt,Tr=.975534-Ae*(.119161+3*pe*.0143059+Ae*.0547009),Rr=-Xe*(2*.119161+4*.0547009*Ae+2*.0143059*pe),Qr=Xe*(2*.0802894+4*199025e-9*pe+2*-.02855*Ae),nn=1.00384+pe*(.0802894+199025e-9*pe)+Ae*(3*(.0998909-.02855*pe)-5*.0491032*Ae),mn=Rr*Qr-nn*Tr,zn=(or*Rr-nr*nn)/mn,na=(nr*Qr-or*Tr)/mn;ne-=zn,oe-=na}while((A(zn)>l||A(na)>l)&&--be>0);return be&&[ne,oe]};function pl(){return g.geoProjection(ys).scale(139.98)}function $o(Rt,Gt){return[p(Rt)/r(Gt),y(Gt)*r(Rt)]}$o.invert=function(Rt,Gt){var ne=Rt*Rt,oe=Gt*Gt,be=oe+1,pe=ne+be,Ae=Rt?M*B((pe-B(pe*pe-4*ne))/ne):1/B(be);return[I(Rt*Ae),m(Gt)*O(Ae)]};function ks(){return g.geoProjection($o).scale(144.049).clipAngle(90-.001)}function Bu(Rt){var Gt=r(Rt),ne=y(T+Rt/2);function oe(be,pe){var Ae=pe-Rt,Xe=A(Ae)<l?be*Gt:A(Xe=T+pe/2)<l||A(A(Xe)-S)<l?0:be*Ae/o(y(Xe)/ne);return[Xe,Ae]}return oe.invert=function(be,pe){var Ae,Xe=pe+Rt;return[A(pe)<l?be/Gt:A(Ae=T+Xe/2)<l||A(A(Ae)-S)<l?0:be*o(y(Ae)/ne)/pe,Xe]},oe}function Ol(){return Zt(Bu).parallel(40).scale(158.837)}function Xu(Rt,Gt){return[Rt,1.25*o(y(T+.4*Gt))]}Xu.invert=function(Rt,Gt){return[Rt,2.5*t(i(.8*Gt))-.625*b]};function Cs(){return g.geoProjection(Xu).scale(108.318)}function zh(Rt){var Gt=Rt.length-1;function ne(oe,be){for(var pe=r(be),Ae=2/(1+pe*r(oe)),Xe=Ae*pe*p(oe),nr=Ae*p(be),or=Gt,Tr=Rt[or],Rr=Tr[0],Qr=Tr[1],nn;--or>=0;)Tr=Rt[or],Rr=Tr[0]+Xe*(nn=Rr)-nr*Qr,Qr=Tr[1]+Xe*Qr+nr*nn;return Rr=Xe*(nn=Rr)-nr*Qr,Qr=Xe*Qr+nr*nn,[Rr,Qr]}return ne.invert=function(oe,be){var pe=20,Ae=oe,Xe=be;do{for(var nr=Gt,or=Rt[nr],Tr=or[0],Rr=or[1],Qr=0,nn=0,mn;--nr>=0;)or=Rt[nr],Qr=Tr+Ae*(mn=Qr)-Xe*nn,nn=Rr+Ae*nn+Xe*mn,Tr=or[0]+Ae*(mn=Tr)-Xe*Rr,Rr=or[1]+Ae*Rr+Xe*mn;Qr=Tr+Ae*(mn=Qr)-Xe*nn,nn=Rr+Ae*nn+Xe*mn,Tr=Ae*(mn=Tr)-Xe*Rr-oe,Rr=Ae*Rr+Xe*mn-be;var zn=Qr*Qr+nn*nn,na,Yn;Ae-=na=(Tr*Qr+Rr*nn)/zn,Xe-=Yn=(Rr*Qr-Tr*nn)/zn}while(A(na)+A(Yn)>l*l&&--pe>0);if(pe){var la=B(Ae*Ae+Xe*Xe),Na=2*t(la*.5),li=p(Na);return[e(Ae*li,la*r(Na)),la?I(Xe*li/la):0]}},ne}var Mo=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Oh=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],as=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],io=[[.9245,0],[0,0],[.01943,0]],pc=[[.721316,0],[0,0],[-.00881625,-.00617325]];function gu(){return rl(Mo,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Pl(){return rl(Oh,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Wc(){return rl(as,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function $u(){return rl(io,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function dc(){return rl(pc,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function rl(Rt,Gt){var ne=g.geoProjection(zh(Rt)).rotate(Gt).clipAngle(90),oe=g.geoRotation(Gt),be=ne.center;return delete ne.rotate,ne.center=function(pe){return arguments.length?be(oe(pe)):oe.invert(be())},ne}var oh=B(6),Zc=B(7);function Lc(Rt,Gt){var ne=I(7*p(Gt)/(3*oh));return[oh*Rt*(2*r(2*ne/3)-1)/Zc,9*p(ne/3)/Zc]}Lc.invert=function(Rt,Gt){var ne=3*I(Gt*Zc/9);return[Rt*Zc/(oh*(2*r(2*ne/3)-1)),I(p(ne)*3*oh/7)]};function Ju(){return g.geoProjection(Lc).scale(164.859)}function Cc(Rt,Gt){for(var ne=(1+M)*p(Gt),oe=Gt,be=0,pe;be<25&&(oe-=pe=(p(oe/2)+p(oe)-ne)/(.5*r(oe/2)+r(oe)),!(A(pe)<l));be++);return[Rt*(1+2*r(oe)/r(oe/2))/(3*w),2*B(3)*p(oe/2)/B(2+w)]}Cc.invert=function(Rt,Gt){var ne=Gt*B(2+w)/(2*B(3)),oe=2*I(ne);return[3*w*Rt/(1+2*r(oe)/r(oe/2)),I((ne+p(oe))/(1+M))]};function Xc(){return g.geoProjection(Cc).scale(188.209)}function mu(Rt,Gt){for(var ne=B(6/(4+b)),oe=(1+b/4)*p(Gt),be=Gt/2,pe=0,Ae;pe<25&&(be-=Ae=(be/2+p(be)-oe)/(.5+r(be)),!(A(Ae)<l));pe++);return[ne*(.5+r(be))*Rt/1.5,ne*be]}mu.invert=function(Rt,Gt){var ne=B(6/(4+b)),oe=Gt/ne;return A(A(oe)-S)<l&&(oe=oe<0?-S:S),[1.5*Rt/(ne*(.5+r(oe))),I((oe/2+p(oe))/(1+b/4))]};function $c(){return g.geoProjection(mu).scale(166.518)}function nc(Rt,Gt){var ne=Gt*Gt,oe=ne*ne,be=ne*oe;return[Rt*(.84719-.13063*ne+be*be*(-.04515+.05494*ne-.02326*oe+.00331*be)),Gt*(1.01183+oe*oe*(-.02625+.01926*ne-.00396*oe))]}nc.invert=function(Rt,Gt){var ne=Gt,oe=25,be,pe,Ae,Xe;do pe=ne*ne,Ae=pe*pe,ne-=be=(ne*(1.01183+Ae*Ae*(-.02625+.01926*pe-.00396*Ae))-Gt)/(1.01183+Ae*Ae*(9*-.02625+11*.01926*pe+13*-.00396*Ae));while(A(be)>x&&--oe>0);return pe=ne*ne,Ae=pe*pe,Xe=pe*Ae,[Rt/(.84719-.13063*pe+Xe*Xe*(-.04515+.05494*pe-.02326*Ae+.00331*Xe)),ne]};function vu(){return g.geoProjection(nc).scale(175.295)}function Gl(Rt,Gt){return[Rt*(1+r(Gt))/2,2*(Gt-y(Gt/2))]}Gl.invert=function(Rt,Gt){for(var ne=Gt/2,oe=0,be=1/0;oe<10&&A(be)>l;++oe){var pe=r(Gt/2);Gt-=be=(Gt-y(Gt/2)-ne)/(1-.5/(pe*pe))}return[2*Rt/(1+r(Gt)),Gt]};function yc(){return g.geoProjection(Gl).scale(152.63)}var Jc=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function ps(){return Ci(dt(1/0),Jc).rotate([20,0]).scale(152.63)}function Dc(Rt,Gt){var ne=p(Gt),oe=r(Gt),be=m(Rt);if(Rt===0||A(Gt)===S)return[0,Gt];if(Gt===0)return[Rt,0];if(A(Rt)===S)return[Rt*oe,S*ne];var pe=b/(2*Rt)-2*Rt/b,Ae=2*Gt/b,Xe=(1-Ae*Ae)/(ne-Ae),nr=pe*pe,or=Xe*Xe,Tr=1+nr/or,Rr=1+or/nr,Qr=(pe*ne/Xe-pe/2)/Tr,nn=(or*ne/nr+Xe/2)/Rr,mn=Qr*Qr+oe*oe/Tr,zn=nn*nn-(or*ne*ne/nr+Xe*ne-1)/Rr;return[S*(Qr+B(mn)*be),S*(nn+B(zn<0?0:zn)*m(-Gt*pe)*be)]}Dc.invert=function(Rt,Gt){Rt/=S,Gt/=S;var ne=Rt*Rt,oe=Gt*Gt,be=ne+oe,pe=b*b;return[Rt?(be-1+B((1-be)*(1-be)+4*ne))/(2*Rt)*S:0,Ft(function(Ae){return be*(b*p(Ae)-2*Ae)*b+4*Ae*Ae*(Gt-p(Ae))+2*b*Ae-pe*Gt},0)]};function Fh(){return g.geoProjection(Dc).scale(127.267)}var sh=1.0148,xc=.23185,lh=-.14499,Wl=.02406,uh=sh,Il=5*xc,Zl=7*lh,Ru=9*Wl,Xs=1.790857183;function Qu(Rt,Gt){var ne=Gt*Gt;return[Rt,Gt*(sh+ne*ne*(xc+ne*(lh+Wl*ne)))]}Qu.invert=function(Rt,Gt){Gt>Xs?Gt=Xs:Gt<-Xs&&(Gt=-Xs);var ne=Gt,oe;do{var be=ne*ne;ne-=oe=(ne*(sh+be*be*(xc+be*(lh+Wl*be)))-Gt)/(uh+be*be*(Il+be*(Zl+Ru*be)))}while(A(oe)>l);return[Rt,ne]};function yu(){return g.geoProjection(Qu).scale(139.319)}function Xl(Rt,Gt){if(A(Gt)<l)return[Rt,0];var ne=y(Gt),oe=Rt*p(Gt);return[p(oe)/ne,Gt+(1-r(oe))/ne]}Xl.invert=function(Rt,Gt){if(A(Gt)<l)return[Rt,0];var ne=Rt*Rt+Gt*Gt,oe=Gt*.5,be=10,pe;do{var Ae=y(oe),Xe=1/r(oe),nr=ne-2*Gt*oe+oe*oe;oe-=pe=(Ae*nr+2*(oe-Gt))/(2+nr*Xe*Xe+2*(oe-Gt)*Ae)}while(A(pe)>l&&--be>0);return Ae=y(oe),[(A(Gt)<A(oe+1/Ae)?I(Rt*Ae):m(Gt)*m(Rt)*(O(A(Rt*Ae))+S))/p(oe),oe]};function Ds(){return g.geoProjection(Xl).scale(103.74)}function gc(Rt,Gt){var ne=_c(Rt[1],Rt[0]),oe=_c(Gt[1],Gt[0]),be=Zh(ne,oe),pe=bh(ne)/bh(oe);return Yu([1,0,Rt[0][0],0,1,Rt[0][1]],Yu([pe,0,0,0,pe,0],Yu([r(be),p(be),0,-p(be),r(be),0],[1,0,-Gt[0][0],0,1,-Gt[0][1]])))}function Su(Rt){var Gt=1/(Rt[0]*Rt[4]-Rt[1]*Rt[3]);return[Gt*Rt[4],-Gt*Rt[1],Gt*(Rt[1]*Rt[5]-Rt[2]*Rt[4]),-Gt*Rt[3],Gt*Rt[0],Gt*(Rt[2]*Rt[3]-Rt[0]*Rt[5])]}function Yu(Rt,Gt){return[Rt[0]*Gt[0]+Rt[1]*Gt[3],Rt[0]*Gt[1]+Rt[1]*Gt[4],Rt[0]*Gt[2]+Rt[1]*Gt[5]+Rt[2],Rt[3]*Gt[0]+Rt[4]*Gt[3],Rt[3]*Gt[1]+Rt[4]*Gt[4],Rt[3]*Gt[2]+Rt[4]*Gt[5]+Rt[5]]}function _c(Rt,Gt){return[Rt[0]-Gt[0],Rt[1]-Gt[1]]}function bh(Rt){return B(Rt[0]*Rt[0]+Rt[1]*Rt[1])}function Zh(Rt,Gt){return e(Rt[0]*Gt[1]-Rt[1]*Gt[0],Rt[0]*Gt[0]+Rt[1]*Gt[1])}function ac(Rt,Gt,ne){oe(Rt,{transform:null});function oe(or,Tr){if(or.edges=$l(or.face),Tr.face){var Rr=or.shared=zc(or.face,Tr.face),Qr=gc(Rr.map(Tr.project),Rr.map(or.project));or.transform=Tr.transform?Yu(Tr.transform,Qr):Qr;for(var nn=Tr.edges,mn=0,zn=nn.length;mn<zn;++mn)Ll(Rr[0],nn[mn][1])&&Ll(Rr[1],nn[mn][0])&&(nn[mn]=or),Ll(Rr[0],nn[mn][0])&&Ll(Rr[1],nn[mn][1])&&(nn[mn]=or);for(nn=or.edges,mn=0,zn=nn.length;mn<zn;++mn)Ll(Rr[0],nn[mn][0])&&Ll(Rr[1],nn[mn][1])&&(nn[mn]=Tr),Ll(Rr[0],nn[mn][1])&&Ll(Rr[1],nn[mn][0])&&(nn[mn]=Tr)}else or.transform=Tr.transform;return or.children&&or.children.forEach(function(na){oe(na,or)}),or}function be(or,Tr){var Rr=Gt(or,Tr),Qr=Rr.project([or*k,Tr*k]),nn;return(nn=Rr.transform)?[nn[0]*Qr[0]+nn[1]*Qr[1]+nn[2],-(nn[3]*Qr[0]+nn[4]*Qr[1]+nn[5])]:(Qr[1]=-Qr[1],Qr)}ic(Rt)&&(be.invert=function(or,Tr){var Rr=pe(Rt,[or,-Tr]);return Rr&&(Rr[0]*=_,Rr[1]*=_,Rr)});function pe(or,Tr){var Rr=or.project.invert,Qr=or.transform,nn=Tr;if(Qr&&(Qr=Su(Qr),nn=[Qr[0]*nn[0]+Qr[1]*nn[1]+Qr[2],Qr[3]*nn[0]+Qr[4]*nn[1]+Qr[5]]),Rr&&or===Ae(mn=Rr(nn)))return mn;for(var mn,zn=or.children,na=0,Yn=zn&&zn.length;na<Yn;++na)if(mn=pe(zn[na],Tr))return mn}function Ae(or){return Gt(or[0]*_,or[1]*_)}var Xe=g.geoProjection(be),nr=Xe.stream;return Xe.stream=function(or){var Tr=Xe.rotate(),Rr=nr(or),Qr=(Xe.rotate([0,0]),nr(or));return Xe.rotate(Tr),Rr.sphere=function(){Qr.polygonStart(),Qr.lineStart(),bc(Qr,Rt),Qr.lineEnd(),Qr.polygonEnd()},Rr},Xe.angle(ne==null?-30:ne*k)}function bc(Rt,Gt,ne){var oe,be=Gt.edges,pe=be.length,Ae,Xe={type:"MultiPoint",coordinates:Gt.face},nr=Gt.face.filter(function(zn){return A(zn[1])!==90}),or=g.geoBounds({type:"MultiPoint",coordinates:nr}),Tr=!1,Rr=-1,Qr=or[1][0]-or[0][0],nn=Qr===180||Qr===360?[(or[0][0]+or[1][0])/2,(or[0][1]+or[1][1])/2]:g.geoCentroid(Xe);if(ne)for(;++Rr<pe&&be[Rr]!==ne;);++Rr;for(var mn=0;mn<pe;++mn)Ae=be[(mn+Rr)%pe],Array.isArray(Ae)?(Tr||(Rt.point((oe=g.geoInterpolate(Ae[0],nn)(l))[0],oe[1]),Tr=!0),Rt.point((oe=g.geoInterpolate(Ae[1],nn)(l))[0],oe[1])):(Tr=!1,Ae!==ne&&bc(Rt,Ae,Gt))}function Ll(Rt,Gt){return Rt&&Gt&&Rt[0]===Gt[0]&&Rt[1]===Gt[1]}function zc(Rt,Gt){for(var ne,oe,be=Rt.length,pe=null,Ae=0;Ae<be;++Ae){ne=Rt[Ae];for(var Xe=Gt.length;--Xe>=0;)if(oe=Gt[Xe],ne[0]===oe[0]&&ne[1]===oe[1]){if(pe)return[pe,ne];pe=ne}}}function $l(Rt){for(var Gt=Rt.length,ne=[],oe=Rt[Gt-1],be=0;be<Gt;++be)ne.push([oe,oe=Rt[be]]);return ne}function ic(Rt){return Rt.project.invert||Rt.children&&Rt.children.some(ic)}var Oc=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],Ku=[[0,2,1],[0,3,2],[5,1,2],[5,2,3],[0,1,4],[0,4,3],[5,4,1],[5,3,4]].map(function(Rt){return Rt.map(function(Gt){return Oc[Gt]})});function Os(Rt){Rt=Rt||function(ne){var oe=g.geoCentroid({type:"MultiPoint",coordinates:ne});return g.geoGnomonic().scale(1).translate([0,0]).rotate([-oe[0],-oe[1]])};var Gt=Ku.map(function(ne){return{face:ne,project:Rt(ne)}});return[-1,0,0,1,0,1,4,5].forEach(function(ne,oe){var be=Gt[ne];be&&(be.children||(be.children=[])).push(Gt[oe])}),ac(Gt[0],function(ne,oe){return Gt[ne<-b/2?oe<0?6:4:ne<0?oe<0?2:0:ne<b/2?oe<0?3:1:oe<0?7:5]}).angle(-30).scale(101.858).center([0,45])}var Eu=2/B(3);function Jl(Rt,Gt){var ne=yt(Rt,Gt);return[ne[0]*Eu,ne[1]]}Jl.invert=function(Rt,Gt){return yt.invert(Rt/Eu,Gt)};function ch(Rt){Rt=Rt||function(ne){var oe=g.geoCentroid({type:"MultiPoint",coordinates:ne});return g.geoProjection(Jl).translate([0,0]).scale(1).rotate(oe[1]>0?[-oe[0],0]:[180-oe[0],180])};var Gt=Ku.map(function(ne){return{face:ne,project:Rt(ne)}});return[-1,0,0,1,0,1,4,5].forEach(function(ne,oe){var be=Gt[ne];be&&(be.children||(be.children=[])).push(Gt[oe])}),ac(Gt[0],function(ne,oe){return Gt[ne<-b/2?oe<0?6:4:ne<0?oe<0?2:0:ne<b/2?oe<0?3:1:oe<0?7:5]}).angle(-30).scale(121.906).center([0,48.5904])}function Ps(Rt){Rt=Rt||function(Ae){var Xe=Ae.length===6?g.geoCentroid({type:"MultiPoint",coordinates:Ae}):Ae[0];return g.geoGnomonic().scale(1).translate([0,0]).rotate([-Xe[0],-Xe[1]])};var Gt=Ku.map(function(Ae){for(var Xe=Ae.map(oc),nr=Xe.length,or=Xe[nr-1],Tr,Rr=[],Qr=0;Qr<nr;++Qr)Tr=Xe[Qr],Rr.push(Ql([or[0]*.9486832980505138+Tr[0]*.31622776601683794,or[1]*.9486832980505138+Tr[1]*.31622776601683794,or[2]*.9486832980505138+Tr[2]*.31622776601683794]),Ql([Tr[0]*.9486832980505138+or[0]*.31622776601683794,Tr[1]*.9486832980505138+or[1]*.31622776601683794,Tr[2]*.9486832980505138+or[2]*.31622776601683794])),or=Tr;return Rr}),ne=[],oe=[-1,0,0,1,0,1,4,5];Gt.forEach(function(Ae,Xe){for(var nr=Ku[Xe],or=nr.length,Tr=ne[Xe]=[],Rr=0;Rr<or;++Rr)Gt.push([nr[Rr],Ae[(Rr*2+2)%(2*or)],Ae[(Rr*2+1)%(2*or)]]),oe.push(Xe),Tr.push(ju(oc(Ae[(Rr*2+2)%(2*or)]),oc(Ae[(Rr*2+1)%(2*or)])))});var be=Gt.map(function(Ae){return{project:Rt(Ae),face:Ae}});oe.forEach(function(Ae,Xe){var nr=be[Ae];nr&&(nr.children||(nr.children=[])).push(be[Xe])});function pe(Ae,Xe){var nr=r(Xe),or=[nr*r(Ae),nr*p(Ae),p(Xe)],Tr=Ae<-b/2?Xe<0?6:4:Ae<0?Xe<0?2:0:Ae<b/2?Xe<0?3:1:Xe<0?7:5,Rr=ne[Tr];return be[mc(Rr[0],or)<0?8+3*Tr:mc(Rr[1],or)<0?8+3*Tr+1:mc(Rr[2],or)<0?8+3*Tr+2:Tr]}return ac(be[0],pe).angle(-30).scale(110.625).center([0,45])}function mc(Rt,Gt){for(var ne=0,oe=Rt.length,be=0;ne<oe;++ne)be+=Rt[ne]*Gt[ne];return be}function ju(Rt,Gt){return[Rt[1]*Gt[2]-Rt[2]*Gt[1],Rt[2]*Gt[0]-Rt[0]*Gt[2],Rt[0]*Gt[1]-Rt[1]*Gt[0]]}function Ql(Rt){return[e(Rt[1],Rt[0])*k,I(a(-1,s(1,Rt[2])))*k]}function oc(Rt){var Gt=Rt[0]*_,ne=Rt[1]*_,oe=r(ne);return[oe*r(Gt),oe*p(Gt),p(ne)]}function Nu(){}function vc(Rt){if((ne=Rt.length)<4)return!1;for(var Gt=0,ne,oe=Rt[ne-1][1]*Rt[0][0]-Rt[ne-1][0]*Rt[0][1];++Gt<ne;)oe+=Rt[Gt-1][1]*Rt[Gt][0]-Rt[Gt-1][0]*Rt[Gt][1];return oe<=0}function wh(Rt,Gt){for(var ne=Gt[0],oe=Gt[1],be=!1,pe=0,Ae=Rt.length,Xe=Ae-1;pe<Ae;Xe=pe++){var nr=Rt[pe],or=nr[0],Tr=nr[1],Rr=Rt[Xe],Qr=Rr[0],nn=Rr[1];Tr>oe^nn>oe&&ne<(Qr-or)*(oe-Tr)/(nn-Tr)+or&&(be=!be)}return be}function cl(Rt,Gt){var ne=Gt.stream,oe;if(!ne)throw new Error("invalid projection");switch(Rt&&Rt.type){case"Feature":oe=Yl;break;case"FeatureCollection":oe=Qc;break;default:oe=xu;break}return oe(Rt,ne)}function Qc(Rt,Gt){return{type:"FeatureCollection",features:Rt.features.map(function(ne){return Yl(ne,Gt)})}}function Yl(Rt,Gt){return{type:"Feature",id:Rt.id,properties:Rt.properties,geometry:xu(Rt.geometry,Gt)}}function Pu(Rt,Gt){return{type:"GeometryCollection",geometries:Rt.geometries.map(function(ne){return xu(ne,Gt)})}}function xu(Rt,Gt){if(!Rt)return null;if(Rt.type==="GeometryCollection")return Pu(Rt,Gt);var ne;switch(Rt.type){case"Point":ne=Iu;break;case"MultiPoint":ne=Iu;break;case"LineString":ne=sc;break;case"MultiLineString":ne=sc;break;case"Polygon":ne=_u;break;case"MultiPolygon":ne=_u;break;case"Sphere":ne=_u;break;default:return null}return g.geoStream(Rt,Gt(ne)),ne.result()}var Vs=[],qs=[],Iu={point:function(Rt,Gt){Vs.push([Rt,Gt])},result:function(){var Rt=Vs.length?Vs.length<2?{type:"Point",coordinates:Vs[0]}:{type:"MultiPoint",coordinates:Vs}:null;return Vs=[],Rt}},sc={lineStart:Nu,point:function(Rt,Gt){Vs.push([Rt,Gt])},lineEnd:function(){Vs.length&&(qs.push(Vs),Vs=[])},result:function(){var Rt=qs.length?qs.length<2?{type:"LineString",coordinates:qs[0]}:{type:"MultiLineString",coordinates:qs}:null;return qs=[],Rt}},_u={polygonStart:Nu,lineStart:Nu,point:function(Rt,Gt){Vs.push([Rt,Gt])},lineEnd:function(){var Rt=Vs.length;if(Rt){do Vs.push(Vs[0].slice());while(++Rt<4);qs.push(Vs),Vs=[]}},polygonEnd:Nu,result:function(){if(!qs.length)return null;var Rt=[],Gt=[];return qs.forEach(function(ne){vc(ne)?Rt.push([ne]):Gt.push(ne)}),Gt.forEach(function(ne){var oe=ne[0];Rt.some(function(be){if(wh(be[0],oe))return be.push(ne),!0})||Rt.push([ne])}),qs=[],Rt.length?Rt.length>1?{type:"MultiPolygon",coordinates:Rt}:{type:"Polygon",coordinates:Rt[0]}:null}};function wc(Rt){var Gt=Rt(S,0)[0]-Rt(-S,0)[0];function ne(oe,be){var pe=A(oe)<S,Ae=Rt(pe?oe:oe>0?oe-b:oe+b,be),Xe=(Ae[0]-Ae[1])*M,nr=(Ae[0]+Ae[1])*M;if(pe)return[Xe,nr];var or=Gt*M,Tr=Xe>0^nr>0?-1:1;return[Tr*Xe-m(nr)*or,Tr*nr-m(Xe)*or]}return Rt.invert&&(ne.invert=function(oe,be){var pe=(oe+be)*M,Ae=(be-oe)*M,Xe=A(pe)<.5*Gt&&A(Ae)<.5*Gt;if(!Xe){var nr=Gt*M,or=pe>0^Ae>0?-1:1,Tr=-or*oe+(Ae>0?1:-1)*nr,Rr=-or*be+(pe>0?1:-1)*nr;pe=(-Tr-Rr)*M,Ae=(Tr-Rr)*M}var Qr=Rt.invert(pe,Ae);return Xe||(Qr[0]+=pe>0?b:-b),Qr}),g.geoProjection(ne).rotate([-90,-90,45]).clipAngle(180-.001)}function Ve(){return wc(Kr).scale(176.423)}function lr(){return wc(bi).scale(111.48)}function Ur(Rt,Gt){if(!(0<=(Gt=+Gt)&&Gt<=20))throw new Error("invalid digits");function ne(or){var Tr=or.length,Rr=2,Qr=new Array(Tr);for(Qr[0]=+or[0].toFixed(Gt),Qr[1]=+or[1].toFixed(Gt);Rr<Tr;)Qr[Rr]=or[Rr],++Rr;return Qr}function oe(or){return or.map(ne)}function be(or){for(var Tr=ne(or[0]),Rr=[Tr],Qr=1;Qr<or.length;Qr++){var nn=ne(or[Qr]);(nn.length>2||nn[0]!=Tr[0]||nn[1]!=Tr[1])&&(Rr.push(nn),Tr=nn)}return Rr.length===1&&or.length>1&&Rr.push(ne(or[or.length-1])),Rr}function pe(or){return or.map(be)}function Ae(or){if(or==null)return or;var Tr;switch(or.type){case"GeometryCollection":Tr={type:"GeometryCollection",geometries:or.geometries.map(Ae)};break;case"Point":Tr={type:"Point",coordinates:ne(or.coordinates)};break;case"MultiPoint":Tr={type:or.type,coordinates:oe(or.coordinates)};break;case"LineString":Tr={type:or.type,coordinates:be(or.coordinates)};break;case"MultiLineString":case"Polygon":Tr={type:or.type,coordinates:pe(or.coordinates)};break;case"MultiPolygon":Tr={type:"MultiPolygon",coordinates:or.coordinates.map(pe)};break;default:return or}return or.bbox!=null&&(Tr.bbox=or.bbox),Tr}function Xe(or){var Tr={type:"Feature",properties:or.properties,geometry:Ae(or.geometry)};return or.id!=null&&(Tr.id=or.id),or.bbox!=null&&(Tr.bbox=or.bbox),Tr}if(Rt!=null)switch(Rt.type){case"Feature":return Xe(Rt);case"FeatureCollection":{var nr={type:"FeatureCollection",features:Rt.features.map(Xe)};return Rt.bbox!=null&&(nr.bbox=Rt.bbox),nr}default:return Ae(Rt)}return Rt}function Or(Rt){var Gt=p(Rt);function ne(oe,be){var pe=Gt?y(oe*Gt/2)/Gt:oe/2;if(!be)return[2*pe,-Rt];var Ae=2*t(pe*p(be)),Xe=1/y(be);return[p(Ae)*Xe,be+(1-r(Ae))*Xe-Rt]}return ne.invert=function(oe,be){if(A(be+=Rt)<l)return[Gt?2*t(Gt*oe/2)/Gt:oe,0];var pe=oe*oe+be*be,Ae=0,Xe=10,nr;do{var or=y(Ae),Tr=1/r(Ae),Rr=pe-2*be*Ae+Ae*Ae;Ae-=nr=(or*Rr+2*(Ae-be))/(2+Rr*Tr*Tr+2*(Ae-be)*or)}while(A(nr)>l&&--Xe>0);var Qr=oe*(or=y(Ae)),nn=y(A(be)<A(Ae+1/or)?I(Qr)*.5:O(Qr)*.5+b/4)/p(Ae);return[Gt?2*t(Gt*nn)/Gt:2*nn,Ae]},ne}function un(){return Zt(Or).scale(131.215)}var Ln=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];Ln.forEach(function(Rt){Rt[1]*=1.0144});function Gn(Rt,Gt){var ne=s(18,A(Gt)*36/b),oe=n(ne),be=ne-oe,pe=(Rr=Ln[oe])[0],Ae=Rr[1],Xe=(Rr=Ln[++oe])[0],nr=Rr[1],or=(Rr=Ln[s(19,++oe)])[0],Tr=Rr[1],Rr;return[Rt*(Xe+be*(or-pe)/2+be*be*(or-2*Xe+pe)/2),(Gt>0?S:-S)*(nr+be*(Tr-Ae)/2+be*be*(Tr-2*nr+Ae)/2)]}Gn.invert=function(Rt,Gt){var ne=Gt/S,oe=ne*90,be=s(18,A(oe/5)),pe=a(0,n(be));do{var Ae=Ln[pe][1],Xe=Ln[pe+1][1],nr=Ln[s(19,pe+2)][1],or=nr-Ae,Tr=nr-2*Xe+Ae,Rr=2*(A(ne)-Xe)/or,Qr=Tr/or,nn=Rr*(1-Qr*Rr*(1-2*Qr*Rr));if(nn>=0||pe===1){oe=(Gt>=0?5:-5)*(nn+be);var mn=50,zn;do be=s(18,A(oe)/5),pe=n(be),nn=be-pe,Ae=Ln[pe][1],Xe=Ln[pe+1][1],nr=Ln[s(19,pe+2)][1],oe-=(zn=(Gt>=0?S:-S)*(Xe+nn*(nr-Ae)/2+nn*nn*(nr-2*Xe+Ae)/2)-Gt)*k;while(A(zn)>x&&--mn>0);break}}while(--pe>=0);var na=Ln[pe][0],Yn=Ln[pe+1][0],la=Ln[s(19,pe+2)][0];return[Rt/(Yn+nn*(la-na)/2+nn*nn*(la-2*Yn+na)/2),oe*_]};function oa(){return g.geoProjection(Gn).scale(152.63)}function ya(Rt){function Gt(ne,oe){var be=r(oe),pe=(Rt-1)/(Rt-be*r(ne));return[pe*be*p(ne),pe*p(oe)]}return Gt.invert=function(ne,oe){var be=ne*ne+oe*oe,pe=B(be),Ae=(Rt-B(1-be*(Rt+1)/(Rt-1)))/((Rt-1)/pe+pe/(Rt-1));return[e(ne*Ae,pe*B(1-Ae*Ae)),pe?I(oe*Ae/pe):0]},Gt}function Pa(Rt,Gt){var ne=ya(Rt);if(!Gt)return ne;var oe=r(Gt),be=p(Gt);function pe(Ae,Xe){var nr=ne(Ae,Xe),or=nr[1],Tr=or*be/(Rt-1)+oe;return[nr[0]*oe/Tr,or/Tr]}return pe.invert=function(Ae,Xe){var nr=(Rt-1)/(Rt-1-Xe*be);return ne.invert(nr*Ae,nr*Xe*oe)},pe}function Jn(){var Rt=2,Gt=0,ne=g.geoProjectionMutator(Pa),oe=ne(Rt,Gt);return oe.distance=function(be){return arguments.length?ne(Rt=+be,Gt):Rt},oe.tilt=function(be){return arguments.length?ne(Rt,Gt=be*_):Gt*k},oe.scale(432.147).clipAngle(O(1/Rt)*k-1e-6)}var va=1e-4,sa=1e4,qn=-180,Fa=qn+va,Fi=180,Ei=Fi-va,Ni=-90,Hi=Ni+va,Ba=90,ba=Ba-va;function $i(Rt){return Rt.length>0}function So(Rt){return Math.floor(Rt*sa)/sa}function Jo(Rt){return Rt===Ni||Rt===Ba?[0,Rt]:[qn,So(Rt)]}function As(Rt){var Gt=Rt[0],ne=Rt[1],oe=!1;return Gt<=Fa?(Gt=qn,oe=!0):Gt>=Ei&&(Gt=Fi,oe=!0),ne<=Hi?(ne=Ni,oe=!0):ne>=ba&&(ne=Ba,oe=!0),oe?[Gt,ne]:Rt}function os(Rt){return Rt.map(As)}function xs(Rt,Gt,ne){for(var oe=0,be=Rt.length;oe<be;++oe){var pe=Rt[oe].slice();ne.push({index:-1,polygon:Gt,ring:pe});for(var Ae=0,Xe=pe.length;Ae<Xe;++Ae){var nr=pe[Ae],or=nr[0],Tr=nr[1];if(or<=Fa||or>=Ei||Tr<=Hi||Tr>=ba){pe[Ae]=As(nr);for(var Rr=Ae+1;Rr<Xe;++Rr){var Qr=pe[Rr],nn=Qr[0],mn=Qr[1];if(nn>Fa&&nn<Ei&&mn>Hi&&mn<ba)break}if(Rr===Ae+1)continue;if(Ae){var zn={index:-1,polygon:Gt,ring:pe.slice(0,Ae+1)};zn.ring[zn.ring.length-1]=Jo(Tr),ne[ne.length-1]=zn}else ne.pop();if(Rr>=Xe)break;ne.push({index:-1,polygon:Gt,ring:pe=pe.slice(Rr-1)}),pe[0]=Jo(pe[0][1]),Ae=-1,Xe=pe.length}}}}function No(Rt){var Gt,ne=Rt.length,oe={},be={},pe,Ae,Xe,nr,or;for(Gt=0;Gt<ne;++Gt){if(pe=Rt[Gt],Ae=pe.ring[0],nr=pe.ring[pe.ring.length-1],Ae[0]===nr[0]&&Ae[1]===nr[1]){pe.polygon.push(pe.ring),Rt[Gt]=null;continue}pe.index=Gt,oe[Ae]=be[nr]=pe}for(Gt=0;Gt<ne;++Gt)if(pe=Rt[Gt],pe){if(Ae=pe.ring[0],nr=pe.ring[pe.ring.length-1],Xe=be[Ae],or=oe[nr],delete oe[Ae],delete be[nr],Ae[0]===nr[0]&&Ae[1]===nr[1]){pe.polygon.push(pe.ring);continue}Xe?(delete be[Ae],delete oe[Xe.ring[0]],Xe.ring.pop(),Rt[Xe.index]=null,pe={index:-1,polygon:Xe.polygon,ring:Xe.ring.concat(pe.ring)},Xe===or?pe.polygon.push(pe.ring):(pe.index=ne++,Rt.push(oe[pe.ring[0]]=be[pe.ring[pe.ring.length-1]]=pe))):or?(delete oe[nr],delete be[or.ring[or.ring.length-1]],pe.ring.pop(),pe={index:ne++,polygon:or.polygon,ring:pe.ring.concat(or.ring)},Rt[or.index]=null,Rt.push(oe[pe.ring[0]]=be[pe.ring[pe.ring.length-1]]=pe)):(pe.ring.push(pe.ring[0]),pe.polygon.push(pe.ring))}}function Qs(Rt){var Gt={type:"Feature",geometry:Hs(Rt.geometry)};return Rt.id!=null&&(Gt.id=Rt.id),Rt.bbox!=null&&(Gt.bbox=Rt.bbox),Rt.properties!=null&&(Gt.properties=Rt.properties),Gt}function Hs(Rt){if(Rt==null)return Rt;var Gt,ne,oe,be;switch(Rt.type){case"GeometryCollection":Gt={type:"GeometryCollection",geometries:Rt.geometries.map(Hs)};break;case"Point":Gt={type:"Point",coordinates:As(Rt.coordinates)};break;case"MultiPoint":case"LineString":Gt={type:Rt.type,coordinates:os(Rt.coordinates)};break;case"MultiLineString":Gt={type:"MultiLineString",coordinates:Rt.coordinates.map(os)};break;case"Polygon":{var pe=[];xs(Rt.coordinates,pe,ne=[]),No(ne),Gt={type:"Polygon",coordinates:pe};break}case"MultiPolygon":{ne=[],oe=-1,be=Rt.coordinates.length;for(var Ae=new Array(be);++oe<be;)xs(Rt.coordinates[oe],Ae[oe]=[],ne);No(ne),Gt={type:"MultiPolygon",coordinates:Ae.filter($i)};break}default:return Rt}return Rt.bbox!=null&&(Gt.bbox=Rt.bbox),Gt}function Ms(Rt){if(Rt==null)return Rt;switch(Rt.type){case"Feature":return Qs(Rt);case"FeatureCollection":{var Gt={type:"FeatureCollection",features:Rt.features.map(Qs)};return Rt.bbox!=null&&(Gt.bbox=Rt.bbox),Gt}default:return Hs(Rt)}}function ni(Rt,Gt){var ne=y(Gt/2),oe=p(T*ne);return[Rt*(.74482-.34588*oe*oe),1.70711*ne]}ni.invert=function(Rt,Gt){var ne=Gt/1.70711,oe=p(T*ne);return[Rt/(.74482-.34588*oe*oe),2*t(ne)]};function to(){return g.geoProjection(ni).scale(146.153)}function ds(Rt,Gt,ne){var oe=g.geoInterpolate(Gt,ne),be=oe(.5),pe=g.geoRotation([-be[0],-be[1]])(Gt),Ae=oe.distance/2,Xe=-I(p(pe[1]*_)/p(Ae)),nr=[-be[0],-be[1],-(pe[0]>0?b-Xe:Xe)*k],or=g.geoProjection(Rt(Ae)).rotate(nr),Tr=g.geoRotation(nr),Rr=or.center;return delete or.rotate,or.center=function(Qr){return arguments.length?Rr(Tr(Qr)):Tr.invert(Rr())},or.clipAngle(90)}function Qo(Rt){var Gt=r(Rt);function ne(oe,be){var pe=g.geoGnomonicRaw(oe,be);return pe[0]*=Gt,pe}return ne.invert=function(oe,be){return g.geoGnomonicRaw.invert(oe/Gt,be)},ne}function Tl(){return Kl([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Kl(Rt,Gt){return ds(Qo,Rt,Gt)}function Fl(Rt){if(!(Rt*=2))return g.geoAzimuthalEquidistantRaw;var Gt=-Rt/2,ne=-Gt,oe=Rt*Rt,be=y(ne),pe=.5/p(ne);function Ae(Xe,nr){var or=O(r(nr)*r(Xe-Gt)),Tr=O(r(nr)*r(Xe-ne)),Rr=nr<0?-1:1;return or*=or,Tr*=Tr,[(or-Tr)/(2*Rt),Rr*B(4*oe*Tr-(oe-or+Tr)*(oe-or+Tr))/(2*Rt)]}return Ae.invert=function(Xe,nr){var or=nr*nr,Tr=r(B(or+(Qr=Xe+Gt)*Qr)),Rr=r(B(or+(Qr=Xe+ne)*Qr)),Qr,nn;return[e(nn=Tr-Rr,Qr=(Tr+Rr)*be),(nr<0?-1:1)*O(B(Qr*Qr+nn*nn)*pe)]},Ae}function tc(){return tu([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function tu(Rt,Gt){return ds(Fl,Rt,Gt)}function Uu(Rt,Gt){if(A(Gt)<l)return[Rt,0];var ne=A(Gt/S),oe=I(ne);if(A(Rt)<l||A(A(Gt)-S)<l)return[0,m(Gt)*b*y(oe/2)];var be=r(oe),pe=A(b/Rt-Rt/b)/2,Ae=pe*pe,Xe=be/(ne+be-1),nr=Xe*(2/ne-1),or=nr*nr,Tr=or+Ae,Rr=Xe-or,Qr=Ae+Xe;return[m(Rt)*b*(pe*Rr+B(Ae*Rr*Rr-Tr*(Xe*Xe-or)))/Tr,m(Gt)*b*(nr*Qr-pe*B((Ae+1)*Tr-Qr*Qr))/Tr]}Uu.invert=function(Rt,Gt){if(A(Gt)<l)return[Rt,0];if(A(Rt)<l)return[0,S*p(2*t(Gt/b))];var ne=(Rt/=b)*Rt,oe=(Gt/=b)*Gt,be=ne+oe,pe=be*be,Ae=-A(Gt)*(1+be),Xe=Ae-2*oe+ne,nr=-2*Ae+1+2*oe+pe,or=oe/nr+(2*Xe*Xe*Xe/(nr*nr*nr)-9*Ae*Xe/(nr*nr))/27,Tr=(Ae-Xe*Xe/(3*nr))/nr,Rr=2*B(-Tr/3),Qr=O(3*or/(Tr*Rr))/3;return[b*(be-1+B(1+2*(ne-oe)+pe))/(2*Rt),m(Gt)*b*(-Rr*r(Qr+b/3)-Xe/(3*nr))]};function $s(){return g.geoProjection(Uu).scale(79.4183)}function ec(Rt,Gt){if(A(Gt)<l)return[Rt,0];var ne=A(Gt/S),oe=I(ne);if(A(Rt)<l||A(A(Gt)-S)<l)return[0,m(Gt)*b*y(oe/2)];var be=r(oe),pe=A(b/Rt-Rt/b)/2,Ae=pe*pe,Xe=be*(B(1+Ae)-pe*be)/(1+Ae*ne*ne);return[m(Rt)*b*Xe,m(Gt)*b*B(1-Xe*(2*pe+Xe))]}ec.invert=function(Rt,Gt){if(!Rt)return[0,S*p(2*t(Gt/b))];var ne=A(Rt/b),oe=(1-ne*ne-(Gt/=b)*Gt)/(2*ne),be=oe*oe,pe=B(be+1);return[m(Rt)*b*(pe-oe),m(Gt)*S*p(2*e(B((1-2*oe*ne)*(oe+pe)-ne),B(pe+oe+ne)))]};function Ri(){return g.geoProjection(ec).scale(79.4183)}function oo(Rt,Gt){if(A(Gt)<l)return[Rt,0];var ne=Gt/S,oe=I(ne);if(A(Rt)<l||A(A(Gt)-S)<l)return[0,b*y(oe/2)];var be=(b/Rt-Rt/b)/2,pe=ne/(1+r(oe));return[b*(m(Rt)*B(be*be+1-pe*pe)-be),b*pe]}oo.invert=function(Rt,Gt){if(!Gt)return[Rt,0];var ne=Gt/b,oe=(b*b*(1-ne*ne)-Rt*Rt)/(2*b*Rt);return[Rt?b*(m(Rt)*B(oe*oe+1)-oe):0,S*p(2*t(ne))]};function bu(){return g.geoProjection(oo).scale(79.4183)}function Cl(Rt,Gt){if(!Gt)return[Rt,0];var ne=A(Gt);if(!Rt||ne===S)return[0,Gt];var oe=ne/S,be=oe*oe,pe=(8*oe-be*(be+2)-5)/(2*be*(oe-1)),Ae=pe*pe,Xe=oe*pe,nr=be+Ae+2*Xe,or=oe+3*pe,Tr=Rt/S,Rr=Tr+1/Tr,Qr=m(A(Rt)-S)*B(Rr*Rr-4),nn=Qr*Qr,mn=nr*(be+Ae*nn-1)+(1-be)*(be*(or*or+4*Ae)+12*Xe*Ae+4*Ae*Ae),zn=(Qr*(nr+Ae-1)+2*B(mn))/(4*nr+nn);return[m(Rt)*S*zn,m(Gt)*S*B(1+Qr*A(zn)-zn*zn)]}Cl.invert=function(Rt,Gt){var ne;if(!Rt||!Gt)return[Rt,Gt];Gt/=b;var oe=m(Rt)*Rt/S,be=(oe*oe-1+4*Gt*Gt)/A(oe),pe=be*be,Ae=2*Gt,Xe=50;do{var nr=Ae*Ae,or=(8*Ae-nr*(nr+2)-5)/(2*nr*(Ae-1)),Tr=(3*Ae-nr*Ae-10)/(2*nr*Ae),Rr=or*or,Qr=Ae*or,nn=Ae+or,mn=nn*nn,zn=Ae+3*or,na=mn*(nr+Rr*pe-1)+(1-nr)*(nr*(zn*zn+4*Rr)+Rr*(12*Qr+4*Rr)),Yn=-2*nn*(4*Qr*Rr+(1-4*nr+3*nr*nr)*(1+Tr)+Rr*(-6+14*nr-pe+(-8+8*nr-2*pe)*Tr)+Qr*(-8+12*nr+(-10+10*nr-pe)*Tr)),la=B(na),Na=be*(mn+Rr-1)+2*la-oe*(4*mn+pe),li=be*(2*or*Tr+2*nn*(1+Tr))+Yn/la-8*nn*(be*(-1+Rr+mn)+2*la)*(1+Tr)/(pe+4*mn);Ae-=ne=Na/li}while(ne>l&&--Xe>0);return[m(Rt)*(B(be*be+4)+be)*b/4,S*Ae]};function Th(){return g.geoProjection(Cl).scale(127.16)}function Lt(Rt,Gt,ne,oe,be){function pe(Ae,Xe){var nr=ne*p(oe*Xe),or=B(1-nr*nr),Tr=B(2/(1+or*r(Ae*=be)));return[Rt*or*Tr*p(Ae),Gt*nr*Tr]}return pe.invert=function(Ae,Xe){var nr=Ae/Rt,or=Xe/Gt,Tr=B(nr*nr+or*or),Rr=2*I(Tr/2);return[e(Ae*y(Rr),Rt*Tr)/be,Tr&&I(Xe*p(Rr)/(Gt*ne*Tr))/oe]},pe}function P(Rt,Gt,ne,oe){var be=b/3;Rt=a(Rt,l),Gt=a(Gt,l),Rt=s(Rt,S),Gt=s(Gt,b-l),ne=a(ne,0),ne=s(ne,100-l),oe=a(oe,l);var pe=ne/100+1,Ae=oe/100,Xe=O(pe*r(be))/be,nr=p(Rt)/p(Xe*S),or=Gt/b,Tr=B(Ae*p(Rt/2)/p(Gt/2)),Rr=Tr/B(or*nr*Xe),Qr=1/(Tr*B(or*nr*Xe));return Lt(Rr,Qr,nr,Xe,or)}function at(){var Rt=65*_,Gt=60*_,ne=20,oe=200,be=g.geoProjectionMutator(P),pe=be(Rt,Gt,ne,oe);return pe.poleline=function(Ae){return arguments.length?be(Rt=+Ae*_,Gt,ne,oe):Rt*k},pe.parallels=function(Ae){return arguments.length?be(Rt,Gt=+Ae*_,ne,oe):Gt*k},pe.inflation=function(Ae){return arguments.length?be(Rt,Gt,ne=+Ae,oe):ne},pe.ratio=function(Ae){return arguments.length?be(Rt,Gt,ne,oe=+Ae):oe},pe.scale(163.775)}function _t(){return at().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var Tt=4*b+3*B(3),Pt=2*B(2*b*B(3)/Tt),ie=Qt(Pt*B(3)/b,Pt,Tt/6);function de(){return g.geoProjection(ie).scale(176.84)}function Ee(Rt,Gt){return[Rt*B(1-3*Gt*Gt/(b*b)),Gt]}Ee.invert=function(Rt,Gt){return[Rt/B(1-3*Gt*Gt/(b*b)),Gt]};function He(){return g.geoProjection(Ee).scale(152.63)}function ar(Rt,Gt){var ne=r(Gt),oe=r(Rt)*ne,be=1-oe,pe=r(Rt=e(p(Rt)*ne,-p(Gt))),Ae=p(Rt);return ne=B(1-oe*oe),[Ae*ne-pe*be,-pe*ne-Ae*be]}ar.invert=function(Rt,Gt){var ne=(Rt*Rt+Gt*Gt)/-2,oe=B(-ne*(2+ne)),be=Gt*ne+Rt*oe,pe=Rt*ne-Gt*oe,Ae=B(pe*pe+be*be);return[e(oe*be,Ae*(1+ne)),Ae?-I(oe*pe/Ae):0]};function ir(){return g.geoProjection(ar).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function zr(Rt,Gt){var ne=ct(Rt,Gt);return[(ne[0]+Rt/S)/2,(ne[1]+Gt)/2]}zr.invert=function(Rt,Gt){var ne=Rt,oe=Gt,be=25;do{var pe=r(oe),Ae=p(oe),Xe=p(2*oe),nr=Ae*Ae,or=pe*pe,Tr=p(ne),Rr=r(ne/2),Qr=p(ne/2),nn=Qr*Qr,mn=1-or*Rr*Rr,zn=mn?O(pe*Rr)*B(na=1/mn):na=0,na,Yn=.5*(2*zn*pe*Qr+ne/S)-Rt,la=.5*(zn*Ae+oe)-Gt,Na=.5*na*(or*nn+zn*pe*Rr*nr)+.5/S,li=na*(Tr*Xe/4-zn*Ae*Qr),Ka=.125*na*(Xe*Qr-zn*Ae*or*Tr),Gi=.5*na*(nr*Rr+zn*nn*pe)+.5,jo=li*Ka-Gi*Na,Uo=(la*li-Yn*Gi)/jo,ho=(Yn*Ka-la*Na)/jo;ne-=Uo,oe-=ho}while((A(Uo)>l||A(ho)>l)&&--be>0);return[ne,oe]};function Zr(){return g.geoProjection(zr).scale(158.837)}c.geoNaturalEarth=g.geoNaturalEarth1,c.geoNaturalEarthRaw=g.geoNaturalEarth1Raw,c.geoAiry=rt,c.geoAiryRaw=G,c.geoAitoff=lt,c.geoAitoffRaw=ct,c.geoArmadillo=Z,c.geoArmadilloRaw=tt,c.geoAugust=$,c.geoAugustRaw=st,c.geoBaker=q,c.geoBakerRaw=Y,c.geoBerghaus=it,c.geoBerghausRaw=ot,c.geoBertin1953=te,c.geoBertin1953Raw=Nt,c.geoBoggs=Kt,c.geoBoggsRaw=Ut,c.geoBonne=Fe,c.geoBonneRaw=Se,c.geoBottomley=ur,c.geoBottomleyRaw=Oe,c.geoBromley=We,c.geoBromleyRaw=fr,c.geoChamberlin=ut,c.geoChamberlinRaw=Dt,c.geoChamberlinAfrica=zt,c.geoCollignon=Mt,c.geoCollignonRaw=yt,c.geoCraig=$t,c.geoCraigRaw=Ot,c.geoCraster=Me,c.geoCrasterRaw=we,c.geoCylindricalEqualArea=Be,c.geoCylindricalEqualAreaRaw=Re,c.geoCylindricalStereographic=Ue,c.geoCylindricalStereographicRaw=Ze,c.geoEckert1=ln,c.geoEckert1Raw=mr,c.geoEckert2=vn,c.geoEckert2Raw=an,c.geoEckert3=An,c.geoEckert3Raw=Sn,c.geoEckert4=On,c.geoEckert4Raw=pn,c.geoEckert5=ke,c.geoEckert5Raw=Nn,c.geoEckert6=je,c.geoEckert6Raw=ze,c.geoEisenlohr=Xr,c.geoEisenlohrRaw=_r,c.geoFahey=_n,c.geoFaheyRaw=Br,c.geoFoucaut=Fn,c.geoFoucautRaw=bn,c.geoFoucautSinusoidal=Bn,c.geoFoucautSinusoidalRaw=on,c.geoGilbert=Pr,c.geoGingery=Er,c.geoGingeryRaw=Sr,c.geoGinzburg4=Gr,c.geoGinzburg4Raw=Ar,c.geoGinzburg5=Jr,c.geoGinzburg5Raw=Wr,c.geoGinzburg6=Je,c.geoGinzburg6Raw=_e,c.geoGinzburg8=Hr,c.geoGinzburg8Raw=yr,c.geoGinzburg9=En,c.geoGinzburg9Raw=hn,c.geoGringorten=Qn,c.geoGringortenRaw=Kr,c.geoGuyou=Ui,c.geoGuyouRaw=bi,c.geoHammer=xt,c.geoHammerRaw=dt,c.geoHammerRetroazimuthal=Bo,c.geoHammerRetroazimuthalRaw=lo,c.geoHealpix=vs,c.geoHealpixRaw=ko,c.geoHill=ls,c.geoHillRaw=es,c.geoHomolosine=qi,c.geoHomolosineRaw=fs,c.geoHufnagel=Po,c.geoHufnagelRaw=ms,c.geoHyperelliptical=Oi,c.geoHyperellipticalRaw=za,c.geoInterrupt=Ci,c.geoInterruptedBoggs=ql,c.geoInterruptedHomolosine=Hl,c.geoInterruptedMollweide=Es,c.geoInterruptedMollweideHemispheres=Wu,c.geoInterruptedSinuMollweide=Fu,c.geoInterruptedSinusoidal=ih,c.geoKavrayskiy7=du,c.geoKavrayskiy7Raw=ns,c.geoLagrange=ll,c.geoLagrangeRaw=Ic,c.geoLarrivee=Zu,c.geoLarriveeRaw=ul,c.geoLaskowski=pl,c.geoLaskowskiRaw=ys,c.geoLittrow=ks,c.geoLittrowRaw=$o,c.geoLoximuthal=Ol,c.geoLoximuthalRaw=Bu,c.geoMiller=Cs,c.geoMillerRaw=Xu,c.geoModifiedStereographic=rl,c.geoModifiedStereographicRaw=zh,c.geoModifiedStereographicAlaska=gu,c.geoModifiedStereographicGs48=Pl,c.geoModifiedStereographicGs50=Wc,c.geoModifiedStereographicMiller=$u,c.geoModifiedStereographicLee=dc,c.geoMollweide=gt,c.geoMollweideRaw=Wt,c.geoMtFlatPolarParabolic=Ju,c.geoMtFlatPolarParabolicRaw=Lc,c.geoMtFlatPolarQuartic=Xc,c.geoMtFlatPolarQuarticRaw=Cc,c.geoMtFlatPolarSinusoidal=$c,c.geoMtFlatPolarSinusoidalRaw=mu,c.geoNaturalEarth2=vu,c.geoNaturalEarth2Raw=nc,c.geoNellHammer=yc,c.geoNellHammerRaw=Gl,c.geoInterruptedQuarticAuthalic=ps,c.geoNicolosi=Fh,c.geoNicolosiRaw=Dc,c.geoPatterson=yu,c.geoPattersonRaw=Qu,c.geoPolyconic=Ds,c.geoPolyconicRaw=Xl,c.geoPolyhedral=ac,c.geoPolyhedralButterfly=Os,c.geoPolyhedralCollignon=ch,c.geoPolyhedralWaterman=Ps,c.geoProject=cl,c.geoGringortenQuincuncial=Ve,c.geoPeirceQuincuncial=lr,c.geoPierceQuincuncial=lr,c.geoQuantize=Ur,c.geoQuincuncial=wc,c.geoRectangularPolyconic=un,c.geoRectangularPolyconicRaw=Or,c.geoRobinson=oa,c.geoRobinsonRaw=Gn,c.geoSatellite=Jn,c.geoSatelliteRaw=Pa,c.geoSinuMollweide=Ls,c.geoSinuMollweideRaw=Xa,c.geoSinusoidal=Te,c.geoSinusoidalRaw=le,c.geoStitch=Ms,c.geoTimes=to,c.geoTimesRaw=ni,c.geoTwoPointAzimuthal=Kl,c.geoTwoPointAzimuthalRaw=Qo,c.geoTwoPointAzimuthalUsa=Tl,c.geoTwoPointEquidistant=tu,c.geoTwoPointEquidistantRaw=Fl,c.geoTwoPointEquidistantUsa=tc,c.geoVanDerGrinten=$s,c.geoVanDerGrintenRaw=Uu,c.geoVanDerGrinten2=Ri,c.geoVanDerGrinten2Raw=ec,c.geoVanDerGrinten3=bu,c.geoVanDerGrinten3Raw=oo,c.geoVanDerGrinten4=Th,c.geoVanDerGrinten4Raw=Cl,c.geoWagner=at,c.geoWagner7=_t,c.geoWagnerRaw=P,c.geoWagner4=de,c.geoWagner4Raw=ie,c.geoWagner6=He,c.geoWagner6Raw=Ee,c.geoWiechel=ir,c.geoWiechelRaw=ar,c.geoWinkel3=Zr,c.geoWinkel3Raw=zr,Object.defineProperty(c,"__esModule",{value:!0})})}),e8=Vt((X,V)=>{var c=Ai(),g=qr(),E=Mi(),A=Math.PI/180,t=180/Math.PI,e={cursor:"pointer"},r={cursor:"auto"};function i(k,_){var D=k.projection,I;return _._isScoped?I=a:_._isClipped?I=h:I=s,I(k,D)}V.exports=i;function n(k,_){return c.behavior.zoom().translate(_.translate()).scale(_.scale())}function o(k,_,D){var I=k.id,O=k.graphDiv,B=O.layout,R=B[I],L=O._fullLayout,F=L[I],N={},j={};function G(rt,ct){N[I+"."+rt]=g.nestedProperty(R,rt).get(),E.call("_storeDirectGUIEdit",B,L._preGUI,N);var lt=g.nestedProperty(F,rt);lt.get()!==ct&&(lt.set(ct),g.nestedProperty(R,rt).set(ct),j[I+"."+rt]=ct)}D(G),G("projection.scale",_.scale()/k.fitScale),G("fitbounds",!1),O.emit("plotly_relayout",j)}function a(k,_){var D=n(k,_);function I(){c.select(this).style(e)}function O(){_.scale(c.event.scale).translate(c.event.translate),k.render(!0);var L=_.invert(k.midPt);k.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":_.scale()/k.fitScale,"geo.center.lon":L[0],"geo.center.lat":L[1]})}function B(L){var F=_.invert(k.midPt);L("center.lon",F[0]),L("center.lat",F[1])}function R(){c.select(this).style(r),o(k,_,B)}return D.on("zoomstart",I).on("zoom",O).on("zoomend",R),D}function s(k,_){var D=n(k,_),I=2,O,B,R,L,F,N,j,G,rt;function ct(Q){return _.invert(Q)}function lt(Q){var nt=ct(Q);if(!nt)return!0;var Y=_(nt);return Math.abs(Y[0]-Q[0])>I||Math.abs(Y[1]-Q[1])>I}function tt(){c.select(this).style(e),O=c.mouse(this),B=_.rotate(),R=_.translate(),L=B,F=ct(O)}function Z(){if(N=c.mouse(this),lt(O)){D.scale(_.scale()),D.translate(_.translate());return}_.scale(c.event.scale),_.translate([R[0],c.event.translate[1]]),F?ct(N)&&(G=ct(N),j=[L[0]+(G[0]-F[0]),B[1],B[2]],_.rotate(j),L=j):(O=N,F=ct(O)),rt=!0,k.render(!0);var Q=_.rotate(),nt=_.invert(k.midPt);k.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":_.scale()/k.fitScale,"geo.center.lon":nt[0],"geo.center.lat":nt[1],"geo.projection.rotation.lon":-Q[0]})}function st(){c.select(this).style(r),rt&&o(k,_,$)}function $(Q){var nt=_.rotate(),Y=_.invert(k.midPt);Q("projection.rotation.lon",-nt[0]),Q("center.lon",Y[0]),Q("center.lat",Y[1])}return D.on("zoomstart",tt).on("zoom",Z).on("zoomend",st),D}function h(k,_){_.rotate(),_.scale();var D=n(k,_),I=f(D,"zoomstart","zoom","zoomend"),O=0,B=D.on,R;D.on("zoomstart",function(){c.select(this).style(e);var G=c.mouse(this),rt=_.rotate(),ct=rt,lt=_.translate(),tt=m(rt);R=v(_,G),B.call(D,"zoom",function(){var Z=c.mouse(this);if(_.scale(c.event.scale),!R)G=Z,R=v(_,G);else if(v(_,Z)){_.rotate(rt).translate(lt);var st=v(_,Z),$=y(R,st),Q=T(p(tt,$)),nt=l(Q,R,ct);(!isFinite(nt[0])||!isFinite(nt[1])||!isFinite(nt[2]))&&(nt=ct),_.rotate(nt),ct=nt}F(I.of(this,arguments))}),L(I.of(this,arguments))}).on("zoomend",function(){c.select(this).style(r),B.call(D,"zoom",null),N(I.of(this,arguments)),o(k,_,j)}).on("zoom.redraw",function(){k.render(!0);var G=_.rotate();k.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":_.scale()/k.fitScale,"geo.projection.rotation.lon":-G[0],"geo.projection.rotation.lat":-G[1]})});function L(G){O++||G({type:"zoomstart"})}function F(G){G({type:"zoom"})}function N(G){--O||G({type:"zoomend"})}function j(G){var rt=_.rotate();G("projection.rotation.lon",-rt[0]),G("projection.rotation.lat",-rt[1])}return c.rebind(D,I,"on")}function v(k,_){var D=k.invert(_);return D&&isFinite(D[0])&&isFinite(D[1])&&M(D)}function m(k){var _=.5*k[0]*A,D=.5*k[1]*A,I=.5*k[2]*A,O=Math.sin(_),B=Math.cos(_),R=Math.sin(D),L=Math.cos(D),F=Math.sin(I),N=Math.cos(I);return[B*L*N+O*R*F,O*L*N-B*R*F,B*R*N+O*L*F,B*L*F-O*R*N]}function p(k,_){var D=k[0],I=k[1],O=k[2],B=k[3],R=_[0],L=_[1],F=_[2],N=_[3];return[D*R-I*L-O*F-B*N,D*L+I*R+O*N-B*F,D*F-I*N+O*R+B*L,D*N+I*F-O*L+B*R]}function y(k,_){if(!(!k||!_)){var D=u(k,_),I=Math.sqrt(w(D,D)),O=.5*Math.acos(Math.max(-1,Math.min(1,w(k,_)))),B=Math.sin(O)/I;return I&&[Math.cos(O),D[2]*B,-D[1]*B,D[0]*B]}}function l(k,_,D){var I=S(_,2,k[0]);I=S(I,1,k[1]),I=S(I,0,k[2]-D[2]);var O=_[0],B=_[1],R=_[2],L=I[0],F=I[1],N=I[2],j=Math.atan2(B,O)*t,G=Math.sqrt(O*O+B*B),rt,ct;Math.abs(F)>G?(ct=(F>0?90:-90)-j,rt=0):(ct=Math.asin(F/G)*t-j,rt=Math.sqrt(G*G-F*F));var lt=180-ct-2*j,tt=(Math.atan2(N,L)-Math.atan2(R,rt))*t,Z=(Math.atan2(N,L)-Math.atan2(R,-rt))*t,st=x(D[0],D[1],ct,tt),$=x(D[0],D[1],lt,Z);return st<=$?[ct,tt,D[2]]:[lt,Z,D[2]]}function x(k,_,D,I){var O=b(D-k),B=b(I-_);return Math.sqrt(O*O+B*B)}function b(k){return(k%360+540)%360-180}function S(k,_,D){var I=D*A,O=k.slice(),B=_===0?1:0,R=_===2?1:2,L=Math.cos(I),F=Math.sin(I);return O[B]=k[B]*L-k[R]*F,O[R]=k[R]*L+k[B]*F,O}function T(k){return[Math.atan2(2*(k[0]*k[1]+k[2]*k[3]),1-2*(k[1]*k[1]+k[2]*k[2]))*t,Math.asin(Math.max(-1,Math.min(1,2*(k[0]*k[2]-k[3]*k[1]))))*t,Math.atan2(2*(k[0]*k[3]+k[1]*k[2]),1-2*(k[2]*k[2]+k[3]*k[3]))*t]}function M(k){var _=k[0]*A,D=k[1]*A,I=Math.cos(D);return[I*Math.cos(_),I*Math.sin(_),Math.sin(D)]}function w(k,_){for(var D=0,I=0,O=k.length;I<O;++I)D+=k[I]*_[I];return D}function u(k,_){return[k[1]*_[2]-k[2]*_[1],k[2]*_[0]-k[0]*_[2],k[0]*_[1]-k[1]*_[0]]}function f(k){for(var _=0,D=arguments.length,I=[];++_<D;)I.push(arguments[_]);var O=c.dispatch.apply(null,I);return O.of=function(B,R){return function(L){var F;try{F=L.sourceEvent=c.event,L.target=k,c.event=L,O[L.type].apply(B,R)}finally{c.event=F}}},O}}),r8=Vt((X,V)=>{var c=Ai(),g=A3(),E=g.geoPath,A=g.geoDistance,t=t8(),e=Mi(),r=qr(),i=r.strTranslate,n=vi(),o=go(),a=Hu(),s=fu(),h=ao(),v=Kf().getAutoRange,m=af(),p=fc().prepSelect,y=fc().clearOutline,l=fc().selectOnClick,x=e8(),b=Mv(),S=Vd(),T=Ax(),M=w3().feature;function w(D){this.id=D.id,this.graphDiv=D.graphDiv,this.container=D.container,this.topojsonURL=D.topojsonURL,this.isStatic=D.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.scope=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}var u=w.prototype;V.exports=function(D){return new w(D)},u.plot=function(D,I,O,B){var R=this;if(B)return R.update(D,I,!0);R._geoCalcData=D,R._fullLayout=I;var L=I[this.id],F=[],N=!1;for(var j in b.layerNameToAdjective)if(j!=="frame"&&L["show"+j]){N=!0;break}for(var G=!1,rt=0;rt<D.length;rt++){var ct=D[0][0].trace;ct._geo=R,ct.locationmode&&(N=!0);var lt=ct.marker;if(lt){var tt=lt.angle,Z=lt.angleref;(tt||Z==="north"||Z==="previous")&&(G=!0)}}if(this._hasMarkerAngles=G,N){var st=T.getTopojsonName(L);(R.topojson===null||st!==R.topojsonName)&&(R.topojsonName=st,PlotlyGeoAssets.topojson[R.topojsonName]===void 0&&F.push(R.fetchTopojson()))}F=F.concat(S.fetchTraceGeoData(D)),O.push(new Promise(function($,Q){Promise.all(F).then(function(){R.topojson=PlotlyGeoAssets.topojson[R.topojsonName],R.update(D,I),$()}).catch(Q)}))},u.fetchTopojson=function(){var D=this,I=T.getTopojsonPath(D.topojsonURL,D.topojsonName);return new Promise(function(O,B){c.json(I,function(R,L){if(R)return R.status===404?B(new Error(["plotly.js could not find topojson file at",I+".","Make sure the *topojsonURL* plot config option","is set properly."].join(" "))):B(new Error(["unexpected error while fetching topojson file at",I].join(" ")));PlotlyGeoAssets.topojson[D.topojsonName]=L,O()})})},u.update=function(D,I,O){var B=I[this.id];this.hasChoropleth=!1;for(var R=0;R<D.length;R++){var L=D[R],F=L[0].trace;F.type==="choropleth"&&(this.hasChoropleth=!0),F.visible===!0&&F._length>0&&F._module.calcGeoJSON(L,I)}if(!O){var N=this.updateProjection(D,I);if(N)return;(!this.viewInitial||this.scope!==B.scope)&&this.saveViewInitial(B)}this.scope=B.scope,this.updateBaseLayers(I,B),this.updateDims(I,B),this.updateFx(I,B),s.generalUpdatePerTraceModule(this.graphDiv,this,D,B);var j=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=j.selectAll(".point"),this.dataPoints.text=j.selectAll("text"),this.dataPaths.line=j.selectAll(".js-line");var G=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=G.selectAll("path"),this._render()},u.updateProjection=function(D,I){var O=this.graphDiv,B=I[this.id],R=I._size,L=B.domain,F=B.projection,N=B.lonaxis,j=B.lataxis,G=N._ax,rt=j._ax,ct=this.projection=f(B),lt=[[R.l+R.w*L.x[0],R.t+R.h*(1-L.y[1])],[R.l+R.w*L.x[1],R.t+R.h*(1-L.y[0])]],tt=B.center||{},Z=F.rotation||{},st=N.range||[],$=j.range||[];if(B.fitbounds){G._length=lt[1][0]-lt[0][0],rt._length=lt[1][1]-lt[0][1],G.range=v(O,G),rt.range=v(O,rt);var Q=(G.range[0]+G.range[1])/2,nt=(rt.range[0]+rt.range[1])/2;if(B._isScoped)tt={lon:Q,lat:nt};else if(B._isClipped){tt={lon:Q,lat:nt},Z={lon:Q,lat:nt,roll:Z.roll};var Y=F.type,q=b.lonaxisSpan[Y]/2||180,ot=b.lataxisSpan[Y]/2||90;st=[Q-q,Q+q],$=[nt-ot,nt+ot]}else tt={lon:Q,lat:nt},Z={lon:Q,lat:Z.lat,roll:Z.roll}}ct.center([tt.lon-Z.lon,tt.lat-Z.lat]).rotate([-Z.lon,-Z.lat,Z.roll]).parallels(F.parallels);var it=_(st,$);ct.fitExtent(lt,it);var dt=this.bounds=ct.getBounds(it),wt=this.fitScale=ct.scale(),xt=ct.translate();if(B.fitbounds){var Ft=ct.getBounds(_(G.range,rt.range)),Et=Math.min((dt[1][0]-dt[0][0])/(Ft[1][0]-Ft[0][0]),(dt[1][1]-dt[0][1])/(Ft[1][1]-Ft[0][1]));isFinite(Et)?ct.scale(Et*wt):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else ct.scale(F.scale*wt);var Nt=this.midPt=[(dt[0][0]+dt[1][0])/2,(dt[0][1]+dt[1][1])/2];if(ct.translate([xt[0]+(Nt[0]-xt[0]),xt[1]+(Nt[1]-xt[1])]).clipExtent(dt),B._isAlbersUsa){var te=ct([tt.lon,tt.lat]),Jt=ct.translate();ct.translate([Jt[0]-(te[0]-Jt[0]),Jt[1]-(te[1]-Jt[1])])}},u.updateBaseLayers=function(D,I){var O=this,B=O.topojson,R=O.layers,L=O.basePaths;function F(lt){return lt==="lonaxis"||lt==="lataxis"}function N(lt){return!!b.lineLayers[lt]}function j(lt){return!!b.fillLayers[lt]}var G=this.hasChoropleth?b.layersForChoropleth:b.layers,rt=G.filter(function(lt){return N(lt)||j(lt)?I["show"+lt]:F(lt)?I[lt].showgrid:!0}),ct=O.framework.selectAll(".layer").data(rt,String);ct.exit().each(function(lt){delete R[lt],delete L[lt],c.select(this).remove()}),ct.enter().append("g").attr("class",function(lt){return"layer "+lt}).each(function(lt){var tt=R[lt]=c.select(this);lt==="bg"?O.bgRect=tt.append("rect").style("pointer-events","all"):F(lt)?L[lt]=tt.append("path").style("fill","none"):lt==="backplot"?tt.append("g").classed("choroplethlayer",!0):lt==="frontplot"?tt.append("g").classed("scatterlayer",!0):N(lt)?L[lt]=tt.append("path").style("fill","none").style("stroke-miterlimit",2):j(lt)&&(L[lt]=tt.append("path").style("stroke","none"))}),ct.order(),ct.each(function(lt){var tt=L[lt],Z=b.layerNameToAdjective[lt];lt==="frame"?tt.datum(b.sphereSVG):N(lt)||j(lt)?tt.datum(M(B,B.objects[lt])):F(lt)&&tt.datum(k(lt,I,D)).call(n.stroke,I[lt].gridcolor).call(o.dashLine,I[lt].griddash,I[lt].gridwidth),N(lt)?tt.call(n.stroke,I[Z+"color"]).call(o.dashLine,"",I[Z+"width"]):j(lt)&&tt.call(n.fill,I[Z+"color"])})},u.updateDims=function(D,I){var O=this.bounds,B=(I.framewidth||0)/2,R=O[0][0]-B,L=O[0][1]-B,F=O[1][0]-R+B,N=O[1][1]-L+B;o.setRect(this.clipRect,R,L,F,N),this.bgRect.call(o.setRect,R,L,F,N).call(n.fill,I.bgcolor),this.xaxis._offset=R,this.xaxis._length=F,this.yaxis._offset=L,this.yaxis._length=N},u.updateFx=function(D,I){var O=this,B=O.graphDiv,R=O.bgRect,L=D.dragmode,F=D.clickmode;if(O.isStatic)return;function N(){var ct=O.viewInitial,lt={};for(var tt in ct)lt[O.id+"."+tt]=ct[tt];e.call("_guiRelayout",B,lt),B.emit("plotly_doubleclick",null)}function j(ct){return O.projection.invert([ct[0]+O.xaxis._offset,ct[1]+O.yaxis._offset])}var G=function(ct,lt){if(lt.isRect){var tt=ct.range={};tt[O.id]=[j([lt.xmin,lt.ymin]),j([lt.xmax,lt.ymax])]}else{var Z=ct.lassoPoints={};Z[O.id]=lt.map(j)}},rt={element:O.bgRect.node(),gd:B,plotinfo:{id:O.id,xaxis:O.xaxis,yaxis:O.yaxis,fillRangeItems:G},xaxes:[O.xaxis],yaxes:[O.yaxis],subplot:O.id,clickFn:function(ct){ct===2&&y(B)}};L==="pan"?(R.node().onmousedown=null,R.call(x(O,I)),R.on("dblclick.zoom",N),B._context._scrollZoom.geo||R.on("wheel.zoom",null)):(L==="select"||L==="lasso")&&(R.on(".zoom",null),rt.prepFn=function(ct,lt,tt){p(ct,lt,tt,rt,L)},m.init(rt)),R.on("mousemove",function(){var ct=O.projection.invert(r.getPositionFromD3Event());if(!ct)return m.unhover(B,c.event);O.xaxis.p2c=function(){return ct[0]},O.yaxis.p2c=function(){return ct[1]},a.hover(B,c.event,O.id)}),R.on("mouseout",function(){B._dragging||m.unhover(B,c.event)}),R.on("click",function(){L!=="select"&&L!=="lasso"&&(F.indexOf("select")>-1&&l(c.event,B,[O.xaxis],[O.yaxis],O.id,rt),F.indexOf("event")>-1&&a.click(B,c.event))})},u.makeFramework=function(){var D=this,I=D.graphDiv,O=I._fullLayout,B="clip"+O._uid+D.id;D.clipDef=O._clips.append("clipPath").attr("id",B),D.clipRect=D.clipDef.append("rect"),D.framework=c.select(D.container).append("g").attr("class","geo "+D.id).call(o.setClipUrl,B,I),D.project=function(R){var L=D.projection(R);return L?[L[0]-D.xaxis._offset,L[1]-D.yaxis._offset]:[null,null]},D.xaxis={_id:"x",c2p:function(R){return D.project(R)[0]}},D.yaxis={_id:"y",c2p:function(R){return D.project(R)[1]}},D.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},h.setConvert(D.mockAxis,O)},u.saveViewInitial=function(D){var I=D.center||{},O=D.projection,B=O.rotation||{};this.viewInitial={fitbounds:D.fitbounds,"projection.scale":O.scale};var R;D._isScoped?R={"center.lon":I.lon,"center.lat":I.lat}:D._isClipped?R={"projection.rotation.lon":B.lon,"projection.rotation.lat":B.lat}:R={"center.lon":I.lon,"center.lat":I.lat,"projection.rotation.lon":B.lon},r.extendFlat(this.viewInitial,R)},u.render=function(D){this._hasMarkerAngles&&D?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},u._render=function(){var D=this.projection,I=D.getPath(),O;function B(L){var F=D(L.lonlat);return F?i(F[0],F[1]):null}function R(L){return D.isLonLatOverEdges(L.lonlat)?"none":null}for(O in this.basePaths)this.basePaths[O].attr("d",I);for(O in this.dataPaths)this.dataPaths[O].attr("d",function(L){return I(L.geojson)});for(O in this.dataPoints)this.dataPoints[O].attr("display",R).attr("transform",B)};function f(D){var I=D.projection,O=I.type,B=b.projNames[O];B="geo"+r.titleCase(B);for(var R=g[B]||t[B],L=R(),F=D._isSatellite?Math.acos(1/I.distance)*180/Math.PI:D._isClipped?b.lonaxisSpan[O]/2:null,N=["center","rotate","parallels","clipExtent"],j=function(ct){return ct?L:[]},G=0;G<N.length;G++){var rt=N[G];typeof L[rt]!="function"&&(L[rt]=j)}return L.isLonLatOverEdges=function(ct){if(L(ct)===null)return!0;if(F){var lt=L.rotate(),tt=A(ct,[-lt[0],-lt[1]]),Z=F*Math.PI/180;return tt>Z}else return!1},L.getPath=function(){return E().projection(L)},L.getBounds=function(ct){return L.getPath().bounds(ct)},L.precision(b.precision),D._isSatellite&&L.tilt(I.tilt).distance(I.distance),F&&L.clipAngle(F-b.clipPad),L}function k(D,I,O){var B=1e-6,R=2.5,L=I[D],F=b.scopeDefaults[I.scope],N,j,G;D==="lonaxis"?(N=F.lonaxisRange,j=F.lataxisRange,G=function(nt,Y){return[nt,Y]}):D==="lataxis"&&(N=F.lataxisRange,j=F.lonaxisRange,G=function(nt,Y){return[Y,nt]});var rt={type:"linear",range:[N[0],N[1]-B],tick0:L.tick0,dtick:L.dtick};h.setConvert(rt,O);var ct=h.calcTicks(rt);!I.isScoped&&D==="lonaxis"&&ct.pop();for(var lt=ct.length,tt=new Array(lt),Z=0;Z<lt;Z++)for(var st=ct[Z].x,$=tt[Z]=[],Q=j[0];Q<j[1]+R;Q+=R)$.push(G(st,Q));return{type:"MultiLineString",coordinates:tt}}function _(D,I){var O=b.clipPad,B=D[0]+O,R=D[1]-O,L=I[0]+O,F=I[1]-O;B>0&&R<0&&(R+=360);var N=(R-B)/4;return{type:"Polygon",coordinates:[[[B,L],[B,F],[B+N,F],[B+2*N,F],[B+3*N,F],[R,F],[R,L],[R-N,L],[R-2*N,L],[R-3*N,L],[B,L]]]}}}),M3=Vt((X,V)=>{var c=Hc(),g=pu().attributes,E=Eh().dash,A=Mv(),t=su().overrideAll,e=Td(),r={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:c.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:E},i=V.exports=t({domain:g({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:e(A.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:e(A.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:c.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:A.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:A.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:A.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:A.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:c.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:c.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:c.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:c.background},lonaxis:r,lataxis:r},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}),n8=Vt((X,V)=>{var c=qr(),g=Ld(),E=Ph().getSubplotData,A=Mv(),t=M3(),e=A.axesNames;V.exports=function(i,n,o){g(i,n,o,{type:"geo",attributes:t,handleDefaults:r,fullData:o,partition:"y"})};function r(i,n,o,a){var s=E(a.fullData,"geo",a.id),h=s.map(function($){return $.index}),v=o("resolution"),m=o("scope"),p=A.scopeDefaults[m],y=o("projection.type",p.projType),l=n._isAlbersUsa=y==="albers usa";l&&(m=n.scope="usa");var x=n._isScoped=m!=="world",b=n._isSatellite=y==="satellite",S=n._isConic=y.indexOf("conic")!==-1||y==="albers",T=n._isClipped=!!A.lonaxisSpan[y];if(i.visible===!1){var M=c.extendDeep({},n._template);M.showcoastlines=!1,M.showcountries=!1,M.showframe=!1,M.showlakes=!1,M.showland=!1,M.showocean=!1,M.showrivers=!1,M.showsubunits=!1,M.lonaxis&&(M.lonaxis.showgrid=!1),M.lataxis&&(M.lataxis.showgrid=!1),n._template=M}for(var w=o("visible"),u,f=0;f<e.length;f++){var k=e[f],_=[30,10][f],D;if(x)D=p[k+"Range"];else{var I=A[k+"Span"],O=(I[y]||I["*"])/2,B=o("projection.rotation."+k.substr(0,3),p.projRotate[f]);D=[B-O,B+O]}var R=o(k+".range",D);o(k+".tick0"),o(k+".dtick",_),u=o(k+".showgrid",w?void 0:!1),u&&(o(k+".gridcolor"),o(k+".gridwidth"),o(k+".griddash")),n[k]._ax={type:"linear",_id:k.slice(0,3),_traceIndices:h,setScale:c.identity,c2l:c.identity,r2l:c.identity,autorange:!0,range:R.slice(),_m:1,_input:{}}}var L=n.lonaxis.range,F=n.lataxis.range,N=L[0],j=L[1];N>0&&j<0&&(j+=360);var G=(N+j)/2,rt;if(!l){var ct=x?p.projRotate:[G,0,0];rt=o("projection.rotation.lon",ct[0]),o("projection.rotation.lat",ct[1]),o("projection.rotation.roll",ct[2]),u=o("showcoastlines",!x&&w),u&&(o("coastlinecolor"),o("coastlinewidth")),u=o("showocean",w?void 0:!1),u&&o("oceancolor")}var lt,tt;if(l?(lt=-96.6,tt=38.7):(lt=x?G:rt,tt=(F[0]+F[1])/2),o("center.lon",lt),o("center.lat",tt),b&&(o("projection.tilt"),o("projection.distance")),S){var Z=p.projParallels||[0,60];o("projection.parallels",Z)}o("projection.scale"),u=o("showland",w?void 0:!1),u&&o("landcolor"),u=o("showlakes",w?void 0:!1),u&&o("lakecolor"),u=o("showrivers",w?void 0:!1),u&&(o("rivercolor"),o("riverwidth")),u=o("showcountries",x&&m!=="usa"&&w),u&&(o("countrycolor"),o("countrywidth")),(m==="usa"||m==="north america"&&v===50)&&(o("showsubunits",w),o("subunitcolor"),o("subunitwidth")),x||(u=o("showframe",w),u&&(o("framecolor"),o("framewidth"))),o("bgcolor");var st=o("fitbounds");st&&(delete n.projection.scale,x?(delete n.center.lon,delete n.center.lat):T?(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon,delete n.projection.rotation.lat,delete n.lonaxis.range,delete n.lataxis.range):(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon))}}),S3=Vt((X,V)=>{var c=Ph().getSubplotCalcData,g=qr().counterRegex,E=r8(),A="geo",t=g(A),e={};e[A]={valType:"subplotid",dflt:A,editType:"calc"};function r(o){for(var a=o._fullLayout,s=o.calcdata,h=a._subplots[A],v=0;v<h.length;v++){var m=h[v],p=c(s,A,m),y=a[m],l=y._subplot;l||(l=E({id:m,graphDiv:o,container:a._geolayer.node(),topojsonURL:o._context.topojsonURL,staticPlot:o._context.staticPlot}),a[m]._subplot=l),l.plot(p,a,o._promises)}}function i(o,a,s,h){for(var v=h._subplots[A]||[],m=0;m<v.length;m++){var p=v[m],y=h[p]._subplot;!a[p]&&y&&(y.framework.remove(),y.clipDef.remove())}}function n(o){for(var a=o._fullLayout,s=a._subplots[A],h=0;h<s.length;h++){var v=a[s[h]],m=v._subplot;m.updateFx(a,v)}}V.exports={attr:A,name:A,idRoot:A,idRegex:t,attrRegex:t,attributes:e,layoutAttributes:M3(),supplyLayoutDefaults:n8(),plot:r,updateFx:n,clean:i}}),a8=Vt((X,V)=>{V.exports={attributes:E0(),supplyDefaults:GE(),colorbar:Wh(),formatLabels:WE(),calc:kx(),calcGeoJSON:k3().calcGeoJSON,plot:k3().plot,style:T3(),styleOnSelect:yf().styleOnSelect,hoverPoints:QE(),eventData:YE(),selectPoints:KE(),moduleType:"trace",name:"scattergeo",basePlotModule:S3(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}),i8=Vt((X,V)=>{V.exports=a8()}),Wg=Vt((X,V)=>{var c=Zo().hovertemplateAttrs,g=E0(),E=wl(),A=Ks(),t=Hc().defaultLine,e=po().extendFlat,r=g.marker.line;V.exports=e({locations:{valType:"data_array",editType:"calc"},locationmode:g.locationmode,z:{valType:"data_array",editType:"calc"},geojson:e({},g.geojson,{}),featureidkey:g.featureidkey,text:e({},g.text,{}),hovertext:e({},g.hovertext,{}),marker:{line:{color:e({},r.color,{dflt:t}),width:e({},r.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:g.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:g.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:e({},A.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:c(),showlegend:e({},A.showlegend,{dflt:!1})},E("",{cLetter:"z",editTypeOverride:"calc"}))}),o8=Vt((X,V)=>{var c=qr(),g=ah(),E=Wg();V.exports=function(A,t,e,r){function i(m,p){return c.coerce(A,t,E,m,p)}var n=i("locations"),o=i("z");if(!(n&&n.length&&c.isArrayOrTypedArray(o)&&o.length)){t.visible=!1;return}t._length=Math.min(n.length,o.length);var a=i("geojson"),s;(typeof a=="string"&&a!==""||c.isPlainObject(a))&&(s="geojson-id");var h=i("locationmode",s);h==="geojson-id"&&i("featureidkey"),i("text"),i("hovertext"),i("hovertemplate");var v=i("marker.line.width");v&&i("marker.line.color"),i("marker.opacity"),g(A,t,r,i,{prefix:"",cLetter:"z"}),c.coerceSelectionMarkerOpacity(t,i)}}),Ex=Vt((X,V)=>{var c=vo(),g=ts().BADNUM,E=df(),A=bp(),t=qf();function e(r){return r&&typeof r=="string"}V.exports=function(r,i){var n=i._length,o=new Array(n),a;i.geojson?a=function(p){return e(p)||c(p)}:a=e;for(var s=0;s<n;s++){var h=o[s]={},v=i.locations[s],m=i.z[s];a(v)&&c(m)?(h.loc=v,h.z=m):(h.loc=null,h.z=g),h.index=s}return A(o,i),E(r,i,{vals:i.z,containerStr:"",cLetter:"z"}),t(o,i),o}}),Px=Vt((X,V)=>{var c=Ai(),g=vi(),E=go(),A=Ul();function t(i,n){n&&e(i,n)}function e(i,n){var o=n[0].trace,a=n[0].node3,s=a.selectAll(".choroplethlocation"),h=o.marker||{},v=h.line||{},m=A.makeColorScaleFuncFromTrace(o);s.each(function(p){c.select(this).attr("fill",m(p.z)).call(g.stroke,p.mlc||v.color).call(E.dashLine,"",p.mlw||v.width||0).style("opacity",h.opacity)}),E.selectedPointStyle(s,o)}function r(i,n){var o=n[0].node3,a=n[0].trace;a.selectedpoints?E.selectedPointStyle(o.selectAll(".choroplethlocation"),a):e(i,n)}V.exports={style:t,styleOnSelect:r}}),E3=Vt((X,V)=>{var c=Ai(),g=qr(),E=Vd(),A=Ax().getTopojsonFeatures,t=Kf().findExtremes,e=Px().style;function r(n,o,a){var s=o.layers.backplot.select(".choroplethlayer");g.makeTraceGroups(s,a,"trace choropleth").each(function(h){var v=c.select(this),m=v.selectAll("path.choroplethlocation").data(g.identity);m.enter().append("path").classed("choroplethlocation",!0),m.exit().remove(),e(n,h)})}function i(n,o){for(var a=n[0].trace,s=o[a.geo],h=s._subplot,v=a.locationmode,m=a._length,p=v==="geojson-id"?E.extractTraceFeature(n):A(a,h.topojson),y=[],l=[],x=0;x<m;x++){var b=n[x],S=v==="geojson-id"?b.fOut:E.locationToFeature(v,b.loc,p);if(S){b.geojson=S,b.ct=S.properties.ct,b._polygons=E.feature2polygons(S);var T=E.computeBbox(S);y.push(T[0],T[2]),l.push(T[1],T[3])}else b.geojson=null}if(s.fitbounds==="geojson"&&v==="geojson-id"){var M=E.computeBbox(E.getTraceGeojson(a));y=[M[0],M[2]],l=[M[1],M[3]]}var w={padded:!0};a._extremes.lon=t(s.lonaxis._ax,y,w),a._extremes.lat=t(s.lataxis._ax,l,w)}V.exports={calcGeoJSON:i,plot:r}}),Ix=Vt((X,V)=>{var c=ao(),g=Wg(),E=qr().fillText;V.exports=function(t,e,r){var i=t.cd,n=i[0].trace,o=t.subplot,a,s,h,v,m=[e,r],p=[e+360,r];for(s=0;s<i.length;s++)if(a=i[s],v=!1,a._polygons){for(h=0;h<a._polygons.length;h++)a._polygons[h].contains(m)&&(v=!v),a._polygons[h].contains(p)&&(v=!v);if(v)break}if(!(!v||!a))return t.x0=t.x1=t.xa.c2p(a.ct),t.y0=t.y1=t.ya.c2p(a.ct),t.index=a.index,t.location=a.loc,t.z=a.z,t.zLabel=c.tickText(o.mockAxis,o.mockAxis.c2l(a.z),"hover").text,t.hovertemplate=a.hovertemplate,A(t,n,a),[t]};function A(t,e,r){if(!e.hovertemplate){var i=r.hi||e.hoverinfo,n=String(r.loc),o=i==="all"?g.hoverinfo.flags:i.split("+"),a=o.indexOf("name")!==-1,s=o.indexOf("location")!==-1,h=o.indexOf("z")!==-1,v=o.indexOf("text")!==-1,m=!a&&s,p=[];m?t.nameOverride=n:(a&&(t.nameOverride=e.name),s&&p.push(n)),h&&p.push(t.zLabel),v&&E(r,e,p),t.extraText=p.join("<br>")}}}),Lx=Vt((X,V)=>{V.exports=function(c,g,E,A,t){c.location=g.location,c.z=g.z;var e=A[t];return e.fIn&&e.fIn.properties&&(c.properties=e.fIn.properties),c.ct=e.ct,c}}),Cx=Vt((X,V)=>{V.exports=function(c,g){var E=c.cd,A=c.xaxis,t=c.yaxis,e=[],r,i,n,o,a;if(g===!1)for(r=0;r<E.length;r++)E[r].selected=0;else for(r=0;r<E.length;r++)i=E[r],n=i.ct,n&&(o=A.c2p(n),a=t.c2p(n),g.contains([o,a],null,r,c)?(e.push({pointNumber:r,lon:n[0],lat:n[1]}),i.selected=1):i.selected=0);return e}}),s8=Vt((X,V)=>{V.exports={attributes:Wg(),supplyDefaults:o8(),colorbar:Id(),calc:Ex(),calcGeoJSON:E3().calcGeoJSON,plot:E3().plot,style:Px().style,styleOnSelect:Px().styleOnSelect,hoverPoints:Ix(),eventData:Lx(),selectPoints:Cx(),moduleType:"trace",name:"choropleth",basePlotModule:S3(),categories:["geo","noOpacity","showLegend"],meta:{}}}),l8=Vt((X,V)=>{V.exports=s8()}),Dx=Vt((X,V)=>{var c=Mi(),g=qr(),E=Mg();function A(e,r,i,n){var o=e.cd,a=o[0].t,s=o[0].trace,h=e.xa,v=e.ya,m=a.x,p=a.y,y=h.c2p(r),l=v.c2p(i),x=e.distance,b;if(a.tree){var S=h.p2c(y-x),T=h.p2c(y+x),M=v.p2c(l-x),w=v.p2c(l+x);n==="x"?b=a.tree.range(Math.min(S,T),Math.min(v._rl[0],v._rl[1]),Math.max(S,T),Math.max(v._rl[0],v._rl[1])):b=a.tree.range(Math.min(S,T),Math.min(M,w),Math.max(S,T),Math.max(M,w))}else b=a.ids;var u,f,k,_,D,I,O,B,R,L=x;if(n==="x"){var F=!!s.xperiodalignment,N=!!s.yperiodalignment;for(D=0;D<b.length;D++){if(u=b[D],k=m[u],I=Math.abs(h.c2p(k)-y),F){var j=h.c2p(s._xStarts[u]),G=h.c2p(s._xEnds[u]);I=y>=Math.min(j,G)&&y<=Math.max(j,G)?0:1/0}if(I<L){if(L=I,_=p[u],O=v.c2p(_)-l,N){var rt=v.c2p(s._yStarts[u]),ct=v.c2p(s._yEnds[u]);O=l>=Math.min(rt,ct)&&l<=Math.max(rt,ct)?0:1/0}R=Math.sqrt(I*I+O*O),f=b[D]}}}else for(D=b.length-1;D>-1;D--)u=b[D],k=m[u],_=p[u],I=h.c2p(k)-y,O=v.c2p(_)-l,B=Math.sqrt(I*I+O*O),B<L&&(L=R=B,f=u);return e.index=f,e.distance=L,e.dxy=R,f===void 0?[e]:[t(e,m,p,s)]}function t(e,r,i,n){var o=e.xa,a=e.ya,s=e.distance,h=e.dxy,v=e.index,m={pointNumber:v,x:r[v],y:i[v]};m.tx=g.isArrayOrTypedArray(n.text)?n.text[v]:n.text,m.htx=Array.isArray(n.hovertext)?n.hovertext[v]:n.hovertext,m.data=Array.isArray(n.customdata)?n.customdata[v]:n.customdata,m.tp=Array.isArray(n.textposition)?n.textposition[v]:n.textposition;var p=n.textfont;p&&(m.ts=g.isArrayOrTypedArray(p.size)?p.size[v]:p.size,m.tc=g.isArrayOrTypedArray(p.color)?p.color[v]:p.color,m.tf=Array.isArray(p.family)?p.family[v]:p.family,m.tw=Array.isArray(p.weight)?p.weight[v]:p.weight,m.ty=Array.isArray(p.style)?p.style[v]:p.style,m.tv=Array.isArray(p.variant)?p.variant[v]:p.variant);var y=n.marker;y&&(m.ms=g.isArrayOrTypedArray(y.size)?y.size[v]:y.size,m.mo=g.isArrayOrTypedArray(y.opacity)?y.opacity[v]:y.opacity,m.mx=g.isArrayOrTypedArray(y.symbol)?y.symbol[v]:y.symbol,m.ma=g.isArrayOrTypedArray(y.angle)?y.angle[v]:y.angle,m.mc=g.isArrayOrTypedArray(y.color)?y.color[v]:y.color);var l=y&&y.line;l&&(m.mlc=Array.isArray(l.color)?l.color[v]:l.color,m.mlw=g.isArrayOrTypedArray(l.width)?l.width[v]:l.width);var x=y&&y.gradient;x&&x.type!=="none"&&(m.mgt=Array.isArray(x.type)?x.type[v]:x.type,m.mgc=Array.isArray(x.color)?x.color[v]:x.color);var b=o.c2p(m.x,!0),S=a.c2p(m.y,!0),T=m.mrc||1,M=n.hoverlabel;M&&(m.hbg=Array.isArray(M.bgcolor)?M.bgcolor[v]:M.bgcolor,m.hbc=Array.isArray(M.bordercolor)?M.bordercolor[v]:M.bordercolor,m.hts=g.isArrayOrTypedArray(M.font.size)?M.font.size[v]:M.font.size,m.htc=Array.isArray(M.font.color)?M.font.color[v]:M.font.color,m.htf=Array.isArray(M.font.family)?M.font.family[v]:M.font.family,m.hnl=g.isArrayOrTypedArray(M.namelength)?M.namelength[v]:M.namelength);var w=n.hoverinfo;w&&(m.hi=Array.isArray(w)?w[v]:w);var u=n.hovertemplate;u&&(m.ht=Array.isArray(u)?u[v]:u);var f={};f[e.index]=m;var k=n._origX,_=n._origY,D=g.extendFlat({},e,{color:E(n,m),x0:b-T,x1:b+T,xLabelVal:k?k[v]:m.x,y0:S-T,y1:S+T,yLabelVal:_?_[v]:m.y,cd:f,distance:s,spikeDistance:h,hovertemplate:m.ht});return m.htx?D.text=m.htx:m.tx?D.text=m.tx:n.text&&(D.text=n.text),g.fillText(m,n,D),c.getComponentMethod("errorbars","hoverInfo")(m,n,D),D}V.exports={hoverPoints:A,calcHover:t}}),qd=Vt((X,V)=>{var c=20;V.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:c,SYMBOL_STROKE:c/20,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}}),Ev=Vt((X,V)=>{var c=Ks(),g=Nl(),E=rp(),A=Gu(),t=qu().axisHoverFormat,e=wl(),r=Td(),i=po().extendFlat,n=su().overrideAll,o=qd().DASHES,a=A.line,s=A.marker,h=s.line,v=V.exports=n({x:A.x,x0:A.x0,dx:A.dx,y:A.y,y0:A.y0,dy:A.dy,xperiod:A.xperiod,yperiod:A.yperiod,xperiod0:A.xperiod0,yperiod0:A.yperiod0,xperiodalignment:A.xperiodalignment,yperiodalignment:A.yperiodalignment,xhoverformat:t("x"),yhoverformat:t("y"),text:A.text,hovertext:A.hovertext,textposition:A.textposition,textfont:g({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"]}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:a.color,width:a.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:r(o),dflt:"solid"}},marker:i({},e("marker"),{symbol:s.symbol,angle:s.angle,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,opacity:s.opacity,colorbar:s.colorbar,line:i({},e("marker.line"),{width:h.width})}),connectgaps:A.connectgaps,fill:i({},A.fill,{dflt:"none"}),fillcolor:E(),selected:{marker:A.selected.marker,textfont:A.selected.textfont},unselected:{marker:A.unselected.marker,textfont:A.unselected.textfont},opacity:c.opacity},"calc","nested");v.x.editType=v.y.editType=v.x0.editType=v.y0.editType="calc+clearAxisTypes",v.hovertemplate=A.hovertemplate,v.texttemplate=A.texttemplate}),zx=Vt(X=>{var V=qd();X.isOpenSymbol=function(c){return typeof c=="string"?V.OPEN_RE.test(c):c%200>100},X.isDotSymbol=function(c){return typeof c=="string"?V.DOT_RE.test(c):c>200}}),u8=Vt((X,V)=>{var c=qr(),g=Mi(),E=zx(),A=Ev(),t=_p(),e=Sl(),r=Tg(),i=np(),n=Df(),o=Nf(),a=ap(),s=Uf();V.exports=function(h,v,m,p){function y(u,f){return c.coerce(h,v,A,u,f)}var l=h.marker?E.isOpenSymbol(h.marker.symbol):!1,x=e.isBubble(h),b=r(h,v,p,y);if(!b){v.visible=!1;return}i(h,v,p,y),y("xhoverformat"),y("yhoverformat");var S=b<t.PTS_LINESONLY?"lines+markers":"lines";y("text"),y("hovertext"),y("hovertemplate"),y("mode",S),e.hasMarkers(v)&&(n(h,v,m,p,y,{noAngleRef:!0,noStandOff:!0}),y("marker.line.width",l||x?1:0)),e.hasLines(v)&&(y("connectgaps"),o(h,v,m,p,y),y("line.shape")),e.hasText(v)&&(y("texttemplate"),s(h,v,p,y,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var T=(v.line||{}).color,M=(v.marker||{}).color;y("fill"),v.fill!=="none"&&a(h,v,m,y);var w=g.getComponentMethod("errorbars","supplyDefaults");w(h,v,T||M||m,{axis:"y"}),w(h,v,T||M||m,{axis:"x",inherit:"y"}),c.coerceSelectionMarkerOpacity(v,y)}}),c8=Vt((X,V)=>{var c=Qy();V.exports=function(g,E,A){var t=g.i;return"x"in g||(g.x=E._x[t]),"y"in g||(g.y=E._y[t]),c(g,E,A)}}),h8=Vt((X,V)=>{function c(r,i,n,o,a){for(var s=a+1;o<=a;){var h=o+a>>>1,v=r[h],m=n!==void 0?n(v,i):v-i;m>=0?(s=h,a=h-1):o=h+1}return s}function g(r,i,n,o,a){for(var s=a+1;o<=a;){var h=o+a>>>1,v=r[h],m=n!==void 0?n(v,i):v-i;m>0?(s=h,a=h-1):o=h+1}return s}function E(r,i,n,o,a){for(var s=o-1;o<=a;){var h=o+a>>>1,v=r[h],m=n!==void 0?n(v,i):v-i;m<0?(s=h,o=h+1):a=h-1}return s}function A(r,i,n,o,a){for(var s=o-1;o<=a;){var h=o+a>>>1,v=r[h],m=n!==void 0?n(v,i):v-i;m<=0?(s=h,o=h+1):a=h-1}return s}function t(r,i,n,o,a){for(;o<=a;){var s=o+a>>>1,h=r[s],v=n!==void 0?n(h,i):h-i;if(v===0)return s;v<=0?o=s+1:a=s-1}return-1}function e(r,i,n,o,a,s){return typeof n=="function"?s(r,i,n,o===void 0?0:o|0,a===void 0?r.length-1:a|0):s(r,i,void 0,n===void 0?0:n|0,o===void 0?r.length-1:o|0)}V.exports={ge:function(r,i,n,o,a){return e(r,i,n,o,a,c)},gt:function(r,i,n,o,a){return e(r,i,n,o,a,g)},lt:function(r,i,n,o,a){return e(r,i,n,o,a,E)},le:function(r,i,n,o,a){return e(r,i,n,o,a,A)},eq:function(r,i,n,o,a){return e(r,i,n,o,a,t)}}}),kp=Vt((X,V)=>{V.exports=function(E,A,t){var e={},r,i;if(typeof A=="string"&&(A=g(A)),Array.isArray(A)){var n={};for(i=0;i<A.length;i++)n[A[i]]=!0;A=n}for(r in A)A[r]=g(A[r]);var o={};for(r in A){var a=A[r];if(Array.isArray(a))for(i=0;i<a.length;i++){var s=a[i];if(t&&(o[s]=!0),s in E){if(e[r]=E[s],t)for(var h=i;h<a.length;h++)o[a[h]]=!0;break}}else r in E&&(A[r]&&(e[r]=E[r]),t&&(o[r]=!0))}if(t)for(r in E)o[r]||(e[r]=E[r]);return e};var c={};function g(E){return c[E]?c[E]:(typeof E=="string"&&(E=c[E]=E.split(/\s*,\s*|\s+/)),E)}}),Zg=Vt((X,V)=>{var c=kp();V.exports=g;function g(E){var A;return arguments.length>1&&(E=arguments),typeof E=="string"?E=E.split(/\s/).map(parseFloat):typeof E=="number"&&(E=[E]),E.length&&typeof E[0]=="number"?E.length===1?A={width:E[0],height:E[0],x:0,y:0}:E.length===2?A={width:E[0],height:E[1],x:0,y:0}:A={x:E[0],y:E[1],width:E[2]-E[0]||0,height:E[3]-E[1]||0}:E&&(E=c(E,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),A={x:E.left||0,y:E.top||0},E.width==null?E.right?A.width=E.right-A.x:A.width=0:A.width=E.width,E.height==null?E.bottom?A.height=E.bottom-A.y:A.height=0:A.height=E.height),A}}),P0=Vt((X,V)=>{V.exports=c;function c(g,E){if(!g||g.length==null)throw Error("Argument should be an array");E==null?E=1:E=Math.floor(E);for(var A=Array(E*2),t=0;t<E;t++){for(var e=-1/0,r=1/0,i=t,n=g.length;i<n;i+=E)g[i]>e&&(e=g[i]),g[i]<r&&(r=g[i]);A[t]=r,A[E+t]=e}return A}}),f8=Vt((X,V)=>{V.exports=function(){for(var c=0;c<arguments.length;c++)if(arguments[c]!==void 0)return arguments[c]}}),I0=Vt((X,V)=>{var c=xx();V.exports=g;function g(E,A,t){if(!E)throw new TypeError("must specify data as first parameter");if(t=+(t||0)|0,Array.isArray(E)&&E[0]&&typeof E[0][0]=="number"){var e=E[0].length,r=E.length*e,i,n,o,a;(!A||typeof A=="string")&&(A=new(c(A||"float32"))(r+t));var s=A.length-t;if(r!==s)throw new Error("source length "+r+" ("+e+"x"+E.length+") does not match destination length "+s);for(i=0,o=t;i<E.length;i++)for(n=0;n<e;n++)A[o++]=E[i][n]===null?NaN:E[i][n]}else if(!A||typeof A=="string"){var h=c(A||"float32");if(Array.isArray(E)||A==="array")for(A=new h(E.length+t),i=0,o=t,a=A.length;o<a;o++,i++)A[o]=E[i]===null?NaN:E[i];else t===0?A=new h(E):(A=new h(E.length+t),A.set(E,t))}else A.set(E,t);return A}}),p8=Vt((X,V)=>{V.exports=function(c){var g=typeof c;return c!==null&&(g==="object"||g==="function")}}),d8=Vt((X,V)=>{V.exports=Math.log2||function(c){return Math.log(c)*Math.LOG2E}}),g8=Vt((X,V)=>{var c=h8(),g=qg(),E=Zg(),A=P0(),t=kp(),e=f8(),r=I0(),i=p8(),n=xx(),o=d8(),a=1073741824;V.exports=function(h,v){v||(v={}),h=r(h,"float64"),v=t(v,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});let m=e(v.maxDepth,255),p=e(v.bounds,A(h,2));p[0]===p[2]&&p[2]++,p[1]===p[3]&&p[3]++;let y=s(h,p),l=h.length>>>1,x;v.dtype||(v.dtype="array"),typeof v.dtype=="string"?x=new(n(v.dtype))(l):v.dtype&&(x=v.dtype,Array.isArray(x)&&(x.length=l));for(let D=0;D<l;++D)x[D]=D;let b=[],S=[],T=[],M=[];u(0,0,1,x,0,1);let w=0;for(let D=0;D<b.length;D++){let I=b[D];if(x.set)x.set(I,w);else for(let B=0,R=I.length;B<R;B++)x[B+w]=I[B];let O=w+b[D].length;M[D]=[w,O],w=O}return x.range=f,x;function u(D,I,O,B,R,L){if(!B.length)return null;let F=b[R]||(b[R]=[]),N=T[R]||(T[R]=[]),j=S[R]||(S[R]=[]),G=F.length;if(R++,R>m||L>a){for(let Q=0;Q<B.length;Q++)F.push(B[Q]),N.push(L),j.push(null,null,null,null);return G}if(F.push(B[0]),N.push(L),B.length<=1)return j.push(null,null,null,null),G;let rt=O*.5,ct=D+rt,lt=I+rt,tt=[],Z=[],st=[],$=[];for(let Q=1,nt=B.length;Q<nt;Q++){let Y=B[Q],q=y[Y*2],ot=y[Y*2+1];q<ct?ot<lt?tt.push(Y):Z.push(Y):ot<lt?st.push(Y):$.push(Y)}return L<<=2,j.push(u(D,I,rt,tt,R,L),u(D,lt,rt,Z,R,L+1),u(ct,I,rt,st,R,L+2),u(ct,lt,rt,$,R,L+3)),G}function f(...D){let I;if(i(D[D.length-1])){let st=D.pop();!D.length&&(st.x!=null||st.l!=null||st.left!=null)&&(D=[st],I={}),I=t(st,{level:"level maxLevel",d:"d diam diameter r radius px pxSize pixel pixelSize maxD size minSize",lod:"lod details ranges offsets"})}else I={};D.length||(D=p);let O=E(...D),[B,R,L,F]=[Math.min(O.x,O.x+O.width),Math.min(O.y,O.y+O.height),Math.max(O.x,O.x+O.width),Math.max(O.y,O.y+O.height)],[N,j,G,rt]=s([B,R,L,F],p),ct=e(I.level,b.length);if(I.d!=null){let st;typeof I.d=="number"?st=[I.d,I.d]:I.d.length&&(st=I.d),ct=Math.min(Math.max(Math.ceil(-o(Math.abs(st[0])/(p[2]-p[0]))),Math.ceil(-o(Math.abs(st[1])/(p[3]-p[1])))),ct)}if(ct=Math.min(ct,b.length),I.lod)return k(N,j,G,rt,ct);let lt=[];tt(0,0,1,0,0,1);function tt(st,$,Q,nt,Y,q){if(Y===null||q===null)return;let ot=st+Q,it=$+Q;if(N>ot||j>it||G<st||rt<$||nt>=ct||Y===q)return;let dt=b[nt];q===void 0&&(q=dt.length);for(let Wt=Y;Wt<q;Wt++){let gt=dt[Wt],bt=h[gt*2],vt=h[gt*2+1];bt>=B&&bt<=L&&vt>=R&&vt<=F&<.push(gt)}let wt=S[nt],xt=wt[Y*4+0],Ft=wt[Y*4+1],Et=wt[Y*4+2],Nt=wt[Y*4+3],te=Z(wt,Y+1),Jt=Q*.5,Qt=nt+1;tt(st,$,Jt,Qt,xt,Ft||Et||Nt||te),tt(st,$+Jt,Jt,Qt,Ft,Et||Nt||te),tt(st+Jt,$,Jt,Qt,Et,Nt||te),tt(st+Jt,$+Jt,Jt,Qt,Nt,te)}function Z(st,$){let Q=null,nt=0;for(;Q===null;)if(Q=st[$*4+nt],nt++,nt>st.length)return null;return Q}return lt}function k(D,I,O,B,R){let L=[];for(let F=0;F<R;F++){let N=T[F],j=M[F][0],G=_(D,I,F),rt=_(O,B,F),ct=c.ge(N,G),lt=c.gt(N,rt,ct,N.length-1);L[F]=[ct+j,lt+j]}return L}function _(D,I,O){let B=1,R=.5,L=.5,F=.5;for(let N=0;N<O;N++)B<<=2,B+=D<R?I<L?0:1:I<L?2:3,F*=.5,R+=D<R?-F:F,L+=I<L?-F:F;return B}};function s(h,v){let[m,p,y,l]=v,x=1/(y-m),b=1/(l-p),S=new Array(h.length);for(let T=0,M=h.length/2;T<M;T++)S[2*T]=g((h[2*T]-m)*x,0,1),S[2*T+1]=g((h[2*T+1]-p)*b,0,1);return S}}),Ox=Vt((X,V)=>{V.exports=g8()}),P3=Vt((X,V)=>{V.exports=c;function c(g){var E=0,A=0,t=0,e=0;return g.map(function(r){r=r.slice();var i=r[0],n=i.toUpperCase();if(i!=n)switch(r[0]=n,i){case"a":r[6]+=t,r[7]+=e;break;case"v":r[1]+=e;break;case"h":r[1]+=t;break;default:for(var o=1;o<r.length;)r[o++]+=t,r[o++]+=e}switch(n){case"Z":t=E,e=A;break;case"H":t=r[1];break;case"V":e=r[1];break;case"M":t=E=r[1],e=A=r[2];break;default:t=r[r.length-2],e=r[r.length-1]}return r})}}),m8=Vt((X,V)=>{Object.defineProperty(X,"__esModule",{value:!0});var c=function(){function i(n,o){var a=[],s=!0,h=!1,v=void 0;try{for(var m=n[Symbol.iterator](),p;!(s=(p=m.next()).done)&&(a.push(p.value),!(o&&a.length===o));s=!0);}catch(y){h=!0,v=y}finally{try{!s&&m.return&&m.return()}finally{if(h)throw v}}return a}return function(n,o){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return i(n,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),g=Math.PI*2,E=function(i,n,o,a,s,h,v){var m=i.x,p=i.y;m*=n,p*=o;var y=a*m-s*p,l=s*m+a*p;return{x:y+h,y:l+v}},A=function(i,n){var o=n===1.5707963267948966?.551915024494:n===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(n/4),a=Math.cos(i),s=Math.sin(i),h=Math.cos(i+n),v=Math.sin(i+n);return[{x:a-s*o,y:s+a*o},{x:h+v*o,y:v-h*o},{x:h,y:v}]},t=function(i,n,o,a){var s=i*a-n*o<0?-1:1,h=i*o+n*a;return h>1&&(h=1),h<-1&&(h=-1),s*Math.acos(h)},e=function(i,n,o,a,s,h,v,m,p,y,l,x){var b=Math.pow(s,2),S=Math.pow(h,2),T=Math.pow(l,2),M=Math.pow(x,2),w=b*S-b*M-S*T;w<0&&(w=0),w/=b*M+S*T,w=Math.sqrt(w)*(v===m?-1:1);var u=w*s/h*x,f=w*-h/s*l,k=y*u-p*f+(i+o)/2,_=p*u+y*f+(n+a)/2,D=(l-u)/s,I=(x-f)/h,O=(-l-u)/s,B=(-x-f)/h,R=t(1,0,D,I),L=t(D,I,O,B);return m===0&&L>0&&(L-=g),m===1&&L<0&&(L+=g),[k,_,R,L]},r=function(i){var n=i.px,o=i.py,a=i.cx,s=i.cy,h=i.rx,v=i.ry,m=i.xAxisRotation,p=m===void 0?0:m,y=i.largeArcFlag,l=y===void 0?0:y,x=i.sweepFlag,b=x===void 0?0:x,S=[];if(h===0||v===0)return[];var T=Math.sin(p*g/360),M=Math.cos(p*g/360),w=M*(n-a)/2+T*(o-s)/2,u=-T*(n-a)/2+M*(o-s)/2;if(w===0&&u===0)return[];h=Math.abs(h),v=Math.abs(v);var f=Math.pow(w,2)/Math.pow(h,2)+Math.pow(u,2)/Math.pow(v,2);f>1&&(h*=Math.sqrt(f),v*=Math.sqrt(f));var k=e(n,o,a,s,h,v,l,b,T,M,w,u),_=c(k,4),D=_[0],I=_[1],O=_[2],B=_[3],R=Math.abs(B)/(g/4);Math.abs(1-R)<1e-7&&(R=1);var L=Math.max(Math.ceil(R),1);B/=L;for(var F=0;F<L;F++)S.push(A(O,B)),O+=B;return S.map(function(N){var j=E(N[0],h,v,M,T,D,I),G=j.x,rt=j.y,ct=E(N[1],h,v,M,T,D,I),lt=ct.x,tt=ct.y,Z=E(N[2],h,v,M,T,D,I),st=Z.x,$=Z.y;return{x1:G,y1:rt,x2:lt,y2:tt,x:st,y:$}})};X.default=r,V.exports=X.default}),v8=Vt((X,V)=>{V.exports=g;var c=m8();function g(t){for(var e,r=[],i=0,n=0,o=0,a=0,s=null,h=null,v=0,m=0,p=0,y=t.length;p<y;p++){var l=t[p],x=l[0];switch(x){case"M":o=l[1],a=l[2];break;case"A":var b=c({px:v,py:m,cx:l[6],cy:l[7],rx:l[1],ry:l[2],xAxisRotation:l[3],largeArcFlag:l[4],sweepFlag:l[5]});if(!b.length)continue;for(var S=0,T;S<b.length;S++)T=b[S],l=["C",T.x1,T.y1,T.x2,T.y2,T.x,T.y],S<b.length-1&&r.push(l);break;case"S":var M=v,w=m;(e=="C"||e=="S")&&(M+=M-i,w+=w-n),l=["C",M,w,l[1],l[2],l[3],l[4]];break;case"T":e=="Q"||e=="T"?(s=v*2-s,h=m*2-h):(s=v,h=m),l=A(v,m,s,h,l[1],l[2]);break;case"Q":s=l[1],h=l[2],l=A(v,m,l[1],l[2],l[3],l[4]);break;case"L":l=E(v,m,l[1],l[2]);break;case"H":l=E(v,m,l[1],m);break;case"V":l=E(v,m,v,l[1]);break;case"Z":l=E(v,m,o,a);break}e=x,v=l[l.length-2],m=l[l.length-1],l.length>4?(i=l[l.length-4],n=l[l.length-3]):(i=v,n=m),r.push(l)}return r}function E(t,e,r,i){return["C",t,e,r,i,r,i]}function A(t,e,r,i,n,o){return["C",t/3+2/3*r,e/3+2/3*i,n/3+2/3*r,o/3+2/3*i,n,o]}}),I3=Vt((X,V)=>{V.exports=function(c){return typeof c!="string"?!1:(c=c.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(c)&&/[\dz]$/i.test(c)&&c.length>4))}}),y8=Vt((X,V)=>{var c=Om(),g=P3(),E=v8(),A=I3(),t=iv();V.exports=e;function e(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(t(A(r),"String is not an SVG path."),r=c(r)),t(Array.isArray(r),"Argument should be a string or an array of path segments."),r=g(r),r=E(r),!r.length)return[0,0,0,0];for(var i=[1/0,1/0,-1/0,-1/0],n=0,o=r.length;n<o;n++)for(var a=r[n].slice(1),s=0;s<a.length;s+=2)a[s+0]<i[0]&&(i[0]=a[s+0]),a[s+1]<i[1]&&(i[1]=a[s+1]),a[s+0]>i[2]&&(i[2]=a[s+0]),a[s+1]>i[3]&&(i[3]=a[s+1]);return i}}),x8=Vt((X,V)=>{var c=Math.PI,g=i(120);V.exports=E;function E(n){for(var o,a=[],s=0,h=0,v=0,m=0,p=null,y=null,l=0,x=0,b=0,S=n.length;b<S;b++){var T=n[b],M=T[0];switch(M){case"M":v=T[1],m=T[2];break;case"A":T=e(l,x,T[1],T[2],i(T[3]),T[4],T[5],T[6],T[7]),T.unshift("C"),T.length>7&&(a.push(T.splice(0,7)),T.unshift("C"));break;case"S":var w=l,u=x;(o=="C"||o=="S")&&(w+=w-s,u+=u-h),T=["C",w,u,T[1],T[2],T[3],T[4]];break;case"T":o=="Q"||o=="T"?(p=l*2-p,y=x*2-y):(p=l,y=x),T=t(l,x,p,y,T[1],T[2]);break;case"Q":p=T[1],y=T[2],T=t(l,x,T[1],T[2],T[3],T[4]);break;case"L":T=A(l,x,T[1],T[2]);break;case"H":T=A(l,x,T[1],x);break;case"V":T=A(l,x,l,T[1]);break;case"Z":T=A(l,x,v,m);break}o=M,l=T[T.length-2],x=T[T.length-1],T.length>4?(s=T[T.length-4],h=T[T.length-3]):(s=l,h=x),a.push(T)}return a}function A(n,o,a,s){return["C",n,o,a,s,a,s]}function t(n,o,a,s,h,v){return["C",n/3+2/3*a,o/3+2/3*s,h/3+2/3*a,v/3+2/3*s,h,v]}function e(n,o,a,s,h,v,m,p,y,l){if(l)_=l[0],D=l[1],f=l[2],k=l[3];else{var x=r(n,o,-h);n=x.x,o=x.y,x=r(p,y,-h),p=x.x,y=x.y;var b=(n-p)/2,S=(o-y)/2,T=b*b/(a*a)+S*S/(s*s);T>1&&(T=Math.sqrt(T),a=T*a,s=T*s);var M=a*a,w=s*s,u=(v==m?-1:1)*Math.sqrt(Math.abs((M*w-M*S*S-w*b*b)/(M*S*S+w*b*b)));u==1/0&&(u=1);var f=u*a*S/s+(n+p)/2,k=u*-s*b/a+(o+y)/2,_=Math.asin(((o-k)/s).toFixed(9)),D=Math.asin(((y-k)/s).toFixed(9));_=n<f?c-_:_,D=p<f?c-D:D,_<0&&(_=c*2+_),D<0&&(D=c*2+D),m&&_>D&&(_=_-c*2),!m&&D>_&&(D=D-c*2)}if(Math.abs(D-_)>g){var I=D,O=p,B=y;D=_+g*(m&&D>_?1:-1),p=f+a*Math.cos(D),y=k+s*Math.sin(D);var R=e(p,y,a,s,h,0,m,O,B,[D,I,f,k])}var L=Math.tan((D-_)/4),F=4/3*a*L,N=4/3*s*L,j=[2*n-(n+F*Math.sin(_)),2*o-(o-N*Math.cos(_)),p+F*Math.sin(D),y-N*Math.cos(D),p,y];if(l)return j;R&&(j=j.concat(R));for(var G=0;G<j.length;){var rt=r(j[G],j[G+1],h);j[G++]=rt.x,j[G++]=rt.y}return j}function r(n,o,a){return{x:n*Math.cos(a)-o*Math.sin(a),y:n*Math.sin(a)+o*Math.cos(a)}}function i(n){return n*(c/180)}}),_8=Vt((X,V)=>{var c=P3(),g=x8(),E={M:"moveTo",C:"bezierCurveTo"};V.exports=function(A,t){A.beginPath(),g(c(t)).forEach(function(e){var r=e[0],i=e.slice(1);A[E[r]].apply(A,i)}),A.closePath()}}),b8=Vt((X,V)=>{var c=qg();V.exports=E;var g=1e20;function E(e,r){r||(r={});var i=r.cutoff==null?.25:r.cutoff,n=r.radius==null?8:r.radius,o=r.channel||0,a,s,h,v,m,p,y,l,x,b,S;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!r.width||!r.height)throw Error("For raw data width and height should be provided by options");a=r.width,s=r.height,v=e,r.stride?p=r.stride:p=Math.floor(e.length/a/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(l=e,y=l.getContext("2d"),a=l.width,s=l.height,x=y.getImageData(0,0,a,s),v=x.data,p=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(l=e.canvas,y=e,a=l.width,s=l.height,x=y.getImageData(0,0,a,s),v=x.data,p=4):window.ImageData&&e instanceof window.ImageData&&(x=e,a=e.width,s=e.height,v=x.data,p=4);if(h=Math.max(a,s),window.Uint8ClampedArray&&v instanceof window.Uint8ClampedArray||window.Uint8Array&&v instanceof window.Uint8Array)for(m=v,v=Array(a*s),b=0,S=m.length;b<S;b++)v[b]=m[b*p+o]/255;else if(p!==1)throw Error("Raw data can have only 1 value per pixel");var T=Array(a*s),M=Array(a*s),w=Array(h),u=Array(h),f=Array(h+1),k=Array(h);for(b=0,S=a*s;b<S;b++){var _=v[b];T[b]=_===1?0:_===0?g:Math.pow(Math.max(0,.5-_),2),M[b]=_===1?g:_===0?0:Math.pow(Math.max(0,_-.5),2)}A(T,a,s,w,u,k,f),A(M,a,s,w,u,k,f);var D=window.Float32Array?new Float32Array(a*s):new Array(a*s);for(b=0,S=a*s;b<S;b++)D[b]=c(1-((T[b]-M[b])/n+i),0,1);return D}function A(e,r,i,n,o,a,s){for(var h=0;h<r;h++){for(var v=0;v<i;v++)n[v]=e[v*r+h];for(t(n,o,a,s,i),v=0;v<i;v++)e[v*r+h]=o[v]}for(v=0;v<i;v++){for(h=0;h<r;h++)n[h]=e[v*r+h];for(t(n,o,a,s,r),h=0;h<r;h++)e[v*r+h]=Math.sqrt(o[h])}}function t(e,r,i,n,o){i[0]=0,n[0]=-g,n[1]=+g;for(var a=1,s=0;a<o;a++){for(var h=(e[a]+a*a-(e[i[s]]+i[s]*i[s]))/(2*a-2*i[s]);h<=n[s];)s--,h=(e[a]+a*a-(e[i[s]]+i[s]*i[s]))/(2*a-2*i[s]);s++,i[s]=a,n[s]=h,n[s+1]=+g}for(a=0,s=0;a<o;a++){for(;n[s+1]<a;)s++;r[a]=(a-i[s])*(a-i[s])+e[i[s]]}}}),w8=Vt((X,V)=>{var c=y8(),g=Om(),E=_8(),A=I3(),t=b8(),e=document.createElement("canvas"),r=e.getContext("2d");V.exports=i;function i(a,s){if(!A(a))throw Error("Argument should be valid svg path string");s||(s={});var h,v;s.shape?(h=s.shape[0],v=s.shape[1]):(h=e.width=s.w||s.width||200,v=e.height=s.h||s.height||200);var m=Math.min(h,v),p=s.stroke||0,y=s.viewbox||s.viewBox||c(a),l=[h/(y[2]-y[0]),v/(y[3]-y[1])],x=Math.min(l[0]||0,l[1]||0)/2;if(r.fillStyle="black",r.fillRect(0,0,h,v),r.fillStyle="white",p&&(typeof p!="number"&&(p=1),p>0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(p)),r.translate(h*.5,v*.5),r.scale(x,x),o()){var b=new Path2D(a);r.fill(b),p&&r.stroke(b)}else{var S=g(a);E(r,S),r.fill(),p&&r.stroke()}r.setTransform(1,0,0,1,0,0);var T=t(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:m*.5});return T}var n;function o(){if(n!=null)return n;var a=document.createElement("canvas").getContext("2d");if(a.canvas.width=a.canvas.height=1,!window.Path2D)return n=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");a.fillStyle="black",a.fill(s);var h=a.getImageData(0,0,1,1);return n=h&&h.data&&h.data[3]===255}}),L0=Vt((X,V)=>{var c=vo(),g=w8(),E=jd(),A=Mi(),t=qr(),e=t.isArrayOrTypedArray,r=go(),i=rc(),n=Wp().formatColor,o=Sl(),a=_g(),s=zx(),h=qd(),v=bd().DESELECTDIM,m={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},p=vf().appendArrayPointValue;function y(R,L){var F,N={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},j=R._context.plotGlPixelRatio;if(L.visible!==!0)return N;if(o.hasText(L)&&(N.text=l(R,L),N.textSel=T(R,L,L.selected),N.textUnsel=T(R,L,L.unselected)),o.hasMarkers(L)&&(N.marker=b(R,L),N.markerSel=S(R,L,L.selected),N.markerUnsel=S(R,L,L.unselected),!L.unselected&&e(L.marker.opacity))){var G=L.marker.opacity;for(N.markerUnsel.opacity=new Array(G.length),F=0;F<G.length;F++)N.markerUnsel.opacity[F]=v*G[F]}if(o.hasLines(L)){N.line={overlay:!0,thickness:L.line.width*j,color:L.line.color,opacity:L.opacity};var rt=(h.DASHES[L.line.dash]||[1]).slice();for(F=0;F<rt.length;++F)rt[F]*=L.line.width*j;N.line.dashes=rt}return L.error_x&&L.error_x.visible&&(N.errorX=M(L,L.error_x,j)),L.error_y&&L.error_y.visible&&(N.errorY=M(L,L.error_y,j)),L.fill&&L.fill!=="none"&&(N.fill={closed:!0,fill:L.fillcolor,thickness:0}),N}function l(R,L){var F=R._fullLayout,N=L._length,j=L.textfont,G=L.textposition,rt=e(G)?G:[G],ct=j.color,lt=j.size,tt=j.family,Z=j.weight,st=j.style,$=j.variant,Q={},nt,Y=R._context.plotGlPixelRatio,q=L.texttemplate;if(q){Q.text=[];var ot=F._d3locale,it=Array.isArray(q),dt=it?Math.min(q.length,N):N,wt=it?function(Qt){return q[Qt]}:function(){return q};for(nt=0;nt<dt;nt++){var xt={i:nt},Ft=L._module.formatLabels(xt,L,F),Et={};p(Et,L,nt);var Nt=L._meta||{};Q.text.push(t.texttemplateString(wt(nt),Ft,ot,Et,xt,Nt))}}else e(L.text)&&L.text.length<N?Q.text=L.text.slice():Q.text=L.text;if(e(Q.text))for(nt=Q.text.length;nt<N;nt++)Q.text[nt]="";for(Q.opacity=L.opacity,Q.font={},Q.align=[],Q.baseline=[],nt=0;nt<rt.length;nt++){var te=rt[nt].split(/\s+/);switch(te[1]){case"left":Q.align.push("right");break;case"right":Q.align.push("left");break;default:Q.align.push(te[1])}switch(te[0]){case"top":Q.baseline.push("bottom");break;case"bottom":Q.baseline.push("top");break;default:Q.baseline.push(te[0])}}if(e(ct))for(Q.color=new Array(N),nt=0;nt<N;nt++)Q.color[nt]=ct[nt];else Q.color=ct;if(e(lt)||Array.isArray(tt)||e(Z)||Array.isArray(st)||Array.isArray($))for(Q.font=new Array(N),nt=0;nt<N;nt++){var Jt=Q.font[nt]={};Jt.size=(t.isTypedArray(lt)?lt[nt]:e(lt)?c(lt[nt])?lt[nt]:0:lt)*Y,Jt.family=Array.isArray(tt)?tt[nt]:tt,Jt.weight=x(e(Z)?Z[nt]:Z),Jt.style=Array.isArray(st)?st[nt]:st,Jt.variant=Array.isArray($)?$[nt]:$}else Q.font={size:lt*Y,family:tt,weight:x(Z),style:st,variant:$};return Q}function x(R){return R<=1e3?R>500?"bold":"normal":R}function b(R,L){var F=L._length,N=L.marker,j={},G,rt=e(N.symbol),ct=e(N.angle),lt=e(N.color),tt=e(N.line.color),Z=e(N.opacity),st=e(N.size),$=e(N.line.width),Q;if(rt||(Q=s.isOpenSymbol(N.symbol)),rt||lt||tt||Z||ct){j.symbols=new Array(F),j.angles=new Array(F),j.colors=new Array(F),j.borderColors=new Array(F);var nt=N.symbol,Y=N.angle,q=n(N,N.opacity,F),ot=n(N.line,N.opacity,F);if(!e(ot[0])){var it=ot;for(ot=Array(F),G=0;G<F;G++)ot[G]=it}if(!e(q[0])){var dt=q;for(q=Array(F),G=0;G<F;G++)q[G]=dt}if(!e(nt)){var wt=nt;for(nt=Array(F),G=0;G<F;G++)nt[G]=wt}if(!e(Y)){var xt=Y;for(Y=Array(F),G=0;G<F;G++)Y[G]=xt}for(j.symbols=nt,j.angles=Y,j.colors=q,j.borderColors=ot,G=0;G<F;G++)rt&&(Q=s.isOpenSymbol(N.symbol[G])),Q&&(ot[G]=q[G].slice(),q[G]=q[G].slice(),q[G][3]=0);for(j.opacity=L.opacity,j.markers=new Array(F),G=0;G<F;G++)j.markers[G]=D({mx:j.symbols[G],ma:j.angles[G]},L)}else Q?(j.color=E(N.color,"uint8"),j.color[3]=0,j.borderColor=E(N.color,"uint8")):(j.color=E(N.color,"uint8"),j.borderColor=E(N.line.color,"uint8")),j.opacity=L.opacity*N.opacity,j.marker=D({mx:N.symbol,ma:N.angle},L);var Ft=1,Et=a(L,Ft),Nt;if(st||$){var te=j.sizes=new Array(F),Jt=j.borderSizes=new Array(F),Qt=0,Wt;if(st){for(G=0;G<F;G++)te[G]=Et(N.size[G]),Qt+=te[G];Wt=Qt/F}else for(Nt=Et(N.size),G=0;G<F;G++)te[G]=Nt;if($)for(G=0;G<F;G++)Jt[G]=N.line.width[G];else for(Nt=N.line.width,G=0;G<F;G++)Jt[G]=Nt;j.sizeAvg=Wt}else j.size=Et(N&&N.size||10),j.borderSizes=Et(N.line.width);return j}function S(R,L,F){var N=L.marker,j={};return F&&(F.marker&&F.marker.symbol?j=b(R,t.extendFlat({},N,F.marker)):F.marker&&(F.marker.size&&(j.size=F.marker.size),F.marker.color&&(j.colors=F.marker.color),F.marker.opacity!==void 0&&(j.opacity=F.marker.opacity))),j}function T(R,L,F){var N={};if(!F)return N;if(F.textfont){var j={opacity:1,text:L.text,texttemplate:L.texttemplate,textposition:L.textposition,textfont:t.extendFlat({},L.textfont)};F.textfont&&t.extendFlat(j.textfont,F.textfont),N=l(R,j)}return N}function M(R,L,F){var N={capSize:L.width*2*F,lineWidth:L.thickness*F,color:L.color};return L.copy_ystyle&&(N=R.error_y),N}var w=h.SYMBOL_SDF_SIZE,u=h.SYMBOL_SIZE,f=h.SYMBOL_STROKE,k={},_=r.symbolFuncs[0](u*.05);function D(R,L){var F=R.mx;if(F==="circle")return null;var N,j,G=r.symbolNumber(F),rt=r.symbolFuncs[G%100],ct=!!r.symbolNoDot[G%100],lt=!!r.symbolNoFill[G%100],tt=s.isDotSymbol(F);if(R.ma&&(F+="_"+R.ma),k[F])return k[F];var Z=r.getMarkerAngle(R,L);return tt&&!ct?N=rt(u*1.1,Z)+_:N=rt(u,Z),j=g(N,{w,h:w,viewBox:[-u,-u,u,u],stroke:lt?f:-f}),k[F]=j,j||null}function I(R,L,F){var N=F.length,j=N/2,G,rt;if(o.hasLines(L)&&j)if(L.line.shape==="hv"){for(G=[],rt=0;rt<j-1;rt++)isNaN(F[rt*2])||isNaN(F[rt*2+1])?G.push(NaN,NaN,NaN,NaN):(G.push(F[rt*2],F[rt*2+1]),!isNaN(F[rt*2+2])&&!isNaN(F[rt*2+3])?G.push(F[rt*2+2],F[rt*2+1]):G.push(NaN,NaN));G.push(F[N-2],F[N-1])}else if(L.line.shape==="hvh"){for(G=[],rt=0;rt<j-1;rt++)if(isNaN(F[rt*2])||isNaN(F[rt*2+1])||isNaN(F[rt*2+2])||isNaN(F[rt*2+3]))!isNaN(F[rt*2])&&!isNaN(F[rt*2+1])?G.push(F[rt*2],F[rt*2+1]):G.push(NaN,NaN),G.push(NaN,NaN);else{var ct=(F[rt*2]+F[rt*2+2])/2;G.push(F[rt*2],F[rt*2+1],ct,F[rt*2+1],ct,F[rt*2+3])}G.push(F[N-2],F[N-1])}else if(L.line.shape==="vhv"){for(G=[],rt=0;rt<j-1;rt++)if(isNaN(F[rt*2])||isNaN(F[rt*2+1])||isNaN(F[rt*2+2])||isNaN(F[rt*2+3]))!isNaN(F[rt*2])&&!isNaN(F[rt*2+1])?G.push(F[rt*2],F[rt*2+1]):G.push(NaN,NaN),G.push(NaN,NaN);else{var lt=(F[rt*2+1]+F[rt*2+3])/2;G.push(F[rt*2],F[rt*2+1],F[rt*2],lt,F[rt*2+2],lt)}G.push(F[N-2],F[N-1])}else if(L.line.shape==="vh"){for(G=[],rt=0;rt<j-1;rt++)isNaN(F[rt*2])||isNaN(F[rt*2+1])?G.push(NaN,NaN,NaN,NaN):(G.push(F[rt*2],F[rt*2+1]),!isNaN(F[rt*2+2])&&!isNaN(F[rt*2+3])?G.push(F[rt*2],F[rt*2+3]):G.push(NaN,NaN));G.push(F[N-2],F[N-1])}else G=F;var tt=!1;for(rt=0;rt<G.length;rt++)if(isNaN(G[rt])){tt=!0;break}var Z=tt||G.length>h.TOO_MANY_POINTS||o.hasMarkers(L)?"rect":"round";if(tt&&L.connectgaps){var st=G[0],$=G[1];for(rt=0;rt<G.length;rt+=2)isNaN(G[rt])||isNaN(G[rt+1])?(G[rt]=st,G[rt+1]=$):(st=G[rt],$=G[rt+1])}return{join:Z,positions:G}}function O(R,L,F,N,j){var G=A.getComponentMethod("errorbars","makeComputeError"),rt=i.getFromId(R,L.xaxis,"x"),ct=i.getFromId(R,L.yaxis,"y"),lt=F.length/2,tt={};function Z(st,$){var Q=$._id.charAt(0),nt=L["error_"+Q];if(nt&&nt.visible&&($.type==="linear"||$.type==="log")){for(var Y=G(nt),q={x:0,y:1}[Q],ot={x:[0,1,2,3],y:[2,3,0,1]}[Q],it=new Float64Array(4*lt),dt=1/0,wt=-1/0,xt=0,Ft=0;xt<lt;xt++,Ft+=4){var Et=st[xt];if(c(Et)){var Nt=F[xt*2+q],te=Y(Et,xt),Jt=te[0],Qt=te[1];if(c(Jt)&&c(Qt)){var Wt=Et-Jt,gt=Et+Qt;it[Ft+ot[0]]=Nt-$.c2l(Wt),it[Ft+ot[1]]=$.c2l(gt)-Nt,it[Ft+ot[2]]=0,it[Ft+ot[3]]=0,dt=Math.min(dt,Et-Jt),wt=Math.max(wt,Et+Qt)}}}tt[Q]={positions:F,errors:it,_bnds:[dt,wt]}}}return Z(N,rt),Z(j,ct),tt}function B(R,L,F,N){var j=L._length,G={},rt;if(o.hasMarkers(L)){var ct=F.font,lt=F.align,tt=F.baseline;for(G.offset=new Array(j),rt=0;rt<j;rt++){var Z=N.sizes?N.sizes[rt]:N.size,st=e(ct)?ct[rt].size:ct.size,$=e(lt)?lt.length>1?lt[rt]:lt[0]:lt,Q=e(tt)?tt.length>1?tt[rt]:tt[0]:tt,nt=m[$],Y=m[Q],q=Z?Z/.8+1:0,ot=-Y*q-Y*.5;G.offset[rt]=[nt*q/st,ot/st]}}return G}V.exports={style:y,markerStyle:b,markerSelection:S,linePositions:I,errorBarPositions:O,textPosition:B}}),L3=Vt((X,V)=>{var c=qr();V.exports=function(g,E){var A=E._scene,t={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},e={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return E._scene||(A=E._scene={},A.init=function(){c.extendFlat(A,e,t)},A.init(),A.update=function(r){var i=c.repeat(r,A.count);if(A.fill2d&&A.fill2d.update(i),A.scatter2d&&A.scatter2d.update(i),A.line2d&&A.line2d.update(i),A.error2d&&A.error2d.update(i.concat(i)),A.select2d&&A.select2d.update(i),A.glText)for(var n=0;n<A.count;n++)A.glText[n].update(r)},A.draw=function(){for(var r=A.count,i=A.fill2d,n=A.error2d,o=A.line2d,a=A.scatter2d,s=A.glText,h=A.select2d,v=A.selectBatch,m=A.unselectBatch,p=0;p<r;p++){if(i&&A.fillOrder[p]&&i.draw(A.fillOrder[p]),o&&A.lineOptions[p]&&o.draw(p),n&&(A.errorXOptions[p]&&n.draw(p),A.errorYOptions[p]&&n.draw(p+r)),a&&A.markerOptions[p])if(m[p].length){var y=c.repeat([],A.count);y[p]=m[p],a.draw(y)}else v[p].length||a.draw(p);s[p]&&A.textOptions[p]&&s[p].render()}h&&h.draw(v),A.dirty=!1},A.destroy=function(){A.fill2d&&A.fill2d.destroy&&A.fill2d.destroy(),A.scatter2d&&A.scatter2d.destroy&&A.scatter2d.destroy(),A.error2d&&A.error2d.destroy&&A.error2d.destroy(),A.line2d&&A.line2d.destroy&&A.line2d.destroy(),A.select2d&&A.select2d.destroy&&A.select2d.destroy(),A.glText&&A.glText.forEach(function(r){r.destroy&&r.destroy()}),A.lineOptions=null,A.fillOptions=null,A.markerOptions=null,A.markerSelectedOptions=null,A.markerUnselectedOptions=null,A.errorXOptions=null,A.errorYOptions=null,A.textOptions=null,A.textSelectedOptions=null,A.textUnselectedOptions=null,A.selectBatch=null,A.unselectBatch=null,E._scene=null}),A.dirty||c.extendFlat(A,t),A}}),T8=Vt((X,V)=>{var c=Ox(),g=qr(),E=rc(),A=Kf().findExtremes,t=ip(),e=Hf(),r=e.calcMarkerSize,i=e.calcAxisExpansion,n=e.setFirstScatter,o=Vf(),a=L0(),s=L3(),h=ts().BADNUM,v=qd().TOO_MANY_POINTS;V.exports=function(y,l){var x=y._fullLayout,b=l._xA=E.getFromId(y,l.xaxis,"x"),S=l._yA=E.getFromId(y,l.yaxis,"y"),T=x._plots[l.xaxis+l.yaxis],M=l._length,w=M>=v,u=M*2,f={},k,_=b.makeCalcdata(l,"x"),D=S.makeCalcdata(l,"y"),I=t(l,b,"x",_),O=t(l,S,"y",D),B=I.vals,R=O.vals;l._x=B,l._y=R,l.xperiodalignment&&(l._origX=_,l._xStarts=I.starts,l._xEnds=I.ends),l.yperiodalignment&&(l._origY=D,l._yStarts=O.starts,l._yEnds=O.ends);var L=new Array(u),F=new Array(M);for(k=0;k<M;k++)L[k*2]=B[k]===h?NaN:B[k],L[k*2+1]=R[k]===h?NaN:R[k],F[k]=k;if(b.type==="log")for(k=0;k<u;k+=2)L[k]=b.c2l(L[k]);if(S.type==="log")for(k=1;k<u;k+=2)L[k]=S.c2l(L[k]);w&&b.type!=="log"&&S.type!=="log"?f.tree=c(L):f.ids=F,o(y,l);var N=p(y,T,l,L,B,R),j=s(y,T);n(x,l);var G;return w?N.marker&&(G=N.marker.sizeAvg||Math.max(N.marker.size,3)):G=r(l,M),i(y,l,b,S,B,R,G),N.errorX&&m(l,b,N.errorX),N.errorY&&m(l,S,N.errorY),N.fill&&!j.fill2d&&(j.fill2d=!0),N.marker&&!j.scatter2d&&(j.scatter2d=!0),N.line&&!j.line2d&&(j.line2d=!0),(N.errorX||N.errorY)&&!j.error2d&&(j.error2d=!0),N.text&&!j.glText&&(j.glText=!0),N.marker&&(N.marker.snap=M),j.lineOptions.push(N.line),j.errorXOptions.push(N.errorX),j.errorYOptions.push(N.errorY),j.fillOptions.push(N.fill),j.markerOptions.push(N.marker),j.markerSelectedOptions.push(N.markerSel),j.markerUnselectedOptions.push(N.markerUnsel),j.textOptions.push(N.text),j.textSelectedOptions.push(N.textSel),j.textUnselectedOptions.push(N.textUnsel),j.selectBatch.push([]),j.unselectBatch.push([]),f._scene=j,f.index=j.count,f.x=B,f.y=R,f.positions=L,j.count++,[{x:!1,y:!1,t:f,trace:l}]};function m(y,l,x){var b=y._extremes[l._id],S=A(l,x._bnds,{padded:!0});b.min=b.min.concat(S.min),b.max=b.max.concat(S.max)}function p(y,l,x,b,S,T){var M=a.style(y,x);if(M.marker&&(M.marker.positions=b),M.line&&b.length>1&&g.extendFlat(M.line,a.linePositions(y,x,b)),M.errorX||M.errorY){var w=a.errorBarPositions(y,x,b,S,T);M.errorX&&g.extendFlat(M.errorX,w.x),M.errorY&&g.extendFlat(M.errorY,w.y)}return M.text&&(g.extendFlat(M.text,{positions:b},a.textPosition(y,x,M.text,M.marker)),g.extendFlat(M.textSel,{positions:b},a.textPosition(y,x,M.text,M.markerSel)),g.extendFlat(M.textUnsel,{positions:b},a.textPosition(y,x,M.text,M.markerUnsel))),M}}),C3=Vt((X,V)=>{var c=qr(),g=vi(),E=bd().DESELECTDIM;function A(t){var e=t[0],r=e.trace,i=e.t,n=i._scene,o=i.index,a=n.selectBatch[o],s=n.unselectBatch[o],h=n.textOptions[o],v=n.textSelectedOptions[o]||{},m=n.textUnselectedOptions[o]||{},p=c.extendFlat({},h),y,l;if(a.length||s.length){var x=v.color,b=m.color,S=h.color,T=c.isArrayOrTypedArray(S);for(p.color=new Array(r._length),y=0;y<a.length;y++)l=a[y],p.color[l]=x||(T?S[l]:S);for(y=0;y<s.length;y++){l=s[y];var M=T?S[l]:S;p.color[l]=b||(x?M:g.addOpacity(M,E))}}n.glText[o].update(p)}V.exports={styleTextSelection:A}}),D3=Vt((X,V)=>{var c=Sl(),g=C3().styleTextSelection;V.exports=function(E,A){var t=E.cd,e=E.xaxis,r=E.yaxis,i=[],n=t[0].trace,o=t[0].t,a=n._length,s=o.x,h=o.y,v=o._scene,m=o.index;if(!v)return i;var p=c.hasText(n),y=c.hasMarkers(n),l=!y&&!p;if(n.visible!==!0||l)return i;var x=[],b=[];if(A!==!1&&!A.degenerate)for(var S=0;S<a;S++)A.contains([o.xpx[S],o.ypx[S]],!1,S,E)?(x.push(S),i.push({pointNumber:S,x:e.c2d(s[S]),y:r.c2d(h[S])})):b.push(S);if(y){var T=v.scatter2d;if(!x.length&&!b.length){var M=new Array(v.count);M[m]=v.markerOptions[m],T.update.apply(T,M)}else if(!v.selectBatch[m].length&&!v.unselectBatch[m].length){var w=new Array(v.count);w[m]=v.markerUnselectedOptions[m],T.update.apply(T,w)}}return v.selectBatch[m]=x,v.unselectBatch[m]=b,p&&g(t),i}}),k8=Vt((X,V)=>{var c=Dx();V.exports={moduleType:"trace",name:"scattergl",basePlotModule:Pc(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:Ev(),supplyDefaults:u8(),crossTraceDefaults:Pb(),colorbar:Wh(),formatLabels:c8(),calc:T8(),hoverPoints:c.hoverPoints,selectPoints:D3(),meta:{}}}),A8=Vt((X,V)=>{var c=qg();V.exports=g,V.exports.to=g,V.exports.from=E;function g(A,t){t==null&&(t=!0);var e=A[0],r=A[1],i=A[2],n=A[3];n==null&&(n=t?1:255),t&&(e*=255,r*=255,i*=255,n*=255),e=c(e,0,255)&255,r=c(r,0,255)&255,i=c(i,0,255)&255,n=c(n,0,255)&255;var o=e*16777216+(r<<16)+(i<<8)+n;return o}function E(A,t){A=+A;var e=A>>>24,r=(A&16711680)>>>16,i=(A&65280)>>>8,n=A&255;return t===!1?[e,r,i,n]:[e/255,r/255,i/255,n/255]}}),Gc=Vt((X,V)=>{var c=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;function A(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function t(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var r={},i=0;i<10;i++)r["_"+String.fromCharCode(i)]=i;var n=Object.getOwnPropertyNames(r).map(function(a){return r[a]});if(n.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(a){o[a]=a}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}V.exports=t()?Object.assign:function(e,r){for(var i,n=A(e),o,a=1;a<arguments.length;a++){i=Object(arguments[a]);for(var s in i)g.call(i,s)&&(n[s]=i[s]);if(c){o=c(i);for(var h=0;h<o.length;h++)E.call(i,o[h])&&(n[o[h]]=i[o[h]])}}return n}}),M8=Vt((X,V)=>{V.exports=function(c){typeof c=="string"&&(c=[c]);for(var g=[].slice.call(arguments,1),E=[],A=0;A<c.length-1;A++)E.push(c[A],g[A]||"");return E.push(c[A]),E.join("")}}),z3=Vt((X,V)=>{V.exports=function(c,g,E){Array.isArray(E)||(E=[].slice.call(arguments,2));for(var A=0,t=E.length;A<t;A++){var e=E[A];for(var r in e)if(!(g[r]!==void 0&&!Array.isArray(g[r])&&c[r]===g[r])&&r in g){var i;if(e[r]===!0)i=g[r];else if(e[r]===!1||typeof e[r]=="function"&&(i=e[r](g[r],c,g),i===void 0))continue;c[r]=i}}return c}}),S8=Vt((X,V)=>{V.exports=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}),Fx=Vt((X,V)=>{V.exports=E,V.exports.float32=V.exports.float=E,V.exports.fract32=V.exports.fract=g;var c=new Float32Array(1);function g(A,t){if(A.length){if(A instanceof Float32Array)return new Float32Array(A.length);t instanceof Float32Array||(t=E(A));for(var e=0,r=t.length;e<r;e++)t[e]=A[e]-t[e];return t}return E(A-E(A))}function E(A){return A.length?A instanceof Float32Array?A:new Float32Array(A):(c[0]=A,c[0])}}),O3=Vt((X,V)=>{function c(k,_){var D=k==null?null:typeof Symbol<"u"&&k[Symbol.iterator]||k["@@iterator"];if(D!=null){var I,O,B,R,L=[],F=!0,N=!1;try{if(B=(D=D.call(k)).next,_!==0)for(;!(F=(I=B.call(D)).done)&&(L.push(I.value),L.length!==_);F=!0);}catch(j){N=!0,O=j}finally{try{if(!F&&D.return!=null&&(R=D.return(),Object(R)!==R))return}finally{if(N)throw O}}return L}}function g(k,_){return t(k)||c(k,_)||r(k,_)||o()}function E(k){return A(k)||e(k)||r(k)||n()}function A(k){if(Array.isArray(k))return i(k)}function t(k){if(Array.isArray(k))return k}function e(k){if(typeof Symbol<"u"&&k[Symbol.iterator]!=null||k["@@iterator"]!=null)return Array.from(k)}function r(k,_){if(k){if(typeof k=="string")return i(k,_);var D=Object.prototype.toString.call(k).slice(8,-1);if(D==="Object"&&k.constructor&&(D=k.constructor.name),D==="Map"||D==="Set")return Array.from(k);if(D==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(D))return i(k,_)}}function i(k,_){(_==null||_>k.length)&&(_=k.length);for(var D=0,I=new Array(_);D<_;D++)I[D]=k[D];return I}function n(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=jd(),s=P0(),h=A8(),v=Ox(),m=Gc(),p=M8(),y=kp(),l=z3(),x=I0(),b=S8(),S=Fx(),T=Zg(),M=w;function w(k,_){var D=this;if(!(this instanceof w))return new w(k,_);typeof k=="function"?(_||(_={}),_.regl=k):(_=k,k=null),_&&_.length&&(_.positions=_),k=_.regl;var I=k._gl,O,B=[],R={},L=[],F=[null],N=[null],j=255,G=100;this.tooManyColors=b,O=k.texture({data:new Uint8Array(j*4),width:j,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),m(this,{regl:k,gl:I,groups:L,markerCache:N,markerTextures:F,palette:B,paletteIds:R,paletteTexture:O,maxColors:j,maxSize:G,canvas:I.canvas}),this.update(_);var rt={uniforms:{constPointSize:!!_.constPointSize,opacity:k.prop("opacity"),paletteSize:function(tt,Z){return[D.tooManyColors?0:j,O.height]},pixelRatio:k.context("pixelRatio"),scale:k.prop("scale"),scaleFract:k.prop("scaleFract"),translate:k.prop("translate"),translateFract:k.prop("translateFract"),markerTexture:k.prop("markerTexture"),paletteTexture:O},attributes:{x:function(tt,Z){return Z.xAttr||{buffer:Z.positionBuffer,stride:8,offset:0}},y:function(tt,Z){return Z.yAttr||{buffer:Z.positionBuffer,stride:8,offset:4}},xFract:function(tt,Z){return Z.xAttr?{constant:[0,0]}:{buffer:Z.positionFractBuffer,stride:8,offset:0}},yFract:function(tt,Z){return Z.yAttr?{constant:[0,0]}:{buffer:Z.positionFractBuffer,stride:8,offset:4}},size:function(tt,Z){return Z.size.length?{buffer:Z.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(Z.size*255/D.maxSize)]}},borderSize:function(tt,Z){return Z.borderSize.length?{buffer:Z.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(Z.borderSize*255/D.maxSize)]}},colorId:function(tt,Z){return Z.color.length?{buffer:Z.colorBuffer,stride:D.tooManyColors?8:4,offset:0}:{constant:D.tooManyColors?B.slice(Z.color*4,Z.color*4+4):[Z.color]}},borderColorId:function(tt,Z){return Z.borderColor.length?{buffer:Z.colorBuffer,stride:D.tooManyColors?8:4,offset:D.tooManyColors?4:2}:{constant:D.tooManyColors?B.slice(Z.borderColor*4,Z.borderColor*4+4):[Z.borderColor]}},isActive:function(tt,Z){return Z.activation===!0?{constant:[1]}:Z.activation?Z.activation:{constant:[0]}}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:k.prop("viewport")},viewport:k.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:k.prop("elements"),count:k.prop("count"),offset:k.prop("offset"),primitive:"points"},ct=m({},rt);ct.frag=p([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
uniform float opacity;
|
||
uniform sampler2D markerTexture;
|
||
|
||
varying vec4 fragColor, fragBorderColor;
|
||
varying float fragWidth, fragBorderColorLevel, fragColorLevel;
|
||
|
||
float smoothStep(float x, float y) {
|
||
return 1.0 / (1.0 + exp(50.0*(x - y)));
|
||
}
|
||
|
||
void main() {
|
||
float dist = texture2D(markerTexture, gl_PointCoord).r, delta = fragWidth;
|
||
|
||
// max-distance alpha
|
||
if (dist < 0.003) discard;
|
||
|
||
// null-border case
|
||
if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {
|
||
float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);
|
||
gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity);
|
||
}
|
||
else {
|
||
float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);
|
||
float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);
|
||
|
||
vec4 color = fragBorderColor;
|
||
color.a *= borderColorAmt;
|
||
color = mix(color, fragColor, colorAmt);
|
||
color.a *= opacity;
|
||
|
||
gl_FragColor = color;
|
||
}
|
||
|
||
}
|
||
`]),ct.vert=p([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute float x, y, xFract, yFract;
|
||
attribute float size, borderSize;
|
||
attribute vec4 colorId, borderColorId;
|
||
attribute float isActive;
|
||
|
||
// \`invariant\` effectively turns off optimizations for the position.
|
||
// We need this because -fast-math on M1 Macs is re-ordering
|
||
// floating point operations in a way that causes floating point
|
||
// precision limits to put points in the wrong locations.
|
||
invariant gl_Position;
|
||
|
||
uniform bool constPointSize;
|
||
uniform float pixelRatio;
|
||
uniform vec2 scale, scaleFract, translate, translateFract, paletteSize;
|
||
uniform sampler2D paletteTexture;
|
||
|
||
const float maxSize = 100.;
|
||
const float borderLevel = .5;
|
||
|
||
varying vec4 fragColor, fragBorderColor;
|
||
varying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel;
|
||
|
||
float pointSizeScale = (constPointSize) ? 2. : pixelRatio;
|
||
|
||
bool isDirect = (paletteSize.x < 1.);
|
||
|
||
vec4 getColor(vec4 id) {
|
||
return isDirect ? id / 255. : texture2D(paletteTexture,
|
||
vec2(
|
||
(id.x + .5) / paletteSize.x,
|
||
(id.y + .5) / paletteSize.y
|
||
)
|
||
);
|
||
}
|
||
|
||
void main() {
|
||
// ignore inactive points
|
||
if (isActive == 0.) return;
|
||
|
||
vec2 position = vec2(x, y);
|
||
vec2 positionFract = vec2(xFract, yFract);
|
||
|
||
vec4 color = getColor(colorId);
|
||
vec4 borderColor = getColor(borderColorId);
|
||
|
||
float size = size * maxSize / 255.;
|
||
float borderSize = borderSize * maxSize / 255.;
|
||
|
||
gl_PointSize = 2. * size * pointSizeScale;
|
||
fragPointSize = size * pixelRatio;
|
||
|
||
vec2 pos = (position + translate) * scale
|
||
+ (positionFract + translateFract) * scale
|
||
+ (position + translate) * scaleFract
|
||
+ (positionFract + translateFract) * scaleFract;
|
||
|
||
gl_Position = vec4(pos * 2. - 1., 0., 1.);
|
||
|
||
fragColor = color;
|
||
fragBorderColor = borderColor;
|
||
fragWidth = 1. / gl_PointSize;
|
||
|
||
fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);
|
||
fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);
|
||
}
|
||
`]),this.drawMarker=k(ct);var lt=m({},rt);lt.frag=p([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
varying vec4 fragColor, fragBorderColor;
|
||
varying float fragBorderRadius, fragWidth;
|
||
|
||
uniform float opacity;
|
||
|
||
float smoothStep(float edge0, float edge1, float x) {
|
||
float t;
|
||
t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
|
||
return t * t * (3.0 - 2.0 * t);
|
||
}
|
||
|
||
void main() {
|
||
float radius, alpha = 1.0, delta = fragWidth;
|
||
|
||
radius = length(2.0 * gl_PointCoord.xy - 1.0);
|
||
|
||
if (radius > 1.0 + delta) {
|
||
discard;
|
||
}
|
||
|
||
alpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);
|
||
|
||
float borderRadius = fragBorderRadius;
|
||
float ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);
|
||
vec4 color = mix(fragColor, fragBorderColor, ratio);
|
||
color.a *= alpha * opacity;
|
||
gl_FragColor = color;
|
||
}
|
||
`]),lt.vert=p([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute float x, y, xFract, yFract;
|
||
attribute float size, borderSize;
|
||
attribute vec4 colorId, borderColorId;
|
||
attribute float isActive;
|
||
|
||
// \`invariant\` effectively turns off optimizations for the position.
|
||
// We need this because -fast-math on M1 Macs is re-ordering
|
||
// floating point operations in a way that causes floating point
|
||
// precision limits to put points in the wrong locations.
|
||
invariant gl_Position;
|
||
|
||
uniform bool constPointSize;
|
||
uniform float pixelRatio;
|
||
uniform vec2 paletteSize, scale, scaleFract, translate, translateFract;
|
||
uniform sampler2D paletteTexture;
|
||
|
||
const float maxSize = 100.;
|
||
|
||
varying vec4 fragColor, fragBorderColor;
|
||
varying float fragBorderRadius, fragWidth;
|
||
|
||
float pointSizeScale = (constPointSize) ? 2. : pixelRatio;
|
||
|
||
bool isDirect = (paletteSize.x < 1.);
|
||
|
||
vec4 getColor(vec4 id) {
|
||
return isDirect ? id / 255. : texture2D(paletteTexture,
|
||
vec2(
|
||
(id.x + .5) / paletteSize.x,
|
||
(id.y + .5) / paletteSize.y
|
||
)
|
||
);
|
||
}
|
||
|
||
void main() {
|
||
// ignore inactive points
|
||
if (isActive == 0.) return;
|
||
|
||
vec2 position = vec2(x, y);
|
||
vec2 positionFract = vec2(xFract, yFract);
|
||
|
||
vec4 color = getColor(colorId);
|
||
vec4 borderColor = getColor(borderColorId);
|
||
|
||
float size = size * maxSize / 255.;
|
||
float borderSize = borderSize * maxSize / 255.;
|
||
|
||
gl_PointSize = (size + borderSize) * pointSizeScale;
|
||
|
||
vec2 pos = (position + translate) * scale
|
||
+ (positionFract + translateFract) * scale
|
||
+ (position + translate) * scaleFract
|
||
+ (positionFract + translateFract) * scaleFract;
|
||
|
||
gl_Position = vec4(pos * 2. - 1., 0., 1.);
|
||
|
||
fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);
|
||
fragColor = color;
|
||
fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;
|
||
fragWidth = 1. / gl_PointSize;
|
||
}
|
||
`]),b&&(lt.frag=lt.frag.replace("smoothstep","smoothStep"),ct.frag=ct.frag.replace("smoothstep","smoothStep")),this.drawCircle=k(lt)}w.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},w.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},w.prototype.draw=function(){for(var k=this,_=arguments.length,D=new Array(_),I=0;I<_;I++)D[I]=arguments[I];var O=this.groups;if(D.length===1&&Array.isArray(D[0])&&(D[0][0]===null||Array.isArray(D[0][0]))&&(D=D[0]),this.regl._refresh(),D.length)for(var B=0;B<D.length;B++)this.drawItem(B,D[B]);else O.forEach(function(R,L){k.drawItem(L)});return this},w.prototype.drawItem=function(k,_){var D=this.groups,I=D[k];if(typeof _=="number"&&(k=_,I=D[_],_=null),!!(I&&I.count&&I.opacity)){I.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,I,_));for(var O=[],B=1;B<I.activation.length;B++)!I.activation[B]||I.activation[B]!==!0&&!I.activation[B].data.length||O.push.apply(O,E(this.getMarkerDrawOptions(B,I,_)));O.length&&this.drawMarker(O)}},w.prototype.getMarkerDrawOptions=function(k,_,D){var I=_.range,O=_.tree,B=_.viewport,R=_.activation,L=_.selectionBuffer,F=_.count;if(this.regl,!O)return D?[m({},_,{markerTexture:this.markerTextures[k],activation:R[k],count:D.length,elements:D,offset:0})]:[m({},_,{markerTexture:this.markerTextures[k],activation:R[k],offset:0})];var N=[],j=O.range(I,{lod:!0,px:[(I[2]-I[0])/B.width,(I[3]-I[1])/B.height]});if(D){for(var G=R[k],rt=G.data,ct=new Uint8Array(F),lt=0;lt<D.length;lt++){var tt=D[lt];ct[tt]=rt?rt[tt]:1}L.subdata(ct)}for(var Z=j.length;Z--;){var st=g(j[Z],2),$=st[0],Q=st[1];N.push(m({},_,{markerTexture:this.markerTextures[k],activation:D?L:R[k],offset:$,count:Q-$}))}return N},w.prototype.update=function(){for(var k=this,_=arguments.length,D=new Array(_),I=0;I<_;I++)D[I]=arguments[I];if(D.length){D.length===1&&Array.isArray(D[0])&&(D=D[0]);var O=this.groups,B=this.gl,R=this.regl,L=this.maxSize,F=this.maxColors,N=this.palette;this.groups=O=D.map(function(j,G){var rt=O[G];if(j===void 0)return rt;j===null?j={positions:null}:typeof j=="function"?j={ondraw:j}:typeof j[0]=="number"&&(j={positions:j}),j=y(j,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"}),j.positions===null&&(j.positions=[]),j.tooManyColors!=null&&(k.tooManyColors=j.tooManyColors),rt||(O[G]=rt={id:G,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:R.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:R.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:R.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:R.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:R.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},j=m({},w.defaults,j)),j.positions&&!("marker"in j)&&(j.marker=rt.marker,delete rt.marker),j.marker&&!("positions"in j)&&(j.positions=rt.positions,delete rt.positions);var ct=0,lt=0;if(l(rt,j,[{snap:!0,size:function(Jt,Qt){return Jt==null&&(Jt=w.defaults.size),ct+=Jt&&Jt.length?1:0,Jt},borderSize:function(Jt,Qt){return Jt==null&&(Jt=w.defaults.borderSize),ct+=Jt&&Jt.length?1:0,Jt},opacity:parseFloat,color:function(Jt,Qt){return Jt==null&&(Jt=w.defaults.color),Jt=k.updateColor(Jt),lt++,Jt},borderColor:function(Jt,Qt){return Jt==null&&(Jt=w.defaults.borderColor),Jt=k.updateColor(Jt),lt++,Jt},bounds:function(Jt,Qt,Wt){return"range"in Wt||(Wt.range=null),Jt},positions:function(Jt,Qt,Wt){var gt=Qt.snap,bt=Qt.positionBuffer,vt=Qt.positionFractBuffer,Ut=Qt.selectionBuffer;if(Jt.x||Jt.y)return Jt.x.length?Qt.xAttr={buffer:R.buffer(Jt.x),offset:0,stride:4,count:Jt.x.length}:Qt.xAttr={buffer:Jt.x.buffer,offset:Jt.x.offset*4||0,stride:(Jt.x.stride||1)*4,count:Jt.x.count},Jt.y.length?Qt.yAttr={buffer:R.buffer(Jt.y),offset:0,stride:4,count:Jt.y.length}:Qt.yAttr={buffer:Jt.y.buffer,offset:Jt.y.offset*4||0,stride:(Jt.y.stride||1)*4,count:Jt.y.count},Qt.count=Math.max(Qt.xAttr.count,Qt.yAttr.count),Jt;Jt=x(Jt,"float64");var Kt=Qt.count=Math.floor(Jt.length/2),Zt=Qt.bounds=Kt?s(Jt,2):null;if(!Wt.range&&!Qt.range&&(delete Qt.range,Wt.range=Zt),!Wt.marker&&!Qt.marker&&(delete Qt.marker,Wt.marker=null),gt&&(gt===!0||Kt>gt)?Qt.tree=v(Jt,{bounds:Zt}):gt&>.length&&(Qt.tree=gt),Qt.tree){var le={primitive:"points",usage:"static",data:Qt.tree,type:"uint32"};Qt.elements?Qt.elements(le):Qt.elements=R.elements(le)}var Te=S.float32(Jt);bt({data:Te,usage:"dynamic"});var Se=S.fract32(Jt,Te);return vt({data:Se,usage:"dynamic"}),Ut({data:new Uint8Array(Kt),type:"uint8",usage:"stream"}),Jt}},{marker:function(Jt,Qt,Wt){var gt=Qt.activation;if(gt.forEach(function(Se){return Se&&Se.destroy&&Se.destroy()}),gt.length=0,!Jt||typeof Jt[0]=="number"){var bt=k.addMarker(Jt);gt[bt]=!0}else{for(var vt=[],Ut=0,Kt=Math.min(Jt.length,Qt.count);Ut<Kt;Ut++){var Zt=k.addMarker(Jt[Ut]);vt[Zt]||(vt[Zt]=new Uint8Array(Qt.count)),vt[Zt][Ut]=1}for(var le=0;le<vt.length;le++)if(vt[le]){var Te={data:vt[le],type:"uint8",usage:"static"};gt[le]?gt[le](Te):gt[le]=R.buffer(Te),gt[le].data=vt[le]}}return Jt},range:function(Jt,Qt,Wt){var gt=Qt.bounds;if(gt)return Jt||(Jt=gt),Qt.scale=[1/(Jt[2]-Jt[0]),1/(Jt[3]-Jt[1])],Qt.translate=[-Jt[0],-Jt[1]],Qt.scaleFract=S.fract(Qt.scale),Qt.translateFract=S.fract(Qt.translate),Jt},viewport:function(Jt){var Qt=T(Jt||[B.drawingBufferWidth,B.drawingBufferHeight]);return Qt}}]),ct){var tt=rt,Z=tt.count,st=tt.size,$=tt.borderSize,Q=tt.sizeBuffer,nt=new Uint8Array(Z*2);if(st.length||$.length)for(var Y=0;Y<Z;Y++)nt[Y*2]=Math.round((st[Y]==null?st:st[Y])*255/L),nt[Y*2+1]=Math.round(($[Y]==null?$:$[Y])*255/L);Q({data:nt,usage:"dynamic"})}if(lt){var q=rt,ot=q.count,it=q.color,dt=q.borderColor,wt=q.colorBuffer,xt;if(k.tooManyColors){if(it.length||dt.length){xt=new Uint8Array(ot*8);for(var Ft=0;Ft<ot;Ft++){var Et=it[Ft];xt[Ft*8]=N[Et*4],xt[Ft*8+1]=N[Et*4+1],xt[Ft*8+2]=N[Et*4+2],xt[Ft*8+3]=N[Et*4+3];var Nt=dt[Ft];xt[Ft*8+4]=N[Nt*4],xt[Ft*8+5]=N[Nt*4+1],xt[Ft*8+6]=N[Nt*4+2],xt[Ft*8+7]=N[Nt*4+3]}}}else if(it.length||dt.length){xt=new Uint8Array(ot*4+2);for(var te=0;te<ot;te++)it[te]!=null&&(xt[te*4]=it[te]%F,xt[te*4+1]=Math.floor(it[te]/F)),dt[te]!=null&&(xt[te*4+2]=dt[te]%F,xt[te*4+3]=Math.floor(dt[te]/F))}wt({data:xt||new Uint8Array(0),type:"uint8",usage:"dynamic"})}return rt})}},w.prototype.addMarker=function(k){var _=this.markerTextures,D=this.regl,I=this.markerCache,O=k==null?0:I.indexOf(k);if(O>=0)return O;var B;if(k instanceof Uint8Array||k instanceof Uint8ClampedArray)B=k;else{B=new Uint8Array(k.length);for(var R=0,L=k.length;R<L;R++)B[R]=k[R]*255}var F=Math.floor(Math.sqrt(B.length));return O=_.length,I.push(k),_.push(D.texture({channels:1,data:B,radius:F,mag:"linear",min:"linear"})),O},w.prototype.updateColor=function(k){var _=this.paletteIds,D=this.palette,I=this.maxColors;Array.isArray(k)||(k=[k]);var O=[];if(typeof k[0]=="number"){var B=[];if(Array.isArray(k))for(var R=0;R<k.length;R+=4)B.push(k.slice(R,R+4));else for(var L=0;L<k.length;L+=4)B.push(k.subarray(L,L+4));k=B}for(var F=0;F<k.length;F++){var N=k[F];N=a(N,"uint8");var j=h(N,!1);if(_[j]==null){var G=D.length;_[j]=Math.floor(G/4),D[G]=N[0],D[G+1]=N[1],D[G+2]=N[2],D[G+3]=N[3]}O[F]=_[j]}return!this.tooManyColors&&D.length>I*4&&(this.tooManyColors=!0),this.updatePalette(D),O.length===1?O[0]:O},w.prototype.updatePalette=function(k){if(!this.tooManyColors){var _=this.maxColors,D=this.paletteTexture,I=Math.ceil(k.length*.25/_);if(I>1){k=k.slice();for(var O=k.length*.25%_;O<I*_;O++)k.push(0,0,0,0)}D.height<I&&D.resize(_,I),D.subimage({width:Math.min(k.length*.25,_),height:I,data:k},0,0)}},w.prototype.destroy=function(){return this.groups.forEach(function(k){k.sizeBuffer.destroy(),k.positionBuffer.destroy(),k.positionFractBuffer.destroy(),k.colorBuffer.destroy(),k.activation.forEach(function(_){return _&&_.destroy&&_.destroy()}),k.selectionBuffer.destroy(),k.elements&&k.elements.destroy()}),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach(function(k){return k&&k.destroy&&k.destroy()}),this};var u=Gc(),f=function(k,_){var D=new M(k,_),I=D.render.bind(D);return u(I,{render:I,update:D.update.bind(D),draw:D.draw.bind(D),destroy:D.destroy.bind(D),regl:D.regl,gl:D.gl,canvas:D.gl.canvas,groups:D.groups,markers:D.markerCache,palette:D.palette}),I};V.exports=f}),E8=Vt((X,V)=>{V.exports=c,V.exports.default=c;function c(R,L,F){F=F||2;var N=L&&L.length,j=N?L[0]*F:R.length,G=g(R,0,j,F,!0),rt=[];if(!G||G.next===G.prev)return rt;var ct,lt,tt,Z,st,$,Q;if(N&&(G=n(R,L,G,F)),R.length>80*F){ct=tt=R[0],lt=Z=R[1];for(var nt=F;nt<j;nt+=F)st=R[nt],$=R[nt+1],st<ct&&(ct=st),$<lt&&(lt=$),st>tt&&(tt=st),$>Z&&(Z=$);Q=Math.max(tt-ct,Z-lt),Q=Q!==0?32767/Q:0}return A(G,rt,F,ct,lt,Q,0),rt}function g(R,L,F,N,j){var G,rt;if(j===B(R,L,F,N)>0)for(G=L;G<F;G+=N)rt=D(G,R[G],R[G+1],rt);else for(G=F-N;G>=L;G-=N)rt=D(G,R[G],R[G+1],rt);return rt&&S(rt,rt.next)&&(I(rt),rt=rt.next),rt}function E(R,L){if(!R)return R;L||(L=R);var F=R,N;do if(N=!1,!F.steiner&&(S(F,F.next)||b(F.prev,F,F.next)===0)){if(I(F),F=L=F.prev,F===F.next)break;N=!0}else F=F.next;while(N||F!==L);return L}function A(R,L,F,N,j,G,rt){if(R){!rt&&G&&v(R,N,j,G);for(var ct=R,lt,tt;R.prev!==R.next;){if(lt=R.prev,tt=R.next,G?e(R,N,j,G):t(R)){L.push(lt.i/F|0),L.push(R.i/F|0),L.push(tt.i/F|0),I(R),R=tt.next,ct=tt.next;continue}if(R=tt,R===ct){rt?rt===1?(R=r(E(R),L,F),A(R,L,F,N,j,G,2)):rt===2&&i(R,L,F,N,j,G):A(E(R),L,F,N,j,G,1);break}}}}function t(R){var L=R.prev,F=R,N=R.next;if(b(L,F,N)>=0)return!1;for(var j=L.x,G=F.x,rt=N.x,ct=L.y,lt=F.y,tt=N.y,Z=j<G?j<rt?j:rt:G<rt?G:rt,st=ct<lt?ct<tt?ct:tt:lt<tt?lt:tt,$=j>G?j>rt?j:rt:G>rt?G:rt,Q=ct>lt?ct>tt?ct:tt:lt>tt?lt:tt,nt=N.next;nt!==L;){if(nt.x>=Z&&nt.x<=$&&nt.y>=st&&nt.y<=Q&&l(j,ct,G,lt,rt,tt,nt.x,nt.y)&&b(nt.prev,nt,nt.next)>=0)return!1;nt=nt.next}return!0}function e(R,L,F,N){var j=R.prev,G=R,rt=R.next;if(b(j,G,rt)>=0)return!1;for(var ct=j.x,lt=G.x,tt=rt.x,Z=j.y,st=G.y,$=rt.y,Q=ct<lt?ct<tt?ct:tt:lt<tt?lt:tt,nt=Z<st?Z<$?Z:$:st<$?st:$,Y=ct>lt?ct>tt?ct:tt:lt>tt?lt:tt,q=Z>st?Z>$?Z:$:st>$?st:$,ot=p(Q,nt,L,F,N),it=p(Y,q,L,F,N),dt=R.prevZ,wt=R.nextZ;dt&&dt.z>=ot&&wt&&wt.z<=it;){if(dt.x>=Q&&dt.x<=Y&&dt.y>=nt&&dt.y<=q&&dt!==j&&dt!==rt&&l(ct,Z,lt,st,tt,$,dt.x,dt.y)&&b(dt.prev,dt,dt.next)>=0||(dt=dt.prevZ,wt.x>=Q&&wt.x<=Y&&wt.y>=nt&&wt.y<=q&&wt!==j&&wt!==rt&&l(ct,Z,lt,st,tt,$,wt.x,wt.y)&&b(wt.prev,wt,wt.next)>=0))return!1;wt=wt.nextZ}for(;dt&&dt.z>=ot;){if(dt.x>=Q&&dt.x<=Y&&dt.y>=nt&&dt.y<=q&&dt!==j&&dt!==rt&&l(ct,Z,lt,st,tt,$,dt.x,dt.y)&&b(dt.prev,dt,dt.next)>=0)return!1;dt=dt.prevZ}for(;wt&&wt.z<=it;){if(wt.x>=Q&&wt.x<=Y&&wt.y>=nt&&wt.y<=q&&wt!==j&&wt!==rt&&l(ct,Z,lt,st,tt,$,wt.x,wt.y)&&b(wt.prev,wt,wt.next)>=0)return!1;wt=wt.nextZ}return!0}function r(R,L,F){var N=R;do{var j=N.prev,G=N.next.next;!S(j,G)&&T(j,N,N.next,G)&&f(j,G)&&f(G,j)&&(L.push(j.i/F|0),L.push(N.i/F|0),L.push(G.i/F|0),I(N),I(N.next),N=R=G),N=N.next}while(N!==R);return E(N)}function i(R,L,F,N,j,G){var rt=R;do{for(var ct=rt.next.next;ct!==rt.prev;){if(rt.i!==ct.i&&x(rt,ct)){var lt=_(rt,ct);rt=E(rt,rt.next),lt=E(lt,lt.next),A(rt,L,F,N,j,G,0),A(lt,L,F,N,j,G,0);return}ct=ct.next}rt=rt.next}while(rt!==R)}function n(R,L,F,N){var j=[],G,rt,ct,lt,tt;for(G=0,rt=L.length;G<rt;G++)ct=L[G]*N,lt=G<rt-1?L[G+1]*N:R.length,tt=g(R,ct,lt,N,!1),tt===tt.next&&(tt.steiner=!0),j.push(y(tt));for(j.sort(o),G=0;G<j.length;G++)F=a(j[G],F);return F}function o(R,L){return R.x-L.x}function a(R,L){var F=s(R,L);if(!F)return L;var N=_(F,R);return E(N,N.next),E(F,F.next)}function s(R,L){var F=L,N=R.x,j=R.y,G=-1/0,rt;do{if(j<=F.y&&j>=F.next.y&&F.next.y!==F.y){var ct=F.x+(j-F.y)*(F.next.x-F.x)/(F.next.y-F.y);if(ct<=N&&ct>G&&(G=ct,rt=F.x<F.next.x?F:F.next,ct===N))return rt}F=F.next}while(F!==L);if(!rt)return null;var lt=rt,tt=rt.x,Z=rt.y,st=1/0,$;F=rt;do N>=F.x&&F.x>=tt&&N!==F.x&&l(j<Z?N:G,j,tt,Z,j<Z?G:N,j,F.x,F.y)&&($=Math.abs(j-F.y)/(N-F.x),f(F,R)&&($<st||$===st&&(F.x>rt.x||F.x===rt.x&&h(rt,F)))&&(rt=F,st=$)),F=F.next;while(F!==lt);return rt}function h(R,L){return b(R.prev,R,L.prev)<0&&b(L.next,R,R.next)<0}function v(R,L,F,N){var j=R;do j.z===0&&(j.z=p(j.x,j.y,L,F,N)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==R);j.prevZ.nextZ=null,j.prevZ=null,m(j)}function m(R){var L,F,N,j,G,rt,ct,lt,tt=1;do{for(F=R,R=null,G=null,rt=0;F;){for(rt++,N=F,ct=0,L=0;L<tt&&(ct++,N=N.nextZ,!!N);L++);for(lt=tt;ct>0||lt>0&&N;)ct!==0&&(lt===0||!N||F.z<=N.z)?(j=F,F=F.nextZ,ct--):(j=N,N=N.nextZ,lt--),G?G.nextZ=j:R=j,j.prevZ=G,G=j;F=N}G.nextZ=null,tt*=2}while(rt>1);return R}function p(R,L,F,N,j){return R=(R-F)*j|0,L=(L-N)*j|0,R=(R|R<<8)&16711935,R=(R|R<<4)&252645135,R=(R|R<<2)&858993459,R=(R|R<<1)&1431655765,L=(L|L<<8)&16711935,L=(L|L<<4)&252645135,L=(L|L<<2)&858993459,L=(L|L<<1)&1431655765,R|L<<1}function y(R){var L=R,F=R;do(L.x<F.x||L.x===F.x&&L.y<F.y)&&(F=L),L=L.next;while(L!==R);return F}function l(R,L,F,N,j,G,rt,ct){return(j-rt)*(L-ct)>=(R-rt)*(G-ct)&&(R-rt)*(N-ct)>=(F-rt)*(L-ct)&&(F-rt)*(G-ct)>=(j-rt)*(N-ct)}function x(R,L){return R.next.i!==L.i&&R.prev.i!==L.i&&!u(R,L)&&(f(R,L)&&f(L,R)&&k(R,L)&&(b(R.prev,R,L.prev)||b(R,L.prev,L))||S(R,L)&&b(R.prev,R,R.next)>0&&b(L.prev,L,L.next)>0)}function b(R,L,F){return(L.y-R.y)*(F.x-L.x)-(L.x-R.x)*(F.y-L.y)}function S(R,L){return R.x===L.x&&R.y===L.y}function T(R,L,F,N){var j=w(b(R,L,F)),G=w(b(R,L,N)),rt=w(b(F,N,R)),ct=w(b(F,N,L));return!!(j!==G&&rt!==ct||j===0&&M(R,F,L)||G===0&&M(R,N,L)||rt===0&&M(F,R,N)||ct===0&&M(F,L,N))}function M(R,L,F){return L.x<=Math.max(R.x,F.x)&&L.x>=Math.min(R.x,F.x)&&L.y<=Math.max(R.y,F.y)&&L.y>=Math.min(R.y,F.y)}function w(R){return R>0?1:R<0?-1:0}function u(R,L){var F=R;do{if(F.i!==R.i&&F.next.i!==R.i&&F.i!==L.i&&F.next.i!==L.i&&T(F,F.next,R,L))return!0;F=F.next}while(F!==R);return!1}function f(R,L){return b(R.prev,R,R.next)<0?b(R,L,R.next)>=0&&b(R,R.prev,L)>=0:b(R,L,R.prev)<0||b(R,R.next,L)<0}function k(R,L){var F=R,N=!1,j=(R.x+L.x)/2,G=(R.y+L.y)/2;do F.y>G!=F.next.y>G&&F.next.y!==F.y&&j<(F.next.x-F.x)*(G-F.y)/(F.next.y-F.y)+F.x&&(N=!N),F=F.next;while(F!==R);return N}function _(R,L){var F=new O(R.i,R.x,R.y),N=new O(L.i,L.x,L.y),j=R.next,G=L.prev;return R.next=L,L.prev=R,F.next=j,j.prev=F,N.next=F,F.prev=N,G.next=N,N.prev=G,N}function D(R,L,F,N){var j=new O(R,L,F);return N?(j.next=N.next,j.prev=N,N.next.prev=j,N.next=j):(j.prev=j,j.next=j),j}function I(R){R.next.prev=R.prev,R.prev.next=R.next,R.prevZ&&(R.prevZ.nextZ=R.nextZ),R.nextZ&&(R.nextZ.prevZ=R.prevZ)}function O(R,L,F){this.i=R,this.x=L,this.y=F,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}c.deviation=function(R,L,F,N){var j=L&&L.length,G=j?L[0]*F:R.length,rt=Math.abs(B(R,0,G,F));if(j)for(var ct=0,lt=L.length;ct<lt;ct++){var tt=L[ct]*F,Z=ct<lt-1?L[ct+1]*F:R.length;rt-=Math.abs(B(R,tt,Z,F))}var st=0;for(ct=0;ct<N.length;ct+=3){var $=N[ct]*F,Q=N[ct+1]*F,nt=N[ct+2]*F;st+=Math.abs((R[$]-R[nt])*(R[Q+1]-R[$+1])-(R[$]-R[Q])*(R[nt+1]-R[$+1]))}return rt===0&&st===0?0:Math.abs((st-rt)/rt)};function B(R,L,F,N){for(var j=0,G=L,rt=F-N;G<F;G+=N)j+=(R[rt]-R[G])*(R[G+1]+R[rt+1]),rt=G;return j}c.flatten=function(R){for(var L=R[0][0].length,F={vertices:[],holes:[],dimensions:L},N=0,j=0;j<R.length;j++){for(var G=0;G<R[j].length;G++)for(var rt=0;rt<L;rt++)F.vertices.push(R[j][G][rt]);j>0&&(N+=R[j-1].length,F.holes.push(N))}return F}}),P8=Vt((X,V)=>{var c=P0();V.exports=g;function g(E,A,t){if(!E||E.length==null)throw Error("Argument should be an array");A==null&&(A=1),t==null&&(t=c(E,A));for(var e=0;e<A;e++){var r=t[A+e],i=t[e],n=e,o=E.length;if(r===1/0&&i===-1/0)for(n=e;n<o;n+=A)E[n]=E[n]===r?1:E[n]===i?0:.5;else if(r===1/0)for(n=e;n<o;n+=A)E[n]=E[n]===r?1:0;else if(i===-1/0)for(n=e;n<o;n+=A)E[n]=E[n]===i?0:1;else{var a=r-i;for(n=e;n<o;n+=A)isNaN(E[n])||(E[n]=a===0?.5:(E[n]-i)/a)}}return E}}),I8=Vt((X,V)=>{V.exports=function(){var c,g;if(typeof WeakMap!="function")return!1;try{c=new WeakMap([[g={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return!(String(c)!=="[object WeakMap]"||typeof c.set!="function"||c.set({},1)!==c||typeof c.delete!="function"||typeof c.has!="function"||c.get(g)!=="one")}}),L8=Vt((X,V)=>{V.exports=function(){}}),Hd=Vt((X,V)=>{var c=L8()();V.exports=function(g){return g!==c&&g!==null}}),F3=Vt((X,V)=>{var c=Object.create,g=Object.getPrototypeOf,E={};V.exports=function(){var A=Object.setPrototypeOf,t=arguments[0]||c;return typeof A!="function"?!1:g(A(t(null),E))===E}}),B3=Vt((X,V)=>{var c=Hd(),g={function:!0,object:!0};V.exports=function(E){return c(E)&&g[typeof E]||!1}}),Zp=Vt((X,V)=>{var c=Hd();V.exports=function(g){if(!c(g))throw new TypeError("Cannot use null or undefined");return g}}),C8=Vt((X,V)=>{var c=Object.create,g;F3()()||(g=R3()),V.exports=function(){var E,A,t;return!g||g.level!==1?c:(E={},A={},t={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(e){if(e==="__proto__"){A[e]={configurable:!0,enumerable:!1,writable:!0,value:void 0};return}A[e]=t}),Object.defineProperties(E,A),Object.defineProperty(g,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:E}),function(e,r){return c(e===null?E:e,r)})}()}),R3=Vt((X,V)=>{var c=B3(),g=Zp(),E=Object.prototype.isPrototypeOf,A=Object.defineProperty,t={configurable:!0,enumerable:!1,writable:!0,value:void 0},e;e=function(r,i){if(g(r),i===null||c(i))return r;throw new TypeError("Prototype must be null or an object")},V.exports=function(r){var i,n;return r?(r.level===2?r.set?(n=r.set,i=function(o,a){return n.call(e(o,a),a),o}):i=function(o,a){return e(o,a).__proto__=a,o}:i=function o(a,s){var h;return e(a,s),h=E.call(o.nullPolyfill,a),h&&delete o.nullPolyfill.__proto__,s===null&&(s=o.nullPolyfill),a.__proto__=s,h&&A(o.nullPolyfill,"__proto__",t),a},Object.defineProperty(i,"level",{configurable:!1,enumerable:!1,writable:!1,value:r.level})):null}(function(){var r=Object.create(null),i={},n,o=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(o){try{n=o.set,n.call(r,i)}catch{}if(Object.getPrototypeOf(r)===i)return{set:n,level:2}}return r.__proto__=i,Object.getPrototypeOf(r)===i?{level:2}:(r={},r.__proto__=i,Object.getPrototypeOf(r)===i?{level:1}:!1)}()),C8()}),Bx=Vt((X,V)=>{V.exports=F3()()?Object.setPrototypeOf:R3()}),D8=Vt((X,V)=>{var c=B3();V.exports=function(g){if(!c(g))throw new TypeError(g+" is not an Object");return g}}),z8=Vt((X,V)=>{var c=Object.create(null),g=Math.random;V.exports=function(){var E;do E=g().toString(36).slice(2);while(c[E]);return E}}),C0=Vt((X,V)=>{var c=void 0;V.exports=function(g){return g!==c&&g!==null}}),Rx=Vt((X,V)=>{var c=C0(),g={object:!0,function:!0,undefined:!0};V.exports=function(E){return c(E)?hasOwnProperty.call(g,typeof E):!1}}),O8=Vt((X,V)=>{var c=Rx();V.exports=function(g){if(!c(g))return!1;try{return g.constructor?g.constructor.prototype===g:!1}catch{return!1}}}),F8=Vt((X,V)=>{var c=O8();V.exports=function(g){if(typeof g!="function"||!hasOwnProperty.call(g,"length"))return!1;try{if(typeof g.length!="number"||typeof g.call!="function"||typeof g.apply!="function")return!1}catch{return!1}return!c(g)}}),j3=Vt((X,V)=>{var c=F8(),g=/^\s*class[\s{/}]/,E=Function.prototype.toString;V.exports=function(A){return!(!c(A)||g.test(E.call(A)))}}),B8=Vt((X,V)=>{V.exports=function(){var c=Object.assign,g;return typeof c!="function"?!1:(g={foo:"raz"},c(g,{bar:"dwa"},{trzy:"trzy"}),g.foo+g.bar+g.trzy==="razdwatrzy")}}),R8=Vt((X,V)=>{V.exports=function(){try{return Object.keys("primitive"),!0}catch{return!1}}}),j8=Vt((X,V)=>{var c=Hd(),g=Object.keys;V.exports=function(E){return g(c(E)?Object(E):E)}}),N8=Vt((X,V)=>{V.exports=R8()()?Object.keys:j8()}),U8=Vt((X,V)=>{var c=N8(),g=Zp(),E=Math.max;V.exports=function(A,t){var e,r,i=E(arguments.length,2),n;for(A=Object(g(A)),n=function(o){try{A[o]=t[o]}catch(a){e||(e=a)}},r=1;r<i;++r)t=arguments[r],c(t).forEach(n);if(e!==void 0)throw e;return A}}),jx=Vt((X,V)=>{V.exports=B8()()?Object.assign:U8()}),N3=Vt((X,V)=>{var c=Hd(),g=Array.prototype.forEach,E=Object.create,A=function(t,e){var r;for(r in t)e[r]=t[r]};V.exports=function(t){var e=E(null);return g.call(arguments,function(r){c(r)&&A(Object(r),e)}),e}}),V8=Vt((X,V)=>{var c="razdwatrzy";V.exports=function(){return typeof c.contains!="function"?!1:c.contains("dwa")===!0&&c.contains("foo")===!1}}),q8=Vt((X,V)=>{var c=String.prototype.indexOf;V.exports=function(g){return c.call(this,g,arguments[1])>-1}}),U3=Vt((X,V)=>{V.exports=V8()()?String.prototype.contains:q8()}),Xp=Vt((X,V)=>{var c=C0(),g=j3(),E=jx(),A=N3(),t=U3(),e=V.exports=function(r,i){var n,o,a,s,h;return arguments.length<2||typeof r!="string"?(s=i,i=r,r=null):s=arguments[2],c(r)?(n=t.call(r,"c"),o=t.call(r,"e"),a=t.call(r,"w")):(n=a=!0,o=!1),h={value:i,configurable:n,enumerable:o,writable:a},s?E(A(s),h):h};e.gs=function(r,i,n){var o,a,s,h;return typeof r!="string"?(s=n,n=i,i=r,r=null):s=arguments[3],c(i)?g(i)?c(n)?g(n)||(s=n,n=void 0):n=void 0:(s=i,i=n=void 0):i=void 0,c(r)?(o=t.call(r,"c"),a=t.call(r,"e")):(o=!0,a=!1),h={get:i,set:n,configurable:o,enumerable:a},s?E(A(s),h):h}}),Pv=Vt((X,V)=>{var c=Object.prototype.toString,g=c.call(function(){return arguments}());V.exports=function(E){return c.call(E)===g}}),Iv=Vt((X,V)=>{var c=Object.prototype.toString,g=c.call("");V.exports=function(E){return typeof E=="string"||E&&typeof E=="object"&&(E instanceof String||c.call(E)===g)||!1}}),H8=Vt((X,V)=>{V.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}),G8=Vt((X,V)=>{var c=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};V.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return c()}try{return __global__||c()}finally{delete Object.prototype.__global__}}()}),Lv=Vt((X,V)=>{V.exports=H8()()?globalThis:G8()}),W8=Vt((X,V)=>{var c=Lv(),g={object:!0,symbol:!0};V.exports=function(){var E=c.Symbol,A;if(typeof E!="function")return!1;A=E("test symbol");try{String(A)}catch{return!1}return!(!g[typeof E.iterator]||!g[typeof E.toPrimitive]||!g[typeof E.toStringTag])}}),Z8=Vt((X,V)=>{V.exports=function(c){return c?typeof c=="symbol"?!0:!c.constructor||c.constructor.name!=="Symbol"?!1:c[c.constructor.toStringTag]==="Symbol":!1}}),V3=Vt((X,V)=>{var c=Z8();V.exports=function(g){if(!c(g))throw new TypeError(g+" is not a symbol");return g}}),X8=Vt((X,V)=>{var c=Xp(),g=Object.create,E=Object.defineProperty,A=Object.prototype,t=g(null);V.exports=function(e){for(var r=0,i,n;t[e+(r||"")];)++r;return e+=r||"",t[e]=!0,i="@@"+e,E(A,i,c.gs(null,function(o){n||(n=!0,E(this,i,c(o)),n=!1)})),i}}),$8=Vt((X,V)=>{var c=Xp(),g=Lv().Symbol;V.exports=function(E){return Object.defineProperties(E,{hasInstance:c("",g&&g.hasInstance||E("hasInstance")),isConcatSpreadable:c("",g&&g.isConcatSpreadable||E("isConcatSpreadable")),iterator:c("",g&&g.iterator||E("iterator")),match:c("",g&&g.match||E("match")),replace:c("",g&&g.replace||E("replace")),search:c("",g&&g.search||E("search")),species:c("",g&&g.species||E("species")),split:c("",g&&g.split||E("split")),toPrimitive:c("",g&&g.toPrimitive||E("toPrimitive")),toStringTag:c("",g&&g.toStringTag||E("toStringTag")),unscopables:c("",g&&g.unscopables||E("unscopables"))})}}),J8=Vt((X,V)=>{var c=Xp(),g=V3(),E=Object.create(null);V.exports=function(A){return Object.defineProperties(A,{for:c(function(t){return E[t]?E[t]:E[t]=A(String(t))}),keyFor:c(function(t){var e;g(t);for(e in E)if(E[e]===t)return e})})}}),Q8=Vt((X,V)=>{var c=Xp(),g=V3(),E=Lv().Symbol,A=X8(),t=$8(),e=J8(),r=Object.create,i=Object.defineProperties,n=Object.defineProperty,o,a,s;if(typeof E=="function")try{String(E()),s=!0}catch{}else E=null;a=function(h){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return o(h)},V.exports=o=function h(v){var m;if(this instanceof h)throw new TypeError("Symbol is not a constructor");return s?E(v):(m=r(a.prototype),v=v===void 0?"":String(v),i(m,{__description__:c("",v),__name__:c("",A(v))}))},t(o),e(o),i(a.prototype,{constructor:c(o),toString:c("",function(){return this.__name__})}),i(o.prototype,{toString:c(function(){return"Symbol ("+g(this).__description__+")"}),valueOf:c(function(){return g(this)})}),n(o.prototype,o.toPrimitive,c("",function(){var h=g(this);return typeof h=="symbol"?h:h.toString()})),n(o.prototype,o.toStringTag,c("c","Symbol")),n(a.prototype,o.toStringTag,c("c",o.prototype[o.toStringTag])),n(a.prototype,o.toPrimitive,c("c",o.prototype[o.toPrimitive]))}),Gd=Vt((X,V)=>{V.exports=W8()()?Lv().Symbol:Q8()}),Y8=Vt((X,V)=>{var c=Zp();V.exports=function(){return c(this).length=0,this}}),Xg=Vt((X,V)=>{V.exports=function(c){if(typeof c!="function")throw new TypeError(c+" is not a function");return c}}),K8=Vt((X,V)=>{var c=C0(),g=Rx(),E=Object.prototype.toString;V.exports=function(A){if(!c(A))return null;if(g(A)){var t=A.toString;if(typeof t!="function"||t===E)return null}try{return""+A}catch{return null}}}),tP=Vt((X,V)=>{V.exports=function(c){try{return c.toString()}catch{try{return String(c)}catch{return null}}}}),eP=Vt((X,V)=>{var c=tP(),g=/[\n\r\u2028\u2029]/g;V.exports=function(E){var A=c(E);return A===null?"<Non-coercible to string value>":(A.length>100&&(A=A.slice(0,99)+"…"),A=A.replace(g,function(t){switch(t){case`
|
||
`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),A)}}),q3=Vt((X,V)=>{var c=C0(),g=Rx(),E=K8(),A=eP(),t=function(e,r){return e.replace("%v",A(r))};V.exports=function(e,r,i){if(!g(i))throw new TypeError(t(r,e));if(!c(e)){if("default"in i)return i.default;if(i.isOptional)return null}var n=E(i.errorMessage);throw c(n)||(n=r),new TypeError(t(n,e))}}),rP=Vt((X,V)=>{var c=q3(),g=C0();V.exports=function(E){return g(E)?E:c(E,"Cannot use %v",arguments[1])}}),nP=Vt((X,V)=>{var c=q3(),g=j3();V.exports=function(E){return g(E)?E:c(E,"%v is not a plain function",arguments[1])}}),aP=Vt((X,V)=>{V.exports=function(){var c=Array.from,g,E;return typeof c!="function"?!1:(g=["raz","dwa"],E=c(g),!!(E&&E!==g&&E[1]==="dwa"))}}),iP=Vt((X,V)=>{var c=Object.prototype.toString,g=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);V.exports=function(E){return typeof E=="function"&&g(c.call(E))}}),oP=Vt((X,V)=>{V.exports=function(){var c=Math.sign;return typeof c!="function"?!1:c(10)===1&&c(-20)===-1}}),sP=Vt((X,V)=>{V.exports=function(c){return c=Number(c),isNaN(c)||c===0?c:c>0?1:-1}}),lP=Vt((X,V)=>{V.exports=oP()()?Math.sign:sP()}),uP=Vt((X,V)=>{var c=lP(),g=Math.abs,E=Math.floor;V.exports=function(A){return isNaN(A)?0:(A=Number(A),A===0||!isFinite(A)?A:c(A)*E(g(A)))}}),cP=Vt((X,V)=>{var c=uP(),g=Math.max;V.exports=function(E){return g(0,c(E))}}),hP=Vt((X,V)=>{var c=Gd().iterator,g=Pv(),E=iP(),A=cP(),t=Xg(),e=Zp(),r=Hd(),i=Iv(),n=Array.isArray,o=Function.prototype.call,a={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;V.exports=function(h){var v=arguments[1],m=arguments[2],p,y,l,x,b,S,T,M,w,u;if(h=Object(e(h)),r(v)&&t(v),!this||this===Array||!E(this)){if(!v){if(g(h))return b=h.length,b!==1?Array.apply(null,h):(x=new Array(1),x[0]=h[0],x);if(n(h)){for(x=new Array(b=h.length),y=0;y<b;++y)x[y]=h[y];return x}}x=[]}else p=this;if(!n(h)){if((w=h[c])!==void 0){for(T=t(w).call(h),p&&(x=new p),M=T.next(),y=0;!M.done;)u=v?o.call(v,m,M.value,y):M.value,p?(a.value=u,s(x,y,a)):x[y]=u,M=T.next(),++y;b=y}else if(i(h)){for(b=h.length,p&&(x=new p),y=0,l=0;y<b;++y)u=h[y],y+1<b&&(S=u.charCodeAt(0),S>=55296&&S<=56319&&(u+=h[++y])),u=v?o.call(v,m,u,l):u,p?(a.value=u,s(x,l,a)):x[l]=u,++l;b=l}}if(b===void 0)for(b=A(h.length),p&&(x=new p(b)),y=0;y<b;++y)u=v?o.call(v,m,h[y],y):h[y],p?(a.value=u,s(x,y,a)):x[y]=u;return p&&(a.value=null,x.length=b),x}}),fP=Vt((X,V)=>{V.exports=aP()()?Array.from:hP()}),pP=Vt((X,V)=>{var c=fP(),g=jx(),E=Zp();V.exports=function(A){var t=Object(E(A)),e=arguments[1],r=Object(arguments[2]);if(t!==A&&!e)return t;var i={};return e?c(e,function(n){(r.ensure||n in A)&&(i[n]=A[n])}):g(i,A),i}}),dP=Vt((X,V)=>{var c=Xg(),g=Zp(),E=Function.prototype.bind,A=Function.prototype.call,t=Object.keys,e=Object.prototype.propertyIsEnumerable;V.exports=function(r,i){return function(n,o){var a,s=arguments[2],h=arguments[3];return n=Object(g(n)),c(o),a=t(n),h&&a.sort(typeof h=="function"?E.call(h,n):void 0),typeof r!="function"&&(r=a[r]),A.call(r,a,function(v,m){return e.call(n,v)?A.call(o,s,n[v],v,n,m):i})}}}),gP=Vt((X,V)=>{V.exports=dP()("forEach")}),mP=Vt((X,V)=>{var c=Xg(),g=gP(),E=Function.prototype.call;V.exports=function(A,t){var e={},r=arguments[2];return c(t),g(A,function(i,n,o,a){e[n]=E.call(t,r,i,n,o,a)}),e}}),vP=Vt((X,V)=>{var c=C0(),g=rP(),E=nP(),A=pP(),t=N3(),e=mP(),r=Function.prototype.bind,i=Object.defineProperty,n=Object.prototype.hasOwnProperty,o;o=function(a,s,h){var v=g(s)&&E(s.value),m;return m=A(s),delete m.writable,delete m.value,m.get=function(){return!h.overwriteDefinition&&n.call(this,a)?v:(s.value=r.call(v,h.resolveContext?h.resolveContext(this):this),i(this,a,s),this[a])},m},V.exports=function(a){var s=t(arguments[1]);return c(s.resolveContext)&&E(s.resolveContext),e(a,function(h,v){return o(v,h,s)})}}),H3=Vt((X,V)=>{var c=Y8(),g=jx(),E=Xg(),A=Zp(),t=Xp(),e=vP(),r=Gd(),i=Object.defineProperty,n=Object.defineProperties,o;V.exports=o=function(a,s){if(!(this instanceof o))throw new TypeError("Constructor requires 'new'");n(this,{__list__:t("w",A(a)),__context__:t("w",s),__nextIndex__:t("w",0)}),s&&(E(s.on),s.on("_add",this._onAdd),s.on("_delete",this._onDelete),s.on("_clear",this._onClear))},delete o.prototype.constructor,n(o.prototype,g({_next:t(function(){var a;if(this.__list__){if(this.__redo__&&(a=this.__redo__.shift(),a!==void 0))return a;if(this.__nextIndex__<this.__list__.length)return this.__nextIndex__++;this._unBind()}}),next:t(function(){return this._createResult(this._next())}),_createResult:t(function(a){return a===void 0?{done:!0,value:void 0}:{done:!1,value:this._resolve(a)}}),_resolve:t(function(a){return this.__list__[a]}),_unBind:t(function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)}),toString:t(function(){return"[object "+(this[r.toStringTag]||"Object")+"]"})},e({_onAdd:t(function(a){if(!(a>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){i(this,"__redo__",t("c",[a]));return}this.__redo__.forEach(function(s,h){s>=a&&(this.__redo__[h]=++s)},this),this.__redo__.push(a)}}),_onDelete:t(function(a){var s;a>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(a),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(h,v){h>a&&(this.__redo__[v]=--h)},this)))}),_onClear:t(function(){this.__redo__&&c.call(this.__redo__),this.__nextIndex__=0})}))),i(o.prototype,r.iterator,t(function(){return this}))}),yP=Vt((X,V)=>{var c=Bx(),g=U3(),E=Xp(),A=Gd(),t=H3(),e=Object.defineProperty,r;r=V.exports=function(i,n){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");t.call(this,i),n?g.call(n,"key+value")?n="key+value":g.call(n,"key")?n="key":n="value":n="value",e(this,"__kind__",E("",n))},c&&c(r,t),delete r.prototype.constructor,r.prototype=Object.create(t.prototype,{_resolve:E(function(i){return this.__kind__==="value"?this.__list__[i]:this.__kind__==="key+value"?[i,this.__list__[i]]:i})}),e(r.prototype,A.toStringTag,E("c","Array Iterator"))}),xP=Vt((X,V)=>{var c=Bx(),g=Xp(),E=Gd(),A=H3(),t=Object.defineProperty,e;e=V.exports=function(r){if(!(this instanceof e))throw new TypeError("Constructor requires 'new'");r=String(r),A.call(this,r),t(this,"__length__",g("",r.length))},c&&c(e,A),delete e.prototype.constructor,e.prototype=Object.create(A.prototype,{_next:g(function(){if(this.__list__){if(this.__nextIndex__<this.__length__)return this.__nextIndex__++;this._unBind()}}),_resolve:g(function(r){var i=this.__list__[r],n;return this.__nextIndex__===this.__length__?i:(n=i.charCodeAt(0),n>=55296&&n<=56319?i+this.__list__[this.__nextIndex__++]:i)})}),t(e.prototype,E.toStringTag,g("c","String Iterator"))}),_P=Vt((X,V)=>{var c=Pv(),g=Hd(),E=Iv(),A=Gd().iterator,t=Array.isArray;V.exports=function(e){return g(e)?t(e)||E(e)||c(e)?!0:typeof e[A]=="function":!1}}),bP=Vt((X,V)=>{var c=_P();V.exports=function(g){if(!c(g))throw new TypeError(g+" is not iterable");return g}}),G3=Vt((X,V)=>{var c=Pv(),g=Iv(),E=yP(),A=xP(),t=bP(),e=Gd().iterator;V.exports=function(r){return typeof t(r)[e]=="function"?r[e]():c(r)?new E(r):g(r)?new A(r):new E(r)}}),wP=Vt((X,V)=>{var c=Pv(),g=Xg(),E=Iv(),A=G3(),t=Array.isArray,e=Function.prototype.call,r=Array.prototype.some;V.exports=function(i,n){var o,a=arguments[2],s,h,v,m,p,y,l;if(t(i)||c(i)?o="array":E(i)?o="string":i=A(i),g(n),h=function(){v=!0},o==="array"){r.call(i,function(x){return e.call(n,a,x,h),v});return}if(o==="string"){for(p=i.length,m=0;m<p&&(y=i[m],m+1<p&&(l=y.charCodeAt(0),l>=55296&&l<=56319&&(y+=i[++m])),e.call(n,a,y,h),!v);++m);return}for(s=i.next();!s.done;){if(e.call(n,a,s.value,h),v)return;s=i.next()}}}),TP=Vt((X,V)=>{V.exports=function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"}()}),kP=Vt((X,V)=>{var c=Hd(),g=Bx(),E=D8(),A=Zp(),t=z8(),e=Xp(),r=G3(),i=wP(),n=Gd().toStringTag,o=TP(),a=Array.isArray,s=Object.defineProperty,h=Object.prototype.hasOwnProperty,v=Object.getPrototypeOf,m;V.exports=m=function(){var p=arguments[0],y;if(!(this instanceof m))throw new TypeError("Constructor requires 'new'");return y=o&&g&&WeakMap!==m?g(new WeakMap,v(this)):this,c(p)&&(a(p)||(p=r(p))),s(y,"__weakMapData__",e("c","$weakMap$"+t())),p&&i(p,function(l){A(l),y.set(l[0],l[1])}),y},o&&(g&&g(m,WeakMap),m.prototype=Object.create(WeakMap.prototype,{constructor:e(m)})),Object.defineProperties(m.prototype,{delete:e(function(p){return h.call(E(p),this.__weakMapData__)?(delete p[this.__weakMapData__],!0):!1}),get:e(function(p){if(h.call(E(p),this.__weakMapData__))return p[this.__weakMapData__]}),has:e(function(p){return h.call(E(p),this.__weakMapData__)}),set:e(function(p,y){return s(E(p),this.__weakMapData__,e("c",y)),this}),toString:e(function(){return"[object WeakMap]"})}),s(m.prototype,n,e("c","WeakMap"))}),W3=Vt((X,V)=>{V.exports=I8()()?WeakMap:kP()}),AP=Vt((X,V)=>{V.exports=function(c,g,E){if(typeof Array.prototype.findIndex=="function")return c.findIndex(g,E);if(typeof g!="function")throw new TypeError("predicate must be a function");var A=Object(c),t=A.length;if(t===0)return-1;for(var e=0;e<t;e++)if(g.call(E,A[e],e,A))return e;return-1}}),Z3=Vt((X,V)=>{var c=jd(),g=P0(),E=Gc(),A=kp(),t=I0(),e=E8(),r=P8(),{float32:i,fract32:n}=Fx(),o=W3(),a=Zg(),s=AP(),h=`
|
||
precision highp float;
|
||
|
||
attribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;
|
||
attribute vec4 color;
|
||
attribute float lineEnd, lineTop;
|
||
|
||
uniform vec2 scale, scaleFract, translate, translateFract;
|
||
uniform float thickness, pixelRatio, id, depth;
|
||
uniform vec4 viewport;
|
||
|
||
varying vec4 fragColor;
|
||
varying vec2 tangent;
|
||
|
||
vec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {
|
||
// the order is important
|
||
return position * scale + translate
|
||
+ positionFract * scale + translateFract
|
||
+ position * scaleFract
|
||
+ positionFract * scaleFract;
|
||
}
|
||
|
||
void main() {
|
||
float lineStart = 1. - lineEnd;
|
||
float lineOffset = lineTop * 2. - 1.;
|
||
|
||
vec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);
|
||
tangent = normalize(diff * scale * viewport.zw);
|
||
vec2 normal = vec2(-tangent.y, tangent.x);
|
||
|
||
vec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart
|
||
+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd
|
||
|
||
+ thickness * normal * .5 * lineOffset / viewport.zw;
|
||
|
||
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
|
||
|
||
fragColor = color / 255.;
|
||
}
|
||
`,v=`
|
||
precision highp float;
|
||
|
||
uniform float dashLength, pixelRatio, thickness, opacity, id;
|
||
uniform sampler2D dashTexture;
|
||
|
||
varying vec4 fragColor;
|
||
varying vec2 tangent;
|
||
|
||
void main() {
|
||
float alpha = 1.;
|
||
|
||
float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;
|
||
float dash = texture2D(dashTexture, vec2(t, .5)).r;
|
||
|
||
gl_FragColor = fragColor;
|
||
gl_FragColor.a *= alpha * opacity * dash;
|
||
}
|
||
`,m=`
|
||
precision highp float;
|
||
|
||
attribute vec2 position, positionFract;
|
||
|
||
uniform vec4 color;
|
||
uniform vec2 scale, scaleFract, translate, translateFract;
|
||
uniform float pixelRatio, id;
|
||
uniform vec4 viewport;
|
||
uniform float opacity;
|
||
|
||
varying vec4 fragColor;
|
||
|
||
const float MAX_LINES = 256.;
|
||
|
||
void main() {
|
||
float depth = (MAX_LINES - 4. - id) / (MAX_LINES);
|
||
|
||
vec2 position = position * scale + translate
|
||
+ positionFract * scale + translateFract
|
||
+ position * scaleFract
|
||
+ positionFract * scaleFract;
|
||
|
||
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
|
||
|
||
fragColor = color / 255.;
|
||
fragColor.a *= opacity;
|
||
}
|
||
`,p=`
|
||
precision highp float;
|
||
varying vec4 fragColor;
|
||
|
||
void main() {
|
||
gl_FragColor = fragColor;
|
||
}
|
||
`,y=`
|
||
precision highp float;
|
||
|
||
attribute vec2 aCoord, bCoord, nextCoord, prevCoord;
|
||
attribute vec4 aColor, bColor;
|
||
attribute float lineEnd, lineTop;
|
||
|
||
uniform vec2 scale, translate;
|
||
uniform float thickness, pixelRatio, id, depth;
|
||
uniform vec4 viewport;
|
||
uniform float miterLimit, miterMode;
|
||
|
||
varying vec4 fragColor;
|
||
varying vec4 startCutoff, endCutoff;
|
||
varying vec2 tangent;
|
||
varying vec2 startCoord, endCoord;
|
||
varying float enableStartMiter, enableEndMiter;
|
||
|
||
const float REVERSE_THRESHOLD = -.875;
|
||
const float MIN_DIFF = 1e-6;
|
||
|
||
// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead
|
||
// TODO: precalculate dot products, normalize things beforehead etc.
|
||
// TODO: refactor to rectangular algorithm
|
||
|
||
float distToLine(vec2 p, vec2 a, vec2 b) {
|
||
vec2 diff = b - a;
|
||
vec2 perp = normalize(vec2(-diff.y, diff.x));
|
||
return dot(p - a, perp);
|
||
}
|
||
|
||
bool isNaN( float val ){
|
||
return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;
|
||
}
|
||
|
||
void main() {
|
||
vec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;
|
||
|
||
vec2 adjustedScale;
|
||
adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;
|
||
adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;
|
||
|
||
vec2 scaleRatio = adjustedScale * viewport.zw;
|
||
vec2 normalWidth = thickness / scaleRatio;
|
||
|
||
float lineStart = 1. - lineEnd;
|
||
float lineBot = 1. - lineTop;
|
||
|
||
fragColor = (lineStart * aColor + lineEnd * bColor) / 255.;
|
||
|
||
if (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;
|
||
|
||
if (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);
|
||
if (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);
|
||
|
||
|
||
vec2 prevDiff = aCoord - prevCoord;
|
||
vec2 currDiff = bCoord - aCoord;
|
||
vec2 nextDiff = nextCoord - bCoord;
|
||
|
||
vec2 prevTangent = normalize(prevDiff * scaleRatio);
|
||
vec2 currTangent = normalize(currDiff * scaleRatio);
|
||
vec2 nextTangent = normalize(nextDiff * scaleRatio);
|
||
|
||
vec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);
|
||
vec2 currNormal = vec2(-currTangent.y, currTangent.x);
|
||
vec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);
|
||
|
||
vec2 startJoinDirection = normalize(prevTangent - currTangent);
|
||
vec2 endJoinDirection = normalize(currTangent - nextTangent);
|
||
|
||
// collapsed/unidirectional segment cases
|
||
// FIXME: there should be more elegant solution
|
||
vec2 prevTanDiff = abs(prevTangent - currTangent);
|
||
vec2 nextTanDiff = abs(nextTangent - currTangent);
|
||
if (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {
|
||
startJoinDirection = currNormal;
|
||
}
|
||
if (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {
|
||
endJoinDirection = currNormal;
|
||
}
|
||
if (aCoord == bCoord) {
|
||
endJoinDirection = startJoinDirection;
|
||
currNormal = prevNormal;
|
||
currTangent = prevTangent;
|
||
}
|
||
|
||
tangent = currTangent;
|
||
|
||
//calculate join shifts relative to normals
|
||
float startJoinShift = dot(currNormal, startJoinDirection);
|
||
float endJoinShift = dot(currNormal, endJoinDirection);
|
||
|
||
float startMiterRatio = abs(1. / startJoinShift);
|
||
float endMiterRatio = abs(1. / endJoinShift);
|
||
|
||
vec2 startJoin = startJoinDirection * startMiterRatio;
|
||
vec2 endJoin = endJoinDirection * endMiterRatio;
|
||
|
||
vec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;
|
||
startTopJoin = sign(startJoinShift) * startJoin * .5;
|
||
startBotJoin = -startTopJoin;
|
||
|
||
endTopJoin = sign(endJoinShift) * endJoin * .5;
|
||
endBotJoin = -endTopJoin;
|
||
|
||
vec2 aTopCoord = aCoord + normalWidth * startTopJoin;
|
||
vec2 bTopCoord = bCoord + normalWidth * endTopJoin;
|
||
vec2 aBotCoord = aCoord + normalWidth * startBotJoin;
|
||
vec2 bBotCoord = bCoord + normalWidth * endBotJoin;
|
||
|
||
//miter anti-clipping
|
||
float baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));
|
||
float abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));
|
||
|
||
//prevent close to reverse direction switch
|
||
bool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);
|
||
bool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);
|
||
|
||
if (prevReverse) {
|
||
//make join rectangular
|
||
vec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;
|
||
float normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);
|
||
aBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;
|
||
aTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;
|
||
}
|
||
else if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {
|
||
//handle miter clipping
|
||
bTopCoord -= normalWidth * endTopJoin;
|
||
bTopCoord += normalize(endTopJoin * normalWidth) * baClipping;
|
||
}
|
||
|
||
if (nextReverse) {
|
||
//make join rectangular
|
||
vec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;
|
||
float normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);
|
||
bBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;
|
||
bTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;
|
||
}
|
||
else if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {
|
||
//handle miter clipping
|
||
aBotCoord -= normalWidth * startBotJoin;
|
||
aBotCoord += normalize(startBotJoin * normalWidth) * abClipping;
|
||
}
|
||
|
||
vec2 aTopPosition = (aTopCoord) * adjustedScale + translate;
|
||
vec2 aBotPosition = (aBotCoord) * adjustedScale + translate;
|
||
|
||
vec2 bTopPosition = (bTopCoord) * adjustedScale + translate;
|
||
vec2 bBotPosition = (bBotCoord) * adjustedScale + translate;
|
||
|
||
//position is normalized 0..1 coord on the screen
|
||
vec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;
|
||
|
||
startCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;
|
||
endCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;
|
||
|
||
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
|
||
|
||
enableStartMiter = step(dot(currTangent, prevTangent), .5);
|
||
enableEndMiter = step(dot(currTangent, nextTangent), .5);
|
||
|
||
//bevel miter cutoffs
|
||
if (miterMode == 1.) {
|
||
if (enableStartMiter == 1.) {
|
||
vec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;
|
||
startCutoff = vec4(aCoord, aCoord);
|
||
startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;
|
||
startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;
|
||
startCutoff += viewport.xyxy;
|
||
startCutoff += startMiterWidth.xyxy;
|
||
}
|
||
|
||
if (enableEndMiter == 1.) {
|
||
vec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;
|
||
endCutoff = vec4(bCoord, bCoord);
|
||
endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;
|
||
endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;
|
||
endCutoff += viewport.xyxy;
|
||
endCutoff += endMiterWidth.xyxy;
|
||
}
|
||
}
|
||
|
||
//round miter cutoffs
|
||
else if (miterMode == 2.) {
|
||
if (enableStartMiter == 1.) {
|
||
vec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;
|
||
startCutoff = vec4(aCoord, aCoord);
|
||
startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;
|
||
startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;
|
||
startCutoff += viewport.xyxy;
|
||
startCutoff += startMiterWidth.xyxy;
|
||
}
|
||
|
||
if (enableEndMiter == 1.) {
|
||
vec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;
|
||
endCutoff = vec4(bCoord, bCoord);
|
||
endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;
|
||
endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;
|
||
endCutoff += viewport.xyxy;
|
||
endCutoff += endMiterWidth.xyxy;
|
||
}
|
||
}
|
||
}
|
||
`,l=`
|
||
precision highp float;
|
||
|
||
uniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;
|
||
uniform sampler2D dashTexture;
|
||
|
||
varying vec4 fragColor;
|
||
varying vec2 tangent;
|
||
varying vec4 startCutoff, endCutoff;
|
||
varying vec2 startCoord, endCoord;
|
||
varying float enableStartMiter, enableEndMiter;
|
||
|
||
float distToLine(vec2 p, vec2 a, vec2 b) {
|
||
vec2 diff = b - a;
|
||
vec2 perp = normalize(vec2(-diff.y, diff.x));
|
||
return dot(p - a, perp);
|
||
}
|
||
|
||
void main() {
|
||
float alpha = 1., distToStart, distToEnd;
|
||
float cutoff = thickness * .5;
|
||
|
||
//bevel miter
|
||
if (miterMode == 1.) {
|
||
if (enableStartMiter == 1.) {
|
||
distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);
|
||
if (distToStart < -1.) {
|
||
discard;
|
||
return;
|
||
}
|
||
alpha *= min(max(distToStart + 1., 0.), 1.);
|
||
}
|
||
|
||
if (enableEndMiter == 1.) {
|
||
distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);
|
||
if (distToEnd < -1.) {
|
||
discard;
|
||
return;
|
||
}
|
||
alpha *= min(max(distToEnd + 1., 0.), 1.);
|
||
}
|
||
}
|
||
|
||
// round miter
|
||
else if (miterMode == 2.) {
|
||
if (enableStartMiter == 1.) {
|
||
distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);
|
||
if (distToStart < 0.) {
|
||
float radius = length(gl_FragCoord.xy - startCoord);
|
||
|
||
if(radius > cutoff + .5) {
|
||
discard;
|
||
return;
|
||
}
|
||
|
||
alpha -= smoothstep(cutoff - .5, cutoff + .5, radius);
|
||
}
|
||
}
|
||
|
||
if (enableEndMiter == 1.) {
|
||
distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);
|
||
if (distToEnd < 0.) {
|
||
float radius = length(gl_FragCoord.xy - endCoord);
|
||
|
||
if(radius > cutoff + .5) {
|
||
discard;
|
||
return;
|
||
}
|
||
|
||
alpha -= smoothstep(cutoff - .5, cutoff + .5, radius);
|
||
}
|
||
}
|
||
}
|
||
|
||
float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;
|
||
float dash = texture2D(dashTexture, vec2(t, .5)).r;
|
||
|
||
gl_FragColor = fragColor;
|
||
gl_FragColor.a *= alpha * opacity * dash;
|
||
}
|
||
`;V.exports=x;function x(b,S){if(!(this instanceof x))return new x(b,S);if(typeof b=="function"?(S||(S={}),S.regl=b):S=b,S.length&&(S.positions=S),b=S.regl,!b.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=b._gl,this.regl=b,this.passes=[],this.shaders=x.shaders.has(b)?x.shaders.get(b):x.shaders.set(b,x.createShaders(b)).get(b),this.update(S)}x.dashMult=2,x.maxPatternLength=256,x.precisionThreshold=3e6,x.maxPoints=1e4,x.maxLines=2048,x.shaders=new o,x.createShaders=function(b){let S=b.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),T={primitive:"triangle strip",instances:b.prop("count"),count:4,offset:0,uniforms:{miterMode:(u,f)=>f.join==="round"?2:1,miterLimit:b.prop("miterLimit"),scale:b.prop("scale"),scaleFract:b.prop("scaleFract"),translateFract:b.prop("translateFract"),translate:b.prop("translate"),thickness:b.prop("thickness"),dashTexture:b.prop("dashTexture"),opacity:b.prop("opacity"),pixelRatio:b.context("pixelRatio"),id:b.prop("id"),dashLength:b.prop("dashLength"),viewport:(u,f)=>[f.viewport.x,f.viewport.y,u.viewportWidth,u.viewportHeight],depth:b.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(u,f)=>!f.overlay},stencil:{enable:!1},scissor:{enable:!0,box:b.prop("viewport")},viewport:b.prop("viewport")},M=b(E({vert:h,frag:v,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:b.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},T)),w;try{w=b(E({cull:{enable:!0,face:"back"},vert:y,frag:l,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aColor:{buffer:b.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:b.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},T))}catch{w=M}return{fill:b({primitive:"triangle",elements:(u,f)=>f.triangles,offset:0,vert:m,frag:p,uniforms:{scale:b.prop("scale"),color:b.prop("fill"),scaleFract:b.prop("scaleFract"),translateFract:b.prop("translateFract"),translate:b.prop("translate"),opacity:b.prop("opacity"),pixelRatio:b.context("pixelRatio"),id:b.prop("id"),viewport:(u,f)=>[f.viewport.x,f.viewport.y,u.viewportWidth,u.viewportHeight]},attributes:{position:{buffer:b.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:8}},blend:T.blend,depth:{enable:!1},scissor:T.scissor,stencil:T.stencil,viewport:T.viewport}),rect:M,miter:w}},x.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},x.prototype.render=function(...b){b.length&&this.update(...b),this.draw()},x.prototype.draw=function(...b){return(b.length?b:this.passes).forEach((S,T)=>{if(S&&Array.isArray(S))return this.draw(...S);typeof S=="number"&&(S=this.passes[S]),S&&S.count>1&&S.opacity&&(this.regl._refresh(),S.fill&&S.triangles&&S.triangles.length>2&&this.shaders.fill(S),S.thickness&&(S.scale[0]*S.viewport.width>x.precisionThreshold||S.scale[1]*S.viewport.height>x.precisionThreshold?this.shaders.rect(S):S.join==="rect"||!S.join&&(S.thickness<=2||S.count>=x.maxPoints)?this.shaders.rect(S):this.shaders.miter(S)))}),this},x.prototype.update=function(b){if(!b)return;b.length!=null?typeof b[0]=="number"&&(b=[{positions:b}]):Array.isArray(b)||(b=[b]);let{regl:S,gl:T}=this;if(b.forEach((w,u)=>{let f=this.passes[u];if(w!==void 0){if(w===null){this.passes[u]=null;return}if(typeof w[0]=="number"&&(w={positions:w}),w=A(w,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),f||(this.passes[u]=f={id:u,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:S.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:S.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},w=E({},x.defaults,w)),w.thickness!=null&&(f.thickness=parseFloat(w.thickness)),w.opacity!=null&&(f.opacity=parseFloat(w.opacity)),w.miterLimit!=null&&(f.miterLimit=parseFloat(w.miterLimit)),w.overlay!=null&&(f.overlay=!!w.overlay,u<x.maxLines&&(f.depth=2*(x.maxLines-1-u%x.maxLines)/x.maxLines-1)),w.join!=null&&(f.join=w.join),w.hole!=null&&(f.hole=w.hole),w.fill!=null&&(f.fill=w.fill?c(w.fill,"uint8"):null),w.viewport!=null&&(f.viewport=a(w.viewport)),f.viewport||(f.viewport=a([T.drawingBufferWidth,T.drawingBufferHeight])),w.close!=null&&(f.close=w.close),w.positions===null&&(w.positions=[]),w.positions){let D,I;if(w.positions.x&&w.positions.y){let L=w.positions.x,F=w.positions.y;I=f.count=Math.max(L.length,F.length),D=new Float64Array(I*2);for(let N=0;N<I;N++)D[N*2]=L[N],D[N*2+1]=F[N]}else D=t(w.positions,"float64"),I=f.count=Math.floor(D.length/2);let O=f.bounds=g(D,2);if(f.fill){let L=[],F={},N=0;for(let j=0,G=0,rt=f.count;j<rt;j++){let ct=D[j*2],lt=D[j*2+1];isNaN(ct)||isNaN(lt)||ct==null||lt==null?(ct=D[N*2],lt=D[N*2+1],F[j]=N):N=j,L[G++]=ct,L[G++]=lt}if(w.splitNull){f.count-1 in F||(F[f.count]=f.count-1);let j=Object.keys(F).map(Number).sort((lt,tt)=>lt-tt),G=[],rt=0,ct=f.hole!=null?f.hole[0]:null;if(ct!=null){let lt=s(j,tt=>tt>=ct);j=j.slice(0,lt),j.push(ct)}for(let lt=0;lt<j.length;lt++){let tt=L.slice(rt*2,j[lt]*2).concat(ct?L.slice(ct*2):[]),Z=(f.hole||[]).map($=>$-ct+(j[lt]-rt)),st=e(tt,Z);st=st.map($=>$+rt+($+rt<j[lt]?0:ct-j[lt])),G.push(...st),rt=j[lt]+1}for(let lt=0,tt=G.length;lt<tt;lt++)F[G[lt]]!=null&&(G[lt]=F[G[lt]]);f.triangles=G}else{let j=e(L,f.hole||[]);for(let G=0,rt=j.length;G<rt;G++)F[j[G]]!=null&&(j[G]=F[j[G]]);f.triangles=j}}let B=new Float64Array(D);r(B,2,O);let R=new Float64Array(I*2+6);f.close?D[0]===D[I*2-2]&&D[1]===D[I*2-1]?(R[0]=B[I*2-4],R[1]=B[I*2-3]):(R[0]=B[I*2-2],R[1]=B[I*2-1]):(R[0]=B[0],R[1]=B[1]),R.set(B,2),f.close?D[0]===D[I*2-2]&&D[1]===D[I*2-1]?(R[I*2+2]=B[2],R[I*2+3]=B[3],f.count-=1):(R[I*2+2]=B[0],R[I*2+3]=B[1],R[I*2+4]=B[2],R[I*2+5]=B[3]):(R[I*2+2]=B[I*2-2],R[I*2+3]=B[I*2-1],R[I*2+4]=B[I*2-2],R[I*2+5]=B[I*2-1]);var k=i(R);f.positionBuffer(k);var _=n(R,k);f.positionFractBuffer(_)}if(w.range?f.range=w.range:f.range||(f.range=f.bounds),(w.range||w.positions)&&f.count){let D=f.bounds,I=D[2]-D[0],O=D[3]-D[1],B=f.range[2]-f.range[0],R=f.range[3]-f.range[1];f.scale=[I/B,O/R],f.translate=[-f.range[0]/B+D[0]/B||0,-f.range[1]/R+D[1]/R||0],f.scaleFract=n(f.scale),f.translateFract=n(f.translate)}if(w.dashes){let D=0,I;if(!w.dashes||w.dashes.length<2)D=1,I=new Uint8Array([255,255,255,255,255,255,255,255]);else{D=0;for(let R=0;R<w.dashes.length;++R)D+=w.dashes[R];I=new Uint8Array(D*x.dashMult);let O=0,B=255;for(let R=0;R<2;R++)for(let L=0;L<w.dashes.length;++L){for(let F=0,N=w.dashes[L]*x.dashMult*.5;F<N;++F)I[O++]=B;B^=255}}f.dashLength=D,f.dashTexture({channels:1,data:I,width:I.length,height:1,mag:"linear",min:"linear"},0,0)}if(w.color){let D=f.count,I=w.color;I||(I="transparent");let O=new Uint8Array(D*4+4);if(!Array.isArray(I)||typeof I[0]=="number"){let B=c(I,"uint8");for(let R=0;R<D+1;R++)O.set(B,R*4)}else{for(let B=0;B<D;B++){let R=c(I[B],"uint8");O.set(R,B*4)}O.set(c(I[0],"uint8"),D*4)}f.colorBuffer({usage:"dynamic",type:"uint8",data:O})}}}),b.length<this.passes.length){for(let w=b.length;w<this.passes.length;w++){let u=this.passes[w];u&&(u.colorBuffer.destroy(),u.positionBuffer.destroy(),u.dashTexture.destroy())}this.passes.length=b.length}let M=[];for(let w=0;w<this.passes.length;w++)this.passes[w]!==null&&M.push(this.passes[w]);return this.passes=M,this},x.prototype.destroy=function(){return this.passes.forEach(b=>{b.colorBuffer.destroy(),b.positionBuffer.destroy(),b.dashTexture.destroy()}),this.passes.length=0,this}}),MP=Vt((X,V)=>{var c=P0(),g=jd(),E=z3(),A=kp(),t=Gc(),e=I0(),{float32:r,fract32:i}=Fx();V.exports=o;var n=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function o(a,s){if(typeof a=="function"?(s||(s={}),s.regl=a):s=a,s.length&&(s.positions=s),a=s.regl,!a.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let h=a._gl,v,m,p,y,l,x,b={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},S=[];return y=a.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),m=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),l=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),x=a.buffer({usage:"static",type:"float",data:n}),u(s),v=a({vert:`
|
||
precision highp float;
|
||
|
||
attribute vec2 position, positionFract;
|
||
attribute vec4 error;
|
||
attribute vec4 color;
|
||
|
||
attribute vec2 direction, lineOffset, capOffset;
|
||
|
||
uniform vec4 viewport;
|
||
uniform float lineWidth, capSize;
|
||
uniform vec2 scale, scaleFract, translate, translateFract;
|
||
|
||
varying vec4 fragColor;
|
||
|
||
void main() {
|
||
fragColor = color / 255.;
|
||
|
||
vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;
|
||
|
||
vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;
|
||
|
||
vec2 position = position + dxy;
|
||
|
||
vec2 pos = (position + translate) * scale
|
||
+ (positionFract + translateFract) * scale
|
||
+ (position + translate) * scaleFract
|
||
+ (positionFract + translateFract) * scaleFract;
|
||
|
||
pos += pixelOffset / viewport.zw;
|
||
|
||
gl_Position = vec4(pos * 2. - 1., 0, 1);
|
||
}
|
||
`,frag:`
|
||
precision highp float;
|
||
|
||
varying vec4 fragColor;
|
||
|
||
uniform float opacity;
|
||
|
||
void main() {
|
||
gl_FragColor = fragColor;
|
||
gl_FragColor.a *= opacity;
|
||
}
|
||
`,uniforms:{range:a.prop("range"),lineWidth:a.prop("lineWidth"),capSize:a.prop("capSize"),opacity:a.prop("opacity"),scale:a.prop("scale"),translate:a.prop("translate"),scaleFract:a.prop("scaleFract"),translateFract:a.prop("translateFract"),viewport:(k,_)=>[_.viewport.x,_.viewport.y,k.viewportWidth,k.viewportHeight]},attributes:{color:{buffer:y,offset:(k,_)=>_.offset*4,divisor:1},position:{buffer:m,offset:(k,_)=>_.offset*8,divisor:1},positionFract:{buffer:p,offset:(k,_)=>_.offset*8,divisor:1},error:{buffer:l,offset:(k,_)=>_.offset*16,divisor:1},direction:{buffer:x,stride:24,offset:0},lineOffset:{buffer:x,stride:24,offset:8},capOffset:{buffer:x,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:a.prop("viewport")},viewport:a.prop("viewport"),stencil:!1,instances:a.prop("count"),count:n.length}),t(T,{update:u,draw:M,destroy:f,regl:a,gl:h,canvas:h.canvas,groups:S}),T;function T(k){k?u(k):k===null&&f(),M()}function M(k){if(typeof k=="number")return w(k);k&&!Array.isArray(k)&&(k=[k]),a._refresh(),S.forEach((_,D)=>{if(_){if(k&&(k[D]?_.draw=!0:_.draw=!1),!_.draw){_.draw=!0;return}w(D)}})}function w(k){typeof k=="number"&&(k=S[k]),k!=null&&k&&k.count&&k.color&&k.opacity&&k.positions&&k.positions.length>1&&(k.scaleRatio=[k.scale[0]*k.viewport.width,k.scale[1]*k.viewport.height],v(k),k.after&&k.after(k))}function u(k){if(!k)return;k.length!=null?typeof k[0]=="number"&&(k=[{positions:k}]):Array.isArray(k)||(k=[k]);let _=0,D=0;if(T.groups=S=k.map((B,R)=>{let L=S[R];if(B)typeof B=="function"?B={after:B}:typeof B[0]=="number"&&(B={positions:B});else return L;return B=A(B,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),L||(S[R]=L={id:R,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},B=t({},b,B)),E(L,B,[{lineWidth:F=>+F*.5,capSize:F=>+F*.5,opacity:parseFloat,errors:F=>(F=e(F),D+=F.length,F),positions:(F,N)=>(F=e(F,"float64"),N.count=Math.floor(F.length/2),N.bounds=c(F,2),N.offset=_,_+=N.count,F)},{color:(F,N)=>{let j=N.count;if(F||(F="transparent"),!Array.isArray(F)||typeof F[0]=="number"){let rt=F;F=Array(j);for(let ct=0;ct<j;ct++)F[ct]=rt}if(F.length<j)throw Error("Not enough colors");let G=new Uint8Array(j*4);for(let rt=0;rt<j;rt++){let ct=g(F[rt],"uint8");G.set(ct,rt*4)}return G},range:(F,N,j)=>{let G=N.bounds;return F||(F=G),N.scale=[1/(F[2]-F[0]),1/(F[3]-F[1])],N.translate=[-F[0],-F[1]],N.scaleFract=i(N.scale),N.translateFract=i(N.translate),F},viewport:F=>{let N;return Array.isArray(F)?N={x:F[0],y:F[1],width:F[2]-F[0],height:F[3]-F[1]}:F?(N={x:F.x||F.left||0,y:F.y||F.top||0},F.right?N.width=F.right-N.x:N.width=F.w||F.width||0,F.bottom?N.height=F.bottom-N.y:N.height=F.h||F.height||0):N={x:0,y:0,width:h.drawingBufferWidth,height:h.drawingBufferHeight},N}}]),L}),_||D){let B=S.reduce((N,j,G)=>N+(j?j.count:0),0),R=new Float64Array(B*2),L=new Uint8Array(B*4),F=new Float32Array(B*4);S.forEach((N,j)=>{if(!N)return;let{positions:G,count:rt,offset:ct,color:lt,errors:tt}=N;rt&&(L.set(lt,ct*4),F.set(tt,ct*4),R.set(G,ct*2))});var I=r(R);m(I);var O=i(R,I);p(O),y(L),l(F)}}function f(){m.destroy(),p.destroy(),y.destroy(),l.destroy(),x.destroy()}}}),SP=Vt((X,V)=>{var c=/[\'\"]/;V.exports=function(g){return g?(c.test(g.charAt(0))&&(g=g.substr(1)),c.test(g.charAt(g.length-1))&&(g=g.substr(0,g.length-1)),g):""}}),X3=Vt(()=>{}),$3=Vt(()=>{}),J3=Vt(()=>{}),Q3=Vt(()=>{}),Y3=Vt(()=>{}),EP=Vt((X,V)=>{function c(A,t){if(typeof A!="string")return[A];var e=[A];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var r=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],i=t.escape||"___",n=!!t.flat;r.forEach(function(s){var h=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),v=[];function m(p,y,l){var x=e.push(p.slice(s[0].length,-s[1].length))-1;return v.push(x),i+x+i}e.forEach(function(p,y){for(var l,x=0;p!=l;)if(l=p,p=p.replace(h,m),x++>1e4)throw Error("References have circular dependency. Please, check them.");e[y]=p}),v=v.reverse(),e=e.map(function(p){return v.forEach(function(y){p=p.replace(new RegExp("(\\"+i+y+"\\"+i+")","g"),s[0]+"$1"+s[1])}),p})});var o=new RegExp("\\"+i+"([0-9]+)\\"+i);function a(s,h,v){for(var m=[],p,y=0;p=o.exec(s);){if(y++>1e4)throw Error("Circular references in parenthesis");m.push(s.slice(0,p.index)),m.push(a(h[p[1]],h)),s=s.slice(p.index+p[0].length)}return m.push(s),m}return n?e:a(e[0],e)}function g(A,t){if(t&&t.flat){var e=t&&t.escape||"___",r=A[0],i;if(!r)return"";for(var n=new RegExp("\\"+e+"([0-9]+)\\"+e),o=0;r!=i;){if(o++>1e4)throw Error("Circular references in "+A);i=r,r=r.replace(n,a)}return r}return A.reduce(function s(h,v){return Array.isArray(v)&&(v=v.reduce(s,"")),h+v},"");function a(s,h){if(A[h]==null)throw Error("Reference "+h+"is undefined");return A[h]}}function E(A,t){return Array.isArray(A)?g(A,t):c(A,t)}E.parse=c,E.stringify=g,V.exports=E}),PP=Vt((X,V)=>{var c=EP();V.exports=function(g,E,A){if(g==null)throw Error("First argument should be a string");if(E==null)throw Error("Separator should be a string or a RegExp");A?(typeof A=="string"||Array.isArray(A))&&(A={ignore:A}):A={},A.escape==null&&(A.escape=!0),A.ignore==null?A.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof A.ignore=="string"&&(A.ignore=[A.ignore]),A.ignore=A.ignore.map(function(s){return s.length===1&&(s=s+s),s}));var t=c.parse(g,{flat:!0,brackets:A.ignore}),e=t[0],r=e.split(E);if(A.escape){for(var i=[],n=0;n<r.length;n++){var o=r[n],a=r[n+1];o[o.length-1]==="\\"&&o[o.length-2]!=="\\"?(i.push(o+E+a),n++):i.push(o)}r=i}for(var n=0;n<r.length;n++)t[0]=r[n],r[n]=c.stringify(t,{flat:!0});return r}}),IP=Vt(()=>{}),K3=Vt((X,V)=>{var c=IP();V.exports={isSize:function(g){return/^[\d\.]/.test(g)||g.indexOf("/")!==-1||c.indexOf(g)!==-1}}}),LP=Vt((X,V)=>{var c=SP(),g=X3(),E=$3(),A=J3(),t=Q3(),e=Y3(),r=PP(),i=K3().isSize;V.exports=o;var n=o.cache={};function o(s){if(typeof s!="string")throw new Error("Font argument must be a string.");if(n[s])return n[s];if(s==="")throw new Error("Cannot parse an empty string.");if(E.indexOf(s)!==-1)return n[s]={system:s};for(var h={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},v=r(s,/\s+/),m;m=v.shift();){if(g.indexOf(m)!==-1)return["style","variant","weight","stretch"].forEach(function(y){h[y]=m}),n[s]=h;if(t.indexOf(m)!==-1){h.style=m;continue}if(m==="normal"||m==="small-caps"){h.variant=m;continue}if(e.indexOf(m)!==-1){h.stretch=m;continue}if(A.indexOf(m)!==-1){h.weight=m;continue}if(i(m)){var p=r(m,"/");if(h.size=p[0],p[1]!=null?h.lineHeight=a(p[1]):v[0]==="/"&&(v.shift(),h.lineHeight=a(v.shift())),!v.length)throw new Error("Missing required font-family.");return h.family=r(v.join(" "),/\s*,\s*/).map(c),n[s]=h}throw new Error("Unknown or unsupported font token: "+m)}throw new Error("Missing required font-size.")}function a(s){var h=parseFloat(s);return h.toString()===s?h:s}}),t5=Vt((X,V)=>{var c=kp(),g=K3().isSize,E=s(X3()),A=s($3()),t=s(J3()),e=s(Q3()),r=s(Y3()),i={normal:1,"small-caps":1},n={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},o={style:"normal",variant:"normal",weight:"normal",stretch:"normal",size:"1rem",lineHeight:"normal",family:"serif"};V.exports=function(h){if(h=c(h,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"}),h.system)return h.system&&a(h.system,A),h.system;if(a(h.style,e),a(h.variant,i),a(h.weight,t),a(h.stretch,r),h.size==null&&(h.size=o.size),typeof h.size=="number"&&(h.size+="px"),!g)throw Error("Bad size value `"+h.size+"`");h.family||(h.family=o.family),Array.isArray(h.family)&&(h.family.length||(h.family=[o.family]),h.family=h.family.map(function(m){return n[m]?m:'"'+m+'"'}).join(", "));var v=[];return v.push(h.style),h.variant!==h.style&&v.push(h.variant),h.weight!==h.variant&&h.weight!==h.style&&v.push(h.weight),h.stretch!==h.weight&&h.stretch!==h.variant&&h.stretch!==h.style&&v.push(h.stretch),v.push(h.size+(h.lineHeight==null||h.lineHeight==="normal"||h.lineHeight+""=="1"?"":"/"+h.lineHeight)),v.push(h.family),v.filter(Boolean).join(" ")};function a(h,v){if(h&&!v[h]&&!E[h])throw Error("Unknown keyword `"+h+"`");return h}function s(h){for(var v={},m=0;m<h.length;m++)v[h[m]]=1;return v}}),CP=Vt((X,V)=>{V.exports={parse:LP(),stringify:t5()}}),e5=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?V.exports=g():c.createREGL=g()})(X,function(){var c=function(sr,fn){for(var gn=Object.keys(fn),ha=0;ha<gn.length;++ha)sr[gn[ha]]=fn[gn[ha]];return sr},g=0,E=0,A=5,t=6;function e(sr,fn){this.id=g++,this.type=sr,this.data=fn}function r(sr){return sr.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function i(sr){if(sr.length===0)return[];var fn=sr.charAt(0),gn=sr.charAt(sr.length-1);if(sr.length>1&&fn===gn&&(fn==='"'||fn==="'"))return['"'+r(sr.substr(1,sr.length-2))+'"'];var ha=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(sr);if(ha)return i(sr.substr(0,ha.index)).concat(i(ha[1])).concat(i(sr.substr(ha.index+ha[0].length)));var Ta=sr.split(".");if(Ta.length===1)return['"'+r(sr)+'"'];for(var ka=[],Cn=0;Cn<Ta.length;++Cn)ka=ka.concat(i(Ta[Cn]));return ka}function n(sr){return"["+i(sr).join("][")+"]"}function o(sr,fn){return new e(sr,n(fn+""))}function a(sr){return typeof sr=="function"&&!sr._reglType||sr instanceof e}function s(sr,fn){if(typeof sr=="function")return new e(E,sr);if(typeof sr=="number"||typeof sr=="boolean")return new e(A,sr);if(Array.isArray(sr))return new e(t,sr.map(function(gn,ha){return s(gn)}));if(sr instanceof e)return sr}var h={DynamicVariable:e,define:o,isDynamic:a,unbox:s,accessor:n},v={next:typeof requestAnimationFrame=="function"?function(sr){return requestAnimationFrame(sr)}:function(sr){return setTimeout(sr,16)},cancel:typeof cancelAnimationFrame=="function"?function(sr){return cancelAnimationFrame(sr)}:clearTimeout},m=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function p(){var sr={"":0},fn=[""];return{id:function(gn){var ha=sr[gn];return ha||(ha=sr[gn]=fn.length,fn.push(gn),ha)},str:function(gn){return fn[gn]}}}function y(sr,fn,gn){var ha=document.createElement("canvas");c(ha.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),sr.appendChild(ha),sr===document.body&&(ha.style.position="absolute",c(sr.style,{margin:0,padding:0}));function Ta(){var ia=window.innerWidth,qa=window.innerHeight;if(sr!==document.body){var Ra=ha.getBoundingClientRect();ia=Ra.right-Ra.left,qa=Ra.bottom-Ra.top}ha.width=gn*ia,ha.height=gn*qa}var ka;sr!==document.body&&typeof ResizeObserver=="function"?(ka=new ResizeObserver(function(){setTimeout(Ta)}),ka.observe(sr)):window.addEventListener("resize",Ta,!1);function Cn(){ka?ka.disconnect():window.removeEventListener("resize",Ta),sr.removeChild(ha)}return Ta(),{canvas:ha,onDestroy:Cn}}function l(sr,fn){function gn(ha){try{return sr.getContext(ha,fn)}catch{return null}}return gn("webgl")||gn("experimental-webgl")||gn("webgl-experimental")}function x(sr){return typeof sr.nodeName=="string"&&typeof sr.appendChild=="function"&&typeof sr.getBoundingClientRect=="function"}function b(sr){return typeof sr.drawArrays=="function"||typeof sr.drawElements=="function"}function S(sr){return typeof sr=="string"?sr.split():sr}function T(sr){return typeof sr=="string"?document.querySelector(sr):sr}function M(sr){var fn=sr||{},gn,ha,Ta,ka,Cn={},ia=[],qa=[],Ra=typeof window>"u"?1:window.devicePixelRatio,ei=!1,Ii={},wi=function(Wn){},Ha=function(){};if(typeof fn=="string"?gn=document.querySelector(fn):typeof fn=="object"&&(x(fn)?gn=fn:b(fn)?(ka=fn,Ta=ka.canvas):("gl"in fn?ka=fn.gl:"canvas"in fn?Ta=T(fn.canvas):"container"in fn&&(ha=T(fn.container)),"attributes"in fn&&(Cn=fn.attributes),"extensions"in fn&&(ia=S(fn.extensions)),"optionalExtensions"in fn&&(qa=S(fn.optionalExtensions)),"onDone"in fn&&(wi=fn.onDone),"profile"in fn&&(ei=!!fn.profile),"pixelRatio"in fn&&(Ra=+fn.pixelRatio),"cachedCode"in fn&&(Ii=fn.cachedCode))),gn&&(gn.nodeName.toLowerCase()==="canvas"?Ta=gn:ha=gn),!ka){if(!Ta){var Ca=y(ha||document.body,wi,Ra);if(!Ca)return null;Ta=Ca.canvas,Ha=Ca.onDestroy}Cn.premultipliedAlpha===void 0&&(Cn.premultipliedAlpha=!0),ka=l(Ta,Cn)}return ka?{gl:ka,canvas:Ta,container:ha,extensions:ia,optionalExtensions:qa,pixelRatio:Ra,profile:ei,cachedCode:Ii,onDone:wi,onDestroy:Ha}:(Ha(),wi("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function w(sr,fn){var gn={};function ha(Cn){var ia=Cn.toLowerCase(),qa;try{qa=gn[ia]=sr.getExtension(ia)}catch{}return!!qa}for(var Ta=0;Ta<fn.extensions.length;++Ta){var ka=fn.extensions[Ta];if(!ha(ka))return fn.onDestroy(),fn.onDone('"'+ka+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return fn.optionalExtensions.forEach(ha),{extensions:gn,restore:function(){Object.keys(gn).forEach(function(Cn){if(gn[Cn]&&!ha(Cn))throw new Error("(regl): error restoring extension "+Cn)})}}}function u(sr,fn){for(var gn=Array(sr),ha=0;ha<sr;++ha)gn[ha]=fn(ha);return gn}var f=5120,k=5121,_=5122,D=5123,I=5124,O=5125,B=5126;function R(sr){for(var fn=16;fn<=1<<28;fn*=16)if(sr<=fn)return fn;return 0}function L(sr){var fn,gn;return fn=(sr>65535)<<4,sr>>>=fn,gn=(sr>255)<<3,sr>>>=gn,fn|=gn,gn=(sr>15)<<2,sr>>>=gn,fn|=gn,gn=(sr>3)<<1,sr>>>=gn,fn|=gn,fn|sr>>1}function F(){var sr=u(8,function(){return[]});function fn(ka){var Cn=R(ka),ia=sr[L(Cn)>>2];return ia.length>0?ia.pop():new ArrayBuffer(Cn)}function gn(ka){sr[L(ka.byteLength)>>2].push(ka)}function ha(ka,Cn){var ia=null;switch(ka){case f:ia=new Int8Array(fn(Cn),0,Cn);break;case k:ia=new Uint8Array(fn(Cn),0,Cn);break;case _:ia=new Int16Array(fn(2*Cn),0,Cn);break;case D:ia=new Uint16Array(fn(2*Cn),0,Cn);break;case I:ia=new Int32Array(fn(4*Cn),0,Cn);break;case O:ia=new Uint32Array(fn(4*Cn),0,Cn);break;case B:ia=new Float32Array(fn(4*Cn),0,Cn);break;default:return null}return ia.length!==Cn?ia.subarray(0,Cn):ia}function Ta(ka){gn(ka.buffer)}return{alloc:fn,free:gn,allocType:ha,freeType:Ta}}var N=F();N.zero=F();var j=3408,G=3410,rt=3411,ct=3412,lt=3413,tt=3414,Z=3415,st=33901,$=33902,Q=3379,nt=3386,Y=34921,q=36347,ot=36348,it=35661,dt=35660,wt=34930,xt=36349,Ft=34076,Et=34024,Nt=7936,te=7937,Jt=7938,Qt=35724,Wt=34047,gt=36063,bt=34852,vt=3553,Ut=34067,Kt=34069,Zt=33984,le=6408,Te=5126,Se=5121,Fe=36160,Oe=36053,ur=36064,fr=16384,We=function(sr,fn){var gn=1;fn.ext_texture_filter_anisotropic&&(gn=sr.getParameter(Wt));var ha=1,Ta=1;fn.webgl_draw_buffers&&(ha=sr.getParameter(bt),Ta=sr.getParameter(gt));var ka=!!fn.oes_texture_float;if(ka){var Cn=sr.createTexture();sr.bindTexture(vt,Cn),sr.texImage2D(vt,0,le,1,1,0,le,Te,null);var ia=sr.createFramebuffer();if(sr.bindFramebuffer(Fe,ia),sr.framebufferTexture2D(Fe,ur,vt,Cn,0),sr.bindTexture(vt,null),sr.checkFramebufferStatus(Fe)!==Oe)ka=!1;else{sr.viewport(0,0,1,1),sr.clearColor(1,0,0,1),sr.clear(fr);var qa=N.allocType(Te,4);sr.readPixels(0,0,1,1,le,Te,qa),sr.getError()?ka=!1:(sr.deleteFramebuffer(ia),sr.deleteTexture(Cn),ka=qa[0]===1),N.freeType(qa)}}var Ra=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ei=!0;if(!Ra){var Ii=sr.createTexture(),wi=N.allocType(Se,36);sr.activeTexture(Zt),sr.bindTexture(Ut,Ii),sr.texImage2D(Kt,0,le,3,3,0,le,Se,wi),N.freeType(wi),sr.bindTexture(Ut,null),sr.deleteTexture(Ii),ei=!sr.getError()}return{colorBits:[sr.getParameter(G),sr.getParameter(rt),sr.getParameter(ct),sr.getParameter(lt)],depthBits:sr.getParameter(tt),stencilBits:sr.getParameter(Z),subpixelBits:sr.getParameter(j),extensions:Object.keys(fn).filter(function(Ha){return!!fn[Ha]}),maxAnisotropic:gn,maxDrawbuffers:ha,maxColorAttachments:Ta,pointSizeDims:sr.getParameter(st),lineWidthDims:sr.getParameter($),maxViewportDims:sr.getParameter(nt),maxCombinedTextureUnits:sr.getParameter(it),maxCubeMapSize:sr.getParameter(Ft),maxRenderbufferSize:sr.getParameter(Et),maxTextureUnits:sr.getParameter(wt),maxTextureSize:sr.getParameter(Q),maxAttributes:sr.getParameter(Y),maxVertexUniforms:sr.getParameter(q),maxVertexTextureUnits:sr.getParameter(dt),maxVaryingVectors:sr.getParameter(ot),maxFragmentUniforms:sr.getParameter(xt),glsl:sr.getParameter(Qt),renderer:sr.getParameter(te),vendor:sr.getParameter(Nt),version:sr.getParameter(Jt),readFloat:ka,npotTextureCube:ei}},Lr=function(sr){return sr instanceof Uint8Array||sr instanceof Uint16Array||sr instanceof Uint32Array||sr instanceof Int8Array||sr instanceof Int16Array||sr instanceof Int32Array||sr instanceof Float32Array||sr instanceof Float64Array||sr instanceof Uint8ClampedArray};function kr(sr){return!!sr&&typeof sr=="object"&&Array.isArray(sr.shape)&&Array.isArray(sr.stride)&&typeof sr.offset=="number"&&sr.shape.length===sr.stride.length&&(Array.isArray(sr.data)||Lr(sr.data))}var he=function(sr){return Object.keys(sr).map(function(fn){return sr[fn]})},Dt={shape:Ot,flatten:Mt};function qt(sr,fn,gn){for(var ha=0;ha<fn;++ha)gn[ha]=sr[ha]}function zt(sr,fn,gn,ha){for(var Ta=0,ka=0;ka<fn;++ka)for(var Cn=sr[ka],ia=0;ia<gn;++ia)ha[Ta++]=Cn[ia]}function ut(sr,fn,gn,ha,Ta,ka){for(var Cn=ka,ia=0;ia<fn;++ia)for(var qa=sr[ia],Ra=0;Ra<gn;++Ra)for(var ei=qa[Ra],Ii=0;Ii<ha;++Ii)Ta[Cn++]=ei[Ii]}function yt(sr,fn,gn,ha,Ta){for(var ka=1,Cn=gn+1;Cn<fn.length;++Cn)ka*=fn[Cn];var ia=fn[gn];if(fn.length-gn===4){var qa=fn[gn+1],Ra=fn[gn+2],ei=fn[gn+3];for(Cn=0;Cn<ia;++Cn)ut(sr[Cn],qa,Ra,ei,ha,Ta),Ta+=ka}else for(Cn=0;Cn<ia;++Cn)yt(sr[Cn],fn,gn+1,ha,Ta),Ta+=ka}function Mt(sr,fn,gn,ha){var Ta=1;if(fn.length)for(var ka=0;ka<fn.length;++ka)Ta*=fn[ka];else Ta=0;var Cn=ha||N.allocType(gn,Ta);switch(fn.length){case 0:break;case 1:qt(sr,fn[0],Cn);break;case 2:zt(sr,fn[0],fn[1],Cn);break;case 3:ut(sr,fn[0],fn[1],fn[2],Cn,0);break;default:yt(sr,fn,0,Cn,0)}return Cn}function Ot(sr){for(var fn=[],gn=sr;gn.length;gn=gn[0])fn.push(gn.length);return fn}var $t={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},ee=5120,we=5122,Me=5124,Re=5121,Be=5123,Ze=5125,Ue=5126,mr=5126,ln={int8:ee,int16:we,int32:Me,uint8:Re,uint16:Be,uint32:Ze,float:Ue,float32:mr},an=35048,vn=35040,Sn={dynamic:an,stream:vn,static:35044},An=Dt.flatten,pn=Dt.shape,On=35044,Nn=35040,ke=5121,ze=5126,je=[];je[5120]=1,je[5122]=2,je[5124]=4,je[5121]=1,je[5123]=2,je[5125]=4,je[5126]=4;function Ne(sr){return $t[Object.prototype.toString.call(sr)]|0}function _r(sr,fn){for(var gn=0;gn<fn.length;++gn)sr[gn]=fn[gn]}function Xr(sr,fn,gn,ha,Ta,ka,Cn){for(var ia=0,qa=0;qa<gn;++qa)for(var Ra=0;Ra<ha;++Ra)sr[ia++]=fn[Ta*qa+ka*Ra+Cn]}function rn(sr,fn,gn,ha){var Ta=0,ka={};function Cn(Wn){this.id=Ta++,this.buffer=sr.createBuffer(),this.type=Wn,this.usage=On,this.byteLength=0,this.dimension=1,this.dtype=ke,this.persistentData=null,gn.profile&&(this.stats={size:0})}Cn.prototype.bind=function(){sr.bindBuffer(this.type,this.buffer)},Cn.prototype.destroy=function(){wi(this)};var ia=[];function qa(Wn,fa){var Ga=ia.pop();return Ga||(Ga=new Cn(Wn)),Ga.bind(),Ii(Ga,fa,Nn,0,1,!1),Ga}function Ra(Wn){ia.push(Wn)}function ei(Wn,fa,Ga){Wn.byteLength=fa.byteLength,sr.bufferData(Wn.type,fa,Ga)}function Ii(Wn,fa,Ga,Aa,xa,Ti){var fi;if(Wn.usage=Ga,Array.isArray(fa)){if(Wn.dtype=Aa||ze,fa.length>0){var _i;if(Array.isArray(fa[0])){fi=pn(fa);for(var Ia=1,Ma=1;Ma<fi.length;++Ma)Ia*=fi[Ma];Wn.dimension=Ia,_i=An(fa,fi,Wn.dtype),ei(Wn,_i,Ga),Ti?Wn.persistentData=_i:N.freeType(_i)}else if(typeof fa[0]=="number"){Wn.dimension=xa;var ki=N.allocType(Wn.dtype,fa.length);_r(ki,fa),ei(Wn,ki,Ga),Ti?Wn.persistentData=ki:N.freeType(ki)}else Lr(fa[0])&&(Wn.dimension=fa[0].length,Wn.dtype=Aa||Ne(fa[0])||ze,_i=An(fa,[fa.length,fa[0].length],Wn.dtype),ei(Wn,_i,Ga),Ti?Wn.persistentData=_i:N.freeType(_i))}}else if(Lr(fa))Wn.dtype=Aa||Ne(fa),Wn.dimension=xa,ei(Wn,fa,Ga),Ti&&(Wn.persistentData=new Uint8Array(new Uint8Array(fa.buffer)));else if(kr(fa)){fi=fa.shape;var hi=fa.stride,Wa=fa.offset,Qa=0,xi=0,Wo=0,zo=0;fi.length===1?(Qa=fi[0],xi=1,Wo=hi[0],zo=0):fi.length===2&&(Qa=fi[0],xi=fi[1],Wo=hi[0],zo=hi[1]),Wn.dtype=Aa||Ne(fa.data)||ze,Wn.dimension=xi;var mi=N.allocType(Wn.dtype,Qa*xi);Xr(mi,fa.data,Qa,xi,Wo,zo,Wa),ei(Wn,mi,Ga),Ti?Wn.persistentData=mi:N.freeType(mi)}else fa instanceof ArrayBuffer&&(Wn.dtype=ke,Wn.dimension=xa,ei(Wn,fa,Ga),Ti&&(Wn.persistentData=new Uint8Array(new Uint8Array(fa))))}function wi(Wn){fn.bufferCount--,ha(Wn);var fa=Wn.buffer;sr.deleteBuffer(fa),Wn.buffer=null,delete ka[Wn.id]}function Ha(Wn,fa,Ga,Aa){fn.bufferCount++;var xa=new Cn(fa);ka[xa.id]=xa;function Ti(Ia){var Ma=On,ki=null,hi=0,Wa=0,Qa=1;return Array.isArray(Ia)||Lr(Ia)||kr(Ia)||Ia instanceof ArrayBuffer?ki=Ia:typeof Ia=="number"?hi=Ia|0:Ia&&("data"in Ia&&(ki=Ia.data),"usage"in Ia&&(Ma=Sn[Ia.usage]),"type"in Ia&&(Wa=ln[Ia.type]),"dimension"in Ia&&(Qa=Ia.dimension|0),"length"in Ia&&(hi=Ia.length|0)),xa.bind(),ki?Ii(xa,ki,Ma,Wa,Qa,Aa):(hi&&sr.bufferData(xa.type,hi,Ma),xa.dtype=Wa||ke,xa.usage=Ma,xa.dimension=Qa,xa.byteLength=hi),gn.profile&&(xa.stats.size=xa.byteLength*je[xa.dtype]),Ti}function fi(Ia,Ma){sr.bufferSubData(xa.type,Ma,Ia)}function _i(Ia,Ma){var ki=(Ma||0)|0,hi;if(xa.bind(),Lr(Ia)||Ia instanceof ArrayBuffer)fi(Ia,ki);else if(Array.isArray(Ia)){if(Ia.length>0){if(typeof Ia[0]=="number"){var Wa=N.allocType(xa.dtype,Ia.length);_r(Wa,Ia),fi(Wa,ki),N.freeType(Wa)}else if(Array.isArray(Ia[0])||Lr(Ia[0])){hi=pn(Ia);var Qa=An(Ia,hi,xa.dtype);fi(Qa,ki),N.freeType(Qa)}}}else if(kr(Ia)){hi=Ia.shape;var xi=Ia.stride,Wo=0,zo=0,mi=0,Li=0;hi.length===1?(Wo=hi[0],zo=1,mi=xi[0],Li=0):hi.length===2&&(Wo=hi[0],zo=hi[1],mi=xi[0],Li=xi[1]);var mo=Array.isArray(Ia.data)?xa.dtype:Ne(Ia.data),Oo=N.allocType(mo,Wo*zo);Xr(Oo,Ia.data,Wo,zo,mi,Li,Ia.offset),fi(Oo,ki),N.freeType(Oo)}return Ti}return Ga||Ti(Wn),Ti._reglType="buffer",Ti._buffer=xa,Ti.subdata=_i,gn.profile&&(Ti.stats=xa.stats),Ti.destroy=function(){wi(xa)},Ti}function Ca(){he(ka).forEach(function(Wn){Wn.buffer=sr.createBuffer(),sr.bindBuffer(Wn.type,Wn.buffer),sr.bufferData(Wn.type,Wn.persistentData||Wn.byteLength,Wn.usage)})}return gn.profile&&(fn.getTotalBufferSize=function(){var Wn=0;return Object.keys(ka).forEach(function(fa){Wn+=ka[fa].stats.size}),Wn}),{create:Ha,createStream:qa,destroyStream:Ra,clear:function(){he(ka).forEach(wi),ia.forEach(wi)},getBuffer:function(Wn){return Wn&&Wn._buffer instanceof Cn?Wn._buffer:null},restore:Ca,_initBuffer:Ii}}var Br=0,_n=0,bn=1,Fn=1,on=4,Bn=4,ue={points:Br,point:_n,lines:bn,line:Fn,triangles:on,triangle:Bn,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},xe=0,Pr=1,Sr=4,gr=5120,dr=5121,Er=5122,Dr=5123,Ar=5124,Gr=5125,Wr=34963,Jr=35040,_e=35044;function Je(sr,fn,gn,ha){var Ta={},ka=0,Cn={uint8:dr,uint16:Dr};fn.oes_element_index_uint&&(Cn.uint32=Gr);function ia(Ca){this.id=ka++,Ta[this.id]=this,this.buffer=Ca,this.primType=Sr,this.vertCount=0,this.type=0}ia.prototype.bind=function(){this.buffer.bind()};var qa=[];function Ra(Ca){var Wn=qa.pop();return Wn||(Wn=new ia(gn.create(null,Wr,!0,!1)._buffer)),Ii(Wn,Ca,Jr,-1,-1,0,0),Wn}function ei(Ca){qa.push(Ca)}function Ii(Ca,Wn,fa,Ga,Aa,xa,Ti){Ca.buffer.bind();var fi;if(Wn){var _i=Ti;!Ti&&(!Lr(Wn)||kr(Wn)&&!Lr(Wn.data))&&(_i=fn.oes_element_index_uint?Gr:Dr),gn._initBuffer(Ca.buffer,Wn,fa,_i,3)}else sr.bufferData(Wr,xa,fa),Ca.buffer.dtype=fi||dr,Ca.buffer.usage=fa,Ca.buffer.dimension=3,Ca.buffer.byteLength=xa;if(fi=Ti,!Ti){switch(Ca.buffer.dtype){case dr:case gr:fi=dr;break;case Dr:case Er:fi=Dr;break;case Gr:case Ar:fi=Gr;break}Ca.buffer.dtype=fi}Ca.type=fi;var Ia=Aa;Ia<0&&(Ia=Ca.buffer.byteLength,fi===Dr?Ia>>=1:fi===Gr&&(Ia>>=2)),Ca.vertCount=Ia;var Ma=Ga;if(Ga<0){Ma=Sr;var ki=Ca.buffer.dimension;ki===1&&(Ma=xe),ki===2&&(Ma=Pr),ki===3&&(Ma=Sr)}Ca.primType=Ma}function wi(Ca){ha.elementsCount--,delete Ta[Ca.id],Ca.buffer.destroy(),Ca.buffer=null}function Ha(Ca,Wn){var fa=gn.create(null,Wr,!0),Ga=new ia(fa._buffer);ha.elementsCount++;function Aa(xa){if(!xa)fa(),Ga.primType=Sr,Ga.vertCount=0,Ga.type=dr;else if(typeof xa=="number")fa(xa),Ga.primType=Sr,Ga.vertCount=xa|0,Ga.type=dr;else{var Ti=null,fi=_e,_i=-1,Ia=-1,Ma=0,ki=0;Array.isArray(xa)||Lr(xa)||kr(xa)?Ti=xa:("data"in xa&&(Ti=xa.data),"usage"in xa&&(fi=Sn[xa.usage]),"primitive"in xa&&(_i=ue[xa.primitive]),"count"in xa&&(Ia=xa.count|0),"type"in xa&&(ki=Cn[xa.type]),"length"in xa?Ma=xa.length|0:(Ma=Ia,ki===Dr||ki===Er?Ma*=2:(ki===Gr||ki===Ar)&&(Ma*=4))),Ii(Ga,Ti,fi,_i,Ia,Ma,ki)}return Aa}return Aa(Ca),Aa._reglType="elements",Aa._elements=Ga,Aa.subdata=function(xa,Ti){return fa.subdata(xa,Ti),Aa},Aa.destroy=function(){wi(Ga)},Aa}return{create:Ha,createStream:Ra,destroyStream:ei,getElements:function(Ca){return typeof Ca=="function"&&Ca._elements instanceof ia?Ca._elements:null},clear:function(){he(Ta).forEach(wi)}}}var yr=new Float32Array(1),Hr=new Uint32Array(yr.buffer),hn=5123;function En(sr){for(var fn=N.allocType(hn,sr.length),gn=0;gn<sr.length;++gn)if(isNaN(sr[gn]))fn[gn]=65535;else if(sr[gn]===1/0)fn[gn]=31744;else if(sr[gn]===-1/0)fn[gn]=64512;else{yr[0]=sr[gn];var ha=Hr[0],Ta=ha>>>31<<15,ka=(ha<<1>>>24)-127,Cn=ha>>13&1023;if(ka<-24)fn[gn]=Ta;else if(ka<-14){var ia=-14-ka;fn[gn]=Ta+(Cn+1024>>ia)}else ka>15?fn[gn]=Ta+31744:fn[gn]=Ta+(ka+15<<10)+Cn}return fn}function dn(sr){return Array.isArray(sr)||Lr(sr)}var Kr=34467,Tn=3553,ta=34067,Qn=34069,Va=6408,ja=6406,ci=6407,pi=6409,bi=6410,ri=32854,Da=32855,Ui=36194,lo=32819,Co=32820,Bo=33635,ai=34042,yi=6402,Si=34041,ko=35904,Ao=35906,Do=36193,Pi=33776,Yi=33777,vs=33778,es=33779,ls=35986,Xi=35987,ga=34798,Xa=35840,Ls=35841,fs=35842,qi=35843,ms=36196,Po=5121,rs=5123,hl=5125,za=5126,Oi=10242,Bi=10243,Ro=10497,Fo=33071,Ci=33648,fl=10240,ql=10241,Zs=9728,Hl=9729,Us=9984,Es=9985,El=9986,Wu=9987,Mu=33170,Fu=4352,_h=4353,ih=4354,ns=34046,du=3317,Ic=37440,ll=37441,el=37443,ul=37444,Zu=33984,ys=[Us,El,Es,Wu],pl=[0,pi,bi,ci,Va],$o={};$o[pi]=$o[ja]=$o[yi]=1,$o[Si]=$o[bi]=2,$o[ci]=$o[ko]=3,$o[Va]=$o[Ao]=4;function ks(sr){return"[object "+sr+"]"}var Bu=ks("HTMLCanvasElement"),Ol=ks("OffscreenCanvas"),Xu=ks("CanvasRenderingContext2D"),Cs=ks("ImageBitmap"),zh=ks("HTMLImageElement"),Mo=ks("HTMLVideoElement"),Oh=Object.keys($t).concat([Bu,Ol,Xu,Cs,zh,Mo]),as=[];as[Po]=1,as[za]=4,as[Do]=2,as[rs]=2,as[hl]=4;var io=[];io[ri]=2,io[Da]=2,io[Ui]=2,io[Si]=4,io[Pi]=.5,io[Yi]=.5,io[vs]=1,io[es]=1,io[ls]=.5,io[Xi]=1,io[ga]=1,io[Xa]=.5,io[Ls]=.25,io[fs]=.5,io[qi]=.25,io[ms]=.5;function pc(sr){return Array.isArray(sr)&&(sr.length===0||typeof sr[0]=="number")}function gu(sr){if(!Array.isArray(sr))return!1;var fn=sr.length;return!(fn===0||!dn(sr[0]))}function Pl(sr){return Object.prototype.toString.call(sr)}function Wc(sr){return Pl(sr)===Bu}function $u(sr){return Pl(sr)===Ol}function dc(sr){return Pl(sr)===Xu}function rl(sr){return Pl(sr)===Cs}function oh(sr){return Pl(sr)===zh}function Zc(sr){return Pl(sr)===Mo}function Lc(sr){if(!sr)return!1;var fn=Pl(sr);return Oh.indexOf(fn)>=0?!0:pc(sr)||gu(sr)||kr(sr)}function Ju(sr){return $t[Object.prototype.toString.call(sr)]|0}function Cc(sr,fn){var gn=fn.length;switch(sr.type){case Po:case rs:case hl:case za:var ha=N.allocType(sr.type,gn);ha.set(fn),sr.data=ha;break;case Do:sr.data=En(fn);break}}function Xc(sr,fn){return N.allocType(sr.type===Do?za:sr.type,fn)}function mu(sr,fn){sr.type===Do?(sr.data=En(fn),N.freeType(fn)):sr.data=fn}function $c(sr,fn,gn,ha,Ta,ka){for(var Cn=sr.width,ia=sr.height,qa=sr.channels,Ra=Cn*ia*qa,ei=Xc(sr,Ra),Ii=0,wi=0;wi<ia;++wi)for(var Ha=0;Ha<Cn;++Ha)for(var Ca=0;Ca<qa;++Ca)ei[Ii++]=fn[gn*Ha+ha*wi+Ta*Ca+ka];mu(sr,ei)}function nc(sr,fn,gn,ha,Ta,ka){var Cn;if(typeof io[sr]<"u"?Cn=io[sr]:Cn=$o[sr]*as[fn],ka&&(Cn*=6),Ta){for(var ia=0,qa=gn;qa>=1;)ia+=Cn*qa*qa,qa/=2;return ia}else return Cn*gn*ha}function vu(sr,fn,gn,ha,Ta,ka,Cn){var ia={"don't care":Fu,"dont care":Fu,nice:ih,fast:_h},qa={repeat:Ro,clamp:Fo,mirror:Ci},Ra={nearest:Zs,linear:Hl},ei=c({mipmap:Wu,"nearest mipmap nearest":Us,"linear mipmap nearest":Es,"nearest mipmap linear":El,"linear mipmap linear":Wu},Ra),Ii={none:0,browser:ul},wi={uint8:Po,rgba4:lo,rgb565:Bo,"rgb5 a1":Co},Ha={alpha:ja,luminance:pi,"luminance alpha":bi,rgb:ci,rgba:Va,rgba4:ri,"rgb5 a1":Da,rgb565:Ui},Ca={};fn.ext_srgb&&(Ha.srgb=ko,Ha.srgba=Ao),fn.oes_texture_float&&(wi.float32=wi.float=za),fn.oes_texture_half_float&&(wi.float16=wi["half float"]=Do),fn.webgl_depth_texture&&(c(Ha,{depth:yi,"depth stencil":Si}),c(wi,{uint16:rs,uint32:hl,"depth stencil":ai})),fn.webgl_compressed_texture_s3tc&&c(Ca,{"rgb s3tc dxt1":Pi,"rgba s3tc dxt1":Yi,"rgba s3tc dxt3":vs,"rgba s3tc dxt5":es}),fn.webgl_compressed_texture_atc&&c(Ca,{"rgb atc":ls,"rgba atc explicit alpha":Xi,"rgba atc interpolated alpha":ga}),fn.webgl_compressed_texture_pvrtc&&c(Ca,{"rgb pvrtc 4bppv1":Xa,"rgb pvrtc 2bppv1":Ls,"rgba pvrtc 4bppv1":fs,"rgba pvrtc 2bppv1":qi}),fn.webgl_compressed_texture_etc1&&(Ca["rgb etc1"]=ms);var Wn=Array.prototype.slice.call(sr.getParameter(Kr));Object.keys(Ca).forEach(function(W){var et=Ca[W];Wn.indexOf(et)>=0&&(Ha[W]=et)});var fa=Object.keys(Ha);gn.textureFormats=fa;var Ga=[];Object.keys(Ha).forEach(function(W){var et=Ha[W];Ga[et]=W});var Aa=[];Object.keys(wi).forEach(function(W){var et=wi[W];Aa[et]=W});var xa=[];Object.keys(Ra).forEach(function(W){var et=Ra[W];xa[et]=W});var Ti=[];Object.keys(ei).forEach(function(W){var et=ei[W];Ti[et]=W});var fi=[];Object.keys(qa).forEach(function(W){var et=qa[W];fi[et]=W});var _i=fa.reduce(function(W,et){var K=Ha[et];return K===pi||K===ja||K===pi||K===bi||K===yi||K===Si||fn.ext_srgb&&(K===ko||K===Ao)?W[K]=K:K===Da||et.indexOf("rgba")>=0?W[K]=Va:W[K]=ci,W},{});function Ia(){this.internalformat=Va,this.format=Va,this.type=Po,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=ul,this.width=0,this.height=0,this.channels=0}function Ma(W,et){W.internalformat=et.internalformat,W.format=et.format,W.type=et.type,W.compressed=et.compressed,W.premultiplyAlpha=et.premultiplyAlpha,W.flipY=et.flipY,W.unpackAlignment=et.unpackAlignment,W.colorSpace=et.colorSpace,W.width=et.width,W.height=et.height,W.channels=et.channels}function ki(W,et){if(!(typeof et!="object"||!et)){if("premultiplyAlpha"in et&&(W.premultiplyAlpha=et.premultiplyAlpha),"flipY"in et&&(W.flipY=et.flipY),"alignment"in et&&(W.unpackAlignment=et.alignment),"colorSpace"in et&&(W.colorSpace=Ii[et.colorSpace]),"type"in et){var K=et.type;W.type=wi[K]}var pt=W.width,Ct=W.height,Yt=W.channels,ce=!1;"shape"in et?(pt=et.shape[0],Ct=et.shape[1],et.shape.length===3&&(Yt=et.shape[2],ce=!0)):("radius"in et&&(pt=Ct=et.radius),"width"in et&&(pt=et.width),"height"in et&&(Ct=et.height),"channels"in et&&(Yt=et.channels,ce=!0)),W.width=pt|0,W.height=Ct|0,W.channels=Yt|0;var re=!1;if("format"in et){var ye=et.format,Le=W.internalformat=Ha[ye];W.format=_i[Le],ye in wi&&("type"in et||(W.type=wi[ye])),ye in Ca&&(W.compressed=!0),re=!0}!ce&&re?W.channels=$o[W.format]:ce&&!re&&W.channels!==pl[W.format]&&(W.format=W.internalformat=pl[W.channels])}}function hi(W){sr.pixelStorei(Ic,W.flipY),sr.pixelStorei(ll,W.premultiplyAlpha),sr.pixelStorei(el,W.colorSpace),sr.pixelStorei(du,W.unpackAlignment)}function Wa(){Ia.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Qa(W,et){var K=null;if(Lc(et)?K=et:et&&(ki(W,et),"x"in et&&(W.xOffset=et.x|0),"y"in et&&(W.yOffset=et.y|0),Lc(et.data)&&(K=et.data)),et.copy){var pt=Ta.viewportWidth,Ct=Ta.viewportHeight;W.width=W.width||pt-W.xOffset,W.height=W.height||Ct-W.yOffset,W.needsCopy=!0}else if(!K)W.width=W.width||1,W.height=W.height||1,W.channels=W.channels||4;else if(Lr(K))W.channels=W.channels||4,W.data=K,!("type"in et)&&W.type===Po&&(W.type=Ju(K));else if(pc(K))W.channels=W.channels||4,Cc(W,K),W.alignment=1,W.needsFree=!0;else if(kr(K)){var Yt=K.data;!Array.isArray(Yt)&&W.type===Po&&(W.type=Ju(Yt));var ce=K.shape,re=K.stride,ye,Le,tr,$e,er,pr;ce.length===3?(tr=ce[2],pr=re[2]):(tr=1,pr=1),ye=ce[0],Le=ce[1],$e=re[0],er=re[1],W.alignment=1,W.width=ye,W.height=Le,W.channels=tr,W.format=W.internalformat=pl[tr],W.needsFree=!0,$c(W,Yt,$e,er,pr,K.offset)}else if(Wc(K)||$u(K)||dc(K))Wc(K)||$u(K)?W.element=K:W.element=K.canvas,W.width=W.element.width,W.height=W.element.height,W.channels=4;else if(rl(K))W.element=K,W.width=K.width,W.height=K.height,W.channels=4;else if(oh(K))W.element=K,W.width=K.naturalWidth,W.height=K.naturalHeight,W.channels=4;else if(Zc(K))W.element=K,W.width=K.videoWidth,W.height=K.videoHeight,W.channels=4;else if(gu(K)){var wr=W.width||K[0].length,rr=W.height||K.length,cr=W.channels;dn(K[0][0])?cr=cr||K[0][0].length:cr=cr||1;for(var hr=Dt.shape(K),Vr=1,yn=0;yn<hr.length;++yn)Vr*=hr[yn];var wn=Xc(W,Vr);Dt.flatten(K,hr,"",wn),mu(W,wn),W.alignment=1,W.width=wr,W.height=rr,W.channels=cr,W.format=W.internalformat=pl[cr],W.needsFree=!0}W.type===za||W.type}function xi(W,et,K){var pt=W.element,Ct=W.data,Yt=W.internalformat,ce=W.format,re=W.type,ye=W.width,Le=W.height;hi(W),pt?sr.texImage2D(et,K,ce,ce,re,pt):W.compressed?sr.compressedTexImage2D(et,K,Yt,ye,Le,0,Ct):W.needsCopy?(ha(),sr.copyTexImage2D(et,K,ce,W.xOffset,W.yOffset,ye,Le,0)):sr.texImage2D(et,K,ce,ye,Le,0,ce,re,Ct||null)}function Wo(W,et,K,pt,Ct){var Yt=W.element,ce=W.data,re=W.internalformat,ye=W.format,Le=W.type,tr=W.width,$e=W.height;hi(W),Yt?sr.texSubImage2D(et,Ct,K,pt,ye,Le,Yt):W.compressed?sr.compressedTexSubImage2D(et,Ct,K,pt,re,tr,$e,ce):W.needsCopy?(ha(),sr.copyTexSubImage2D(et,Ct,K,pt,W.xOffset,W.yOffset,tr,$e)):sr.texSubImage2D(et,Ct,K,pt,tr,$e,ye,Le,ce)}var zo=[];function mi(){return zo.pop()||new Wa}function Li(W){W.needsFree&&N.freeType(W.data),Wa.call(W),zo.push(W)}function mo(){Ia.call(this),this.genMipmaps=!1,this.mipmapHint=Fu,this.mipmask=0,this.images=Array(16)}function Oo(W,et,K){var pt=W.images[0]=mi();W.mipmask=1,pt.width=W.width=et,pt.height=W.height=K,pt.channels=W.channels=4}function ss(W,et){var K=null;if(Lc(et))K=W.images[0]=mi(),Ma(K,W),Qa(K,et),W.mipmask=1;else if(ki(W,et),Array.isArray(et.mipmap))for(var pt=et.mipmap,Ct=0;Ct<pt.length;++Ct)K=W.images[Ct]=mi(),Ma(K,W),K.width>>=Ct,K.height>>=Ct,Qa(K,pt[Ct]),W.mipmask|=1<<Ct;else K=W.images[0]=mi(),Ma(K,W),Qa(K,et),W.mipmask=1;Ma(W,W.images[0]),W.compressed&&(W.internalformat===Pi||W.internalformat===Yi||W.internalformat===vs||W.internalformat)}function ml(W,et){for(var K=W.images,pt=0;pt<K.length;++pt){if(!K[pt])return;xi(K[pt],et,pt)}}var Gs=[];function ws(){var W=Gs.pop()||new mo;Ia.call(W),W.mipmask=0;for(var et=0;et<16;++et)W.images[et]=null;return W}function ru(W){for(var et=W.images,K=0;K<et.length;++K)et[K]&&Li(et[K]),et[K]=null;Gs.push(W)}function al(){this.minFilter=Zs,this.magFilter=Zs,this.wrapS=Fo,this.wrapT=Fo,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Fu}function Tu(W,et){if("min"in et){var K=et.min;W.minFilter=ei[K],ys.indexOf(W.minFilter)>=0&&!("faces"in et)&&(W.genMipmaps=!0)}if("mag"in et){var pt=et.mag;W.magFilter=Ra[pt]}var Ct=W.wrapS,Yt=W.wrapT;if("wrap"in et){var ce=et.wrap;typeof ce=="string"?Ct=Yt=qa[ce]:Array.isArray(ce)&&(Ct=qa[ce[0]],Yt=qa[ce[1]])}else{if("wrapS"in et){var re=et.wrapS;Ct=qa[re]}if("wrapT"in et){var ye=et.wrapT;Yt=qa[ye]}}if(W.wrapS=Ct,W.wrapT=Yt,"anisotropic"in et&&(et.anisotropic,W.anisotropic=et.anisotropic),"mipmap"in et){var Le=!1;switch(typeof et.mipmap){case"string":W.mipmapHint=ia[et.mipmap],W.genMipmaps=!0,Le=!0;break;case"boolean":Le=W.genMipmaps=et.mipmap;break;case"object":W.genMipmaps=!1,Le=!0;break}Le&&!("min"in et)&&(W.minFilter=Us)}}function lc(W,et){sr.texParameteri(et,ql,W.minFilter),sr.texParameteri(et,fl,W.magFilter),sr.texParameteri(et,Oi,W.wrapS),sr.texParameteri(et,Bi,W.wrapT),fn.ext_texture_filter_anisotropic&&sr.texParameteri(et,ns,W.anisotropic),W.genMipmaps&&(sr.hint(Mu,W.mipmapHint),sr.generateMipmap(et))}var Fc=0,Lu={},nu=gn.maxTextureUnits,Cu=Array(nu).map(function(){return null});function Xo(W){Ia.call(this),this.mipmask=0,this.internalformat=Va,this.id=Fc++,this.refCount=1,this.target=W,this.texture=sr.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new al,Cn.profile&&(this.stats={size:0})}function uu(W){sr.activeTexture(Zu),sr.bindTexture(W.target,W.texture)}function tl(){var W=Cu[0];W?sr.bindTexture(W.target,W.texture):sr.bindTexture(Tn,null)}function au(W){var et=W.texture,K=W.unit,pt=W.target;K>=0&&(sr.activeTexture(Zu+K),sr.bindTexture(pt,null),Cu[K]=null),sr.deleteTexture(et),W.texture=null,W.params=null,W.pixels=null,W.refCount=0,delete Lu[W.id],ka.textureCount--}c(Xo.prototype,{bind:function(){var W=this;W.bindCount+=1;var et=W.unit;if(et<0){for(var K=0;K<nu;++K){var pt=Cu[K];if(pt){if(pt.bindCount>0)continue;pt.unit=-1}Cu[K]=W,et=K;break}Cn.profile&&ka.maxTextureUnits<et+1&&(ka.maxTextureUnits=et+1),W.unit=et,sr.activeTexture(Zu+et),sr.bindTexture(W.target,W.texture)}return et},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&au(this)}});function Bc(W,et){var K=new Xo(Tn);Lu[K.id]=K,ka.textureCount++;function pt(ce,re){var ye=K.texInfo;al.call(ye);var Le=ws();return typeof ce=="number"?typeof re=="number"?Oo(Le,ce|0,re|0):Oo(Le,ce|0,ce|0):ce?(Tu(ye,ce),ss(Le,ce)):Oo(Le,1,1),ye.genMipmaps&&(Le.mipmask=(Le.width<<1)-1),K.mipmask=Le.mipmask,Ma(K,Le),K.internalformat=Le.internalformat,pt.width=Le.width,pt.height=Le.height,uu(K),ml(Le,Tn),lc(ye,Tn),tl(),ru(Le),Cn.profile&&(K.stats.size=nc(K.internalformat,K.type,Le.width,Le.height,ye.genMipmaps,!1)),pt.format=Ga[K.internalformat],pt.type=Aa[K.type],pt.mag=xa[ye.magFilter],pt.min=Ti[ye.minFilter],pt.wrapS=fi[ye.wrapS],pt.wrapT=fi[ye.wrapT],pt}function Ct(ce,re,ye,Le){var tr=re|0,$e=ye|0,er=Le|0,pr=mi();return Ma(pr,K),pr.width=0,pr.height=0,Qa(pr,ce),pr.width=pr.width||(K.width>>er)-tr,pr.height=pr.height||(K.height>>er)-$e,uu(K),Wo(pr,Tn,tr,$e,er),tl(),Li(pr),pt}function Yt(ce,re){var ye=ce|0,Le=re|0||ye;if(ye===K.width&&Le===K.height)return pt;pt.width=K.width=ye,pt.height=K.height=Le,uu(K);for(var tr=0;K.mipmask>>tr;++tr){var $e=ye>>tr,er=Le>>tr;if(!$e||!er)break;sr.texImage2D(Tn,tr,K.format,$e,er,0,K.format,K.type,null)}return tl(),Cn.profile&&(K.stats.size=nc(K.internalformat,K.type,ye,Le,!1,!1)),pt}return pt(W,et),pt.subimage=Ct,pt.resize=Yt,pt._reglType="texture2d",pt._texture=K,Cn.profile&&(pt.stats=K.stats),pt.destroy=function(){K.decRef()},pt}function Ho(W,et,K,pt,Ct,Yt){var ce=new Xo(ta);Lu[ce.id]=ce,ka.cubeCount++;var re=new Array(6);function ye($e,er,pr,wr,rr,cr){var hr,Vr=ce.texInfo;for(al.call(Vr),hr=0;hr<6;++hr)re[hr]=ws();if(typeof $e=="number"||!$e){var yn=$e|0||1;for(hr=0;hr<6;++hr)Oo(re[hr],yn,yn)}else if(typeof $e=="object")if(er)ss(re[0],$e),ss(re[1],er),ss(re[2],pr),ss(re[3],wr),ss(re[4],rr),ss(re[5],cr);else if(Tu(Vr,$e),ki(ce,$e),"faces"in $e){var wn=$e.faces;for(hr=0;hr<6;++hr)Ma(re[hr],ce),ss(re[hr],wn[hr])}else for(hr=0;hr<6;++hr)ss(re[hr],$e);for(Ma(ce,re[0]),Vr.genMipmaps?ce.mipmask=(re[0].width<<1)-1:ce.mipmask=re[0].mipmask,ce.internalformat=re[0].internalformat,ye.width=re[0].width,ye.height=re[0].height,uu(ce),hr=0;hr<6;++hr)ml(re[hr],Qn+hr);for(lc(Vr,ta),tl(),Cn.profile&&(ce.stats.size=nc(ce.internalformat,ce.type,ye.width,ye.height,Vr.genMipmaps,!0)),ye.format=Ga[ce.internalformat],ye.type=Aa[ce.type],ye.mag=xa[Vr.magFilter],ye.min=Ti[Vr.minFilter],ye.wrapS=fi[Vr.wrapS],ye.wrapT=fi[Vr.wrapT],hr=0;hr<6;++hr)ru(re[hr]);return ye}function Le($e,er,pr,wr,rr){var cr=pr|0,hr=wr|0,Vr=rr|0,yn=mi();return Ma(yn,ce),yn.width=0,yn.height=0,Qa(yn,er),yn.width=yn.width||(ce.width>>Vr)-cr,yn.height=yn.height||(ce.height>>Vr)-hr,uu(ce),Wo(yn,Qn+$e,cr,hr,Vr),tl(),Li(yn),ye}function tr($e){var er=$e|0;if(er!==ce.width){ye.width=ce.width=er,ye.height=ce.height=er,uu(ce);for(var pr=0;pr<6;++pr)for(var wr=0;ce.mipmask>>wr;++wr)sr.texImage2D(Qn+pr,wr,ce.format,er>>wr,er>>wr,0,ce.format,ce.type,null);return tl(),Cn.profile&&(ce.stats.size=nc(ce.internalformat,ce.type,ye.width,ye.height,!1,!0)),ye}}return ye(W,et,K,pt,Ct,Yt),ye.subimage=Le,ye.resize=tr,ye._reglType="textureCube",ye._texture=ce,Cn.profile&&(ye.stats=ce.stats),ye.destroy=function(){ce.decRef()},ye}function Fs(){for(var W=0;W<nu;++W)sr.activeTexture(Zu+W),sr.bindTexture(Tn,null),Cu[W]=null;he(Lu).forEach(au),ka.cubeCount=0,ka.textureCount=0}Cn.profile&&(ka.getTotalTextureSize=function(){var W=0;return Object.keys(Lu).forEach(function(et){W+=Lu[et].stats.size}),W});function kl(){for(var W=0;W<nu;++W){var et=Cu[W];et&&(et.bindCount=0,et.unit=-1,Cu[W]=null)}he(Lu).forEach(function(K){K.texture=sr.createTexture(),sr.bindTexture(K.target,K.texture);for(var pt=0;pt<32;++pt)if(K.mipmask&1<<pt)if(K.target===Tn)sr.texImage2D(Tn,pt,K.internalformat,K.width>>pt,K.height>>pt,0,K.internalformat,K.type,null);else for(var Ct=0;Ct<6;++Ct)sr.texImage2D(Qn+Ct,pt,K.internalformat,K.width>>pt,K.height>>pt,0,K.internalformat,K.type,null);lc(K.texInfo,K.target)})}function zs(){for(var W=0;W<nu;++W){var et=Cu[W];et&&(et.bindCount=0,et.unit=-1,Cu[W]=null),sr.activeTexture(Zu+W),sr.bindTexture(Tn,null),sr.bindTexture(ta,null)}}return{create2D:Bc,createCube:Ho,clear:Fs,getTexture:function(W){return null},restore:kl,refresh:zs}}var Gl=36161,yc=32854,Jc=32855,ps=36194,Dc=33189,Fh=36168,sh=34041,xc=35907,lh=34836,Wl=34842,uh=34843,Il=[];Il[yc]=2,Il[Jc]=2,Il[ps]=2,Il[Dc]=2,Il[Fh]=1,Il[sh]=4,Il[xc]=4,Il[lh]=16,Il[Wl]=8,Il[uh]=6;function Zl(sr,fn,gn){return Il[sr]*fn*gn}var Ru=function(sr,fn,gn,ha,Ta){var ka={rgba4:yc,rgb565:ps,"rgb5 a1":Jc,depth:Dc,stencil:Fh,"depth stencil":sh};fn.ext_srgb&&(ka.srgba=xc),fn.ext_color_buffer_half_float&&(ka.rgba16f=Wl,ka.rgb16f=uh),fn.webgl_color_buffer_float&&(ka.rgba32f=lh);var Cn=[];Object.keys(ka).forEach(function(Ha){var Ca=ka[Ha];Cn[Ca]=Ha});var ia=0,qa={};function Ra(Ha){this.id=ia++,this.refCount=1,this.renderbuffer=Ha,this.format=yc,this.width=0,this.height=0,Ta.profile&&(this.stats={size:0})}Ra.prototype.decRef=function(){--this.refCount<=0&&ei(this)};function ei(Ha){var Ca=Ha.renderbuffer;sr.bindRenderbuffer(Gl,null),sr.deleteRenderbuffer(Ca),Ha.renderbuffer=null,Ha.refCount=0,delete qa[Ha.id],ha.renderbufferCount--}function Ii(Ha,Ca){var Wn=new Ra(sr.createRenderbuffer());qa[Wn.id]=Wn,ha.renderbufferCount++;function fa(Aa,xa){var Ti=0,fi=0,_i=yc;if(typeof Aa=="object"&&Aa){var Ia=Aa;if("shape"in Ia){var Ma=Ia.shape;Ti=Ma[0]|0,fi=Ma[1]|0}else"radius"in Ia&&(Ti=fi=Ia.radius|0),"width"in Ia&&(Ti=Ia.width|0),"height"in Ia&&(fi=Ia.height|0);"format"in Ia&&(_i=ka[Ia.format])}else typeof Aa=="number"?(Ti=Aa|0,typeof xa=="number"?fi=xa|0:fi=Ti):Aa||(Ti=fi=1);if(!(Ti===Wn.width&&fi===Wn.height&&_i===Wn.format))return fa.width=Wn.width=Ti,fa.height=Wn.height=fi,Wn.format=_i,sr.bindRenderbuffer(Gl,Wn.renderbuffer),sr.renderbufferStorage(Gl,_i,Ti,fi),Ta.profile&&(Wn.stats.size=Zl(Wn.format,Wn.width,Wn.height)),fa.format=Cn[Wn.format],fa}function Ga(Aa,xa){var Ti=Aa|0,fi=xa|0||Ti;return Ti===Wn.width&&fi===Wn.height||(fa.width=Wn.width=Ti,fa.height=Wn.height=fi,sr.bindRenderbuffer(Gl,Wn.renderbuffer),sr.renderbufferStorage(Gl,Wn.format,Ti,fi),Ta.profile&&(Wn.stats.size=Zl(Wn.format,Wn.width,Wn.height))),fa}return fa(Ha,Ca),fa.resize=Ga,fa._reglType="renderbuffer",fa._renderbuffer=Wn,Ta.profile&&(fa.stats=Wn.stats),fa.destroy=function(){Wn.decRef()},fa}Ta.profile&&(ha.getTotalRenderbufferSize=function(){var Ha=0;return Object.keys(qa).forEach(function(Ca){Ha+=qa[Ca].stats.size}),Ha});function wi(){he(qa).forEach(function(Ha){Ha.renderbuffer=sr.createRenderbuffer(),sr.bindRenderbuffer(Gl,Ha.renderbuffer),sr.renderbufferStorage(Gl,Ha.format,Ha.width,Ha.height)}),sr.bindRenderbuffer(Gl,null)}return{create:Ii,clear:function(){he(qa).forEach(ei)},restore:wi}},Xs=36160,Qu=36161,yu=3553,Xl=34069,Ds=36064,gc=36096,Su=36128,Yu=33306,_c=36193,bh=5121,Zh=5126,ac=6407,bc=6408,Ll=[];Ll[bc]=4,Ll[ac]=3;var zc=[];zc[bh]=1,zc[Zh]=4,zc[_c]=2;function $l(sr,fn,gn,ha,Ta,ka){var Cn={cur:null,next:null,dirty:!1,setFBO:null},ia=["rgba"],qa=["rgba4","rgb565","rgb5 a1"];fn.ext_srgb&&qa.push("srgba"),fn.ext_color_buffer_half_float&&qa.push("rgba16f","rgb16f"),fn.webgl_color_buffer_float&&qa.push("rgba32f");var Ra=["uint8"];fn.oes_texture_half_float&&Ra.push("half float","float16"),fn.oes_texture_float&&Ra.push("float","float32");function ei(Wa,Qa,xi){this.target=Wa,this.texture=Qa,this.renderbuffer=xi;var Wo=0,zo=0;Qa?(Wo=Qa.width,zo=Qa.height):xi&&(Wo=xi.width,zo=xi.height),this.width=Wo,this.height=zo}function Ii(Wa){Wa&&(Wa.texture&&Wa.texture._texture.decRef(),Wa.renderbuffer&&Wa.renderbuffer._renderbuffer.decRef())}function wi(Wa,Qa,xi){if(Wa)if(Wa.texture){var Wo=Wa.texture._texture;Math.max(1,Wo.width),Math.max(1,Wo.height),Wo.refCount+=1}else{var zo=Wa.renderbuffer._renderbuffer;zo.refCount+=1}}function Ha(Wa,Qa){Qa&&(Qa.texture?sr.framebufferTexture2D(Xs,Wa,Qa.target,Qa.texture._texture.texture,0):sr.framebufferRenderbuffer(Xs,Wa,Qu,Qa.renderbuffer._renderbuffer.renderbuffer))}function Ca(Wa){var Qa=yu,xi=null,Wo=null,zo=Wa;typeof Wa=="object"&&(zo=Wa.data,"target"in Wa&&(Qa=Wa.target|0));var mi=zo._reglType;return mi==="texture2d"||mi==="textureCube"?xi=zo:mi==="renderbuffer"&&(Wo=zo,Qa=Qu),new ei(Qa,xi,Wo)}function Wn(Wa,Qa,xi,Wo,zo){if(xi){var mi=ha.create2D({width:Wa,height:Qa,format:Wo,type:zo});return mi._texture.refCount=0,new ei(yu,mi,null)}else{var Li=Ta.create({width:Wa,height:Qa,format:Wo});return Li._renderbuffer.refCount=0,new ei(Qu,null,Li)}}function fa(Wa){return Wa&&(Wa.texture||Wa.renderbuffer)}function Ga(Wa,Qa,xi){Wa&&(Wa.texture?Wa.texture.resize(Qa,xi):Wa.renderbuffer&&Wa.renderbuffer.resize(Qa,xi),Wa.width=Qa,Wa.height=xi)}var Aa=0,xa={};function Ti(){this.id=Aa++,xa[this.id]=this,this.framebuffer=sr.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function fi(Wa){Wa.colorAttachments.forEach(Ii),Ii(Wa.depthAttachment),Ii(Wa.stencilAttachment),Ii(Wa.depthStencilAttachment)}function _i(Wa){var Qa=Wa.framebuffer;sr.deleteFramebuffer(Qa),Wa.framebuffer=null,ka.framebufferCount--,delete xa[Wa.id]}function Ia(Wa){var Qa;sr.bindFramebuffer(Xs,Wa.framebuffer);var xi=Wa.colorAttachments;for(Qa=0;Qa<xi.length;++Qa)Ha(Ds+Qa,xi[Qa]);for(Qa=xi.length;Qa<gn.maxColorAttachments;++Qa)sr.framebufferTexture2D(Xs,Ds+Qa,yu,null,0);sr.framebufferTexture2D(Xs,Yu,yu,null,0),sr.framebufferTexture2D(Xs,gc,yu,null,0),sr.framebufferTexture2D(Xs,Su,yu,null,0),Ha(gc,Wa.depthAttachment),Ha(Su,Wa.stencilAttachment),Ha(Yu,Wa.depthStencilAttachment),sr.checkFramebufferStatus(Xs),sr.isContextLost(),sr.bindFramebuffer(Xs,Cn.next?Cn.next.framebuffer:null),Cn.cur=Cn.next,sr.getError()}function Ma(Wa,Qa){var xi=new Ti;ka.framebufferCount++;function Wo(mi,Li){var mo,Oo=0,ss=0,ml=!0,Gs=!0,ws=null,ru=!0,al="rgba",Tu="uint8",lc=1,Fc=null,Lu=null,nu=null,Cu=!1;if(typeof mi=="number")Oo=mi|0,ss=Li|0||Oo;else if(!mi)Oo=ss=1;else{var Xo=mi;if("shape"in Xo){var uu=Xo.shape;Oo=uu[0],ss=uu[1]}else"radius"in Xo&&(Oo=ss=Xo.radius),"width"in Xo&&(Oo=Xo.width),"height"in Xo&&(ss=Xo.height);("color"in Xo||"colors"in Xo)&&(ws=Xo.color||Xo.colors,Array.isArray(ws)),ws||("colorCount"in Xo&&(lc=Xo.colorCount|0),"colorTexture"in Xo&&(ru=!!Xo.colorTexture,al="rgba4"),"colorType"in Xo&&(Tu=Xo.colorType,ru||(Tu==="half float"||Tu==="float16"?al="rgba16f":(Tu==="float"||Tu==="float32")&&(al="rgba32f"))),"colorFormat"in Xo&&(al=Xo.colorFormat,ia.indexOf(al)>=0?ru=!0:qa.indexOf(al)>=0&&(ru=!1))),("depthTexture"in Xo||"depthStencilTexture"in Xo)&&(Cu=!!(Xo.depthTexture||Xo.depthStencilTexture)),"depth"in Xo&&(typeof Xo.depth=="boolean"?ml=Xo.depth:(Fc=Xo.depth,Gs=!1)),"stencil"in Xo&&(typeof Xo.stencil=="boolean"?Gs=Xo.stencil:(Lu=Xo.stencil,ml=!1)),"depthStencil"in Xo&&(typeof Xo.depthStencil=="boolean"?ml=Gs=Xo.depthStencil:(nu=Xo.depthStencil,ml=!1,Gs=!1))}var tl=null,au=null,Bc=null,Ho=null;if(Array.isArray(ws))tl=ws.map(Ca);else if(ws)tl=[Ca(ws)];else for(tl=new Array(lc),mo=0;mo<lc;++mo)tl[mo]=Wn(Oo,ss,ru,al,Tu);for(Oo=Oo||tl[0].width,ss=ss||tl[0].height,Fc?au=Ca(Fc):ml&&!Gs&&(au=Wn(Oo,ss,Cu,"depth","uint32")),Lu?Bc=Ca(Lu):Gs&&!ml&&(Bc=Wn(Oo,ss,!1,"stencil","uint8")),nu?Ho=Ca(nu):!Fc&&!Lu&&Gs&&ml&&(Ho=Wn(Oo,ss,Cu,"depth stencil","depth stencil")),mo=0;mo<tl.length;++mo)wi(tl[mo]),tl[mo]&&tl[mo].texture&&Ll[tl[mo].texture._texture.format]*zc[tl[mo].texture._texture.type];return wi(au),wi(Bc),wi(Ho),fi(xi),xi.width=Oo,xi.height=ss,xi.colorAttachments=tl,xi.depthAttachment=au,xi.stencilAttachment=Bc,xi.depthStencilAttachment=Ho,Wo.color=tl.map(fa),Wo.depth=fa(au),Wo.stencil=fa(Bc),Wo.depthStencil=fa(Ho),Wo.width=xi.width,Wo.height=xi.height,Ia(xi),Wo}function zo(mi,Li){var mo=Math.max(mi|0,1),Oo=Math.max(Li|0||mo,1);if(mo===xi.width&&Oo===xi.height)return Wo;for(var ss=xi.colorAttachments,ml=0;ml<ss.length;++ml)Ga(ss[ml],mo,Oo);return Ga(xi.depthAttachment,mo,Oo),Ga(xi.stencilAttachment,mo,Oo),Ga(xi.depthStencilAttachment,mo,Oo),xi.width=Wo.width=mo,xi.height=Wo.height=Oo,Ia(xi),Wo}return Wo(Wa,Qa),c(Wo,{resize:zo,_reglType:"framebuffer",_framebuffer:xi,destroy:function(){_i(xi),fi(xi)},use:function(mi){Cn.setFBO({framebuffer:Wo},mi)}})}function ki(Wa){var Qa=Array(6);function xi(zo){var mi,Li={color:null},mo=0,Oo=null,ss="rgba",ml="uint8",Gs=1;if(typeof zo=="number")mo=zo|0;else if(!zo)mo=1;else{var ws=zo;if("shape"in ws){var ru=ws.shape;mo=ru[0]}else"radius"in ws&&(mo=ws.radius|0),"width"in ws?(mo=ws.width|0,"height"in ws):"height"in ws&&(mo=ws.height|0);("color"in ws||"colors"in ws)&&(Oo=ws.color||ws.colors,Array.isArray(Oo)),Oo||("colorCount"in ws&&(Gs=ws.colorCount|0),"colorType"in ws&&(ml=ws.colorType),"colorFormat"in ws&&(ss=ws.colorFormat)),"depth"in ws&&(Li.depth=ws.depth),"stencil"in ws&&(Li.stencil=ws.stencil),"depthStencil"in ws&&(Li.depthStencil=ws.depthStencil)}var al;if(Oo)if(Array.isArray(Oo))for(al=[],mi=0;mi<Oo.length;++mi)al[mi]=Oo[mi];else al=[Oo];else{al=Array(Gs);var Tu={radius:mo,format:ss,type:ml};for(mi=0;mi<Gs;++mi)al[mi]=ha.createCube(Tu)}for(Li.color=Array(al.length),mi=0;mi<al.length;++mi){var lc=al[mi];mo=mo||lc.width,Li.color[mi]={target:Xl,data:al[mi]}}for(mi=0;mi<6;++mi){for(var Fc=0;Fc<al.length;++Fc)Li.color[Fc].target=Xl+mi;mi>0&&(Li.depth=Qa[0].depth,Li.stencil=Qa[0].stencil,Li.depthStencil=Qa[0].depthStencil),Qa[mi]?Qa[mi](Li):Qa[mi]=Ma(Li)}return c(xi,{width:mo,height:mo,color:al})}function Wo(zo){var mi,Li=zo|0;if(Li===xi.width)return xi;var mo=xi.color;for(mi=0;mi<mo.length;++mi)mo[mi].resize(Li);for(mi=0;mi<6;++mi)Qa[mi].resize(Li);return xi.width=xi.height=Li,xi}return xi(Wa),c(xi,{faces:Qa,resize:Wo,_reglType:"framebufferCube",destroy:function(){Qa.forEach(function(zo){zo.destroy()})}})}function hi(){Cn.cur=null,Cn.next=null,Cn.dirty=!0,he(xa).forEach(function(Wa){Wa.framebuffer=sr.createFramebuffer(),Ia(Wa)})}return c(Cn,{getFramebuffer:function(Wa){if(typeof Wa=="function"&&Wa._reglType==="framebuffer"){var Qa=Wa._framebuffer;if(Qa instanceof Ti)return Qa}return null},create:Ma,createCube:ki,clear:function(){he(xa).forEach(_i)},restore:hi})}var ic=5126,Oc=34962,Ku=34963;function Os(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=ic,this.offset=0,this.stride=0,this.divisor=0}function Eu(sr,fn,gn,ha,Ta,ka,Cn){for(var ia=gn.maxAttributes,qa=new Array(ia),Ra=0;Ra<ia;++Ra)qa[Ra]=new Os;var ei=0,Ii={},wi={Record:Os,scope:{},state:qa,currentVAO:null,targetVAO:null,restore:Ca()?fi:function(){},createVAO:_i,getVAO:fa,destroyBuffer:Ha,setVAO:Ca()?Ga:Aa,clear:Ca()?xa:function(){}};function Ha(Ia){for(var Ma=0;Ma<qa.length;++Ma){var ki=qa[Ma];ki.buffer===Ia&&(sr.disableVertexAttribArray(Ma),ki.buffer=null)}}function Ca(){return fn.oes_vertex_array_object}function Wn(){return fn.angle_instanced_arrays}function fa(Ia){return typeof Ia=="function"&&Ia._vao?Ia._vao:null}function Ga(Ia){if(Ia!==wi.currentVAO){var Ma=Ca();Ia?Ma.bindVertexArrayOES(Ia.vao):Ma.bindVertexArrayOES(null),wi.currentVAO=Ia}}function Aa(Ia){if(Ia!==wi.currentVAO){if(Ia)Ia.bindAttrs();else{for(var Ma=Wn(),ki=0;ki<qa.length;++ki){var hi=qa[ki];hi.buffer?(sr.enableVertexAttribArray(ki),hi.buffer.bind(),sr.vertexAttribPointer(ki,hi.size,hi.type,hi.normalized,hi.stride,hi.offfset),Ma&&hi.divisor&&Ma.vertexAttribDivisorANGLE(ki,hi.divisor)):(sr.disableVertexAttribArray(ki),sr.vertexAttrib4f(ki,hi.x,hi.y,hi.z,hi.w))}Cn.elements?sr.bindBuffer(Ku,Cn.elements.buffer.buffer):sr.bindBuffer(Ku,null)}wi.currentVAO=Ia}}function xa(){he(Ii).forEach(function(Ia){Ia.destroy()})}function Ti(){this.id=++ei,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var Ia=Ca();Ia?this.vao=Ia.createVertexArrayOES():this.vao=null,Ii[this.id]=this,this.buffers=[]}Ti.prototype.bindAttrs=function(){for(var Ia=Wn(),Ma=this.attributes,ki=0;ki<Ma.length;++ki){var hi=Ma[ki];hi.buffer?(sr.enableVertexAttribArray(ki),sr.bindBuffer(Oc,hi.buffer.buffer),sr.vertexAttribPointer(ki,hi.size,hi.type,hi.normalized,hi.stride,hi.offset),Ia&&hi.divisor&&Ia.vertexAttribDivisorANGLE(ki,hi.divisor)):(sr.disableVertexAttribArray(ki),sr.vertexAttrib4f(ki,hi.x,hi.y,hi.z,hi.w))}for(var Wa=Ma.length;Wa<ia;++Wa)sr.disableVertexAttribArray(Wa);var Qa=ka.getElements(this.elements);Qa?sr.bindBuffer(Ku,Qa.buffer.buffer):sr.bindBuffer(Ku,null)},Ti.prototype.refresh=function(){var Ia=Ca();Ia&&(Ia.bindVertexArrayOES(this.vao),this.bindAttrs(),wi.currentVAO=null,Ia.bindVertexArrayOES(null))},Ti.prototype.destroy=function(){if(this.vao){var Ia=Ca();this===wi.currentVAO&&(wi.currentVAO=null,Ia.bindVertexArrayOES(null)),Ia.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),Ii[this.id]&&(delete Ii[this.id],ha.vaoCount-=1)};function fi(){var Ia=Ca();Ia&&he(Ii).forEach(function(Ma){Ma.refresh()})}function _i(Ia){var Ma=new Ti;ha.vaoCount+=1;function ki(hi){var Wa;if(Array.isArray(hi))Wa=hi,Ma.elements&&Ma.ownsElements&&Ma.elements.destroy(),Ma.elements=null,Ma.ownsElements=!1,Ma.offset=0,Ma.count=0,Ma.instances=-1,Ma.primitive=4;else{if(hi.elements){var Qa=hi.elements;Ma.ownsElements?typeof Qa=="function"&&Qa._reglType==="elements"?(Ma.elements.destroy(),Ma.ownsElements=!1):(Ma.elements(Qa),Ma.ownsElements=!1):ka.getElements(hi.elements)?(Ma.elements=hi.elements,Ma.ownsElements=!1):(Ma.elements=ka.create(hi.elements),Ma.ownsElements=!0)}else Ma.elements=null,Ma.ownsElements=!1;Wa=hi.attributes,Ma.offset=0,Ma.count=-1,Ma.instances=-1,Ma.primitive=4,Ma.elements&&(Ma.count=Ma.elements._elements.vertCount,Ma.primitive=Ma.elements._elements.primType),"offset"in hi&&(Ma.offset=hi.offset|0),"count"in hi&&(Ma.count=hi.count|0),"instances"in hi&&(Ma.instances=hi.instances|0),"primitive"in hi&&(Ma.primitive=ue[hi.primitive])}var xi={},Wo=Ma.attributes;Wo.length=Wa.length;for(var zo=0;zo<Wa.length;++zo){var mi=Wa[zo],Li=Wo[zo]=new Os,mo=mi.data||mi;if(Array.isArray(mo)||Lr(mo)||kr(mo)){var Oo;Ma.buffers[zo]&&(Oo=Ma.buffers[zo],Lr(mo)&&Oo._buffer.byteLength>=mo.byteLength?Oo.subdata(mo):(Oo.destroy(),Ma.buffers[zo]=null)),Ma.buffers[zo]||(Oo=Ma.buffers[zo]=Ta.create(mi,Oc,!1,!0)),Li.buffer=Ta.getBuffer(Oo),Li.size=Li.buffer.dimension|0,Li.normalized=!1,Li.type=Li.buffer.dtype,Li.offset=0,Li.stride=0,Li.divisor=0,Li.state=1,xi[zo]=1}else Ta.getBuffer(mi)?(Li.buffer=Ta.getBuffer(mi),Li.size=Li.buffer.dimension|0,Li.normalized=!1,Li.type=Li.buffer.dtype,Li.offset=0,Li.stride=0,Li.divisor=0,Li.state=1):Ta.getBuffer(mi.buffer)?(Li.buffer=Ta.getBuffer(mi.buffer),Li.size=(+mi.size||Li.buffer.dimension)|0,Li.normalized=!!mi.normalized||!1,"type"in mi?Li.type=ln[mi.type]:Li.type=Li.buffer.dtype,Li.offset=(mi.offset||0)|0,Li.stride=(mi.stride||0)|0,Li.divisor=(mi.divisor||0)|0,Li.state=1):"x"in mi&&(Li.x=+mi.x||0,Li.y=+mi.y||0,Li.z=+mi.z||0,Li.w=+mi.w||0,Li.state=2)}for(var ss=0;ss<Ma.buffers.length;++ss)!xi[ss]&&Ma.buffers[ss]&&(Ma.buffers[ss].destroy(),Ma.buffers[ss]=null);return Ma.refresh(),ki}return ki.destroy=function(){for(var hi=0;hi<Ma.buffers.length;++hi)Ma.buffers[hi]&&Ma.buffers[hi].destroy();Ma.buffers.length=0,Ma.ownsElements&&(Ma.elements.destroy(),Ma.elements=null,Ma.ownsElements=!1),Ma.destroy()},ki._vao=Ma,ki._reglType="vao",ki(Ia)}return wi}var Jl=35632,ch=35633,Ps=35718,mc=35721;function ju(sr,fn,gn,ha){var Ta={},ka={};function Cn(Wn,fa,Ga,Aa){this.name=Wn,this.id=fa,this.location=Ga,this.info=Aa}function ia(Wn,fa){for(var Ga=0;Ga<Wn.length;++Ga)if(Wn[Ga].id===fa.id){Wn[Ga].location=fa.location;return}Wn.push(fa)}function qa(Wn,fa,Ga){var Aa=Wn===Jl?Ta:ka,xa=Aa[fa];if(!xa){var Ti=fn.str(fa);xa=sr.createShader(Wn),sr.shaderSource(xa,Ti),sr.compileShader(xa),Aa[fa]=xa}return xa}var Ra={},ei=[],Ii=0;function wi(Wn,fa){this.id=Ii++,this.fragId=Wn,this.vertId=fa,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,ha.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function Ha(Wn,fa,Ga){var Aa,xa,Ti=qa(Jl,Wn.fragId),fi=qa(ch,Wn.vertId),_i=Wn.program=sr.createProgram();if(sr.attachShader(_i,Ti),sr.attachShader(_i,fi),Ga)for(Aa=0;Aa<Ga.length;++Aa){var Ia=Ga[Aa];sr.bindAttribLocation(_i,Ia[0],Ia[1])}sr.linkProgram(_i);var Ma=sr.getProgramParameter(_i,Ps);ha.profile&&(Wn.stats.uniformsCount=Ma);var ki=Wn.uniforms;for(Aa=0;Aa<Ma;++Aa)if(xa=sr.getActiveUniform(_i,Aa),xa)if(xa.size>1)for(var hi=0;hi<xa.size;++hi){var Wa=xa.name.replace("[0]","["+hi+"]");ia(ki,new Cn(Wa,fn.id(Wa),sr.getUniformLocation(_i,Wa),xa))}else ia(ki,new Cn(xa.name,fn.id(xa.name),sr.getUniformLocation(_i,xa.name),xa));var Qa=sr.getProgramParameter(_i,mc);ha.profile&&(Wn.stats.attributesCount=Qa);var xi=Wn.attributes;for(Aa=0;Aa<Qa;++Aa)xa=sr.getActiveAttrib(_i,Aa),xa&&ia(xi,new Cn(xa.name,fn.id(xa.name),sr.getAttribLocation(_i,xa.name),xa))}ha.profile&&(gn.getMaxUniformsCount=function(){var Wn=0;return ei.forEach(function(fa){fa.stats.uniformsCount>Wn&&(Wn=fa.stats.uniformsCount)}),Wn},gn.getMaxAttributesCount=function(){var Wn=0;return ei.forEach(function(fa){fa.stats.attributesCount>Wn&&(Wn=fa.stats.attributesCount)}),Wn});function Ca(){Ta={},ka={};for(var Wn=0;Wn<ei.length;++Wn)Ha(ei[Wn],null,ei[Wn].attributes.map(function(fa){return[fa.location,fa.name]}))}return{clear:function(){var Wn=sr.deleteShader.bind(sr);he(Ta).forEach(Wn),Ta={},he(ka).forEach(Wn),ka={},ei.forEach(function(fa){sr.deleteProgram(fa.program)}),ei.length=0,Ra={},gn.shaderCount=0},program:function(Wn,fa,Ga,Aa){var xa=Ra[fa];xa||(xa=Ra[fa]={});var Ti=xa[Wn];if(Ti&&(Ti.refCount++,!Aa))return Ti;var fi=new wi(fa,Wn);return gn.shaderCount++,Ha(fi,Ga,Aa),Ti||(xa[Wn]=fi),ei.push(fi),c(fi,{destroy:function(){if(fi.refCount--,fi.refCount<=0){sr.deleteProgram(fi.program);var _i=ei.indexOf(fi);ei.splice(_i,1),gn.shaderCount--}xa[fi.vertId].refCount<=0&&(sr.deleteShader(ka[fi.vertId]),delete ka[fi.vertId],delete Ra[fi.fragId][fi.vertId]),Object.keys(Ra[fi.fragId]).length||(sr.deleteShader(Ta[fi.fragId]),delete Ta[fi.fragId],delete Ra[fi.fragId])}})},restore:Ca,shader:qa,frag:-1,vert:-1}}var Ql=6408,oc=5121,Nu=3333,vc=5126;function wh(sr,fn,gn,ha,Ta,ka,Cn){function ia(ei){var Ii;fn.next===null?Ii=oc:Ii=fn.next.colorAttachments[0].texture._texture.type;var wi=0,Ha=0,Ca=ha.framebufferWidth,Wn=ha.framebufferHeight,fa=null;Lr(ei)?fa=ei:ei&&(wi=ei.x|0,Ha=ei.y|0,Ca=(ei.width||ha.framebufferWidth-wi)|0,Wn=(ei.height||ha.framebufferHeight-Ha)|0,fa=ei.data||null),gn();var Ga=Ca*Wn*4;return fa||(Ii===oc?fa=new Uint8Array(Ga):Ii===vc&&(fa=fa||new Float32Array(Ga))),sr.pixelStorei(Nu,4),sr.readPixels(wi,Ha,Ca,Wn,Ql,Ii,fa),fa}function qa(ei){var Ii;return fn.setFBO({framebuffer:ei.framebuffer},function(){Ii=ia(ei)}),Ii}function Ra(ei){return!ei||!("framebuffer"in ei)?ia(ei):qa(ei)}return Ra}function cl(sr){return Yl(Qc(Pu(sr)))}function Qc(sr){return Vs(un(xu(sr),sr.length*8))}function Yl(sr){for(var fn="0123456789abcdef",gn="",ha,Ta=0;Ta<sr.length;Ta++)ha=sr.charCodeAt(Ta),gn+=fn.charAt(ha>>>4&15)+fn.charAt(ha&15);return gn}function Pu(sr){for(var fn="",gn=-1,ha,Ta;++gn<sr.length;)ha=sr.charCodeAt(gn),Ta=gn+1<sr.length?sr.charCodeAt(gn+1):0,55296<=ha&&ha<=56319&&56320<=Ta&&Ta<=57343&&(ha=65536+((ha&1023)<<10)+(Ta&1023),gn++),ha<=127?fn+=String.fromCharCode(ha):ha<=2047?fn+=String.fromCharCode(192|ha>>>6&31,128|ha&63):ha<=65535?fn+=String.fromCharCode(224|ha>>>12&15,128|ha>>>6&63,128|ha&63):ha<=2097151&&(fn+=String.fromCharCode(240|ha>>>18&7,128|ha>>>12&63,128|ha>>>6&63,128|ha&63));return fn}function xu(sr){for(var fn=Array(sr.length>>2),gn=0;gn<fn.length;gn++)fn[gn]=0;for(var gn=0;gn<sr.length*8;gn+=8)fn[gn>>5]|=(sr.charCodeAt(gn/8)&255)<<24-gn%32;return fn}function Vs(sr){for(var fn="",gn=0;gn<sr.length*32;gn+=8)fn+=String.fromCharCode(sr[gn>>5]>>>24-gn%32&255);return fn}function qs(sr,fn){return sr>>>fn|sr<<32-fn}function Iu(sr,fn){return sr>>>fn}function sc(sr,fn,gn){return sr&fn^~sr&gn}function _u(sr,fn,gn){return sr&fn^sr&gn^fn&gn}function wc(sr){return qs(sr,2)^qs(sr,13)^qs(sr,22)}function Ve(sr){return qs(sr,6)^qs(sr,11)^qs(sr,25)}function lr(sr){return qs(sr,7)^qs(sr,18)^Iu(sr,3)}function Ur(sr){return qs(sr,17)^qs(sr,19)^Iu(sr,10)}var Or=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function un(sr,fn){var gn=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ha=new Array(64),Ta,ka,Cn,ia,qa,Ra,ei,Ii,wi,Ha,Ca,Wn;for(sr[fn>>5]|=128<<24-fn%32,sr[(fn+64>>9<<4)+15]=fn,wi=0;wi<sr.length;wi+=16){for(Ta=gn[0],ka=gn[1],Cn=gn[2],ia=gn[3],qa=gn[4],Ra=gn[5],ei=gn[6],Ii=gn[7],Ha=0;Ha<64;Ha++)Ha<16?ha[Ha]=sr[Ha+wi]:ha[Ha]=Ln(Ln(Ln(Ur(ha[Ha-2]),ha[Ha-7]),lr(ha[Ha-15])),ha[Ha-16]),Ca=Ln(Ln(Ln(Ln(Ii,Ve(qa)),sc(qa,Ra,ei)),Or[Ha]),ha[Ha]),Wn=Ln(wc(Ta),_u(Ta,ka,Cn)),Ii=ei,ei=Ra,Ra=qa,qa=Ln(ia,Ca),ia=Cn,Cn=ka,ka=Ta,Ta=Ln(Ca,Wn);gn[0]=Ln(Ta,gn[0]),gn[1]=Ln(ka,gn[1]),gn[2]=Ln(Cn,gn[2]),gn[3]=Ln(ia,gn[3]),gn[4]=Ln(qa,gn[4]),gn[5]=Ln(Ra,gn[5]),gn[6]=Ln(ei,gn[6]),gn[7]=Ln(Ii,gn[7])}return gn}function Ln(sr,fn){var gn=(sr&65535)+(fn&65535),ha=(sr>>16)+(fn>>16)+(gn>>16);return ha<<16|gn&65535}function Gn(sr){return Array.prototype.slice.call(sr)}function oa(sr){return Gn(sr).join("")}function ya(sr){var fn=sr&&sr.cache,gn=0,ha=[],Ta=[],ka=[];function Cn(Ca,Wn){var fa=Wn&&Wn.stable;if(!fa){for(var Ga=0;Ga<Ta.length;++Ga)if(Ta[Ga]===Ca&&!ka[Ga])return ha[Ga]}var Aa="g"+gn++;return ha.push(Aa),Ta.push(Ca),ka.push(fa),Aa}function ia(){var Ca=[];function Wn(){Ca.push.apply(Ca,Gn(arguments))}var fa=[];function Ga(){var Aa="v"+gn++;return fa.push(Aa),arguments.length>0&&(Ca.push(Aa,"="),Ca.push.apply(Ca,Gn(arguments)),Ca.push(";")),Aa}return c(Wn,{def:Ga,toString:function(){return oa([fa.length>0?"var "+fa.join(",")+";":"",oa(Ca)])}})}function qa(){var Ca=ia(),Wn=ia(),fa=Ca.toString,Ga=Wn.toString;function Aa(xa,Ti){Wn(xa,Ti,"=",Ca.def(xa,Ti),";")}return c(function(){Ca.apply(Ca,Gn(arguments))},{def:Ca.def,entry:Ca,exit:Wn,save:Aa,set:function(xa,Ti,fi){Aa(xa,Ti),Ca(xa,Ti,"=",fi,";")},toString:function(){return fa()+Ga()}})}function Ra(){var Ca=oa(arguments),Wn=qa(),fa=qa(),Ga=Wn.toString,Aa=fa.toString;return c(Wn,{then:function(){return Wn.apply(Wn,Gn(arguments)),this},else:function(){return fa.apply(fa,Gn(arguments)),this},toString:function(){var xa=Aa();return xa&&(xa="else{"+xa+"}"),oa(["if(",Ca,"){",Ga(),"}",xa])}})}var ei=ia(),Ii={};function wi(Ca,Wn){var fa=[];function Ga(){var _i="a"+fa.length;return fa.push(_i),_i}Wn=Wn||0;for(var Aa=0;Aa<Wn;++Aa)Ga();var xa=qa(),Ti=xa.toString,fi=Ii[Ca]=c(xa,{arg:Ga,toString:function(){return oa(["function(",fa.join(),"){",Ti(),"}"])}});return fi}function Ha(){var Ca=['"use strict";',ei,"return {"];Object.keys(Ii).forEach(function(Aa){Ca.push('"',Aa,'":',Ii[Aa].toString(),",")}),Ca.push("}");var Wn=oa(Ca).replace(/;/g,`;
|
||
`).replace(/}/g,`}
|
||
`).replace(/{/g,`{
|
||
`),fa;if(fn&&(fa=cl(Wn),fn[fa]))return fn[fa].apply(null,Ta);var Ga=Function.apply(null,ha.concat(Wn));return fn&&(fn[fa]=Ga),Ga.apply(null,Ta)}return{global:ei,link:Cn,block:ia,proc:wi,scope:qa,cond:Ra,compile:Ha}}var Pa="xyzw".split(""),Jn=5121,va=1,sa=2,qn=0,Fa=1,Fi=2,Ei=3,Ni=4,Hi=5,Ba=6,ba="dither",$i="blend.enable",So="blend.color",Jo="blend.equation",As="blend.func",os="depth.enable",xs="depth.func",No="depth.range",Qs="depth.mask",Hs="colorMask",Ms="cull.enable",ni="cull.face",to="frontFace",ds="lineWidth",Qo="polygonOffset.enable",Tl="polygonOffset.offset",Kl="sample.alpha",Fl="sample.enable",tc="sample.coverage",tu="stencil.enable",Uu="stencil.mask",$s="stencil.func",ec="stencil.opFront",Ri="stencil.opBack",oo="scissor.enable",bu="scissor.box",Cl="viewport",Th="profile",Lt="framebuffer",P="vert",at="frag",_t="elements",Tt="primitive",Pt="count",ie="offset",de="instances",Ee="vao",He="Width",ar="Height",ir=Lt+He,zr=Lt+ar,Zr=Cl+He,Rt=Cl+ar,Gt="drawingBuffer",ne=Gt+He,oe=Gt+ar,be=[As,Jo,$s,ec,Ri,tc,Cl,bu,Tl],pe=34962,Ae=34963,Xe=2884,nr=3042,or=3024,Tr=2960,Rr=2929,Qr=3089,nn=32823,mn=32926,zn=32928,na=5126,Yn=35664,la=35665,Na=35666,li=5124,Ka=35667,Gi=35668,jo=35669,Uo=35670,ho=35671,Go=35672,js=35673,Is=35674,bo=35675,wo=35676,nl=35678,dl=35680,lu=4,mt=1028,St=1029,Xt=2304,se=2305,fe=32775,ve=32776,De=519,Ce=7680,Qe=0,Mr=1,br=32774,jr=513,Yr=36160,tn=36064,Rn={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},sn={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Mn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},In={cw:Xt,ccw:se};function Dn(sr){return Array.isArray(sr)||Lr(sr)||kr(sr)}function jn(sr){return sr.sort(function(fn,gn){return fn===Cl?-1:gn===Cl?1:fn<gn?-1:1})}function xn(sr,fn,gn,ha){this.thisDep=sr,this.contextDep=fn,this.propDep=gn,this.append=ha}function _a(sr){return sr&&!(sr.thisDep||sr.contextDep||sr.propDep)}function La(sr){return new xn(!1,!1,!1,sr)}function $a(sr,fn){var gn=sr.type;if(gn===qn){var ha=sr.data.length;return new xn(!0,ha>=1,ha>=2,fn)}else if(gn===Ni){var Ta=sr.data;return new xn(Ta.thisDep,Ta.contextDep,Ta.propDep,fn)}else{if(gn===Hi)return new xn(!1,!1,!1,fn);if(gn===Ba){for(var ka=!1,Cn=!1,ia=!1,qa=0;qa<sr.data.length;++qa){var Ra=sr.data[qa];if(Ra.type===Fa)ia=!0;else if(Ra.type===Fi)Cn=!0;else if(Ra.type===Ei)ka=!0;else if(Ra.type===qn){ka=!0;var ei=Ra.data;ei>=1&&(Cn=!0),ei>=2&&(ia=!0)}else Ra.type===Ni&&(ka=ka||Ra.data.thisDep,Cn=Cn||Ra.data.contextDep,ia=ia||Ra.data.propDep)}return new xn(ka,Cn,ia,fn)}else return new xn(gn===Ei,gn===Fi,gn===Fa,fn)}}var ti=new xn(!1,!1,!1,function(){});function ii(sr,fn,gn,ha,Ta,ka,Cn,ia,qa,Ra,ei,Ii,wi,Ha,Ca,Wn){var fa=Ra.Record,Ga={add:32774,subtract:32778,"reverse subtract":32779};gn.ext_blend_minmax&&(Ga.min=fe,Ga.max=ve);var Aa=gn.angle_instanced_arrays,xa=gn.webgl_draw_buffers,Ti=gn.oes_vertex_array_object,fi={dirty:!0,profile:Wn.profile},_i={},Ia=[],Ma={},ki={};function hi(re){return re.replace(".","_")}function Wa(re,ye,Le){var tr=hi(re);Ia.push(re),_i[tr]=fi[tr]=!!Le,Ma[tr]=ye}function Qa(re,ye,Le){var tr=hi(re);Ia.push(re),Array.isArray(Le)?(fi[tr]=Le.slice(),_i[tr]=Le.slice()):fi[tr]=_i[tr]=Le,ki[tr]=ye}function xi(re){return!!isNaN(re)}Wa(ba,or),Wa($i,nr),Qa(So,"blendColor",[0,0,0,0]),Qa(Jo,"blendEquationSeparate",[br,br]),Qa(As,"blendFuncSeparate",[Mr,Qe,Mr,Qe]),Wa(os,Rr,!0),Qa(xs,"depthFunc",jr),Qa(No,"depthRange",[0,1]),Qa(Qs,"depthMask",!0),Qa(Hs,Hs,[!0,!0,!0,!0]),Wa(Ms,Xe),Qa(ni,"cullFace",St),Qa(to,to,se),Qa(ds,ds,1),Wa(Qo,nn),Qa(Tl,"polygonOffset",[0,0]),Wa(Kl,mn),Wa(Fl,zn),Qa(tc,"sampleCoverage",[1,!1]),Wa(tu,Tr),Qa(Uu,"stencilMask",-1),Qa($s,"stencilFunc",[De,0,-1]),Qa(ec,"stencilOpSeparate",[mt,Ce,Ce,Ce]),Qa(Ri,"stencilOpSeparate",[St,Ce,Ce,Ce]),Wa(oo,Qr),Qa(bu,"scissor",[0,0,sr.drawingBufferWidth,sr.drawingBufferHeight]),Qa(Cl,Cl,[0,0,sr.drawingBufferWidth,sr.drawingBufferHeight]);var Wo={gl:sr,context:wi,strings:fn,next:_i,current:fi,draw:Ii,elements:ka,buffer:Ta,shader:ei,attributes:Ra.state,vao:Ra,uniforms:qa,framebuffer:ia,extensions:gn,timer:Ha,isBufferArgs:Dn},zo={primTypes:ue,compareFuncs:sn,blendFuncs:Rn,blendEquations:Ga,stencilOps:Mn,glTypes:ln,orientationType:In};xa&&(zo.backBuffer=[St],zo.drawBuffer=u(ha.maxDrawbuffers,function(re){return re===0?[0]:u(re,function(ye){return tn+ye})}));var mi=0;function Li(){var re=ya({cache:Ca}),ye=re.link,Le=re.global;re.id=mi++,re.batchId="0";var tr=ye(Wo),$e=re.shared={props:"a0"};Object.keys(Wo).forEach(function(cr){$e[cr]=Le.def(tr,".",cr)});var er=re.next={},pr=re.current={};Object.keys(ki).forEach(function(cr){Array.isArray(fi[cr])&&(er[cr]=Le.def($e.next,".",cr),pr[cr]=Le.def($e.current,".",cr))});var wr=re.constants={};Object.keys(zo).forEach(function(cr){wr[cr]=Le.def(JSON.stringify(zo[cr]))}),re.invoke=function(cr,hr){switch(hr.type){case qn:var Vr=["this",$e.context,$e.props,re.batchId];return cr.def(ye(hr.data),".call(",Vr.slice(0,Math.max(hr.data.length+1,4)),")");case Fa:return cr.def($e.props,hr.data);case Fi:return cr.def($e.context,hr.data);case Ei:return cr.def("this",hr.data);case Ni:return hr.data.append(re,cr),hr.data.ref;case Hi:return hr.data.toString();case Ba:return hr.data.map(function(yn){return re.invoke(cr,yn)})}},re.attribCache={};var rr={};return re.scopeAttrib=function(cr){var hr=fn.id(cr);if(hr in rr)return rr[hr];var Vr=Ra.scope[hr];Vr||(Vr=Ra.scope[hr]=new fa);var yn=rr[hr]=ye(Vr);return yn},re}function mo(re){var ye=re.static,Le=re.dynamic,tr;if(Th in ye){var $e=!!ye[Th];tr=La(function(pr,wr){return $e}),tr.enable=$e}else if(Th in Le){var er=Le[Th];tr=$a(er,function(pr,wr){return pr.invoke(wr,er)})}return tr}function Oo(re,ye){var Le=re.static,tr=re.dynamic;if(Lt in Le){var $e=Le[Lt];return $e?($e=ia.getFramebuffer($e),La(function(pr,wr){var rr=pr.link($e),cr=pr.shared;wr.set(cr.framebuffer,".next",rr);var hr=cr.context;return wr.set(hr,"."+ir,rr+".width"),wr.set(hr,"."+zr,rr+".height"),rr})):La(function(pr,wr){var rr=pr.shared;wr.set(rr.framebuffer,".next","null");var cr=rr.context;return wr.set(cr,"."+ir,cr+"."+ne),wr.set(cr,"."+zr,cr+"."+oe),"null"})}else if(Lt in tr){var er=tr[Lt];return $a(er,function(pr,wr){var rr=pr.invoke(wr,er),cr=pr.shared,hr=cr.framebuffer,Vr=wr.def(hr,".getFramebuffer(",rr,")");wr.set(hr,".next",Vr);var yn=cr.context;return wr.set(yn,"."+ir,Vr+"?"+Vr+".width:"+yn+"."+ne),wr.set(yn,"."+zr,Vr+"?"+Vr+".height:"+yn+"."+oe),Vr})}else return null}function ss(re,ye,Le){var tr=re.static,$e=re.dynamic;function er(rr){if(rr in tr){var cr=tr[rr],hr=!0,Vr=cr.x|0,yn=cr.y|0,wn,$n;return"width"in cr?wn=cr.width|0:hr=!1,"height"in cr?$n=cr.height|0:hr=!1,new xn(!hr&&ye&&ye.thisDep,!hr&&ye&&ye.contextDep,!hr&&ye&&ye.propDep,function(ca,ea){var wa=ca.shared.context,da=wn;"width"in cr||(da=ea.def(wa,".",ir,"-",Vr));var pa=$n;return"height"in cr||(pa=ea.def(wa,".",zr,"-",yn)),[Vr,yn,da,pa]})}else if(rr in $e){var Xn=$e[rr],Vn=$a(Xn,function(ca,ea){var wa=ca.invoke(ea,Xn),da=ca.shared.context,pa=ea.def(wa,".x|0"),Ua=ea.def(wa,".y|0"),Di=ea.def('"width" in ',wa,"?",wa,".width|0:","(",da,".",ir,"-",pa,")"),ui=ea.def('"height" in ',wa,"?",wa,".height|0:","(",da,".",zr,"-",Ua,")");return[pa,Ua,Di,ui]});return ye&&(Vn.thisDep=Vn.thisDep||ye.thisDep,Vn.contextDep=Vn.contextDep||ye.contextDep,Vn.propDep=Vn.propDep||ye.propDep),Vn}else return ye?new xn(ye.thisDep,ye.contextDep,ye.propDep,function(ca,ea){var wa=ca.shared.context;return[0,0,ea.def(wa,".",ir),ea.def(wa,".",zr)]}):null}var pr=er(Cl);if(pr){var wr=pr;pr=new xn(pr.thisDep,pr.contextDep,pr.propDep,function(rr,cr){var hr=wr.append(rr,cr),Vr=rr.shared.context;return cr.set(Vr,"."+Zr,hr[2]),cr.set(Vr,"."+Rt,hr[3]),hr})}return{viewport:pr,scissor_box:er(bu)}}function ml(re,ye){var Le=re.static,tr=typeof Le[at]=="string"&&typeof Le[P]=="string";if(tr){if(Object.keys(ye.dynamic).length>0)return null;var $e=ye.static,er=Object.keys($e);if(er.length>0&&typeof $e[er[0]]=="number"){for(var pr=[],wr=0;wr<er.length;++wr)pr.push([$e[er[wr]]|0,er[wr]]);return pr}}return null}function Gs(re,ye,Le){var tr=re.static,$e=re.dynamic;function er(hr){if(hr in tr){var Vr=fn.id(tr[hr]),yn=La(function(){return Vr});return yn.id=Vr,yn}else if(hr in $e){var wn=$e[hr];return $a(wn,function($n,Xn){var Vn=$n.invoke(Xn,wn),ca=Xn.def($n.shared.strings,".id(",Vn,")");return ca})}return null}var pr=er(at),wr=er(P),rr=null,cr;return _a(pr)&&_a(wr)?(rr=ei.program(wr.id,pr.id,null,Le),cr=La(function(hr,Vr){return hr.link(rr)})):cr=new xn(pr&&pr.thisDep||wr&&wr.thisDep,pr&&pr.contextDep||wr&&wr.contextDep,pr&&pr.propDep||wr&&wr.propDep,function(hr,Vr){var yn=hr.shared.shader,wn;pr?wn=pr.append(hr,Vr):wn=Vr.def(yn,".",at);var $n;wr?$n=wr.append(hr,Vr):$n=Vr.def(yn,".",P);var Xn=yn+".program("+$n+","+wn;return Vr.def(Xn+")")}),{frag:pr,vert:wr,progVar:cr,program:rr}}function ws(re,ye){var Le=re.static,tr=re.dynamic,$e={},er=!1;function pr(){if(Ee in Le){var ea=Le[Ee];return ea!==null&&Ra.getVAO(ea)===null&&(ea=Ra.createVAO(ea)),er=!0,$e.vao=ea,La(function(da){var pa=Ra.getVAO(ea);return pa?da.link(pa):"null"})}else if(Ee in tr){er=!0;var wa=tr[Ee];return $a(wa,function(da,pa){var Ua=da.invoke(pa,wa);return pa.def(da.shared.vao+".getVAO("+Ua+")")})}return null}var wr=pr(),rr=!1;function cr(){if(_t in Le){var ea=Le[_t];if($e.elements=ea,Dn(ea)){var wa=$e.elements=ka.create(ea,!0);ea=ka.getElements(wa),rr=!0}else ea&&(ea=ka.getElements(ea),rr=!0);var da=La(function(Ua,Di){if(ea){var ui=Ua.link(ea);return Ua.ELEMENTS=ui,ui}return Ua.ELEMENTS=null,null});return da.value=ea,da}else if(_t in tr){rr=!0;var pa=tr[_t];return $a(pa,function(Ua,Di){var ui=Ua.shared,ji=ui.isBufferArgs,uo=ui.elements,cs=Ua.invoke(Di,pa),Ts=Di.def("null"),is=Di.def(ji,"(",cs,")"),hs=Ua.cond(is).then(Ts,"=",uo,".createStream(",cs,");").else(Ts,"=",uo,".getElements(",cs,");");return Di.entry(hs),Di.exit(Ua.cond(is).then(uo,".destroyStream(",Ts,");")),Ua.ELEMENTS=Ts,Ts})}else if(er)return new xn(wr.thisDep,wr.contextDep,wr.propDep,function(Ua,Di){return Di.def(Ua.shared.vao+".currentVAO?"+Ua.shared.elements+".getElements("+Ua.shared.vao+".currentVAO.elements):null")});return null}var hr=cr();function Vr(){if(Tt in Le){var ea=Le[Tt];return $e.primitive=ea,La(function(da,pa){return ue[ea]})}else if(Tt in tr){var wa=tr[Tt];return $a(wa,function(da,pa){var Ua=da.constants.primTypes,Di=da.invoke(pa,wa);return pa.def(Ua,"[",Di,"]")})}else{if(rr)return _a(hr)?hr.value?La(function(da,pa){return pa.def(da.ELEMENTS,".primType")}):La(function(){return lu}):new xn(hr.thisDep,hr.contextDep,hr.propDep,function(da,pa){var Ua=da.ELEMENTS;return pa.def(Ua,"?",Ua,".primType:",lu)});if(er)return new xn(wr.thisDep,wr.contextDep,wr.propDep,function(da,pa){return pa.def(da.shared.vao+".currentVAO?"+da.shared.vao+".currentVAO.primitive:"+lu)})}return null}function yn(ea,wa){if(ea in Le){var da=Le[ea]|0;return wa?$e.offset=da:$e.instances=da,La(function(Ua,Di){return wa&&(Ua.OFFSET=da),da})}else if(ea in tr){var pa=tr[ea];return $a(pa,function(Ua,Di){var ui=Ua.invoke(Di,pa);return wa&&(Ua.OFFSET=ui),ui})}else if(wa){if(rr)return La(function(Ua,Di){return Ua.OFFSET=0,0});if(er)return new xn(wr.thisDep,wr.contextDep,wr.propDep,function(Ua,Di){return Di.def(Ua.shared.vao+".currentVAO?"+Ua.shared.vao+".currentVAO.offset:0")})}else if(er)return new xn(wr.thisDep,wr.contextDep,wr.propDep,function(Ua,Di){return Di.def(Ua.shared.vao+".currentVAO?"+Ua.shared.vao+".currentVAO.instances:-1")});return null}var wn=yn(ie,!0);function $n(){if(Pt in Le){var ea=Le[Pt]|0;return $e.count=ea,La(function(){return ea})}else if(Pt in tr){var wa=tr[Pt];return $a(wa,function(Di,ui){var ji=Di.invoke(ui,wa);return ji})}else if(rr)if(_a(hr)){if(hr)return wn?new xn(wn.thisDep,wn.contextDep,wn.propDep,function(Di,ui){var ji=ui.def(Di.ELEMENTS,".vertCount-",Di.OFFSET);return ji}):La(function(Di,ui){return ui.def(Di.ELEMENTS,".vertCount")});var da=La(function(){return-1});return da}else{var pa=new xn(hr.thisDep||wn.thisDep,hr.contextDep||wn.contextDep,hr.propDep||wn.propDep,function(Di,ui){var ji=Di.ELEMENTS;return Di.OFFSET?ui.def(ji,"?",ji,".vertCount-",Di.OFFSET,":-1"):ui.def(ji,"?",ji,".vertCount:-1")});return pa}else if(er){var Ua=new xn(wr.thisDep,wr.contextDep,wr.propDep,function(Di,ui){return ui.def(Di.shared.vao,".currentVAO?",Di.shared.vao,".currentVAO.count:-1")});return Ua}return null}var Xn=Vr(),Vn=$n(),ca=yn(de,!1);return{elements:hr,primitive:Xn,count:Vn,instances:ca,offset:wn,vao:wr,vaoActive:er,elementsActive:rr,static:$e}}function ru(re,ye){var Le=re.static,tr=re.dynamic,$e={};return Ia.forEach(function(er){var pr=hi(er);function wr(rr,cr){if(er in Le){var hr=rr(Le[er]);$e[pr]=La(function(){return hr})}else if(er in tr){var Vr=tr[er];$e[pr]=$a(Vr,function(yn,wn){return cr(yn,wn,yn.invoke(wn,Vr))})}}switch(er){case Ms:case $i:case ba:case tu:case os:case oo:case Qo:case Kl:case Fl:case Qs:return wr(function(rr){return rr},function(rr,cr,hr){return hr});case xs:return wr(function(rr){return sn[rr]},function(rr,cr,hr){var Vr=rr.constants.compareFuncs;return cr.def(Vr,"[",hr,"]")});case No:return wr(function(rr){return rr},function(rr,cr,hr){var Vr=cr.def("+",hr,"[0]"),yn=cr.def("+",hr,"[1]");return[Vr,yn]});case As:return wr(function(rr){var cr="srcRGB"in rr?rr.srcRGB:rr.src,hr="srcAlpha"in rr?rr.srcAlpha:rr.src,Vr="dstRGB"in rr?rr.dstRGB:rr.dst,yn="dstAlpha"in rr?rr.dstAlpha:rr.dst;return[Rn[cr],Rn[Vr],Rn[hr],Rn[yn]]},function(rr,cr,hr){var Vr=rr.constants.blendFuncs;function yn(wa,da){var pa=cr.def('"',wa,da,'" in ',hr,"?",hr,".",wa,da,":",hr,".",wa);return pa}var wn=yn("src","RGB"),$n=yn("dst","RGB"),Xn=cr.def(Vr,"[",wn,"]"),Vn=cr.def(Vr,"[",yn("src","Alpha"),"]"),ca=cr.def(Vr,"[",$n,"]"),ea=cr.def(Vr,"[",yn("dst","Alpha"),"]");return[Xn,ca,Vn,ea]});case Jo:return wr(function(rr){if(typeof rr=="string")return[Ga[rr],Ga[rr]];if(typeof rr=="object")return[Ga[rr.rgb],Ga[rr.alpha]]},function(rr,cr,hr){var Vr=rr.constants.blendEquations,yn=cr.def(),wn=cr.def(),$n=rr.cond("typeof ",hr,'==="string"');return $n.then(yn,"=",wn,"=",Vr,"[",hr,"];"),$n.else(yn,"=",Vr,"[",hr,".rgb];",wn,"=",Vr,"[",hr,".alpha];"),cr($n),[yn,wn]});case So:return wr(function(rr){return u(4,function(cr){return+rr[cr]})},function(rr,cr,hr){return u(4,function(Vr){return cr.def("+",hr,"[",Vr,"]")})});case Uu:return wr(function(rr){return rr|0},function(rr,cr,hr){return cr.def(hr,"|0")});case $s:return wr(function(rr){var cr=rr.cmp||"keep",hr=rr.ref||0,Vr="mask"in rr?rr.mask:-1;return[sn[cr],hr,Vr]},function(rr,cr,hr){var Vr=rr.constants.compareFuncs,yn=cr.def('"cmp" in ',hr,"?",Vr,"[",hr,".cmp]",":",Ce),wn=cr.def(hr,".ref|0"),$n=cr.def('"mask" in ',hr,"?",hr,".mask|0:-1");return[yn,wn,$n]});case ec:case Ri:return wr(function(rr){var cr=rr.fail||"keep",hr=rr.zfail||"keep",Vr=rr.zpass||"keep";return[er===Ri?St:mt,Mn[cr],Mn[hr],Mn[Vr]]},function(rr,cr,hr){var Vr=rr.constants.stencilOps;function yn(wn){return cr.def('"',wn,'" in ',hr,"?",Vr,"[",hr,".",wn,"]:",Ce)}return[er===Ri?St:mt,yn("fail"),yn("zfail"),yn("zpass")]});case Tl:return wr(function(rr){var cr=rr.factor|0,hr=rr.units|0;return[cr,hr]},function(rr,cr,hr){var Vr=cr.def(hr,".factor|0"),yn=cr.def(hr,".units|0");return[Vr,yn]});case ni:return wr(function(rr){var cr=0;return rr==="front"?cr=mt:rr==="back"&&(cr=St),cr},function(rr,cr,hr){return cr.def(hr,'==="front"?',mt,":",St)});case ds:return wr(function(rr){return rr},function(rr,cr,hr){return hr});case to:return wr(function(rr){return In[rr]},function(rr,cr,hr){return cr.def(hr+'==="cw"?'+Xt+":"+se)});case Hs:return wr(function(rr){return rr.map(function(cr){return!!cr})},function(rr,cr,hr){return u(4,function(Vr){return"!!"+hr+"["+Vr+"]"})});case tc:return wr(function(rr){var cr="value"in rr?rr.value:1,hr=!!rr.invert;return[cr,hr]},function(rr,cr,hr){var Vr=cr.def('"value" in ',hr,"?+",hr,".value:1"),yn=cr.def("!!",hr,".invert");return[Vr,yn]})}}),$e}function al(re,ye){var Le=re.static,tr=re.dynamic,$e={};return Object.keys(Le).forEach(function(er){var pr=Le[er],wr;if(typeof pr=="number"||typeof pr=="boolean")wr=La(function(){return pr});else if(typeof pr=="function"){var rr=pr._reglType;rr==="texture2d"||rr==="textureCube"?wr=La(function(cr){return cr.link(pr)}):(rr==="framebuffer"||rr==="framebufferCube")&&(wr=La(function(cr){return cr.link(pr.color[0])}))}else dn(pr)&&(wr=La(function(cr){var hr=cr.global.def("[",u(pr.length,function(Vr){return pr[Vr]}),"]");return hr}));wr.value=pr,$e[er]=wr}),Object.keys(tr).forEach(function(er){var pr=tr[er];$e[er]=$a(pr,function(wr,rr){return wr.invoke(rr,pr)})}),$e}function Tu(re,ye){var Le=re.static,tr=re.dynamic,$e={};return Object.keys(Le).forEach(function(er){var pr=Le[er],wr=fn.id(er),rr=new fa;if(Dn(pr))rr.state=va,rr.buffer=Ta.getBuffer(Ta.create(pr,pe,!1,!0)),rr.type=0;else{var cr=Ta.getBuffer(pr);if(cr)rr.state=va,rr.buffer=cr,rr.type=0;else if("constant"in pr){var hr=pr.constant;rr.buffer="null",rr.state=sa,typeof hr=="number"?rr.x=hr:Pa.forEach(function(ca,ea){ea<hr.length&&(rr[ca]=hr[ea])})}else{Dn(pr.buffer)?cr=Ta.getBuffer(Ta.create(pr.buffer,pe,!1,!0)):cr=Ta.getBuffer(pr.buffer);var Vr=pr.offset|0,yn=pr.stride|0,wn=pr.size|0,$n=!!pr.normalized,Xn=0;"type"in pr&&(Xn=ln[pr.type]);var Vn=pr.divisor|0;rr.buffer=cr,rr.state=va,rr.size=wn,rr.normalized=$n,rr.type=Xn||cr.dtype,rr.offset=Vr,rr.stride=yn,rr.divisor=Vn}}$e[er]=La(function(ca,ea){var wa=ca.attribCache;if(wr in wa)return wa[wr];var da={isStream:!1};return Object.keys(rr).forEach(function(pa){da[pa]=rr[pa]}),rr.buffer&&(da.buffer=ca.link(rr.buffer),da.type=da.type||da.buffer+".dtype"),wa[wr]=da,da})}),Object.keys(tr).forEach(function(er){var pr=tr[er];function wr(rr,cr){var hr=rr.invoke(cr,pr),Vr=rr.shared,yn=rr.constants,wn=Vr.isBufferArgs,$n=Vr.buffer,Xn={isStream:cr.def(!1)},Vn=new fa;Vn.state=va,Object.keys(Vn).forEach(function(da){Xn[da]=cr.def(""+Vn[da])});var ca=Xn.buffer,ea=Xn.type;cr("if(",wn,"(",hr,")){",Xn.isStream,"=true;",ca,"=",$n,".createStream(",pe,",",hr,");",ea,"=",ca,".dtype;","}else{",ca,"=",$n,".getBuffer(",hr,");","if(",ca,"){",ea,"=",ca,".dtype;",'}else if("constant" in ',hr,"){",Xn.state,"=",sa,";","if(typeof "+hr+'.constant === "number"){',Xn[Pa[0]],"=",hr,".constant;",Pa.slice(1).map(function(da){return Xn[da]}).join("="),"=0;","}else{",Pa.map(function(da,pa){return Xn[da]+"="+hr+".constant.length>"+pa+"?"+hr+".constant["+pa+"]:0;"}).join(""),"}}else{","if(",wn,"(",hr,".buffer)){",ca,"=",$n,".createStream(",pe,",",hr,".buffer);","}else{",ca,"=",$n,".getBuffer(",hr,".buffer);","}",ea,'="type" in ',hr,"?",yn.glTypes,"[",hr,".type]:",ca,".dtype;",Xn.normalized,"=!!",hr,".normalized;");function wa(da){cr(Xn[da],"=",hr,".",da,"|0;")}return wa("size"),wa("offset"),wa("stride"),wa("divisor"),cr("}}"),cr.exit("if(",Xn.isStream,"){",$n,".destroyStream(",ca,");","}"),Xn}$e[er]=$a(pr,wr)}),$e}function lc(re){var ye=re.static,Le=re.dynamic,tr={};return Object.keys(ye).forEach(function($e){var er=ye[$e];tr[$e]=La(function(pr,wr){return typeof er=="number"||typeof er=="boolean"?""+er:pr.link(er)})}),Object.keys(Le).forEach(function($e){var er=Le[$e];tr[$e]=$a(er,function(pr,wr){return pr.invoke(wr,er)})}),tr}function Fc(re,ye,Le,tr,$e){re.static,re.dynamic;var er=ml(re,ye),pr=Oo(re),wr=ss(re,pr),rr=ws(re),cr=ru(re),hr=Gs(re,$e,er);function Vr(ca){var ea=wr[ca];ea&&(cr[ca]=ea)}Vr(Cl),Vr(hi(bu));var yn=Object.keys(cr).length>0,wn={framebuffer:pr,draw:rr,shader:hr,state:cr,dirty:yn,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(wn.profile=mo(re),wn.uniforms=al(Le),wn.drawVAO=wn.scopeVAO=rr.vao,!wn.drawVAO&&hr.program&&!er&&gn.angle_instanced_arrays&&rr.static.elements){var $n=!0,Xn=hr.program.attributes.map(function(ca){var ea=ye.static[ca];return $n=$n&&!!ea,ea});if($n&&Xn.length>0){var Vn=Ra.getVAO(Ra.createVAO({attributes:Xn,elements:rr.static.elements}));wn.drawVAO=new xn(null,null,null,function(ca,ea){return ca.link(Vn)}),wn.useVAO=!0}}return er?wn.useVAO=!0:wn.attributes=Tu(ye),wn.context=lc(tr),wn}function Lu(re,ye,Le){var tr=re.shared,$e=tr.context,er=re.scope();Object.keys(Le).forEach(function(pr){ye.save($e,"."+pr);var wr=Le[pr],rr=wr.append(re,ye);Array.isArray(rr)?er($e,".",pr,"=[",rr.join(),"];"):er($e,".",pr,"=",rr,";")}),ye(er)}function nu(re,ye,Le,tr){var $e=re.shared,er=$e.gl,pr=$e.framebuffer,wr;xa&&(wr=ye.def($e.extensions,".webgl_draw_buffers"));var rr=re.constants,cr=rr.drawBuffer,hr=rr.backBuffer,Vr;Le?Vr=Le.append(re,ye):Vr=ye.def(pr,".next"),tr||ye("if(",Vr,"!==",pr,".cur){"),ye("if(",Vr,"){",er,".bindFramebuffer(",Yr,",",Vr,".framebuffer);"),xa&&ye(wr,".drawBuffersWEBGL(",cr,"[",Vr,".colorAttachments.length]);"),ye("}else{",er,".bindFramebuffer(",Yr,",null);"),xa&&ye(wr,".drawBuffersWEBGL(",hr,");"),ye("}",pr,".cur=",Vr,";"),tr||ye("}")}function Cu(re,ye,Le){var tr=re.shared,$e=tr.gl,er=re.current,pr=re.next,wr=tr.current,rr=tr.next,cr=re.cond(wr,".dirty");Ia.forEach(function(hr){var Vr=hi(hr);if(!(Vr in Le.state)){var yn,wn;if(Vr in pr){yn=pr[Vr],wn=er[Vr];var $n=u(fi[Vr].length,function(Vn){return cr.def(yn,"[",Vn,"]")});cr(re.cond($n.map(function(Vn,ca){return Vn+"!=="+wn+"["+ca+"]"}).join("||")).then($e,".",ki[Vr],"(",$n,");",$n.map(function(Vn,ca){return wn+"["+ca+"]="+Vn}).join(";"),";"))}else{yn=cr.def(rr,".",Vr);var Xn=re.cond(yn,"!==",wr,".",Vr);cr(Xn),Vr in Ma?Xn(re.cond(yn).then($e,".enable(",Ma[Vr],");").else($e,".disable(",Ma[Vr],");"),wr,".",Vr,"=",yn,";"):Xn($e,".",ki[Vr],"(",yn,");",wr,".",Vr,"=",yn,";")}}}),Object.keys(Le.state).length===0&&cr(wr,".dirty=false;"),ye(cr)}function Xo(re,ye,Le,tr){var $e=re.shared,er=re.current,pr=$e.current,wr=$e.gl,rr;jn(Object.keys(Le)).forEach(function(cr){var hr=Le[cr];if(!(tr&&!tr(hr))){var Vr=hr.append(re,ye);if(Ma[cr]){var yn=Ma[cr];_a(hr)?(rr=re.link(Vr,{stable:!0}),ye(re.cond(rr).then(wr,".enable(",yn,");").else(wr,".disable(",yn,");")),ye(pr,".",cr,"=",rr,";")):(ye(re.cond(Vr).then(wr,".enable(",yn,");").else(wr,".disable(",yn,");")),ye(pr,".",cr,"=",Vr,";"))}else if(dn(Vr)){var wn=er[cr];ye(wr,".",ki[cr],"(",Vr,");",Vr.map(function($n,Xn){return wn+"["+Xn+"]="+$n}).join(";"),";")}else _a(hr)?(rr=re.link(Vr,{stable:!0}),ye(wr,".",ki[cr],"(",rr,");",pr,".",cr,"=",rr,";")):ye(wr,".",ki[cr],"(",Vr,");",pr,".",cr,"=",Vr,";")}})}function uu(re,ye){Aa&&(re.instancing=ye.def(re.shared.extensions,".angle_instanced_arrays"))}function tl(re,ye,Le,tr,$e){var er=re.shared,pr=re.stats,wr=er.current,rr=er.timer,cr=Le.profile;function hr(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Vr,yn;function wn(wa){Vr=ye.def(),wa(Vr,"=",hr(),";"),typeof $e=="string"?wa(pr,".count+=",$e,";"):wa(pr,".count++;"),Ha&&(tr?(yn=ye.def(),wa(yn,"=",rr,".getNumPendingQueries();")):wa(rr,".beginQuery(",pr,");"))}function $n(wa){wa(pr,".cpuTime+=",hr(),"-",Vr,";"),Ha&&(tr?wa(rr,".pushScopeStats(",yn,",",rr,".getNumPendingQueries(),",pr,");"):wa(rr,".endQuery();"))}function Xn(wa){var da=ye.def(wr,".profile");ye(wr,".profile=",wa,";"),ye.exit(wr,".profile=",da,";")}var Vn;if(cr){if(_a(cr)){cr.enable?(wn(ye),$n(ye.exit),Xn("true")):Xn("false");return}Vn=cr.append(re,ye),Xn(Vn)}else Vn=ye.def(wr,".profile");var ca=re.block();wn(ca),ye("if(",Vn,"){",ca,"}");var ea=re.block();$n(ea),ye.exit("if(",Vn,"){",ea,"}")}function au(re,ye,Le,tr,$e){var er=re.shared;function pr(rr){switch(rr){case Yn:case Ka:case ho:return 2;case la:case Gi:case Go:return 3;case Na:case jo:case js:return 4;default:return 1}}function wr(rr,cr,hr){var Vr=er.gl,yn=ye.def(rr,".location"),wn=ye.def(er.attributes,"[",yn,"]"),$n=hr.state,Xn=hr.buffer,Vn=[hr.x,hr.y,hr.z,hr.w],ca=["buffer","normalized","offset","stride"];function ea(){ye("if(!",wn,".buffer){",Vr,".enableVertexAttribArray(",yn,");}");var da=hr.type,pa;if(hr.size?pa=ye.def(hr.size,"||",cr):pa=cr,ye("if(",wn,".type!==",da,"||",wn,".size!==",pa,"||",ca.map(function(Di){return wn+"."+Di+"!=="+hr[Di]}).join("||"),"){",Vr,".bindBuffer(",pe,",",Xn,".buffer);",Vr,".vertexAttribPointer(",[yn,pa,da,hr.normalized,hr.stride,hr.offset],");",wn,".type=",da,";",wn,".size=",pa,";",ca.map(function(Di){return wn+"."+Di+"="+hr[Di]+";"}).join(""),"}"),Aa){var Ua=hr.divisor;ye("if(",wn,".divisor!==",Ua,"){",re.instancing,".vertexAttribDivisorANGLE(",[yn,Ua],");",wn,".divisor=",Ua,";}")}}function wa(){ye("if(",wn,".buffer){",Vr,".disableVertexAttribArray(",yn,");",wn,".buffer=null;","}if(",Pa.map(function(da,pa){return wn+"."+da+"!=="+Vn[pa]}).join("||"),"){",Vr,".vertexAttrib4f(",yn,",",Vn,");",Pa.map(function(da,pa){return wn+"."+da+"="+Vn[pa]+";"}).join(""),"}")}$n===va?ea():$n===sa?wa():(ye("if(",$n,"===",va,"){"),ea(),ye("}else{"),wa(),ye("}"))}tr.forEach(function(rr){var cr=rr.name,hr=Le.attributes[cr],Vr;if(hr){if(!$e(hr))return;Vr=hr.append(re,ye)}else{if(!$e(ti))return;var yn=re.scopeAttrib(cr);Vr={},Object.keys(new fa).forEach(function(wn){Vr[wn]=ye.def(yn,".",wn)})}wr(re.link(rr),pr(rr.info.type),Vr)})}function Bc(re,ye,Le,tr,$e,er){for(var pr=re.shared,wr=pr.gl,rr,cr=0;cr<tr.length;++cr){var hr=tr[cr],Vr=hr.name,yn=hr.info.type,wn=Le.uniforms[Vr],$n=re.link(hr),Xn=$n+".location",Vn;if(wn){if(!$e(wn))continue;if(_a(wn)){var ca=wn.value;if(yn===nl||yn===dl){var ea=re.link(ca._texture||ca.color[0]._texture);ye(wr,".uniform1i(",Xn,",",ea+".bind());"),ye.exit(ea,".unbind();")}else if(yn===Is||yn===bo||yn===wo){var wa=re.global.def("new Float32Array(["+Array.prototype.slice.call(ca)+"])"),da=2;yn===bo?da=3:yn===wo&&(da=4),ye(wr,".uniformMatrix",da,"fv(",Xn,",false,",wa,");")}else{switch(yn){case na:rr="1f";break;case Yn:rr="2f";break;case la:rr="3f";break;case Na:rr="4f";break;case Uo:rr="1i";break;case li:rr="1i";break;case ho:rr="2i";break;case Ka:rr="2i";break;case Go:rr="3i";break;case Gi:rr="3i";break;case js:rr="4i";break;case jo:rr="4i";break}ye(wr,".uniform",rr,"(",Xn,",",dn(ca)?Array.prototype.slice.call(ca):ca,");")}continue}else Vn=wn.append(re,ye)}else{if(!$e(ti))continue;Vn=ye.def(pr.uniforms,"[",fn.id(Vr),"]")}yn===nl?ye("if(",Vn,"&&",Vn,'._reglType==="framebuffer"){',Vn,"=",Vn,".color[0];","}"):yn===dl&&ye("if(",Vn,"&&",Vn,'._reglType==="framebufferCube"){',Vn,"=",Vn,".color[0];","}");var pa=1;switch(yn){case nl:case dl:var Ua=ye.def(Vn,"._texture");ye(wr,".uniform1i(",Xn,",",Ua,".bind());"),ye.exit(Ua,".unbind();");continue;case li:case Uo:rr="1i";break;case Ka:case ho:rr="2i",pa=2;break;case Gi:case Go:rr="3i",pa=3;break;case jo:case js:rr="4i",pa=4;break;case na:rr="1f";break;case Yn:rr="2f",pa=2;break;case la:rr="3f",pa=3;break;case Na:rr="4f",pa=4;break;case Is:rr="Matrix2fv";break;case bo:rr="Matrix3fv";break;case wo:rr="Matrix4fv";break}if(rr.charAt(0)==="M"){ye(wr,".uniform",rr,"(",Xn,",");var Di=Math.pow(yn-Is+2,2),ui=re.global.def("new Float32Array(",Di,")");Array.isArray(Vn)?ye("false,(",u(Di,function(is){return ui+"["+is+"]="+Vn[is]}),",",ui,")"):ye("false,(Array.isArray(",Vn,")||",Vn," instanceof Float32Array)?",Vn,":(",u(Di,function(is){return ui+"["+is+"]="+Vn+"["+is+"]"}),",",ui,")"),ye(");")}else if(pa>1){for(var ji=[],uo=[],cs=0;cs<pa;++cs)Array.isArray(Vn)?uo.push(Vn[cs]):uo.push(ye.def(Vn+"["+cs+"]")),er&&ji.push(ye.def());er&&ye("if(!",re.batchId,"||",ji.map(function(is,hs){return is+"!=="+uo[hs]}).join("||"),"){",ji.map(function(is,hs){return is+"="+uo[hs]+";"}).join("")),ye(wr,".uniform",rr,"(",Xn,",",uo.join(","),");"),er&&ye("}")}else{if(er){var Ts=ye.def();ye("if(!",re.batchId,"||",Ts,"!==",Vn,"){",Ts,"=",Vn,";")}ye(wr,".uniform",rr,"(",Xn,",",Vn,");"),er&&ye("}")}}}function Ho(re,ye,Le,tr){var $e=re.shared,er=$e.gl,pr=$e.draw,wr=tr.draw;function rr(){var pa=wr.elements,Ua,Di=ye;return pa?((pa.contextDep&&tr.contextDynamic||pa.propDep)&&(Di=Le),Ua=pa.append(re,Di),wr.elementsActive&&Di("if("+Ua+")"+er+".bindBuffer("+Ae+","+Ua+".buffer.buffer);")):(Ua=Di.def(),Di(Ua,"=",pr,".",_t,";","if(",Ua,"){",er,".bindBuffer(",Ae,",",Ua,".buffer.buffer);}","else if(",$e.vao,".currentVAO){",Ua,"=",re.shared.elements+".getElements("+$e.vao,".currentVAO.elements);",Ti?"":"if("+Ua+")"+er+".bindBuffer("+Ae+","+Ua+".buffer.buffer);","}")),Ua}function cr(){var pa=wr.count,Ua,Di=ye;return pa?((pa.contextDep&&tr.contextDynamic||pa.propDep)&&(Di=Le),Ua=pa.append(re,Di)):Ua=Di.def(pr,".",Pt),Ua}var hr=rr();function Vr(pa){var Ua=wr[pa];return Ua?Ua.contextDep&&tr.contextDynamic||Ua.propDep?Ua.append(re,Le):Ua.append(re,ye):ye.def(pr,".",pa)}var yn=Vr(Tt),wn=Vr(ie),$n=cr();if(typeof $n=="number"){if($n===0)return}else Le("if(",$n,"){"),Le.exit("}");var Xn,Vn;Aa&&(Xn=Vr(de),Vn=re.instancing);var ca=hr+".type",ea=wr.elements&&_a(wr.elements)&&!wr.vaoActive;function wa(){function pa(){Le(Vn,".drawElementsInstancedANGLE(",[yn,$n,ca,wn+"<<(("+ca+"-"+Jn+")>>1)",Xn],");")}function Ua(){Le(Vn,".drawArraysInstancedANGLE(",[yn,wn,$n,Xn],");")}hr&&hr!=="null"?ea?pa():(Le("if(",hr,"){"),pa(),Le("}else{"),Ua(),Le("}")):Ua()}function da(){function pa(){Le(er+".drawElements("+[yn,$n,ca,wn+"<<(("+ca+"-"+Jn+")>>1)"]+");")}function Ua(){Le(er+".drawArrays("+[yn,wn,$n]+");")}hr&&hr!=="null"?ea?pa():(Le("if(",hr,"){"),pa(),Le("}else{"),Ua(),Le("}")):Ua()}Aa&&(typeof Xn!="number"||Xn>=0)?typeof Xn=="string"?(Le("if(",Xn,">0){"),wa(),Le("}else if(",Xn,"<0){"),da(),Le("}")):wa():da()}function Fs(re,ye,Le,tr,$e){var er=Li(),pr=er.proc("body",$e);return Aa&&(er.instancing=pr.def(er.shared.extensions,".angle_instanced_arrays")),re(er,pr,Le,tr),er.compile().body}function kl(re,ye,Le,tr){uu(re,ye),Le.useVAO?Le.drawVAO?ye(re.shared.vao,".setVAO(",Le.drawVAO.append(re,ye),");"):ye(re.shared.vao,".setVAO(",re.shared.vao,".targetVAO);"):(ye(re.shared.vao,".setVAO(null);"),au(re,ye,Le,tr.attributes,function(){return!0})),Bc(re,ye,Le,tr.uniforms,function(){return!0},!1),Ho(re,ye,ye,Le)}function zs(re,ye){var Le=re.proc("draw",1);uu(re,Le),Lu(re,Le,ye.context),nu(re,Le,ye.framebuffer),Cu(re,Le,ye),Xo(re,Le,ye.state),tl(re,Le,ye,!1,!0);var tr=ye.shader.progVar.append(re,Le);if(Le(re.shared.gl,".useProgram(",tr,".program);"),ye.shader.program)kl(re,Le,ye,ye.shader.program);else{Le(re.shared.vao,".setVAO(null);");var $e=re.global.def("{}"),er=Le.def(tr,".id"),pr=Le.def($e,"[",er,"]");Le(re.cond(pr).then(pr,".call(this,a0);").else(pr,"=",$e,"[",er,"]=",re.link(function(wr){return Fs(kl,re,ye,wr,1)}),"(",tr,");",pr,".call(this,a0);"))}Object.keys(ye.state).length>0&&Le(re.shared.current,".dirty=true;"),re.shared.vao&&Le(re.shared.vao,".setVAO(null);")}function W(re,ye,Le,tr){re.batchId="a1",uu(re,ye);function $e(){return!0}au(re,ye,Le,tr.attributes,$e),Bc(re,ye,Le,tr.uniforms,$e,!1),Ho(re,ye,ye,Le)}function et(re,ye,Le,tr){uu(re,ye);var $e=Le.contextDep,er=ye.def(),pr="a0",wr="a1",rr=ye.def();re.shared.props=rr,re.batchId=er;var cr=re.scope(),hr=re.scope();ye(cr.entry,"for(",er,"=0;",er,"<",wr,";++",er,"){",rr,"=",pr,"[",er,"];",hr,"}",cr.exit);function Vr(ca){return ca.contextDep&&$e||ca.propDep}function yn(ca){return!Vr(ca)}if(Le.needsContext&&Lu(re,hr,Le.context),Le.needsFramebuffer&&nu(re,hr,Le.framebuffer),Xo(re,hr,Le.state,Vr),Le.profile&&Vr(Le.profile)&&tl(re,hr,Le,!1,!0),tr)Le.useVAO?Le.drawVAO?Vr(Le.drawVAO)?hr(re.shared.vao,".setVAO(",Le.drawVAO.append(re,hr),");"):cr(re.shared.vao,".setVAO(",Le.drawVAO.append(re,cr),");"):cr(re.shared.vao,".setVAO(",re.shared.vao,".targetVAO);"):(cr(re.shared.vao,".setVAO(null);"),au(re,cr,Le,tr.attributes,yn),au(re,hr,Le,tr.attributes,Vr)),Bc(re,cr,Le,tr.uniforms,yn,!1),Bc(re,hr,Le,tr.uniforms,Vr,!0),Ho(re,cr,hr,Le);else{var wn=re.global.def("{}"),$n=Le.shader.progVar.append(re,hr),Xn=hr.def($n,".id"),Vn=hr.def(wn,"[",Xn,"]");hr(re.shared.gl,".useProgram(",$n,".program);","if(!",Vn,"){",Vn,"=",wn,"[",Xn,"]=",re.link(function(ca){return Fs(W,re,Le,ca,2)}),"(",$n,");}",Vn,".call(this,a0[",er,"],",er,");")}}function K(re,ye){var Le=re.proc("batch",2);re.batchId="0",uu(re,Le);var tr=!1,$e=!0;Object.keys(ye.context).forEach(function(wn){tr=tr||ye.context[wn].propDep}),tr||(Lu(re,Le,ye.context),$e=!1);var er=ye.framebuffer,pr=!1;er?(er.propDep?tr=pr=!0:er.contextDep&&tr&&(pr=!0),pr||nu(re,Le,er)):nu(re,Le,null),ye.state.viewport&&ye.state.viewport.propDep&&(tr=!0);function wr(wn){return wn.contextDep&&tr||wn.propDep}Cu(re,Le,ye),Xo(re,Le,ye.state,function(wn){return!wr(wn)}),(!ye.profile||!wr(ye.profile))&&tl(re,Le,ye,!1,"a1"),ye.contextDep=tr,ye.needsContext=$e,ye.needsFramebuffer=pr;var rr=ye.shader.progVar;if(rr.contextDep&&tr||rr.propDep)et(re,Le,ye,null);else{var cr=rr.append(re,Le);if(Le(re.shared.gl,".useProgram(",cr,".program);"),ye.shader.program)et(re,Le,ye,ye.shader.program);else{Le(re.shared.vao,".setVAO(null);");var hr=re.global.def("{}"),Vr=Le.def(cr,".id"),yn=Le.def(hr,"[",Vr,"]");Le(re.cond(yn).then(yn,".call(this,a0,a1);").else(yn,"=",hr,"[",Vr,"]=",re.link(function(wn){return Fs(et,re,ye,wn,2)}),"(",cr,");",yn,".call(this,a0,a1);"))}}Object.keys(ye.state).length>0&&Le(re.shared.current,".dirty=true;"),re.shared.vao&&Le(re.shared.vao,".setVAO(null);")}function pt(re,ye){var Le=re.proc("scope",3);re.batchId="a2";var tr=re.shared,$e=tr.current;if(Lu(re,Le,ye.context),ye.framebuffer&&ye.framebuffer.append(re,Le),jn(Object.keys(ye.state)).forEach(function(wr){var rr=ye.state[wr],cr=rr.append(re,Le);dn(cr)?cr.forEach(function(hr,Vr){xi(hr)?Le.set(re.next[wr],"["+Vr+"]",hr):Le.set(re.next[wr],"["+Vr+"]",re.link(hr,{stable:!0}))}):_a(rr)?Le.set(tr.next,"."+wr,re.link(cr,{stable:!0})):Le.set(tr.next,"."+wr,cr)}),tl(re,Le,ye,!0,!0),[_t,ie,Pt,de,Tt].forEach(function(wr){var rr=ye.draw[wr];if(rr){var cr=rr.append(re,Le);xi(cr)?Le.set(tr.draw,"."+wr,cr):Le.set(tr.draw,"."+wr,re.link(cr),{stable:!0})}}),Object.keys(ye.uniforms).forEach(function(wr){var rr=ye.uniforms[wr].append(re,Le);Array.isArray(rr)&&(rr="["+rr.map(function(cr){return xi(cr)?cr:re.link(cr,{stable:!0})})+"]"),Le.set(tr.uniforms,"["+re.link(fn.id(wr),{stable:!0})+"]",rr)}),Object.keys(ye.attributes).forEach(function(wr){var rr=ye.attributes[wr].append(re,Le),cr=re.scopeAttrib(wr);Object.keys(new fa).forEach(function(hr){Le.set(cr,"."+hr,rr[hr])})}),ye.scopeVAO){var er=ye.scopeVAO.append(re,Le);xi(er)?Le.set(tr.vao,".targetVAO",er):Le.set(tr.vao,".targetVAO",re.link(er,{stable:!0}))}function pr(wr){var rr=ye.shader[wr];if(rr){var cr=rr.append(re,Le);xi(cr)?Le.set(tr.shader,"."+wr,cr):Le.set(tr.shader,"."+wr,re.link(cr,{stable:!0}))}}pr(P),pr(at),Object.keys(ye.state).length>0&&(Le($e,".dirty=true;"),Le.exit($e,".dirty=true;")),Le("a1(",re.shared.context,",a0,",re.batchId,");")}function Ct(re){if(!(typeof re!="object"||dn(re))){for(var ye=Object.keys(re),Le=0;Le<ye.length;++Le)if(h.isDynamic(re[ye[Le]]))return!0;return!1}}function Yt(re,ye,Le){var tr=ye.static[Le];if(!tr||!Ct(tr))return;var $e=re.global,er=Object.keys(tr),pr=!1,wr=!1,rr=!1,cr=re.global.def("{}");er.forEach(function(Vr){var yn=tr[Vr];if(h.isDynamic(yn)){typeof yn=="function"&&(yn=tr[Vr]=h.unbox(yn));var wn=$a(yn,null);pr=pr||wn.thisDep,rr=rr||wn.propDep,wr=wr||wn.contextDep}else{switch($e(cr,".",Vr,"="),typeof yn){case"number":$e(yn);break;case"string":$e('"',yn,'"');break;case"object":Array.isArray(yn)&&$e("[",yn.join(),"]");break;default:$e(re.link(yn));break}$e(";")}});function hr(Vr,yn){er.forEach(function(wn){var $n=tr[wn];if(h.isDynamic($n)){var Xn=Vr.invoke(yn,$n);yn(cr,".",wn,"=",Xn,";")}})}ye.dynamic[Le]=new h.DynamicVariable(Ni,{thisDep:pr,contextDep:wr,propDep:rr,ref:cr,append:hr}),delete ye.static[Le]}function ce(re,ye,Le,tr,$e){var er=Li();er.stats=er.link($e),Object.keys(ye.static).forEach(function(wr){Yt(er,ye,wr)}),be.forEach(function(wr){Yt(er,re,wr)});var pr=Fc(re,ye,Le,tr,er);return pr.shader.program&&(pr.shader.program.attributes.sort(function(wr,rr){return wr.name<rr.name?-1:1}),pr.shader.program.uniforms.sort(function(wr,rr){return wr.name<rr.name?-1:1})),zs(er,pr),pt(er,pr),K(er,pr),c(er.compile(),{destroy:function(){pr.shader.program.destroy()}})}return{next:_i,current:fi,procs:function(){var re=Li(),ye=re.proc("poll"),Le=re.proc("refresh"),tr=re.block();ye(tr),Le(tr);var $e=re.shared,er=$e.gl,pr=$e.next,wr=$e.current;tr(wr,".dirty=false;"),nu(re,ye),nu(re,Le,null,!0);var rr;Aa&&(rr=re.link(Aa)),gn.oes_vertex_array_object&&Le(re.link(gn.oes_vertex_array_object),".bindVertexArrayOES(null);");var cr=Le.def($e.attributes),hr=Le.def(0),Vr=re.cond(hr,".buffer");Vr.then(er,".enableVertexAttribArray(i);",er,".bindBuffer(",pe,",",hr,".buffer.buffer);",er,".vertexAttribPointer(i,",hr,".size,",hr,".type,",hr,".normalized,",hr,".stride,",hr,".offset);").else(er,".disableVertexAttribArray(i);",er,".vertexAttrib4f(i,",hr,".x,",hr,".y,",hr,".z,",hr,".w);",hr,".buffer=null;");var yn=re.link(ha.maxAttributes,{stable:!0});return Le("for(var i=0;i<",yn,";++i){",hr,"=",cr,"[i];",Vr,"}"),Aa&&Le("for(var i=0;i<",yn,";++i){",rr,".vertexAttribDivisorANGLE(i,",cr,"[i].divisor);","}"),Le(re.shared.vao,".currentVAO=null;",re.shared.vao,".setVAO(",re.shared.vao,".targetVAO);"),Object.keys(Ma).forEach(function(wn){var $n=Ma[wn],Xn=tr.def(pr,".",wn),Vn=re.block();Vn("if(",Xn,"){",er,".enable(",$n,")}else{",er,".disable(",$n,")}",wr,".",wn,"=",Xn,";"),Le(Vn),ye("if(",Xn,"!==",wr,".",wn,"){",Vn,"}")}),Object.keys(ki).forEach(function(wn){var $n=ki[wn],Xn=fi[wn],Vn,ca,ea=re.block();if(ea(er,".",$n,"("),dn(Xn)){var wa=Xn.length;Vn=re.global.def(pr,".",wn),ca=re.global.def(wr,".",wn),ea(u(wa,function(da){return Vn+"["+da+"]"}),");",u(wa,function(da){return ca+"["+da+"]="+Vn+"["+da+"];"}).join("")),ye("if(",u(wa,function(da){return Vn+"["+da+"]!=="+ca+"["+da+"]"}).join("||"),"){",ea,"}")}else Vn=tr.def(pr,".",wn),ca=tr.def(wr,".",wn),ea(Vn,");",wr,".",wn,"=",Vn,";"),ye("if(",Vn,"!==",ca,"){",ea,"}");Le(ea)}),re.compile()}(),compile:ce}}function di(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var Io=34918,gi=34919,Ji=35007,qo=function(sr,fn){if(!fn.ext_disjoint_timer_query)return null;var gn=[];function ha(){return gn.pop()||fn.ext_disjoint_timer_query.createQueryEXT()}function Ta(Ga){gn.push(Ga)}var ka=[];function Cn(Ga){var Aa=ha();fn.ext_disjoint_timer_query.beginQueryEXT(Ji,Aa),ka.push(Aa),Ha(ka.length-1,ka.length,Ga)}function ia(){fn.ext_disjoint_timer_query.endQueryEXT(Ji)}function qa(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var Ra=[];function ei(){return Ra.pop()||new qa}function Ii(Ga){Ra.push(Ga)}var wi=[];function Ha(Ga,Aa,xa){var Ti=ei();Ti.startQueryIndex=Ga,Ti.endQueryIndex=Aa,Ti.sum=0,Ti.stats=xa,wi.push(Ti)}var Ca=[],Wn=[];function fa(){var Ga,Aa,xa=ka.length;if(xa!==0){Wn.length=Math.max(Wn.length,xa+1),Ca.length=Math.max(Ca.length,xa+1),Ca[0]=0,Wn[0]=0;var Ti=0;for(Ga=0,Aa=0;Aa<ka.length;++Aa){var fi=ka[Aa];fn.ext_disjoint_timer_query.getQueryObjectEXT(fi,gi)?(Ti+=fn.ext_disjoint_timer_query.getQueryObjectEXT(fi,Io),Ta(fi)):ka[Ga++]=fi,Ca[Aa+1]=Ti,Wn[Aa+1]=Ga}for(ka.length=Ga,Ga=0,Aa=0;Aa<wi.length;++Aa){var _i=wi[Aa],Ia=_i.startQueryIndex,Ma=_i.endQueryIndex;_i.sum+=Ca[Ma]-Ca[Ia];var ki=Wn[Ia],hi=Wn[Ma];hi===ki?(_i.stats.gpuTime+=_i.sum/1e6,Ii(_i)):(_i.startQueryIndex=ki,_i.endQueryIndex=hi,wi[Ga++]=_i)}wi.length=Ga}}return{beginQuery:Cn,endQuery:ia,pushScopeStats:Ha,update:fa,getNumPendingQueries:function(){return ka.length},clear:function(){gn.push.apply(gn,ka);for(var Ga=0;Ga<gn.length;Ga++)fn.ext_disjoint_timer_query.deleteQueryEXT(gn[Ga]);ka.length=0,gn.length=0},restore:function(){ka.length=0,gn.length=0}}},Ys=16384,_s=256,Ja=1024,yo=34962,Lo="webglcontextlost",bs="webglcontextrestored",us=1,eu=2,Yo=3;function gs(sr,fn){for(var gn=0;gn<sr.length;++gn)if(sr[gn]===fn)return gn;return-1}function wu(sr){var fn=M(sr);if(!fn)return null;var gn=fn.gl,ha=gn.getContextAttributes();gn.isContextLost();var Ta=w(gn,fn);if(!Ta)return null;var ka=p(),Cn=di(),ia=fn.cachedCode||{},qa=Ta.extensions,Ra=qo(gn,qa),ei=m(),Ii=gn.drawingBufferWidth,wi=gn.drawingBufferHeight,Ha={tick:0,time:0,viewportWidth:Ii,viewportHeight:wi,framebufferWidth:Ii,framebufferHeight:wi,drawingBufferWidth:Ii,drawingBufferHeight:wi,pixelRatio:fn.pixelRatio},Ca={},Wn={elements:null,primitive:4,count:-1,offset:0,instances:-1},fa=We(gn,qa),Ga=rn(gn,Cn,fn,Ti),Aa=Je(gn,qa,Ga,Cn),xa=Eu(gn,qa,fa,Cn,Ga,Aa,Wn);function Ti(Ho){return xa.destroyBuffer(Ho)}var fi=ju(gn,ka,Cn,fn),_i=vu(gn,qa,fa,function(){ki.procs.poll()},Ha,Cn,fn),Ia=Ru(gn,qa,fa,Cn,fn),Ma=$l(gn,qa,fa,_i,Ia,Cn),ki=ii(gn,ka,qa,fa,Ga,Aa,_i,Ma,Ca,xa,fi,Wn,Ha,Ra,ia,fn),hi=wh(gn,Ma,ki.procs.poll,Ha),Wa=ki.next,Qa=gn.canvas,xi=[],Wo=[],zo=[],mi=[fn.onDestroy],Li=null;function mo(){if(xi.length===0){Ra&&Ra.update(),Li=null;return}Li=v.next(mo),nu();for(var Ho=xi.length-1;Ho>=0;--Ho){var Fs=xi[Ho];Fs&&Fs(Ha,null,0)}gn.flush(),Ra&&Ra.update()}function Oo(){!Li&&xi.length>0&&(Li=v.next(mo))}function ss(){Li&&(v.cancel(mo),Li=null)}function ml(Ho){Ho.preventDefault(),ss(),Wo.forEach(function(Fs){Fs()})}function Gs(Ho){gn.getError(),Ta.restore(),fi.restore(),Ga.restore(),_i.restore(),Ia.restore(),Ma.restore(),xa.restore(),Ra&&Ra.restore(),ki.procs.refresh(),Oo(),zo.forEach(function(Fs){Fs()})}Qa&&(Qa.addEventListener(Lo,ml,!1),Qa.addEventListener(bs,Gs,!1));function ws(){xi.length=0,ss(),Qa&&(Qa.removeEventListener(Lo,ml),Qa.removeEventListener(bs,Gs)),fi.clear(),Ma.clear(),Ia.clear(),xa.clear(),_i.clear(),Aa.clear(),Ga.clear(),Ra&&Ra.clear(),mi.forEach(function(Ho){Ho()})}function ru(Ho){function Fs($e){var er=c({},$e);delete er.uniforms,delete er.attributes,delete er.context,delete er.vao,"stencil"in er&&er.stencil.op&&(er.stencil.opBack=er.stencil.opFront=er.stencil.op,delete er.stencil.op);function pr(wr){if(wr in er){var rr=er[wr];delete er[wr],Object.keys(rr).forEach(function(cr){er[wr+"."+cr]=rr[cr]})}}return pr("blend"),pr("depth"),pr("cull"),pr("stencil"),pr("polygonOffset"),pr("scissor"),pr("sample"),"vao"in $e&&(er.vao=$e.vao),er}function kl($e,er){var pr={},wr={};return Object.keys($e).forEach(function(rr){var cr=$e[rr];if(h.isDynamic(cr)){wr[rr]=h.unbox(cr,rr);return}else if(er&&Array.isArray(cr)){for(var hr=0;hr<cr.length;++hr)if(h.isDynamic(cr[hr])){wr[rr]=h.unbox(cr,rr);return}}pr[rr]=cr}),{dynamic:wr,static:pr}}var zs=kl(Ho.context||{},!0),W=kl(Ho.uniforms||{},!0),et=kl(Ho.attributes||{},!1),K=kl(Fs(Ho),!1),pt={gpuTime:0,cpuTime:0,count:0},Ct=ki.compile(K,et,W,zs,pt),Yt=Ct.draw,ce=Ct.batch,re=Ct.scope,ye=[];function Le($e){for(;ye.length<$e;)ye.push(null);return ye}function tr($e,er){var pr;if(typeof $e=="function")return re.call(this,null,$e,0);if(typeof er=="function")if(typeof $e=="number")for(pr=0;pr<$e;++pr)re.call(this,null,er,pr);else if(Array.isArray($e))for(pr=0;pr<$e.length;++pr)re.call(this,$e[pr],er,pr);else return re.call(this,$e,er,0);else if(typeof $e=="number"){if($e>0)return ce.call(this,Le($e|0),$e|0)}else if(Array.isArray($e)){if($e.length)return ce.call(this,$e,$e.length)}else return Yt.call(this,$e)}return c(tr,{stats:pt,destroy:function(){Ct.destroy()}})}var al=Ma.setFBO=ru({framebuffer:h.define.call(null,us,"framebuffer")});function Tu(Ho,Fs){var kl=0;ki.procs.poll();var zs=Fs.color;zs&&(gn.clearColor(+zs[0]||0,+zs[1]||0,+zs[2]||0,+zs[3]||0),kl|=Ys),"depth"in Fs&&(gn.clearDepth(+Fs.depth),kl|=_s),"stencil"in Fs&&(gn.clearStencil(Fs.stencil|0),kl|=Ja),gn.clear(kl)}function lc(Ho){if("framebuffer"in Ho)if(Ho.framebuffer&&Ho.framebuffer_reglType==="framebufferCube")for(var Fs=0;Fs<6;++Fs)al(c({framebuffer:Ho.framebuffer.faces[Fs]},Ho),Tu);else al(Ho,Tu);else Tu(null,Ho)}function Fc(Ho){xi.push(Ho);function Fs(){var kl=gs(xi,Ho);function zs(){var W=gs(xi,zs);xi[W]=xi[xi.length-1],xi.length-=1,xi.length<=0&&ss()}xi[kl]=zs}return Oo(),{cancel:Fs}}function Lu(){var Ho=Wa.viewport,Fs=Wa.scissor_box;Ho[0]=Ho[1]=Fs[0]=Fs[1]=0,Ha.viewportWidth=Ha.framebufferWidth=Ha.drawingBufferWidth=Ho[2]=Fs[2]=gn.drawingBufferWidth,Ha.viewportHeight=Ha.framebufferHeight=Ha.drawingBufferHeight=Ho[3]=Fs[3]=gn.drawingBufferHeight}function nu(){Ha.tick+=1,Ha.time=Xo(),Lu(),ki.procs.poll()}function Cu(){_i.refresh(),Lu(),ki.procs.refresh(),Ra&&Ra.update()}function Xo(){return(m()-ei)/1e3}Cu();function uu(Ho,Fs){var kl;switch(Ho){case"frame":return Fc(Fs);case"lost":kl=Wo;break;case"restore":kl=zo;break;case"destroy":kl=mi;break}return kl.push(Fs),{cancel:function(){for(var zs=0;zs<kl.length;++zs)if(kl[zs]===Fs){kl[zs]=kl[kl.length-1],kl.pop();return}}}}function tl(){return ia}function au(Ho){Object.entries(Ho).forEach(function(Fs){ia[Fs[0]]=Fs[1]})}var Bc=c(ru,{clear:lc,prop:h.define.bind(null,us),context:h.define.bind(null,eu),this:h.define.bind(null,Yo),draw:ru({}),buffer:function(Ho){return Ga.create(Ho,yo,!1,!1)},elements:function(Ho){return Aa.create(Ho,!1)},texture:_i.create2D,cube:_i.createCube,renderbuffer:Ia.create,framebuffer:Ma.create,framebufferCube:Ma.createCube,vao:xa.createVAO,attributes:ha,frame:Fc,on:uu,limits:fa,hasExtension:function(Ho){return fa.extensions.indexOf(Ho.toLowerCase())>=0},read:hi,destroy:ws,_gl:gn,_refresh:Cu,poll:function(){nu(),Ra&&Ra.update()},now:Xo,stats:Cn,getCachedCode:tl,preloadCachedCode:au});return fn.onDone(null,Bc),Bc}return wu})}),DP=Vt((X,V)=>{var c=kp();V.exports=function(r){if(r?typeof r=="string"&&(r={container:r}):r={},E(r)?r={container:r}:A(r)?r={container:r}:t(r)?r={gl:r}:r=c(r,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),r.pixelRatio||(r.pixelRatio=window.pixelRatio||1),r.gl)return r.gl;if(r.canvas&&(r.container=r.canvas.parentNode),r.container){if(typeof r.container=="string"){var i=document.querySelector(r.container);if(!i)throw Error("Element "+r.container+" is not found");r.container=i}E(r.container)?(r.canvas=r.container,r.container=r.canvas.parentNode):r.canvas||(r.canvas=e(),r.container.appendChild(r.canvas),g(r))}else if(!r.canvas)if(typeof document<"u")r.container=document.body||document.documentElement,r.canvas=e(),r.container.appendChild(r.canvas),g(r);else throw Error("Not DOM environment. Use headless-gl.");return r.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(n){try{r.gl=r.canvas.getContext(n,r.attrs)}catch{}return r.gl}),r.gl};function g(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var i=r.container.getBoundingClientRect();r.canvas.width=r.width||i.right-i.left,r.canvas.height=r.height||i.bottom-i.top}}function E(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function A(r){return typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.getBoundingClientRect=="function"}function t(r){return typeof r.drawArrays=="function"||typeof r.drawElements=="function"}function e(){var r=document.createElement("canvas");return r.style.position="absolute",r.style.top=0,r.style.left=0,r}}),zP=Vt((X,V)=>{var c=t5(),g=[32,126];V.exports=E;function E(A){A=A||{};var t=A.shape?A.shape:A.canvas?[A.canvas.width,A.canvas.height]:[512,512],e=A.canvas||document.createElement("canvas"),r=A.font,i=typeof A.step=="number"?[A.step,A.step]:A.step||[32,32],n=A.chars||g;if(r&&typeof r!="string"&&(r=c(r)),!Array.isArray(n))n=String(n).split("");else if(n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"){for(var o=[],a=n[0],s=0;a<=n[1];a++)o[s++]=String.fromCharCode(a);n=o}t=t.slice(),e.width=t[0],e.height=t[1];var h=e.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,e.width,e.height),h.font=r,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";for(var v=i[0]/2,m=i[1]/2,a=0;a<n.length;a++)h.fillText(n[a],v,m),(v+=i[0])>t[0]-i[0]/2&&(v=i[0]/2,m+=i[1]);return e}}),r5=Vt(X=>{"use restrict";var V=32;X.INT_BITS=V,X.INT_MAX=2147483647,X.INT_MIN=-1<<V-1,X.sign=function(E){return(E>0)-(E<0)},X.abs=function(E){var A=E>>V-1;return(E^A)-A},X.min=function(E,A){return A^(E^A)&-(E<A)},X.max=function(E,A){return E^(E^A)&-(E<A)},X.isPow2=function(E){return!(E&E-1)&&!!E},X.log2=function(E){var A,t;return A=(E>65535)<<4,E>>>=A,t=(E>255)<<3,E>>>=t,A|=t,t=(E>15)<<2,E>>>=t,A|=t,t=(E>3)<<1,E>>>=t,A|=t,A|E>>1},X.log10=function(E){return E>=1e9?9:E>=1e8?8:E>=1e7?7:E>=1e6?6:E>=1e5?5:E>=1e4?4:E>=1e3?3:E>=100?2:E>=10?1:0},X.popCount=function(E){return E=E-(E>>>1&1431655765),E=(E&858993459)+(E>>>2&858993459),(E+(E>>>4)&252645135)*16843009>>>24};function c(E){var A=32;return E&=-E,E&&A--,E&65535&&(A-=16),E&16711935&&(A-=8),E&252645135&&(A-=4),E&858993459&&(A-=2),E&1431655765&&(A-=1),A}X.countTrailingZeros=c,X.nextPow2=function(E){return E+=E===0,--E,E|=E>>>1,E|=E>>>2,E|=E>>>4,E|=E>>>8,E|=E>>>16,E+1},X.prevPow2=function(E){return E|=E>>>1,E|=E>>>2,E|=E>>>4,E|=E>>>8,E|=E>>>16,E-(E>>>1)},X.parity=function(E){return E^=E>>>16,E^=E>>>8,E^=E>>>4,E&=15,27030>>>E&1};var g=new Array(256);(function(E){for(var A=0;A<256;++A){var t=A,e=A,r=7;for(t>>>=1;t;t>>>=1)e<<=1,e|=t&1,--r;E[A]=e<<r&255}})(g),X.reverse=function(E){return g[E&255]<<24|g[E>>>8&255]<<16|g[E>>>16&255]<<8|g[E>>>24&255]},X.interleave2=function(E,A){return E&=65535,E=(E|E<<8)&16711935,E=(E|E<<4)&252645135,E=(E|E<<2)&858993459,E=(E|E<<1)&1431655765,A&=65535,A=(A|A<<8)&16711935,A=(A|A<<4)&252645135,A=(A|A<<2)&858993459,A=(A|A<<1)&1431655765,E|A<<1},X.deinterleave2=function(E,A){return E=E>>>A&1431655765,E=(E|E>>>1)&858993459,E=(E|E>>>2)&252645135,E=(E|E>>>4)&16711935,E=(E|E>>>16)&65535,E<<16>>16},X.interleave3=function(E,A,t){return E&=1023,E=(E|E<<16)&4278190335,E=(E|E<<8)&251719695,E=(E|E<<4)&3272356035,E=(E|E<<2)&1227133513,A&=1023,A=(A|A<<16)&4278190335,A=(A|A<<8)&251719695,A=(A|A<<4)&3272356035,A=(A|A<<2)&1227133513,E|=A<<1,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,E|t<<2},X.deinterleave3=function(E,A){return E=E>>>A&1227133513,E=(E|E>>>2)&3272356035,E=(E|E>>>4)&251719695,E=(E|E>>>8)&4278190335,E=(E|E>>>16)&1023,E<<22>>22},X.nextCombination=function(E){var A=E|E-1;return A+1|(~A&-~A)-1>>>c(E)+1}}),OP=Vt((X,V)=>{function c(A,t,e){var r=A[e]|0;if(r<=0)return[];var i=new Array(r),n;if(e===A.length-1)for(n=0;n<r;++n)i[n]=t;else for(n=0;n<r;++n)i[n]=c(A,t,e+1);return i}function g(A,t){var e,r;for(e=new Array(A),r=0;r<A;++r)e[r]=t;return e}function E(A,t){switch(typeof t>"u"&&(t=0),typeof A){case"number":if(A>0)return g(A|0,t);break;case"object":if(typeof A.length=="number")return c(A,t,0);break}return[]}V.exports=E}),FP=Vt(X=>{var V=r5(),c=OP(),g=m0().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:c([32,0]),UINT16:c([32,0]),UINT32:c([32,0]),BIGUINT64:c([32,0]),INT8:c([32,0]),INT16:c([32,0]),INT32:c([32,0]),BIGINT64:c([32,0]),FLOAT:c([32,0]),DOUBLE:c([32,0]),DATA:c([32,0]),UINT8C:c([32,0]),BUFFER:c([32,0])});var E=typeof Uint8ClampedArray<"u",A=typeof BigUint64Array<"u",t=typeof BigInt64Array<"u",e=window.__TYPEDARRAY_POOL;e.UINT8C||(e.UINT8C=c([32,0])),e.BIGUINT64||(e.BIGUINT64=c([32,0])),e.BIGINT64||(e.BIGINT64=c([32,0])),e.BUFFER||(e.BUFFER=c([32,0]));var r=e.DATA,i=e.BUFFER;X.free=function(u){if(g.isBuffer(u))i[V.log2(u.length)].push(u);else{if(Object.prototype.toString.call(u)!=="[object ArrayBuffer]"&&(u=u.buffer),!u)return;var f=u.length||u.byteLength,k=V.log2(f)|0;r[k].push(u)}};function n(u){if(u){var f=u.length||u.byteLength,k=V.log2(f);r[k].push(u)}}function o(u){n(u.buffer)}X.freeUint8=X.freeUint16=X.freeUint32=X.freeBigUint64=X.freeInt8=X.freeInt16=X.freeInt32=X.freeBigInt64=X.freeFloat32=X.freeFloat=X.freeFloat64=X.freeDouble=X.freeUint8Clamped=X.freeDataView=o,X.freeArrayBuffer=n,X.freeBuffer=function(u){i[V.log2(u.length)].push(u)},X.malloc=function(u,f){if(f===void 0||f==="arraybuffer")return a(u);switch(f){case"uint8":return s(u);case"uint16":return h(u);case"uint32":return v(u);case"int8":return m(u);case"int16":return p(u);case"int32":return y(u);case"float":case"float32":return l(u);case"double":case"float64":return x(u);case"uint8_clamped":return b(u);case"bigint64":return T(u);case"biguint64":return S(u);case"buffer":return w(u);case"data":case"dataview":return M(u);default:return null}return null};function a(f){var f=V.nextPow2(f),k=V.log2(f),_=r[k];return _.length>0?_.pop():new ArrayBuffer(f)}X.mallocArrayBuffer=a;function s(u){return new Uint8Array(a(u),0,u)}X.mallocUint8=s;function h(u){return new Uint16Array(a(2*u),0,u)}X.mallocUint16=h;function v(u){return new Uint32Array(a(4*u),0,u)}X.mallocUint32=v;function m(u){return new Int8Array(a(u),0,u)}X.mallocInt8=m;function p(u){return new Int16Array(a(2*u),0,u)}X.mallocInt16=p;function y(u){return new Int32Array(a(4*u),0,u)}X.mallocInt32=y;function l(u){return new Float32Array(a(4*u),0,u)}X.mallocFloat32=X.mallocFloat=l;function x(u){return new Float64Array(a(8*u),0,u)}X.mallocFloat64=X.mallocDouble=x;function b(u){return E?new Uint8ClampedArray(a(u),0,u):s(u)}X.mallocUint8Clamped=b;function S(u){return A?new BigUint64Array(a(8*u),0,u):null}X.mallocBigUint64=S;function T(u){return t?new BigInt64Array(a(8*u),0,u):null}X.mallocBigInt64=T;function M(u){return new DataView(a(u),0,u)}X.mallocDataView=M;function w(u){u=V.nextPow2(u);var f=V.log2(u),k=i[f];return k.length>0?k.pop():new g(u)}X.mallocBuffer=w,X.clearCache=function(){for(var u=0;u<32;++u)e.UINT8[u].length=0,e.UINT16[u].length=0,e.UINT32[u].length=0,e.INT8[u].length=0,e.INT16[u].length=0,e.INT32[u].length=0,e.FLOAT[u].length=0,e.DOUBLE[u].length=0,e.BIGUINT64[u].length=0,e.BIGINT64[u].length=0,e.UINT8C[u].length=0,r[u].length=0,i[u].length=0}}),BP=Vt((X,V)=>{var c=Object.prototype.toString;V.exports=function(g){var E;return c.call(g)==="[object Object]"&&(E=Object.getPrototypeOf(g),E===null||E===Object.getPrototypeOf({}))}}),n5=Vt((X,V)=>{V.exports=function(c,g){g||(g=[0,""]),c=String(c);var E=parseFloat(c,10);return g[0]=E,g[1]=c.match(/[\d.\-\+]*\s*(.*)/)[1]||"",g}}),RP=Vt((X,V)=>{var c=n5();V.exports=t;var g=96;function E(e,r){var i=c(getComputedStyle(e).getPropertyValue(r));return i[0]*t(i[1],e)}function A(e,r){var i=document.createElement("div");i.style["font-size"]="128"+e,r.appendChild(i);var n=E(i,"font-size")/128;return r.removeChild(i),n}function t(e,r){switch(r=r||document.body,e=(e||"px").trim().toLowerCase(),(r===window||r===document)&&(r=document.body),e){case"%":return r.clientHeight/100;case"ch":case"ex":return A(e,r);case"em":return E(r,"font-size");case"rem":return E(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return g;case"cm":return g/2.54;case"mm":return g/25.4;case"pt":return g/72;case"pc":return g/6}return 1}}),jP=Vt((X,V)=>{V.exports=A;var c=A.canvas=document.createElement("canvas"),g=c.getContext("2d"),E=t([32,126]);A.createPairs=t,A.ascii=E;function A(e,r){Array.isArray(e)&&(e=e.join(", "));var i={},n,o=16,a=.05;r&&(r.length===2&&typeof r[0]=="number"?n=t(r):Array.isArray(r)?n=r:(r.o?n=t(r.o):r.pairs&&(n=r.pairs),r.fontSize&&(o=r.fontSize),r.threshold!=null&&(a=r.threshold))),n||(n=E),g.font=o+"px "+e;for(var s=0;s<n.length;s++){var h=n[s],v=g.measureText(h[0]).width+g.measureText(h[1]).width,m=g.measureText(h).width;if(Math.abs(v-m)>o*a){var p=(m-v)/o;i[h]=p*1e3}}return i}function t(e){for(var r=[],i=e[0];i<=e[1];i++)for(var n=String.fromCharCode(i),o=e[0];o<e[1];o++){var a=String.fromCharCode(o),s=n+a;r.push(s)}return r}}),NP=Vt((X,V)=>{V.exports=c,c.canvas=document.createElement("canvas"),c.cache={};function c(a,e){e||(e={}),(typeof a=="string"||Array.isArray(a))&&(e.family=a);var r=Array.isArray(e.family)?e.family.join(", "):e.family;if(!r)throw Error("`family` must be defined");var i=e.size||e.fontSize||e.em||48,n=e.weight||e.fontWeight||"",o=e.style||e.fontStyle||"",a=[o,n,i].join(" ")+"px "+r,s=e.origin||"top";if(c.cache[r]&&i<=c.cache[r].em)return g(c.cache[r],s);var h=e.canvas||c.canvas,v=h.getContext("2d"),m={upper:e.upper!==void 0?e.upper:"H",lower:e.lower!==void 0?e.lower:"x",descent:e.descent!==void 0?e.descent:"p",ascent:e.ascent!==void 0?e.ascent:"h",tittle:e.tittle!==void 0?e.tittle:"i",overshoot:e.overshoot!==void 0?e.overshoot:"O"},p=Math.ceil(i*1.5);h.height=p,h.width=p*.5,v.font=a;var y="H",l={top:0};v.clearRect(0,0,p,p),v.textBaseline="top",v.fillStyle="black",v.fillText(y,0,0);var x=E(v.getImageData(0,0,p,p));v.clearRect(0,0,p,p),v.textBaseline="bottom",v.fillText(y,0,p);var b=E(v.getImageData(0,0,p,p));l.lineHeight=l.bottom=p-b+x,v.clearRect(0,0,p,p),v.textBaseline="alphabetic",v.fillText(y,0,p);var S=E(v.getImageData(0,0,p,p)),T=p-S-1+x;l.baseline=l.alphabetic=T,v.clearRect(0,0,p,p),v.textBaseline="middle",v.fillText(y,0,p*.5);var M=E(v.getImageData(0,0,p,p));l.median=l.middle=p-M-1+x-p*.5,v.clearRect(0,0,p,p),v.textBaseline="hanging",v.fillText(y,0,p*.5);var w=E(v.getImageData(0,0,p,p));l.hanging=p-w-1+x-p*.5,v.clearRect(0,0,p,p),v.textBaseline="ideographic",v.fillText(y,0,p);var u=E(v.getImageData(0,0,p,p));if(l.ideographic=p-u-1+x,m.upper&&(v.clearRect(0,0,p,p),v.textBaseline="top",v.fillText(m.upper,0,0),l.upper=E(v.getImageData(0,0,p,p)),l.capHeight=l.baseline-l.upper),m.lower&&(v.clearRect(0,0,p,p),v.textBaseline="top",v.fillText(m.lower,0,0),l.lower=E(v.getImageData(0,0,p,p)),l.xHeight=l.baseline-l.lower),m.tittle&&(v.clearRect(0,0,p,p),v.textBaseline="top",v.fillText(m.tittle,0,0),l.tittle=E(v.getImageData(0,0,p,p))),m.ascent&&(v.clearRect(0,0,p,p),v.textBaseline="top",v.fillText(m.ascent,0,0),l.ascent=E(v.getImageData(0,0,p,p))),m.descent&&(v.clearRect(0,0,p,p),v.textBaseline="top",v.fillText(m.descent,0,0),l.descent=A(v.getImageData(0,0,p,p))),m.overshoot){v.clearRect(0,0,p,p),v.textBaseline="top",v.fillText(m.overshoot,0,0);var f=A(v.getImageData(0,0,p,p));l.overshoot=f-T}for(var k in l)l[k]/=i;return l.em=i,c.cache[r]=l,g(l,s)}function g(t,e){var r={};typeof e=="string"&&(e=t[e]);for(var i in t)i!=="em"&&(r[i]=t[i]-e);return r}function E(t){for(var e=t.height,r=t.data,i=3;i<r.length;i+=4)if(r[i]!==0)return Math.floor((i-3)*.25/e)}function A(t){for(var e=t.height,r=t.data,i=r.length-1;i>0;i-=4)if(r[i]!==0)return Math.floor((i-3)*.25/e)}}),UP=Vt((X,V)=>{var c=CP(),g=kp(),E=e5(),A=DP(),t=W3(),e=jd(),r=zP(),i=FP(),n=Zg(),o=BP(),a=n5(),s=RP(),h=jP(),v=Gc(),m=NP(),p=I0(),y=r5(),l=y.nextPow2,x=new t,b=!1;document.body&&(S=document.body.appendChild(document.createElement("div")),S.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(S).fontStretch&&(b=!0),document.body.removeChild(S));var S,T=function(w){M(w)?(w={regl:w},this.gl=w.regl._gl):this.gl=A(w),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=w.regl||E({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),x.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(o(w)?w:{})};T.prototype.createShader=function(){var w=this.regl,u=w({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:w.prop("count"),offset:w.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:w.this("sizeBuffer")},width:{offset:0,stride:8,buffer:w.this("sizeBuffer")},char:w.this("charBuffer"),position:w.this("position")},uniforms:{atlasSize:function(k,_){return[_.atlas.width,_.atlas.height]},atlasDim:function(k,_){return[_.atlas.cols,_.atlas.rows]},atlas:function(k,_){return _.atlas.texture},charStep:function(k,_){return _.atlas.step},em:function(k,_){return _.atlas.em},color:w.prop("color"),opacity:w.prop("opacity"),viewport:w.this("viewportArray"),scale:w.this("scale"),align:w.prop("align"),baseline:w.prop("baseline"),translate:w.this("translate"),positionOffset:w.prop("positionOffset")},primitive:"points",viewport:w.this("viewport"),vert:`
|
||
precision highp float;
|
||
attribute float width, charOffset, char;
|
||
attribute vec2 position;
|
||
uniform float fontSize, charStep, em, align, baseline;
|
||
uniform vec4 viewport;
|
||
uniform vec4 color;
|
||
uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;
|
||
varying vec2 charCoord, charId;
|
||
varying float charWidth;
|
||
varying vec4 fontColor;
|
||
void main () {
|
||
vec2 offset = floor(em * (vec2(align + charOffset, baseline)
|
||
+ vec2(positionOffset.x, -positionOffset.y)))
|
||
/ (viewport.zw * scale.xy);
|
||
|
||
vec2 position = (position + translate) * scale;
|
||
position += offset * scale;
|
||
|
||
charCoord = position * viewport.zw + viewport.xy;
|
||
|
||
gl_Position = vec4(position * 2. - 1., 0, 1);
|
||
|
||
gl_PointSize = charStep;
|
||
|
||
charId.x = mod(char, atlasDim.x);
|
||
charId.y = floor(char / atlasDim.x);
|
||
|
||
charWidth = width * em;
|
||
|
||
fontColor = color / 255.;
|
||
}`,frag:`
|
||
precision highp float;
|
||
uniform float fontSize, charStep, opacity;
|
||
uniform vec2 atlasSize;
|
||
uniform vec4 viewport;
|
||
uniform sampler2D atlas;
|
||
varying vec4 fontColor;
|
||
varying vec2 charCoord, charId;
|
||
varying float charWidth;
|
||
|
||
float lightness(vec4 color) {
|
||
return color.r * 0.299 + color.g * 0.587 + color.b * 0.114;
|
||
}
|
||
|
||
void main () {
|
||
vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;
|
||
float halfCharStep = floor(charStep * .5 + .5);
|
||
|
||
// invert y and shift by 1px (FF expecially needs that)
|
||
uv.y = charStep - uv.y;
|
||
|
||
// ignore points outside of character bounding box
|
||
float halfCharWidth = ceil(charWidth * .5);
|
||
if (floor(uv.x) > halfCharStep + halfCharWidth ||
|
||
floor(uv.x) < halfCharStep - halfCharWidth) return;
|
||
|
||
uv += charId * charStep;
|
||
uv = uv / atlasSize;
|
||
|
||
vec4 color = fontColor;
|
||
vec4 mask = texture2D(atlas, uv);
|
||
|
||
float maskY = lightness(mask);
|
||
// float colorY = lightness(color);
|
||
color.a *= maskY;
|
||
color.a *= opacity;
|
||
|
||
// color.a += .1;
|
||
|
||
// antialiasing, see yiq color space y-channel formula
|
||
// color.rgb += (1. - color.rgb) * (1. - mask.rgb);
|
||
|
||
gl_FragColor = color;
|
||
}`}),f={};return{regl:w,draw:u,atlas:f}},T.prototype.update=function(w){var u=this;if(typeof w=="string")w={text:w};else if(!w)return;w=g(w,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0),w.opacity!=null&&(Array.isArray(w.opacity)?this.opacity=w.opacity.map(function(bt){return parseFloat(bt)}):this.opacity=parseFloat(w.opacity)),w.viewport!=null&&(this.viewport=n(w.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),w.kerning!=null&&(this.kerning=w.kerning),w.offset!=null&&(typeof w.offset=="number"&&(w.offset=[w.offset,0]),this.positionOffset=p(w.offset)),w.direction&&(this.direction=w.direction),w.range&&(this.range=w.range,this.scale=[1/(w.range[2]-w.range[0]),1/(w.range[3]-w.range[1])],this.translate=[-w.range[0],-w.range[1]]),w.scale&&(this.scale=w.scale),w.translate&&(this.translate=w.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!w.font&&(w.font=T.baseFontSize+"px sans-serif");var f=!1,k=!1;if(w.font&&(Array.isArray(w.font)?w.font:[w.font]).forEach(function(bt,vt){if(typeof bt=="string")try{bt=c.parse(bt)}catch{bt=c.parse(T.baseFontSize+"px "+bt)}else{var Ut=bt.style,Kt=bt.weight,Zt=bt.stretch,le=bt.variant;bt=c.parse(c.stringify(bt)),Ut&&(bt.style=Ut),Kt&&(bt.weight=Kt),Zt&&(bt.stretch=Zt),le&&(bt.variant=le)}var Te=c.stringify({size:T.baseFontSize,family:bt.family,stretch:b?bt.stretch:void 0,variant:bt.variant,weight:bt.weight,style:bt.style}),Se=a(bt.size),Fe=Math.round(Se[0]*s(Se[1]));if(Fe!==u.fontSize[vt]&&(k=!0,u.fontSize[vt]=Fe),(!u.font[vt]||Te!=u.font[vt].baseString)&&(f=!0,u.font[vt]=T.fonts[Te],!u.font[vt])){var Oe=bt.family.join(", "),ur=[bt.style];bt.style!=bt.variant&&ur.push(bt.variant),bt.variant!=bt.weight&&ur.push(bt.weight),b&&bt.weight!=bt.stretch&&ur.push(bt.stretch),u.font[vt]={baseString:Te,family:Oe,weight:bt.weight,stretch:bt.stretch,style:bt.style,variant:bt.variant,width:{},kerning:{},metrics:m(Oe,{origin:"top",fontSize:T.baseFontSize,fontStyle:ur.join(" ")})},T.fonts[Te]=u.font[vt]}}),(f||k)&&this.font.forEach(function(bt,vt){var Ut=c.stringify({size:u.fontSize[vt],family:bt.family,stretch:b?bt.stretch:void 0,variant:bt.variant,weight:bt.weight,style:bt.style});if(u.fontAtlas[vt]=u.shader.atlas[Ut],!u.fontAtlas[vt]){var Kt=bt.metrics;u.shader.atlas[Ut]=u.fontAtlas[vt]={fontString:Ut,step:Math.ceil(u.fontSize[vt]*Kt.bottom*.5)*2,em:u.fontSize[vt],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:u.regl.texture()}}w.text==null&&(w.text=u.text)}),typeof w.text=="string"&&w.position&&w.position.length>2){for(var _=Array(w.position.length*.5),D=0;D<_.length;D++)_[D]=w.text;w.text=_}var I;if(w.text!=null||f){if(this.textOffsets=[0],Array.isArray(w.text)){this.count=w.text[0].length,this.counts=[this.count];for(var O=1;O<w.text.length;O++)this.textOffsets[O]=this.textOffsets[O-1]+w.text[O-1].length,this.count+=w.text[O].length,this.counts.push(w.text[O].length);this.text=w.text.join("")}else this.text=w.text,this.count=this.text.length,this.counts=[this.count];I=[],this.font.forEach(function(bt,vt){T.atlasContext.font=bt.baseString;for(var Ut=u.fontAtlas[vt],Kt=0;Kt<u.text.length;Kt++){var Zt=u.text.charAt(Kt);if(Ut.ids[Zt]==null&&(Ut.ids[Zt]=Ut.chars.length,Ut.chars.push(Zt),I.push(Zt)),bt.width[Zt]==null&&(bt.width[Zt]=T.atlasContext.measureText(Zt).width/T.baseFontSize,u.kerning)){var le=[];for(var Te in bt.width)le.push(Te+Zt,Zt+Te);v(bt.kerning,h(bt.family,{pairs:le}))}}})}if(w.position)if(w.position.length>2){for(var B=!w.position[0].length,R=i.mallocFloat(this.count*2),L=0,F=0;L<this.counts.length;L++){var N=this.counts[L];if(B)for(var j=0;j<N;j++)R[F++]=w.position[L*2],R[F++]=w.position[L*2+1];else for(var G=0;G<N;G++)R[F++]=w.position[L][0],R[F++]=w.position[L][1]}this.position.call?this.position({type:"float",data:R}):this.position=this.regl.buffer({type:"float",data:R}),i.freeFloat(R)}else this.position.destroy&&this.position.destroy(),this.position={constant:w.position};if(w.text||f){var rt=i.mallocUint8(this.count),ct=i.mallocFloat(this.count*2);this.textWidth=[];for(var lt=0,tt=0;lt<this.counts.length;lt++){for(var Z=this.counts[lt],st=this.font[lt]||this.font[0],$=this.fontAtlas[lt]||this.fontAtlas[0],Q=0;Q<Z;Q++){var nt=this.text.charAt(tt),Y=this.text.charAt(tt-1);if(rt[tt]=$.ids[nt],ct[tt*2]=st.width[nt],Q){var q=ct[tt*2-2],ot=ct[tt*2],it=ct[tt*2-1],dt=it+q*.5+ot*.5;if(this.kerning){var wt=st.kerning[Y+nt];wt&&(dt+=wt*.001)}ct[tt*2+1]=dt}else ct[tt*2+1]=ct[tt*2]*.5;tt++}this.textWidth.push(ct.length?ct[tt*2-2]*.5+ct[tt*2-1]:0)}w.align||(w.align=this.align),this.charBuffer({data:rt,type:"uint8",usage:"stream"}),this.sizeBuffer({data:ct,type:"float",usage:"stream"}),i.freeUint8(rt),i.freeFloat(ct),I.length&&this.font.forEach(function(bt,vt){var Ut=u.fontAtlas[vt],Kt=Ut.step,Zt=Math.floor(T.maxAtlasSize/Kt),le=Math.min(Zt,Ut.chars.length),Te=Math.ceil(Ut.chars.length/le),Se=l(le*Kt),Fe=l(Te*Kt);Ut.width=Se,Ut.height=Fe,Ut.rows=Te,Ut.cols=le,Ut.em&&Ut.texture({data:r({canvas:T.atlasCanvas,font:Ut.fontString,chars:Ut.chars,shape:[Se,Fe],step:[Kt,Kt]})})})}if(w.align&&(this.align=w.align,this.alignOffset=this.textWidth.map(function(bt,vt){var Ut=Array.isArray(u.align)?u.align.length>1?u.align[vt]:u.align[0]:u.align;if(typeof Ut=="number")return Ut;switch(Ut){case"right":case"end":return-bt;case"center":case"centre":case"middle":return-bt*.5}return 0})),this.baseline==null&&w.baseline==null&&(w.baseline=0),w.baseline!=null&&(this.baseline=w.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(bt,vt){var Ut=(u.font[vt]||u.font[0]).metrics,Kt=0;return Kt+=Ut.bottom*.5,typeof bt=="number"?Kt+=bt-Ut.baseline:Kt+=-Ut[bt],Kt*=-1,Kt})),w.color!=null)if(w.color||(w.color="transparent"),typeof w.color=="string"||!isNaN(w.color))this.color=e(w.color,"uint8");else{var xt;if(typeof w.color[0]=="number"&&w.color.length>this.counts.length){var Ft=w.color.length;xt=i.mallocUint8(Ft);for(var Et=(w.color.subarray||w.color.slice).bind(w.color),Nt=0;Nt<Ft;Nt+=4)xt.set(e(Et(Nt,Nt+4),"uint8"),Nt)}else{var te=w.color.length;xt=i.mallocUint8(te*4);for(var Jt=0;Jt<te;Jt++)xt.set(e(w.color[Jt]||0,"uint8"),Jt*4)}this.color=xt}if(w.position||w.text||w.color||w.baseline||w.align||w.font||w.offset||w.opacity){var Qt=this.color.length>4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(Qt){var Wt=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(Wt);for(var gt=0;gt<this.batch.length;gt++)this.batch[gt]={count:this.counts.length>1?this.counts[gt]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[gt]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(gt*4,gt*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[gt]:this.opacity,baseline:this.baselineOffset[gt]!=null?this.baselineOffset[gt]:this.baselineOffset[0],align:this.align?this.alignOffset[gt]!=null?this.alignOffset[gt]:this.alignOffset[0]:0,atlas:this.fontAtlas[gt]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(gt*2,gt*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},T.prototype.destroy=function(){},T.prototype.kerning=!0,T.prototype.position={constant:new Float32Array(2)},T.prototype.translate=null,T.prototype.scale=null,T.prototype.font=null,T.prototype.text="",T.prototype.positionOffset=[0,0],T.prototype.opacity=1,T.prototype.color=new Uint8Array([0,0,0,255]),T.prototype.alignOffset=[0,0],T.maxAtlasSize=1024,T.atlasCanvas=document.createElement("canvas"),T.atlasContext=T.atlasCanvas.getContext("2d",{alpha:!1}),T.baseFontSize=64,T.fonts={};function M(w){return typeof w=="function"&&w._gl&&w.prop&&w.texture&&w.buffer}V.exports=T}),Nx=Vt((X,V)=>{var c=p3(),g=e5();V.exports=function(E,A,t){var e=E._fullLayout,r=!0;return e._glcanvas.each(function(i){if(i.regl){i.regl.preloadCachedCode(t);return}if(!(i.pick&&!e._has("parcoords"))){try{i.regl=g({canvas:this,attributes:{antialias:!i.pick,preserveDrawingBuffer:!0},pixelRatio:E._context.plotGlPixelRatio||window.devicePixelRatio,extensions:A||[],cachedCode:t||{}})}catch{r=!1}i.regl||(r=!1),r&&this.addEventListener("webglcontextlost",function(n){E&&E.emit&&E.emit("plotly_webglcontextlost",{event:n,layer:i.key})},!1)}}),r||c({container:e._glcontainer.node()}),r}}),a5=Vt((h,V)=>{var c=O3(),g=Z3(),E=MP(),A=UP(),t=qr(),e=ep().selectMode,r=Nx(),i=Sl(),n=Lb(),o=C3().styleTextSelection,a={};function s(v,m,p,y){var l=v._size,x=v.width*y,b=v.height*y,S=l.l*y,T=l.b*y,M=l.r*y,w=l.t*y,u=l.w*y,f=l.h*y;return[S+m.domain[0]*u,T+p.domain[0]*f,x-M-(1-m.domain[1])*u,b-w-(1-p.domain[1])*f]}var h=V.exports=function(v,m,p){if(p.length){var y=v._fullLayout,l=m._scene,x=m.xaxis,b=m.yaxis,S,T;if(l){var M=r(v,["ANGLE_instanced_arrays","OES_element_index_uint"],a);if(!M){l.init();return}var w=l.count,u=y._glcanvas.data()[0].regl;if(n(v,m,p),l.dirty){if((l.line2d||l.error2d)&&!(l.scatter2d||l.fill2d||l.glText)&&u.clear({}),l.error2d===!0&&(l.error2d=E(u)),l.line2d===!0&&(l.line2d=g(u)),l.scatter2d===!0&&(l.scatter2d=c(u)),l.fill2d===!0&&(l.fill2d=g(u)),l.glText===!0)for(l.glText=new Array(w),S=0;S<w;S++)l.glText[S]=new A(u);if(l.glText){if(w>l.glText.length){var f=w-l.glText.length;for(S=0;S<f;S++)l.glText.push(new A(u))}else if(w<l.glText.length){var k=l.glText.length-w,_=l.glText.splice(w,k);_.forEach(function(Y){Y.destroy()})}for(S=0;S<w;S++)l.glText[S].update(l.textOptions[S])}if(l.line2d&&(l.line2d.update(l.lineOptions),l.lineOptions=l.lineOptions.map(function(Y){if(Y&&Y.positions){for(var q=Y.positions,ot=0;ot<q.length&&(isNaN(q[ot])||isNaN(q[ot+1]));)ot+=2;for(var it=q.length-2;it>ot&&(isNaN(q[it])||isNaN(q[it+1]));)it-=2;Y.positions=q.slice(ot,it+2)}return Y}),l.line2d.update(l.lineOptions)),l.error2d){var D=(l.errorXOptions||[]).concat(l.errorYOptions||[]);l.error2d.update(D)}l.scatter2d&&l.scatter2d.update(l.markerOptions),l.fillOrder=t.repeat(null,w),l.fill2d&&(l.fillOptions=l.fillOptions.map(function(Y,q){var ot=p[q];if(!(!Y||!ot||!ot[0]||!ot[0].trace)){var it=ot[0],dt=it.trace,wt=it.t,xt=l.lineOptions[q],Ft,Et,Nt=[];dt._ownfill&&Nt.push(q),dt._nexttrace&&Nt.push(q+1),Nt.length&&(l.fillOrder[q]=Nt);var te=[],Jt=xt&&xt.positions||wt.positions,Qt,Wt;if(dt.fill==="tozeroy"){for(Qt=0;Qt<Jt.length&&isNaN(Jt[Qt+1]);)Qt+=2;for(Wt=Jt.length-2;Wt>Qt&&isNaN(Jt[Wt+1]);)Wt-=2;Jt[Qt+1]!==0&&(te=[Jt[Qt],0]),te=te.concat(Jt.slice(Qt,Wt+2)),Jt[Wt+1]!==0&&(te=te.concat([Jt[Wt],0]))}else if(dt.fill==="tozerox"){for(Qt=0;Qt<Jt.length&&isNaN(Jt[Qt]);)Qt+=2;for(Wt=Jt.length-2;Wt>Qt&&isNaN(Jt[Wt]);)Wt-=2;Jt[Qt]!==0&&(te=[0,Jt[Qt+1]]),te=te.concat(Jt.slice(Qt,Wt+2)),Jt[Wt]!==0&&(te=te.concat([0,Jt[Wt+1]]))}else if(dt.fill==="toself"||dt.fill==="tonext"){for(te=[],Ft=0,Y.splitNull=!0,Et=0;Et<Jt.length;Et+=2)(isNaN(Jt[Et])||isNaN(Jt[Et+1]))&&(te=te.concat(Jt.slice(Ft,Et)),te.push(Jt[Ft],Jt[Ft+1]),te.push(null,null),Ft=Et+2);te=te.concat(Jt.slice(Ft)),Ft&&te.push(Jt[Ft],Jt[Ft+1])}else{var gt=dt._nexttrace;if(gt){var bt=l.lineOptions[q+1];if(bt){var vt=bt.positions;if(dt.fill==="tonexty"){for(te=Jt.slice(),q=Math.floor(vt.length/2);q--;){var Ut=vt[q*2],Kt=vt[q*2+1];isNaN(Ut)||isNaN(Kt)||te.push(Ut,Kt)}Y.fill=gt.fillcolor}}}}if(dt._prevtrace&&dt._prevtrace.fill==="tonext"){var Zt=l.lineOptions[q-1].positions,le=te.length/2;Ft=le;var Te=[Ft];for(Et=0;Et<Zt.length;Et+=2)(isNaN(Zt[Et])||isNaN(Zt[Et+1]))&&(Te.push(Et/2+le+1),Ft=Et+2);te=te.concat(Zt),Y.hole=Te}return Y.fillmode=dt.fill,Y.opacity=dt.opacity,Y.positions=te,Y}}),l.fill2d.update(l.fillOptions))}var I=y.dragmode,O=e(I),B=y.clickmode.indexOf("select")>-1;for(S=0;S<w;S++){var R=p[S][0],L=R.trace,F=R.t,N=F.index,j=L._length,G=F.x,rt=F.y;if(L.selectedpoints||O||B){if(O||(O=!0),L.selectedpoints){var ct=l.selectBatch[N]=t.selIndices2selPoints(L),lt={};for(T=0;T<ct.length;T++)lt[ct[T]]=1;var tt=[];for(T=0;T<j;T++)lt[T]||tt.push(T);l.unselectBatch[N]=tt}var Z=F.xpx=new Array(j),st=F.ypx=new Array(j);for(T=0;T<j;T++)Z[T]=x.c2p(G[T]),st[T]=b.c2p(rt[T])}else F.xpx=F.ypx=null}if(O){if(l.select2d||(l.select2d=c(y._glcanvas.data()[1].regl)),l.scatter2d){var $=new Array(w);for(S=0;S<w;S++)$[S]=l.selectBatch[S].length||l.unselectBatch[S].length?l.markerUnselectedOptions[S]:{};l.scatter2d.update($)}l.select2d&&(l.select2d.update(l.markerOptions),l.select2d.update(l.markerSelectedOptions)),l.glText&&p.forEach(function(Y){var q=((Y||[])[0]||{}).trace||{};i.hasText(q)&&o(Y)})}else l.scatter2d&&l.scatter2d.update(l.markerOptions);var Q={viewport:s(y,x,b,v._context.plotGlPixelRatio),range:[(x._rl||x.range)[0],(b._rl||b.range)[0],(x._rl||x.range)[1],(b._rl||b.range)[1]]},nt=t.repeat(Q,l.count);l.fill2d&&l.fill2d.update(nt),l.line2d&&l.line2d.update(nt),l.error2d&&l.error2d.update(nt.concat(nt)),l.scatter2d&&l.scatter2d.update(nt),l.select2d&&l.select2d.update(nt),l.glText&&l.glText.forEach(function(Y){Y.update(Q)})}}};h.reglPrecompiled=a}),VP=Vt((X,V)=>{var c=k8();c.plot=a5(),V.exports=c}),qP=Vt((X,V)=>{V.exports=VP()}),i5=Vt((X,V)=>{var c=Gu(),g=wl(),E=qu().axisHoverFormat,A=Zo().hovertemplateAttrs,t=Ev(),e=xh().idRegex,r=Ns().templatedArray,i=po().extendFlat,n=c.marker,o=n.line,a=i(g("marker.line",{editTypeOverride:"calc"}),{width:i({},o.width,{editType:"calc"}),editType:"calc"}),s=i(g("marker"),{symbol:n.symbol,angle:n.angle,size:i({},n.size,{editType:"markerSize"}),sizeref:n.sizeref,sizemin:n.sizemin,sizemode:n.sizemode,opacity:n.opacity,colorbar:n.colorbar,line:a,editType:"calc"});s.color.editType=s.cmin.editType=s.cmax.editType="style";function h(v){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:e[v],editType:"plot"}}}V.exports={dimensions:r("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:i({},t.text,{}),hovertext:i({},t.hovertext,{}),hovertemplate:A(),xhoverformat:E("x"),yhoverformat:E("y"),marker:s,xaxes:h("x"),yaxes:h("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:t.selected.marker,editType:"calc"},unselected:{marker:t.unselected.marker,editType:"calc"},opacity:t.opacity}}),Ux=Vt((X,V)=>{V.exports=function(c,g,E,A){A||(A=1/0);var t,e;for(t=0;t<g.length;t++)e=g[t],e.visible&&(A=Math.min(A,e[E].length));for(A===1/0&&(A=0),c._length=A,t=0;t<g.length;t++)e=g[t],e.visible&&(e._length=A);return A}}),HP=Vt((X,V)=>{var c=qr(),g=Gh(),E=i5(),A=Sl(),t=Df(),e=Ux(),r=zx().isOpenSymbol;V.exports=function(o,a,s,h){function v(T,M){return c.coerce(o,a,E,T,M)}var m=g(o,a,{name:"dimensions",handleItemDefaults:i}),p=v("diagonal.visible"),y=v("showupperhalf"),l=v("showlowerhalf"),x=e(a,m,"values");if(!x||!p&&!y&&!l){a.visible=!1;return}v("text"),v("hovertext"),v("hovertemplate"),v("xhoverformat"),v("yhoverformat"),t(o,a,s,h,v,{noAngleRef:!0,noStandOff:!0});var b=r(a.marker.symbol),S=A.isBubble(a);v("marker.line.width",b||S?1:0),n(o,a,h,v),c.coerceSelectionMarkerOpacity(a,v)};function i(o,a){function s(v,m){return c.coerce(o,a,E.dimensions,v,m)}s("label");var h=s("values");h&&h.length?s("visible"):a.visible=!1,s("axis.type"),s("axis.matches")}function n(o,a,s,h){var v=a.dimensions,m=v.length,p=a.showupperhalf,y=a.showlowerhalf,l=a.diagonal.visible,x,b,S=new Array(m),T=new Array(m);for(x=0;x<m;x++){var M=x?x+1:"";S[x]="x"+M,T[x]="y"+M}var w=h("xaxes",S),u=h("yaxes",T),f=a._diag=new Array(m);a._xaxes={},a._yaxes={};var k=[],_=[];function D(G,rt,ct,lt){if(G){var tt=G.charAt(0),Z=s._splomAxes[tt];if(a["_"+tt+"axes"][G]=1,lt.push(G),!(G in Z)){var st=Z[G]={};ct&&(st.label=ct.label||"",ct.visible&&ct.axis&&(ct.axis.type&&(st.type=ct.axis.type),ct.axis.matches&&(st.matches=rt)))}}}var I=!l&&!y,O=!l&&!p;for(a._axesDim={},x=0;x<m;x++){var B=v[x],R=x===0,L=x===m-1,F=R&&I||L&&O?void 0:w[x],N=R&&O||L&&I?void 0:u[x];D(F,N,B,k),D(N,F,B,_),f[x]=[F,N],a._axesDim[F]=x,a._axesDim[N]=x}for(x=0;x<k.length;x++)for(b=0;b<_.length;b++){var j=k[x]+_[b];(x>b&&p||x<b&&y||x===b&&(l||!y||!p))&&(s._splomSubplots[j]=1)}(!y||!l&&p&&y)&&(s._splomGridDflt.xside="bottom",s._splomGridDflt.yside="left")}}),GP=Vt((X,V)=>{var c=qr();V.exports=function(g,E){var A=g._fullLayout,t=E.uid,e=A._splomScenes;e||(e=A._splomScenes={});var r={dirty:!0,selectBatch:[],unselectBatch:[]},i={matrix:!1,selectBatch:[],unselectBatch:[]},n=e[E.uid];return n||(n=e[t]=c.extendFlat({},r,i),n.draw=function(){n.matrix&&n.matrix.draw&&(n.selectBatch.length||n.unselectBatch.length?n.matrix.draw(n.unselectBatch,n.selectBatch):n.matrix.draw()),n.dirty=!1},n.destroy=function(){n.matrix&&n.matrix.destroy&&n.matrix.destroy(),n.matrixOptions=null,n.selectBatch=null,n.unselectBatch=null,n=null}),n.dirty||c.extendFlat(n,r),n}}),WP=Vt((X,V)=>{var c=qr(),g=rc(),E=Hf().calcMarkerSize,A=Hf().calcAxisExpansion,t=Vf(),e=L0().markerSelection,r=L0().markerStyle,i=GP(),n=ts().BADNUM,o=qd().TOO_MANY_POINTS;V.exports=function(a,s){var h=s.dimensions,v=s._length,m={},p=m.cdata=[],y=m.data=[],l=s._visibleDims=[],x,b,S,T,M;function w(D,I){for(var O=D.makeCalcdata({v:I.values,vcalendar:s.calendar},"v"),B=0;B<O.length;B++)O[B]=O[B]===n?NaN:O[B];p.push(O),y.push(D.type==="log"?c.simpleMap(O,D.c2l):O)}for(x=0;x<h.length;x++)if(S=h[x],S.visible){if(T=g.getFromId(a,s._diag[x][0]),M=g.getFromId(a,s._diag[x][1]),T&&M&&T.type!==M.type){c.log("Skipping splom dimension "+x+" with conflicting axis types");continue}T?(w(T,S),M&&M.type==="category"&&(M._categories=T._categories.slice())):w(M,S),l.push(x)}t(a,s),c.extendFlat(m,r(a,s));var u=p.length,f=u*v>o,k;for(f?k=m.sizeAvg||Math.max(m.size,3):k=E(s,v),b=0;b<l.length;b++)x=l[b],S=h[x],T=g.getFromId(a,s._diag[x][0])||{},M=g.getFromId(a,s._diag[x][1])||{},A(a,s,T,M,p[b],p[b],k);var _=i(a,s);return _.matrix||(_.matrix=!0),_.matrixOptions=m,_.selectedOptions=e(a,s,s.selected),_.unselectedOptions=e(a,s,s.unselected),[{x:!1,y:!1,t:{},trace:s}]}}),ZP=Vt((X,V)=>{(function(){var c,g,E,A,t,e;typeof performance<"u"&&performance!==null&&performance.now?V.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(V.exports=function(){return(c()-t)/1e6},g=process.hrtime,c=function(){var r;return r=g(),r[0]*1e9+r[1]},A=c(),e=process.uptime()*1e9,t=A-e):Date.now?(V.exports=function(){return Date.now()-E},E=Date.now()):(V.exports=function(){return new Date().getTime()-E},E=new Date().getTime())}).call(X)}),XP=Vt((X,V)=>{var c=ZP(),g=window,E=["moz","webkit"],A="AnimationFrame",t=g["request"+A],e=g["cancel"+A]||g["cancelRequest"+A];for(r=0;!t&&r<E.length;r++)t=g[E[r]+"Request"+A],e=g[E[r]+"Cancel"+A]||g[E[r]+"CancelRequest"+A];var r;(!t||!e)&&(i=0,n=0,o=[],a=1e3/60,t=function(s){if(o.length===0){var h=c(),v=Math.max(0,a-(h-i));i=v+h,setTimeout(function(){var m=o.slice(0);o.length=0;for(var p=0;p<m.length;p++)if(!m[p].cancelled)try{m[p].callback(i)}catch(y){setTimeout(function(){throw y},0)}},Math.round(v))}return o.push({handle:++n,callback:s,cancelled:!1}),n},e=function(s){for(var h=0;h<o.length;h++)o[h].handle===s&&(o[h].cancelled=!0)});var i,n,o,a;V.exports=function(s){return t.call(g,s)},V.exports.cancel=function(){e.apply(g,arguments)},V.exports.polyfill=function(s){s||(s=g),s.requestAnimationFrame=t,s.cancelAnimationFrame=e}}),$P=Vt((X,V)=>{V.exports=function(c,g){var E=typeof c=="number",A=typeof g=="number";E&&!A?(g=c,c=0):!E&&!A&&(c=0,g=0),c=c|0,g=g|0;var t=g-c;if(t<0)throw new Error("array length must be positive");for(var e=new Array(t),r=0,i=c;r<t;r++,i++)e[r]=i;return e}}),JP=Vt((X,V)=>{var c=O3(),g=kp(),E=P0(),A=XP(),t=$P(),e=Zg(),r=I0();V.exports=i;function i(s,h){if(!(this instanceof i))return new i(s);this.traces=[],this.passes={},this.regl=s,this.scatter=c(s),this.canvas=this.scatter.canvas}i.prototype.render=function(...s){return s.length&&this.update(...s),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?this.planned==null&&(this.planned=A(()=>{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,A(()=>{this.dirty=!1})),this)},i.prototype.update=function(...s){if(!s.length)return;for(let m=0;m<s.length;m++)this.updateItem(m,s[m]);this.traces=this.traces.filter(Boolean);let h=[],v=0;for(let m=0;m<this.traces.length;m++){let p=this.traces[m],y=this.traces[m].passes;for(let l=0;l<y.length;l++)h.push(this.passes[y[l]]);p.passOffset=v,v+=p.passes.length}return this.scatter.update(...h),this},i.prototype.updateItem=function(s,h){let{regl:v}=this;if(h===null)return this.traces[s]=null,this;if(!h)return this;let m=g(h,{data:"data items columns rows values dimensions samples x",snap:"snap cluster",size:"sizes size radius",color:"colors color fill fill-color fillColor",opacity:"opacity alpha transparency opaque",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",borderColor:"borderColors borderColor bordercolor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range ranges databox dataBox",viewport:"viewport viewBox viewbox",domain:"domain domains area areas",padding:"pad padding paddings pads margin margins",transpose:"transpose transposed",diagonal:"diagonal diag showDiagonal",upper:"upper up top upperhalf upperHalf showupperhalf showUpper showUpperHalf",lower:"lower low bottom lowerhalf lowerHalf showlowerhalf showLowerHalf showLower"}),p=this.traces[s]||(this.traces[s]={id:s,buffer:v.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),color:"black",marker:null,size:12,borderColor:"transparent",borderSize:1,viewport:e([v._gl.drawingBufferWidth,v._gl.drawingBufferHeight]),padding:[0,0,0,0],opacity:1,diagonal:!0,upper:!0,lower:!0});if(m.color!=null&&(p.color=m.color),m.size!=null&&(p.size=m.size),m.marker!=null&&(p.marker=m.marker),m.borderColor!=null&&(p.borderColor=m.borderColor),m.borderSize!=null&&(p.borderSize=m.borderSize),m.opacity!=null&&(p.opacity=m.opacity),m.viewport&&(p.viewport=e(m.viewport)),m.diagonal!=null&&(p.diagonal=m.diagonal),m.upper!=null&&(p.upper=m.upper),m.lower!=null&&(p.lower=m.lower),m.data){p.buffer(r(m.data)),p.columns=m.data.length,p.count=m.data[0].length,p.bounds=[];for(let k=0;k<p.columns;k++)p.bounds[k]=E(m.data[k],1)}let y;m.range&&(p.range=m.range,y=p.range&&typeof p.range[0]!="number"),m.domain&&(p.domain=m.domain);let l=!1;m.padding!=null&&(Array.isArray(m.padding)&&m.padding.length===p.columns&&typeof m.padding[m.padding.length-1]=="number"?(p.padding=m.padding.map(a),l=!0):p.padding=a(m.padding));let x=p.columns,b=p.count,S=p.viewport.width,T=p.viewport.height,M=p.viewport.x,w=p.viewport.y,u=S/x,f=T/x;p.passes=[];for(let k=0;k<x;k++)for(let _=0;_<x;_++){if(!p.diagonal&&_===k||!p.upper&&k>_||!p.lower&&k<_)continue;let D=n(p.id,k,_),I=this.passes[D]||(this.passes[D]={});if(m.data&&(m.transpose?I.positions={x:{buffer:p.buffer,offset:_,count:b,stride:x},y:{buffer:p.buffer,offset:k,count:b,stride:x}}:I.positions={x:{buffer:p.buffer,offset:_*b,count:b},y:{buffer:p.buffer,offset:k*b,count:b}},I.bounds=o(p.bounds,k,_)),m.domain||m.viewport||m.data){let O=l?o(p.padding,k,_):p.padding;if(p.domain){let[B,R,L,F]=o(p.domain,k,_);I.viewport=[M+B*S+O[0],w+R*T+O[1],M+L*S-O[2],w+F*T-O[3]]}else I.viewport=[M+_*u+u*O[0],w+k*f+f*O[1],M+(_+1)*u-u*O[2],w+(k+1)*f-f*O[3]]}m.color&&(I.color=p.color),m.size&&(I.size=p.size),m.marker&&(I.marker=p.marker),m.borderSize&&(I.borderSize=p.borderSize),m.borderColor&&(I.borderColor=p.borderColor),m.opacity&&(I.opacity=p.opacity),m.range&&(I.range=y?o(p.range,k,_):p.range||I.bounds),p.passes.push(D)}return this},i.prototype.draw=function(...s){if(!s.length)this.scatter.draw();else{let h=[];for(let v=0;v<s.length;v++)if(typeof s[v]=="number"){let{passes:m,passOffset:p}=this.traces[s[v]];h.push(...t(p,p+m.length))}else if(s[v].length){let m=s[v],{passes:p,passOffset:y}=this.traces[v];p=p.map((l,x)=>{h[y+x]=m})}this.scatter.draw(...h)}return this},i.prototype.destroy=function(){return this.traces.forEach(s=>{s.buffer&&s.buffer.destroy&&s.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function n(s,h,v){let m=s.id!=null?s.id:s,p=h,y=v;return m<<16|(p&255)<<8|y&255}function o(s,h,v){let m,p,y,l,x=s[h],b=s[v];return x.length>2?(x[0],x[2],m=x[1],p=x[3]):x.length?(m=x[0],p=x[1]):(x.x,m=x.y,x.x+x.width,p=x.y+x.height),b.length>2?(y=b[0],l=b[2],b[1],b[3]):b.length?(y=b[0],l=b[1]):(y=b.x,b.y,l=b.x+b.width,b.y+b.height),[y,m,l,p]}function a(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];{let h=e(s);return[h.x,h.y,h.x+h.width,h.y+h.height]}}}),QP=Vt((X,V)=>{var c=JP(),g=qr(),E=rc(),A=ep().selectMode;V.exports=function(e,r,i){if(i.length)for(var n=0;n<i.length;n++)t(e,i[n][0])};function t(e,r){var i=e._fullLayout,n=i._size,o=r.trace,a=r.t,s=i._splomScenes[o.uid],h=s.matrixOptions,v=h.cdata,m=i._glcanvas.data()[0].regl,p=i.dragmode,y,l,x,b,S;if(v.length!==0){h.lower=o.showupperhalf,h.upper=o.showlowerhalf,h.diagonal=o.diagonal.visible;var T=o._visibleDims,M=v.length,w=s.viewOpts={};for(w.ranges=new Array(M),w.domains=new Array(M),S=0;S<T.length;S++){x=T[S];var u=w.ranges[S]=new Array(4),f=w.domains[S]=new Array(4);y=E.getFromId(e,o._diag[x][0]),y&&(u[0]=y._rl[0],u[2]=y._rl[1],f[0]=y.domain[0],f[2]=y.domain[1]),l=E.getFromId(e,o._diag[x][1]),l&&(u[1]=l._rl[0],u[3]=l._rl[1],f[1]=l.domain[0],f[3]=l.domain[1])}var k=e._context.plotGlPixelRatio,_=n.l*k,D=n.b*k,I=n.w*k,O=n.h*k;w.viewport=[_,D,I+_,O+D],s.matrix===!0&&(s.matrix=c(m));var B=i.clickmode.indexOf("select")>-1,R=A(p)||!!o.selectedpoints||B,L=!0;if(R){var F=o._length;if(o.selectedpoints){s.selectBatch=o.selectedpoints;var N=o.selectedpoints,j={};for(x=0;x<N.length;x++)j[N[x]]=!0;var G=[];for(x=0;x<F;x++)j[x]||G.push(x);s.unselectBatch=G}var rt=a.xpx=new Array(M),ct=a.ypx=new Array(M);for(S=0;S<T.length;S++){if(x=T[S],y=E.getFromId(e,o._diag[x][0]),y)for(rt[S]=new Array(F),b=0;b<F;b++)rt[S][b]=y.c2p(v[S][b]);if(l=E.getFromId(e,o._diag[x][1]),l)for(ct[S]=new Array(F),b=0;b<F;b++)ct[S][b]=l.c2p(v[S][b])}if(s.selectBatch.length||s.unselectBatch.length){var lt=g.extendFlat({},h,s.unselectedOptions,w),tt=g.extendFlat({},h,s.selectedOptions,w);s.matrix.update(lt,tt),L=!1}}else a.xpx=a.ypx=null;if(L){var Z=g.extendFlat({},h,w);s.matrix.update(Z,null)}}}}),o5=Vt(X=>{X.getDimIndex=function(V,c){for(var g=c._id,E=g.charAt(0),A={x:0,y:1}[E],t=V._visibleDims,e=0;e<t.length;e++){var r=t[e];if(V._diag[r][A]===g)return e}return!1}}),YP=Vt((X,V)=>{var c=o5(),g=Dx().calcHover,E=ao().getFromId,A=po().extendFlat;function t(r,i,n,o,a){a||(a={});var s=(o||"").charAt(0)==="x",h=(o||"").charAt(0)==="y",v=e(r,i,n);if((s||h)&&a.hoversubplots==="axis"&&v[0])for(var m=(s?r.xa:r.ya)._subplotsWith,p=a.gd,y=A({},r),l=0;l<m.length;l++){var x=m[l];if(x!==r.xa._id+r.ya._id){h?y.xa=E(p,x,"x"):y.ya=E(p,x,"y");var b=s||h,S=e(y,i,n,b);v=v.concat(S)}}return v}function e(r,i,n,o){var a=r.cd,s=a[0].trace,h=r.scene,v=h.matrixOptions.cdata,m=r.xa,p=r.ya,y=m.c2p(i),l=p.c2p(n),x=r.distance,b=c.getDimIndex(s,m),S=c.getDimIndex(s,p);if(b===!1||S===!1)return[r];for(var T=v[b],M=v[S],w,u,f=x,k=0;k<T.length;k++)if(!(o&&k!==r.index)){var _=T[k],D=M[k],I=m.c2p(_)-y,O=p.c2p(D)-l,B=Math.sqrt(I*I+O*O);(o||B<f)&&(f=u=B,w=k)}return r.index=w,r.distance=f,r.dxy=u,w===void 0?[r]:[g(r,T,M,s)]}V.exports={hoverPoints:t}}),KP=Vt((X,V)=>{var c=qr(),g=c.pushUnique,E=Sl(),A=o5();V.exports=function(t,e){var r=t.cd,i=r[0].trace,n=r[0].t,o=t.scene,a=o.matrixOptions.cdata,s=t.xaxis,h=t.yaxis,v=[];if(!o)return v;var m=!E.hasMarkers(i)&&!E.hasText(i);if(i.visible!==!0||m)return v;var p=A.getDimIndex(i,s),y=A.getDimIndex(i,h);if(p===!1||y===!1)return v;var l=n.xpx[p],x=n.ypx[y],b=a[p],S=a[y],T=(t.scene.selectBatch||[]).slice(),M=[];if(e!==!1&&!e.degenerate)for(var w=0;w<b.length;w++)e.contains([l[w],x[w]],null,w,t)?(v.push({pointNumber:w,x:b[w],y:S[w]}),g(T,w)):T.indexOf(w)!==-1?g(T,w):M.push(w);var u=o.matrixOptions;return!T.length&&!M.length?o.matrix.update(u,null):!o.selectBatch.length&&!o.unselectBatch.length&&o.matrix.update(o.unselectedOptions,c.extendFlat({},u,o.selectedOptions,o.viewOpts)),o.selectBatch=T,o.unselectBatch=M,v}}),tI=Vt((X,V)=>{var c=qr(),g=Vf(),E=L0().markerStyle;V.exports=function(A,t){var e=t.trace,r=A._fullLayout._splomScenes[e.uid];if(r){g(A,e),c.extendFlat(r.matrixOptions,E(A,e));var i=c.extendFlat({},r.matrixOptions,r.viewOpts);r.matrix.update(i,null)}}}),eI=Vt((X,V)=>{var c=Mi(),g=Ub();V.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:i5(),supplyDefaults:HP(),colorbar:Wh(),calc:WP(),plot:QP(),hoverPoints:YP().hoverPoints,selectPoints:KP(),editStyle:tI(),meta:{}},c.register(g)}),rI=Vt((X,V)=>{var c=Z3(),g=Mi(),E=Nx(),A=Ph().getModuleCalcData,t=Pc(),e=rc().getFromId,r=ao().shouldShowZeroLine,i="splom",n={};function o(p){var y=p._fullLayout,l=g.getModule(i),x=A(p.calcdata,l)[0],b=E(p,["ANGLE_instanced_arrays","OES_element_index_uint"],n);b&&(y._hasOnlyLargeSploms&&h(p),l.plot(p,{},x))}function a(p){var y=p.calcdata,l=p._fullLayout;l._hasOnlyLargeSploms&&h(p);for(var x=0;x<y.length;x++){var b=y[x][0],S=b.trace,T=l._splomScenes[S.uid];S.type==="splom"&&T&&T.matrix&&s(p,S,T)}}function s(p,y,l){for(var x=l.matrixOptions.data.length,b=y._visibleDims,S=l.viewOpts.ranges=new Array(x),T=0;T<b.length;T++){var M=b[T],w=S[T]=new Array(4),u=e(p,y._diag[M][0]);u&&(w[0]=u.r2l(u.range[0]),w[2]=u.r2l(u.range[1]));var f=e(p,y._diag[M][1]);f&&(w[1]=f.r2l(f.range[0]),w[3]=f.r2l(f.range[1]))}l.selectBatch.length||l.unselectBatch.length?l.matrix.update({ranges:S},{ranges:S}):l.matrix.update({ranges:S})}function h(p){var y=p._fullLayout,l=y._glcanvas.data()[0].regl,x=y._splomGrid;x||(x=y._splomGrid=c(l)),x.update(v(p))}function v(p){var y=p._context.plotGlPixelRatio,l=p._fullLayout,x=l._size,b=[0,0,l.width*y,l.height*y],S={},T;function M(G,rt,ct,lt,tt,Z){ct*=y,lt*=y,tt*=y,Z*=y;var st=rt[G+"color"],$=rt[G+"width"],Q=String(st+$);Q in S?S[Q].data.push(NaN,NaN,ct,lt,tt,Z):S[Q]={data:[ct,lt,tt,Z],join:"rect",thickness:$*y,color:st,viewport:b,range:b,overlay:!1}}for(T in l._splomSubplots){var w=l._plots[T],u=w.xaxis,f=w.yaxis,k=u._gridVals,_=f._gridVals,D=u._offset,I=u._length,O=f._length,B=x.b+f.domain[0]*x.h,R=-f._m,L=-R*f.r2l(f.range[0],f.calendar),F,N;if(u.showgrid)for(T=0;T<k.length;T++)F=D+u.l2p(k[T].x),M("grid",u,F,B,F,B+O);if(f.showgrid)for(T=0;T<_.length;T++)N=B+L+R*_[T].x,M("grid",f,D,N,D+I,N);r(p,u,f)&&(F=D+u.l2p(0),M("zeroline",u,F,B,F,B+O)),r(p,f,u)&&(N=B+L+0,M("zeroline",f,D,N,D+I,N))}var j=[];for(T in S)j.push(S[T]);return j}function m(p,y,l,x){var b={},S;if(x._splomScenes){for(S=0;S<p.length;S++){var T=p[S];T.type==="splom"&&(b[T.uid]=1)}for(S=0;S<l.length;S++){var M=l[S];if(!b[M.uid]){var w=x._splomScenes[M.uid];w&&w.destroy&&w.destroy(),x._splomScenes[M.uid]=null,delete x._splomScenes[M.uid]}}}Object.keys(x._splomScenes||{}).length===0&&delete x._splomScenes,x._splomGrid&&!y._hasOnlyLargeSploms&&x._hasOnlyLargeSploms&&(x._splomGrid.destroy(),x._splomGrid=null,delete x._splomGrid),t.clean(p,y,l,x)}V.exports={name:i,attr:t.attr,attrRegex:t.attrRegex,layoutAttributes:t.layoutAttributes,supplyLayoutDefaults:t.supplyLayoutDefaults,drawFramework:t.drawFramework,plot:o,drag:a,updateGrid:h,clean:m,updateFx:t.updateFx,toSVG:t.toSVG,reglPrecompiled:n}}),nI=Vt((X,V)=>{var c=eI();c.basePlotModule=rI(),V.exports=c}),aI=Vt((X,V)=>{V.exports=nI()}),s5=Vt((X,V)=>{var c=wl(),g=Ih(),E=Nl(),A=pu().attributes,t=po().extendFlat,e=Ns().templatedArray;V.exports={domain:A({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:E({editType:"plot"}),tickfont:E({autoShadowDflt:!0,editType:"plot"}),rangefont:E({editType:"plot"}),dimensions:e("dimension",{label:{valType:"string",editType:"plot"},tickvals:t({},g.tickvals,{editType:"plot"}),ticktext:t({},g.ticktext,{editType:"plot"}),tickformat:t({},g.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:t({editType:"calc"},c("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}}),Cv=Vt((X,V)=>{V.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}}),Ap=Vt((X,V)=>{var c=zm();function g(E){return[E]}V.exports={keyFun:function(E){return E.key},repeat:g,descend:c,wrap:g,unwrap:function(E){return E[0]}}}),l5=Vt((X,V)=>{var c=Cv(),g=Ai(),E=Ap().keyFun,A=Ap().repeat,t=qr().sorterAsc,e=qr().strTranslate,r=c.bar.snapRatio;function i(j,G){return j*(1-r)+G*r}var n=c.bar.snapClose;function o(j,G){return j*(1-n)+G*n}function a(j,G,rt,ct){if(s(rt,ct))return rt;var lt=j?-1:1,tt=0,Z=G.length-1;if(lt<0){var st=tt;tt=Z,Z=st}for(var $=G[tt],Q=$,nt=tt;lt*nt<lt*Z;nt+=lt){var Y=nt+lt,q=G[Y];if(lt*rt<lt*o($,q))return i($,Q);if(lt*rt<lt*q||Y===Z)return i(q,$);Q=$,$=q}}function s(j,G){for(var rt=0;rt<G.length;rt++)if(j>=G[rt][0]&&j<=G[rt][1])return!0;return!1}function h(j){j.attr("x",-c.bar.captureWidth/2).attr("width",c.bar.captureWidth)}function v(j){j.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function m(j){if(!j.brush.filterSpecified)return"0,"+j.height;for(var G=p(j.brush.filter.getConsolidated(),j.height),rt=[0],ct,lt,tt,Z=G.length?G[0][0]:null,st=0;st<G.length;st++)ct=G[st],lt=ct[1]-ct[0],rt.push(Z),rt.push(lt),tt=st+1,tt<G.length&&(Z=G[tt][0]-ct[1]);return rt.push(j.height),rt}function p(j,G){return j.map(function(rt){return rt.map(function(ct){return Math.max(0,ct*G)}).sort(t)})}function y(j,G){var rt=c.bar.handleHeight;if(!(G>j[1]+rt||G<j[0]-rt))return G>=.9*j[1]+.1*j[0]?"n":G<=.9*j[0]+.1*j[1]?"s":"ns"}function l(){g.select(document.body).style("cursor",null)}function x(j){j.attr("stroke-dasharray",m)}function b(j,G){var rt=g.select(j).selectAll(".highlight, .highlight-shadow"),ct=G?rt.transition().duration(c.bar.snapDuration).each("end",G):rt;x(ct)}function S(j,G){var rt=j.brush,ct=rt.filterSpecified,lt=NaN,tt={},Z;if(ct){var st=j.height,$=rt.filter.getConsolidated(),Q=p($,st),nt=NaN,Y=NaN,q=NaN;for(Z=0;Z<=Q.length;Z++){var ot=Q[Z];if(ot&&ot[0]<=G&&G<=ot[1]){nt=Z;break}else if(Y=Z?Z-1:NaN,ot&&ot[0]>G){q=Z;break}}if(lt=nt,isNaN(lt)&&(isNaN(Y)||isNaN(q)?lt=isNaN(Y)?q:Y:lt=G-Q[Y][1]<Q[q][0]-G?Y:q),!isNaN(lt)){var it=Q[lt],dt=y(it,G);dt&&(tt.interval=$[lt],tt.intervalPix=it,tt.region=dt)}}if(j.ordinal&&!tt.region){var wt=j.unitTickvals,xt=j.unitToPaddedPx.invert(G);for(Z=0;Z<wt.length;Z++){var Ft=[wt[Math.max(Z-1,0)]*.25+wt[Z]*.75,wt[Math.min(Z+1,wt.length-1)]*.25+wt[Z]*.75];if(xt>=Ft[0]&&xt<=Ft[1]){tt.clickableOrdinalRange=Ft;break}}}return tt}function T(j,G){g.event.sourceEvent.stopPropagation();var rt=G.height-g.mouse(j)[1]-2*c.verticalPadding,ct=G.unitToPaddedPx.invert(rt),lt=G.brush,tt=S(G,rt),Z=tt.interval,st=lt.svgBrush;if(st.wasDragged=!1,st.grabbingBar=tt.region==="ns",st.grabbingBar){var $=Z.map(G.unitToPaddedPx);st.grabPoint=rt-$[0]-c.verticalPadding,st.barLength=$[1]-$[0]}st.clickableOrdinalRange=tt.clickableOrdinalRange,st.stayingIntervals=G.multiselect&<.filterSpecified?lt.filter.getConsolidated():[],Z&&(st.stayingIntervals=st.stayingIntervals.filter(function(Q){return Q[0]!==Z[0]&&Q[1]!==Z[1]})),st.startExtent=tt.region?Z[tt.region==="s"?1:0]:ct,G.parent.inBrushDrag=!0,st.brushStartCallback()}function M(j,G){g.event.sourceEvent.stopPropagation();var rt=G.height-g.mouse(j)[1]-2*c.verticalPadding,ct=G.brush.svgBrush;ct.wasDragged=!0,ct._dragging=!0,ct.grabbingBar?ct.newExtent=[rt-ct.grabPoint,rt+ct.barLength-ct.grabPoint].map(G.unitToPaddedPx.invert):ct.newExtent=[ct.startExtent,G.unitToPaddedPx.invert(rt)].sort(t),G.brush.filterSpecified=!0,ct.extent=ct.stayingIntervals.concat([ct.newExtent]),ct.brushCallback(G),b(j.parentNode)}function w(j,G){var rt=G.brush,ct=rt.filter,lt=rt.svgBrush;lt._dragging||(u(j,G),M(j,G),G.brush.svgBrush.wasDragged=!1),lt._dragging=!1;var tt=g.event;tt.sourceEvent.stopPropagation();var Z=lt.grabbingBar;if(lt.grabbingBar=!1,lt.grabLocation=void 0,G.parent.inBrushDrag=!1,l(),!lt.wasDragged){lt.wasDragged=void 0,lt.clickableOrdinalRange?rt.filterSpecified&&G.multiselect?lt.extent.push(lt.clickableOrdinalRange):(lt.extent=[lt.clickableOrdinalRange],rt.filterSpecified=!0):Z?(lt.extent=lt.stayingIntervals,lt.extent.length===0&&O(rt)):O(rt),lt.brushCallback(G),b(j.parentNode),lt.brushEndCallback(rt.filterSpecified?ct.getConsolidated():[]);return}var st=function(){ct.set(ct.getConsolidated())};if(G.ordinal){var $=G.unitTickvals;$[$.length-1]<$[0]&&$.reverse(),lt.newExtent=[a(0,$,lt.newExtent[0],lt.stayingIntervals),a(1,$,lt.newExtent[1],lt.stayingIntervals)];var Q=lt.newExtent[1]>lt.newExtent[0];lt.extent=lt.stayingIntervals.concat(Q?[lt.newExtent]:[]),lt.extent.length||O(rt),lt.brushCallback(G),Q?b(j.parentNode,st):(st(),b(j.parentNode))}else st();lt.brushEndCallback(rt.filterSpecified?ct.getConsolidated():[])}function u(j,G){var rt=G.height-g.mouse(j)[1]-2*c.verticalPadding,ct=S(G,rt),lt="crosshair";ct.clickableOrdinalRange?lt="pointer":ct.region&&(lt=ct.region+"-resize"),g.select(document.body).style("cursor",lt)}function f(j){j.on("mousemove",function(G){g.event.preventDefault(),G.parent.inBrushDrag||u(this,G)}).on("mouseleave",function(G){G.parent.inBrushDrag||l()}).call(g.behavior.drag().on("dragstart",function(G){T(this,G)}).on("drag",function(G){M(this,G)}).on("dragend",function(G){w(this,G)}))}function k(j,G){return j[0]-G[0]}function _(j,G,rt){var ct=rt._context.staticPlot,lt=j.selectAll(".background").data(A);lt.enter().append("rect").classed("background",!0).call(h).call(v).style("pointer-events",ct?"none":"auto").attr("transform",e(0,c.verticalPadding)),lt.call(f).attr("height",function(st){return st.height-c.verticalPadding});var tt=j.selectAll(".highlight-shadow").data(A);tt.enter().append("line").classed("highlight-shadow",!0).attr("x",-c.bar.width/2).attr("stroke-width",c.bar.width+c.bar.strokeWidth).attr("stroke",G).attr("opacity",c.bar.strokeOpacity).attr("stroke-linecap","butt"),tt.attr("y1",function(st){return st.height}).call(x);var Z=j.selectAll(".highlight").data(A);Z.enter().append("line").classed("highlight",!0).attr("x",-c.bar.width/2).attr("stroke-width",c.bar.width-c.bar.strokeWidth).attr("stroke",c.bar.fillColor).attr("opacity",c.bar.fillOpacity).attr("stroke-linecap","butt"),Z.attr("y1",function(st){return st.height}).call(x)}function D(j,G,rt){var ct=j.selectAll("."+c.cn.axisBrush).data(A,E);ct.enter().append("g").classed(c.cn.axisBrush,!0),_(ct,G,rt)}function I(j){return j.svgBrush.extent.map(function(G){return G.slice()})}function O(j){j.filterSpecified=!1,j.svgBrush.extent=[[-1/0,1/0]]}function B(j){return function(G){var rt=G.brush,ct=I(rt),lt=ct.slice();rt.filter.set(lt),j()}}function R(j){for(var G=j.slice(),rt=[],ct,lt=G.shift();lt;){for(ct=lt.slice();(lt=G.shift())&<[0]<=ct[1];)ct[1]=Math.max(ct[1],lt[1]);rt.push(ct)}return rt.length===1&&rt[0][0]>rt[0][1]&&(rt=[]),rt}function L(){var j=[],G,rt;return{set:function(ct){j=ct.map(function(lt){return lt.slice().sort(t)}).sort(k),j.length===1&&j[0][0]===-1/0&&j[0][1]===1/0&&(j=[[0,-1]]),G=R(j),rt=j.reduce(function(lt,tt){return[Math.min(lt[0],tt[0]),Math.max(lt[1],tt[1])]},[1/0,-1/0])},get:function(){return j.slice()},getConsolidated:function(){return G},getBounds:function(){return rt}}}function F(j,G,rt,ct,lt,tt){var Z=L();return Z.set(rt),{filter:Z,filterSpecified:G,svgBrush:{extent:[],brushStartCallback:ct,brushCallback:B(lt),brushEndCallback:tt}}}function N(j,G){if(Array.isArray(j[0])?(j=j.map(function(ct){return ct.sort(t)}),G.multiselect?j=R(j.sort(k)):j=[j[0]]):j=[j.sort(t)],G.tickvals){var rt=G.tickvals.slice().sort(t);if(j=j.map(function(ct){var lt=[a(0,rt,ct[0],[]),a(1,rt,ct[1],[])];if(lt[1]>lt[0])return lt}).filter(function(ct){return ct}),!j.length)return}return j.length>1?j:j[0]}V.exports={makeBrush:F,ensureAxisBrush:D,cleanRanges:N}}),iI=Vt((X,V)=>{var c=qr(),g=pf().hasColorscale,E=ah(),A=pu().defaults,t=Gh(),e=ao(),r=s5(),i=l5(),n=Cv().maxDimensionCount,o=Ux();function a(h,v,m,p,y){var l=y("line.color",m);if(g(h,"line")&&c.isArrayOrTypedArray(l)){if(l.length)return y("line.colorscale"),E(h,v,p,y,{prefix:"line.",cLetter:"c"}),l.length;v.line.color=m}return 1/0}function s(h,v,m,p){function y(T,M){return c.coerce(h,v,r.dimensions,T,M)}var l=y("values"),x=y("visible");if(l&&l.length||(x=v.visible=!1),x){y("label"),y("tickvals"),y("ticktext"),y("tickformat");var b=y("range");v._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:b},e.setConvert(v._ax,p.layout),y("multiselect");var S=y("constraintrange");S&&(v.constraintrange=i.cleanRanges(S,v))}}V.exports=function(h,v,m,p){function y(T,M){return c.coerce(h,v,r,T,M)}var l=h.dimensions;Array.isArray(l)&&l.length>n&&(c.log("parcoords traces support up to "+n+" dimensions at the moment"),l.splice(n));var x=t(h,v,{name:"dimensions",layout:p,handleItemDefaults:s}),b=a(h,v,m,p,y);A(v,p,y),(!Array.isArray(x)||!x.length)&&(v.visible=!1),o(v,x,"values",b);var S=c.extendFlat({},p.font,{size:Math.round(p.font.size/1.2)});c.coerceFont(y,"labelfont",S),c.coerceFont(y,"tickfont",S,{autoShadowDflt:!0}),c.coerceFont(y,"rangefont",S),y("labelangle"),y("labelside"),y("unselected.line.color"),y("unselected.line.opacity")}}),oI=Vt((X,V)=>{var c=qr().isArrayOrTypedArray,g=Ul(),E=Ap().wrap;V.exports=function(t,e){var r,i;return g.hasColorscale(e,"line")&&c(e.line.color)?(r=e.line.color,i=g.extractOpts(e.line).colorscale,g.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=A(e._length),i=[[0,e.line.color],[1,e.line.color]]),E({lineColor:r,cscale:i})};function A(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=.5;return e}}),u5=Vt(X=>{var V=qr().isTypedArray;X.convertTypedArray=function(c){return V(c)?Array.prototype.slice.call(c):c},X.isOrdinal=function(c){return!!c.tickvals},X.isVisible=function(c){return c.visible||!("visible"in c)}}),sI=Vt((X,V)=>{var c=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(`
|
||
`),g=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(`
|
||
`),E=Cv().maxDimensionCount,A=qr(),t=1e-6,e=2048,r=new Uint8Array(4),i=new Uint8Array(4),n={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function o(w){w.read({x:0,y:0,width:1,height:1,data:r})}function a(w,u,f,k,_){var D=w._gl;D.enable(D.SCISSOR_TEST),D.scissor(u,f,k,_),w.clear({color:[0,0,0,0],depth:1})}function s(w,u,f,k,_,D){var I=D.key;function O(B){var R=Math.min(k,_-B*k);B===0&&(window.cancelAnimationFrame(f.currentRafs[I]),delete f.currentRafs[I],a(w,D.scissorX,D.scissorY,D.scissorWidth,D.viewBoxSize[1])),!f.clearOnly&&(D.count=2*R,D.offset=2*B*k,u(D),B*k+R<_&&(f.currentRafs[I]=window.requestAnimationFrame(function(){O(B+1)})),f.drawCompleted=!1)}f.drawCompleted||(o(w),f.drawCompleted=!0),O(0)}function h(w){return Math.max(t,Math.min(1-t,w))}function v(w,u){for(var f=new Array(256),k=0;k<256;k++)f[k]=w(k/255).concat(u);return f}function m(w,u){return(w>>>8*u)%256/255}function p(w,u,f){for(var k=new Array(w*(E+4)),_=0,D=0;D<w;D++){for(var I=0;I<E;I++)k[_++]=I<u.length?u[I].paddedUnitValues[D]:.5;k[_++]=m(D,2),k[_++]=m(D,1),k[_++]=m(D,0),k[_++]=h(f[D])}return k}function y(w,u,f){for(var k=new Array(u*8),_=0,D=0;D<u;D++)for(var I=0;I<2;I++)for(var O=0;O<4;O++){var B=w*4+O,R=f[D*64+B];B===63&&I===0&&(R*=-1),k[_++]=R}return k}function l(w){var u="0"+w;return u.substr(u.length-2)}function x(w){return w<E?"p"+l(w+1)+"_"+l(w+4):"colors"}function b(w,u,f){for(var k=0;k<=E;k+=4)w[x(k)](y(k/4,u,f))}function S(w){for(var u={},f=0;f<=E;f+=4)u[x(f)]=w.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return u}function T(w,u,f,k,_,D,I,O,B,R,L,F,N,j){for(var G=[[],[]],rt=0;rt<64;rt++)G[0][rt]=rt===_?1:0,G[1][rt]=rt===D?1:0;I*=j,O*=j,B*=j,R*=j;var ct=w.lines.canvasOverdrag*j,lt=w.domain,tt=w.canvasWidth*j,Z=w.canvasHeight*j,st=w.pad.l*j,$=w.pad.b*j,Q=w.layoutHeight*j,nt=w.layoutWidth*j,Y=w.deselectedLines.color,q=w.deselectedLines.opacity,ot=A.extendFlat({key:L,resolution:[tt,Z],viewBoxPos:[I+ct,O],viewBoxSize:[B,R],i0:_,i1:D,dim0A:G[0].slice(0,16),dim0B:G[0].slice(16,32),dim0C:G[0].slice(32,48),dim0D:G[0].slice(48,64),dim1A:G[1].slice(0,16),dim1B:G[1].slice(16,32),dim1C:G[1].slice(32,48),dim1D:G[1].slice(48,64),drwLayer:F,contextColor:[Y[0]/255,Y[1]/255,Y[2]/255,q!=="auto"?Y[3]*q:Math.max(1/255,Math.pow(1/w.lines.color.length,1/3))],scissorX:(k===u?0:I+ct)+(st-ct)+nt*lt.x[0],scissorWidth:(k===f?tt-I+ct:B+.5)+(k===u?I+ct:0),scissorY:O+$+Q*lt.y[0],scissorHeight:R,viewportX:st-ct+nt*lt.x[0],viewportY:$+Q*lt.y[0],viewportWidth:tt,viewportHeight:Z},N);return ot}function M(w){var u=e-1,f=Math.max(0,Math.floor(w[0]*u),0),k=Math.min(u,Math.ceil(w[1]*u),u);return[Math.min(f,k),Math.max(f,k)]}V.exports=function(w,u){var f=u.context,k=u.pick,_=u.regl,D=_._gl,I=D.getParameter(D.ALIASED_LINE_WIDTH_RANGE),O=Math.max(I[0],Math.min(I[1],u.viewModel.plotGlPixelRatio)),B={currentRafs:{},drawCompleted:!0,clearOnly:!1},R,L,F,N,j=S(_),G,rt=_.texture(n),ct=[];tt(u);var lt=_({profile:!1,blend:{enable:f,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!f,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:_.prop("scissorX"),y:_.prop("scissorY"),width:_.prop("scissorWidth"),height:_.prop("scissorHeight")}},viewport:{x:_.prop("viewportX"),y:_.prop("viewportY"),width:_.prop("viewportWidth"),height:_.prop("viewportHeight")},dither:!1,vert:c,frag:g,primitive:"lines",lineWidth:O,attributes:j,uniforms:{resolution:_.prop("resolution"),viewBoxPos:_.prop("viewBoxPos"),viewBoxSize:_.prop("viewBoxSize"),dim0A:_.prop("dim0A"),dim1A:_.prop("dim1A"),dim0B:_.prop("dim0B"),dim1B:_.prop("dim1B"),dim0C:_.prop("dim0C"),dim1C:_.prop("dim1C"),dim0D:_.prop("dim0D"),dim1D:_.prop("dim1D"),loA:_.prop("loA"),hiA:_.prop("hiA"),loB:_.prop("loB"),hiB:_.prop("hiB"),loC:_.prop("loC"),hiC:_.prop("hiC"),loD:_.prop("loD"),hiD:_.prop("hiD"),palette:rt,contextColor:_.prop("contextColor"),maskTexture:_.prop("maskTexture"),drwLayer:_.prop("drwLayer"),maskHeight:_.prop("maskHeight")},offset:_.prop("offset"),count:_.prop("count")});function tt(Y){R=Y.model,L=Y.viewModel,F=L.dimensions.slice(),N=F[0]?F[0].values.length:0;var q=R.lines,ot=k?q.color.map(function(dt,wt){return wt/q.color.length}):q.color,it=p(N,F,ot);b(j,N,it),!f&&!k&&(rt=_.texture(A.extendFlat({data:v(R.unitToColor,255)},n)))}function Z(Y){var q,ot,it,dt=[[],[]];for(it=0;it<64;it++){var wt=!Y&&it<F.length?F[it].brush.filter.getBounds():[-1/0,1/0];dt[0][it]=wt[0],dt[1][it]=wt[1]}var xt=e*8,Ft=new Array(xt);for(q=0;q<xt;q++)Ft[q]=255;if(!Y)for(q=0;q<F.length;q++){var Et=q%8,Nt=(q-Et)/8,te=Math.pow(2,Et),Jt=F[q],Qt=Jt.brush.filter.get();if(!(Qt.length<2)){var Wt=M(Qt[0])[1];for(ot=1;ot<Qt.length;ot++){var gt=M(Qt[ot]);for(it=Wt+1;it<gt[0];it++)Ft[it*8+Nt]&=~te;Wt=Math.max(Wt,gt[1])}}}var bt={shape:[8,e],format:"alpha",type:"uint8",mag:"nearest",min:"nearest",data:Ft};return G?G(bt):G=_.texture(bt),{maskTexture:G,maskHeight:e,loA:dt[0].slice(0,16),loB:dt[0].slice(16,32),loC:dt[0].slice(32,48),loD:dt[0].slice(48,64),hiA:dt[1].slice(0,16),hiB:dt[1].slice(16,32),hiC:dt[1].slice(32,48),hiD:dt[1].slice(48,64)}}function st(Y,q,ot){var it=Y.length,dt,wt,xt,Ft=1/0,Et=-1/0;for(dt=0;dt<it;dt++)Y[dt].dim0.canvasX<Ft&&(Ft=Y[dt].dim0.canvasX,wt=dt),Y[dt].dim1.canvasX>Et&&(Et=Y[dt].dim1.canvasX,xt=dt);it===0&&a(_,0,0,R.canvasWidth,R.canvasHeight);var Nt=Z(f);for(dt=0;dt<it;dt++){var te=Y[dt],Jt=te.dim0.crossfilterDimensionIndex,Qt=te.dim1.crossfilterDimensionIndex,Wt=te.canvasX,gt=te.canvasY,bt=Wt+te.panelSizeX,vt=te.plotGlPixelRatio;if(q||!ct[Jt]||ct[Jt][0]!==Wt||ct[Jt][1]!==bt){ct[Jt]=[Wt,bt];var Ut=T(R,wt,xt,dt,Jt,Qt,Wt,gt,te.panelSizeX,te.panelSizeY,te.dim0.crossfilterDimensionIndex,f?0:k?2:1,Nt,vt);B.clearOnly=ot;var Kt=q?R.lines.blockLineCount:N;s(_,lt,B,Kt,N,Ut)}}}function $(Y,q){return _.read({x:Y,y:q,width:1,height:1,data:i}),i}function Q(Y,q,ot,it){var dt=new Uint8Array(4*ot*it);return _.read({x:Y,y:q,width:ot,height:it,data:dt}),dt}function nt(){w.style["pointer-events"]="none",rt.destroy(),G&&G.destroy();for(var Y in j)j[Y].destroy()}return{render:st,readPixel:$,readPixels:Q,destroy:nt,update:tt}}}),lI=Vt((X,V)=>{var c=Ai(),g=qr(),E=g.isArrayOrTypedArray,A=g.numberFormat,t=c3(),e=ao(),r=g.strRotate,i=g.strTranslate,n=sl(),o=go(),a=Ul(),s=Ap(),h=s.keyFun,v=s.repeat,m=s.unwrap,p=u5(),y=Cv(),l=l5(),x=sI();function b(ct,lt,tt){return g.aggNums(ct,null,lt,tt)}function S(ct,lt){return M(b(Math.min,ct,lt),b(Math.max,ct,lt))}function T(ct){var lt=ct.range;return lt?M(lt[0],lt[1]):S(ct.values,ct._length)}function M(ct,lt){return(isNaN(ct)||!isFinite(ct))&&(ct=0),(isNaN(lt)||!isFinite(lt))&&(lt=0),ct===lt&&(ct===0?(ct-=1,lt+=1):(ct*=.9,lt*=1.1)),[ct,lt]}function w(ct,lt){return lt?function(tt,Z){var st=lt[Z];return st??ct(tt)}:ct}function u(ct,lt,tt,Z,st){var $=T(tt);return Z?c.scale.ordinal().domain(Z.map(w(A(tt.tickformat),st))).range(Z.map(function(Q){var nt=(Q-$[0])/($[1]-$[0]);return ct-lt+nt*(2*lt-ct)})):c.scale.linear().domain($).range([ct-lt,lt])}function f(ct,lt){return c.scale.linear().range([lt,ct-lt])}function k(ct,lt){return c.scale.linear().domain(T(ct)).range([lt,1-lt])}function _(ct){if(ct.tickvals){var lt=T(ct);return c.scale.ordinal().domain(ct.tickvals).range(ct.tickvals.map(function(tt){return(tt-lt[0])/(lt[1]-lt[0])}))}}function D(ct){var lt=ct.map(function($){return $[0]}),tt=ct.map(function($){var Q=t($[1]);return c.rgb("rgb("+Q[0]+","+Q[1]+","+Q[2]+")")}),Z=function($){return function(Q){return Q[$]}},st="rgb".split("").map(function($){return c.scale.linear().clamp(!0).domain(lt).range(tt.map(Z($)))});return function($){return st.map(function(Q){return Q($)})}}function I(ct){return ct.dimensions.some(function(lt){return lt.brush.filterSpecified})}function O(ct,lt,tt){var Z=m(lt),st=Z.trace,$=p.convertTypedArray(Z.lineColor),Q=st.line,nt={color:t(st.unselected.line.color),opacity:st.unselected.line.opacity},Y=a.extractOpts(Q),q=Y.reversescale?a.flipScale(Z.cscale):Z.cscale,ot=st.domain,it=st.dimensions,dt=ct.width,wt=st.labelangle,xt=st.labelside,Ft=st.labelfont,Et=st.tickfont,Nt=st.rangefont,te=g.extendDeepNoArrays({},Q,{color:$.map(c.scale.linear().domain(T({values:$,range:[Y.min,Y.max],_length:st._length}))),blockLineCount:y.blockLineCount,canvasOverdrag:y.overdrag*y.canvasPixelRatio}),Jt=Math.floor(dt*(ot.x[1]-ot.x[0])),Qt=Math.floor(ct.height*(ot.y[1]-ot.y[0])),Wt=ct.margin||{l:80,r:80,t:100,b:80},gt=Jt,bt=Qt;return{key:tt,colCount:it.filter(p.isVisible).length,dimensions:it,tickDistance:y.tickDistance,unitToColor:D(q),lines:te,deselectedLines:nt,labelAngle:wt,labelSide:xt,labelFont:Ft,tickFont:Et,rangeFont:Nt,layoutWidth:dt,layoutHeight:ct.height,domain:ot,translateX:ot.x[0]*dt,translateY:ct.height-ot.y[1]*ct.height,pad:Wt,canvasWidth:gt*y.canvasPixelRatio+2*te.canvasOverdrag,canvasHeight:bt*y.canvasPixelRatio,width:gt,height:bt,canvasPixelRatio:y.canvasPixelRatio}}function B(ct,lt,tt){var Z=tt.width,st=tt.height,$=tt.dimensions,Q=tt.canvasPixelRatio,nt=function(dt){return Z*dt/Math.max(1,tt.colCount-1)},Y=y.verticalPadding/st,q=f(st,y.verticalPadding),ot={key:tt.key,xScale:nt,model:tt,inBrushDrag:!1},it={};return ot.dimensions=$.filter(p.isVisible).map(function(dt,wt){var xt=k(dt,Y),Ft=it[dt.label];it[dt.label]=(Ft||0)+1;var Et=dt.label+(Ft?"__"+Ft:""),Nt=dt.constraintrange,te=Nt&&Nt.length;te&&!E(Nt[0])&&(Nt=[Nt]);var Jt=te?Nt.map(function(Te){return Te.map(xt)}):[[-1/0,1/0]],Qt=function(){var Te=ot;Te.focusLayer&&Te.focusLayer.render(Te.panels,!0);var Se=I(Te);!ct.contextShown()&&Se?(Te.contextLayer&&Te.contextLayer.render(Te.panels,!0),ct.contextShown(!0)):ct.contextShown()&&!Se&&(Te.contextLayer&&Te.contextLayer.render(Te.panels,!0,!0),ct.contextShown(!1))},Wt=dt.values;Wt.length>dt._length&&(Wt=Wt.slice(0,dt._length));var gt=dt.tickvals,bt;function vt(Te,Se){return{val:Te,text:bt[Se]}}function Ut(Te,Se){return Te.val-Se.val}if(E(gt)&>.length){g.isTypedArray(gt)&&(gt=Array.from(gt)),bt=dt.ticktext,!E(bt)||!bt.length?bt=gt.map(A(dt.tickformat)):bt.length>gt.length?bt=bt.slice(0,gt.length):gt.length>bt.length&&(gt=gt.slice(0,bt.length));for(var Kt=1;Kt<gt.length;Kt++)if(gt[Kt]<gt[Kt-1]){for(var Zt=gt.map(vt).sort(Ut),le=0;le<gt.length;le++)gt[le]=Zt[le].val,bt[le]=Zt[le].text;break}}else gt=void 0;return Wt=p.convertTypedArray(Wt),{key:Et,label:dt.label,tickFormat:dt.tickformat,tickvals:gt,ticktext:bt,ordinal:p.isOrdinal(dt),multiselect:dt.multiselect,xIndex:wt,crossfilterDimensionIndex:wt,visibleIndex:dt._index,height:st,values:Wt,paddedUnitValues:Wt.map(xt),unitTickvals:gt&>.map(xt),xScale:nt,x:nt(wt),canvasX:nt(wt)*Q,unitToPaddedPx:q,domainScale:u(st,y.verticalPadding,dt,gt,bt),ordinalScale:_(dt),parent:ot,model:tt,brush:l.makeBrush(ct,te,Jt,function(){ct.linePickActive(!1)},Qt,function(Te){if(ot.focusLayer.render(ot.panels,!0),ot.pickLayer&&ot.pickLayer.render(ot.panels,!0),ct.linePickActive(!0),lt&<.filterChanged){var Se=xt.invert,Fe=Te.map(function(Oe){return Oe.map(Se).sort(g.sorterAsc)}).sort(function(Oe,ur){return Oe[0]-ur[0]});lt.filterChanged(ot.key,dt._index,Fe)}})}}),ot}function R(ct){ct.classed(y.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default")}function L(){var ct=!0,lt=!1;return{linePickActive:function(tt){return arguments.length?ct=!!tt:ct},contextShown:function(tt){return arguments.length?lt=!!tt:lt}}}function F(ct,lt){var tt=lt==="top"?1:-1,Z=ct*Math.PI/180,st=Math.sin(Z),$=Math.cos(Z);return{dir:tt,dx:st,dy:$,degrees:ct}}function N(ct,lt,tt){for(var Z=lt.panels||(lt.panels=[]),st=ct.data(),$=0;$<st.length-1;$++){var Q=Z[$]||(Z[$]={}),nt=st[$],Y=st[$+1];Q.dim0=nt,Q.dim1=Y,Q.canvasX=nt.canvasX,Q.panelSizeX=Y.canvasX-nt.canvasX,Q.panelSizeY=lt.model.canvasHeight,Q.y=0,Q.canvasY=0,Q.plotGlPixelRatio=tt}}function j(ct){for(var lt=0;lt<ct.length;lt++)for(var tt=0;tt<ct[lt].length;tt++)for(var Z=ct[lt][tt].trace,st=Z.dimensions,$=0;$<st.length;$++){var Q=st[$].values,nt=st[$]._ax;nt&&(nt.range?nt.range=M(nt.range[0],nt.range[1]):nt.range=S(Q,Z._length),nt.dtick||(nt.dtick=.01*(Math.abs(nt.range[1]-nt.range[0])||1)),nt.tickformat=st[$].tickformat,e.calcTicks(nt),nt.cleanRange())}}function G(ct,lt){return e.tickText(ct._ax,lt,!1).text}function rt(ct,lt){if(ct.ordinal)return"";var tt=ct.domainScale.domain(),Z=tt[lt?tt.length-1:0];return G(ct.model.dimensions[ct.visibleIndex],Z)}V.exports=function(ct,lt,tt,Z){var st=ct._context.staticPlot,$=ct._fullLayout,Q=$._toppaper,nt=$._glcontainer,Y=ct._context.plotGlPixelRatio,q=ct._fullLayout.paper_bgcolor;j(lt);var ot=L(),it=lt.filter(function(Zt){return m(Zt).trace.visible}).map(O.bind(0,tt)).map(B.bind(0,ot,Z));nt.each(function(Zt,le){return g.extendFlat(Zt,it[le])});var dt=nt.selectAll(".gl-canvas").each(function(Zt){Zt.viewModel=it[0],Zt.viewModel.plotGlPixelRatio=Y,Zt.viewModel.paperColor=q,Zt.model=Zt.viewModel?Zt.viewModel.model:null}),wt=null,xt=dt.filter(function(Zt){return Zt.pick});xt.style("pointer-events",st?"none":"auto").on("mousemove",function(Zt){if(ot.linePickActive()&&Zt.lineLayer&&Z&&Z.hover){var le=c.event,Te=this.width,Se=this.height,Fe=c.mouse(this),Oe=Fe[0],ur=Fe[1];if(Oe<0||ur<0||Oe>=Te||ur>=Se)return;var fr=Zt.lineLayer.readPixel(Oe,Se-1-ur),We=fr[3]!==0,Lr=We?fr[2]+256*(fr[1]+256*fr[0]):null,kr={x:Oe,y:ur,clientX:le.clientX,clientY:le.clientY,dataIndex:Zt.model.key,curveNumber:Lr};Lr!==wt&&(We?Z.hover(kr):Z.unhover&&Z.unhover(kr),wt=Lr)}}),dt.style("opacity",function(Zt){return Zt.pick?0:1}),Q.style("background","rgba(255, 255, 255, 0)");var Ft=Q.selectAll("."+y.cn.parcoords).data(it,h);Ft.exit().remove(),Ft.enter().append("g").classed(y.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Ft.attr("transform",function(Zt){return i(Zt.model.translateX,Zt.model.translateY)});var Et=Ft.selectAll("."+y.cn.parcoordsControlView).data(v,h);Et.enter().append("g").classed(y.cn.parcoordsControlView,!0),Et.attr("transform",function(Zt){return i(Zt.model.pad.l,Zt.model.pad.t)});var Nt=Et.selectAll("."+y.cn.yAxis).data(function(Zt){return Zt.dimensions},h);Nt.enter().append("g").classed(y.cn.yAxis,!0),Et.each(function(Zt){N(Nt,Zt,Y)}),dt.each(function(Zt){if(Zt.viewModel){!Zt.lineLayer||Z?Zt.lineLayer=x(this,Zt):Zt.lineLayer.update(Zt),(Zt.key||Zt.key===0)&&(Zt.viewModel[Zt.key]=Zt.lineLayer);var le=!Zt.context||Z;Zt.lineLayer.render(Zt.viewModel.panels,le)}}),Nt.attr("transform",function(Zt){return i(Zt.xScale(Zt.xIndex),0)}),Nt.call(c.behavior.drag().origin(function(Zt){return Zt}).on("drag",function(Zt){var le=Zt.parent;ot.linePickActive(!1),Zt.x=Math.max(-y.overdrag,Math.min(Zt.model.width+y.overdrag,c.event.x)),Zt.canvasX=Zt.x*Zt.model.canvasPixelRatio,Nt.sort(function(Te,Se){return Te.x-Se.x}).each(function(Te,Se){Te.xIndex=Se,Te.x=Zt===Te?Te.x:Te.xScale(Te.xIndex),Te.canvasX=Te.x*Te.model.canvasPixelRatio}),N(Nt,le,Y),Nt.filter(function(Te){return Math.abs(Zt.xIndex-Te.xIndex)!==0}).attr("transform",function(Te){return i(Te.xScale(Te.xIndex),0)}),c.select(this).attr("transform",i(Zt.x,0)),Nt.each(function(Te,Se,Fe){Fe===Zt.parent.key&&(le.dimensions[Se]=Te)}),le.contextLayer&&le.contextLayer.render(le.panels,!1,!I(le)),le.focusLayer.render&&le.focusLayer.render(le.panels)}).on("dragend",function(Zt){var le=Zt.parent;Zt.x=Zt.xScale(Zt.xIndex),Zt.canvasX=Zt.x*Zt.model.canvasPixelRatio,N(Nt,le,Y),c.select(this).attr("transform",function(Te){return i(Te.x,0)}),le.contextLayer&&le.contextLayer.render(le.panels,!1,!I(le)),le.focusLayer&&le.focusLayer.render(le.panels),le.pickLayer&&le.pickLayer.render(le.panels,!0),ot.linePickActive(!0),Z&&Z.axesMoved&&Z.axesMoved(le.key,le.dimensions.map(function(Te){return Te.crossfilterDimensionIndex}))})),Nt.exit().remove();var te=Nt.selectAll("."+y.cn.axisOverlays).data(v,h);te.enter().append("g").classed(y.cn.axisOverlays,!0),te.selectAll("."+y.cn.axis).remove();var Jt=te.selectAll("."+y.cn.axis).data(v,h);Jt.enter().append("g").classed(y.cn.axis,!0),Jt.each(function(Zt){var le=Zt.model.height/Zt.model.tickDistance,Te=Zt.domainScale,Se=Te.domain();c.select(this).call(c.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(le,Zt.tickFormat).tickValues(Zt.ordinal?Se:null).tickFormat(function(Fe){return p.isOrdinal(Zt)?Fe:G(Zt.model.dimensions[Zt.visibleIndex],Fe)}).scale(Te)),o.font(Jt.selectAll("text"),Zt.model.tickFont)}),Jt.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),Jt.selectAll("text").style("cursor","default");var Qt=te.selectAll("."+y.cn.axisHeading).data(v,h);Qt.enter().append("g").classed(y.cn.axisHeading,!0);var Wt=Qt.selectAll("."+y.cn.axisTitle).data(v,h);Wt.enter().append("text").classed(y.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",st?"none":"auto"),Wt.text(function(Zt){return Zt.label}).each(function(Zt){var le=c.select(this);o.font(le,Zt.model.labelFont),n.convertToTspans(le,ct)}).attr("transform",function(Zt){var le=F(Zt.model.labelAngle,Zt.model.labelSide),Te=y.axisTitleOffset;return(le.dir>0?"":i(0,2*Te+Zt.model.height))+r(le.degrees)+i(-Te*le.dx,-Te*le.dy)}).attr("text-anchor",function(Zt){var le=F(Zt.model.labelAngle,Zt.model.labelSide),Te=Math.abs(le.dx),Se=Math.abs(le.dy);return 2*Te>Se?le.dir*le.dx<0?"start":"end":"middle"});var gt=te.selectAll("."+y.cn.axisExtent).data(v,h);gt.enter().append("g").classed(y.cn.axisExtent,!0);var bt=gt.selectAll("."+y.cn.axisExtentTop).data(v,h);bt.enter().append("g").classed(y.cn.axisExtentTop,!0),bt.attr("transform",i(0,-y.axisExtentOffset));var vt=bt.selectAll("."+y.cn.axisExtentTopText).data(v,h);vt.enter().append("text").classed(y.cn.axisExtentTopText,!0).call(R),vt.text(function(Zt){return rt(Zt,!0)}).each(function(Zt){o.font(c.select(this),Zt.model.rangeFont)});var Ut=gt.selectAll("."+y.cn.axisExtentBottom).data(v,h);Ut.enter().append("g").classed(y.cn.axisExtentBottom,!0),Ut.attr("transform",function(Zt){return i(0,Zt.model.height+y.axisExtentOffset)});var Kt=Ut.selectAll("."+y.cn.axisExtentBottomText).data(v,h);Kt.enter().append("text").classed(y.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(R),Kt.text(function(Zt){return rt(Zt,!1)}).each(function(Zt){o.font(c.select(this),Zt.model.rangeFont)}),l.ensureAxisBrush(te,q,ct)}}),c5=Vt((r,V)=>{var c=lI(),g=Nx(),E=u5().isVisible,A={};function t(i,n,o){var a=n.indexOf(o),s=i.indexOf(a);return s===-1&&(s+=n.length),s}function e(i,n){return function(o,a){return t(i,n,o)-t(i,n,a)}}var r=V.exports=function(i,n){var o=i._fullLayout,a=g(i,[],A);if(a){var s={},h={},v={},m={},p=o._size;n.forEach(function(S,T){var M=S[0].trace;v[T]=M.index;var w=m[T]=M.index;s[T]=i.data[w].dimensions,h[T]=i.data[w].dimensions.slice()});var y=function(S,T,M){var w=h[S][T],u=M.map(function(O){return O.slice()}),f="dimensions["+T+"].constraintrange",k=o._tracePreGUI[i._fullData[v[S]]._fullInput.uid];if(k[f]===void 0){var _=w.constraintrange;k[f]=_||null}var D=i._fullData[v[S]].dimensions[T];u.length?(u.length===1&&(u=u[0]),w.constraintrange=u,D.constraintrange=u.slice(),u=[u]):(delete w.constraintrange,delete D.constraintrange,u=null);var I={};I[f]=u,i.emit("plotly_restyle",[I,[m[S]]])},l=function(S){i.emit("plotly_hover",S)},x=function(S){i.emit("plotly_unhover",S)},b=function(S,T){var M=e(T,h[S].filter(E));s[S].sort(M),h[S].filter(function(w){return!E(w)}).sort(function(w){return h[S].indexOf(w)}).forEach(function(w){s[S].splice(s[S].indexOf(w),1),s[S].splice(h[S].indexOf(w),0,w)}),i.emit("plotly_restyle",[{dimensions:[s[S]]},[m[S]]])};c(i,n,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{filterChanged:y,hover:l,unhover:x,axesMoved:b})}};r.reglPrecompiled=A}),uI=Vt(X=>{var V=Ai(),c=Ph().getModuleCalcData,g=c5(),E=Cf();X.name="parcoords",X.plot=function(A){var t=c(A.calcdata,"parcoords")[0];t.length&&g(A,t)},X.clean=function(A,t,e,r){var i=r._has&&r._has("parcoords"),n=t._has&&t._has("parcoords");i&&!n&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},X.toSVG=function(A){var t=A._fullLayout._glimages,e=V.select(A).selectAll(".svg-container"),r=e.filter(function(n,o){return o===e.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function i(){var n=this,o=n.toDataURL("image/png"),a=t.append("svg:image");a.attr({xmlns:E.svg,"xlink:href":o,preserveAspectRatio:"none",x:0,y:0,width:n.style.width,height:n.style.height})}r.each(i),window.setTimeout(function(){V.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}),cI=Vt((X,V)=>{V.exports={attributes:s5(),supplyDefaults:iI(),calc:oI(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:uI(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}),hI=Vt((X,V)=>{var c=cI();c.plot=c5(),V.exports=c}),fI=Vt((X,V)=>{V.exports=hI()}),h5=Vt((X,V)=>{var c=po().extendFlat,g=Ks(),E=Nl(),A=wl(),t=Zo().hovertemplateAttrs,e=pu().attributes,r=c({editType:"calc"},A("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:t({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});V.exports={domain:e({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:c({},g.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:t({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:E({editType:"calc"}),tickfont:E({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:r,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}),pI=Vt((X,V)=>{var c=qr(),g=pf().hasColorscale,E=ah(),A=pu().defaults,t=Gh(),e=h5(),r=Ux(),i=nf().isTypedArraySpec;function n(a,s,h,v,m){m("line.shape"),m("line.hovertemplate");var p=m("line.color",v.colorway[0]);if(g(a,"line")&&c.isArrayOrTypedArray(p)){if(p.length)return m("line.colorscale"),E(a,s,v,m,{prefix:"line.",cLetter:"c"}),p.length;s.line.color=h}return 1/0}function o(a,s){function h(b,S){return c.coerce(a,s,e.dimensions,b,S)}var v=h("values"),m=h("visible");if(v&&v.length||(m=s.visible=!1),m){h("label"),h("displayindex",s._index);var p=a.categoryarray,y=c.isArrayOrTypedArray(p)&&p.length>0||i(p),l;y&&(l="array");var x=h("categoryorder",l);x==="array"?(h("categoryarray"),h("ticktext")):(delete a.categoryarray,delete a.ticktext),!y&&x==="array"&&(s.categoryorder="trace")}}V.exports=function(a,s,h,v){function m(x,b){return c.coerce(a,s,e,x,b)}var p=t(a,s,{name:"dimensions",handleItemDefaults:o}),y=n(a,s,h,v,m);A(s,v,m),(!Array.isArray(p)||!p.length)&&(s.visible=!1),r(s,p,"values",y),m("hoveron"),m("hovertemplate"),m("arrangement"),m("bundlecolors"),m("sortpaths"),m("counts");var l=v.font;c.coerceFont(m,"labelfont",l,{overrideDflt:{size:Math.round(l.size)}}),c.coerceFont(m,"tickfont",l,{autoShadowDflt:!0,overrideDflt:{size:Math.round(l.size/1.2)}})}}),dI=Vt((X,V)=>{var c=Ap().wrap,g=pf().hasColorscale,E=df(),A=Q_(),t=go(),e=qr(),r=vo();V.exports=function(l,x){var b=e.filterVisible(x.dimensions);if(b.length===0)return[];var S=b.map(function(tt){var Z;if(tt.categoryorder==="trace")Z=null;else if(tt.categoryorder==="array")Z=tt.categoryarray;else{Z=A(tt.values);for(var st=!0,$=0;$<Z.length;$++)if(!r(Z[$])){st=!1;break}Z.sort(st?e.sorterAsc:void 0),tt.categoryorder==="category descending"&&(Z=Z.reverse())}return v(tt.values,Z)}),T,M,w;e.isArrayOrTypedArray(x.counts)?T=x.counts:T=[x.counts],m(b),b.forEach(function(tt,Z){p(tt,S[Z])});var u=x.line,f;u?(g(x,"line")&&E(l,x,{vals:x.line.color,containerStr:"line",cLetter:"c"}),f=t.tryColorscale(u)):f=e.identity;function k(tt){var Z,st;return e.isArrayOrTypedArray(u.color)?(Z=u.color[tt%u.color.length],st=Z):Z=u.color,{color:f(Z),rawColor:st}}var _=b[0].values.length,D={},I=S.map(function(tt){return tt.inds});w=0;var O,B;for(O=0;O<_;O++){var R=[];for(B=0;B<I.length;B++)R.push(I[B][O]);M=T[O%T.length],w+=M;var L=k(O),F=R+"-"+L.rawColor;D[F]===void 0&&(D[F]=s(R,L.color,L.rawColor)),h(D[F],O,M)}var N=b.map(function(tt,Z){return n(Z,tt._index,tt._displayindex,tt.label,w)});for(O=0;O<_;O++)for(M=T[O%T.length],B=0;B<N.length;B++){var j=N[B].containerInd,G=S[B].inds[O],rt=N[B].categories;if(rt[G]===void 0){var ct=x.dimensions[j]._categoryarray[G],lt=x.dimensions[j]._ticktext[G];rt[G]=o(B,G,ct,lt)}a(rt[G],O,M)}return c(i(N,D,w))};function i(l,x,b){var S=l.map(function(T){return T.categories.length}).reduce(function(T,M){return Math.max(T,M)});return{dimensions:l,paths:x,trace:void 0,maxCats:S,count:b}}function n(l,x,b,S,T){return{dimensionInd:l,containerInd:x,displayInd:b,dimensionLabel:S,count:T,categories:[],dragX:null}}function o(l,x,b,S){return{dimensionInd:l,categoryInd:x,categoryValue:b,displayInd:x,categoryLabel:S,valueInds:[],count:0,dragY:null}}function a(l,x,b){l.valueInds.push(x),l.count+=b}function s(l,x,b){return{categoryInds:l,color:x,rawColor:b,valueInds:[],count:0}}function h(l,x,b){l.valueInds.push(x),l.count+=b}function v(l,x){x==null?x=[]:x=x.map(function(k){return k});var b={},S={},T=[];x.forEach(function(k,_){b[k]=0,S[k]=_});for(var M=0;M<l.length;M++){var w=l[M],u;b[w]===void 0?(b[w]=1,u=x.push(w)-1,S[w]=u):(b[w]++,u=S[w]),T.push(u)}var f=x.map(function(k){return b[k]});return{uniqueValues:x,uniqueCounts:f,inds:T}}function m(l){var x=l.map(function(S){return S.displayindex}),b;if(y(x))for(b=0;b<l.length;b++)l[b]._displayindex=l[b].displayindex;else for(b=0;b<l.length;b++)l[b]._displayindex=b}function p(l,x){l._categoryarray=x.uniqueValues,l.ticktext===null||l.ticktext===void 0?l._ticktext=[]:l._ticktext=l.ticktext.slice();for(var b=l._ticktext.length;b<x.uniqueValues.length;b++)l._ticktext.push(x.uniqueValues[b])}function y(l){for(var x=new Array(l.length),b=0;b<l.length;b++){if(l[b]<0||l[b]>=l.length||x[l[b]]!==void 0)return!1;x[l[b]]=!0}return!0}}),gI=Vt((X,V)=>{var c=Ai(),g=(M0(),xd(Rd)).interpolateNumber,E=Xy(),A=Hu(),t=qr(),e=t.strTranslate,r=go(),i=yh(),n=sl();function o(Q,nt,Y,q){var ot=nt._context.staticPlot,it=Q.map(lt.bind(0,nt,Y)),dt=q.selectAll("g.parcatslayer").data([null]);dt.enter().append("g").attr("class","parcatslayer").style("pointer-events",ot?"none":"all");var wt=dt.selectAll("g.trace.parcats").data(it,a),xt=wt.enter().append("g").attr("class","trace parcats");wt.attr("transform",function(vt){return e(vt.x,vt.y)}),xt.append("g").attr("class","paths");var Ft=wt.select("g.paths"),Et=Ft.selectAll("path.path").data(function(vt){return vt.paths},a);Et.attr("fill",function(vt){return vt.model.color});var Nt=Et.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(vt){return vt.model.color}).attr("fill-opacity",0);x(Nt),Et.attr("d",function(vt){return vt.svgD}),Nt.empty()||Et.sort(h),Et.exit().remove(),Et.on("mouseover",v).on("mouseout",m).on("click",l),xt.append("g").attr("class","dimensions");var te=wt.select("g.dimensions"),Jt=te.selectAll("g.dimension").data(function(vt){return vt.dimensions},a);Jt.enter().append("g").attr("class","dimension"),Jt.attr("transform",function(vt){return e(vt.x,0)}),Jt.exit().remove();var Qt=Jt.selectAll("g.category").data(function(vt){return vt.categories},a),Wt=Qt.enter().append("g").attr("class","category");Qt.attr("transform",function(vt){return e(0,vt.y)}),Wt.append("rect").attr("class","catrect").attr("pointer-events","none"),Qt.select("rect.catrect").attr("fill","none").attr("width",function(vt){return vt.width}).attr("height",function(vt){return vt.height}),T(Wt);var gt=Qt.selectAll("rect.bandrect").data(function(vt){return vt.bands},a);gt.each(function(){t.raiseToTop(this)}),gt.attr("fill",function(vt){return vt.color});var bt=gt.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(vt){return vt.color}).attr("fill-opacity",0);gt.attr("fill",function(vt){return vt.color}).attr("width",function(vt){return vt.width}).attr("height",function(vt){return vt.height}).attr("y",function(vt){return vt.y}).attr("cursor",function(vt){return vt.parcatsViewModel.arrangement==="fixed"?"default":vt.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),w(bt),gt.exit().remove(),Wt.append("text").attr("class","catlabel").attr("pointer-events","none"),Qt.select("text.catlabel").attr("text-anchor",function(vt){return s(vt)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(vt){return s(vt)?vt.width+5:-5}).attr("y",function(vt){return vt.height/2}).text(function(vt){return vt.model.categoryLabel}).each(function(vt){r.font(c.select(this),vt.parcatsViewModel.categorylabelfont),n.convertToTspans(c.select(this),nt)}),Wt.append("text").attr("class","dimlabel"),Qt.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(vt){return vt.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(vt){return vt.width/2}).attr("y",-5).text(function(vt,Ut){return Ut===0?vt.parcatsViewModel.model.dimensions[vt.model.dimensionInd].dimensionLabel:null}).each(function(vt){r.font(c.select(this),vt.parcatsViewModel.labelfont)}),Qt.selectAll("rect.bandrect").on("mouseover",R).on("mouseout",L),Qt.exit().remove(),Jt.call(c.behavior.drag().origin(function(vt){return{x:vt.x,y:0}}).on("dragstart",F).on("drag",N).on("dragend",j)),wt.each(function(vt){vt.traceSelection=c.select(this),vt.pathSelection=c.select(this).selectAll("g.paths").selectAll("path.path"),vt.dimensionSelection=c.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),wt.exit().remove()}V.exports=function(Q,nt,Y,q){o(Y,Q,q,nt)};function a(Q){return Q.key}function s(Q){var nt=Q.parcatsViewModel.dimensions.length,Y=Q.parcatsViewModel.dimensions[nt-1].model.dimensionInd;return Q.model.dimensionInd===Y}function h(Q,nt){return Q.model.rawColor>nt.model.rawColor?1:Q.model.rawColor<nt.model.rawColor?-1:0}function v(Q){if(!Q.parcatsViewModel.dragDimension&&Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){t.raiseToTop(this),b(c.select(this));var nt=p(Q),Y=y(Q);if(Q.parcatsViewModel.graphDiv.emit("plotly_hover",{points:nt,event:c.event,constraints:Y}),Q.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var q=c.mouse(this)[0],ot=Q.parcatsViewModel.graphDiv,it=Q.parcatsViewModel.trace,dt=ot._fullLayout,wt=dt._paperdiv.node().getBoundingClientRect(),xt=Q.parcatsViewModel.graphDiv.getBoundingClientRect(),Ft,Et,Nt;for(Nt=0;Nt<Q.leftXs.length-1;Nt++)if(Q.leftXs[Nt]+Q.dimWidths[Nt]-2<=q&&q<=Q.leftXs[Nt+1]+2){var te=Q.parcatsViewModel.dimensions[Nt],Jt=Q.parcatsViewModel.dimensions[Nt+1];Ft=(te.x+te.width+Jt.x)/2,Et=(Q.topYs[Nt]+Q.topYs[Nt+1]+Q.height)/2;break}var Qt=Q.parcatsViewModel.x+Ft,Wt=Q.parcatsViewModel.y+Et,gt=i.mostReadable(Q.model.color,["black","white"]),bt=Q.model.count,vt=bt/Q.parcatsViewModel.model.count,Ut={countLabel:bt,probabilityLabel:vt.toFixed(3)},Kt=[];Q.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Kt.push(["Count:",Ut.countLabel].join(" ")),Q.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&Kt.push(["P:",Ut.probabilityLabel].join(" "));var Zt=Kt.join("<br>"),le=c.mouse(ot)[0];A.loneHover({trace:it,x:Qt-wt.left+xt.left,y:Wt-wt.top+xt.top,text:Zt,color:Q.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:gt,idealAlign:le<Qt?"right":"left",hovertemplate:(it.line||{}).hovertemplate,hovertemplateLabels:Ut,eventData:[{data:it._input,fullData:it,count:bt,probability:vt}]},{container:dt._hoverlayer.node(),outerContainer:dt._paper.node(),gd:ot})}}}function m(Q){if(!Q.parcatsViewModel.dragDimension&&(x(c.select(this)),A.loneUnhover(Q.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),Q.parcatsViewModel.pathSelection.sort(h),Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1)){var nt=p(Q),Y=y(Q);Q.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:nt,event:c.event,constraints:Y})}}function p(Q){for(var nt=[],Y=G(Q.parcatsViewModel),q=0;q<Q.model.valueInds.length;q++){var ot=Q.model.valueInds[q];nt.push({curveNumber:Y,pointNumber:ot})}return nt}function y(Q){for(var nt={},Y=Q.parcatsViewModel.model.dimensions,q=0;q<Y.length;q++){var ot=Y[q],it=ot.categories[Q.model.categoryInds[q]];nt[ot.containerInd]=it.categoryValue}return Q.model.rawColor!==void 0&&(nt.color=Q.model.rawColor),nt}function l(Q){if(Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var nt=p(Q),Y=y(Q);Q.parcatsViewModel.graphDiv.emit("plotly_click",{points:nt,event:c.event,constraints:Y})}}function x(Q){Q.attr("fill",function(nt){return nt.model.color}).attr("fill-opacity",.6).attr("stroke","lightgray").attr("stroke-width",.2).attr("stroke-opacity",1)}function b(Q){Q.attr("fill-opacity",.8).attr("stroke",function(nt){return i.mostReadable(nt.model.color,["black","white"])}).attr("stroke-width",.3)}function S(Q){Q.select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}function T(Q){Q.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function M(Q){Q.attr("stroke","black").attr("stroke-width",1.5)}function w(Q){Q.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function u(Q){var nt=Q.parcatsViewModel.pathSelection,Y=Q.categoryViewModel.model.dimensionInd,q=Q.categoryViewModel.model.categoryInd;return nt.filter(function(ot){return ot.model.categoryInds[Y]===q&&ot.model.color===Q.color})}function f(Q){var nt=c.select(Q.parentNode).selectAll("rect.bandrect");nt.each(function(Y){var q=u(Y);b(q),q.each(function(){t.raiseToTop(this)})}),S(c.select(Q.parentNode))}function k(Q){var nt=c.select(Q).datum(),Y=u(nt);b(Y),Y.each(function(){t.raiseToTop(this)}),c.select(Q.parentNode).selectAll("rect.bandrect").filter(function(q){return q.color===nt.color}).each(function(){t.raiseToTop(this),M(c.select(this))})}function _(Q,nt,Y){var q=c.select(Q).datum(),ot=q.categoryViewModel.model,it=q.parcatsViewModel.graphDiv,dt=c.select(Q.parentNode).selectAll("rect.bandrect"),wt=[];dt.each(function(Ft){var Et=u(Ft);Et.each(function(Nt){Array.prototype.push.apply(wt,p(Nt))})});var xt={};xt[ot.dimensionInd]=ot.categoryValue,it.emit(nt,{points:wt,event:Y,constraints:xt})}function D(Q,nt,Y){var q=c.select(Q).datum(),ot=q.categoryViewModel.model,it=q.parcatsViewModel.graphDiv,dt=u(q),wt=[];dt.each(function(Ft){Array.prototype.push.apply(wt,p(Ft))});var xt={};xt[ot.dimensionInd]=ot.categoryValue,q.rawColor!==void 0&&(xt.color=q.rawColor),it.emit(nt,{points:wt,event:Y,constraints:xt})}function I(Q,nt,Y){Q._fullLayout._calcInverseTransform(Q);var q=Q._fullLayout._invScaleX,ot=Q._fullLayout._invScaleY,it=c.select(Y.parentNode).select("rect.catrect"),dt=it.node().getBoundingClientRect(),wt=it.datum(),xt=wt.parcatsViewModel,Ft=xt.model.dimensions[wt.model.dimensionInd],Et=xt.trace,Nt=dt.top+dt.height/2,te,Jt;xt.dimensions.length>1&&Ft.displayInd===xt.dimensions.length-1?(te=dt.left,Jt="left"):(te=dt.left+dt.width,Jt="right");var Qt=wt.model.count,Wt=wt.model.categoryLabel,gt=Qt/wt.parcatsViewModel.model.count,bt={countLabel:Qt,categoryLabel:Wt,probabilityLabel:gt.toFixed(3)},vt=[];wt.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&vt.push(["Count:",bt.countLabel].join(" ")),wt.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&vt.push(["P("+bt.categoryLabel+"):",bt.probabilityLabel].join(" "));var Ut=vt.join("<br>");return{trace:Et,x:q*(te-nt.left),y:ot*(Nt-nt.top),text:Ut,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:Jt,hovertemplate:Et.hovertemplate,hovertemplateLabels:bt,eventData:[{data:Et._input,fullData:Et,count:Qt,category:Wt,probability:gt}]}}function O(Q,nt,Y){var q=[];return c.select(Y.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var ot=this;q.push(I(Q,nt,ot))}),q}function B(Q,nt,Y){Q._fullLayout._calcInverseTransform(Q);var q=Q._fullLayout._invScaleX,ot=Q._fullLayout._invScaleY,it=Y.getBoundingClientRect(),dt=c.select(Y).datum(),wt=dt.categoryViewModel,xt=wt.parcatsViewModel,Ft=xt.model.dimensions[wt.model.dimensionInd],Et=xt.trace,Nt=it.y+it.height/2,te,Jt;xt.dimensions.length>1&&Ft.displayInd===xt.dimensions.length-1?(te=it.left,Jt="left"):(te=it.left+it.width,Jt="right");var Qt=wt.model.categoryLabel,Wt=dt.parcatsViewModel.model.count,gt=0;dt.categoryViewModel.bands.forEach(function(Oe){Oe.color===dt.color&&(gt+=Oe.count)});var bt=wt.model.count,vt=0;xt.pathSelection.each(function(Oe){Oe.model.color===dt.color&&(vt+=Oe.model.count)});var Ut=gt/Wt,Kt=gt/vt,Zt=gt/bt,le={countLabel:gt,categoryLabel:Qt,probabilityLabel:Ut.toFixed(3)},Te=[];wt.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Te.push(["Count:",le.countLabel].join(" ")),wt.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Te.push("P(color ∩ "+Qt+"): "+le.probabilityLabel),Te.push("P("+Qt+" | color): "+Kt.toFixed(3)),Te.push("P(color | "+Qt+"): "+Zt.toFixed(3)));var Se=Te.join("<br>"),Fe=i.mostReadable(dt.color,["black","white"]);return{trace:Et,x:q*(te-nt.left),y:ot*(Nt-nt.top),text:Se,color:dt.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:Fe,fontSize:10,idealAlign:Jt,hovertemplate:Et.hovertemplate,hovertemplateLabels:le,eventData:[{data:Et._input,fullData:Et,category:Qt,count:Wt,probability:Ut,categorycount:bt,colorcount:vt,bandcolorcount:gt}]}}function R(Q){if(!Q.parcatsViewModel.dragDimension&&Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var nt=c.mouse(this)[1];if(nt<-1)return;var Y=Q.parcatsViewModel.graphDiv,q=Y._fullLayout,ot=q._paperdiv.node().getBoundingClientRect(),it=Q.parcatsViewModel.hoveron,dt=this;if(it==="color"?(k(dt),D(dt,"plotly_hover",c.event)):(f(dt),_(dt,"plotly_hover",c.event)),Q.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var wt;it==="category"?wt=I(Y,ot,dt):it==="color"?wt=B(Y,ot,dt):it==="dimension"&&(wt=O(Y,ot,dt)),wt&&A.loneHover(wt,{container:q._hoverlayer.node(),outerContainer:q._paper.node(),gd:Y})}}}function L(Q){var nt=Q.parcatsViewModel;if(!nt.dragDimension&&(x(nt.pathSelection),T(nt.dimensionSelection.selectAll("g.category")),w(nt.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),A.loneUnhover(nt.graphDiv._fullLayout._hoverlayer.node()),nt.pathSelection.sort(h),nt.hoverinfoItems.indexOf("skip")===-1)){var Y=Q.parcatsViewModel.hoveron,q=this;Y==="color"?D(q,"plotly_unhover",c.event):_(q,"plotly_unhover",c.event)}}function F(Q){Q.parcatsViewModel.arrangement!=="fixed"&&(Q.dragDimensionDisplayInd=Q.model.displayInd,Q.initialDragDimensionDisplayInds=Q.parcatsViewModel.model.dimensions.map(function(nt){return nt.displayInd}),Q.dragHasMoved=!1,Q.dragCategoryDisplayInd=null,c.select(this).selectAll("g.category").select("rect.catrect").each(function(nt){var Y=c.mouse(this)[0],q=c.mouse(this)[1];-2<=Y&&Y<=nt.width+2&&-2<=q&&q<=nt.height+2&&(Q.dragCategoryDisplayInd=nt.model.displayInd,Q.initialDragCategoryDisplayInds=Q.model.categories.map(function(ot){return ot.displayInd}),nt.model.dragY=nt.y,t.raiseToTop(this.parentNode),c.select(this.parentNode).selectAll("rect.bandrect").each(function(ot){ot.y<q&&q<=ot.y+ot.height&&(Q.potentialClickBand=this)}))}),Q.parcatsViewModel.dragDimension=Q,A.loneUnhover(Q.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()))}function N(Q){if(Q.parcatsViewModel.arrangement!=="fixed"&&(Q.dragHasMoved=!0,Q.dragDimensionDisplayInd!==null)){var nt=Q.dragDimensionDisplayInd,Y=nt-1,q=nt+1,ot=Q.parcatsViewModel.dimensions[nt];if(Q.dragCategoryDisplayInd!==null){var it=ot.categories[Q.dragCategoryDisplayInd];it.model.dragY+=c.event.dy;var dt=it.model.dragY,wt=it.model.displayInd,xt=ot.categories,Ft=xt[wt-1],Et=xt[wt+1];Ft!==void 0&&dt<Ft.y+Ft.height/2&&(it.model.displayInd=Ft.model.displayInd,Ft.model.displayInd=wt),Et!==void 0&&dt+it.height>Et.y+Et.height/2&&(it.model.displayInd=Et.model.displayInd,Et.model.displayInd=wt),Q.dragCategoryDisplayInd=it.model.displayInd}if(Q.dragCategoryDisplayInd===null||Q.parcatsViewModel.arrangement==="freeform"){ot.model.dragX=c.event.x;var Nt=Q.parcatsViewModel.dimensions[Y],te=Q.parcatsViewModel.dimensions[q];Nt!==void 0&&ot.model.dragX<Nt.x+Nt.width&&(ot.model.displayInd=Nt.model.displayInd,Nt.model.displayInd=nt),te!==void 0&&ot.model.dragX+ot.width>te.x&&(ot.model.displayInd=te.model.displayInd,te.model.displayInd=Q.dragDimensionDisplayInd),Q.dragDimensionDisplayInd=ot.model.displayInd}st(Q.parcatsViewModel),Z(Q.parcatsViewModel),ct(Q.parcatsViewModel),rt(Q.parcatsViewModel)}}function j(Q){if(Q.parcatsViewModel.arrangement!=="fixed"&&Q.dragDimensionDisplayInd!==null){c.select(this).selectAll("text").attr("font-weight","normal");var nt={},Y=G(Q.parcatsViewModel),q=Q.parcatsViewModel.model.dimensions.map(function(te){return te.displayInd}),ot=Q.initialDragDimensionDisplayInds.some(function(te,Jt){return te!==q[Jt]});ot&&q.forEach(function(te,Jt){var Qt=Q.parcatsViewModel.model.dimensions[Jt].containerInd;nt["dimensions["+Qt+"].displayindex"]=te});var it=!1;if(Q.dragCategoryDisplayInd!==null){var dt=Q.model.categories.map(function(te){return te.displayInd});if(it=Q.initialDragCategoryDisplayInds.some(function(te,Jt){return te!==dt[Jt]}),it){var wt=Q.model.categories.slice().sort(function(te,Jt){return te.displayInd-Jt.displayInd}),xt=wt.map(function(te){return te.categoryValue}),Ft=wt.map(function(te){return te.categoryLabel});nt["dimensions["+Q.model.containerInd+"].categoryarray"]=[xt],nt["dimensions["+Q.model.containerInd+"].ticktext"]=[Ft],nt["dimensions["+Q.model.containerInd+"].categoryorder"]="array"}}if(Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!Q.dragHasMoved&&Q.potentialClickBand&&(Q.parcatsViewModel.hoveron==="color"?D(Q.potentialClickBand,"plotly_click",c.event.sourceEvent):_(Q.potentialClickBand,"plotly_click",c.event.sourceEvent)),Q.model.dragX=null,Q.dragCategoryDisplayInd!==null){var Et=Q.parcatsViewModel.dimensions[Q.dragDimensionDisplayInd].categories[Q.dragCategoryDisplayInd];Et.model.dragY=null,Q.dragCategoryDisplayInd=null}Q.dragDimensionDisplayInd=null,Q.parcatsViewModel.dragDimension=null,Q.dragHasMoved=null,Q.potentialClickBand=null,st(Q.parcatsViewModel),Z(Q.parcatsViewModel);var Nt=c.transition().duration(300).ease("cubic-in-out");Nt.each(function(){ct(Q.parcatsViewModel,!0),rt(Q.parcatsViewModel,!0)}).each("end",function(){(ot||it)&&E.restyle(Q.parcatsViewModel.graphDiv,nt,[Y])})}}function G(Q){for(var nt,Y=Q.graphDiv._fullData,q=0;q<Y.length;q++)if(Q.key===Y[q].uid){nt=q;break}return nt}function rt(Q,nt){nt===void 0&&(nt=!1);function Y(q){return nt?q.transition():q}Q.pathSelection.data(function(q){return q.paths},a),Y(Q.pathSelection).attr("d",function(q){return q.svgD})}function ct(Q,nt){nt===void 0&&(nt=!1);function Y(xt){return nt?xt.transition():xt}Q.dimensionSelection.data(function(xt){return xt.dimensions},a);var q=Q.dimensionSelection.selectAll("g.category").data(function(xt){return xt.categories},a);Y(Q.dimensionSelection).attr("transform",function(xt){return e(xt.x,0)}),Y(q).attr("transform",function(xt){return e(0,xt.y)});var ot=q.select(".dimlabel");ot.text(function(xt,Ft){return Ft===0?xt.parcatsViewModel.model.dimensions[xt.model.dimensionInd].dimensionLabel:null});var it=q.select(".catlabel");it.attr("text-anchor",function(xt){return s(xt)?"start":"end"}).attr("x",function(xt){return s(xt)?xt.width+5:-5}).each(function(xt){var Ft,Et;s(xt)?(Ft=xt.width+5,Et="start"):(Ft=-5,Et="end"),c.select(this).selectAll("tspan").attr("x",Ft).attr("text-anchor",Et)});var dt=q.selectAll("rect.bandrect").data(function(xt){return xt.bands},a),wt=dt.enter().append("rect").attr("class","bandrect").attr("cursor","move").attr("stroke-opacity",0).attr("fill",function(xt){return xt.color}).attr("fill-opacity",0);dt.attr("fill",function(xt){return xt.color}).attr("width",function(xt){return xt.width}).attr("height",function(xt){return xt.height}).attr("y",function(xt){return xt.y}),w(wt),dt.each(function(){t.raiseToTop(this)}),dt.exit().remove()}function lt(Q,nt,Y){var q=Y[0],ot=nt.margin||{l:80,r:80,t:100,b:80},it=q.trace,dt=it.domain,wt=nt.width,xt=nt.height,Ft=Math.floor(wt*(dt.x[1]-dt.x[0])),Et=Math.floor(xt*(dt.y[1]-dt.y[0])),Nt=dt.x[0]*wt+ot.l,te=nt.height-dt.y[1]*nt.height+ot.t,Jt=it.line.shape,Qt;it.hoverinfo==="all"?Qt=["count","probability"]:Qt=(it.hoverinfo||"").split("+");var Wt={trace:it,key:it.uid,model:q,x:Nt,y:te,width:Ft,height:Et,hoveron:it.hoveron,hoverinfoItems:Qt,arrangement:it.arrangement,bundlecolors:it.bundlecolors,sortpaths:it.sortpaths,labelfont:it.labelfont,categorylabelfont:it.tickfont,pathShape:Jt,dragDimension:null,margin:ot,paths:[],dimensions:[],graphDiv:Q,traceSelection:null,pathSelection:null,dimensionSelection:null};return q.dimensions&&(st(Wt),Z(Wt)),Wt}function tt(Q,nt,Y,q,ot){var it=[],dt=[],wt,xt;for(xt=0;xt<Y.length-1;xt++)wt=g(Y[xt]+Q[xt],Q[xt+1]),it.push(wt(ot)),dt.push(wt(1-ot));var Ft="M "+Q[0]+","+nt[0];for(Ft+="l"+Y[0]+",0 ",xt=1;xt<Y.length;xt++)Ft+="C"+it[xt-1]+","+nt[xt-1]+" "+dt[xt-1]+","+nt[xt]+" "+Q[xt]+","+nt[xt],Ft+="l"+Y[xt]+",0 ";for(Ft+="l0,"+q+" ",Ft+="l -"+Y[Y.length-1]+",0 ",xt=Y.length-2;xt>=0;xt--)Ft+="C"+dt[xt]+","+(nt[xt+1]+q)+" "+it[xt]+","+(nt[xt]+q)+" "+(Q[xt]+Y[xt])+","+(nt[xt]+q),Ft+="l-"+Y[xt]+",0 ";return Ft+="Z",Ft}function Z(Q){var nt=Q.dimensions,Y=Q.model,q=nt.map(function(We){return We.categories.map(function(Lr){return Lr.y})}),ot=Q.model.dimensions.map(function(We){return We.categories.map(function(Lr){return Lr.displayInd})}),it=Q.model.dimensions.map(function(We){return We.displayInd}),dt=Q.dimensions.map(function(We){return We.model.dimensionInd}),wt=nt.map(function(We){return We.x}),xt=nt.map(function(We){return We.width}),Ft=[];for(var Et in Y.paths)Y.paths.hasOwnProperty(Et)&&Ft.push(Y.paths[Et]);function Nt(We){var Lr=We.categoryInds.map(function(he,Dt){return ot[Dt][he]}),kr=dt.map(function(he){return Lr[he]});return kr}Ft.sort(function(We,Lr){var kr=Nt(We),he=Nt(Lr);return Q.sortpaths==="backward"&&(kr.reverse(),he.reverse()),kr.push(We.valueInds[0]),he.push(Lr.valueInds[0]),Q.bundlecolors&&(kr.unshift(We.rawColor),he.unshift(Lr.rawColor)),kr<he?-1:kr>he?1:0});for(var te=new Array(Ft.length),Jt=nt[0].model.count,Qt=nt[0].categories.map(function(We){return We.height}).reduce(function(We,Lr){return We+Lr}),Wt=0;Wt<Ft.length;Wt++){var gt=Ft[Wt],bt;Jt>0?bt=Qt*(gt.count/Jt):bt=0;for(var vt=new Array(q.length),Ut=0;Ut<gt.categoryInds.length;Ut++){var Kt=gt.categoryInds[Ut],Zt=ot[Ut][Kt],le=it[Ut];vt[le]=q[le][Zt],q[le][Zt]+=bt;var Te=Q.dimensions[le].categories[Zt],Se=Te.bands.length,Fe=Te.bands[Se-1];if(Fe===void 0||gt.rawColor!==Fe.rawColor){var Oe=Fe===void 0?0:Fe.y+Fe.height;Te.bands.push({key:Oe,color:gt.color,rawColor:gt.rawColor,height:bt,width:Te.width,count:gt.count,y:Oe,categoryViewModel:Te,parcatsViewModel:Q})}else{var ur=Te.bands[Se-1];ur.height+=bt,ur.count+=gt.count}}var fr;Q.pathShape==="hspline"?fr=tt(wt,vt,xt,bt,.5):fr=tt(wt,vt,xt,bt,0),te[Wt]={key:gt.valueInds[0],model:gt,height:bt,leftXs:wt,topYs:vt,dimWidths:xt,svgD:fr,parcatsViewModel:Q}}Q.paths=te}function st(Q){var nt=Q.model.dimensions.map(function(dt){return{displayInd:dt.displayInd,dimensionInd:dt.dimensionInd}});nt.sort(function(dt,wt){return dt.displayInd-wt.displayInd});var Y=[];for(var q in nt){var ot=nt[q].dimensionInd,it=Q.model.dimensions[ot];Y.push($(Q,it))}Q.dimensions=Y}function $(Q,nt){var Y=40,q=16,ot=Q.model.dimensions.length,it=nt.displayInd,dt,wt,xt;ot>1?dt=(Q.width-2*Y-q)/(ot-1):dt=0,wt=Y,xt=wt+dt*it;var Ft=[],Et=Q.model.maxCats,Nt=nt.categories.length,te=8,Jt=nt.count,Qt=Q.height-te*(Et-1),Wt,gt,bt,vt,Ut,Kt=(Et-Nt)*te/2,Zt=nt.categories.map(function(le){return{displayInd:le.displayInd,categoryInd:le.categoryInd}});for(Zt.sort(function(le,Te){return le.displayInd-Te.displayInd}),Ut=0;Ut<Nt;Ut++)vt=Zt[Ut].categoryInd,gt=nt.categories[vt],Jt>0?Wt=gt.count/Jt*Qt:Wt=0,bt={key:gt.valueInds[0],model:gt,width:q,height:Wt,y:gt.dragY!==null?gt.dragY:Kt,bands:[],parcatsViewModel:Q},Kt=Kt+Wt+te,Ft.push(bt);return{key:nt.dimensionInd,x:nt.dragX!==null?nt.dragX:xt,y:0,width:q,model:nt,categories:Ft,parcatsViewModel:Q,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}),f5=Vt((X,V)=>{var c=gI();V.exports=function(g,E,A,t){var e=g._fullLayout,r=e._paper,i=e._size;c(g,r,E,{width:i.w,height:i.h,margin:{t:i.t,r:i.r,b:i.b,l:i.l}},A,t)}}),mI=Vt(X=>{var V=Ph().getModuleCalcData,c=f5(),g="parcats";X.name=g,X.plot=function(E,A,t,e){var r=V(E.calcdata,g);if(r.length){var i=r[0];c(E,i,t,e)}},X.clean=function(E,A,t,e){var r=e._has&&e._has("parcats"),i=A._has&&A._has("parcats");r&&!i&&e._paperdiv.selectAll(".parcats").remove()}}),vI=Vt((X,V)=>{V.exports={attributes:h5(),supplyDefaults:pI(),calc:dI(),plot:f5(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:mI(),categories:["noOpacity"],meta:{}}}),yI=Vt((X,V)=>{V.exports=vI()}),$p=Vt((X,V)=>{var c=Td(),g="1.13.4",E='© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',A=['© <a target="_blank" href="https://carto.com/">Carto</a>',E].join(" "),t=['Map tiles by <a target="_blank" href="https://stamen.com">Stamen Design</a>','under <a target="_blank" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',"|",'Data by <a target="_blank" href="https://openstreetmap.org">OpenStreetMap</a> contributors','under <a target="_blank" href="https://www.openstreetmap.org/copyright">ODbL</a>'].join(" "),e=['Map tiles by <a target="_blank" href="https://stamen.com">Stamen Design</a>','under <a target="_blank" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',"|",'Data by <a target="_blank" href="https://openstreetmap.org">OpenStreetMap</a> contributors','under <a target="_blank" href="https://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>'].join(" "),r={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:E,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:A,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:A,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},i=c(r);V.exports={requiredVersion:g,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:i,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+g+"."].join(`
|
||
`),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(`
|
||
`),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",i.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(`
|
||
`),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(`
|
||
`),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}),Dv=Vt((X,V)=>{var c=qr(),g=vi().defaultLine,E=pu().attributes,A=Nl(),t=Gu().textposition,e=su().overrideAll,r=Ns().templatedArray,i=$p(),n=A({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var o=V.exports=e({_arrayAttrRegexps:[c.counterRegex("mapbox",".layers",!0)],domain:E({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:i.styleValuesMapbox.concat(i.styleValuesNonMapbox),dflt:i.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:g},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:g}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:n,textposition:c.extendFlat({},t,{arrayOk:!1})}})},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}),Vx=Vt((X,V)=>{var c=Zo().hovertemplateAttrs,g=Zo().texttemplateAttrs,E=rp(),A=E0(),t=Gu(),e=Dv(),r=Ks(),i=wl(),n=po().extendFlat,o=su().overrideAll,a=Dv(),s=A.line,h=A.marker;V.exports=o({lon:A.lon,lat:A.lat,cluster:{enabled:{valType:"boolean"},maxzoom:n({},a.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:n({},h.opacity,{dflt:1})},mode:n({},t.mode,{dflt:"markers"}),text:n({},t.text,{}),texttemplate:g({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:n({},t.hovertext,{}),line:{color:s.color,width:s.width},connectgaps:t.connectgaps,marker:n({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:h.opacity,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode},i("marker")),fill:A.fill,fillcolor:E(),textfont:e.layers.symbol.textfont,textposition:e.layers.symbol.textposition,below:{valType:"string"},selected:{marker:t.selected.marker},unselected:{marker:t.unselected.marker},hoverinfo:n({},r.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:c()},"calc","nested")}),p5=Vt((X,V)=>{var c=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];V.exports={isSupportedFont:function(g){return c.indexOf(g)!==-1}}}),xI=Vt((X,V)=>{var c=qr(),g=Sl(),E=Df(),A=Nf(),t=Uf(),e=ap(),r=Vx(),i=p5().isSupportedFont;V.exports=function(o,a,s,h){function v(f,k){return c.coerce(o,a,r,f,k)}function m(f,k){return c.coerce2(o,a,r,f,k)}var p=n(o,a,v);if(!p){a.visible=!1;return}if(v("text"),v("texttemplate"),v("hovertext"),v("hovertemplate"),v("mode"),v("below"),g.hasMarkers(a)){E(o,a,s,h,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("marker.angle");var y=a.marker;y.symbol!=="circle"&&(c.isArrayOrTypedArray(y.size)&&(y.size=y.size[0]),c.isArrayOrTypedArray(y.color)&&(y.color=y.color[0]))}g.hasLines(a)&&(A(o,a,s,h,v,{noDash:!0}),v("connectgaps"));var l=m("cluster.maxzoom"),x=m("cluster.step"),b=m("cluster.color",a.marker&&a.marker.color||s),S=m("cluster.size"),T=m("cluster.opacity"),M=l!==!1||x!==!1||b!==!1||S!==!1||T!==!1,w=v("cluster.enabled",M);if(w||g.hasText(a)){var u=h.font.family;t(o,a,h,v,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:i(u)?u:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}v("fill"),a.fill!=="none"&&e(o,a,s,v),c.coerceSelectionMarkerOpacity(a,v)};function n(o,a,s){var h=s("lon")||[],v=s("lat")||[],m=Math.min(h.length,v.length);return a._length=m,m}}),d5=Vt((X,V)=>{var c=ao();V.exports=function(g,E,A){var t={},e=A[E.subplot]._subplot,r=e.mockAxis,i=g.lonlat;return t.lonLabel=c.tickText(r,r.c2l(i[0]),!0).text,t.latLabel=c.tickText(r,r.c2l(i[1]),!0).text,t}}),g5=Vt((X,V)=>{var c=qr();V.exports=function(g,E){var A=g.split(" "),t=A[0],e=A[1],r=c.isArrayOrTypedArray(E)?c.mean(E):E,i=.5+r/100,n=1.5+r/100,o=["",""],a=[0,0];switch(t){case"top":o[0]="top",a[1]=-n;break;case"bottom":o[0]="bottom",a[1]=n;break}switch(e){case"left":o[1]="right",a[0]=-i;break;case"right":o[1]="left",a[0]=i;break}var s;return o[0]&&o[1]?s=o.join("-"):o[0]?s=o[0]:o[1]?s=o[1]:s="center",{anchor:s,offset:a}}}),_I=Vt((X,V)=>{var c=vo(),g=qr(),E=ts().BADNUM,A=Ud(),t=Ul(),e=go(),r=_g(),i=Sl(),n=p5().isSupportedFont,o=g5(),a=vf().appendArrayPointValue,s=sl().NEWLINES,h=sl().BR_TAG_ALL;V.exports=function(T,M){var w=M[0].trace,u=w.visible===!0&&w._length!==0,f=w.fill!=="none",k=i.hasLines(w),_=i.hasMarkers(w),D=i.hasText(w),I=_&&w.marker.symbol==="circle",O=_&&w.marker.symbol!=="circle",B=w.cluster&&w.cluster.enabled,R=v("fill"),L=v("line"),F=v("circle"),N=v("symbol"),j={fill:R,line:L,circle:F,symbol:N};if(!u)return j;var G;if((f||k)&&(G=A.calcTraceToLineCoords(M)),f&&(R.geojson=A.makePolygon(G),R.layout.visibility="visible",g.extendFlat(R.paint,{"fill-color":w.fillcolor})),k&&(L.geojson=A.makeLine(G),L.layout.visibility="visible",g.extendFlat(L.paint,{"line-width":w.line.width,"line-color":w.line.color,"line-opacity":w.opacity})),I){var rt=m(M);F.geojson=rt.geojson,F.layout.visibility="visible",B&&(F.filter=["!",["has","point_count"]],j.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":b(w.cluster.color,w.cluster.step),"circle-radius":b(w.cluster.size,w.cluster.step),"circle-opacity":b(w.cluster.opacity,w.cluster.step)}},j.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(w),"text-size":12}}),g.extendFlat(F.paint,{"circle-color":rt.mcc,"circle-radius":rt.mrc,"circle-opacity":rt.mo})}if(I&&B&&(F.filter=["!",["has","point_count"]]),(O||D)&&(N.geojson=p(M,T),g.extendFlat(N.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),O&&(g.extendFlat(N.layout,{"icon-size":w.marker.size/10}),"angle"in w.marker&&w.marker.angle!=="auto"&&g.extendFlat(N.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),N.layout["icon-allow-overlap"]=w.marker.allowoverlap,g.extendFlat(N.paint,{"icon-opacity":w.opacity*w.marker.opacity,"icon-color":w.marker.color})),D)){var ct=(w.marker||{}).size,lt=o(w.textposition,ct);g.extendFlat(N.layout,{"text-size":w.textfont.size,"text-anchor":lt.anchor,"text-offset":lt.offset,"text-font":S(w)}),g.extendFlat(N.paint,{"text-color":w.textfont.color,"text-opacity":w.opacity})}return j};function v(T){return{type:T,geojson:A.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function m(T){var M=T[0].trace,w=M.marker,u=M.selectedpoints,f=g.isArrayOrTypedArray(w.color),k=g.isArrayOrTypedArray(w.size),_=g.isArrayOrTypedArray(w.opacity),D;function I(lt){return M.opacity*lt}function O(lt){return lt/2}var B;f&&(t.hasColorscale(M,"marker")?B=t.makeColorScaleFuncFromTrace(w):B=g.identity);var R;k&&(R=r(M));var L;_&&(L=function(lt){var tt=c(lt)?+g.constrain(lt,0,1):0;return I(tt)});var F=[];for(D=0;D<T.length;D++){var N=T[D],j=N.lonlat;if(!x(j)){var G={};B&&(G.mcc=N.mcc=B(N.mc)),R&&(G.mrc=N.mrc=R(N.ms)),L&&(G.mo=L(N.mo)),u&&(G.selected=N.selected||0),F.push({type:"Feature",id:D+1,geometry:{type:"Point",coordinates:j},properties:G})}}var rt;if(u)for(rt=e.makeSelectedPointStyleFns(M),D=0;D<F.length;D++){var ct=F[D].properties;rt.selectedOpacityFn&&(ct.mo=I(rt.selectedOpacityFn(ct))),rt.selectedColorFn&&(ct.mcc=rt.selectedColorFn(ct)),rt.selectedSizeFn&&(ct.mrc=rt.selectedSizeFn(ct))}return{geojson:{type:"FeatureCollection",features:F},mcc:f||rt&&rt.selectedColorFn?{type:"identity",property:"mcc"}:w.color,mrc:k||rt&&rt.selectedSizeFn?{type:"identity",property:"mrc"}:O(w.size),mo:_||rt&&rt.selectedOpacityFn?{type:"identity",property:"mo"}:I(w.opacity)}}function p(T,M){for(var w=M._fullLayout,u=T[0].trace,f=u.marker||{},k=f.symbol,_=f.angle,D=k!=="circle"?y(k):l,I=_!=="auto"?y(_,!0):l,O=i.hasText(u)?y(u.text):l,B=[],R=0;R<T.length;R++){var L=T[R];if(!x(L.lonlat)){var F=u.texttemplate,N;if(F){var j=Array.isArray(F)?F[R]||"":F,G=u._module.formatLabels(L,u,w),rt={};a(rt,u,L.i);var ct=u._meta||{};N=g.texttemplateString(j,G,w._d3locale,rt,L,ct)}else N=O(R);N&&(N=N.replace(s,"").replace(h,`
|
||
`)),B.push({type:"Feature",geometry:{type:"Point",coordinates:L.lonlat},properties:{symbol:D(R),angle:I(R),text:N}})}}return{type:"FeatureCollection",features:B}}function y(T,M){return g.isArrayOrTypedArray(T)?M?function(w){return c(T[w])?+T[w]:0}:function(w){return T[w]}:T?function(){return T}:l}function l(){return""}function x(T){return T[0]===E}function b(T,M){var w;if(g.isArrayOrTypedArray(T)&&g.isArrayOrTypedArray(M)){w=["step",["get","point_count"],T[0]];for(var u=1;u<T.length;u++)w.push(M[u-1],T[u])}else w=T;return w}function S(T){var M=T.textfont,w=M.family,u=M.style,f=M.weight,k=w.split(" "),_=k[k.length-1]==="Italic";_&&k.pop(),_=_||u==="italic";var D=k.join(" ");f==="bold"&&k.indexOf("Bold")===-1?D+=" Bold":f<=1e3&&(k[0]==="Metropolis"?(D="Metropolis",f>850?D+=" Black":f>750?D+=" Extra Bold":f>650?D+=" Bold":f>550?D+=" Semi Bold":f>450?D+=" Medium":f>350?D+=" Regular":f>250?D+=" Light":f>150?D+=" Extra Light":D+=" Thin"):k.slice(0,2).join(" ")==="Open Sans"?(D="Open Sans",f>750?D+=" Extrabold":f>650?D+=" Bold":f>550?D+=" Semibold":f>350?D+=" Regular":D+=" Light"):k.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(D="Klokantech Noto Sans",k[3]==="CJK"&&(D+=" CJK"),D+=f>500?" Bold":" Regular")),_&&(D+=" Italic"),D==="Open Sans Regular Italic"?D="Open Sans Italic":D==="Open Sans Regular Bold"?D="Open Sans Bold":D==="Open Sans Regular Bold Italic"?D="Open Sans Bold Italic":D==="Klokantech Noto Sans Regular Italic"&&(D="Klokantech Noto Sans Italic"),n(D)||(D=w);var I=D.split(", ");return I}}),bI=Vt((X,V)=>{var c=qr(),g=_I(),E=$p().traceLayerPrefix,A={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function t(r,i,n,o){this.type="scattermapbox",this.subplot=r,this.uid=i,this.clusterEnabled=n,this.isHidden=o,this.sourceIds={fill:"source-"+i+"-fill",line:"source-"+i+"-line",circle:"source-"+i+"-circle",symbol:"source-"+i+"-symbol",cluster:"source-"+i+"-circle",clusterCount:"source-"+i+"-circle"},this.layerIds={fill:E+i+"-fill",line:E+i+"-line",circle:E+i+"-circle",symbol:E+i+"-symbol",cluster:E+i+"-cluster",clusterCount:E+i+"-cluster-count"},this.below=null}var e=t.prototype;e.addSource=function(r,i,n){var o={type:"geojson",data:i.geojson};n&&n.enabled&&c.extendFlat(o,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[r]);a?a.setData(i.geojson):this.subplot.map.addSource(this.sourceIds[r],o)},e.setSourceData=function(r,i){this.subplot.map.getSource(this.sourceIds[r]).setData(i.geojson)},e.addLayer=function(r,i,n){var o={type:i.type,id:this.layerIds[r],source:this.sourceIds[r],layout:i.layout,paint:i.paint};i.filter&&(o.filter=i.filter);for(var a=this.layerIds[r],s,h=this.subplot.getMapLayers(),v=0;v<h.length;v++)if(h[v].id===a){s=!0;break}s?(this.subplot.setOptions(a,"setLayoutProperty",o.layout),o.layout.visibility==="visible"&&this.subplot.setOptions(a,"setPaintProperty",o.paint)):this.subplot.addLayer(o,n)},e.update=function(r){var i=r[0].trace,n=this.subplot,o=n.map,a=g(n.gd,r),s=n.belowLookup["trace-"+this.uid],h=!!(i.cluster&&i.cluster.enabled),v=!!this.clusterEnabled,m=this;function p(u){u||m.addSource("circle",a.circle,i.cluster);for(var f=A.cluster,k=0;k<f.length;k++){var _=f[k],D=a[_];m.addLayer(_,D,s)}}function y(u){for(var f=A.cluster,k=f.length-1;k>=0;k--){var _=f[k];o.removeLayer(m.layerIds[_])}u||o.removeSource(m.sourceIds.circle)}function l(u){for(var f=A.nonCluster,k=0;k<f.length;k++){var _=f[k],D=a[_];u||m.addSource(_,D),m.addLayer(_,D,s)}}function x(u){for(var f=A.nonCluster,k=f.length-1;k>=0;k--){var _=f[k];o.removeLayer(m.layerIds[_]),u||o.removeSource(m.sourceIds[_])}}function b(u){v?y(u):x(u)}function S(u){h?p(u):l(u)}function T(){for(var u=h?A.cluster:A.nonCluster,f=0;f<u.length;f++){var k=u[f],_=a[k];_&&(n.setOptions(m.layerIds[k],"setLayoutProperty",_.layout),_.layout.visibility==="visible"&&(k!=="cluster"&&m.setSourceData(k,_),n.setOptions(m.layerIds[k],"setPaintProperty",_.paint)))}}var M=this.isHidden,w=i.visible!==!0;w?M||b():M?w||S():v!==h?(b(),S()):(this.below!==s&&(b(!0),S(!0)),T()),this.clusterEnabled=h,this.isHidden=w,this.below=s,r[0].trace._glTrace=this},e.dispose=function(){for(var r=this.subplot.map,i=this.clusterEnabled?A.cluster:A.nonCluster,n=i.length-1;n>=0;n--){var o=i[n];r.removeLayer(this.layerIds[o]),r.removeSource(this.sourceIds[o])}},V.exports=function(r,i){var n=i[0].trace,o=n.cluster&&n.cluster.enabled,a=n.visible!==!0,s=new t(r,n.uid,o,a),h=g(r.gd,i),v=s.below=r.belowLookup["trace-"+n.uid],m,p,y;if(o)for(s.addSource("circle",h.circle,n.cluster),m=0;m<A.cluster.length;m++)p=A.cluster[m],y=h[p],s.addLayer(p,y,v);else for(m=0;m<A.nonCluster.length;m++)p=A.nonCluster[m],y=h[p],s.addSource(p,y,n.cluster),s.addLayer(p,y,v);return i[0].trace._glTrace=s,s}}),qx=Vt((X,V)=>{var c=Hu(),g=qr(),E=Mg(),A=g.fillText,t=ts().BADNUM,e=$p().traceLayerPrefix;function r(n,o,a){var s=n.cd,h=s[0].trace,v=n.xa,m=n.ya,p=n.subplot,y=[],l=e+h.uid+"-circle",x=h.cluster&&h.cluster.enabled;if(x){var b=p.map.queryRenderedFeatures(null,{layers:[l]});y=b.map(function(R){return R.id})}var S=o>=0?Math.floor((o+180)/360):Math.ceil((o-180)/360),T=S*360,M=o-T;function w(R){var L=R.lonlat;if(L[0]===t||x&&y.indexOf(R.i+1)===-1)return 1/0;var F=g.modHalf(L[0],360),N=L[1],j=p.project([F,N]),G=j.x-v.c2p([M,N]),rt=j.y-m.c2p([F,a]),ct=Math.max(3,R.mrc||0);return Math.max(Math.sqrt(G*G+rt*rt)-ct,1-3/ct)}if(c.getClosest(s,w,n),n.index!==!1){var u=s[n.index],f=u.lonlat,k=[g.modHalf(f[0],360)+T,f[1]],_=v.c2p(k),D=m.c2p(k),I=u.mrc||1;n.x0=_-I,n.x1=_+I,n.y0=D-I,n.y1=D+I;var O={};O[h.subplot]={_subplot:p};var B=h._module.formatLabels(u,h,O);return n.lonLabel=B.lonLabel,n.latLabel=B.latLabel,n.color=E(h,u),n.extraText=i(h,u,s[0].t.labels),n.hovertemplate=h.hovertemplate,[n]}}function i(n,o,a){if(n.hovertemplate)return;var s=o.hi||n.hoverinfo,h=s.split("+"),v=h.indexOf("all")!==-1,m=h.indexOf("lon")!==-1,p=h.indexOf("lat")!==-1,y=o.lonlat,l=[];function x(b){return b+"°"}return v||m&&p?l.push("("+x(y[1])+", "+x(y[0])+")"):m?l.push(a.lon+x(y[0])):p&&l.push(a.lat+x(y[1])),(v||h.indexOf("text")!==-1)&&A(o,n,l),l.join("<br>")}V.exports={hoverPoints:r,getExtraText:i}}),wI=Vt((X,V)=>{V.exports=function(c,g){return c.lon=g.lon,c.lat=g.lat,c}}),TI=Vt((X,V)=>{var c=qr(),g=Sl(),E=ts().BADNUM;V.exports=function(A,t){var e=A.cd,r=A.xaxis,i=A.yaxis,n=[],o=e[0].trace,a;if(!g.hasMarkers(o))return[];if(t===!1)for(a=0;a<e.length;a++)e[a].selected=0;else for(a=0;a<e.length;a++){var s=e[a],h=s.lonlat;if(h[0]!==E){var v=[c.modHalf(h[0],360),h[1]],m=[r.c2p(v),i.c2p(v)];t.contains(m,null,a,A)?(n.push({pointNumber:a,lon:h[0],lat:h[1]}),s.selected=1):s.selected=0}}return n}}),m5=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?V.exports=g():(c=c||self,c.mapboxgl=g())})(X,function(){var c,g,E;function A(t,e){if(!c)c=e;else if(!g)g=e;else{var r="var sharedChunk = {}; ("+c+")(sharedChunk); ("+g+")(sharedChunk);",i={};c(i),E=e(i),typeof window<"u"&&(E.workerUrl=window.URL.createObjectURL(new Blob([r],{type:"text/javascript"})))}}return A(["exports"],function(t){function e(d,z){return z={exports:{}},d(z,z.exports),z.exports}var r="1.13.4",i=n;function n(d,z,H,ft){this.cx=3*d,this.bx=3*(H-d)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*z,this.by=3*(ft-z)-this.cy,this.ay=1-this.cy-this.by,this.p1x=d,this.p1y=ft,this.p2x=H,this.p2y=ft}n.prototype.sampleCurveX=function(d){return((this.ax*d+this.bx)*d+this.cx)*d},n.prototype.sampleCurveY=function(d){return((this.ay*d+this.by)*d+this.cy)*d},n.prototype.sampleCurveDerivativeX=function(d){return(3*this.ax*d+2*this.bx)*d+this.cx},n.prototype.solveCurveX=function(d,z){typeof z>"u"&&(z=1e-6);var H,ft,kt,It,Ht;for(kt=d,Ht=0;Ht<8;Ht++){if(It=this.sampleCurveX(kt)-d,Math.abs(It)<z)return kt;var ge=this.sampleCurveDerivativeX(kt);if(Math.abs(ge)<1e-6)break;kt=kt-It/ge}if(H=0,ft=1,kt=d,kt<H)return H;if(kt>ft)return ft;for(;H<ft;){if(It=this.sampleCurveX(kt),Math.abs(It-d)<z)return kt;d>It?H=kt:ft=kt,kt=(ft-H)*.5+H}return kt},n.prototype.solve=function(d,z){return this.sampleCurveY(this.solveCurveX(d,z))};var o=a;function a(d,z){this.x=d,this.y=z}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(d){return this.clone()._add(d)},sub:function(d){return this.clone()._sub(d)},multByPoint:function(d){return this.clone()._multByPoint(d)},divByPoint:function(d){return this.clone()._divByPoint(d)},mult:function(d){return this.clone()._mult(d)},div:function(d){return this.clone()._div(d)},rotate:function(d){return this.clone()._rotate(d)},rotateAround:function(d,z){return this.clone()._rotateAround(d,z)},matMult:function(d){return this.clone()._matMult(d)},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(d){return this.x===d.x&&this.y===d.y},dist:function(d){return Math.sqrt(this.distSqr(d))},distSqr:function(d){var z=d.x-this.x,H=d.y-this.y;return z*z+H*H},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(d){return Math.atan2(this.y-d.y,this.x-d.x)},angleWith:function(d){return this.angleWithSep(d.x,d.y)},angleWithSep:function(d,z){return Math.atan2(this.x*z-this.y*d,this.x*d+this.y*z)},_matMult:function(d){var z=d[0]*this.x+d[1]*this.y,H=d[2]*this.x+d[3]*this.y;return this.x=z,this.y=H,this},_add:function(d){return this.x+=d.x,this.y+=d.y,this},_sub:function(d){return this.x-=d.x,this.y-=d.y,this},_mult:function(d){return this.x*=d,this.y*=d,this},_div:function(d){return this.x/=d,this.y/=d,this},_multByPoint:function(d){return this.x*=d.x,this.y*=d.y,this},_divByPoint:function(d){return this.x/=d.x,this.y/=d.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var d=this.y;return this.y=this.x,this.x=-d,this},_rotate:function(d){var z=Math.cos(d),H=Math.sin(d),ft=z*this.x-H*this.y,kt=H*this.x+z*this.y;return this.x=ft,this.y=kt,this},_rotateAround:function(d,z){var H=Math.cos(d),ft=Math.sin(d),kt=z.x+H*(this.x-z.x)-ft*(this.y-z.y),It=z.y+ft*(this.x-z.x)+H*(this.y-z.y);return this.x=kt,this.y=It,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(d){return d instanceof a?d:Array.isArray(d)?new a(d[0],d[1]):d};var s=typeof self<"u"?self:{};function h(d,z){if(Array.isArray(d)){if(!Array.isArray(z)||d.length!==z.length)return!1;for(var H=0;H<d.length;H++)if(!h(d[H],z[H]))return!1;return!0}if(typeof d=="object"&&d!==null&&z!==null){if(typeof z!="object")return!1;var ft=Object.keys(d);if(ft.length!==Object.keys(z).length)return!1;for(var kt in d)if(!h(d[kt],z[kt]))return!1;return!0}return d===z}var v=Math.pow(2,53)-1;function m(d){if(d<=0)return 0;if(d>=1)return 1;var z=d*d,H=z*d;return 4*(d<.5?H:3*(d-z)+H-.75)}function p(d,z,H,ft){var kt=new i(d,z,H,ft);return function(It){return kt.solve(It)}}var y=p(.25,.1,.25,1);function l(d,z,H){return Math.min(H,Math.max(z,d))}function x(d,z,H){var ft=H-z,kt=((d-z)%ft+ft)%ft+z;return kt===z?H:kt}function b(d,z,H){if(!d.length)return H(null,[]);var ft=d.length,kt=new Array(d.length),It=null;d.forEach(function(Ht,ge){z(Ht,function(Pe,qe){Pe&&(It=Pe),kt[ge]=qe,--ft===0&&H(It,kt)})})}function S(d){var z=[];for(var H in d)z.push(d[H]);return z}function T(d,z){var H=[];for(var ft in d)ft in z||H.push(ft);return H}function M(d){for(var z=[],H=arguments.length-1;H-- >0;)z[H]=arguments[H+1];for(var ft=0,kt=z;ft<kt.length;ft+=1){var It=kt[ft];for(var Ht in It)d[Ht]=It[Ht]}return d}function w(d,z){for(var H={},ft=0;ft<z.length;ft++){var kt=z[ft];kt in d&&(H[kt]=d[kt])}return H}var u=1;function f(){return u++}function k(){function d(z){return z?(z^Math.random()*16>>z/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,d)}return d()}function _(d){return d<=1?1:Math.pow(2,Math.ceil(Math.log(d)/Math.LN2))}function D(d){return d?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(d):!1}function I(d,z){d.forEach(function(H){z[H]&&(z[H]=z[H].bind(z))})}function O(d,z){return d.indexOf(z,d.length-z.length)!==-1}function B(d,z,H){var ft={};for(var kt in d)ft[kt]=z.call(H||this,d[kt],kt,d);return ft}function R(d,z,H){var ft={};for(var kt in d)z.call(H||this,d[kt],kt,d)&&(ft[kt]=d[kt]);return ft}function L(d){return Array.isArray(d)?d.map(L):typeof d=="object"&&d?B(d,L):d}function F(d,z){for(var H=0;H<d.length;H++)if(z.indexOf(d[H])>=0)return!0;return!1}var N={};function j(d){N[d]||(typeof console<"u"&&console.warn(d),N[d]=!0)}function G(d,z,H){return(H.y-d.y)*(z.x-d.x)>(z.y-d.y)*(H.x-d.x)}function rt(d){for(var z=0,H=0,ft=d.length,kt=ft-1,It=void 0,Ht=void 0;H<ft;kt=H++)It=d[H],Ht=d[kt],z+=(Ht.x-It.x)*(It.y+Ht.y);return z}function ct(d){var z=d[0],H=d[1],ft=d[2];return H+=90,H*=Math.PI/180,ft*=Math.PI/180,{x:z*Math.cos(H)*Math.sin(ft),y:z*Math.sin(H)*Math.sin(ft),z:z*Math.cos(ft)}}function lt(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function tt(d){var z=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,H={};if(d.replace(z,function(kt,It,Ht,ge){var Pe=Ht||ge;return H[It]=Pe?Pe.toLowerCase():!0,""}),H["max-age"]){var ft=parseInt(H["max-age"],10);isNaN(ft)?delete H["max-age"]:H["max-age"]=ft}return H}var Z=null;function st(d){if(Z==null){var z=d.navigator?d.navigator.userAgent:null;Z=!!d.safari||!!(z&&(/\b(iPad|iPhone|iPod)\b/.test(z)||z.match("Safari")&&!z.match("Chrome")))}return Z}function $(d){try{var z=s[d];return z.setItem("_mapbox_test_",1),z.removeItem("_mapbox_test_"),!0}catch{return!1}}function Q(d){return s.btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,function(z,H){return String.fromCharCode(+("0x"+H))}))}function nt(d){return decodeURIComponent(s.atob(d).split("").map(function(z){return"%"+("00"+z.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var Y=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),q=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,ot=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,it,dt,wt={now:Y,frame:function(d){var z=q(d);return{cancel:function(){return ot(z)}}},getImageData:function(d,z){z===void 0&&(z=0);var H=s.document.createElement("canvas"),ft=H.getContext("2d");if(!ft)throw new Error("failed to create canvas 2d context");return H.width=d.width,H.height=d.height,ft.drawImage(d,0,0,d.width,d.height),ft.getImageData(-z,-z,d.width+2*z,d.height+2*z)},resolveURL:function(d){return it||(it=s.document.createElement("a")),it.href=d,it.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(dt==null&&(dt=s.matchMedia("(prefers-reduced-motion: reduce)")),dt.matches):!1}},xt={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Ft={supported:!1,testSupport:Qt},Et,Nt=!1,te,Jt=!1;s.document&&(te=s.document.createElement("img"),te.onload=function(){Et&&Wt(Et),Et=null,Jt=!0},te.onerror=function(){Nt=!0,Et=null},te.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function Qt(d){Nt||!te||(Jt?Wt(d):Et=d)}function Wt(d){var z=d.createTexture();d.bindTexture(d.TEXTURE_2D,z);try{if(d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,te),d.isContextLost())return;Ft.supported=!0}catch{}d.deleteTexture(z),Nt=!0}var gt="01";function bt(){for(var d="1",z="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",H="",ft=0;ft<10;ft++)H+=z[Math.floor(Math.random()*62)];var kt=12*60*60*1e3,It=[d,gt,H].join(""),Ht=Date.now()+kt;return{token:It,tokenExpiresAt:Ht}}var vt=function(d,z){this._transformRequestFn=d,this._customAccessToken=z,this._createSkuToken()};vt.prototype._createSkuToken=function(){var d=bt();this._skuToken=d.token,this._skuTokenExpiresAt=d.tokenExpiresAt},vt.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},vt.prototype.transformRequest=function(d,z){return this._transformRequestFn?this._transformRequestFn(d,z)||{url:d}:{url:d}},vt.prototype.normalizeStyleURL=function(d,z){if(!Ut(d))return d;var H=Fe(d);return H.path="/styles/v1"+H.path,this._makeAPIURL(H,this._customAccessToken||z)},vt.prototype.normalizeGlyphsURL=function(d,z){if(!Ut(d))return d;var H=Fe(d);return H.path="/fonts/v1"+H.path,this._makeAPIURL(H,this._customAccessToken||z)},vt.prototype.normalizeSourceURL=function(d,z){if(!Ut(d))return d;var H=Fe(d);return H.path="/v4/"+H.authority+".json",H.params.push("secure"),this._makeAPIURL(H,this._customAccessToken||z)},vt.prototype.normalizeSpriteURL=function(d,z,H,ft){var kt=Fe(d);return Ut(d)?(kt.path="/styles/v1"+kt.path+"/sprite"+z+H,this._makeAPIURL(kt,this._customAccessToken||ft)):(kt.path+=""+z+H,Oe(kt))},vt.prototype.normalizeTileURL=function(d,z){if(this._isSkuTokenExpired()&&this._createSkuToken(),d&&!Ut(d))return d;var H=Fe(d),ft=/(\.(png|jpg)\d*)(?=$)/,kt=/^.+\/v4\//,It=wt.devicePixelRatio>=2||z===512?"@2x":"",Ht=Ft.supported?".webp":"$1";H.path=H.path.replace(ft,""+It+Ht),H.path=H.path.replace(kt,"/"),H.path="/v4"+H.path;var ge=this._customAccessToken||Te(H.params)||xt.ACCESS_TOKEN;return xt.REQUIRE_ACCESS_TOKEN&&ge&&this._skuToken&&H.params.push("sku="+this._skuToken),this._makeAPIURL(H,ge)},vt.prototype.canonicalizeTileURL=function(d,z){var H="/v4/",ft=/\.[\w]+$/,kt=Fe(d);if(!kt.path.match(/(^\/v4\/)/)||!kt.path.match(ft))return d;var It="mapbox://tiles/";It+=kt.path.replace(H,"");var Ht=kt.params;return z&&(Ht=Ht.filter(function(ge){return!ge.match(/^access_token=/)})),Ht.length&&(It+="?"+Ht.join("&")),It},vt.prototype.canonicalizeTileset=function(d,z){for(var H=z?Ut(z):!1,ft=[],kt=0,It=d.tiles||[];kt<It.length;kt+=1){var Ht=It[kt];Zt(Ht)?ft.push(this.canonicalizeTileURL(Ht,H)):ft.push(Ht)}return ft},vt.prototype._makeAPIURL=function(d,z){var H="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",ft=Fe(xt.API_URL);if(d.protocol=ft.protocol,d.authority=ft.authority,d.protocol==="http"){var kt=d.params.indexOf("secure");kt>=0&&d.params.splice(kt,1)}if(ft.path!=="/"&&(d.path=""+ft.path+d.path),!xt.REQUIRE_ACCESS_TOKEN)return Oe(d);if(z=z||xt.ACCESS_TOKEN,!z)throw new Error("An API access token is required to use Mapbox GL. "+H);if(z[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+H);return d.params=d.params.filter(function(It){return It.indexOf("access_token")===-1}),d.params.push("access_token="+z),Oe(d)};function Ut(d){return d.indexOf("mapbox:")===0}var Kt=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Zt(d){return Kt.test(d)}function le(d){return d.indexOf("sku=")>0&&Zt(d)}function Te(d){for(var z=0,H=d;z<H.length;z+=1){var ft=H[z],kt=ft.match(/^access_token=(.*)$/);if(kt)return kt[1]}return null}var Se=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Fe(d){var z=d.match(Se);if(!z)throw new Error("Unable to parse URL object");return{protocol:z[1],authority:z[2],path:z[3]||"/",params:z[4]?z[4].split("&"):[]}}function Oe(d){var z=d.params.length?"?"+d.params.join("&"):"";return d.protocol+"://"+d.authority+d.path+z}var ur="mapbox.eventData";function fr(d){if(!d)return null;var z=d.split(".");if(!z||z.length!==3)return null;try{var H=JSON.parse(nt(z[1]));return H}catch{return null}}var We=function(d){this.type=d,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};We.prototype.getStorageKey=function(d){var z=fr(xt.ACCESS_TOKEN),H="";return z&&z.u?H=Q(z.u):H=xt.ACCESS_TOKEN||"",d?ur+"."+d+":"+H:ur+":"+H},We.prototype.fetchEventData=function(){var d=$("localStorage"),z=this.getStorageKey(),H=this.getStorageKey("uuid");if(d)try{var ft=s.localStorage.getItem(z);ft&&(this.eventData=JSON.parse(ft));var kt=s.localStorage.getItem(H);kt&&(this.anonId=kt)}catch{j("Unable to read from LocalStorage")}},We.prototype.saveEventData=function(){var d=$("localStorage"),z=this.getStorageKey(),H=this.getStorageKey("uuid");if(d)try{s.localStorage.setItem(H,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(z,JSON.stringify(this.eventData))}catch{j("Unable to write to LocalStorage")}},We.prototype.processRequests=function(d){},We.prototype.postEvent=function(d,z,H,ft){var kt=this;if(xt.EVENTS_URL){var It=Fe(xt.EVENTS_URL);It.params.push("access_token="+(ft||xt.ACCESS_TOKEN||""));var Ht={event:this.type,created:new Date(d).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:gt,userId:this.anonId},ge=z?M(Ht,z):Ht,Pe={url:Oe(It),headers:{"Content-Type":"text/plain"},body:JSON.stringify([ge])};this.pendingRequest=Br(Pe,function(qe){kt.pendingRequest=null,H(qe),kt.saveEventData(),kt.processRequests(ft)})}},We.prototype.queueRequest=function(d,z){this.queue.push(d),this.processRequests(z)};var Lr=function(d){function z(){d.call(this,"map.load"),this.success={},this.skuToken=""}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.postMapLoadEvent=function(H,ft,kt,It){this.skuToken=kt,(xt.EVENTS_URL&&It||xt.ACCESS_TOKEN&&Array.isArray(H)&&H.some(function(Ht){return Ut(Ht)||Zt(Ht)}))&&this.queueRequest({id:ft,timestamp:Date.now()},It)},z.prototype.processRequests=function(H){var ft=this;if(!(this.pendingRequest||this.queue.length===0)){var kt=this.queue.shift(),It=kt.id,Ht=kt.timestamp;It&&this.success[It]||(this.anonId||this.fetchEventData(),D(this.anonId)||(this.anonId=k()),this.postEvent(Ht,{skuToken:this.skuToken},function(ge){ge||It&&(ft.success[It]=!0)},H))}},z}(We),kr=function(d){function z(H){d.call(this,"appUserTurnstile"),this._customAccessToken=H}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.postTurnstileEvent=function(H,ft){xt.EVENTS_URL&&xt.ACCESS_TOKEN&&Array.isArray(H)&&H.some(function(kt){return Ut(kt)||Zt(kt)})&&this.queueRequest(Date.now(),ft)},z.prototype.processRequests=function(H){var ft=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var kt=fr(xt.ACCESS_TOKEN),It=kt?kt.u:xt.ACCESS_TOKEN,Ht=It!==this.eventData.tokenU;D(this.anonId)||(this.anonId=k(),Ht=!0);var ge=this.queue.shift();if(this.eventData.lastSuccess){var Pe=new Date(this.eventData.lastSuccess),qe=new Date(ge),Ye=(ge-this.eventData.lastSuccess)/(24*60*60*1e3);Ht=Ht||Ye>=1||Ye<-1||Pe.getDate()!==qe.getDate()}else Ht=!0;if(!Ht)return this.processRequests();this.postEvent(ge,{"enabled.telemetry":!1},function(xr){xr||(ft.eventData.lastSuccess=ge,ft.eventData.tokenU=It)},H)}},z}(We),he=new kr,Dt=he.postTurnstileEvent.bind(he),qt=new Lr,zt=qt.postMapLoadEvent.bind(qt),ut="mapbox-tiles",yt=500,Mt=50,Ot=1e3*60*7,$t;function ee(){s.caches&&!$t&&($t=s.caches.open(ut))}var we;function Me(d,z){if(we===void 0)try{new Response(new ReadableStream),we=!0}catch{we=!1}we?z(d.body):d.blob().then(z)}function Re(d,z,H){if(ee(),!!$t){var ft={status:z.status,statusText:z.statusText,headers:new s.Headers};z.headers.forEach(function(Ht,ge){return ft.headers.set(ge,Ht)});var kt=tt(z.headers.get("Cache-Control")||"");if(!kt["no-store"]){kt["max-age"]&&ft.headers.set("Expires",new Date(H+kt["max-age"]*1e3).toUTCString());var It=new Date(ft.headers.get("Expires")).getTime()-H;It<Ot||Me(z,function(Ht){var ge=new s.Response(Ht,ft);ee(),$t&&$t.then(function(Pe){return Pe.put(Be(d.url),ge)}).catch(function(Pe){return j(Pe.message)})})}}}function Be(d){var z=d.indexOf("?");return z<0?d:d.slice(0,z)}function Ze(d,z){if(ee(),!$t)return z(null);var H=Be(d.url);$t.then(function(ft){ft.match(H).then(function(kt){var It=Ue(kt);ft.delete(H),It&&ft.put(H,kt.clone()),z(null,kt,It)}).catch(z)}).catch(z)}function Ue(d){if(!d)return!1;var z=new Date(d.headers.get("Expires")||0),H=tt(d.headers.get("Cache-Control")||"");return z>Date.now()&&!H["no-cache"]}var mr=1/0;function ln(d){mr++,mr>Mt&&(d.getActor().send("enforceCacheSizeLimit",yt),mr=0)}function an(d){ee(),$t&&$t.then(function(z){z.keys().then(function(H){for(var ft=0;ft<H.length-d;ft++)z.delete(H[ft])})})}function vn(d){var z=s.caches.delete(ut);d&&z.catch(d).then(function(){return d()})}function Sn(d,z){yt=d,Mt=z}var An;function pn(){return An==null&&(An=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&typeof s.createImageBitmap=="function"),An}var On={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(On);var Nn=function(d){function z(H,ft,kt){ft===401&&Zt(kt)&&(H+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),d.call(this,H),this.status=ft,this.url=kt,this.name=this.constructor.name,this.message=H}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},z}(Error),ke=lt()?function(){return self.worker&&self.worker.referrer}:function(){return(s.location.protocol==="blob:"?s.parent:s).location.href},ze=function(d){return/^file:/.test(d)||/^file:/.test(ke())&&!/^\w+:/.test(d)};function je(d,z){var H=new s.AbortController,ft=new s.Request(d.url,{method:d.method||"GET",body:d.body,credentials:d.credentials,headers:d.headers,referrer:ke(),signal:H.signal}),kt=!1,It=!1,Ht=le(ft.url);d.type==="json"&&ft.headers.set("Accept","application/json");var ge=function(qe,Ye,xr){if(!It){if(qe&&qe.message!=="SecurityError"&&j(qe),Ye&&xr)return Pe(Ye);var Ir=Date.now();s.fetch(ft).then(function(Fr){if(Fr.ok){var en=Ht?Fr.clone():null;return Pe(Fr,en,Ir)}else return z(new Nn(Fr.statusText,Fr.status,d.url))}).catch(function(Fr){Fr.code!==20&&z(new Error(Fr.message))})}},Pe=function(qe,Ye,xr){(d.type==="arrayBuffer"?qe.arrayBuffer():d.type==="json"?qe.json():qe.text()).then(function(Ir){It||(Ye&&xr&&Re(ft,Ye,xr),kt=!0,z(null,Ir,qe.headers.get("Cache-Control"),qe.headers.get("Expires")))}).catch(function(Ir){It||z(new Error(Ir.message))})};return Ht?Ze(ft,ge):ge(null,null),{cancel:function(){It=!0,kt||H.abort()}}}function Ne(d,z){var H=new s.XMLHttpRequest;H.open(d.method||"GET",d.url,!0),d.type==="arrayBuffer"&&(H.responseType="arraybuffer");for(var ft in d.headers)H.setRequestHeader(ft,d.headers[ft]);return d.type==="json"&&(H.responseType="text",H.setRequestHeader("Accept","application/json")),H.withCredentials=d.credentials==="include",H.onerror=function(){z(new Error(H.statusText))},H.onload=function(){if((H.status>=200&&H.status<300||H.status===0)&&H.response!==null){var kt=H.response;if(d.type==="json")try{kt=JSON.parse(H.response)}catch(It){return z(It)}z(null,kt,H.getResponseHeader("Cache-Control"),H.getResponseHeader("Expires"))}else z(new Nn(H.statusText,H.status,d.url))},H.send(d.body),{cancel:function(){return H.abort()}}}var _r=function(d,z){if(!ze(d.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return je(d,z);if(lt()&&self.worker&&self.worker.actor){var H=!0;return self.worker.actor.send("getResource",d,z,void 0,H)}}return Ne(d,z)},Xr=function(d,z){return _r(M(d,{type:"json"}),z)},rn=function(d,z){return _r(M(d,{type:"arrayBuffer"}),z)},Br=function(d,z){return _r(M(d,{method:"POST"}),z)};function _n(d){var z=s.document.createElement("a");return z.href=d,z.protocol===s.document.location.protocol&&z.host===s.document.location.host}var bn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Fn(d,z,H,ft){var kt=new s.Image,It=s.URL;kt.onload=function(){z(null,kt),It.revokeObjectURL(kt.src),kt.onload=null,s.requestAnimationFrame(function(){kt.src=bn})},kt.onerror=function(){return z(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."))};var Ht=new s.Blob([new Uint8Array(d)],{type:"image/png"});kt.cacheControl=H,kt.expires=ft,kt.src=d.byteLength?It.createObjectURL(Ht):bn}function on(d,z){var H=new s.Blob([new Uint8Array(d)],{type:"image/png"});s.createImageBitmap(H).then(function(ft){z(null,ft)}).catch(function(ft){z(new Error("Could not load image because of "+ft.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var Bn,ue,xe=function(){Bn=[],ue=0};xe();var Pr=function(d,z){if(Ft.supported&&(d.headers||(d.headers={}),d.headers.accept="image/webp,*/*"),ue>=xt.MAX_PARALLEL_IMAGE_REQUESTS){var H={requestParameters:d,callback:z,cancelled:!1,cancel:function(){this.cancelled=!0}};return Bn.push(H),H}ue++;var ft=!1,kt=function(){if(!ft)for(ft=!0,ue--;Bn.length&&ue<xt.MAX_PARALLEL_IMAGE_REQUESTS;){var Ht=Bn.shift(),ge=Ht.requestParameters,Pe=Ht.callback,qe=Ht.cancelled;qe||(Ht.cancel=Pr(ge,Pe).cancel)}},It=rn(d,function(Ht,ge,Pe,qe){kt(),Ht?z(Ht):ge&&(pn()?on(ge,z):Fn(ge,z,Pe,qe))});return{cancel:function(){It.cancel(),kt()}}},Sr=function(d,z){var H=s.document.createElement("video");H.muted=!0,H.onloadstart=function(){z(null,H)};for(var ft=0;ft<d.length;ft++){var kt=s.document.createElement("source");_n(d[ft])||(H.crossOrigin="Anonymous"),kt.src=d[ft],H.appendChild(kt)}return{cancel:function(){}}};function gr(d,z,H){var ft=H[d]&&H[d].indexOf(z)!==-1;ft||(H[d]=H[d]||[],H[d].push(z))}function dr(d,z,H){if(H&&H[d]){var ft=H[d].indexOf(z);ft!==-1&&H[d].splice(ft,1)}}var Er=function(d,z){z===void 0&&(z={}),M(this,z),this.type=d},Dr=function(d){function z(H,ft){ft===void 0&&(ft={}),d.call(this,"error",M({error:H},ft))}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z}(Er),Ar=function(){};Ar.prototype.on=function(d,z){return this._listeners=this._listeners||{},gr(d,z,this._listeners),this},Ar.prototype.off=function(d,z){return dr(d,z,this._listeners),dr(d,z,this._oneTimeListeners),this},Ar.prototype.once=function(d,z){return this._oneTimeListeners=this._oneTimeListeners||{},gr(d,z,this._oneTimeListeners),this},Ar.prototype.fire=function(d,z){typeof d=="string"&&(d=new Er(d,z||{}));var H=d.type;if(this.listens(H)){d.target=this;for(var ft=this._listeners&&this._listeners[H]?this._listeners[H].slice():[],kt=0,It=ft;kt<It.length;kt+=1){var Ht=It[kt];Ht.call(this,d)}for(var ge=this._oneTimeListeners&&this._oneTimeListeners[H]?this._oneTimeListeners[H].slice():[],Pe=0,qe=ge;Pe<qe.length;Pe+=1){var Ye=qe[Pe];dr(H,Ye,this._oneTimeListeners),Ye.call(this,d)}var xr=this._eventedParent;xr&&(M(d,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),xr.fire(d))}else d instanceof Dr&&console.error(d.error);return this},Ar.prototype.listens=function(d){return this._listeners&&this._listeners[d]&&this._listeners[d].length>0||this._oneTimeListeners&&this._oneTimeListeners[d]&&this._oneTimeListeners[d].length>0||this._eventedParent&&this._eventedParent.listens(d)},Ar.prototype.setEventedParent=function(d,z){return this._eventedParent=d,this._eventedParentData=z,this};var Gr=8,Wr={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"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Jr={"*":{type:"source"}},_e=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Je={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:"*"}},yr={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:"*"}},Hr={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:"*"}},hn={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},En={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"}}},dn={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"}}},Kr={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"}},Tn=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],ta={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Qn={"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"}},Va={"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"}},ja={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ci={"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"}},pi={"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"],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:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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:{},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"],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"}},bi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ri={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Da={type:"array",value:"*"},Ui={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},lo={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Co={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Bo={type:"array",value:"*",minimum:1},ai={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}},yi=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Si={"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"}},ko={"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"}},Ao={"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"}},Do={"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"}},Pi={"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"}},Yi={"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"}},vs={"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"}},es={"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"}},ls={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Xi={"*":{type:"string"}},ga={$version:Gr,$root:Wr,sources:Jr,source:_e,source_vector:Je,source_raster:yr,source_raster_dem:Hr,source_geojson:hn,source_video:En,source_image:dn,layer:Kr,layout:Tn,layout_background:ta,layout_fill:Qn,layout_circle:Va,layout_heatmap:ja,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:ci,layout_symbol:pi,layout_raster:bi,layout_hillshade:ri,filter:Da,filter_operator:Ui,geometry_type:lo,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:Co,expression:Bo,light:ai,paint:yi,paint_fill:Si,"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:ko,paint_circle:Ao,paint_heatmap:Do,paint_symbol:Pi,paint_raster:Yi,paint_hillshade:vs,paint_background:es,transition:ls,"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:Xi},Xa=function(d,z,H,ft){this.message=(d?d+": ":"")+H,ft&&(this.identifier=ft),z!=null&&z.__line__&&(this.line=z.__line__)};function Ls(d){var z=d.key,H=d.value;return H?[new Xa(z,H,"constants have been deprecated as of v8")]:[]}function fs(d){for(var z=[],H=arguments.length-1;H-- >0;)z[H]=arguments[H+1];for(var ft=0,kt=z;ft<kt.length;ft+=1){var It=kt[ft];for(var Ht in It)d[Ht]=It[Ht]}return d}function qi(d){return d instanceof Number||d instanceof String||d instanceof Boolean?d.valueOf():d}function ms(d){if(Array.isArray(d))return d.map(ms);if(d instanceof Object&&!(d instanceof Number||d instanceof String||d instanceof Boolean)){var z={};for(var H in d)z[H]=ms(d[H]);return z}return qi(d)}var Po=function(d){function z(H,ft){d.call(this,ft),this.message=ft,this.key=H}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z}(Error),rs=function(d,z){z===void 0&&(z=[]),this.parent=d,this.bindings={};for(var H=0,ft=z;H<ft.length;H+=1){var kt=ft[H],It=kt[0],Ht=kt[1];this.bindings[It]=Ht}};rs.prototype.concat=function(d){return new rs(this,d)},rs.prototype.get=function(d){if(this.bindings[d])return this.bindings[d];if(this.parent)return this.parent.get(d);throw new Error(d+" not found in scope.")},rs.prototype.has=function(d){return this.bindings[d]?!0:this.parent?this.parent.has(d):!1};var hl={kind:"null"},za={kind:"number"},Oi={kind:"string"},Bi={kind:"boolean"},Ro={kind:"color"},Fo={kind:"object"},Ci={kind:"value"},fl={kind:"error"},ql={kind:"collator"},Zs={kind:"formatted"},Hl={kind:"resolvedImage"};function Us(d,z){return{kind:"array",itemType:d,N:z}}function Es(d){if(d.kind==="array"){var z=Es(d.itemType);return typeof d.N=="number"?"array<"+z+", "+d.N+">":d.itemType.kind==="value"?"array":"array<"+z+">"}else return d.kind}var El=[hl,za,Oi,Bi,Ro,Zs,Fo,Us(Ci),Hl];function Wu(d,z){if(z.kind==="error")return null;if(d.kind==="array"){if(z.kind==="array"&&(z.N===0&&z.itemType.kind==="value"||!Wu(d.itemType,z.itemType))&&(typeof d.N!="number"||d.N===z.N))return null}else{if(d.kind===z.kind)return null;if(d.kind==="value")for(var H=0,ft=El;H<ft.length;H+=1){var kt=ft[H];if(!Wu(kt,z))return null}}return"Expected "+Es(d)+" but found "+Es(z)+" instead."}function Mu(d,z){return z.some(function(H){return H.kind===d.kind})}function Fu(d,z){return z.some(function(H){return H==="null"?d===null:H==="array"?Array.isArray(d):H==="object"?d&&!Array.isArray(d)&&typeof d=="object":H===typeof d})}var _h=e(function(d,z){var H={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 ft(qe){return qe=Math.round(qe),qe<0?0:qe>255?255:qe}function kt(qe){return qe<0?0:qe>1?1:qe}function It(qe){return qe[qe.length-1]==="%"?ft(parseFloat(qe)/100*255):ft(parseInt(qe))}function Ht(qe){return qe[qe.length-1]==="%"?kt(parseFloat(qe)/100):kt(parseFloat(qe))}function ge(qe,Ye,xr){return xr<0?xr+=1:xr>1&&(xr-=1),xr*6<1?qe+(Ye-qe)*xr*6:xr*2<1?Ye:xr*3<2?qe+(Ye-qe)*(2/3-xr)*6:qe}function Pe(qe){var Ye=qe.replace(/ /g,"").toLowerCase();if(Ye in H)return H[Ye].slice();if(Ye[0]==="#"){if(Ye.length===4){var xr=parseInt(Ye.substr(1),16);return xr>=0&&xr<=4095?[(xr&3840)>>4|(xr&3840)>>8,xr&240|(xr&240)>>4,xr&15|(xr&15)<<4,1]:null}else if(Ye.length===7){var xr=parseInt(Ye.substr(1),16);return xr>=0&&xr<=16777215?[(xr&16711680)>>16,(xr&65280)>>8,xr&255,1]:null}return null}var Ir=Ye.indexOf("("),Fr=Ye.indexOf(")");if(Ir!==-1&&Fr+1===Ye.length){var en=Ye.substr(0,Ir),kn=Ye.substr(Ir+1,Fr-(Ir+1)).split(","),Zn=1;switch(en){case"rgba":if(kn.length!==4)return null;Zn=Ht(kn.pop());case"rgb":return kn.length!==3?null:[It(kn[0]),It(kn[1]),It(kn[2]),Zn];case"hsla":if(kn.length!==4)return null;Zn=Ht(kn.pop());case"hsl":if(kn.length!==3)return null;var Hn=(parseFloat(kn[0])%360+360)%360/360,aa=Ht(kn[1]),ma=Ht(kn[2]),ra=ma<=.5?ma*(aa+1):ma+aa-ma*aa,Ea=ma*2-ra;return[ft(ge(Ea,ra,Hn+1/3)*255),ft(ge(Ea,ra,Hn)*255),ft(ge(Ea,ra,Hn-1/3)*255),Zn];default:return null}}return null}try{z.parseCSSColor=Pe}catch{}}),ih=_h.parseCSSColor,ns=function(d,z,H,ft){ft===void 0&&(ft=1),this.r=d,this.g=z,this.b=H,this.a=ft};ns.parse=function(d){if(d){if(d instanceof ns)return d;if(typeof d=="string"){var z=ih(d);if(z)return new ns(z[0]/255*z[3],z[1]/255*z[3],z[2]/255*z[3],z[3])}}},ns.prototype.toString=function(){var d=this.toArray(),z=d[0],H=d[1],ft=d[2],kt=d[3];return"rgba("+Math.round(z)+","+Math.round(H)+","+Math.round(ft)+","+kt+")"},ns.prototype.toArray=function(){var d=this,z=d.r,H=d.g,ft=d.b,kt=d.a;return kt===0?[0,0,0,0]:[z*255/kt,H*255/kt,ft*255/kt,kt]},ns.black=new ns(0,0,0,1),ns.white=new ns(1,1,1,1),ns.transparent=new ns(0,0,0,0),ns.red=new ns(1,0,0,1);var du=function(d,z,H){d?this.sensitivity=z?"variant":"case":this.sensitivity=z?"accent":"base",this.locale=H,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};du.prototype.compare=function(d,z){return this.collator.compare(d,z)},du.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Ic=function(d,z,H,ft,kt){this.text=d,this.image=z,this.scale=H,this.fontStack=ft,this.textColor=kt},ll=function(d){this.sections=d};ll.fromString=function(d){return new ll([new Ic(d,null,null,null,null)])},ll.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(d){return d.text.length!==0||d.image&&d.image.name.length!==0})},ll.factory=function(d){return d instanceof ll?d:ll.fromString(d)},ll.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(d){return d.text}).join("")},ll.prototype.serialize=function(){for(var d=["format"],z=0,H=this.sections;z<H.length;z+=1){var ft=H[z];if(ft.image){d.push(["image",ft.image.name]);continue}d.push(ft.text);var kt={};ft.fontStack&&(kt["text-font"]=["literal",ft.fontStack.split(",")]),ft.scale&&(kt["font-scale"]=ft.scale),ft.textColor&&(kt["text-color"]=["rgba"].concat(ft.textColor.toArray())),d.push(kt)}return d};var el=function(d){this.name=d.name,this.available=d.available};el.prototype.toString=function(){return this.name},el.fromString=function(d){return d?new el({name:d,available:!1}):null},el.prototype.serialize=function(){return["image",this.name]};function ul(d,z,H,ft){if(!(typeof d=="number"&&d>=0&&d<=255&&typeof z=="number"&&z>=0&&z<=255&&typeof H=="number"&&H>=0&&H<=255)){var kt=typeof ft=="number"?[d,z,H,ft]:[d,z,H];return"Invalid rgba value ["+kt.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof ft>"u"||typeof ft=="number"&&ft>=0&&ft<=1?null:"Invalid rgba value ["+[d,z,H,ft].join(", ")+"]: 'a' must be between 0 and 1."}function Zu(d){if(d===null||typeof d=="string"||typeof d=="boolean"||typeof d=="number"||d instanceof ns||d instanceof du||d instanceof ll||d instanceof el)return!0;if(Array.isArray(d)){for(var z=0,H=d;z<H.length;z+=1){var ft=H[z];if(!Zu(ft))return!1}return!0}else if(typeof d=="object"){for(var kt in d)if(!Zu(d[kt]))return!1;return!0}else return!1}function ys(d){if(d===null)return hl;if(typeof d=="string")return Oi;if(typeof d=="boolean")return Bi;if(typeof d=="number")return za;if(d instanceof ns)return Ro;if(d instanceof du)return ql;if(d instanceof ll)return Zs;if(d instanceof el)return Hl;if(Array.isArray(d)){for(var z=d.length,H,ft=0,kt=d;ft<kt.length;ft+=1){var It=kt[ft],Ht=ys(It);if(!H)H=Ht;else{if(H===Ht)continue;H=Ci;break}}return Us(H||Ci,z)}else return Fo}function pl(d){var z=typeof d;return d===null?"":z==="string"||z==="number"||z==="boolean"?String(d):d instanceof ns||d instanceof ll||d instanceof el?d.toString():JSON.stringify(d)}var $o=function(d,z){this.type=d,this.value=z};$o.parse=function(d,z){if(d.length!==2)return z.error("'literal' expression requires exactly one argument, but found "+(d.length-1)+" instead.");if(!Zu(d[1]))return z.error("invalid value");var H=d[1],ft=ys(H),kt=z.expectedType;return ft.kind==="array"&&ft.N===0&&kt&&kt.kind==="array"&&(typeof kt.N!="number"||kt.N===0)&&(ft=kt),new $o(ft,H)},$o.prototype.evaluate=function(){return this.value},$o.prototype.eachChild=function(){},$o.prototype.outputDefined=function(){return!0},$o.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof ns?["rgba"].concat(this.value.toArray()):this.value instanceof ll?this.value.serialize():this.value};var ks=function(d){this.name="ExpressionEvaluationError",this.message=d};ks.prototype.toJSON=function(){return this.message};var Bu={string:Oi,number:za,boolean:Bi,object:Fo},Ol=function(d,z){this.type=d,this.args=z};Ol.parse=function(d,z){if(d.length<2)return z.error("Expected at least one argument.");var H=1,ft,kt=d[0];if(kt==="array"){var It;if(d.length>2){var Ht=d[1];if(typeof Ht!="string"||!(Ht in Bu)||Ht==="object")return z.error('The item type argument of "array" must be one of string, number, boolean',1);It=Bu[Ht],H++}else It=Ci;var ge;if(d.length>3){if(d[2]!==null&&(typeof d[2]!="number"||d[2]<0||d[2]!==Math.floor(d[2])))return z.error('The length argument to "array" must be a positive integer literal',2);ge=d[2],H++}ft=Us(It,ge)}else ft=Bu[kt];for(var Pe=[];H<d.length;H++){var qe=z.parse(d[H],H,Ci);if(!qe)return null;Pe.push(qe)}return new Ol(ft,Pe)},Ol.prototype.evaluate=function(d){for(var z=0;z<this.args.length;z++){var H=this.args[z].evaluate(d),ft=Wu(this.type,ys(H));if(ft){if(z===this.args.length-1)throw new ks("Expected value to be of type "+Es(this.type)+", but found "+Es(ys(H))+" instead.")}else return H}return null},Ol.prototype.eachChild=function(d){this.args.forEach(d)},Ol.prototype.outputDefined=function(){return this.args.every(function(d){return d.outputDefined()})},Ol.prototype.serialize=function(){var d=this.type,z=[d.kind];if(d.kind==="array"){var H=d.itemType;if(H.kind==="string"||H.kind==="number"||H.kind==="boolean"){z.push(H.kind);var ft=d.N;(typeof ft=="number"||this.args.length>1)&&z.push(ft)}}return z.concat(this.args.map(function(kt){return kt.serialize()}))};var Xu=function(d){this.type=Zs,this.sections=d};Xu.parse=function(d,z){if(d.length<2)return z.error("Expected at least one argument.");var H=d[1];if(!Array.isArray(H)&&typeof H=="object")return z.error("First argument must be an image or text section.");for(var ft=[],kt=!1,It=1;It<=d.length-1;++It){var Ht=d[It];if(kt&&typeof Ht=="object"&&!Array.isArray(Ht)){kt=!1;var ge=null;if(Ht["font-scale"]&&(ge=z.parse(Ht["font-scale"],1,za),!ge))return null;var Pe=null;if(Ht["text-font"]&&(Pe=z.parse(Ht["text-font"],1,Us(Oi)),!Pe))return null;var qe=null;if(Ht["text-color"]&&(qe=z.parse(Ht["text-color"],1,Ro),!qe))return null;var Ye=ft[ft.length-1];Ye.scale=ge,Ye.font=Pe,Ye.textColor=qe}else{var xr=z.parse(d[It],1,Ci);if(!xr)return null;var Ir=xr.type.kind;if(Ir!=="string"&&Ir!=="value"&&Ir!=="null"&&Ir!=="resolvedImage")return z.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");kt=!0,ft.push({content:xr,scale:null,font:null,textColor:null})}}return new Xu(ft)},Xu.prototype.evaluate=function(d){var z=function(H){var ft=H.content.evaluate(d);return ys(ft)===Hl?new Ic("",ft,null,null,null):new Ic(pl(ft),null,H.scale?H.scale.evaluate(d):null,H.font?H.font.evaluate(d).join(","):null,H.textColor?H.textColor.evaluate(d):null)};return new ll(this.sections.map(z))},Xu.prototype.eachChild=function(d){for(var z=0,H=this.sections;z<H.length;z+=1){var ft=H[z];d(ft.content),ft.scale&&d(ft.scale),ft.font&&d(ft.font),ft.textColor&&d(ft.textColor)}},Xu.prototype.outputDefined=function(){return!1},Xu.prototype.serialize=function(){for(var d=["format"],z=0,H=this.sections;z<H.length;z+=1){var ft=H[z];d.push(ft.content.serialize());var kt={};ft.scale&&(kt["font-scale"]=ft.scale.serialize()),ft.font&&(kt["text-font"]=ft.font.serialize()),ft.textColor&&(kt["text-color"]=ft.textColor.serialize()),d.push(kt)}return d};var Cs=function(d){this.type=Hl,this.input=d};Cs.parse=function(d,z){if(d.length!==2)return z.error("Expected two arguments.");var H=z.parse(d[1],1,Oi);return H?new Cs(H):z.error("No image name provided.")},Cs.prototype.evaluate=function(d){var z=this.input.evaluate(d),H=el.fromString(z);return H&&d.availableImages&&(H.available=d.availableImages.indexOf(z)>-1),H},Cs.prototype.eachChild=function(d){d(this.input)},Cs.prototype.outputDefined=function(){return!1},Cs.prototype.serialize=function(){return["image",this.input.serialize()]};var zh={"to-boolean":Bi,"to-color":Ro,"to-number":za,"to-string":Oi},Mo=function(d,z){this.type=d,this.args=z};Mo.parse=function(d,z){if(d.length<2)return z.error("Expected at least one argument.");var H=d[0];if((H==="to-boolean"||H==="to-string")&&d.length!==2)return z.error("Expected one argument.");for(var ft=zh[H],kt=[],It=1;It<d.length;It++){var Ht=z.parse(d[It],It,Ci);if(!Ht)return null;kt.push(Ht)}return new Mo(ft,kt)},Mo.prototype.evaluate=function(d){if(this.type.kind==="boolean")return!!this.args[0].evaluate(d);if(this.type.kind==="color"){for(var z,H,ft=0,kt=this.args;ft<kt.length;ft+=1){var It=kt[ft];if(z=It.evaluate(d),H=null,z instanceof ns)return z;if(typeof z=="string"){var Ht=d.parseColor(z);if(Ht)return Ht}else if(Array.isArray(z)&&(z.length<3||z.length>4?H="Invalid rbga value "+JSON.stringify(z)+": expected an array containing either three or four numeric values.":H=ul(z[0],z[1],z[2],z[3]),!H))return new ns(z[0]/255,z[1]/255,z[2]/255,z[3])}throw new ks(H||"Could not parse color from value '"+(typeof z=="string"?z:String(JSON.stringify(z)))+"'")}else if(this.type.kind==="number"){for(var ge=null,Pe=0,qe=this.args;Pe<qe.length;Pe+=1){var Ye=qe[Pe];if(ge=Ye.evaluate(d),ge===null)return 0;var xr=Number(ge);if(!isNaN(xr))return xr}throw new ks("Could not convert "+JSON.stringify(ge)+" to number.")}else return this.type.kind==="formatted"?ll.fromString(pl(this.args[0].evaluate(d))):this.type.kind==="resolvedImage"?el.fromString(pl(this.args[0].evaluate(d))):pl(this.args[0].evaluate(d))},Mo.prototype.eachChild=function(d){this.args.forEach(d)},Mo.prototype.outputDefined=function(){return this.args.every(function(d){return d.outputDefined()})},Mo.prototype.serialize=function(){if(this.type.kind==="formatted")return new Xu([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Cs(this.args[0]).serialize();var d=["to-"+this.type.kind];return this.eachChild(function(z){d.push(z.serialize())}),d};var Oh=["Unknown","Point","LineString","Polygon"],as=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};as.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},as.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?Oh[this.feature.type]:this.feature.type:null},as.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},as.prototype.canonicalID=function(){return this.canonical},as.prototype.properties=function(){return this.feature&&this.feature.properties||{}},as.prototype.parseColor=function(d){var z=this._parseColorCache[d];return z||(z=this._parseColorCache[d]=ns.parse(d)),z};var io=function(d,z,H,ft){this.name=d,this.type=z,this._evaluate=H,this.args=ft};io.prototype.evaluate=function(d){return this._evaluate(d,this.args)},io.prototype.eachChild=function(d){this.args.forEach(d)},io.prototype.outputDefined=function(){return!1},io.prototype.serialize=function(){return[this.name].concat(this.args.map(function(d){return d.serialize()}))},io.parse=function(d,z){var H,ft=d[0],kt=io.definitions[ft];if(!kt)return z.error('Unknown expression "'+ft+'". If you wanted a literal array, use ["literal", [...]].',0);for(var It=Array.isArray(kt)?kt[0]:kt.type,Ht=Array.isArray(kt)?[[kt[1],kt[2]]]:kt.overloads,ge=Ht.filter(function(fo){var Eo=fo[0];return!Array.isArray(Eo)||Eo.length===d.length-1}),Pe=null,qe=0,Ye=ge;qe<Ye.length;qe+=1){var xr=Ye[qe],Ir=xr[0],Fr=xr[1];Pe=new Xs(z.registry,z.path,null,z.scope);for(var en=[],kn=!1,Zn=1;Zn<d.length;Zn++){var Hn=d[Zn],aa=Array.isArray(Ir)?Ir[Zn-1]:Ir.type,ma=Pe.parse(Hn,1+en.length,aa);if(!ma){kn=!0;break}en.push(ma)}if(!kn){if(Array.isArray(Ir)&&Ir.length!==en.length){Pe.error("Expected "+Ir.length+" arguments, but found "+en.length+" instead.");continue}for(var ra=0;ra<en.length;ra++){var Ea=Array.isArray(Ir)?Ir[ra]:Ir.type,Za=en[ra];Pe.concat(ra+1).checkSubtype(Ea,Za.type)}if(Pe.errors.length===0)return new io(ft,It,Fr,en)}}if(ge.length===1)(H=z.errors).push.apply(H,Pe.errors);else{for(var oi=ge.length?ge:Ht,si=oi.map(function(fo){var Eo=fo[0];return pc(Eo)}).join(" | "),Wi=[],Zi=1;Zi<d.length;Zi++){var ro=z.parse(d[Zi],1+Wi.length);if(!ro)return null;Wi.push(Es(ro.type))}z.error("Expected arguments of type "+si+", but found ("+Wi.join(", ")+") instead.")}return null},io.register=function(d,z){io.definitions=z;for(var H in z)d[H]=io};function pc(d){return Array.isArray(d)?"("+d.map(Es).join(", ")+")":"("+Es(d.type)+"...)"}var gu=function(d,z,H){this.type=ql,this.locale=H,this.caseSensitive=d,this.diacriticSensitive=z};gu.parse=function(d,z){if(d.length!==2)return z.error("Expected one argument.");var H=d[1];if(typeof H!="object"||Array.isArray(H))return z.error("Collator options argument must be an object.");var ft=z.parse(H["case-sensitive"]===void 0?!1:H["case-sensitive"],1,Bi);if(!ft)return null;var kt=z.parse(H["diacritic-sensitive"]===void 0?!1:H["diacritic-sensitive"],1,Bi);if(!kt)return null;var It=null;return H.locale&&(It=z.parse(H.locale,1,Oi),!It)?null:new gu(ft,kt,It)},gu.prototype.evaluate=function(d){return new du(this.caseSensitive.evaluate(d),this.diacriticSensitive.evaluate(d),this.locale?this.locale.evaluate(d):null)},gu.prototype.eachChild=function(d){d(this.caseSensitive),d(this.diacriticSensitive),this.locale&&d(this.locale)},gu.prototype.outputDefined=function(){return!1},gu.prototype.serialize=function(){var d={};return d["case-sensitive"]=this.caseSensitive.serialize(),d["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(d.locale=this.locale.serialize()),["collator",d]};var Pl=8192;function Wc(d,z){d[0]=Math.min(d[0],z[0]),d[1]=Math.min(d[1],z[1]),d[2]=Math.max(d[2],z[0]),d[3]=Math.max(d[3],z[1])}function $u(d){return(180+d)/360}function dc(d){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+d*Math.PI/360)))/360}function rl(d,z){return!(d[0]<=z[0]||d[2]>=z[2]||d[1]<=z[1]||d[3]>=z[3])}function oh(d,z){var H=$u(d[0]),ft=dc(d[1]),kt=Math.pow(2,z.z);return[Math.round(H*kt*Pl),Math.round(ft*kt*Pl)]}function Zc(d,z,H){var ft=d[0]-z[0],kt=d[1]-z[1],It=d[0]-H[0],Ht=d[1]-H[1];return ft*Ht-It*kt===0&&ft*It<=0&&kt*Ht<=0}function Lc(d,z,H){return z[1]>d[1]!=H[1]>d[1]&&d[0]<(H[0]-z[0])*(d[1]-z[1])/(H[1]-z[1])+z[0]}function Ju(d,z){for(var H=!1,ft=0,kt=z.length;ft<kt;ft++)for(var It=z[ft],Ht=0,ge=It.length;Ht<ge-1;Ht++){if(Zc(d,It[Ht],It[Ht+1]))return!1;Lc(d,It[Ht],It[Ht+1])&&(H=!H)}return H}function Cc(d,z){for(var H=0;H<z.length;H++)if(Ju(d,z[H]))return!0;return!1}function Xc(d,z){return d[0]*z[1]-d[1]*z[0]}function mu(d,z,H,ft){var kt=d[0]-H[0],It=d[1]-H[1],Ht=z[0]-H[0],ge=z[1]-H[1],Pe=ft[0]-H[0],qe=ft[1]-H[1],Ye=kt*qe-Pe*It,xr=Ht*qe-Pe*ge;return Ye>0&&xr<0||Ye<0&&xr>0}function $c(d,z,H,ft){var kt=[z[0]-d[0],z[1]-d[1]],It=[ft[0]-H[0],ft[1]-H[1]];return Xc(It,kt)===0?!1:!!(mu(d,z,H,ft)&&mu(H,ft,d,z))}function nc(d,z,H){for(var ft=0,kt=H;ft<kt.length;ft+=1)for(var It=kt[ft],Ht=0;Ht<It.length-1;++Ht)if($c(d,z,It[Ht],It[Ht+1]))return!0;return!1}function vu(d,z){for(var H=0;H<d.length;++H)if(!Ju(d[H],z))return!1;for(var ft=0;ft<d.length-1;++ft)if(nc(d[ft],d[ft+1],z))return!1;return!0}function Gl(d,z){for(var H=0;H<z.length;H++)if(vu(d,z[H]))return!0;return!1}function yc(d,z,H){for(var ft=[],kt=0;kt<d.length;kt++){for(var It=[],Ht=0;Ht<d[kt].length;Ht++){var ge=oh(d[kt][Ht],H);Wc(z,ge),It.push(ge)}ft.push(It)}return ft}function Jc(d,z,H){for(var ft=[],kt=0;kt<d.length;kt++){var It=yc(d[kt],z,H);ft.push(It)}return ft}function ps(d,z,H,ft){if(d[0]<H[0]||d[0]>H[2]){var kt=ft*.5,It=d[0]-H[0]>kt?-ft:H[0]-d[0]>kt?ft:0;It===0&&(It=d[0]-H[2]>kt?-ft:H[2]-d[0]>kt?ft:0),d[0]+=It}Wc(z,d)}function Dc(d){d[0]=d[1]=1/0,d[2]=d[3]=-1/0}function Fh(d,z,H,ft){for(var kt=Math.pow(2,ft.z)*Pl,It=[ft.x*Pl,ft.y*Pl],Ht=[],ge=0,Pe=d;ge<Pe.length;ge+=1)for(var qe=Pe[ge],Ye=0,xr=qe;Ye<xr.length;Ye+=1){var Ir=xr[Ye],Fr=[Ir.x+It[0],Ir.y+It[1]];ps(Fr,z,H,kt),Ht.push(Fr)}return Ht}function sh(d,z,H,ft){for(var kt=Math.pow(2,ft.z)*Pl,It=[ft.x*Pl,ft.y*Pl],Ht=[],ge=0,Pe=d;ge<Pe.length;ge+=1){for(var qe=Pe[ge],Ye=[],xr=0,Ir=qe;xr<Ir.length;xr+=1){var Fr=Ir[xr],en=[Fr.x+It[0],Fr.y+It[1]];Wc(z,en),Ye.push(en)}Ht.push(Ye)}if(z[2]-z[0]<=kt/2){Dc(z);for(var kn=0,Zn=Ht;kn<Zn.length;kn+=1)for(var Hn=Zn[kn],aa=0,ma=Hn;aa<ma.length;aa+=1){var ra=ma[aa];ps(ra,z,H,kt)}}return Ht}function xc(d,z){var H=[1/0,1/0,-1/0,-1/0],ft=[1/0,1/0,-1/0,-1/0],kt=d.canonicalID();if(z.type==="Polygon"){var It=yc(z.coordinates,ft,kt),Ht=Fh(d.geometry(),H,ft,kt);if(!rl(H,ft))return!1;for(var ge=0,Pe=Ht;ge<Pe.length;ge+=1){var qe=Pe[ge];if(!Ju(qe,It))return!1}}if(z.type==="MultiPolygon"){var Ye=Jc(z.coordinates,ft,kt),xr=Fh(d.geometry(),H,ft,kt);if(!rl(H,ft))return!1;for(var Ir=0,Fr=xr;Ir<Fr.length;Ir+=1){var en=Fr[Ir];if(!Cc(en,Ye))return!1}}return!0}function lh(d,z){var H=[1/0,1/0,-1/0,-1/0],ft=[1/0,1/0,-1/0,-1/0],kt=d.canonicalID();if(z.type==="Polygon"){var It=yc(z.coordinates,ft,kt),Ht=sh(d.geometry(),H,ft,kt);if(!rl(H,ft))return!1;for(var ge=0,Pe=Ht;ge<Pe.length;ge+=1){var qe=Pe[ge];if(!vu(qe,It))return!1}}if(z.type==="MultiPolygon"){var Ye=Jc(z.coordinates,ft,kt),xr=sh(d.geometry(),H,ft,kt);if(!rl(H,ft))return!1;for(var Ir=0,Fr=xr;Ir<Fr.length;Ir+=1){var en=Fr[Ir];if(!Gl(en,Ye))return!1}}return!0}var Wl=function(d,z){this.type=Bi,this.geojson=d,this.geometries=z};Wl.parse=function(d,z){if(d.length!==2)return z.error("'within' expression requires exactly one argument, but found "+(d.length-1)+" instead.");if(Zu(d[1])){var H=d[1];if(H.type==="FeatureCollection")for(var ft=0;ft<H.features.length;++ft){var kt=H.features[ft].geometry.type;if(kt==="Polygon"||kt==="MultiPolygon")return new Wl(H,H.features[ft].geometry)}else if(H.type==="Feature"){var It=H.geometry.type;if(It==="Polygon"||It==="MultiPolygon")return new Wl(H,H.geometry)}else if(H.type==="Polygon"||H.type==="MultiPolygon")return new Wl(H,H)}return z.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Wl.prototype.evaluate=function(d){if(d.geometry()!=null&&d.canonicalID()!=null){if(d.geometryType()==="Point")return xc(d,this.geometries);if(d.geometryType()==="LineString")return lh(d,this.geometries)}return!1},Wl.prototype.eachChild=function(){},Wl.prototype.outputDefined=function(){return!0},Wl.prototype.serialize=function(){return["within",this.geojson]};function uh(d){if(d instanceof io&&(d.name==="get"&&d.args.length===1||d.name==="feature-state"||d.name==="has"&&d.args.length===1||d.name==="properties"||d.name==="geometry-type"||d.name==="id"||/^filter-/.test(d.name))||d instanceof Wl)return!1;var z=!0;return d.eachChild(function(H){z&&!uh(H)&&(z=!1)}),z}function Il(d){if(d instanceof io&&d.name==="feature-state")return!1;var z=!0;return d.eachChild(function(H){z&&!Il(H)&&(z=!1)}),z}function Zl(d,z){if(d instanceof io&&z.indexOf(d.name)>=0)return!1;var H=!0;return d.eachChild(function(ft){H&&!Zl(ft,z)&&(H=!1)}),H}var Ru=function(d,z){this.type=z.type,this.name=d,this.boundExpression=z};Ru.parse=function(d,z){if(d.length!==2||typeof d[1]!="string")return z.error("'var' expression requires exactly one string literal argument.");var H=d[1];return z.scope.has(H)?new Ru(H,z.scope.get(H)):z.error('Unknown variable "'+H+'". Make sure "'+H+'" has been bound in an enclosing "let" expression before using it.',1)},Ru.prototype.evaluate=function(d){return this.boundExpression.evaluate(d)},Ru.prototype.eachChild=function(){},Ru.prototype.outputDefined=function(){return!1},Ru.prototype.serialize=function(){return["var",this.name]};var Xs=function(d,z,H,ft,kt){z===void 0&&(z=[]),ft===void 0&&(ft=new rs),kt===void 0&&(kt=[]),this.registry=d,this.path=z,this.key=z.map(function(It){return"["+It+"]"}).join(""),this.scope=ft,this.errors=kt,this.expectedType=H};Xs.prototype.parse=function(d,z,H,ft,kt){return kt===void 0&&(kt={}),z?this.concat(z,H,ft)._parse(d,kt):this._parse(d,kt)},Xs.prototype._parse=function(d,z){(d===null||typeof d=="string"||typeof d=="boolean"||typeof d=="number")&&(d=["literal",d]);function H(qe,Ye,xr){return xr==="assert"?new Ol(Ye,[qe]):xr==="coerce"?new Mo(Ye,[qe]):qe}if(Array.isArray(d)){if(d.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var ft=d[0];if(typeof ft!="string")return this.error("Expression name must be a string, but found "+typeof ft+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var kt=this.registry[ft];if(kt){var It=kt.parse(d,this);if(!It)return null;if(this.expectedType){var Ht=this.expectedType,ge=It.type;if((Ht.kind==="string"||Ht.kind==="number"||Ht.kind==="boolean"||Ht.kind==="object"||Ht.kind==="array")&&ge.kind==="value")It=H(It,Ht,z.typeAnnotation||"assert");else if((Ht.kind==="color"||Ht.kind==="formatted"||Ht.kind==="resolvedImage")&&(ge.kind==="value"||ge.kind==="string"))It=H(It,Ht,z.typeAnnotation||"coerce");else if(this.checkSubtype(Ht,ge))return null}if(!(It instanceof $o)&&It.type.kind!=="resolvedImage"&&Qu(It)){var Pe=new as;try{It=new $o(It.type,It.evaluate(Pe))}catch(qe){return this.error(qe.message),null}}return It}return this.error('Unknown expression "'+ft+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof d>"u"?this.error("'undefined' value invalid. Use null instead."):typeof d=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof d+" instead.")},Xs.prototype.concat=function(d,z,H){var ft=typeof d=="number"?this.path.concat(d):this.path,kt=H?this.scope.concat(H):this.scope;return new Xs(this.registry,ft,z||null,kt,this.errors)},Xs.prototype.error=function(d){for(var z=[],H=arguments.length-1;H-- >0;)z[H]=arguments[H+1];var ft=""+this.key+z.map(function(kt){return"["+kt+"]"}).join("");this.errors.push(new Po(ft,d))},Xs.prototype.checkSubtype=function(d,z){var H=Wu(d,z);return H&&this.error(H),H};function Qu(d){if(d instanceof Ru)return Qu(d.boundExpression);if(d instanceof io&&d.name==="error"||d instanceof gu||d instanceof Wl)return!1;var z=d instanceof Mo||d instanceof Ol,H=!0;return d.eachChild(function(ft){z?H=H&&Qu(ft):H=H&&ft instanceof $o}),H?uh(d)&&Zl(d,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function yu(d,z){for(var H=d.length-1,ft=0,kt=H,It=0,Ht,ge;ft<=kt;)if(It=Math.floor((ft+kt)/2),Ht=d[It],ge=d[It+1],Ht<=z){if(It===H||z<ge)return It;ft=It+1}else if(Ht>z)kt=It-1;else throw new ks("Input is not a number.");return 0}var Xl=function(d,z,H){this.type=d,this.input=z,this.labels=[],this.outputs=[];for(var ft=0,kt=H;ft<kt.length;ft+=1){var It=kt[ft],Ht=It[0],ge=It[1];this.labels.push(Ht),this.outputs.push(ge)}};Xl.parse=function(d,z){if(d.length-1<4)return z.error("Expected at least 4 arguments, but found only "+(d.length-1)+".");if((d.length-1)%2!==0)return z.error("Expected an even number of arguments.");var H=z.parse(d[1],1,za);if(!H)return null;var ft=[],kt=null;z.expectedType&&z.expectedType.kind!=="value"&&(kt=z.expectedType);for(var It=1;It<d.length;It+=2){var Ht=It===1?-1/0:d[It],ge=d[It+1],Pe=It,qe=It+1;if(typeof Ht!="number")return z.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Pe);if(ft.length&&ft[ft.length-1][0]>=Ht)return z.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Pe);var Ye=z.parse(ge,qe,kt);if(!Ye)return null;kt=kt||Ye.type,ft.push([Ht,Ye])}return new Xl(kt,H,ft)},Xl.prototype.evaluate=function(d){var z=this.labels,H=this.outputs;if(z.length===1)return H[0].evaluate(d);var ft=this.input.evaluate(d);if(ft<=z[0])return H[0].evaluate(d);var kt=z.length;if(ft>=z[kt-1])return H[kt-1].evaluate(d);var It=yu(z,ft);return H[It].evaluate(d)},Xl.prototype.eachChild=function(d){d(this.input);for(var z=0,H=this.outputs;z<H.length;z+=1){var ft=H[z];d(ft)}},Xl.prototype.outputDefined=function(){return this.outputs.every(function(d){return d.outputDefined()})},Xl.prototype.serialize=function(){for(var d=["step",this.input.serialize()],z=0;z<this.labels.length;z++)z>0&&d.push(this.labels[z]),d.push(this.outputs[z].serialize());return d};function Ds(d,z,H){return d*(1-H)+z*H}function gc(d,z,H){return new ns(Ds(d.r,z.r,H),Ds(d.g,z.g,H),Ds(d.b,z.b,H),Ds(d.a,z.a,H))}function Su(d,z,H){return d.map(function(ft,kt){return Ds(ft,z[kt],H)})}var Yu=Object.freeze({__proto__:null,number:Ds,color:gc,array:Su}),_c=.95047,bh=1,Zh=1.08883,ac=4/29,bc=6/29,Ll=3*bc*bc,zc=bc*bc*bc,$l=Math.PI/180,ic=180/Math.PI;function Oc(d){return d>zc?Math.pow(d,1/3):d/Ll+ac}function Ku(d){return d>bc?d*d*d:Ll*(d-ac)}function Os(d){return 255*(d<=.0031308?12.92*d:1.055*Math.pow(d,1/2.4)-.055)}function Eu(d){return d/=255,d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4)}function Jl(d){var z=Eu(d.r),H=Eu(d.g),ft=Eu(d.b),kt=Oc((.4124564*z+.3575761*H+.1804375*ft)/_c),It=Oc((.2126729*z+.7151522*H+.072175*ft)/bh),Ht=Oc((.0193339*z+.119192*H+.9503041*ft)/Zh);return{l:116*It-16,a:500*(kt-It),b:200*(It-Ht),alpha:d.a}}function ch(d){var z=(d.l+16)/116,H=isNaN(d.a)?z:z+d.a/500,ft=isNaN(d.b)?z:z-d.b/200;return z=bh*Ku(z),H=_c*Ku(H),ft=Zh*Ku(ft),new ns(Os(3.2404542*H-1.5371385*z-.4985314*ft),Os(-.969266*H+1.8760108*z+.041556*ft),Os(.0556434*H-.2040259*z+1.0572252*ft),d.alpha)}function Ps(d,z,H){return{l:Ds(d.l,z.l,H),a:Ds(d.a,z.a,H),b:Ds(d.b,z.b,H),alpha:Ds(d.alpha,z.alpha,H)}}function mc(d){var z=Jl(d),H=z.l,ft=z.a,kt=z.b,It=Math.atan2(kt,ft)*ic;return{h:It<0?It+360:It,c:Math.sqrt(ft*ft+kt*kt),l:H,alpha:d.a}}function ju(d){var z=d.h*$l,H=d.c,ft=d.l;return ch({l:ft,a:Math.cos(z)*H,b:Math.sin(z)*H,alpha:d.alpha})}function Ql(d,z,H){var ft=z-d;return d+H*(ft>180||ft<-180?ft-360*Math.round(ft/360):ft)}function oc(d,z,H){return{h:Ql(d.h,z.h,H),c:Ds(d.c,z.c,H),l:Ds(d.l,z.l,H),alpha:Ds(d.alpha,z.alpha,H)}}var Nu={forward:Jl,reverse:ch,interpolate:Ps},vc={forward:mc,reverse:ju,interpolate:oc},wh=Object.freeze({__proto__:null,lab:Nu,hcl:vc}),cl=function(d,z,H,ft,kt){this.type=d,this.operator=z,this.interpolation=H,this.input=ft,this.labels=[],this.outputs=[];for(var It=0,Ht=kt;It<Ht.length;It+=1){var ge=Ht[It],Pe=ge[0],qe=ge[1];this.labels.push(Pe),this.outputs.push(qe)}};cl.interpolationFactor=function(d,z,H,ft){var kt=0;if(d.name==="exponential")kt=Qc(z,d.base,H,ft);else if(d.name==="linear")kt=Qc(z,1,H,ft);else if(d.name==="cubic-bezier"){var It=d.controlPoints,Ht=new i(It[0],It[1],It[2],It[3]);kt=Ht.solve(Qc(z,1,H,ft))}return kt},cl.parse=function(d,z){var H=d[0],ft=d[1],kt=d[2],It=d.slice(3);if(!Array.isArray(ft)||ft.length===0)return z.error("Expected an interpolation type expression.",1);if(ft[0]==="linear")ft={name:"linear"};else if(ft[0]==="exponential"){var Ht=ft[1];if(typeof Ht!="number")return z.error("Exponential interpolation requires a numeric base.",1,1);ft={name:"exponential",base:Ht}}else if(ft[0]==="cubic-bezier"){var ge=ft.slice(1);if(ge.length!==4||ge.some(function(Zn){return typeof Zn!="number"||Zn<0||Zn>1}))return z.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);ft={name:"cubic-bezier",controlPoints:ge}}else return z.error("Unknown interpolation type "+String(ft[0]),1,0);if(d.length-1<4)return z.error("Expected at least 4 arguments, but found only "+(d.length-1)+".");if((d.length-1)%2!==0)return z.error("Expected an even number of arguments.");if(kt=z.parse(kt,2,za),!kt)return null;var Pe=[],qe=null;H==="interpolate-hcl"||H==="interpolate-lab"?qe=Ro:z.expectedType&&z.expectedType.kind!=="value"&&(qe=z.expectedType);for(var Ye=0;Ye<It.length;Ye+=2){var xr=It[Ye],Ir=It[Ye+1],Fr=Ye+3,en=Ye+4;if(typeof xr!="number")return z.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Fr);if(Pe.length&&Pe[Pe.length-1][0]>=xr)return z.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Fr);var kn=z.parse(Ir,en,qe);if(!kn)return null;qe=qe||kn.type,Pe.push([xr,kn])}return qe.kind!=="number"&&qe.kind!=="color"&&!(qe.kind==="array"&&qe.itemType.kind==="number"&&typeof qe.N=="number")?z.error("Type "+Es(qe)+" is not interpolatable."):new cl(qe,H,ft,kt,Pe)},cl.prototype.evaluate=function(d){var z=this.labels,H=this.outputs;if(z.length===1)return H[0].evaluate(d);var ft=this.input.evaluate(d);if(ft<=z[0])return H[0].evaluate(d);var kt=z.length;if(ft>=z[kt-1])return H[kt-1].evaluate(d);var It=yu(z,ft),Ht=z[It],ge=z[It+1],Pe=cl.interpolationFactor(this.interpolation,ft,Ht,ge),qe=H[It].evaluate(d),Ye=H[It+1].evaluate(d);return this.operator==="interpolate"?Yu[this.type.kind.toLowerCase()](qe,Ye,Pe):this.operator==="interpolate-hcl"?vc.reverse(vc.interpolate(vc.forward(qe),vc.forward(Ye),Pe)):Nu.reverse(Nu.interpolate(Nu.forward(qe),Nu.forward(Ye),Pe))},cl.prototype.eachChild=function(d){d(this.input);for(var z=0,H=this.outputs;z<H.length;z+=1){var ft=H[z];d(ft)}},cl.prototype.outputDefined=function(){return this.outputs.every(function(d){return d.outputDefined()})},cl.prototype.serialize=function(){var d;this.interpolation.name==="linear"?d=["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?d=["linear"]:d=["exponential",this.interpolation.base]:d=["cubic-bezier"].concat(this.interpolation.controlPoints);for(var z=[this.operator,d,this.input.serialize()],H=0;H<this.labels.length;H++)z.push(this.labels[H],this.outputs[H].serialize());return z};function Qc(d,z,H,ft){var kt=ft-H,It=d-H;return kt===0?0:z===1?It/kt:(Math.pow(z,It)-1)/(Math.pow(z,kt)-1)}var Yl=function(d,z){this.type=d,this.args=z};Yl.parse=function(d,z){if(d.length<2)return z.error("Expectected at least one argument.");var H=null,ft=z.expectedType;ft&&ft.kind!=="value"&&(H=ft);for(var kt=[],It=0,Ht=d.slice(1);It<Ht.length;It+=1){var ge=Ht[It],Pe=z.parse(ge,1+kt.length,H,void 0,{typeAnnotation:"omit"});if(!Pe)return null;H=H||Pe.type,kt.push(Pe)}var qe=ft&&kt.some(function(Ye){return Wu(ft,Ye.type)});return qe?new Yl(Ci,kt):new Yl(H,kt)},Yl.prototype.evaluate=function(d){for(var z=null,H=0,ft,kt=0,It=this.args;kt<It.length;kt+=1){var Ht=It[kt];if(H++,z=Ht.evaluate(d),z&&z instanceof el&&!z.available&&(ft||(ft=z.name),z=null,H===this.args.length&&(z=ft)),z!==null)break}return z},Yl.prototype.eachChild=function(d){this.args.forEach(d)},Yl.prototype.outputDefined=function(){return this.args.every(function(d){return d.outputDefined()})},Yl.prototype.serialize=function(){var d=["coalesce"];return this.eachChild(function(z){d.push(z.serialize())}),d};var Pu=function(d,z){this.type=z.type,this.bindings=[].concat(d),this.result=z};Pu.prototype.evaluate=function(d){return this.result.evaluate(d)},Pu.prototype.eachChild=function(d){for(var z=0,H=this.bindings;z<H.length;z+=1){var ft=H[z];d(ft[1])}d(this.result)},Pu.parse=function(d,z){if(d.length<4)return z.error("Expected at least 3 arguments, but found "+(d.length-1)+" instead.");for(var H=[],ft=1;ft<d.length-1;ft+=2){var kt=d[ft];if(typeof kt!="string")return z.error("Expected string, but found "+typeof kt+" instead.",ft);if(/[^a-zA-Z0-9_]/.test(kt))return z.error("Variable names must contain only alphanumeric characters or '_'.",ft);var It=z.parse(d[ft+1],ft+1);if(!It)return null;H.push([kt,It])}var Ht=z.parse(d[d.length-1],d.length-1,z.expectedType,H);return Ht?new Pu(H,Ht):null},Pu.prototype.outputDefined=function(){return this.result.outputDefined()},Pu.prototype.serialize=function(){for(var d=["let"],z=0,H=this.bindings;z<H.length;z+=1){var ft=H[z],kt=ft[0],It=ft[1];d.push(kt,It.serialize())}return d.push(this.result.serialize()),d};var xu=function(d,z,H){this.type=d,this.index=z,this.input=H};xu.parse=function(d,z){if(d.length!==3)return z.error("Expected 2 arguments, but found "+(d.length-1)+" instead.");var H=z.parse(d[1],1,za),ft=z.parse(d[2],2,Us(z.expectedType||Ci));if(!H||!ft)return null;var kt=ft.type;return new xu(kt.itemType,H,ft)},xu.prototype.evaluate=function(d){var z=this.index.evaluate(d),H=this.input.evaluate(d);if(z<0)throw new ks("Array index out of bounds: "+z+" < 0.");if(z>=H.length)throw new ks("Array index out of bounds: "+z+" > "+(H.length-1)+".");if(z!==Math.floor(z))throw new ks("Array index must be an integer, but found "+z+" instead.");return H[z]},xu.prototype.eachChild=function(d){d(this.index),d(this.input)},xu.prototype.outputDefined=function(){return!1},xu.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Vs=function(d,z){this.type=Bi,this.needle=d,this.haystack=z};Vs.parse=function(d,z){if(d.length!==3)return z.error("Expected 2 arguments, but found "+(d.length-1)+" instead.");var H=z.parse(d[1],1,Ci),ft=z.parse(d[2],2,Ci);return!H||!ft?null:Mu(H.type,[Bi,Oi,za,hl,Ci])?new Vs(H,ft):z.error("Expected first argument to be of type boolean, string, number or null, but found "+Es(H.type)+" instead")},Vs.prototype.evaluate=function(d){var z=this.needle.evaluate(d),H=this.haystack.evaluate(d);if(!H)return!1;if(!Fu(z,["boolean","string","number","null"]))throw new ks("Expected first argument to be of type boolean, string, number or null, but found "+Es(ys(z))+" instead.");if(!Fu(H,["string","array"]))throw new ks("Expected second argument to be of type array or string, but found "+Es(ys(H))+" instead.");return H.indexOf(z)>=0},Vs.prototype.eachChild=function(d){d(this.needle),d(this.haystack)},Vs.prototype.outputDefined=function(){return!0},Vs.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var qs=function(d,z,H){this.type=za,this.needle=d,this.haystack=z,this.fromIndex=H};qs.parse=function(d,z){if(d.length<=2||d.length>=5)return z.error("Expected 3 or 4 arguments, but found "+(d.length-1)+" instead.");var H=z.parse(d[1],1,Ci),ft=z.parse(d[2],2,Ci);if(!H||!ft)return null;if(!Mu(H.type,[Bi,Oi,za,hl,Ci]))return z.error("Expected first argument to be of type boolean, string, number or null, but found "+Es(H.type)+" instead");if(d.length===4){var kt=z.parse(d[3],3,za);return kt?new qs(H,ft,kt):null}else return new qs(H,ft)},qs.prototype.evaluate=function(d){var z=this.needle.evaluate(d),H=this.haystack.evaluate(d);if(!Fu(z,["boolean","string","number","null"]))throw new ks("Expected first argument to be of type boolean, string, number or null, but found "+Es(ys(z))+" instead.");if(!Fu(H,["string","array"]))throw new ks("Expected second argument to be of type array or string, but found "+Es(ys(H))+" instead.");if(this.fromIndex){var ft=this.fromIndex.evaluate(d);return H.indexOf(z,ft)}return H.indexOf(z)},qs.prototype.eachChild=function(d){d(this.needle),d(this.haystack),this.fromIndex&&d(this.fromIndex)},qs.prototype.outputDefined=function(){return!1},qs.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var d=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),d]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Iu=function(d,z,H,ft,kt,It){this.inputType=d,this.type=z,this.input=H,this.cases=ft,this.outputs=kt,this.otherwise=It};Iu.parse=function(d,z){if(d.length<5)return z.error("Expected at least 4 arguments, but found only "+(d.length-1)+".");if(d.length%2!==1)return z.error("Expected an even number of arguments.");var H,ft;z.expectedType&&z.expectedType.kind!=="value"&&(ft=z.expectedType);for(var kt={},It=[],Ht=2;Ht<d.length-1;Ht+=2){var ge=d[Ht],Pe=d[Ht+1];Array.isArray(ge)||(ge=[ge]);var qe=z.concat(Ht);if(ge.length===0)return qe.error("Expected at least one branch label.");for(var Ye=0,xr=ge;Ye<xr.length;Ye+=1){var Ir=xr[Ye];if(typeof Ir!="number"&&typeof Ir!="string")return qe.error("Branch labels must be numbers or strings.");if(typeof Ir=="number"&&Math.abs(Ir)>Number.MAX_SAFE_INTEGER)return qe.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Ir=="number"&&Math.floor(Ir)!==Ir)return qe.error("Numeric branch labels must be integer values.");if(!H)H=ys(Ir);else if(qe.checkSubtype(H,ys(Ir)))return null;if(typeof kt[String(Ir)]<"u")return qe.error("Branch labels must be unique.");kt[String(Ir)]=It.length}var Fr=z.parse(Pe,Ht,ft);if(!Fr)return null;ft=ft||Fr.type,It.push(Fr)}var en=z.parse(d[1],1,Ci);if(!en)return null;var kn=z.parse(d[d.length-1],d.length-1,ft);return!kn||en.type.kind!=="value"&&z.concat(1).checkSubtype(H,en.type)?null:new Iu(H,ft,en,kt,It,kn)},Iu.prototype.evaluate=function(d){var z=this.input.evaluate(d),H=ys(z)===this.inputType&&this.outputs[this.cases[z]]||this.otherwise;return H.evaluate(d)},Iu.prototype.eachChild=function(d){d(this.input),this.outputs.forEach(d),d(this.otherwise)},Iu.prototype.outputDefined=function(){return this.outputs.every(function(d){return d.outputDefined()})&&this.otherwise.outputDefined()},Iu.prototype.serialize=function(){for(var d=this,z=["match",this.input.serialize()],H=Object.keys(this.cases).sort(),ft=[],kt={},It=0,Ht=H;It<Ht.length;It+=1){var ge=Ht[It],Pe=kt[this.cases[ge]];Pe===void 0?(kt[this.cases[ge]]=ft.length,ft.push([this.cases[ge],[ge]])):ft[Pe][1].push(ge)}for(var qe=function(en){return d.inputType.kind==="number"?Number(en):en},Ye=0,xr=ft;Ye<xr.length;Ye+=1){var Ir=xr[Ye],Pe=Ir[0],Fr=Ir[1];Fr.length===1?z.push(qe(Fr[0])):z.push(Fr.map(qe)),z.push(this.outputs[outputIndex$1].serialize())}return z.push(this.otherwise.serialize()),z};var sc=function(d,z,H){this.type=d,this.branches=z,this.otherwise=H};sc.parse=function(d,z){if(d.length<4)return z.error("Expected at least 3 arguments, but found only "+(d.length-1)+".");if(d.length%2!==0)return z.error("Expected an odd number of arguments.");var H;z.expectedType&&z.expectedType.kind!=="value"&&(H=z.expectedType);for(var ft=[],kt=1;kt<d.length-1;kt+=2){var It=z.parse(d[kt],kt,Bi);if(!It)return null;var Ht=z.parse(d[kt+1],kt+1,H);if(!Ht)return null;ft.push([It,Ht]),H=H||Ht.type}var ge=z.parse(d[d.length-1],d.length-1,H);return ge?new sc(H,ft,ge):null},sc.prototype.evaluate=function(d){for(var z=0,H=this.branches;z<H.length;z+=1){var ft=H[z],kt=ft[0],It=ft[1];if(kt.evaluate(d))return It.evaluate(d)}return this.otherwise.evaluate(d)},sc.prototype.eachChild=function(d){for(var z=0,H=this.branches;z<H.length;z+=1){var ft=H[z],kt=ft[0],It=ft[1];d(kt),d(It)}d(this.otherwise)},sc.prototype.outputDefined=function(){return this.branches.every(function(d){d[0];var z=d[1];return z.outputDefined()})&&this.otherwise.outputDefined()},sc.prototype.serialize=function(){var d=["case"];return this.eachChild(function(z){d.push(z.serialize())}),d};var _u=function(d,z,H,ft){this.type=d,this.input=z,this.beginIndex=H,this.endIndex=ft};_u.parse=function(d,z){if(d.length<=2||d.length>=5)return z.error("Expected 3 or 4 arguments, but found "+(d.length-1)+" instead.");var H=z.parse(d[1],1,Ci),ft=z.parse(d[2],2,za);if(!H||!ft)return null;if(!Mu(H.type,[Us(Ci),Oi,Ci]))return z.error("Expected first argument to be of type array or string, but found "+Es(H.type)+" instead");if(d.length===4){var kt=z.parse(d[3],3,za);return kt?new _u(H.type,H,ft,kt):null}else return new _u(H.type,H,ft)},_u.prototype.evaluate=function(d){var z=this.input.evaluate(d),H=this.beginIndex.evaluate(d);if(!Fu(z,["string","array"]))throw new ks("Expected first argument to be of type array or string, but found "+Es(ys(z))+" instead.");if(this.endIndex){var ft=this.endIndex.evaluate(d);return z.slice(H,ft)}return z.slice(H)},_u.prototype.eachChild=function(d){d(this.input),d(this.beginIndex),this.endIndex&&d(this.endIndex)},_u.prototype.outputDefined=function(){return!1},_u.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var d=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),d]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function wc(d,z){return d==="=="||d==="!="?z.kind==="boolean"||z.kind==="string"||z.kind==="number"||z.kind==="null"||z.kind==="value":z.kind==="string"||z.kind==="number"||z.kind==="value"}function Ve(d,z,H){return z===H}function lr(d,z,H){return z!==H}function Ur(d,z,H){return z<H}function Or(d,z,H){return z>H}function un(d,z,H){return z<=H}function Ln(d,z,H){return z>=H}function Gn(d,z,H,ft){return ft.compare(z,H)===0}function oa(d,z,H,ft){return!Gn(d,z,H,ft)}function ya(d,z,H,ft){return ft.compare(z,H)<0}function Pa(d,z,H,ft){return ft.compare(z,H)>0}function Jn(d,z,H,ft){return ft.compare(z,H)<=0}function va(d,z,H,ft){return ft.compare(z,H)>=0}function sa(d,z,H){var ft=d!=="=="&&d!=="!=";return function(){function kt(It,Ht,ge){this.type=Bi,this.lhs=It,this.rhs=Ht,this.collator=ge,this.hasUntypedArgument=It.type.kind==="value"||Ht.type.kind==="value"}return kt.parse=function(It,Ht){if(It.length!==3&&It.length!==4)return Ht.error("Expected two or three arguments.");var ge=It[0],Pe=Ht.parse(It[1],1,Ci);if(!Pe)return null;if(!wc(ge,Pe.type))return Ht.concat(1).error('"'+ge+`" comparisons are not supported for type '`+Es(Pe.type)+"'.");var qe=Ht.parse(It[2],2,Ci);if(!qe)return null;if(!wc(ge,qe.type))return Ht.concat(2).error('"'+ge+`" comparisons are not supported for type '`+Es(qe.type)+"'.");if(Pe.type.kind!==qe.type.kind&&Pe.type.kind!=="value"&&qe.type.kind!=="value")return Ht.error("Cannot compare types '"+Es(Pe.type)+"' and '"+Es(qe.type)+"'.");ft&&(Pe.type.kind==="value"&&qe.type.kind!=="value"?Pe=new Ol(qe.type,[Pe]):Pe.type.kind!=="value"&&qe.type.kind==="value"&&(qe=new Ol(Pe.type,[qe])));var Ye=null;if(It.length===4){if(Pe.type.kind!=="string"&&qe.type.kind!=="string"&&Pe.type.kind!=="value"&&qe.type.kind!=="value")return Ht.error("Cannot use collator to compare non-string types.");if(Ye=Ht.parse(It[3],3,ql),!Ye)return null}return new kt(Pe,qe,Ye)},kt.prototype.evaluate=function(It){var Ht=this.lhs.evaluate(It),ge=this.rhs.evaluate(It);if(ft&&this.hasUntypedArgument){var Pe=ys(Ht),qe=ys(ge);if(Pe.kind!==qe.kind||!(Pe.kind==="string"||Pe.kind==="number"))throw new ks('Expected arguments for "'+d+'" to be (string, string) or (number, number), but found ('+Pe.kind+", "+qe.kind+") instead.")}if(this.collator&&!ft&&this.hasUntypedArgument){var Ye=ys(Ht),xr=ys(ge);if(Ye.kind!=="string"||xr.kind!=="string")return z(It,Ht,ge)}return this.collator?H(It,Ht,ge,this.collator.evaluate(It)):z(It,Ht,ge)},kt.prototype.eachChild=function(It){It(this.lhs),It(this.rhs),this.collator&&It(this.collator)},kt.prototype.outputDefined=function(){return!0},kt.prototype.serialize=function(){var It=[d];return this.eachChild(function(Ht){It.push(Ht.serialize())}),It},kt}()}var qn=sa("==",Ve,Gn),Fa=sa("!=",lr,oa),Fi=sa("<",Ur,ya),Ei=sa(">",Or,Pa),Ni=sa("<=",un,Jn),Hi=sa(">=",Ln,va),Ba=function(d,z,H,ft,kt){this.type=Oi,this.number=d,this.locale=z,this.currency=H,this.minFractionDigits=ft,this.maxFractionDigits=kt};Ba.parse=function(d,z){if(d.length!==3)return z.error("Expected two arguments.");var H=z.parse(d[1],1,za);if(!H)return null;var ft=d[2];if(typeof ft!="object"||Array.isArray(ft))return z.error("NumberFormat options argument must be an object.");var kt=null;if(ft.locale&&(kt=z.parse(ft.locale,1,Oi),!kt))return null;var It=null;if(ft.currency&&(It=z.parse(ft.currency,1,Oi),!It))return null;var Ht=null;if(ft["min-fraction-digits"]&&(Ht=z.parse(ft["min-fraction-digits"],1,za),!Ht))return null;var ge=null;return ft["max-fraction-digits"]&&(ge=z.parse(ft["max-fraction-digits"],1,za),!ge)?null:new Ba(H,kt,It,Ht,ge)},Ba.prototype.evaluate=function(d){return new Intl.NumberFormat(this.locale?this.locale.evaluate(d):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(d):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(d):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(d):void 0}).format(this.number.evaluate(d))},Ba.prototype.eachChild=function(d){d(this.number),this.locale&&d(this.locale),this.currency&&d(this.currency),this.minFractionDigits&&d(this.minFractionDigits),this.maxFractionDigits&&d(this.maxFractionDigits)},Ba.prototype.outputDefined=function(){return!1},Ba.prototype.serialize=function(){var d={};return this.locale&&(d.locale=this.locale.serialize()),this.currency&&(d.currency=this.currency.serialize()),this.minFractionDigits&&(d["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(d["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),d]};var ba=function(d){this.type=za,this.input=d};ba.parse=function(d,z){if(d.length!==2)return z.error("Expected 1 argument, but found "+(d.length-1)+" instead.");var H=z.parse(d[1],1);return H?H.type.kind!=="array"&&H.type.kind!=="string"&&H.type.kind!=="value"?z.error("Expected argument of type string or array, but found "+Es(H.type)+" instead."):new ba(H):null},ba.prototype.evaluate=function(d){var z=this.input.evaluate(d);if(typeof z=="string"||Array.isArray(z))return z.length;throw new ks("Expected value to be of type string or array, but found "+Es(ys(z))+" instead.")},ba.prototype.eachChild=function(d){d(this.input)},ba.prototype.outputDefined=function(){return!1},ba.prototype.serialize=function(){var d=["length"];return this.eachChild(function(z){d.push(z.serialize())}),d};var $i={"==":qn,"!=":Fa,">":Ei,"<":Fi,">=":Hi,"<=":Ni,array:Ol,at:xu,boolean:Ol,case:sc,coalesce:Yl,collator:gu,format:Xu,image:Cs,in:Vs,"index-of":qs,interpolate:cl,"interpolate-hcl":cl,"interpolate-lab":cl,length:ba,let:Pu,literal:$o,match:Iu,number:Ol,"number-format":Ba,object:Ol,slice:_u,step:Xl,string:Ol,"to-boolean":Mo,"to-color":Mo,"to-number":Mo,"to-string":Mo,var:Ru,within:Wl};function So(d,z){var H=z[0],ft=z[1],kt=z[2],It=z[3];H=H.evaluate(d),ft=ft.evaluate(d),kt=kt.evaluate(d);var Ht=It?It.evaluate(d):1,ge=ul(H,ft,kt,Ht);if(ge)throw new ks(ge);return new ns(H/255*Ht,ft/255*Ht,kt/255*Ht,Ht)}function Jo(d,z){return d in z}function As(d,z){var H=z[d];return typeof H>"u"?null:H}function os(d,z,H,ft){for(;H<=ft;){var kt=H+ft>>1;if(z[kt]===d)return!0;z[kt]>d?ft=kt-1:H=kt+1}return!1}function xs(d){return{type:d}}io.register($i,{error:[fl,[Oi],function(d,z){var H=z[0];throw new ks(H.evaluate(d))}],typeof:[Oi,[Ci],function(d,z){var H=z[0];return Es(ys(H.evaluate(d)))}],"to-rgba":[Us(za,4),[Ro],function(d,z){var H=z[0];return H.evaluate(d).toArray()}],rgb:[Ro,[za,za,za],So],rgba:[Ro,[za,za,za,za],So],has:{type:Bi,overloads:[[[Oi],function(d,z){var H=z[0];return Jo(H.evaluate(d),d.properties())}],[[Oi,Fo],function(d,z){var H=z[0],ft=z[1];return Jo(H.evaluate(d),ft.evaluate(d))}]]},get:{type:Ci,overloads:[[[Oi],function(d,z){var H=z[0];return As(H.evaluate(d),d.properties())}],[[Oi,Fo],function(d,z){var H=z[0],ft=z[1];return As(H.evaluate(d),ft.evaluate(d))}]]},"feature-state":[Ci,[Oi],function(d,z){var H=z[0];return As(H.evaluate(d),d.featureState||{})}],properties:[Fo,[],function(d){return d.properties()}],"geometry-type":[Oi,[],function(d){return d.geometryType()}],id:[Ci,[],function(d){return d.id()}],zoom:[za,[],function(d){return d.globals.zoom}],"heatmap-density":[za,[],function(d){return d.globals.heatmapDensity||0}],"line-progress":[za,[],function(d){return d.globals.lineProgress||0}],accumulated:[Ci,[],function(d){return d.globals.accumulated===void 0?null:d.globals.accumulated}],"+":[za,xs(za),function(d,z){for(var H=0,ft=0,kt=z;ft<kt.length;ft+=1){var It=kt[ft];H+=It.evaluate(d)}return H}],"*":[za,xs(za),function(d,z){for(var H=1,ft=0,kt=z;ft<kt.length;ft+=1){var It=kt[ft];H*=It.evaluate(d)}return H}],"-":{type:za,overloads:[[[za,za],function(d,z){var H=z[0],ft=z[1];return H.evaluate(d)-ft.evaluate(d)}],[[za],function(d,z){var H=z[0];return-H.evaluate(d)}]]},"/":[za,[za,za],function(d,z){var H=z[0],ft=z[1];return H.evaluate(d)/ft.evaluate(d)}],"%":[za,[za,za],function(d,z){var H=z[0],ft=z[1];return H.evaluate(d)%ft.evaluate(d)}],ln2:[za,[],function(){return Math.LN2}],pi:[za,[],function(){return Math.PI}],e:[za,[],function(){return Math.E}],"^":[za,[za,za],function(d,z){var H=z[0],ft=z[1];return Math.pow(H.evaluate(d),ft.evaluate(d))}],sqrt:[za,[za],function(d,z){var H=z[0];return Math.sqrt(H.evaluate(d))}],log10:[za,[za],function(d,z){var H=z[0];return Math.log(H.evaluate(d))/Math.LN10}],ln:[za,[za],function(d,z){var H=z[0];return Math.log(H.evaluate(d))}],log2:[za,[za],function(d,z){var H=z[0];return Math.log(H.evaluate(d))/Math.LN2}],sin:[za,[za],function(d,z){var H=z[0];return Math.sin(H.evaluate(d))}],cos:[za,[za],function(d,z){var H=z[0];return Math.cos(H.evaluate(d))}],tan:[za,[za],function(d,z){var H=z[0];return Math.tan(H.evaluate(d))}],asin:[za,[za],function(d,z){var H=z[0];return Math.asin(H.evaluate(d))}],acos:[za,[za],function(d,z){var H=z[0];return Math.acos(H.evaluate(d))}],atan:[za,[za],function(d,z){var H=z[0];return Math.atan(H.evaluate(d))}],min:[za,xs(za),function(d,z){return Math.min.apply(Math,z.map(function(H){return H.evaluate(d)}))}],max:[za,xs(za),function(d,z){return Math.max.apply(Math,z.map(function(H){return H.evaluate(d)}))}],abs:[za,[za],function(d,z){var H=z[0];return Math.abs(H.evaluate(d))}],round:[za,[za],function(d,z){var H=z[0],ft=H.evaluate(d);return ft<0?-Math.round(-ft):Math.round(ft)}],floor:[za,[za],function(d,z){var H=z[0];return Math.floor(H.evaluate(d))}],ceil:[za,[za],function(d,z){var H=z[0];return Math.ceil(H.evaluate(d))}],"filter-==":[Bi,[Oi,Ci],function(d,z){var H=z[0],ft=z[1];return d.properties()[H.value]===ft.value}],"filter-id-==":[Bi,[Ci],function(d,z){var H=z[0];return d.id()===H.value}],"filter-type-==":[Bi,[Oi],function(d,z){var H=z[0];return d.geometryType()===H.value}],"filter-<":[Bi,[Oi,Ci],function(d,z){var H=z[0],ft=z[1],kt=d.properties()[H.value],It=ft.value;return typeof kt==typeof It&&kt<It}],"filter-id-<":[Bi,[Ci],function(d,z){var H=z[0],ft=d.id(),kt=H.value;return typeof ft==typeof kt&&ft<kt}],"filter->":[Bi,[Oi,Ci],function(d,z){var H=z[0],ft=z[1],kt=d.properties()[H.value],It=ft.value;return typeof kt==typeof It&&kt>It}],"filter-id->":[Bi,[Ci],function(d,z){var H=z[0],ft=d.id(),kt=H.value;return typeof ft==typeof kt&&ft>kt}],"filter-<=":[Bi,[Oi,Ci],function(d,z){var H=z[0],ft=z[1],kt=d.properties()[H.value],It=ft.value;return typeof kt==typeof It&&kt<=It}],"filter-id-<=":[Bi,[Ci],function(d,z){var H=z[0],ft=d.id(),kt=H.value;return typeof ft==typeof kt&&ft<=kt}],"filter->=":[Bi,[Oi,Ci],function(d,z){var H=z[0],ft=z[1],kt=d.properties()[H.value],It=ft.value;return typeof kt==typeof It&&kt>=It}],"filter-id->=":[Bi,[Ci],function(d,z){var H=z[0],ft=d.id(),kt=H.value;return typeof ft==typeof kt&&ft>=kt}],"filter-has":[Bi,[Ci],function(d,z){var H=z[0];return H.value in d.properties()}],"filter-has-id":[Bi,[],function(d){return d.id()!==null&&d.id()!==void 0}],"filter-type-in":[Bi,[Us(Oi)],function(d,z){var H=z[0];return H.value.indexOf(d.geometryType())>=0}],"filter-id-in":[Bi,[Us(Ci)],function(d,z){var H=z[0];return H.value.indexOf(d.id())>=0}],"filter-in-small":[Bi,[Oi,Us(Ci)],function(d,z){var H=z[0],ft=z[1];return ft.value.indexOf(d.properties()[H.value])>=0}],"filter-in-large":[Bi,[Oi,Us(Ci)],function(d,z){var H=z[0],ft=z[1];return os(d.properties()[H.value],ft.value,0,ft.value.length-1)}],all:{type:Bi,overloads:[[[Bi,Bi],function(d,z){var H=z[0],ft=z[1];return H.evaluate(d)&&ft.evaluate(d)}],[xs(Bi),function(d,z){for(var H=0,ft=z;H<ft.length;H+=1){var kt=ft[H];if(!kt.evaluate(d))return!1}return!0}]]},any:{type:Bi,overloads:[[[Bi,Bi],function(d,z){var H=z[0],ft=z[1];return H.evaluate(d)||ft.evaluate(d)}],[xs(Bi),function(d,z){for(var H=0,ft=z;H<ft.length;H+=1){var kt=ft[H];if(kt.evaluate(d))return!0}return!1}]]},"!":[Bi,[Bi],function(d,z){var H=z[0];return!H.evaluate(d)}],"is-supported-script":[Bi,[Oi],function(d,z){var H=z[0],ft=d.globals&&d.globals.isSupportedScript;return ft?ft(H.evaluate(d)):!0}],upcase:[Oi,[Oi],function(d,z){var H=z[0];return H.evaluate(d).toUpperCase()}],downcase:[Oi,[Oi],function(d,z){var H=z[0];return H.evaluate(d).toLowerCase()}],concat:[Oi,xs(Ci),function(d,z){return z.map(function(H){return pl(H.evaluate(d))}).join("")}],"resolved-locale":[Oi,[ql],function(d,z){var H=z[0];return H.evaluate(d).resolvedLocale()}]});function No(d){return{result:"success",value:d}}function Qs(d){return{result:"error",value:d}}function Hs(d){return d["property-type"]==="data-driven"||d["property-type"]==="cross-faded-data-driven"}function Ms(d){return!!d.expression&&d.expression.parameters.indexOf("zoom")>-1}function ni(d){return!!d.expression&&d.expression.interpolated}function to(d){return d instanceof Number?"number":d instanceof String?"string":d instanceof Boolean?"boolean":Array.isArray(d)?"array":d===null?"null":typeof d}function ds(d){return typeof d=="object"&&d!==null&&!Array.isArray(d)}function Qo(d){return d}function Tl(d,z){var H=z.type==="color",ft=d.stops&&typeof d.stops[0][0]=="object",kt=ft||d.property!==void 0,It=ft||!kt,Ht=d.type||(ni(z)?"exponential":"interval");if(H&&(d=fs({},d),d.stops&&(d.stops=d.stops.map(function(si){return[si[0],ns.parse(si[1])]})),d.default?d.default=ns.parse(d.default):d.default=ns.parse(z.default)),d.colorSpace&&d.colorSpace!=="rgb"&&!wh[d.colorSpace])throw new Error("Unknown color space: "+d.colorSpace);var ge,Pe,qe;if(Ht==="exponential")ge=tu;else if(Ht==="interval")ge=tc;else if(Ht==="categorical"){ge=Fl,Pe=Object.create(null);for(var Ye=0,xr=d.stops;Ye<xr.length;Ye+=1){var Ir=xr[Ye];Pe[Ir[0]]=Ir[1]}qe=typeof d.stops[0][0]}else if(Ht==="identity")ge=Uu;else throw new Error('Unknown function type "'+Ht+'"');if(ft){for(var Fr={},en=[],kn=0;kn<d.stops.length;kn++){var Zn=d.stops[kn],Hn=Zn[0].zoom;Fr[Hn]===void 0&&(Fr[Hn]={zoom:Hn,type:d.type,property:d.property,default:d.default,stops:[]},en.push(Hn)),Fr[Hn].stops.push([Zn[0].value,Zn[1]])}for(var aa=[],ma=0,ra=en;ma<ra.length;ma+=1){var Ea=ra[ma];aa.push([Fr[Ea].zoom,Tl(Fr[Ea],z)])}var Za={name:"linear"};return{kind:"composite",interpolationType:Za,interpolationFactor:cl.interpolationFactor.bind(void 0,Za),zoomStops:aa.map(function(si){return si[0]}),evaluate:function(si,Wi){var Zi=si.zoom;return tu({stops:aa,base:d.base},z,Zi).evaluate(Zi,Wi)}}}else if(It){var oi=Ht==="exponential"?{name:"exponential",base:d.base!==void 0?d.base:1}:null;return{kind:"camera",interpolationType:oi,interpolationFactor:cl.interpolationFactor.bind(void 0,oi),zoomStops:d.stops.map(function(si){return si[0]}),evaluate:function(si){var Wi=si.zoom;return ge(d,z,Wi,Pe,qe)}}}else return{kind:"source",evaluate:function(si,Wi){var Zi=Wi&&Wi.properties?Wi.properties[d.property]:void 0;return Zi===void 0?Kl(d.default,z.default):ge(d,z,Zi,Pe,qe)}}}function Kl(d,z,H){if(d!==void 0)return d;if(z!==void 0)return z;if(H!==void 0)return H}function Fl(d,z,H,ft,kt){var It=typeof H===kt?ft[H]:void 0;return Kl(It,d.default,z.default)}function tc(d,z,H){if(to(H)!=="number")return Kl(d.default,z.default);var ft=d.stops.length;if(ft===1||H<=d.stops[0][0])return d.stops[0][1];if(H>=d.stops[ft-1][0])return d.stops[ft-1][1];var kt=yu(d.stops.map(function(It){return It[0]}),H);return d.stops[kt][1]}function tu(d,z,H){var ft=d.base!==void 0?d.base:1;if(to(H)!=="number")return Kl(d.default,z.default);var kt=d.stops.length;if(kt===1||H<=d.stops[0][0])return d.stops[0][1];if(H>=d.stops[kt-1][0])return d.stops[kt-1][1];var It=yu(d.stops.map(function(xr){return xr[0]}),H),Ht=$s(H,ft,d.stops[It][0],d.stops[It+1][0]),ge=d.stops[It][1],Pe=d.stops[It+1][1],qe=Yu[z.type]||Qo;if(d.colorSpace&&d.colorSpace!=="rgb"){var Ye=wh[d.colorSpace];qe=function(xr,Ir){return Ye.reverse(Ye.interpolate(Ye.forward(xr),Ye.forward(Ir),Ht))}}return typeof ge.evaluate=="function"?{evaluate:function(){for(var xr=[],Ir=arguments.length;Ir--;)xr[Ir]=arguments[Ir];var Fr=ge.evaluate.apply(void 0,xr),en=Pe.evaluate.apply(void 0,xr);if(!(Fr===void 0||en===void 0))return qe(Fr,en,Ht)}}:qe(ge,Pe,Ht)}function Uu(d,z,H){return z.type==="color"?H=ns.parse(H):z.type==="formatted"?H=ll.fromString(H.toString()):z.type==="resolvedImage"?H=el.fromString(H.toString()):to(H)!==z.type&&(z.type!=="enum"||!z.values[H])&&(H=void 0),Kl(H,d.default,z.default)}function $s(d,z,H,ft){var kt=ft-H,It=d-H;return kt===0?0:z===1?It/kt:(Math.pow(z,It)-1)/(Math.pow(z,kt)-1)}var ec=function(d,z){this.expression=d,this._warningHistory={},this._evaluator=new as,this._defaultValue=z?Tt(z):null,this._enumValues=z&&z.type==="enum"?z.values:null};ec.prototype.evaluateWithoutErrorHandling=function(d,z,H,ft,kt,It){return this._evaluator.globals=d,this._evaluator.feature=z,this._evaluator.featureState=H,this._evaluator.canonical=ft,this._evaluator.availableImages=kt||null,this._evaluator.formattedSection=It,this.expression.evaluate(this._evaluator)},ec.prototype.evaluate=function(d,z,H,ft,kt,It){this._evaluator.globals=d,this._evaluator.feature=z||null,this._evaluator.featureState=H||null,this._evaluator.canonical=ft,this._evaluator.availableImages=kt||null,this._evaluator.formattedSection=It||null;try{var Ht=this.expression.evaluate(this._evaluator);if(Ht==null||typeof Ht=="number"&&Ht!==Ht)return this._defaultValue;if(this._enumValues&&!(Ht in this._enumValues))throw new ks("Expected value to be one of "+Object.keys(this._enumValues).map(function(ge){return JSON.stringify(ge)}).join(", ")+", but found "+JSON.stringify(Ht)+" instead.");return Ht}catch(ge){return this._warningHistory[ge.message]||(this._warningHistory[ge.message]=!0,typeof console<"u"&&console.warn(ge.message)),this._defaultValue}};function Ri(d){return Array.isArray(d)&&d.length>0&&typeof d[0]=="string"&&d[0]in $i}function oo(d,z){var H=new Xs($i,[],z?_t(z):void 0),ft=H.parse(d,void 0,void 0,void 0,z&&z.type==="string"?{typeAnnotation:"coerce"}:void 0);return ft?No(new ec(ft,z)):Qs(H.errors)}var bu=function(d,z){this.kind=d,this._styleExpression=z,this.isStateDependent=d!=="constant"&&!Il(z.expression)};bu.prototype.evaluateWithoutErrorHandling=function(d,z,H,ft,kt,It){return this._styleExpression.evaluateWithoutErrorHandling(d,z,H,ft,kt,It)},bu.prototype.evaluate=function(d,z,H,ft,kt,It){return this._styleExpression.evaluate(d,z,H,ft,kt,It)};var Cl=function(d,z,H,ft){this.kind=d,this.zoomStops=H,this._styleExpression=z,this.isStateDependent=d!=="camera"&&!Il(z.expression),this.interpolationType=ft};Cl.prototype.evaluateWithoutErrorHandling=function(d,z,H,ft,kt,It){return this._styleExpression.evaluateWithoutErrorHandling(d,z,H,ft,kt,It)},Cl.prototype.evaluate=function(d,z,H,ft,kt,It){return this._styleExpression.evaluate(d,z,H,ft,kt,It)},Cl.prototype.interpolationFactor=function(d,z,H){return this.interpolationType?cl.interpolationFactor(this.interpolationType,d,z,H):0};function Th(d,z){if(d=oo(d,z),d.result==="error")return d;var H=d.value.expression,ft=uh(H);if(!ft&&!Hs(z))return Qs([new Po("","data expressions not supported")]);var kt=Zl(H,["zoom"]);if(!kt&&!Ms(z))return Qs([new Po("","zoom expressions not supported")]);var It=at(H);if(!It&&!kt)return Qs([new Po("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(It instanceof Po)return Qs([It]);if(It instanceof cl&&!ni(z))return Qs([new Po("",'"interpolate" expressions cannot be used with this property')]);if(!It)return No(ft?new bu("constant",d.value):new bu("source",d.value));var Ht=It instanceof cl?It.interpolation:void 0;return No(ft?new Cl("camera",d.value,It.labels,Ht):new Cl("composite",d.value,It.labels,Ht))}var Lt=function(d,z){this._parameters=d,this._specification=z,fs(this,Tl(this._parameters,this._specification))};Lt.deserialize=function(d){return new Lt(d._parameters,d._specification)},Lt.serialize=function(d){return{_parameters:d._parameters,_specification:d._specification}};function P(d,z){if(ds(d))return new Lt(d,z);if(Ri(d)){var H=Th(d,z);if(H.result==="error")throw new Error(H.value.map(function(kt){return kt.key+": "+kt.message}).join(", "));return H.value}else{var ft=d;return typeof d=="string"&&z.type==="color"&&(ft=ns.parse(d)),{kind:"constant",evaluate:function(){return ft}}}}function at(d){var z=null;if(d instanceof Pu)z=at(d.result);else if(d instanceof Yl)for(var H=0,ft=d.args;H<ft.length;H+=1){var kt=ft[H];if(z=at(kt),z)break}else(d instanceof Xl||d instanceof cl)&&d.input instanceof io&&d.input.name==="zoom"&&(z=d);return z instanceof Po||d.eachChild(function(It){var Ht=at(It);Ht instanceof Po?z=Ht:!z&&Ht?z=new Po("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):z&&Ht&&z!==Ht&&(z=new Po("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),z}function _t(d){var z={color:Ro,string:Oi,number:za,enum:Oi,boolean:Bi,formatted:Zs,resolvedImage:Hl};return d.type==="array"?Us(z[d.value]||Ci,d.length):z[d.type]}function Tt(d){return d.type==="color"&&ds(d.default)?new ns(0,0,0,0):d.type==="color"?ns.parse(d.default)||null:d.default===void 0?null:d.default}function Pt(d){var z=d.key,H=d.value,ft=d.valueSpec||{},kt=d.objectElementValidators||{},It=d.style,Ht=d.styleSpec,ge=[],Pe=to(H);if(Pe!=="object")return[new Xa(z,H,"object expected, "+Pe+" found")];for(var qe in H){var Ye=qe.split(".")[0],xr=ft[Ye]||ft["*"],Ir=void 0;if(kt[Ye])Ir=kt[Ye];else if(ft[Ye])Ir=Uo;else if(kt["*"])Ir=kt["*"];else if(ft["*"])Ir=Uo;else{ge.push(new Xa(z,H[qe],'unknown property "'+qe+'"'));continue}ge=ge.concat(Ir({key:(z&&z+".")+qe,value:H[qe],valueSpec:xr,style:It,styleSpec:Ht,object:H,objectKey:qe},H))}for(var Fr in ft)kt[Fr]||ft[Fr].required&&ft[Fr].default===void 0&&H[Fr]===void 0&&ge.push(new Xa(z,H,'missing required property "'+Fr+'"'));return ge}function ie(d){var z=d.value,H=d.valueSpec,ft=d.style,kt=d.styleSpec,It=d.key,Ht=d.arrayElementValidator||Uo;if(to(z)!=="array")return[new Xa(It,z,"array expected, "+to(z)+" found")];if(H.length&&z.length!==H.length)return[new Xa(It,z,"array length "+H.length+" expected, length "+z.length+" found")];if(H["min-length"]&&z.length<H["min-length"])return[new Xa(It,z,"array length at least "+H["min-length"]+" expected, length "+z.length+" found")];var ge={type:H.value,values:H.values};kt.$version<7&&(ge.function=H.function),to(H.value)==="object"&&(ge=H.value);for(var Pe=[],qe=0;qe<z.length;qe++)Pe=Pe.concat(Ht({array:z,arrayIndex:qe,value:z[qe],valueSpec:ge,style:ft,styleSpec:kt,key:It+"["+qe+"]"}));return Pe}function de(d){var z=d.key,H=d.value,ft=d.valueSpec,kt=to(H);return kt==="number"&&H!==H&&(kt="NaN"),kt!=="number"?[new Xa(z,H,"number expected, "+kt+" found")]:"minimum"in ft&&H<ft.minimum?[new Xa(z,H,H+" is less than the minimum value "+ft.minimum)]:"maximum"in ft&&H>ft.maximum?[new Xa(z,H,H+" is greater than the maximum value "+ft.maximum)]:[]}function Ee(d){var z=d.valueSpec,H=qi(d.value.type),ft,kt={},It,Ht,ge=H!=="categorical"&&d.value.property===void 0,Pe=!ge,qe=to(d.value.stops)==="array"&&to(d.value.stops[0])==="array"&&to(d.value.stops[0][0])==="object",Ye=Pt({key:d.key,value:d.value,valueSpec:d.styleSpec.function,style:d.style,styleSpec:d.styleSpec,objectElementValidators:{stops:xr,default:en}});return H==="identity"&&ge&&Ye.push(new Xa(d.key,d.value,'missing required property "property"')),H!=="identity"&&!d.value.stops&&Ye.push(new Xa(d.key,d.value,'missing required property "stops"')),H==="exponential"&&d.valueSpec.expression&&!ni(d.valueSpec)&&Ye.push(new Xa(d.key,d.value,"exponential functions not supported")),d.styleSpec.$version>=8&&(Pe&&!Hs(d.valueSpec)?Ye.push(new Xa(d.key,d.value,"property functions not supported")):ge&&!Ms(d.valueSpec)&&Ye.push(new Xa(d.key,d.value,"zoom functions not supported"))),(H==="categorical"||qe)&&d.value.property===void 0&&Ye.push(new Xa(d.key,d.value,'"property" property is required')),Ye;function xr(kn){if(H==="identity")return[new Xa(kn.key,kn.value,'identity function may not have a "stops" property')];var Zn=[],Hn=kn.value;return Zn=Zn.concat(ie({key:kn.key,value:Hn,valueSpec:kn.valueSpec,style:kn.style,styleSpec:kn.styleSpec,arrayElementValidator:Ir})),to(Hn)==="array"&&Hn.length===0&&Zn.push(new Xa(kn.key,Hn,"array must have at least one stop")),Zn}function Ir(kn){var Zn=[],Hn=kn.value,aa=kn.key;if(to(Hn)!=="array")return[new Xa(aa,Hn,"array expected, "+to(Hn)+" found")];if(Hn.length!==2)return[new Xa(aa,Hn,"array length 2 expected, length "+Hn.length+" found")];if(qe){if(to(Hn[0])!=="object")return[new Xa(aa,Hn,"object expected, "+to(Hn[0])+" found")];if(Hn[0].zoom===void 0)return[new Xa(aa,Hn,"object stop key must have zoom")];if(Hn[0].value===void 0)return[new Xa(aa,Hn,"object stop key must have value")];if(Ht&&Ht>qi(Hn[0].zoom))return[new Xa(aa,Hn[0].zoom,"stop zoom values must appear in ascending order")];qi(Hn[0].zoom)!==Ht&&(Ht=qi(Hn[0].zoom),It=void 0,kt={}),Zn=Zn.concat(Pt({key:aa+"[0]",value:Hn[0],valueSpec:{zoom:{}},style:kn.style,styleSpec:kn.styleSpec,objectElementValidators:{zoom:de,value:Fr}}))}else Zn=Zn.concat(Fr({key:aa+"[0]",value:Hn[0],valueSpec:{},style:kn.style,styleSpec:kn.styleSpec},Hn));return Ri(ms(Hn[1]))?Zn.concat([new Xa(aa+"[1]",Hn[1],"expressions are not allowed in function stops.")]):Zn.concat(Uo({key:aa+"[1]",value:Hn[1],valueSpec:z,style:kn.style,styleSpec:kn.styleSpec}))}function Fr(kn,Zn){var Hn=to(kn.value),aa=qi(kn.value),ma=kn.value!==null?kn.value:Zn;if(!ft)ft=Hn;else if(Hn!==ft)return[new Xa(kn.key,ma,Hn+" stop domain type must match previous stop domain type "+ft)];if(Hn!=="number"&&Hn!=="string"&&Hn!=="boolean")return[new Xa(kn.key,ma,"stop domain value must be a number, string, or boolean")];if(Hn!=="number"&&H!=="categorical"){var ra="number expected, "+Hn+" found";return Hs(z)&&H===void 0&&(ra+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Xa(kn.key,ma,ra)]}return H==="categorical"&&Hn==="number"&&(!isFinite(aa)||Math.floor(aa)!==aa)?[new Xa(kn.key,ma,"integer expected, found "+aa)]:H!=="categorical"&&Hn==="number"&&It!==void 0&&aa<It?[new Xa(kn.key,ma,"stop domain values must appear in ascending order")]:(It=aa,H==="categorical"&&aa in kt?[new Xa(kn.key,ma,"stop domain values must be unique")]:(kt[aa]=!0,[]))}function en(kn){return Uo({key:kn.key,value:kn.value,valueSpec:z,style:kn.style,styleSpec:kn.styleSpec})}}function He(d){var z=(d.expressionContext==="property"?Th:oo)(ms(d.value),d.valueSpec);if(z.result==="error")return z.value.map(function(ft){return new Xa(""+d.key+ft.key,d.value,ft.message)});var H=z.value.expression||z.value._styleExpression.expression;if(d.expressionContext==="property"&&d.propertyKey==="text-font"&&!H.outputDefined())return[new Xa(d.key,d.value,'Invalid data expression for "'+d.propertyKey+'". Output values must be contained as literals within the expression.')];if(d.expressionContext==="property"&&d.propertyType==="layout"&&!Il(H))return[new Xa(d.key,d.value,'"feature-state" data expressions are not supported with layout properties.')];if(d.expressionContext==="filter"&&!Il(H))return[new Xa(d.key,d.value,'"feature-state" data expressions are not supported with filters.')];if(d.expressionContext&&d.expressionContext.indexOf("cluster")===0){if(!Zl(H,["zoom","feature-state"]))return[new Xa(d.key,d.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(d.expressionContext==="cluster-initial"&&!uh(H))return[new Xa(d.key,d.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ar(d){var z=d.value,H=d.key,ft=to(z);return ft!=="boolean"?[new Xa(H,z,"boolean expected, "+ft+" found")]:[]}function ir(d){var z=d.key,H=d.value,ft=to(H);return ft!=="string"?[new Xa(z,H,"color expected, "+ft+" found")]:ih(H)===null?[new Xa(z,H,'color expected, "'+H+'" found')]:[]}function zr(d){var z=d.key,H=d.value,ft=d.valueSpec,kt=[];return Array.isArray(ft.values)?ft.values.indexOf(qi(H))===-1&&kt.push(new Xa(z,H,"expected one of ["+ft.values.join(", ")+"], "+JSON.stringify(H)+" found")):Object.keys(ft.values).indexOf(qi(H))===-1&&kt.push(new Xa(z,H,"expected one of ["+Object.keys(ft.values).join(", ")+"], "+JSON.stringify(H)+" found")),kt}function Zr(d){if(d===!0||d===!1)return!0;if(!Array.isArray(d)||d.length===0)return!1;switch(d[0]){case"has":return d.length>=2&&d[1]!=="$id"&&d[1]!=="$type";case"in":return d.length>=3&&(typeof d[1]!="string"||Array.isArray(d[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return d.length!==3||Array.isArray(d[1])||Array.isArray(d[2]);case"any":case"all":for(var z=0,H=d.slice(1);z<H.length;z+=1){var ft=H[z];if(!Zr(ft)&&typeof ft!="boolean")return!1}return!0;default:return!0}}var Rt={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Gt(d){if(d==null)return{filter:function(){return!0},needGeometry:!1};Zr(d)||(d=be(d));var z=oo(d,Rt);if(z.result==="error")throw new Error(z.value.map(function(ft){return ft.key+": "+ft.message}).join(", "));var H=oe(d);return{filter:function(ft,kt,It){return z.value.evaluate(ft,kt,{},It)},needGeometry:H}}function ne(d,z){return d<z?-1:d>z?1:0}function oe(d){if(!Array.isArray(d))return!1;if(d[0]==="within")return!0;for(var z=1;z<d.length;z++)if(oe(d[z]))return!0;return!1}function be(d){if(!d)return!0;var z=d[0];if(d.length<=1)return z!=="any";var H=z==="=="?pe(d[1],d[2],"=="):z==="!="?or(pe(d[1],d[2],"==")):z==="<"||z===">"||z==="<="||z===">="?pe(d[1],d[2],z):z==="any"?Ae(d.slice(1)):z==="all"?["all"].concat(d.slice(1).map(be)):z==="none"?["all"].concat(d.slice(1).map(be).map(or)):z==="in"?Xe(d[1],d.slice(2)):z==="!in"?or(Xe(d[1],d.slice(2))):z==="has"?nr(d[1]):z==="!has"?or(nr(d[1])):z==="within"?d:!0;return H}function pe(d,z,H){switch(d){case"$type":return["filter-type-"+H,z];case"$id":return["filter-id-"+H,z];default:return["filter-"+H,d,z]}}function Ae(d){return["any"].concat(d.map(be))}function Xe(d,z){if(z.length===0)return!1;switch(d){case"$type":return["filter-type-in",["literal",z]];case"$id":return["filter-id-in",["literal",z]];default:return z.length>200&&!z.some(function(H){return typeof H!=typeof z[0]})?["filter-in-large",d,["literal",z.sort(ne)]]:["filter-in-small",d,["literal",z]]}}function nr(d){switch(d){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",d]}}function or(d){return["!",d]}function Tr(d){return Zr(ms(d.value))?He(fs({},d,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Rr(d)}function Rr(d){var z=d.value,H=d.key;if(to(z)!=="array")return[new Xa(H,z,"array expected, "+to(z)+" found")];var ft=d.styleSpec,kt,It=[];if(z.length<1)return[new Xa(H,z,"filter array must have at least 1 element")];switch(It=It.concat(zr({key:H+"[0]",value:z[0],valueSpec:ft.filter_operator,style:d.style,styleSpec:d.styleSpec})),qi(z[0])){case"<":case"<=":case">":case">=":z.length>=2&&qi(z[1])==="$type"&&It.push(new Xa(H,z,'"$type" cannot be use with operator "'+z[0]+'"'));case"==":case"!=":z.length!==3&&It.push(new Xa(H,z,'filter array for operator "'+z[0]+'" must have 3 elements'));case"in":case"!in":z.length>=2&&(kt=to(z[1]),kt!=="string"&&It.push(new Xa(H+"[1]",z[1],"string expected, "+kt+" found")));for(var Ht=2;Ht<z.length;Ht++)kt=to(z[Ht]),qi(z[1])==="$type"?It=It.concat(zr({key:H+"["+Ht+"]",value:z[Ht],valueSpec:ft.geometry_type,style:d.style,styleSpec:d.styleSpec})):kt!=="string"&&kt!=="number"&&kt!=="boolean"&&It.push(new Xa(H+"["+Ht+"]",z[Ht],"string, number, or boolean expected, "+kt+" found"));break;case"any":case"all":case"none":for(var ge=1;ge<z.length;ge++)It=It.concat(Rr({key:H+"["+ge+"]",value:z[ge],style:d.style,styleSpec:d.styleSpec}));break;case"has":case"!has":kt=to(z[1]),z.length!==2?It.push(new Xa(H,z,'filter array for "'+z[0]+'" operator must have 2 elements')):kt!=="string"&&It.push(new Xa(H+"[1]",z[1],"string expected, "+kt+" found"));break;case"within":kt=to(z[1]),z.length!==2?It.push(new Xa(H,z,'filter array for "'+z[0]+'" operator must have 2 elements')):kt!=="object"&&It.push(new Xa(H+"[1]",z[1],"object expected, "+kt+" found"));break}return It}function Qr(d,z){var H=d.key,ft=d.style,kt=d.styleSpec,It=d.value,Ht=d.objectKey,ge=kt[z+"_"+d.layerType];if(!ge)return[];var Pe=Ht.match(/^(.*)-transition$/);if(z==="paint"&&Pe&&ge[Pe[1]]&&ge[Pe[1]].transition)return Uo({key:H,value:It,valueSpec:kt.transition,style:ft,styleSpec:kt});var qe=d.valueSpec||ge[Ht];if(!qe)return[new Xa(H,It,'unknown property "'+Ht+'"')];var Ye;if(to(It)==="string"&&Hs(qe)&&!qe.tokens&&(Ye=/^{([^}]+)}$/.exec(It)))return[new Xa(H,It,'"'+Ht+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(Ye[1])+" }`.")];var xr=[];return d.layerType==="symbol"&&(Ht==="text-field"&&ft&&!ft.glyphs&&xr.push(new Xa(H,It,'use of "text-field" requires a style "glyphs" property')),Ht==="text-font"&&ds(ms(It))&&qi(It.type)==="identity"&&xr.push(new Xa(H,It,'"text-font" does not support identity functions'))),xr.concat(Uo({key:d.key,value:It,valueSpec:qe,style:ft,styleSpec:kt,expressionContext:"property",propertyType:z,propertyKey:Ht}))}function nn(d){return Qr(d,"paint")}function mn(d){return Qr(d,"layout")}function zn(d){var z=[],H=d.value,ft=d.key,kt=d.style,It=d.styleSpec;!H.type&&!H.ref&&z.push(new Xa(ft,H,'either "type" or "ref" is required'));var Ht=qi(H.type),ge=qi(H.ref);if(H.id)for(var Pe=qi(H.id),qe=0;qe<d.arrayIndex;qe++){var Ye=kt.layers[qe];qi(Ye.id)===Pe&&z.push(new Xa(ft,H.id,'duplicate layer id "'+H.id+'", previously used at line '+Ye.id.__line__))}if("ref"in H){["type","source","source-layer","filter","layout"].forEach(function(en){en in H&&z.push(new Xa(ft,H[en],'"'+en+'" is prohibited for ref layers'))});var xr;kt.layers.forEach(function(en){qi(en.id)===ge&&(xr=en)}),xr?xr.ref?z.push(new Xa(ft,H.ref,"ref cannot reference another ref layer")):Ht=qi(xr.type):z.push(new Xa(ft,H.ref,'ref layer "'+ge+'" not found'))}else if(Ht!=="background")if(!H.source)z.push(new Xa(ft,H,'missing required property "source"'));else{var Ir=kt.sources&&kt.sources[H.source],Fr=Ir&&qi(Ir.type);Ir?Fr==="vector"&&Ht==="raster"?z.push(new Xa(ft,H.source,'layer "'+H.id+'" requires a raster source')):Fr==="raster"&&Ht!=="raster"?z.push(new Xa(ft,H.source,'layer "'+H.id+'" requires a vector source')):Fr==="vector"&&!H["source-layer"]?z.push(new Xa(ft,H,'layer "'+H.id+'" must specify a "source-layer"')):Fr==="raster-dem"&&Ht!=="hillshade"?z.push(new Xa(ft,H.source,"raster-dem source can only be used with layer type 'hillshade'.")):Ht==="line"&&H.paint&&H.paint["line-gradient"]&&(Fr!=="geojson"||!Ir.lineMetrics)&&z.push(new Xa(ft,H,'layer "'+H.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):z.push(new Xa(ft,H.source,'source "'+H.source+'" not found'))}return z=z.concat(Pt({key:ft,value:H,valueSpec:It.layer,style:d.style,styleSpec:d.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Uo({key:ft+".type",value:H.type,valueSpec:It.layer.type,style:d.style,styleSpec:d.styleSpec,object:H,objectKey:"type"})},filter:Tr,layout:function(en){return Pt({layer:H,key:en.key,value:en.value,style:en.style,styleSpec:en.styleSpec,objectElementValidators:{"*":function(kn){return mn(fs({layerType:Ht},kn))}}})},paint:function(en){return Pt({layer:H,key:en.key,value:en.value,style:en.style,styleSpec:en.styleSpec,objectElementValidators:{"*":function(kn){return nn(fs({layerType:Ht},kn))}}})}}})),z}function na(d){var z=d.value,H=d.key,ft=to(z);return ft!=="string"?[new Xa(H,z,"string expected, "+ft+" found")]:[]}var Yn={promoteId:Na};function la(d){var z=d.value,H=d.key,ft=d.styleSpec,kt=d.style;if(!z.type)return[new Xa(H,z,'"type" is required')];var It=qi(z.type),Ht;switch(It){case"vector":case"raster":case"raster-dem":return Ht=Pt({key:H,value:z,valueSpec:ft["source_"+It.replace("-","_")],style:d.style,styleSpec:ft,objectElementValidators:Yn}),Ht;case"geojson":if(Ht=Pt({key:H,value:z,valueSpec:ft.source_geojson,style:kt,styleSpec:ft,objectElementValidators:Yn}),z.cluster)for(var ge in z.clusterProperties){var Pe=z.clusterProperties[ge],qe=Pe[0],Ye=Pe[1],xr=typeof qe=="string"?[qe,["accumulated"],["get",ge]]:qe;Ht.push.apply(Ht,He({key:H+"."+ge+".map",value:Ye,expressionContext:"cluster-map"})),Ht.push.apply(Ht,He({key:H+"."+ge+".reduce",value:xr,expressionContext:"cluster-reduce"}))}return Ht;case"video":return Pt({key:H,value:z,valueSpec:ft.source_video,style:kt,styleSpec:ft});case"image":return Pt({key:H,value:z,valueSpec:ft.source_image,style:kt,styleSpec:ft});case"canvas":return[new Xa(H,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return zr({key:H+".type",value:z.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:kt,styleSpec:ft})}}function Na(d){var z=d.key,H=d.value;if(to(H)==="string")return na({key:z,value:H});var ft=[];for(var kt in H)ft.push.apply(ft,na({key:z+"."+kt,value:H[kt]}));return ft}function li(d){var z=d.value,H=d.styleSpec,ft=H.light,kt=d.style,It=[],Ht=to(z);if(z===void 0)return It;if(Ht!=="object")return It=It.concat([new Xa("light",z,"object expected, "+Ht+" found")]),It;for(var ge in z){var Pe=ge.match(/^(.*)-transition$/);Pe&&ft[Pe[1]]&&ft[Pe[1]].transition?It=It.concat(Uo({key:ge,value:z[ge],valueSpec:H.transition,style:kt,styleSpec:H})):ft[ge]?It=It.concat(Uo({key:ge,value:z[ge],valueSpec:ft[ge],style:kt,styleSpec:H})):It=It.concat([new Xa(ge,z[ge],'unknown property "'+ge+'"')])}return It}function Ka(d){return na(d).length===0?[]:He(d)}function Gi(d){return na(d).length===0?[]:He(d)}var jo={"*":function(){return[]},array:ie,boolean:ar,number:de,color:ir,constants:Ls,enum:zr,filter:Tr,function:Ee,layer:zn,object:Pt,source:la,light:li,string:na,formatted:Ka,resolvedImage:Gi};function Uo(d){var z=d.value,H=d.valueSpec,ft=d.styleSpec;if(H.expression&&ds(qi(z)))return Ee(d);if(H.expression&&Ri(ms(z)))return He(d);if(H.type&&jo[H.type])return jo[H.type](d);var kt=Pt(fs({},d,{valueSpec:H.type?ft[H.type]:H}));return kt}function ho(d){var z=d.value,H=d.key,ft=na(d);return ft.length||(z.indexOf("{fontstack}")===-1&&ft.push(new Xa(H,z,'"glyphs" url must include a "{fontstack}" token')),z.indexOf("{range}")===-1&&ft.push(new Xa(H,z,'"glyphs" url must include a "{range}" token'))),ft}function Go(d,z){z===void 0&&(z=ga);var H=[];return H=H.concat(Uo({key:"",value:d,valueSpec:z.$root,styleSpec:z,style:d,objectElementValidators:{glyphs:ho,"*":function(){return[]}}})),d.constants&&(H=H.concat(Ls({key:"constants",value:d.constants,style:d,styleSpec:z}))),js(H)}Go.source=Is(la),Go.light=Is(li),Go.layer=Is(zn),Go.filter=Is(Tr),Go.paintProperty=Is(nn),Go.layoutProperty=Is(mn);function js(d){return[].concat(d).sort(function(z,H){return z.line-H.line})}function Is(d){return function(){for(var z=[],H=arguments.length;H--;)z[H]=arguments[H];return js(d.apply(this,z))}}var bo=Go,wo=bo.light,nl=bo.paintProperty,dl=bo.layoutProperty;function lu(d,z){var H=!1;if(z&&z.length)for(var ft=0,kt=z;ft<kt.length;ft+=1){var It=kt[ft];d.fire(new Dr(new Error(It.message))),H=!0}return H}var mt=Xt,St=3;function Xt(d,z,H){var ft=this.cells=[];if(d instanceof ArrayBuffer){this.arrayBuffer=d;var kt=new Int32Array(this.arrayBuffer);d=kt[0],z=kt[1],H=kt[2],this.d=z+2*H;for(var It=0;It<this.d*this.d;It++){var Ht=kt[St+It],ge=kt[St+It+1];ft.push(Ht===ge?null:kt.subarray(Ht,ge))}var Pe=kt[St+ft.length],qe=kt[St+ft.length+1];this.keys=kt.subarray(Pe,qe),this.bboxes=kt.subarray(qe),this.insert=this._insertReadonly}else{this.d=z+2*H;for(var Ye=0;Ye<this.d*this.d;Ye++)ft.push([]);this.keys=[],this.bboxes=[]}this.n=z,this.extent=d,this.padding=H,this.scale=z/d,this.uid=0;var xr=H/z*d;this.min=-xr,this.max=d+xr}Xt.prototype.insert=function(d,z,H,ft,kt){this._forEachCell(z,H,ft,kt,this._insertCell,this.uid++),this.keys.push(d),this.bboxes.push(z),this.bboxes.push(H),this.bboxes.push(ft),this.bboxes.push(kt)},Xt.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Xt.prototype._insertCell=function(d,z,H,ft,kt,It){this.cells[kt].push(It)},Xt.prototype.query=function(d,z,H,ft,kt){var It=this.min,Ht=this.max;if(d<=It&&z<=It&&Ht<=H&&Ht<=ft&&!kt)return Array.prototype.slice.call(this.keys);var ge=[],Pe={};return this._forEachCell(d,z,H,ft,this._queryCell,ge,Pe,kt),ge},Xt.prototype._queryCell=function(d,z,H,ft,kt,It,Ht,ge){var Pe=this.cells[kt];if(Pe!==null)for(var qe=this.keys,Ye=this.bboxes,xr=0;xr<Pe.length;xr++){var Ir=Pe[xr];if(Ht[Ir]===void 0){var Fr=Ir*4;(ge?ge(Ye[Fr+0],Ye[Fr+1],Ye[Fr+2],Ye[Fr+3]):d<=Ye[Fr+2]&&z<=Ye[Fr+3]&&H>=Ye[Fr+0]&&ft>=Ye[Fr+1])?(Ht[Ir]=!0,It.push(qe[Ir])):Ht[Ir]=!1}}},Xt.prototype._forEachCell=function(d,z,H,ft,kt,It,Ht,ge){for(var Pe=this._convertToCellCoord(d),qe=this._convertToCellCoord(z),Ye=this._convertToCellCoord(H),xr=this._convertToCellCoord(ft),Ir=Pe;Ir<=Ye;Ir++)for(var Fr=qe;Fr<=xr;Fr++){var en=this.d*Fr+Ir;if(!(ge&&!ge(this._convertFromCellCoord(Ir),this._convertFromCellCoord(Fr),this._convertFromCellCoord(Ir+1),this._convertFromCellCoord(Fr+1)))&&kt.call(this,d,z,H,ft,en,It,Ht,ge))return}},Xt.prototype._convertFromCellCoord=function(d){return(d-this.padding)/this.scale},Xt.prototype._convertToCellCoord=function(d){return Math.max(0,Math.min(this.d-1,Math.floor(d*this.scale)+this.padding))},Xt.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var d=this.cells,z=St+this.cells.length+1+1,H=0,ft=0;ft<this.cells.length;ft++)H+=this.cells[ft].length;var kt=new Int32Array(z+H+this.keys.length+this.bboxes.length);kt[0]=this.extent,kt[1]=this.n,kt[2]=this.padding;for(var It=z,Ht=0;Ht<d.length;Ht++){var ge=d[Ht];kt[St+Ht]=It,kt.set(ge,It),It+=ge.length}return kt[St+d.length]=It,kt.set(this.keys,It),It+=this.keys.length,kt[St+d.length+1]=It,kt.set(this.bboxes,It),It+=this.bboxes.length,kt.buffer};var se=s.ImageData,fe=s.ImageBitmap,ve={};function De(d,z,H){H===void 0&&(H={}),Object.defineProperty(z,"_classRegistryKey",{value:d,writeable:!1}),ve[d]={klass:z,omit:H.omit||[],shallow:H.shallow||[]}}De("Object",Object),mt.serialize=function(d,z){var H=d.toArrayBuffer();return z&&z.push(H),{buffer:H}},mt.deserialize=function(d){return new mt(d.buffer)},De("Grid",mt),De("Color",ns),De("Error",Error),De("ResolvedImage",el),De("StylePropertyFunction",Lt),De("StyleExpression",ec,{omit:["_evaluator"]}),De("ZoomDependentExpression",Cl),De("ZoomConstantExpression",bu),De("CompoundExpression",io,{omit:["_evaluate"]});for(var Ce in $i)$i[Ce]._classRegistryKey||De("Expression_"+Ce,$i[Ce]);function Qe(d){return d&&typeof ArrayBuffer<"u"&&(d instanceof ArrayBuffer||d.constructor&&d.constructor.name==="ArrayBuffer")}function Mr(d){return fe&&d instanceof fe}function br(d,z){if(d==null||typeof d=="boolean"||typeof d=="number"||typeof d=="string"||d instanceof Boolean||d instanceof Number||d instanceof String||d instanceof Date||d instanceof RegExp)return d;if(Qe(d)||Mr(d))return z&&z.push(d),d;if(ArrayBuffer.isView(d)){var H=d;return z&&z.push(H.buffer),H}if(d instanceof se)return z&&z.push(d.data.buffer),d;if(Array.isArray(d)){for(var ft=[],kt=0,It=d;kt<It.length;kt+=1){var Ht=It[kt];ft.push(br(Ht,z))}return ft}if(typeof d=="object"){var ge=d.constructor,Pe=ge._classRegistryKey;if(!Pe)throw new Error("can't serialize object of unregistered class");var qe=ge.serialize?ge.serialize(d,z):{};if(!ge.serialize){for(var Ye in d)if(d.hasOwnProperty(Ye)&&!(ve[Pe].omit.indexOf(Ye)>=0)){var xr=d[Ye];qe[Ye]=ve[Pe].shallow.indexOf(Ye)>=0?xr:br(xr,z)}d instanceof Error&&(qe.message=d.message)}if(qe.$name)throw new Error("$name property is reserved for worker serialization logic.");return Pe!=="Object"&&(qe.$name=Pe),qe}throw new Error("can't serialize object of type "+typeof d)}function jr(d){if(d==null||typeof d=="boolean"||typeof d=="number"||typeof d=="string"||d instanceof Boolean||d instanceof Number||d instanceof String||d instanceof Date||d instanceof RegExp||Qe(d)||Mr(d)||ArrayBuffer.isView(d)||d instanceof se)return d;if(Array.isArray(d))return d.map(jr);if(typeof d=="object"){var z=d.$name||"Object",H=ve[z],ft=H.klass;if(!ft)throw new Error("can't deserialize unregistered class "+z);if(ft.deserialize)return ft.deserialize(d);for(var kt=Object.create(ft.prototype),It=0,Ht=Object.keys(d);It<Ht.length;It+=1){var ge=Ht[It];if(ge!=="$name"){var Pe=d[ge];kt[ge]=ve[z].shallow.indexOf(ge)>=0?Pe:jr(Pe)}}return kt}throw new Error("can't deserialize object of type "+typeof d)}var Yr=function(){this.first=!0};Yr.prototype.update=function(d,z){var H=Math.floor(d);return this.first?(this.first=!1,this.lastIntegerZoom=H,this.lastIntegerZoomTime=0,this.lastZoom=d,this.lastFloorZoom=H,!0):(this.lastFloorZoom>H?(this.lastIntegerZoom=H+1,this.lastIntegerZoomTime=z):this.lastFloorZoom<H&&(this.lastIntegerZoom=H,this.lastIntegerZoomTime=z),d!==this.lastZoom?(this.lastZoom=d,this.lastFloorZoom=H,!0):!1)};var tn={"Latin-1 Supplement":function(d){return d>=128&&d<=255},Arabic:function(d){return d>=1536&&d<=1791},"Arabic Supplement":function(d){return d>=1872&&d<=1919},"Arabic Extended-A":function(d){return d>=2208&&d<=2303},"Hangul Jamo":function(d){return d>=4352&&d<=4607},"Unified Canadian Aboriginal Syllabics":function(d){return d>=5120&&d<=5759},Khmer:function(d){return d>=6016&&d<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(d){return d>=6320&&d<=6399},"General Punctuation":function(d){return d>=8192&&d<=8303},"Letterlike Symbols":function(d){return d>=8448&&d<=8527},"Number Forms":function(d){return d>=8528&&d<=8591},"Miscellaneous Technical":function(d){return d>=8960&&d<=9215},"Control Pictures":function(d){return d>=9216&&d<=9279},"Optical Character Recognition":function(d){return d>=9280&&d<=9311},"Enclosed Alphanumerics":function(d){return d>=9312&&d<=9471},"Geometric Shapes":function(d){return d>=9632&&d<=9727},"Miscellaneous Symbols":function(d){return d>=9728&&d<=9983},"Miscellaneous Symbols and Arrows":function(d){return d>=11008&&d<=11263},"CJK Radicals Supplement":function(d){return d>=11904&&d<=12031},"Kangxi Radicals":function(d){return d>=12032&&d<=12255},"Ideographic Description Characters":function(d){return d>=12272&&d<=12287},"CJK Symbols and Punctuation":function(d){return d>=12288&&d<=12351},Hiragana:function(d){return d>=12352&&d<=12447},Katakana:function(d){return d>=12448&&d<=12543},Bopomofo:function(d){return d>=12544&&d<=12591},"Hangul Compatibility Jamo":function(d){return d>=12592&&d<=12687},Kanbun:function(d){return d>=12688&&d<=12703},"Bopomofo Extended":function(d){return d>=12704&&d<=12735},"CJK Strokes":function(d){return d>=12736&&d<=12783},"Katakana Phonetic Extensions":function(d){return d>=12784&&d<=12799},"Enclosed CJK Letters and Months":function(d){return d>=12800&&d<=13055},"CJK Compatibility":function(d){return d>=13056&&d<=13311},"CJK Unified Ideographs Extension A":function(d){return d>=13312&&d<=19903},"Yijing Hexagram Symbols":function(d){return d>=19904&&d<=19967},"CJK Unified Ideographs":function(d){return d>=19968&&d<=40959},"Yi Syllables":function(d){return d>=40960&&d<=42127},"Yi Radicals":function(d){return d>=42128&&d<=42191},"Hangul Jamo Extended-A":function(d){return d>=43360&&d<=43391},"Hangul Syllables":function(d){return d>=44032&&d<=55215},"Hangul Jamo Extended-B":function(d){return d>=55216&&d<=55295},"Private Use Area":function(d){return d>=57344&&d<=63743},"CJK Compatibility Ideographs":function(d){return d>=63744&&d<=64255},"Arabic Presentation Forms-A":function(d){return d>=64336&&d<=65023},"Vertical Forms":function(d){return d>=65040&&d<=65055},"CJK Compatibility Forms":function(d){return d>=65072&&d<=65103},"Small Form Variants":function(d){return d>=65104&&d<=65135},"Arabic Presentation Forms-B":function(d){return d>=65136&&d<=65279},"Halfwidth and Fullwidth Forms":function(d){return d>=65280&&d<=65519}};function Rn(d){for(var z=0,H=d;z<H.length;z+=1){var ft=H[z];if(Dn(ft.charCodeAt(0)))return!0}return!1}function sn(d){for(var z=0,H=d;z<H.length;z+=1){var ft=H[z];if(!Mn(ft.charCodeAt(0)))return!1}return!0}function Mn(d){return!(tn.Arabic(d)||tn["Arabic Supplement"](d)||tn["Arabic Extended-A"](d)||tn["Arabic Presentation Forms-A"](d)||tn["Arabic Presentation Forms-B"](d))}function In(d){return d<11904?!1:!!(tn["Bopomofo Extended"](d)||tn.Bopomofo(d)||tn["CJK Compatibility Forms"](d)||tn["CJK Compatibility Ideographs"](d)||tn["CJK Compatibility"](d)||tn["CJK Radicals Supplement"](d)||tn["CJK Strokes"](d)||tn["CJK Symbols and Punctuation"](d)||tn["CJK Unified Ideographs Extension A"](d)||tn["CJK Unified Ideographs"](d)||tn["Enclosed CJK Letters and Months"](d)||tn["Halfwidth and Fullwidth Forms"](d)||tn.Hiragana(d)||tn["Ideographic Description Characters"](d)||tn["Kangxi Radicals"](d)||tn["Katakana Phonetic Extensions"](d)||tn.Katakana(d)||tn["Vertical Forms"](d)||tn["Yi Radicals"](d)||tn["Yi Syllables"](d))}function Dn(d){return d===746||d===747?!0:d<4352?!1:!!(tn["Bopomofo Extended"](d)||tn.Bopomofo(d)||tn["CJK Compatibility Forms"](d)&&!(d>=65097&&d<=65103)||tn["CJK Compatibility Ideographs"](d)||tn["CJK Compatibility"](d)||tn["CJK Radicals Supplement"](d)||tn["CJK Strokes"](d)||tn["CJK Symbols and Punctuation"](d)&&!(d>=12296&&d<=12305)&&!(d>=12308&&d<=12319)&&d!==12336||tn["CJK Unified Ideographs Extension A"](d)||tn["CJK Unified Ideographs"](d)||tn["Enclosed CJK Letters and Months"](d)||tn["Hangul Compatibility Jamo"](d)||tn["Hangul Jamo Extended-A"](d)||tn["Hangul Jamo Extended-B"](d)||tn["Hangul Jamo"](d)||tn["Hangul Syllables"](d)||tn.Hiragana(d)||tn["Ideographic Description Characters"](d)||tn.Kanbun(d)||tn["Kangxi Radicals"](d)||tn["Katakana Phonetic Extensions"](d)||tn.Katakana(d)&&d!==12540||tn["Halfwidth and Fullwidth Forms"](d)&&d!==65288&&d!==65289&&d!==65293&&!(d>=65306&&d<=65310)&&d!==65339&&d!==65341&&d!==65343&&!(d>=65371&&d<=65503)&&d!==65507&&!(d>=65512&&d<=65519)||tn["Small Form Variants"](d)&&!(d>=65112&&d<=65118)&&!(d>=65123&&d<=65126)||tn["Unified Canadian Aboriginal Syllabics"](d)||tn["Unified Canadian Aboriginal Syllabics Extended"](d)||tn["Vertical Forms"](d)||tn["Yijing Hexagram Symbols"](d)||tn["Yi Syllables"](d)||tn["Yi Radicals"](d))}function jn(d){return!!(tn["Latin-1 Supplement"](d)&&(d===167||d===169||d===174||d===177||d===188||d===189||d===190||d===215||d===247)||tn["General Punctuation"](d)&&(d===8214||d===8224||d===8225||d===8240||d===8241||d===8251||d===8252||d===8258||d===8263||d===8264||d===8265||d===8273)||tn["Letterlike Symbols"](d)||tn["Number Forms"](d)||tn["Miscellaneous Technical"](d)&&(d>=8960&&d<=8967||d>=8972&&d<=8991||d>=8996&&d<=9e3||d===9003||d>=9085&&d<=9114||d>=9150&&d<=9165||d===9167||d>=9169&&d<=9179||d>=9186&&d<=9215)||tn["Control Pictures"](d)&&d!==9251||tn["Optical Character Recognition"](d)||tn["Enclosed Alphanumerics"](d)||tn["Geometric Shapes"](d)||tn["Miscellaneous Symbols"](d)&&!(d>=9754&&d<=9759)||tn["Miscellaneous Symbols and Arrows"](d)&&(d>=11026&&d<=11055||d>=11088&&d<=11097||d>=11192&&d<=11243)||tn["CJK Symbols and Punctuation"](d)||tn.Katakana(d)||tn["Private Use Area"](d)||tn["CJK Compatibility Forms"](d)||tn["Small Form Variants"](d)||tn["Halfwidth and Fullwidth Forms"](d)||d===8734||d===8756||d===8757||d>=9984&&d<=10087||d>=10102&&d<=10131||d===65532||d===65533)}function xn(d){return!(Dn(d)||jn(d))}function _a(d){return tn.Arabic(d)||tn["Arabic Supplement"](d)||tn["Arabic Extended-A"](d)||tn["Arabic Presentation Forms-A"](d)||tn["Arabic Presentation Forms-B"](d)}function La(d){return d>=1424&&d<=2303||tn["Arabic Presentation Forms-A"](d)||tn["Arabic Presentation Forms-B"](d)}function $a(d,z){return!(!z&&La(d)||d>=2304&&d<=3583||d>=3840&&d<=4255||tn.Khmer(d))}function ti(d){for(var z=0,H=d;z<H.length;z+=1){var ft=H[z];if(La(ft.charCodeAt(0)))return!0}return!1}function ii(d,z){for(var H=0,ft=d;H<ft.length;H+=1){var kt=ft[H];if(!$a(kt.charCodeAt(0),z))return!1}return!0}var di={unavailable:"unavailable",deferred:"deferred",loading:"loading",loaded:"loaded",error:"error"},Io=null,gi=di.unavailable,Ji=null,qo=function(d){d&&typeof d=="string"&&d.indexOf("NetworkError")>-1&&(gi=di.error),Io&&Io(d)};function Ys(){_s.fire(new Er("pluginStateChange",{pluginStatus:gi,pluginURL:Ji}))}var _s=new Ar,Ja=function(){return gi},yo=function(d){return d({pluginStatus:gi,pluginURL:Ji}),_s.on("pluginStateChange",d),d},Lo=function(d,z,H){if(H===void 0&&(H=!1),gi===di.deferred||gi===di.loading||gi===di.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ji=wt.resolveURL(d),gi=di.deferred,Io=z,Ys(),H||bs()},bs=function(){if(gi!==di.deferred||!Ji)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");gi=di.loading,Ys(),Ji&&rn({url:Ji},function(d){d?qo(d):(gi=di.loaded,Ys())})},us={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return gi===di.loaded||us.applyArabicShaping!=null},isLoading:function(){return gi===di.loading},setState:function(d){gi=d.pluginStatus,Ji=d.pluginURL},isParsed:function(){return us.applyArabicShaping!=null&&us.processBidirectionalText!=null&&us.processStyledBidirectionalText!=null},getPluginURL:function(){return Ji}},eu=function(){!us.isLoading()&&!us.isLoaded()&&Ja()==="deferred"&&bs()},Yo=function(d,z){this.zoom=d,z?(this.now=z.now,this.fadeDuration=z.fadeDuration,this.zoomHistory=z.zoomHistory,this.transition=z.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Yr,this.transition={})};Yo.prototype.isSupportedScript=function(d){return ii(d,us.isLoaded())},Yo.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Yo.prototype.getCrossfadeParameters=function(){var d=this.zoom,z=d-Math.floor(d),H=this.crossFadingFactor();return d>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:z+(1-z)*H}:{fromScale:.5,toScale:1,t:1-(1-H)*z}};var gs=function(d,z){this.property=d,this.value=z,this.expression=P(z===void 0?d.specification.default:z,d.specification)};gs.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},gs.prototype.possiblyEvaluate=function(d,z,H){return this.property.possiblyEvaluate(this,d,z,H)};var wu=function(d){this.property=d,this.value=new gs(d,void 0)};wu.prototype.transitioned=function(d,z){return new fn(this.property,this.value,z,M({},d.transition,this.transition),d.now)},wu.prototype.untransitioned=function(){return new fn(this.property,this.value,null,{},0)};var sr=function(d){this._properties=d,this._values=Object.create(d.defaultTransitionablePropertyValues)};sr.prototype.getValue=function(d){return L(this._values[d].value.value)},sr.prototype.setValue=function(d,z){this._values.hasOwnProperty(d)||(this._values[d]=new wu(this._values[d].property)),this._values[d].value=new gs(this._values[d].property,z===null?void 0:L(z))},sr.prototype.getTransition=function(d){return L(this._values[d].transition)},sr.prototype.setTransition=function(d,z){this._values.hasOwnProperty(d)||(this._values[d]=new wu(this._values[d].property)),this._values[d].transition=L(z)||void 0},sr.prototype.serialize=function(){for(var d={},z=0,H=Object.keys(this._values);z<H.length;z+=1){var ft=H[z],kt=this.getValue(ft);kt!==void 0&&(d[ft]=kt);var It=this.getTransition(ft);It!==void 0&&(d[ft+"-transition"]=It)}return d},sr.prototype.transitioned=function(d,z){for(var H=new gn(this._properties),ft=0,kt=Object.keys(this._values);ft<kt.length;ft+=1){var It=kt[ft];H._values[It]=this._values[It].transitioned(d,z._values[It])}return H},sr.prototype.untransitioned=function(){for(var d=new gn(this._properties),z=0,H=Object.keys(this._values);z<H.length;z+=1){var ft=H[z];d._values[ft]=this._values[ft].untransitioned()}return d};var fn=function(d,z,H,ft,kt){this.property=d,this.value=z,this.begin=kt+ft.delay||0,this.end=this.begin+ft.duration||0,d.specification.transition&&(ft.delay||ft.duration)&&(this.prior=H)};fn.prototype.possiblyEvaluate=function(d,z,H){var ft=d.now||0,kt=this.value.possiblyEvaluate(d,z,H),It=this.prior;if(It){if(ft>this.end)return this.prior=null,kt;if(this.value.isDataDriven())return this.prior=null,kt;if(ft<this.begin)return It.possiblyEvaluate(d,z,H);var Ht=(ft-this.begin)/(this.end-this.begin);return this.property.interpolate(It.possiblyEvaluate(d,z,H),kt,m(Ht))}else return kt};var gn=function(d){this._properties=d,this._values=Object.create(d.defaultTransitioningPropertyValues)};gn.prototype.possiblyEvaluate=function(d,z,H){for(var ft=new ka(this._properties),kt=0,It=Object.keys(this._values);kt<It.length;kt+=1){var Ht=It[kt];ft._values[Ht]=this._values[Ht].possiblyEvaluate(d,z,H)}return ft},gn.prototype.hasTransition=function(){for(var d=0,z=Object.keys(this._values);d<z.length;d+=1){var H=z[d];if(this._values[H].prior)return!0}return!1};var ha=function(d){this._properties=d,this._values=Object.create(d.defaultPropertyValues)};ha.prototype.getValue=function(d){return L(this._values[d].value)},ha.prototype.setValue=function(d,z){this._values[d]=new gs(this._values[d].property,z===null?void 0:L(z))},ha.prototype.serialize=function(){for(var d={},z=0,H=Object.keys(this._values);z<H.length;z+=1){var ft=H[z],kt=this.getValue(ft);kt!==void 0&&(d[ft]=kt)}return d},ha.prototype.possiblyEvaluate=function(d,z,H){for(var ft=new ka(this._properties),kt=0,It=Object.keys(this._values);kt<It.length;kt+=1){var Ht=It[kt];ft._values[Ht]=this._values[Ht].possiblyEvaluate(d,z,H)}return ft};var Ta=function(d,z,H){this.property=d,this.value=z,this.parameters=H};Ta.prototype.isConstant=function(){return this.value.kind==="constant"},Ta.prototype.constantOr=function(d){return this.value.kind==="constant"?this.value.value:d},Ta.prototype.evaluate=function(d,z,H,ft){return this.property.evaluate(this.value,this.parameters,d,z,H,ft)};var ka=function(d){this._properties=d,this._values=Object.create(d.defaultPossiblyEvaluatedValues)};ka.prototype.get=function(d){return this._values[d]};var Cn=function(d){this.specification=d};Cn.prototype.possiblyEvaluate=function(d,z){return d.expression.evaluate(z)},Cn.prototype.interpolate=function(d,z,H){var ft=Yu[this.specification.type];return ft?ft(d,z,H):d};var ia=function(d,z){this.specification=d,this.overrides=z};ia.prototype.possiblyEvaluate=function(d,z,H,ft){return d.expression.kind==="constant"||d.expression.kind==="camera"?new Ta(this,{kind:"constant",value:d.expression.evaluate(z,null,{},H,ft)},z):new Ta(this,d.expression,z)},ia.prototype.interpolate=function(d,z,H){if(d.value.kind!=="constant"||z.value.kind!=="constant")return d;if(d.value.value===void 0||z.value.value===void 0)return new Ta(this,{kind:"constant",value:void 0},d.parameters);var ft=Yu[this.specification.type];return ft?new Ta(this,{kind:"constant",value:ft(d.value.value,z.value.value,H)},d.parameters):d},ia.prototype.evaluate=function(d,z,H,ft,kt,It){return d.kind==="constant"?d.value:d.evaluate(z,H,ft,kt,It)};var qa=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.possiblyEvaluate=function(H,ft,kt,It){if(H.value===void 0)return new Ta(this,{kind:"constant",value:void 0},ft);if(H.expression.kind==="constant"){var Ht=H.expression.evaluate(ft,null,{},kt,It),ge=H.property.specification.type==="resolvedImage",Pe=ge&&typeof Ht!="string"?Ht.name:Ht,qe=this._calculate(Pe,Pe,Pe,ft);return new Ta(this,{kind:"constant",value:qe},ft)}else if(H.expression.kind==="camera"){var Ye=this._calculate(H.expression.evaluate({zoom:ft.zoom-1}),H.expression.evaluate({zoom:ft.zoom}),H.expression.evaluate({zoom:ft.zoom+1}),ft);return new Ta(this,{kind:"constant",value:Ye},ft)}else return new Ta(this,H.expression,ft)},z.prototype.evaluate=function(H,ft,kt,It,Ht,ge){if(H.kind==="source"){var Pe=H.evaluate(ft,kt,It,Ht,ge);return this._calculate(Pe,Pe,Pe,ft)}else return H.kind==="composite"?this._calculate(H.evaluate({zoom:Math.floor(ft.zoom)-1},kt,It),H.evaluate({zoom:Math.floor(ft.zoom)},kt,It),H.evaluate({zoom:Math.floor(ft.zoom)+1},kt,It),ft):H.value},z.prototype._calculate=function(H,ft,kt,It){var Ht=It.zoom;return Ht>It.zoomHistory.lastIntegerZoom?{from:H,to:ft}:{from:kt,to:ft}},z.prototype.interpolate=function(H){return H},z}(ia),Ra=function(d){this.specification=d};Ra.prototype.possiblyEvaluate=function(d,z,H,ft){if(d.value!==void 0)if(d.expression.kind==="constant"){var kt=d.expression.evaluate(z,null,{},H,ft);return this._calculate(kt,kt,kt,z)}else return this._calculate(d.expression.evaluate(new Yo(Math.floor(z.zoom-1),z)),d.expression.evaluate(new Yo(Math.floor(z.zoom),z)),d.expression.evaluate(new Yo(Math.floor(z.zoom+1),z)),z)},Ra.prototype._calculate=function(d,z,H,ft){var kt=ft.zoom;return kt>ft.zoomHistory.lastIntegerZoom?{from:d,to:z}:{from:H,to:z}},Ra.prototype.interpolate=function(d){return d};var ei=function(d){this.specification=d};ei.prototype.possiblyEvaluate=function(d,z,H,ft){return!!d.expression.evaluate(z,null,{},H,ft)},ei.prototype.interpolate=function(){return!1};var Ii=function(d){this.properties=d,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var z in d){var H=d[z];H.specification.overridable&&this.overridableProperties.push(z);var ft=this.defaultPropertyValues[z]=new gs(H,void 0),kt=this.defaultTransitionablePropertyValues[z]=new wu(H);this.defaultTransitioningPropertyValues[z]=kt.untransitioned(),this.defaultPossiblyEvaluatedValues[z]=ft.possiblyEvaluate({})}};De("DataDrivenProperty",ia),De("DataConstantProperty",Cn),De("CrossFadedDataDrivenProperty",qa),De("CrossFadedProperty",Ra),De("ColorRampProperty",ei);var wi="-transition",Ha=function(d){function z(H,ft){if(d.call(this),this.id=H.id,this.type=H.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},H.type!=="custom"&&(H=H,this.metadata=H.metadata,this.minzoom=H.minzoom,this.maxzoom=H.maxzoom,H.type!=="background"&&(this.source=H.source,this.sourceLayer=H["source-layer"],this.filter=H.filter),ft.layout&&(this._unevaluatedLayout=new ha(ft.layout)),ft.paint)){this._transitionablePaint=new sr(ft.paint);for(var kt in H.paint)this.setPaintProperty(kt,H.paint[kt],{validate:!1});for(var It in H.layout)this.setLayoutProperty(It,H.layout[It],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ka(ft.paint)}}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},z.prototype.getLayoutProperty=function(H){return H==="visibility"?this.visibility:this._unevaluatedLayout.getValue(H)},z.prototype.setLayoutProperty=function(H,ft,kt){if(kt===void 0&&(kt={}),ft!=null){var It="layers."+this.id+".layout."+H;if(this._validate(dl,It,H,ft,kt))return}if(H==="visibility"){this.visibility=ft;return}this._unevaluatedLayout.setValue(H,ft)},z.prototype.getPaintProperty=function(H){return O(H,wi)?this._transitionablePaint.getTransition(H.slice(0,-wi.length)):this._transitionablePaint.getValue(H)},z.prototype.setPaintProperty=function(H,ft,kt){if(kt===void 0&&(kt={}),ft!=null){var It="layers."+this.id+".paint."+H;if(this._validate(nl,It,H,ft,kt))return!1}if(O(H,wi))return this._transitionablePaint.setTransition(H.slice(0,-wi.length),ft||void 0),!1;var Ht=this._transitionablePaint._values[H],ge=Ht.property.specification["property-type"]==="cross-faded-data-driven",Pe=Ht.value.isDataDriven(),qe=Ht.value;this._transitionablePaint.setValue(H,ft),this._handleSpecialPaintPropertyUpdate(H);var Ye=this._transitionablePaint._values[H].value,xr=Ye.isDataDriven();return xr||Pe||ge||this._handleOverridablePaintPropertyUpdate(H,qe,Ye)},z.prototype._handleSpecialPaintPropertyUpdate=function(H){},z.prototype._handleOverridablePaintPropertyUpdate=function(H,ft,kt){return!1},z.prototype.isHidden=function(H){return this.minzoom&&H<this.minzoom||this.maxzoom&&H>=this.maxzoom?!0:this.visibility==="none"},z.prototype.updateTransitions=function(H){this._transitioningPaint=this._transitionablePaint.transitioned(H,this._transitioningPaint)},z.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},z.prototype.recalculate=function(H,ft){H.getCrossfadeParameters&&(this._crossfadeParameters=H.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(H,void 0,ft)),this.paint=this._transitioningPaint.possiblyEvaluate(H,void 0,ft)},z.prototype.serialize=function(){var H={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&&(H.layout=H.layout||{},H.layout.visibility=this.visibility),R(H,function(ft,kt){return ft!==void 0&&!(kt==="layout"&&!Object.keys(ft).length)&&!(kt==="paint"&&!Object.keys(ft).length)})},z.prototype._validate=function(H,ft,kt,It,Ht){return Ht===void 0&&(Ht={}),Ht&&Ht.validate===!1?!1:lu(this,H.call(bo,{key:ft,layerType:this.type,objectKey:kt,value:It,styleSpec:ga,style:{glyphs:!0,sprite:!0}}))},z.prototype.is3D=function(){return!1},z.prototype.isTileClipped=function(){return!1},z.prototype.hasOffscreenPass=function(){return!1},z.prototype.resize=function(){},z.prototype.isStateDependent=function(){for(var H in this.paint._values){var ft=this.paint.get(H);if(!(!(ft instanceof Ta)||!Hs(ft.property.specification))&&(ft.value.kind==="source"||ft.value.kind==="composite")&&ft.value.isStateDependent)return!0}return!1},z}(Ar),Ca={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Wn=function(d,z){this._structArray=d,this._pos1=z*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},fa=128,Ga=5,Aa=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Aa.serialize=function(d,z){return d._trim(),z&&(d.isTransferred=!0,z.push(d.arrayBuffer)),{length:d.length,arrayBuffer:d.arrayBuffer}},Aa.deserialize=function(d){var z=Object.create(this.prototype);return z.arrayBuffer=d.arrayBuffer,z.length=d.length,z.capacity=d.arrayBuffer.byteLength/z.bytesPerElement,z._refreshViews(),z},Aa.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Aa.prototype.clear=function(){this.length=0},Aa.prototype.resize=function(d){this.reserve(d),this.length=d},Aa.prototype.reserve=function(d){if(d>this.capacity){this.capacity=Math.max(d,Math.floor(this.capacity*Ga),fa),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var z=this.uint8;this._refreshViews(),z&&this.uint8.set(z)}},Aa.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function xa(d,z){z===void 0&&(z=1);var H=0,ft=0,kt=d.map(function(Ht){var ge=Ti(Ht.type),Pe=H=fi(H,Math.max(z,ge)),qe=Ht.components||1;return ft=Math.max(ft,ge),H+=ge*qe,{name:Ht.name,type:Ht.type,components:qe,offset:Pe}}),It=fi(H,Math.max(ft,z));return{members:kt,size:It,alignment:z}}function Ti(d){return Ca[d].BYTES_PER_ELEMENT}function fi(d,z){return Math.ceil(d/z)*z}var _i=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft){var kt=this.length;return this.resize(kt+1),this.emplace(kt,H,ft)},z.prototype.emplace=function(H,ft,kt){var It=H*2;return this.int16[It+0]=ft,this.int16[It+1]=kt,H},z}(Aa);_i.prototype.bytesPerElement=4,De("StructArrayLayout2i4",_i);var Ia=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt,It){var Ht=this.length;return this.resize(Ht+1),this.emplace(Ht,H,ft,kt,It)},z.prototype.emplace=function(H,ft,kt,It,Ht){var ge=H*4;return this.int16[ge+0]=ft,this.int16[ge+1]=kt,this.int16[ge+2]=It,this.int16[ge+3]=Ht,H},z}(Aa);Ia.prototype.bytesPerElement=8,De("StructArrayLayout4i8",Ia);var Ma=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt,It,Ht,ge){var Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,H,ft,kt,It,Ht,ge)},z.prototype.emplace=function(H,ft,kt,It,Ht,ge,Pe){var qe=H*6;return this.int16[qe+0]=ft,this.int16[qe+1]=kt,this.int16[qe+2]=It,this.int16[qe+3]=Ht,this.int16[qe+4]=ge,this.int16[qe+5]=Pe,H},z}(Aa);Ma.prototype.bytesPerElement=12,De("StructArrayLayout2i4i12",Ma);var ki=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt,It,Ht,ge){var Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,H,ft,kt,It,Ht,ge)},z.prototype.emplace=function(H,ft,kt,It,Ht,ge,Pe){var qe=H*4,Ye=H*8;return this.int16[qe+0]=ft,this.int16[qe+1]=kt,this.uint8[Ye+4]=It,this.uint8[Ye+5]=Ht,this.uint8[Ye+6]=ge,this.uint8[Ye+7]=Pe,H},z}(Aa);ki.prototype.bytesPerElement=8,De("StructArrayLayout2i4ub8",ki);var hi=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft){var kt=this.length;return this.resize(kt+1),this.emplace(kt,H,ft)},z.prototype.emplace=function(H,ft,kt){var It=H*2;return this.float32[It+0]=ft,this.float32[It+1]=kt,H},z}(Aa);hi.prototype.bytesPerElement=8,De("StructArrayLayout2f8",hi);var Wa=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr){var Ir=this.length;return this.resize(Ir+1),this.emplace(Ir,H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr)},z.prototype.emplace=function(H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir){var Fr=H*10;return this.uint16[Fr+0]=ft,this.uint16[Fr+1]=kt,this.uint16[Fr+2]=It,this.uint16[Fr+3]=Ht,this.uint16[Fr+4]=ge,this.uint16[Fr+5]=Pe,this.uint16[Fr+6]=qe,this.uint16[Fr+7]=Ye,this.uint16[Fr+8]=xr,this.uint16[Fr+9]=Ir,H},z}(Aa);Wa.prototype.bytesPerElement=20,De("StructArrayLayout10ui20",Wa);var Qa=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir,Fr){var en=this.length;return this.resize(en+1),this.emplace(en,H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir,Fr)},z.prototype.emplace=function(H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir,Fr,en){var kn=H*12;return this.int16[kn+0]=ft,this.int16[kn+1]=kt,this.int16[kn+2]=It,this.int16[kn+3]=Ht,this.uint16[kn+4]=ge,this.uint16[kn+5]=Pe,this.uint16[kn+6]=qe,this.uint16[kn+7]=Ye,this.int16[kn+8]=xr,this.int16[kn+9]=Ir,this.int16[kn+10]=Fr,this.int16[kn+11]=en,H},z}(Aa);Qa.prototype.bytesPerElement=24,De("StructArrayLayout4i4ui4i24",Qa);var xi=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt){var It=this.length;return this.resize(It+1),this.emplace(It,H,ft,kt)},z.prototype.emplace=function(H,ft,kt,It){var Ht=H*3;return this.float32[Ht+0]=ft,this.float32[Ht+1]=kt,this.float32[Ht+2]=It,H},z}(Aa);xi.prototype.bytesPerElement=12,De("StructArrayLayout3f12",xi);var Wo=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H){var ft=this.length;return this.resize(ft+1),this.emplace(ft,H)},z.prototype.emplace=function(H,ft){var kt=H*1;return this.uint32[kt+0]=ft,H},z}(Aa);Wo.prototype.bytesPerElement=4,De("StructArrayLayout1ul4",Wo);var zo=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt,It,Ht,ge,Pe,qe,Ye){var xr=this.length;return this.resize(xr+1),this.emplace(xr,H,ft,kt,It,Ht,ge,Pe,qe,Ye)},z.prototype.emplace=function(H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr){var Ir=H*10,Fr=H*5;return this.int16[Ir+0]=ft,this.int16[Ir+1]=kt,this.int16[Ir+2]=It,this.int16[Ir+3]=Ht,this.int16[Ir+4]=ge,this.int16[Ir+5]=Pe,this.uint32[Fr+3]=qe,this.uint16[Ir+8]=Ye,this.uint16[Ir+9]=xr,H},z}(Aa);zo.prototype.bytesPerElement=20,De("StructArrayLayout6i1ul2ui20",zo);var mi=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt,It,Ht,ge){var Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,H,ft,kt,It,Ht,ge)},z.prototype.emplace=function(H,ft,kt,It,Ht,ge,Pe){var qe=H*6;return this.int16[qe+0]=ft,this.int16[qe+1]=kt,this.int16[qe+2]=It,this.int16[qe+3]=Ht,this.int16[qe+4]=ge,this.int16[qe+5]=Pe,H},z}(Aa);mi.prototype.bytesPerElement=12,De("StructArrayLayout2i2i2i12",mi);var Li=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt,It,Ht){var ge=this.length;return this.resize(ge+1),this.emplace(ge,H,ft,kt,It,Ht)},z.prototype.emplace=function(H,ft,kt,It,Ht,ge){var Pe=H*4,qe=H*8;return this.float32[Pe+0]=ft,this.float32[Pe+1]=kt,this.float32[Pe+2]=It,this.int16[qe+6]=Ht,this.int16[qe+7]=ge,H},z}(Aa);Li.prototype.bytesPerElement=16,De("StructArrayLayout2f1f2i16",Li);var mo=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt,It){var Ht=this.length;return this.resize(Ht+1),this.emplace(Ht,H,ft,kt,It)},z.prototype.emplace=function(H,ft,kt,It,Ht){var ge=H*12,Pe=H*3;return this.uint8[ge+0]=ft,this.uint8[ge+1]=kt,this.float32[Pe+1]=It,this.float32[Pe+2]=Ht,H},z}(Aa);mo.prototype.bytesPerElement=12,De("StructArrayLayout2ub2f12",mo);var Oo=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt){var It=this.length;return this.resize(It+1),this.emplace(It,H,ft,kt)},z.prototype.emplace=function(H,ft,kt,It){var Ht=H*3;return this.uint16[Ht+0]=ft,this.uint16[Ht+1]=kt,this.uint16[Ht+2]=It,H},z}(Aa);Oo.prototype.bytesPerElement=6,De("StructArrayLayout3ui6",Oo);var ss=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){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)},z.prototype.emplaceBack=function(H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir,Fr,en,kn,Zn,Hn,aa){var ma=this.length;return this.resize(ma+1),this.emplace(ma,H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir,Fr,en,kn,Zn,Hn,aa)},z.prototype.emplace=function(H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir,Fr,en,kn,Zn,Hn,aa,ma){var ra=H*24,Ea=H*12,Za=H*48;return this.int16[ra+0]=ft,this.int16[ra+1]=kt,this.uint16[ra+2]=It,this.uint16[ra+3]=Ht,this.uint32[Ea+2]=ge,this.uint32[Ea+3]=Pe,this.uint32[Ea+4]=qe,this.uint16[ra+10]=Ye,this.uint16[ra+11]=xr,this.uint16[ra+12]=Ir,this.float32[Ea+7]=Fr,this.float32[Ea+8]=en,this.uint8[Za+36]=kn,this.uint8[Za+37]=Zn,this.uint8[Za+38]=Hn,this.uint32[Ea+10]=aa,this.int16[ra+22]=ma,H},z}(Aa);ss.prototype.bytesPerElement=48,De("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ss);var ml=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){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)},z.prototype.emplaceBack=function(H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir,Fr,en,kn,Zn,Hn,aa,ma,ra,Ea,Za,oi,si,Wi,Zi,ro,fo,Eo){var no=this.length;return this.resize(no+1),this.emplace(no,H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir,Fr,en,kn,Zn,Hn,aa,ma,ra,Ea,Za,oi,si,Wi,Zi,ro,fo,Eo)},z.prototype.emplace=function(H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir,Fr,en,kn,Zn,Hn,aa,ma,ra,Ea,Za,oi,si,Wi,Zi,ro,fo,Eo,no){var co=H*34,Bs=H*17;return this.int16[co+0]=ft,this.int16[co+1]=kt,this.int16[co+2]=It,this.int16[co+3]=Ht,this.int16[co+4]=ge,this.int16[co+5]=Pe,this.int16[co+6]=qe,this.int16[co+7]=Ye,this.uint16[co+8]=xr,this.uint16[co+9]=Ir,this.uint16[co+10]=Fr,this.uint16[co+11]=en,this.uint16[co+12]=kn,this.uint16[co+13]=Zn,this.uint16[co+14]=Hn,this.uint16[co+15]=aa,this.uint16[co+16]=ma,this.uint16[co+17]=ra,this.uint16[co+18]=Ea,this.uint16[co+19]=Za,this.uint16[co+20]=oi,this.uint16[co+21]=si,this.uint16[co+22]=Wi,this.uint32[Bs+12]=Zi,this.float32[Bs+13]=ro,this.float32[Bs+14]=fo,this.float32[Bs+15]=Eo,this.float32[Bs+16]=no,H},z}(Aa);ml.prototype.bytesPerElement=68,De("StructArrayLayout8i15ui1ul4f68",ml);var Gs=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H){var ft=this.length;return this.resize(ft+1),this.emplace(ft,H)},z.prototype.emplace=function(H,ft){var kt=H*1;return this.float32[kt+0]=ft,H},z}(Aa);Gs.prototype.bytesPerElement=4,De("StructArrayLayout1f4",Gs);var ws=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt){var It=this.length;return this.resize(It+1),this.emplace(It,H,ft,kt)},z.prototype.emplace=function(H,ft,kt,It){var Ht=H*3;return this.int16[Ht+0]=ft,this.int16[Ht+1]=kt,this.int16[Ht+2]=It,H},z}(Aa);ws.prototype.bytesPerElement=6,De("StructArrayLayout3i6",ws);var ru=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt){var It=this.length;return this.resize(It+1),this.emplace(It,H,ft,kt)},z.prototype.emplace=function(H,ft,kt,It){var Ht=H*2,ge=H*4;return this.uint32[Ht+0]=ft,this.uint16[ge+2]=kt,this.uint16[ge+3]=It,H},z}(Aa);ru.prototype.bytesPerElement=8,De("StructArrayLayout1ul2ui8",ru);var al=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft){var kt=this.length;return this.resize(kt+1),this.emplace(kt,H,ft)},z.prototype.emplace=function(H,ft,kt){var It=H*2;return this.uint16[It+0]=ft,this.uint16[It+1]=kt,H},z}(Aa);al.prototype.bytesPerElement=4,De("StructArrayLayout2ui4",al);var Tu=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H){var ft=this.length;return this.resize(ft+1),this.emplace(ft,H)},z.prototype.emplace=function(H,ft){var kt=H*1;return this.uint16[kt+0]=ft,H},z}(Aa);Tu.prototype.bytesPerElement=2,De("StructArrayLayout1ui2",Tu);var lc=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},z.prototype.emplaceBack=function(H,ft,kt,It){var Ht=this.length;return this.resize(Ht+1),this.emplace(Ht,H,ft,kt,It)},z.prototype.emplace=function(H,ft,kt,It,Ht){var ge=H*4;return this.float32[ge+0]=ft,this.float32[ge+1]=kt,this.float32[ge+2]=It,this.float32[ge+3]=Ht,H},z}(Aa);lc.prototype.bytesPerElement=16,De("StructArrayLayout4f16",lc);var Fc=function(d){function z(){d.apply(this,arguments)}d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z;var H={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return H.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},H.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},H.x1.get=function(){return this._structArray.int16[this._pos2+2]},H.y1.get=function(){return this._structArray.int16[this._pos2+3]},H.x2.get=function(){return this._structArray.int16[this._pos2+4]},H.y2.get=function(){return this._structArray.int16[this._pos2+5]},H.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},H.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},H.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},H.anchorPoint.get=function(){return new o(this.anchorPointX,this.anchorPointY)},Object.defineProperties(z.prototype,H),z}(Wn);Fc.prototype.size=20;var Lu=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.get=function(H){return new Fc(this,H)},z}(zo);De("CollisionBoxArray",Lu);var nu=function(d){function z(){d.apply(this,arguments)}d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z;var H={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return H.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},H.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},H.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},H.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},H.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},H.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},H.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},H.segment.get=function(){return this._structArray.uint16[this._pos2+10]},H.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},H.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},H.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},H.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},H.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},H.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},H.placedOrientation.set=function(ft){this._structArray.uint8[this._pos1+37]=ft},H.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},H.hidden.set=function(ft){this._structArray.uint8[this._pos1+38]=ft},H.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},H.crossTileID.set=function(ft){this._structArray.uint32[this._pos4+10]=ft},H.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(z.prototype,H),z}(Wn);nu.prototype.size=48;var Cu=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.get=function(H){return new nu(this,H)},z}(ss);De("PlacedSymbolArray",Cu);var Xo=function(d){function z(){d.apply(this,arguments)}d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z;var H={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return H.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},H.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},H.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},H.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},H.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},H.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},H.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},H.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},H.key.get=function(){return this._structArray.uint16[this._pos2+8]},H.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},H.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},H.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},H.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},H.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},H.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},H.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},H.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},H.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},H.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},H.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},H.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},H.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},H.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},H.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},H.crossTileID.set=function(ft){this._structArray.uint32[this._pos4+12]=ft},H.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},H.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},H.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},H.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(z.prototype,H),z}(Wn);Xo.prototype.size=68;var uu=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.get=function(H){return new Xo(this,H)},z}(ml);De("SymbolInstanceArray",uu);var tl=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.getoffsetX=function(H){return this.float32[H*1+0]},z}(Gs);De("GlyphOffsetArray",tl);var au=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.getx=function(H){return this.int16[H*3+0]},z.prototype.gety=function(H){return this.int16[H*3+1]},z.prototype.gettileUnitDistanceFromAnchor=function(H){return this.int16[H*3+2]},z}(ws);De("SymbolLineVertexArray",au);var Bc=function(d){function z(){d.apply(this,arguments)}d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z;var H={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return H.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},H.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},H.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(z.prototype,H),z}(Wn);Bc.prototype.size=8;var Ho=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.get=function(H){return new Bc(this,H)},z}(ru);De("FeatureIndexArray",Ho);var Fs=xa([{name:"a_pos",components:2,type:"Int16"}],4),kl=Fs.members,zs=function(d){d===void 0&&(d=[]),this.segments=d};zs.prototype.prepareSegment=function(d,z,H,ft){var kt=this.segments[this.segments.length-1];return d>zs.MAX_VERTEX_ARRAY_LENGTH&&j("Max vertices per segment is "+zs.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+d),(!kt||kt.vertexLength+d>zs.MAX_VERTEX_ARRAY_LENGTH||kt.sortKey!==ft)&&(kt={vertexOffset:z.length,primitiveOffset:H.length,vertexLength:0,primitiveLength:0},ft!==void 0&&(kt.sortKey=ft),this.segments.push(kt)),kt},zs.prototype.get=function(){return this.segments},zs.prototype.destroy=function(){for(var d=0,z=this.segments;d<z.length;d+=1){var H=z[d];for(var ft in H.vaos)H.vaos[ft].destroy()}},zs.simpleSegment=function(d,z,H,ft){return new zs([{vertexOffset:d,primitiveOffset:z,vertexLength:H,primitiveLength:ft,vaos:{},sortKey:0}])},zs.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,De("SegmentVector",zs);function W(d,z){return d=l(Math.floor(d),0,255),z=l(Math.floor(z),0,255),256*d+z}var et=xa([{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"}]),K=e(function(d){function z(H,ft){var kt,It,Ht,ge,Pe,qe,Ye,xr;for(kt=H.length&3,It=H.length-kt,Ht=ft,Pe=3432918353,qe=461845907,xr=0;xr<It;)Ye=H.charCodeAt(xr)&255|(H.charCodeAt(++xr)&255)<<8|(H.charCodeAt(++xr)&255)<<16|(H.charCodeAt(++xr)&255)<<24,++xr,Ye=(Ye&65535)*Pe+(((Ye>>>16)*Pe&65535)<<16)&4294967295,Ye=Ye<<15|Ye>>>17,Ye=(Ye&65535)*qe+(((Ye>>>16)*qe&65535)<<16)&4294967295,Ht^=Ye,Ht=Ht<<13|Ht>>>19,ge=(Ht&65535)*5+(((Ht>>>16)*5&65535)<<16)&4294967295,Ht=(ge&65535)+27492+(((ge>>>16)+58964&65535)<<16);switch(Ye=0,kt){case 3:Ye^=(H.charCodeAt(xr+2)&255)<<16;case 2:Ye^=(H.charCodeAt(xr+1)&255)<<8;case 1:Ye^=H.charCodeAt(xr)&255,Ye=(Ye&65535)*Pe+(((Ye>>>16)*Pe&65535)<<16)&4294967295,Ye=Ye<<15|Ye>>>17,Ye=(Ye&65535)*qe+(((Ye>>>16)*qe&65535)<<16)&4294967295,Ht^=Ye}return Ht^=H.length,Ht^=Ht>>>16,Ht=(Ht&65535)*2246822507+(((Ht>>>16)*2246822507&65535)<<16)&4294967295,Ht^=Ht>>>13,Ht=(Ht&65535)*3266489909+(((Ht>>>16)*3266489909&65535)<<16)&4294967295,Ht^=Ht>>>16,Ht>>>0}d.exports=z}),pt=e(function(d){function z(H,ft){for(var kt=H.length,It=ft^kt,Ht=0,ge;kt>=4;)ge=H.charCodeAt(Ht)&255|(H.charCodeAt(++Ht)&255)<<8|(H.charCodeAt(++Ht)&255)<<16|(H.charCodeAt(++Ht)&255)<<24,ge=(ge&65535)*1540483477+(((ge>>>16)*1540483477&65535)<<16),ge^=ge>>>24,ge=(ge&65535)*1540483477+(((ge>>>16)*1540483477&65535)<<16),It=(It&65535)*1540483477+(((It>>>16)*1540483477&65535)<<16)^ge,kt-=4,++Ht;switch(kt){case 3:It^=(H.charCodeAt(Ht+2)&255)<<16;case 2:It^=(H.charCodeAt(Ht+1)&255)<<8;case 1:It^=H.charCodeAt(Ht)&255,It=(It&65535)*1540483477+(((It>>>16)*1540483477&65535)<<16)}return It^=It>>>13,It=(It&65535)*1540483477+(((It>>>16)*1540483477&65535)<<16),It^=It>>>15,It>>>0}d.exports=z}),Ct=K,Yt=K,ce=pt;Ct.murmur3=Yt,Ct.murmur2=ce;var re=function(){this.ids=[],this.positions=[],this.indexed=!1};re.prototype.add=function(d,z,H,ft){this.ids.push(Le(d)),this.positions.push(z,H,ft)},re.prototype.getPositions=function(d){for(var z=Le(d),H=0,ft=this.ids.length-1;H<ft;){var kt=H+ft>>1;this.ids[kt]>=z?ft=kt:H=kt+1}for(var It=[];this.ids[H]===z;){var Ht=this.positions[3*H],ge=this.positions[3*H+1],Pe=this.positions[3*H+2];It.push({index:Ht,start:ge,end:Pe}),H++}return It},re.serialize=function(d,z){var H=new Float64Array(d.ids),ft=new Uint32Array(d.positions);return tr(H,ft,0,H.length-1),z&&z.push(H.buffer,ft.buffer),{ids:H,positions:ft}},re.deserialize=function(d){var z=new re;return z.ids=d.ids,z.positions=d.positions,z.indexed=!0,z};var ye=Math.pow(2,53)-1;function Le(d){var z=+d;return!isNaN(z)&&z<=ye?z:Ct(String(d))}function tr(d,z,H,ft){for(;H<ft;){for(var kt=d[H+ft>>1],It=H-1,Ht=ft+1;;){do It++;while(d[It]<kt);do Ht--;while(d[Ht]>kt);if(It>=Ht)break;$e(d,It,Ht),$e(z,3*It,3*Ht),$e(z,3*It+1,3*Ht+1),$e(z,3*It+2,3*Ht+2)}Ht-H<ft-Ht?(tr(d,z,H,Ht),H=Ht+1):(tr(d,z,Ht+1,ft),ft=Ht)}}function $e(d,z,H){var ft=d[z];d[z]=d[H],d[H]=ft}De("FeaturePositionMap",re);var er=function(d,z){this.gl=d.gl,this.location=z},pr=function(d){function z(H,ft){d.call(this,H,ft),this.current=0}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.set=function(H){this.current!==H&&(this.current=H,this.gl.uniform1i(this.location,H))},z}(er),wr=function(d){function z(H,ft){d.call(this,H,ft),this.current=0}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.set=function(H){this.current!==H&&(this.current=H,this.gl.uniform1f(this.location,H))},z}(er),rr=function(d){function z(H,ft){d.call(this,H,ft),this.current=[0,0]}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.set=function(H){(H[0]!==this.current[0]||H[1]!==this.current[1])&&(this.current=H,this.gl.uniform2f(this.location,H[0],H[1]))},z}(er),cr=function(d){function z(H,ft){d.call(this,H,ft),this.current=[0,0,0]}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.set=function(H){(H[0]!==this.current[0]||H[1]!==this.current[1]||H[2]!==this.current[2])&&(this.current=H,this.gl.uniform3f(this.location,H[0],H[1],H[2]))},z}(er),hr=function(d){function z(H,ft){d.call(this,H,ft),this.current=[0,0,0,0]}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.set=function(H){(H[0]!==this.current[0]||H[1]!==this.current[1]||H[2]!==this.current[2]||H[3]!==this.current[3])&&(this.current=H,this.gl.uniform4f(this.location,H[0],H[1],H[2],H[3]))},z}(er),Vr=function(d){function z(H,ft){d.call(this,H,ft),this.current=ns.transparent}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.set=function(H){(H.r!==this.current.r||H.g!==this.current.g||H.b!==this.current.b||H.a!==this.current.a)&&(this.current=H,this.gl.uniform4f(this.location,H.r,H.g,H.b,H.a))},z}(er),yn=new Float32Array(16),wn=function(d){function z(H,ft){d.call(this,H,ft),this.current=yn}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.set=function(H){if(H[12]!==this.current[12]||H[0]!==this.current[0]){this.current=H,this.gl.uniformMatrix4fv(this.location,!1,H);return}for(var ft=1;ft<16;ft++)if(H[ft]!==this.current[ft]){this.current=H,this.gl.uniformMatrix4fv(this.location,!1,H);break}},z}(er);function $n(d){return[W(255*d.r,255*d.g),W(255*d.b,255*d.a)]}var Xn=function(d,z,H){this.value=d,this.uniformNames=z.map(function(ft){return"u_"+ft}),this.type=H};Xn.prototype.setUniform=function(d,z,H){d.set(H.constantOr(this.value))},Xn.prototype.getBinding=function(d,z,H){return this.type==="color"?new Vr(d,z):new wr(d,z)};var Vn=function(d,z){this.uniformNames=z.map(function(H){return"u_"+H}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Vn.prototype.setConstantPatternPositions=function(d,z){this.pixelRatioFrom=z.pixelRatio,this.pixelRatioTo=d.pixelRatio,this.patternFrom=z.tlbr,this.patternTo=d.tlbr},Vn.prototype.setUniform=function(d,z,H,ft){var kt=ft==="u_pattern_to"?this.patternTo:ft==="u_pattern_from"?this.patternFrom:ft==="u_pixel_ratio_to"?this.pixelRatioTo:ft==="u_pixel_ratio_from"?this.pixelRatioFrom:null;kt&&d.set(kt)},Vn.prototype.getBinding=function(d,z,H){return H.substr(0,9)==="u_pattern"?new hr(d,z):new wr(d,z)};var ca=function(d,z,H,ft){this.expression=d,this.type=H,this.maxValue=0,this.paintVertexAttributes=z.map(function(kt){return{name:"a_"+kt,type:"Float32",components:H==="color"?2:1,offset:0}}),this.paintVertexArray=new ft};ca.prototype.populatePaintArray=function(d,z,H,ft,kt){var It=this.paintVertexArray.length,Ht=this.expression.evaluate(new Yo(0),z,{},ft,[],kt);this.paintVertexArray.resize(d),this._setPaintValue(It,d,Ht)},ca.prototype.updatePaintArray=function(d,z,H,ft){var kt=this.expression.evaluate({zoom:0},H,ft);this._setPaintValue(d,z,kt)},ca.prototype._setPaintValue=function(d,z,H){if(this.type==="color")for(var ft=$n(H),kt=d;kt<z;kt++)this.paintVertexArray.emplace(kt,ft[0],ft[1]);else{for(var It=d;It<z;It++)this.paintVertexArray.emplace(It,H);this.maxValue=Math.max(this.maxValue,Math.abs(H))}},ca.prototype.upload=function(d){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=d.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ca.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var ea=function(d,z,H,ft,kt,It){this.expression=d,this.uniformNames=z.map(function(Ht){return"u_"+Ht+"_t"}),this.type=H,this.useIntegerZoom=ft,this.zoom=kt,this.maxValue=0,this.paintVertexAttributes=z.map(function(Ht){return{name:"a_"+Ht,type:"Float32",components:H==="color"?4:2,offset:0}}),this.paintVertexArray=new It};ea.prototype.populatePaintArray=function(d,z,H,ft,kt){var It=this.expression.evaluate(new Yo(this.zoom),z,{},ft,[],kt),Ht=this.expression.evaluate(new Yo(this.zoom+1),z,{},ft,[],kt),ge=this.paintVertexArray.length;this.paintVertexArray.resize(d),this._setPaintValue(ge,d,It,Ht)},ea.prototype.updatePaintArray=function(d,z,H,ft){var kt=this.expression.evaluate({zoom:this.zoom},H,ft),It=this.expression.evaluate({zoom:this.zoom+1},H,ft);this._setPaintValue(d,z,kt,It)},ea.prototype._setPaintValue=function(d,z,H,ft){if(this.type==="color")for(var kt=$n(H),It=$n(ft),Ht=d;Ht<z;Ht++)this.paintVertexArray.emplace(Ht,kt[0],kt[1],It[0],It[1]);else{for(var ge=d;ge<z;ge++)this.paintVertexArray.emplace(ge,H,ft);this.maxValue=Math.max(this.maxValue,Math.abs(H),Math.abs(ft))}},ea.prototype.upload=function(d){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=d.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ea.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},ea.prototype.setUniform=function(d,z){var H=this.useIntegerZoom?Math.floor(z.zoom):z.zoom,ft=l(this.expression.interpolationFactor(H,this.zoom,this.zoom+1),0,1);d.set(ft)},ea.prototype.getBinding=function(d,z,H){return new wr(d,z)};var wa=function(d,z,H,ft,kt,It){this.expression=d,this.type=z,this.useIntegerZoom=H,this.zoom=ft,this.layerId=It,this.zoomInPaintVertexArray=new kt,this.zoomOutPaintVertexArray=new kt};wa.prototype.populatePaintArray=function(d,z,H){var ft=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(d),this.zoomOutPaintVertexArray.resize(d),this._setPaintValues(ft,d,z.patterns&&z.patterns[this.layerId],H)},wa.prototype.updatePaintArray=function(d,z,H,ft,kt){this._setPaintValues(d,z,H.patterns&&H.patterns[this.layerId],kt)},wa.prototype._setPaintValues=function(d,z,H,ft){if(!(!ft||!H)){var kt=H.min,It=H.mid,Ht=H.max,ge=ft[kt],Pe=ft[It],qe=ft[Ht];if(!(!ge||!Pe||!qe))for(var Ye=d;Ye<z;Ye++)this.zoomInPaintVertexArray.emplace(Ye,Pe.tl[0],Pe.tl[1],Pe.br[0],Pe.br[1],ge.tl[0],ge.tl[1],ge.br[0],ge.br[1],Pe.pixelRatio,ge.pixelRatio),this.zoomOutPaintVertexArray.emplace(Ye,Pe.tl[0],Pe.tl[1],Pe.br[0],Pe.br[1],qe.tl[0],qe.tl[1],qe.br[0],qe.br[1],Pe.pixelRatio,qe.pixelRatio)}},wa.prototype.upload=function(d){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=d.createVertexBuffer(this.zoomInPaintVertexArray,et.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=d.createVertexBuffer(this.zoomOutPaintVertexArray,et.members,this.expression.isStateDependent))},wa.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var da=function(d,z,H){this.binders={},this._buffers=[];var ft=[];for(var kt in d.paint._values)if(H(kt)){var It=d.paint.get(kt);if(!(!(It instanceof Ta)||!Hs(It.property.specification))){var Ht=Ua(kt,d.type),ge=It.value,Pe=It.property.specification.type,qe=It.property.useIntegerZoom,Ye=It.property.specification["property-type"],xr=Ye==="cross-faded"||Ye==="cross-faded-data-driven";if(ge.kind==="constant")this.binders[kt]=xr?new Vn(ge.value,Ht):new Xn(ge.value,Ht,Pe),ft.push("/u_"+kt);else if(ge.kind==="source"||xr){var Ir=ui(kt,Pe,"source");this.binders[kt]=xr?new wa(ge,Pe,qe,z,Ir,d.id):new ca(ge,Ht,Pe,Ir),ft.push("/a_"+kt)}else{var Fr=ui(kt,Pe,"composite");this.binders[kt]=new ea(ge,Ht,Pe,qe,z,Fr),ft.push("/z_"+kt)}}}this.cacheKey=ft.sort().join("")};da.prototype.getMaxValue=function(d){var z=this.binders[d];return z instanceof ca||z instanceof ea?z.maxValue:0},da.prototype.populatePaintArrays=function(d,z,H,ft,kt){for(var It in this.binders){var Ht=this.binders[It];(Ht instanceof ca||Ht instanceof ea||Ht instanceof wa)&&Ht.populatePaintArray(d,z,H,ft,kt)}},da.prototype.setConstantPatternPositions=function(d,z){for(var H in this.binders){var ft=this.binders[H];ft instanceof Vn&&ft.setConstantPatternPositions(d,z)}},da.prototype.updatePaintArrays=function(d,z,H,ft,kt){var It=!1;for(var Ht in d)for(var ge=z.getPositions(Ht),Pe=0,qe=ge;Pe<qe.length;Pe+=1){var Ye=qe[Pe],xr=H.feature(Ye.index);for(var Ir in this.binders){var Fr=this.binders[Ir];if((Fr instanceof ca||Fr instanceof ea||Fr instanceof wa)&&Fr.expression.isStateDependent===!0){var en=ft.paint.get(Ir);Fr.expression=en.value,Fr.updatePaintArray(Ye.start,Ye.end,xr,d[Ht],kt),It=!0}}}return It},da.prototype.defines=function(){var d=[];for(var z in this.binders){var H=this.binders[z];(H instanceof Xn||H instanceof Vn)&&d.push.apply(d,H.uniformNames.map(function(ft){return"#define HAS_UNIFORM_"+ft}))}return d},da.prototype.getBinderAttributes=function(){var d=[];for(var z in this.binders){var H=this.binders[z];if(H instanceof ca||H instanceof ea)for(var ft=0;ft<H.paintVertexAttributes.length;ft++)d.push(H.paintVertexAttributes[ft].name);else if(H instanceof wa)for(var kt=0;kt<et.members.length;kt++)d.push(et.members[kt].name)}return d},da.prototype.getBinderUniforms=function(){var d=[];for(var z in this.binders){var H=this.binders[z];if(H instanceof Xn||H instanceof Vn||H instanceof ea)for(var ft=0,kt=H.uniformNames;ft<kt.length;ft+=1){var It=kt[ft];d.push(It)}}return d},da.prototype.getPaintVertexBuffers=function(){return this._buffers},da.prototype.getUniforms=function(d,z){var H=[];for(var ft in this.binders){var kt=this.binders[ft];if(kt instanceof Xn||kt instanceof Vn||kt instanceof ea)for(var It=0,Ht=kt.uniformNames;It<Ht.length;It+=1){var ge=Ht[It];if(z[ge]){var Pe=kt.getBinding(d,z[ge],ge);H.push({name:ge,property:ft,binding:Pe})}}}return H},da.prototype.setUniforms=function(d,z,H,ft){for(var kt=0,It=z;kt<It.length;kt+=1){var Ht=It[kt],ge=Ht.name,Pe=Ht.property,qe=Ht.binding;this.binders[Pe].setUniform(qe,ft,H.get(Pe),ge)}},da.prototype.updatePaintBuffers=function(d){this._buffers=[];for(var z in this.binders){var H=this.binders[z];if(d&&H instanceof wa){var ft=d.fromScale===2?H.zoomInPaintVertexBuffer:H.zoomOutPaintVertexBuffer;ft&&this._buffers.push(ft)}else(H instanceof ca||H instanceof ea)&&H.paintVertexBuffer&&this._buffers.push(H.paintVertexBuffer)}},da.prototype.upload=function(d){for(var z in this.binders){var H=this.binders[z];(H instanceof ca||H instanceof ea||H instanceof wa)&&H.upload(d)}this.updatePaintBuffers()},da.prototype.destroy=function(){for(var d in this.binders){var z=this.binders[d];(z instanceof ca||z instanceof ea||z instanceof wa)&&z.destroy()}};var pa=function(d,z,H){H===void 0&&(H=function(){return!0}),this.programConfigurations={};for(var ft=0,kt=d;ft<kt.length;ft+=1){var It=kt[ft];this.programConfigurations[It.id]=new da(It,z,H)}this.needsUpload=!1,this._featureMap=new re,this._bufferOffset=0};pa.prototype.populatePaintArrays=function(d,z,H,ft,kt,It){for(var Ht in this.programConfigurations)this.programConfigurations[Ht].populatePaintArrays(d,z,ft,kt,It);z.id!==void 0&&this._featureMap.add(z.id,H,this._bufferOffset,d),this._bufferOffset=d,this.needsUpload=!0},pa.prototype.updatePaintArrays=function(d,z,H,ft){for(var kt=0,It=H;kt<It.length;kt+=1){var Ht=It[kt];this.needsUpload=this.programConfigurations[Ht.id].updatePaintArrays(d,this._featureMap,z,Ht,ft)||this.needsUpload}},pa.prototype.get=function(d){return this.programConfigurations[d]},pa.prototype.upload=function(d){if(this.needsUpload){for(var z in this.programConfigurations)this.programConfigurations[z].upload(d);this.needsUpload=!1}},pa.prototype.destroy=function(){for(var d in this.programConfigurations)this.programConfigurations[d].destroy()};function Ua(d,z){var H={"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"]};return H[d]||[d.replace(z+"-","").replace(/-/g,"_")]}function Di(d){var z={"line-pattern":{source:Wa,composite:Wa},"fill-pattern":{source:Wa,composite:Wa},"fill-extrusion-pattern":{source:Wa,composite:Wa}};return z[d]}function ui(d,z,H){var ft={color:{source:hi,composite:lc},number:{source:Gs,composite:hi}},kt=Di(d);return kt&&kt[H]||ft[z][H]}De("ConstantBinder",Xn),De("CrossFadedConstantBinder",Vn),De("SourceExpressionBinder",ca),De("CrossFadedCompositeBinder",wa),De("CompositeExpressionBinder",ea),De("ProgramConfiguration",da,{omit:["_buffers"]}),De("ProgramConfigurationSet",pa);var ji=8192,uo=15,cs=Math.pow(2,uo-1)-1,Ts=-cs-1;function is(d){for(var z=ji/d.extent,H=d.loadGeometry(),ft=0;ft<H.length;ft++)for(var kt=H[ft],It=0;It<kt.length;It++){var Ht=kt[It],ge=Math.round(Ht.x*z),Pe=Math.round(Ht.y*z);Ht.x=l(ge,Ts,cs),Ht.y=l(Pe,Ts,cs),(ge<Ht.x||ge>Ht.x+1||Pe<Ht.y||Pe>Ht.y+1)&&j("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return H}function hs(d,z){return{type:d.type,id:d.id,properties:d.properties,geometry:z?is(d):[]}}function il(d,z,H,ft,kt){d.emplaceBack(z*2+(ft+1)/2,H*2+(kt+1)/2)}var eo=function(d){this.zoom=d.zoom,this.overscaling=d.overscaling,this.layers=d.layers,this.layerIds=this.layers.map(function(z){return z.id}),this.index=d.index,this.hasPattern=!1,this.layoutVertexArray=new _i,this.indexArray=new Oo,this.segments=new zs,this.programConfigurations=new pa(d.layers,d.zoom),this.stateDependentLayerIds=this.layers.filter(function(z){return z.isStateDependent()}).map(function(z){return z.id})};eo.prototype.populate=function(d,z,H){var ft=this.layers[0],kt=[],It=null;ft.type==="circle"&&(It=ft.layout.get("circle-sort-key"));for(var Ht=0,ge=d;Ht<ge.length;Ht+=1){var Pe=ge[Ht],qe=Pe.feature,Ye=Pe.id,xr=Pe.index,Ir=Pe.sourceLayerIndex,Fr=this.layers[0]._featureFilter.needGeometry,en=hs(qe,Fr);if(this.layers[0]._featureFilter.filter(new Yo(this.zoom),en,H)){var kn=It?It.evaluate(en,{},H):void 0,Zn={id:Ye,properties:qe.properties,type:qe.type,sourceLayerIndex:Ir,index:xr,geometry:Fr?en.geometry:is(qe),patterns:{},sortKey:kn};kt.push(Zn)}}It&&kt.sort(function(Wi,Zi){return Wi.sortKey-Zi.sortKey});for(var Hn=0,aa=kt;Hn<aa.length;Hn+=1){var ma=aa[Hn],ra=ma,Ea=ra.geometry,Za=ra.index,oi=ra.sourceLayerIndex,si=d[Za].feature;this.addFeature(ma,Ea,Za,H),z.featureIndex.insert(si,Ea,Za,oi,this.index)}},eo.prototype.update=function(d,z,H){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(d,z,this.stateDependentLayers,H)},eo.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},eo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},eo.prototype.upload=function(d){this.uploaded||(this.layoutVertexBuffer=d.createVertexBuffer(this.layoutVertexArray,kl),this.indexBuffer=d.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(d),this.uploaded=!0},eo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},eo.prototype.addFeature=function(d,z,H,ft){for(var kt=0,It=z;kt<It.length;kt+=1)for(var Ht=It[kt],ge=0,Pe=Ht;ge<Pe.length;ge+=1){var qe=Pe[ge],Ye=qe.x,xr=qe.y;if(!(Ye<0||Ye>=ji||xr<0||xr>=ji)){var Ir=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,d.sortKey),Fr=Ir.vertexLength;il(this.layoutVertexArray,Ye,xr,-1,-1),il(this.layoutVertexArray,Ye,xr,1,-1),il(this.layoutVertexArray,Ye,xr,1,1),il(this.layoutVertexArray,Ye,xr,-1,1),this.indexArray.emplaceBack(Fr,Fr+1,Fr+2),this.indexArray.emplaceBack(Fr,Fr+3,Fr+2),Ir.vertexLength+=4,Ir.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,d,H,{},ft)},De("CircleBucket",eo,{omit:["layers"]});function Ss(d,z){for(var H=0;H<d.length;H++)if(hh(z,d[H]))return!0;for(var ft=0;ft<z.length;ft++)if(hh(d,z[ft]))return!0;return!!Xh(d,z)}function Du(d,z,H){return!!(hh(d,z)||Tf(z,d,H))}function uc(d,z){if(d.length===1)return Jh(z,d[0]);for(var H=0;H<z.length;H++)for(var ft=z[H],kt=0;kt<ft.length;kt++)if(hh(d,ft[kt]))return!0;for(var It=0;It<d.length;It++)if(Jh(z,d[It]))return!0;for(var Ht=0;Ht<z.length;Ht++)if(Xh(d,z[Ht]))return!0;return!1}function lf(d,z,H){for(var ft=0;ft<z.length;ft++){var kt=z[ft];if(d.length>=3){for(var It=0;It<kt.length;It++)if(hh(d,kt[It]))return!0}if(xf(d,kt,H))return!0}return!1}function xf(d,z,H){if(d.length>1){if(Xh(d,z))return!0;for(var ft=0;ft<z.length;ft++)if(Tf(z[ft],d,H))return!0}for(var kt=0;kt<d.length;kt++)if(Tf(d[kt],z,H))return!0;return!1}function Xh(d,z){if(d.length===0||z.length===0)return!1;for(var H=0;H<d.length-1;H++)for(var ft=d[H],kt=d[H+1],It=0;It<z.length-1;It++){var Ht=z[It],ge=z[It+1];if($h(ft,kt,Ht,ge))return!0}return!1}function $h(d,z,H,ft){return G(d,H,ft)!==G(z,H,ft)&&G(d,z,H)!==G(d,z,ft)}function Tf(d,z,H){var ft=H*H;if(z.length===1)return d.distSqr(z[0])<ft;for(var kt=1;kt<z.length;kt++){var It=z[kt-1],Ht=z[kt];if(kh(d,It,Ht)<ft)return!0}return!1}function kh(d,z,H){var ft=z.distSqr(H);if(ft===0)return d.distSqr(z);var kt=((d.x-z.x)*(H.x-z.x)+(d.y-z.y)*(H.y-z.y))/ft;return kt<0?d.distSqr(z):kt>1?d.distSqr(H):d.distSqr(H.sub(z)._mult(kt)._add(z))}function Jh(d,z){for(var H=!1,ft,kt,It,Ht=0;Ht<d.length;Ht++){ft=d[Ht];for(var ge=0,Pe=ft.length-1;ge<ft.length;Pe=ge++)kt=ft[ge],It=ft[Pe],kt.y>z.y!=It.y>z.y&&z.x<(It.x-kt.x)*(z.y-kt.y)/(It.y-kt.y)+kt.x&&(H=!H)}return H}function hh(d,z){for(var H=!1,ft=0,kt=d.length-1;ft<d.length;kt=ft++){var It=d[ft],Ht=d[kt];It.y>z.y!=Ht.y>z.y&&z.x<(Ht.x-It.x)*(z.y-It.y)/(Ht.y-It.y)+It.x&&(H=!H)}return H}function Of(d,z,H,ft,kt){for(var It=0,Ht=d;It<Ht.length;It+=1){var ge=Ht[It];if(z<=ge.x&&H<=ge.y&&ft>=ge.x&&kt>=ge.y)return!0}var Pe=[new o(z,H),new o(z,kt),new o(ft,kt),new o(ft,H)];if(d.length>2)for(var qe=0,Ye=Pe;qe<Ye.length;qe+=1){var xr=Ye[qe];if(hh(d,xr))return!0}for(var Ir=0;Ir<d.length-1;Ir++){var Fr=d[Ir],en=d[Ir+1];if(lp(Fr,en,Pe))return!0}return!1}function lp(d,z,H){var ft=H[0],kt=H[2];if(d.x<ft.x&&z.x<ft.x||d.x>kt.x&&z.x>kt.x||d.y<ft.y&&z.y<ft.y||d.y>kt.y&&z.y>kt.y)return!1;var It=G(d,z,H[0]);return It!==G(d,z,H[1])||It!==G(d,z,H[2])||It!==G(d,z,H[3])}function Qh(d,z,H){var ft=z.paint.get(d).value;return ft.kind==="constant"?ft.value:H.programConfigurations.get(z.id).getMaxValue(d)}function Yh(d){return Math.sqrt(d[0]*d[0]+d[1]*d[1])}function Ah(d,z,H,ft,kt){if(!z[0]&&!z[1])return d;var It=o.convert(z)._mult(kt);H==="viewport"&&It._rotate(-ft);for(var Ht=[],ge=0;ge<d.length;ge++){var Pe=d[ge];Ht.push(Pe.sub(It))}return Ht}var up=new Ii({"circle-sort-key":new ia(ga.layout_circle["circle-sort-key"])}),Mp=new Ii({"circle-radius":new ia(ga.paint_circle["circle-radius"]),"circle-color":new ia(ga.paint_circle["circle-color"]),"circle-blur":new ia(ga.paint_circle["circle-blur"]),"circle-opacity":new ia(ga.paint_circle["circle-opacity"]),"circle-translate":new Cn(ga.paint_circle["circle-translate"]),"circle-translate-anchor":new Cn(ga.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Cn(ga.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Cn(ga.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ia(ga.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ia(ga.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ia(ga.paint_circle["circle-stroke-opacity"])}),cp={paint:Mp,layout:up},Rc=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var d=arguments,z=0,H=arguments.length;H--;)z+=d[H]*d[H];return Math.sqrt(z)});function Xf(){var d=new Rc(4);return Rc!=Float32Array&&(d[1]=0,d[2]=0),d[0]=1,d[3]=1,d}function Sp(d,z,H){var ft=z[0],kt=z[1],It=z[2],Ht=z[3],ge=Math.sin(H),Pe=Math.cos(H);return d[0]=ft*Pe+It*ge,d[1]=kt*Pe+Ht*ge,d[2]=ft*-ge+It*Pe,d[3]=kt*-ge+Ht*Pe,d}function jc(){var d=new Rc(9);return Rc!=Float32Array&&(d[1]=0,d[2]=0,d[3]=0,d[5]=0,d[6]=0,d[7]=0),d[0]=1,d[4]=1,d[8]=1,d}function hp(d,z){var H=Math.sin(z),ft=Math.cos(z);return d[0]=ft,d[1]=H,d[2]=0,d[3]=-H,d[4]=ft,d[5]=0,d[6]=0,d[7]=0,d[8]=1,d}function Jp(){var d=new Rc(16);return Rc!=Float32Array&&(d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[11]=0,d[12]=0,d[13]=0,d[14]=0),d[0]=1,d[5]=1,d[10]=1,d[15]=1,d}function Qp(d){var z=new Rc(16);return z[0]=d[0],z[1]=d[1],z[2]=d[2],z[3]=d[3],z[4]=d[4],z[5]=d[5],z[6]=d[6],z[7]=d[7],z[8]=d[8],z[9]=d[9],z[10]=d[10],z[11]=d[11],z[12]=d[12],z[13]=d[13],z[14]=d[14],z[15]=d[15],z}function kf(d){return d[0]=1,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}function Ep(d,z){var H=z[0],ft=z[1],kt=z[2],It=z[3],Ht=z[4],ge=z[5],Pe=z[6],qe=z[7],Ye=z[8],xr=z[9],Ir=z[10],Fr=z[11],en=z[12],kn=z[13],Zn=z[14],Hn=z[15],aa=H*ge-ft*Ht,ma=H*Pe-kt*Ht,ra=H*qe-It*Ht,Ea=ft*Pe-kt*ge,Za=ft*qe-It*ge,oi=kt*qe-It*Pe,si=Ye*kn-xr*en,Wi=Ye*Zn-Ir*en,Zi=Ye*Hn-Fr*en,ro=xr*Zn-Ir*kn,fo=xr*Hn-Fr*kn,Eo=Ir*Hn-Fr*Zn,no=aa*Eo-ma*fo+ra*ro+Ea*Zi-Za*Wi+oi*si;return no?(no=1/no,d[0]=(ge*Eo-Pe*fo+qe*ro)*no,d[1]=(kt*fo-ft*Eo-It*ro)*no,d[2]=(kn*oi-Zn*Za+Hn*Ea)*no,d[3]=(Ir*Za-xr*oi-Fr*Ea)*no,d[4]=(Pe*Zi-Ht*Eo-qe*Wi)*no,d[5]=(H*Eo-kt*Zi+It*Wi)*no,d[6]=(Zn*ra-en*oi-Hn*ma)*no,d[7]=(Ye*oi-Ir*ra+Fr*ma)*no,d[8]=(Ht*fo-ge*Zi+qe*si)*no,d[9]=(ft*Zi-H*fo-It*si)*no,d[10]=(en*Za-kn*ra+Hn*aa)*no,d[11]=(xr*ra-Ye*Za-Fr*aa)*no,d[12]=(ge*Wi-Ht*ro-Pe*si)*no,d[13]=(H*ro-ft*Wi+kt*si)*no,d[14]=(kn*ma-en*Ea-Zn*aa)*no,d[15]=(Ye*Ea-xr*ma+Ir*aa)*no,d):null}function zu(d,z,H){var ft=z[0],kt=z[1],It=z[2],Ht=z[3],ge=z[4],Pe=z[5],qe=z[6],Ye=z[7],xr=z[8],Ir=z[9],Fr=z[10],en=z[11],kn=z[12],Zn=z[13],Hn=z[14],aa=z[15],ma=H[0],ra=H[1],Ea=H[2],Za=H[3];return d[0]=ma*ft+ra*ge+Ea*xr+Za*kn,d[1]=ma*kt+ra*Pe+Ea*Ir+Za*Zn,d[2]=ma*It+ra*qe+Ea*Fr+Za*Hn,d[3]=ma*Ht+ra*Ye+Ea*en+Za*aa,ma=H[4],ra=H[5],Ea=H[6],Za=H[7],d[4]=ma*ft+ra*ge+Ea*xr+Za*kn,d[5]=ma*kt+ra*Pe+Ea*Ir+Za*Zn,d[6]=ma*It+ra*qe+Ea*Fr+Za*Hn,d[7]=ma*Ht+ra*Ye+Ea*en+Za*aa,ma=H[8],ra=H[9],Ea=H[10],Za=H[11],d[8]=ma*ft+ra*ge+Ea*xr+Za*kn,d[9]=ma*kt+ra*Pe+Ea*Ir+Za*Zn,d[10]=ma*It+ra*qe+Ea*Fr+Za*Hn,d[11]=ma*Ht+ra*Ye+Ea*en+Za*aa,ma=H[12],ra=H[13],Ea=H[14],Za=H[15],d[12]=ma*ft+ra*ge+Ea*xr+Za*kn,d[13]=ma*kt+ra*Pe+Ea*Ir+Za*Zn,d[14]=ma*It+ra*qe+Ea*Fr+Za*Hn,d[15]=ma*Ht+ra*Ye+Ea*en+Za*aa,d}function Nc(d,z,H){var ft=H[0],kt=H[1],It=H[2],Ht,ge,Pe,qe,Ye,xr,Ir,Fr,en,kn,Zn,Hn;return z===d?(d[12]=z[0]*ft+z[4]*kt+z[8]*It+z[12],d[13]=z[1]*ft+z[5]*kt+z[9]*It+z[13],d[14]=z[2]*ft+z[6]*kt+z[10]*It+z[14],d[15]=z[3]*ft+z[7]*kt+z[11]*It+z[15]):(Ht=z[0],ge=z[1],Pe=z[2],qe=z[3],Ye=z[4],xr=z[5],Ir=z[6],Fr=z[7],en=z[8],kn=z[9],Zn=z[10],Hn=z[11],d[0]=Ht,d[1]=ge,d[2]=Pe,d[3]=qe,d[4]=Ye,d[5]=xr,d[6]=Ir,d[7]=Fr,d[8]=en,d[9]=kn,d[10]=Zn,d[11]=Hn,d[12]=Ht*ft+Ye*kt+en*It+z[12],d[13]=ge*ft+xr*kt+kn*It+z[13],d[14]=Pe*ft+Ir*kt+Zn*It+z[14],d[15]=qe*ft+Fr*kt+Hn*It+z[15]),d}function ol(d,z,H){var ft=H[0],kt=H[1],It=H[2];return d[0]=z[0]*ft,d[1]=z[1]*ft,d[2]=z[2]*ft,d[3]=z[3]*ft,d[4]=z[4]*kt,d[5]=z[5]*kt,d[6]=z[6]*kt,d[7]=z[7]*kt,d[8]=z[8]*It,d[9]=z[9]*It,d[10]=z[10]*It,d[11]=z[11]*It,d[12]=z[12],d[13]=z[13],d[14]=z[14],d[15]=z[15],d}function Pp(d,z,H){var ft=Math.sin(H),kt=Math.cos(H),It=z[4],Ht=z[5],ge=z[6],Pe=z[7],qe=z[8],Ye=z[9],xr=z[10],Ir=z[11];return z!==d&&(d[0]=z[0],d[1]=z[1],d[2]=z[2],d[3]=z[3],d[12]=z[12],d[13]=z[13],d[14]=z[14],d[15]=z[15]),d[4]=It*kt+qe*ft,d[5]=Ht*kt+Ye*ft,d[6]=ge*kt+xr*ft,d[7]=Pe*kt+Ir*ft,d[8]=qe*kt-It*ft,d[9]=Ye*kt-Ht*ft,d[10]=xr*kt-ge*ft,d[11]=Ir*kt-Pe*ft,d}function Yp(d,z,H){var ft=Math.sin(H),kt=Math.cos(H),It=z[0],Ht=z[1],ge=z[2],Pe=z[3],qe=z[4],Ye=z[5],xr=z[6],Ir=z[7];return z!==d&&(d[8]=z[8],d[9]=z[9],d[10]=z[10],d[11]=z[11],d[12]=z[12],d[13]=z[13],d[14]=z[14],d[15]=z[15]),d[0]=It*kt+qe*ft,d[1]=Ht*kt+Ye*ft,d[2]=ge*kt+xr*ft,d[3]=Pe*kt+Ir*ft,d[4]=qe*kt-It*ft,d[5]=Ye*kt-Ht*ft,d[6]=xr*kt-ge*ft,d[7]=Ir*kt-Pe*ft,d}function D0(d,z,H,ft,kt){var It=1/Math.tan(z/2),Ht;return d[0]=It/H,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=It,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[11]=-1,d[12]=0,d[13]=0,d[15]=0,kt!=null&&kt!==1/0?(Ht=1/(ft-kt),d[10]=(kt+ft)*Ht,d[14]=2*kt*ft*Ht):(d[10]=-1,d[14]=-2*ft),d}function vl(d,z,H,ft,kt,It,Ht){var ge=1/(z-H),Pe=1/(ft-kt),qe=1/(It-Ht);return d[0]=-2*ge,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=-2*Pe,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=2*qe,d[11]=0,d[12]=(z+H)*ge,d[13]=(kt+ft)*Pe,d[14]=(Ht+It)*qe,d[15]=1,d}var $f=zu;function z0(){var d=new Rc(3);return Rc!=Float32Array&&(d[0]=0,d[1]=0,d[2]=0),d}function Ip(d){var z=new Rc(3);return z[0]=d[0],z[1]=d[1],z[2]=d[2],z}function Af(d,z,H){return d[0]=z[0]+H[0],d[1]=z[1]+H[1],d[2]=z[2]+H[2],d}function $g(d,z,H){return d[0]=z[0]-H[0],d[1]=z[1]-H[1],d[2]=z[2]-H[2],d}function Kp(d,z,H){return d[0]=z[0]*H,d[1]=z[1]*H,d[2]=z[2]*H,d}function a_(d,z){var H=z[0],ft=z[1],kt=z[2],It=H*H+ft*ft+kt*kt;return It>0&&(It=1/Math.sqrt(It)),d[0]=z[0]*It,d[1]=z[1]*It,d[2]=z[2]*It,d}function i_(d,z){return d[0]*z[0]+d[1]*z[1]+d[2]*z[2]}function o_(d,z,H){var ft=z[0],kt=z[1],It=z[2],Ht=H[0],ge=H[1],Pe=H[2];return d[0]=kt*Pe-It*ge,d[1]=It*Ht-ft*Pe,d[2]=ft*ge-kt*Ht,d}function s_(d,z,H){var ft=z[0],kt=z[1],It=z[2];return d[0]=ft*H[0]+kt*H[3]+It*H[6],d[1]=ft*H[1]+kt*H[4]+It*H[7],d[2]=ft*H[2]+kt*H[5]+It*H[8],d}var l_=$g;(function(){var d=z0();return function(z,H,ft,kt,It,Ht){var ge,Pe;for(H||(H=3),ft||(ft=0),kt?Pe=Math.min(kt*H+ft,z.length):Pe=z.length,ge=ft;ge<Pe;ge+=H)d[0]=z[ge],d[1]=z[ge+1],d[2]=z[ge+2],It(d,d,Ht),z[ge]=d[0],z[ge+1]=d[1],z[ge+2]=d[2];return z}})();function u_(){var d=new Rc(4);return Rc!=Float32Array&&(d[0]=0,d[1]=0,d[2]=0,d[3]=0),d}function c_(d,z,H){return d[0]=z[0]*H,d[1]=z[1]*H,d[2]=z[2]*H,d[3]=z[3]*H,d}function h_(d,z){return d[0]*z[0]+d[1]*z[1]+d[2]*z[2]+d[3]*z[3]}function O0(d,z,H){var ft=z[0],kt=z[1],It=z[2],Ht=z[3];return d[0]=H[0]*ft+H[4]*kt+H[8]*It+H[12]*Ht,d[1]=H[1]*ft+H[5]*kt+H[9]*It+H[13]*Ht,d[2]=H[2]*ft+H[6]*kt+H[10]*It+H[14]*Ht,d[3]=H[3]*ft+H[7]*kt+H[11]*It+H[15]*Ht,d}(function(){var d=u_();return function(z,H,ft,kt,It,Ht){var ge,Pe;for(H||(H=4),ft||(ft=0),kt?Pe=Math.min(kt*H+ft,z.length):Pe=z.length,ge=ft;ge<Pe;ge+=H)d[0]=z[ge],d[1]=z[ge+1],d[2]=z[ge+2],d[3]=z[ge+3],It(d,d,Ht),z[ge]=d[0],z[ge+1]=d[1],z[ge+2]=d[2],z[ge+3]=d[3];return z}})();function F0(){var d=new Rc(2);return Rc!=Float32Array&&(d[0]=0,d[1]=0),d}function td(d){var z=d[0],H=d[1];return z*z+H*H}var Fv=td;(function(){var d=F0();return function(z,H,ft,kt,It,Ht){var ge,Pe;for(H||(H=2),ft||(ft=0),kt?Pe=Math.min(kt*H+ft,z.length):Pe=z.length,ge=ft;ge<Pe;ge+=H)d[0]=z[ge],d[1]=z[ge+1],It(d,d,Ht),z[ge]=d[0],z[ge+1]=d[1];return z}})();var Jg=function(d){function z(H){d.call(this,H,cp)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.createBucket=function(H){return new eo(H)},z.prototype.queryRadius=function(H){var ft=H;return Qh("circle-radius",this,ft)+Qh("circle-stroke-width",this,ft)+Yh(this.paint.get("circle-translate"))},z.prototype.queryIntersectsFeature=function(H,ft,kt,It,Ht,ge,Pe,qe){for(var Ye=Ah(H,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),ge.angle,Pe),xr=this.paint.get("circle-radius").evaluate(ft,kt),Ir=this.paint.get("circle-stroke-width").evaluate(ft,kt),Fr=xr+Ir,en=this.paint.get("circle-pitch-alignment")==="map",kn=en?Ye:f_(Ye,qe),Zn=en?Fr*Pe:Fr,Hn=0,aa=It;Hn<aa.length;Hn+=1)for(var ma=aa[Hn],ra=0,Ea=ma;ra<Ea.length;ra+=1){var Za=Ea[ra],oi=en?Za:B0(Za,qe),si=Zn,Wi=O0([],[Za.x,Za.y,0,1],qe);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?si*=Wi[3]/ge.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(si*=ge.cameraToCenterDistance/Wi[3]),Du(kn,oi,si))return!0}return!1},z}(Ha);function B0(d,z){var H=O0([],[d.x,d.y,0,1],z);return new o(H[0]/H[3],H[1]/H[3])}function f_(d,z){return d.map(function(H){return B0(H,z)})}var Bv=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z}(eo);De("HeatmapBucket",Bv,{omit:["layers"]});function Qg(d,z,H,ft){var kt=z.width,It=z.height;if(!ft)ft=new Uint8Array(kt*It*H);else if(ft instanceof Uint8ClampedArray)ft=new Uint8Array(ft.buffer);else if(ft.length!==kt*It*H)throw new RangeError("mismatched image size");return d.width=kt,d.height=It,d.data=ft,d}function Yg(d,z,H){var ft=z.width,kt=z.height;if(!(ft===d.width&&kt===d.height)){var It=Qg({},{width:ft,height:kt},H);R0(d,It,{x:0,y:0},{x:0,y:0},{width:Math.min(d.width,ft),height:Math.min(d.height,kt)},H),d.width=ft,d.height=kt,d.data=It.data}}function R0(d,z,H,ft,kt,It){if(kt.width===0||kt.height===0)return z;if(kt.width>d.width||kt.height>d.height||H.x>d.width-kt.width||H.y>d.height-kt.height)throw new RangeError("out of range source coordinates for image copy");if(kt.width>z.width||kt.height>z.height||ft.x>z.width-kt.width||ft.y>z.height-kt.height)throw new RangeError("out of range destination coordinates for image copy");for(var Ht=d.data,ge=z.data,Pe=0;Pe<kt.height;Pe++)for(var qe=((H.y+Pe)*d.width+H.x)*It,Ye=((ft.y+Pe)*z.width+ft.x)*It,xr=0;xr<kt.width*It;xr++)ge[Ye+xr]=Ht[qe+xr];return z}var Tc=function(d,z){Qg(this,d,1,z)};Tc.prototype.resize=function(d){Yg(this,d,1)},Tc.prototype.clone=function(){return new Tc({width:this.width,height:this.height},new Uint8Array(this.data))},Tc.copy=function(d,z,H,ft,kt){R0(d,z,H,ft,kt,1)};var fh=function(d,z){Qg(this,d,4,z)};fh.prototype.resize=function(d){Yg(this,d,4)},fh.prototype.replace=function(d,z){z?this.data.set(d):d instanceof Uint8ClampedArray?this.data=new Uint8Array(d.buffer):this.data=d},fh.prototype.clone=function(){return new fh({width:this.width,height:this.height},new Uint8Array(this.data))},fh.copy=function(d,z,H,ft,kt){R0(d,z,H,ft,kt,4)},De("AlphaImage",Tc),De("RGBAImage",fh);var Rv=new Ii({"heatmap-radius":new ia(ga.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ia(ga.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Cn(ga.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ei(ga.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Cn(ga.paint_heatmap["heatmap-opacity"])}),fp={paint:Rv};function ed(d){var z={},H=d.resolution||256,ft=d.clips?d.clips.length:1,kt=d.image||new fh({width:H,height:ft}),It=function(aa,ma,ra){z[d.evaluationKey]=ra;var Ea=d.expression.evaluate(z);kt.data[aa+ma+0]=Math.floor(Ea.r*255/Ea.a),kt.data[aa+ma+1]=Math.floor(Ea.g*255/Ea.a),kt.data[aa+ma+2]=Math.floor(Ea.b*255/Ea.a),kt.data[aa+ma+3]=Math.floor(Ea.a*255)};if(d.clips)for(var Ht=0,ge=0;Ht<ft;++Ht,ge+=H*4)for(var Pe=0,qe=0;Pe<H;Pe++,qe+=4){var Ye=Pe/(H-1),xr=d.clips[Ht],Ir=xr.start,Fr=xr.end,en=Ir*(1-Ye)+Fr*Ye;It(ge,qe,en)}else for(var kn=0,Zn=0;kn<H;kn++,Zn+=4){var Hn=kn/(H-1);It(0,Zn,Hn)}return kt}var Zd=function(d){function z(H){d.call(this,H,fp),this._updateColorRamp()}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.createBucket=function(H){return new Bv(H)},z.prototype._handleSpecialPaintPropertyUpdate=function(H){H==="heatmap-color"&&this._updateColorRamp()},z.prototype._updateColorRamp=function(){var H=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=ed({expression:H,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},z.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},z.prototype.queryRadius=function(){return 0},z.prototype.queryIntersectsFeature=function(){return!1},z.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},z}(Ha),rd=new Ii({"hillshade-illumination-direction":new Cn(ga.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Cn(ga.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Cn(ga.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Cn(ga.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Cn(ga.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Cn(ga.paint_hillshade["hillshade-accent-color"])}),j0={paint:rd},N0=function(d){function z(H){d.call(this,H,j0)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},z}(Ha),p_=xa([{name:"a_pos",components:2,type:"Int16"}],4),d_=p_.members,U0=V0,jv=V0;function V0(d,z,H){H=H||2;var ft=z&&z.length,kt=ft?z[0]*H:d.length,It=Kg(d,0,kt,H,!0),Ht=[];if(!It||It.next===It.prev)return Ht;var ge,Pe,qe,Ye,xr,Ir,Fr;if(ft&&(It=Uv(d,z,It,H)),d.length>80*H){ge=qe=d[0],Pe=Ye=d[1];for(var en=H;en<kt;en+=H)xr=d[en],Ir=d[en+1],xr<ge&&(ge=xr),Ir<Pe&&(Pe=Ir),xr>qe&&(qe=xr),Ir>Ye&&(Ye=Ir);Fr=Math.max(qe-ge,Ye-Pe),Fr=Fr!==0?1/Fr:0}return Lp(It,Ht,H,ge,Pe,Fr),Ht}function Kg(d,z,H,ft,kt){var It,Ht;if(kt===im(d,z,H,ft)>0)for(It=z;It<H;It+=ft)Ht=qv(It,d[It],d[It+1],Ht);else for(It=H-ft;It>=z;It-=ft)Ht=qv(It,d[It],d[It+1],Ht);return Ht&&nd(Ht,Ht.next)&&(Qd(Ht),Ht=Ht.next),Ht}function Jf(d,z){if(!d)return d;z||(z=d);var H=d,ft;do if(ft=!1,!H.steiner&&(nd(H,H.next)||Vu(H.prev,H,H.next)===0)){if(Qd(H),H=z=H.prev,H===H.next)break;ft=!0}else H=H.next;while(ft||H!==z);return z}function Lp(d,z,H,ft,kt,It,Ht){if(d){!Ht&&It&&em(d,ft,kt,It);for(var ge=d,Pe,qe;d.prev!==d.next;){if(Pe=d.prev,qe=d.next,It?g_(d,ft,kt,It):tm(d)){z.push(Pe.i/H),z.push(d.i/H),z.push(qe.i/H),Qd(d),d=qe.next,ge=qe.next;continue}if(d=qe,d===ge){Ht?Ht===1?(d=m_(Jf(d),z,H),Lp(d,z,H,ft,kt,It,2)):Ht===2&&Nv(d,z,H,ft,kt,It):Lp(Jf(d),z,H,ft,kt,It,1);break}}}}function tm(d){var z=d.prev,H=d,ft=d.next;if(Vu(z,H,ft)>=0)return!1;for(var kt=d.next.next;kt!==d.prev;){if(dp(z.x,z.y,H.x,H.y,ft.x,ft.y,kt.x,kt.y)&&Vu(kt.prev,kt,kt.next)>=0)return!1;kt=kt.next}return!0}function g_(d,z,H,ft){var kt=d.prev,It=d,Ht=d.next;if(Vu(kt,It,Ht)>=0)return!1;for(var ge=kt.x<It.x?kt.x<Ht.x?kt.x:Ht.x:It.x<Ht.x?It.x:Ht.x,Pe=kt.y<It.y?kt.y<Ht.y?kt.y:Ht.y:It.y<Ht.y?It.y:Ht.y,qe=kt.x>It.x?kt.x>Ht.x?kt.x:Ht.x:It.x>Ht.x?It.x:Ht.x,Ye=kt.y>It.y?kt.y>Ht.y?kt.y:Ht.y:It.y>Ht.y?It.y:Ht.y,xr=rm(ge,Pe,z,H,ft),Ir=rm(qe,Ye,z,H,ft),Fr=d.prevZ,en=d.nextZ;Fr&&Fr.z>=xr&&en&&en.z<=Ir;){if(Fr!==d.prev&&Fr!==d.next&&dp(kt.x,kt.y,It.x,It.y,Ht.x,Ht.y,Fr.x,Fr.y)&&Vu(Fr.prev,Fr,Fr.next)>=0||(Fr=Fr.prevZ,en!==d.prev&&en!==d.next&&dp(kt.x,kt.y,It.x,It.y,Ht.x,Ht.y,en.x,en.y)&&Vu(en.prev,en,en.next)>=0))return!1;en=en.nextZ}for(;Fr&&Fr.z>=xr;){if(Fr!==d.prev&&Fr!==d.next&&dp(kt.x,kt.y,It.x,It.y,Ht.x,Ht.y,Fr.x,Fr.y)&&Vu(Fr.prev,Fr,Fr.next)>=0)return!1;Fr=Fr.prevZ}for(;en&&en.z<=Ir;){if(en!==d.prev&&en!==d.next&&dp(kt.x,kt.y,It.x,It.y,Ht.x,Ht.y,en.x,en.y)&&Vu(en.prev,en,en.next)>=0)return!1;en=en.nextZ}return!0}function m_(d,z,H){var ft=d;do{var kt=ft.prev,It=ft.next.next;!nd(kt,It)&&Cp(kt,ft,ft.next,It)&&ad(kt,It)&&ad(It,kt)&&(z.push(kt.i/H),z.push(ft.i/H),z.push(It.i/H),Qd(ft),Qd(ft.next),ft=d=It),ft=ft.next}while(ft!==d);return Jf(ft)}function Nv(d,z,H,ft,kt,It){var Ht=d;do{for(var ge=Ht.next.next;ge!==Ht.prev;){if(Ht.i!==ge.i&&y_(Ht,ge)){var Pe=am(Ht,ge);Ht=Jf(Ht,Ht.next),Pe=Jf(Pe,Pe.next),Lp(Ht,z,H,ft,kt,It),Lp(Pe,z,H,ft,kt,It);return}ge=ge.next}Ht=Ht.next}while(Ht!==d)}function Uv(d,z,H,ft){var kt=[],It,Ht,ge,Pe,qe;for(It=0,Ht=z.length;It<Ht;It++)ge=z[It]*ft,Pe=It<Ht-1?z[It+1]*ft:d.length,qe=Kg(d,ge,Pe,ft,!1),qe===qe.next&&(qe.steiner=!0),kt.push(q0(qe));for(kt.sort(Xd),It=0;It<kt.length;It++)Ff(kt[It],H),H=Jf(H,H.next);return H}function Xd(d,z){return d.x-z.x}function Ff(d,z){if(z=pp(d,z),z){var H=am(z,d);Jf(z,z.next),Jf(H,H.next)}}function pp(d,z){var H=z,ft=d.x,kt=d.y,It=-1/0,Ht;do{if(kt<=H.y&&kt>=H.next.y&&H.next.y!==H.y){var ge=H.x+(kt-H.y)*(H.next.x-H.x)/(H.next.y-H.y);if(ge<=ft&&ge>It){if(It=ge,ge===ft){if(kt===H.y)return H;if(kt===H.next.y)return H.next}Ht=H.x<H.next.x?H:H.next}}H=H.next}while(H!==z);if(!Ht)return null;if(ft===It)return Ht;var Pe=Ht,qe=Ht.x,Ye=Ht.y,xr=1/0,Ir;H=Ht;do ft>=H.x&&H.x>=qe&&ft!==H.x&&dp(kt<Ye?ft:It,kt,qe,Ye,kt<Ye?It:ft,kt,H.x,H.y)&&(Ir=Math.abs(kt-H.y)/(ft-H.x),ad(H,d)&&(Ir<xr||Ir===xr&&(H.x>Ht.x||H.x===Ht.x&&Vv(Ht,H)))&&(Ht=H,xr=Ir)),H=H.next;while(H!==Pe);return Ht}function Vv(d,z){return Vu(d.prev,d,z.prev)<0&&Vu(z.next,d,d.next)<0}function em(d,z,H,ft){var kt=d;do kt.z===null&&(kt.z=rm(kt.x,kt.y,z,H,ft)),kt.prevZ=kt.prev,kt.nextZ=kt.next,kt=kt.next;while(kt!==d);kt.prevZ.nextZ=null,kt.prevZ=null,v_(kt)}function v_(d){var z,H,ft,kt,It,Ht,ge,Pe,qe=1;do{for(H=d,d=null,It=null,Ht=0;H;){for(Ht++,ft=H,ge=0,z=0;z<qe&&(ge++,ft=ft.nextZ,!!ft);z++);for(Pe=qe;ge>0||Pe>0&&ft;)ge!==0&&(Pe===0||!ft||H.z<=ft.z)?(kt=H,H=H.nextZ,ge--):(kt=ft,ft=ft.nextZ,Pe--),It?It.nextZ=kt:d=kt,kt.prevZ=It,It=kt;H=ft}It.nextZ=null,qe*=2}while(Ht>1);return d}function rm(d,z,H,ft,kt){return d=32767*(d-H)*kt,z=32767*(z-ft)*kt,d=(d|d<<8)&16711935,d=(d|d<<4)&252645135,d=(d|d<<2)&858993459,d=(d|d<<1)&1431655765,z=(z|z<<8)&16711935,z=(z|z<<4)&252645135,z=(z|z<<2)&858993459,z=(z|z<<1)&1431655765,d|z<<1}function q0(d){var z=d,H=d;do(z.x<H.x||z.x===H.x&&z.y<H.y)&&(H=z),z=z.next;while(z!==d);return H}function dp(d,z,H,ft,kt,It,Ht,ge){return(kt-Ht)*(z-ge)-(d-Ht)*(It-ge)>=0&&(d-Ht)*(ft-ge)-(H-Ht)*(z-ge)>=0&&(H-Ht)*(It-ge)-(kt-Ht)*(ft-ge)>=0}function y_(d,z){return d.next.i!==z.i&&d.prev.i!==z.i&&!nm(d,z)&&(ad(d,z)&&ad(z,d)&&H0(d,z)&&(Vu(d.prev,d,z.prev)||Vu(d,z.prev,z))||nd(d,z)&&Vu(d.prev,d,d.next)>0&&Vu(z.prev,z,z.next)>0)}function Vu(d,z,H){return(z.y-d.y)*(H.x-z.x)-(z.x-d.x)*(H.y-z.y)}function nd(d,z){return d.x===z.x&&d.y===z.y}function Cp(d,z,H,ft){var kt=Jd(Vu(d,z,H)),It=Jd(Vu(d,z,ft)),Ht=Jd(Vu(H,ft,d)),ge=Jd(Vu(H,ft,z));return!!(kt!==It&&Ht!==ge||kt===0&&$d(d,H,z)||It===0&&$d(d,ft,z)||Ht===0&&$d(H,d,ft)||ge===0&&$d(H,z,ft))}function $d(d,z,H){return z.x<=Math.max(d.x,H.x)&&z.x>=Math.min(d.x,H.x)&&z.y<=Math.max(d.y,H.y)&&z.y>=Math.min(d.y,H.y)}function Jd(d){return d>0?1:d<0?-1:0}function nm(d,z){var H=d;do{if(H.i!==d.i&&H.next.i!==d.i&&H.i!==z.i&&H.next.i!==z.i&&Cp(H,H.next,d,z))return!0;H=H.next}while(H!==d);return!1}function ad(d,z){return Vu(d.prev,d,d.next)<0?Vu(d,z,d.next)>=0&&Vu(d,d.prev,z)>=0:Vu(d,z,d.prev)<0||Vu(d,d.next,z)<0}function H0(d,z){var H=d,ft=!1,kt=(d.x+z.x)/2,It=(d.y+z.y)/2;do H.y>It!=H.next.y>It&&H.next.y!==H.y&&kt<(H.next.x-H.x)*(It-H.y)/(H.next.y-H.y)+H.x&&(ft=!ft),H=H.next;while(H!==d);return ft}function am(d,z){var H=new G0(d.i,d.x,d.y),ft=new G0(z.i,z.x,z.y),kt=d.next,It=z.prev;return d.next=z,z.prev=d,H.next=kt,kt.prev=H,ft.next=H,H.prev=ft,It.next=ft,ft.prev=It,ft}function qv(d,z,H,ft){var kt=new G0(d,z,H);return ft?(kt.next=ft.next,kt.prev=ft,ft.next.prev=kt,ft.next=kt):(kt.prev=kt,kt.next=kt),kt}function Qd(d){d.next.prev=d.prev,d.prev.next=d.next,d.prevZ&&(d.prevZ.nextZ=d.nextZ),d.nextZ&&(d.nextZ.prevZ=d.prevZ)}function G0(d,z,H){this.i=d,this.x=z,this.y=H,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}V0.deviation=function(d,z,H,ft){var kt=z&&z.length,It=kt?z[0]*H:d.length,Ht=Math.abs(im(d,0,It,H));if(kt)for(var ge=0,Pe=z.length;ge<Pe;ge++){var qe=z[ge]*H,Ye=ge<Pe-1?z[ge+1]*H:d.length;Ht-=Math.abs(im(d,qe,Ye,H))}var xr=0;for(ge=0;ge<ft.length;ge+=3){var Ir=ft[ge]*H,Fr=ft[ge+1]*H,en=ft[ge+2]*H;xr+=Math.abs((d[Ir]-d[en])*(d[Fr+1]-d[Ir+1])-(d[Ir]-d[Fr])*(d[en+1]-d[Ir+1]))}return Ht===0&&xr===0?0:Math.abs((xr-Ht)/Ht)};function im(d,z,H,ft){for(var kt=0,It=z,Ht=H-ft;It<H;It+=ft)kt+=(d[Ht]-d[It])*(d[It+1]+d[Ht+1]),Ht=It;return kt}V0.flatten=function(d){for(var z=d[0][0].length,H={vertices:[],holes:[],dimensions:z},ft=0,kt=0;kt<d.length;kt++){for(var It=0;It<d[kt].length;It++)for(var Ht=0;Ht<z;Ht++)H.vertices.push(d[kt][It][Ht]);kt>0&&(ft+=d[kt-1].length,H.holes.push(ft))}return H},U0.default=jv;function x_(d,z,H,ft,kt){Hv(d,z,H,ft||d.length-1,kt||om)}function Hv(d,z,H,ft,kt){for(;ft>H;){if(ft-H>600){var It=ft-H+1,Ht=z-H+1,ge=Math.log(It),Pe=.5*Math.exp(2*ge/3),qe=.5*Math.sqrt(ge*Pe*(It-Pe)/It)*(Ht-It/2<0?-1:1),Ye=Math.max(H,Math.floor(z-Ht*Pe/It+qe)),xr=Math.min(ft,Math.floor(z+(It-Ht)*Pe/It+qe));Hv(d,z,Ye,xr,kt)}var Ir=d[z],Fr=H,en=ft;for(Yd(d,H,z),kt(d[ft],Ir)>0&&Yd(d,H,ft);Fr<en;){for(Yd(d,Fr,en),Fr++,en--;kt(d[Fr],Ir)<0;)Fr++;for(;kt(d[en],Ir)>0;)en--}kt(d[H],Ir)===0?Yd(d,H,en):(en++,Yd(d,en,ft)),en<=z&&(H=en+1),z<=en&&(ft=en-1)}}function Yd(d,z,H){var ft=d[z];d[z]=d[H],d[H]=ft}function om(d,z){return d<z?-1:d>z?1:0}function Bf(d,z){var H=d.length;if(H<=1)return[d];for(var ft=[],kt,It,Ht=0;Ht<H;Ht++){var ge=rt(d[Ht]);ge!==0&&(d[Ht].area=Math.abs(ge),It===void 0&&(It=ge<0),It===ge<0?(kt&&ft.push(kt),kt=[d[Ht]]):kt.push(d[Ht]))}if(kt&&ft.push(kt),z>1)for(var Pe=0;Pe<ft.length;Pe++)ft[Pe].length<=z||(x_(ft[Pe],z,1,ft[Pe].length-1,Gv),ft[Pe]=ft[Pe].slice(0,z));return ft}function Gv(d,z){return z.area-d.area}function W0(d,z,H){for(var ft=H.patternDependencies,kt=!1,It=0,Ht=z;It<Ht.length;It+=1){var ge=Ht[It],Pe=ge.paint.get(d+"-pattern");Pe.isConstant()||(kt=!0);var qe=Pe.constantOr(null);qe&&(kt=!0,ft[qe.to]=!0,ft[qe.from]=!0)}return kt}function Z0(d,z,H,ft,kt){for(var It=kt.patternDependencies,Ht=0,ge=z;Ht<ge.length;Ht+=1){var Pe=ge[Ht],qe=Pe.paint.get(d+"-pattern"),Ye=qe.value;if(Ye.kind!=="constant"){var xr=Ye.evaluate({zoom:ft-1},H,{},kt.availableImages),Ir=Ye.evaluate({zoom:ft},H,{},kt.availableImages),Fr=Ye.evaluate({zoom:ft+1},H,{},kt.availableImages);xr=xr&&xr.name?xr.name:xr,Ir=Ir&&Ir.name?Ir.name:Ir,Fr=Fr&&Fr.name?Fr.name:Fr,It[xr]=!0,It[Ir]=!0,It[Fr]=!0,H.patterns[Pe.id]={min:xr,mid:Ir,max:Fr}}}return H}var Wv=500,_f=function(d){this.zoom=d.zoom,this.overscaling=d.overscaling,this.layers=d.layers,this.layerIds=this.layers.map(function(z){return z.id}),this.index=d.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new _i,this.indexArray=new Oo,this.indexArray2=new al,this.programConfigurations=new pa(d.layers,d.zoom),this.segments=new zs,this.segments2=new zs,this.stateDependentLayerIds=this.layers.filter(function(z){return z.isStateDependent()}).map(function(z){return z.id})};_f.prototype.populate=function(d,z,H){this.hasPattern=W0("fill",this.layers,z);for(var ft=this.layers[0].layout.get("fill-sort-key"),kt=[],It=0,Ht=d;It<Ht.length;It+=1){var ge=Ht[It],Pe=ge.feature,qe=ge.id,Ye=ge.index,xr=ge.sourceLayerIndex,Ir=this.layers[0]._featureFilter.needGeometry,Fr=hs(Pe,Ir);if(this.layers[0]._featureFilter.filter(new Yo(this.zoom),Fr,H)){var en=ft?ft.evaluate(Fr,{},H,z.availableImages):void 0,kn={id:qe,properties:Pe.properties,type:Pe.type,sourceLayerIndex:xr,index:Ye,geometry:Ir?Fr.geometry:is(Pe),patterns:{},sortKey:en};kt.push(kn)}}ft&&kt.sort(function(Wi,Zi){return Wi.sortKey-Zi.sortKey});for(var Zn=0,Hn=kt;Zn<Hn.length;Zn+=1){var aa=Hn[Zn],ma=aa,ra=ma.geometry,Ea=ma.index,Za=ma.sourceLayerIndex;if(this.hasPattern){var oi=Z0("fill",this.layers,aa,this.zoom,z);this.patternFeatures.push(oi)}else this.addFeature(aa,ra,Ea,H,{});var si=d[Ea].feature;z.featureIndex.insert(si,ra,Ea,Za,this.index)}},_f.prototype.update=function(d,z,H){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(d,z,this.stateDependentLayers,H)},_f.prototype.addFeatures=function(d,z,H){for(var ft=0,kt=this.patternFeatures;ft<kt.length;ft+=1){var It=kt[ft];this.addFeature(It,It.geometry,It.index,z,H)}},_f.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},_f.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},_f.prototype.upload=function(d){this.uploaded||(this.layoutVertexBuffer=d.createVertexBuffer(this.layoutVertexArray,d_),this.indexBuffer=d.createIndexBuffer(this.indexArray),this.indexBuffer2=d.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(d),this.uploaded=!0},_f.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},_f.prototype.addFeature=function(d,z,H,ft,kt){for(var It=0,Ht=Bf(z,Wv);It<Ht.length;It+=1){for(var ge=Ht[It],Pe=0,qe=0,Ye=ge;qe<Ye.length;qe+=1){var xr=Ye[qe];Pe+=xr.length}for(var Ir=this.segments.prepareSegment(Pe,this.layoutVertexArray,this.indexArray),Fr=Ir.vertexLength,en=[],kn=[],Zn=0,Hn=ge;Zn<Hn.length;Zn+=1){var aa=Hn[Zn];if(aa.length!==0){aa!==ge[0]&&kn.push(en.length/2);var ma=this.segments2.prepareSegment(aa.length,this.layoutVertexArray,this.indexArray2),ra=ma.vertexLength;this.layoutVertexArray.emplaceBack(aa[0].x,aa[0].y),this.indexArray2.emplaceBack(ra+aa.length-1,ra),en.push(aa[0].x),en.push(aa[0].y);for(var Ea=1;Ea<aa.length;Ea++)this.layoutVertexArray.emplaceBack(aa[Ea].x,aa[Ea].y),this.indexArray2.emplaceBack(ra+Ea-1,ra+Ea),en.push(aa[Ea].x),en.push(aa[Ea].y);ma.vertexLength+=aa.length,ma.primitiveLength+=aa.length}}for(var Za=U0(en,kn),oi=0;oi<Za.length;oi+=3)this.indexArray.emplaceBack(Fr+Za[oi],Fr+Za[oi+1],Fr+Za[oi+2]);Ir.vertexLength+=Pe,Ir.primitiveLength+=Za.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,d,H,kt,ft)},De("FillBucket",_f,{omit:["layers","patternFeatures"]});var sm=new Ii({"fill-sort-key":new ia(ga.layout_fill["fill-sort-key"])}),Kd=new Ii({"fill-antialias":new Cn(ga.paint_fill["fill-antialias"]),"fill-opacity":new ia(ga.paint_fill["fill-opacity"]),"fill-color":new ia(ga.paint_fill["fill-color"]),"fill-outline-color":new ia(ga.paint_fill["fill-outline-color"]),"fill-translate":new Cn(ga.paint_fill["fill-translate"]),"fill-translate-anchor":new Cn(ga.paint_fill["fill-translate-anchor"]),"fill-pattern":new qa(ga.paint_fill["fill-pattern"])}),Zv={paint:Kd,layout:sm},lm=function(d){function z(H){d.call(this,H,Zv)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.recalculate=function(H,ft){d.prototype.recalculate.call(this,H,ft);var kt=this.paint._values["fill-outline-color"];kt.value.kind==="constant"&&kt.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},z.prototype.createBucket=function(H){return new _f(H)},z.prototype.queryRadius=function(){return Yh(this.paint.get("fill-translate"))},z.prototype.queryIntersectsFeature=function(H,ft,kt,It,Ht,ge,Pe){var qe=Ah(H,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),ge.angle,Pe);return uc(qe,It)},z.prototype.isTileClipped=function(){return!0},z}(Ha),Xv=xa([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),gf=Xv.members,id=Dp;function Dp(d,z,H,ft,kt){this.properties={},this.extent=H,this.type=0,this._pbf=d,this._geometry=-1,this._keys=ft,this._values=kt,d.readFields($v,this,z)}function $v(d,z,H){d==1?z.id=H.readVarint():d==2?Jv(H,z):d==3?z.type=H.readVarint():d==4&&(z._geometry=H.pos)}function Jv(d,z){for(var H=d.readVarint()+d.pos;d.pos<H;){var ft=z._keys[d.readVarint()],kt=z._values[d.readVarint()];z.properties[ft]=kt}}Dp.types=["Unknown","Point","LineString","Polygon"],Dp.prototype.loadGeometry=function(){var d=this._pbf;d.pos=this._geometry;for(var z=d.readVarint()+d.pos,H=1,ft=0,kt=0,It=0,Ht=[],ge;d.pos<z;){if(ft<=0){var Pe=d.readVarint();H=Pe&7,ft=Pe>>3}if(ft--,H===1||H===2)kt+=d.readSVarint(),It+=d.readSVarint(),H===1&&(ge&&Ht.push(ge),ge=[]),ge.push(new o(kt,It));else if(H===7)ge&&ge.push(ge[0].clone());else throw new Error("unknown command "+H)}return ge&&Ht.push(ge),Ht},Dp.prototype.bbox=function(){var d=this._pbf;d.pos=this._geometry;for(var z=d.readVarint()+d.pos,H=1,ft=0,kt=0,It=0,Ht=1/0,ge=-1/0,Pe=1/0,qe=-1/0;d.pos<z;){if(ft<=0){var Ye=d.readVarint();H=Ye&7,ft=Ye>>3}if(ft--,H===1||H===2)kt+=d.readSVarint(),It+=d.readSVarint(),kt<Ht&&(Ht=kt),kt>ge&&(ge=kt),It<Pe&&(Pe=It),It>qe&&(qe=It);else if(H!==7)throw new Error("unknown command "+H)}return[Ht,Pe,ge,qe]},Dp.prototype.toGeoJSON=function(d,z,H){var ft=this.extent*Math.pow(2,H),kt=this.extent*d,It=this.extent*z,Ht=this.loadGeometry(),ge=Dp.types[this.type],Pe,qe;function Ye(Fr){for(var en=0;en<Fr.length;en++){var kn=Fr[en],Zn=180-(kn.y+It)*360/ft;Fr[en]=[(kn.x+kt)*360/ft-180,360/Math.PI*Math.atan(Math.exp(Zn*Math.PI/180))-90]}}switch(this.type){case 1:var xr=[];for(Pe=0;Pe<Ht.length;Pe++)xr[Pe]=Ht[Pe][0];Ht=xr,Ye(Ht);break;case 2:for(Pe=0;Pe<Ht.length;Pe++)Ye(Ht[Pe]);break;case 3:for(Ht=Qv(Ht),Pe=0;Pe<Ht.length;Pe++)for(qe=0;qe<Ht[Pe].length;qe++)Ye(Ht[Pe][qe]);break}Ht.length===1?Ht=Ht[0]:ge="Multi"+ge;var Ir={type:"Feature",geometry:{type:ge,coordinates:Ht},properties:this.properties};return"id"in this&&(Ir.id=this.id),Ir};function Qv(d){var z=d.length;if(z<=1)return[d];for(var H=[],ft,kt,It=0;It<z;It++){var Ht=Yv(d[It]);Ht!==0&&(kt===void 0&&(kt=Ht<0),kt===Ht<0?(ft&&H.push(ft),ft=[d[It]]):ft.push(d[It]))}return ft&&H.push(ft),H}function Yv(d){for(var z=0,H=0,ft=d.length,kt=ft-1,It,Ht;H<ft;kt=H++)It=d[H],Ht=d[kt],z+=(Ht.x-It.x)*(It.y+Ht.y);return z}var um=Kv;function Kv(d,z){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=d,this._keys=[],this._values=[],this._features=[],d.readFields(ty,this,z),this.length=this._features.length}function ty(d,z,H){d===15?z.version=H.readVarint():d===1?z.name=H.readString():d===5?z.extent=H.readVarint():d===2?z._features.push(H.pos):d===3?z._keys.push(H.readString()):d===4&&z._values.push(gp(H))}function gp(d){for(var z=null,H=d.readVarint()+d.pos;d.pos<H;){var ft=d.readVarint()>>3;z=ft===1?d.readString():ft===2?d.readFloat():ft===3?d.readDouble():ft===4?d.readVarint64():ft===5?d.readVarint():ft===6?d.readSVarint():ft===7?d.readBoolean():null}return z}Kv.prototype.feature=function(d){if(d<0||d>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[d];var z=this._pbf.readVarint()+this._pbf.pos;return new id(this._pbf,z,this.extent,this._keys,this._values)};var ey=ry;function ry(d,z){this.layers=d.readFields(ny,{},z)}function ny(d,z,H){if(d===3){var ft=new um(H,H.readVarint()+H.pos);ft.length&&(z[ft.name]=ft)}}var ay=ey,__=id,b_=um,zp={VectorTile:ay,VectorTileFeature:__,VectorTileLayer:b_},od=zp.VectorTileFeature.types,iy=500,sd=Math.pow(2,13);function ld(d,z,H,ft,kt,It,Ht,ge){d.emplaceBack(z,H,Math.floor(ft*sd)*2+Ht,kt*sd*2,It*sd*2,Math.round(ge))}var uf=function(d){this.zoom=d.zoom,this.overscaling=d.overscaling,this.layers=d.layers,this.layerIds=this.layers.map(function(z){return z.id}),this.index=d.index,this.hasPattern=!1,this.layoutVertexArray=new Ma,this.indexArray=new Oo,this.programConfigurations=new pa(d.layers,d.zoom),this.segments=new zs,this.stateDependentLayerIds=this.layers.filter(function(z){return z.isStateDependent()}).map(function(z){return z.id})};uf.prototype.populate=function(d,z,H){this.features=[],this.hasPattern=W0("fill-extrusion",this.layers,z);for(var ft=0,kt=d;ft<kt.length;ft+=1){var It=kt[ft],Ht=It.feature,ge=It.id,Pe=It.index,qe=It.sourceLayerIndex,Ye=this.layers[0]._featureFilter.needGeometry,xr=hs(Ht,Ye);if(this.layers[0]._featureFilter.filter(new Yo(this.zoom),xr,H)){var Ir={id:ge,sourceLayerIndex:qe,index:Pe,geometry:Ye?xr.geometry:is(Ht),properties:Ht.properties,type:Ht.type,patterns:{}};this.hasPattern?this.features.push(Z0("fill-extrusion",this.layers,Ir,this.zoom,z)):this.addFeature(Ir,Ir.geometry,Pe,H,{}),z.featureIndex.insert(Ht,Ir.geometry,Pe,qe,this.index,!0)}}},uf.prototype.addFeatures=function(d,z,H){for(var ft=0,kt=this.features;ft<kt.length;ft+=1){var It=kt[ft],Ht=It.geometry;this.addFeature(It,Ht,It.index,z,H)}},uf.prototype.update=function(d,z,H){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(d,z,this.stateDependentLayers,H)},uf.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},uf.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},uf.prototype.upload=function(d){this.uploaded||(this.layoutVertexBuffer=d.createVertexBuffer(this.layoutVertexArray,gf),this.indexBuffer=d.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(d),this.uploaded=!0},uf.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},uf.prototype.addFeature=function(d,z,H,ft,kt){for(var It=0,Ht=Bf(z,iy);It<Ht.length;It+=1){for(var ge=Ht[It],Pe=0,qe=0,Ye=ge;qe<Ye.length;qe+=1){var xr=Ye[qe];Pe+=xr.length}for(var Ir=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),Fr=0,en=ge;Fr<en.length;Fr+=1){var kn=en[Fr];if(kn.length!==0&&!$0(kn))for(var Zn=0,Hn=0;Hn<kn.length;Hn++){var aa=kn[Hn];if(Hn>=1){var ma=kn[Hn-1];if(!X0(aa,ma)){Ir.vertexLength+4>zs.MAX_VERTEX_ARRAY_LENGTH&&(Ir=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var ra=aa.sub(ma)._perp()._unit(),Ea=ma.dist(aa);Zn+Ea>32768&&(Zn=0),ld(this.layoutVertexArray,aa.x,aa.y,ra.x,ra.y,0,0,Zn),ld(this.layoutVertexArray,aa.x,aa.y,ra.x,ra.y,0,1,Zn),Zn+=Ea,ld(this.layoutVertexArray,ma.x,ma.y,ra.x,ra.y,0,0,Zn),ld(this.layoutVertexArray,ma.x,ma.y,ra.x,ra.y,0,1,Zn);var Za=Ir.vertexLength;this.indexArray.emplaceBack(Za,Za+2,Za+1),this.indexArray.emplaceBack(Za+1,Za+2,Za+3),Ir.vertexLength+=4,Ir.primitiveLength+=2}}}}if(Ir.vertexLength+Pe>zs.MAX_VERTEX_ARRAY_LENGTH&&(Ir=this.segments.prepareSegment(Pe,this.layoutVertexArray,this.indexArray)),od[d.type]==="Polygon"){for(var oi=[],si=[],Wi=Ir.vertexLength,Zi=0,ro=ge;Zi<ro.length;Zi+=1){var fo=ro[Zi];if(fo.length!==0){fo!==ge[0]&&si.push(oi.length/2);for(var Eo=0;Eo<fo.length;Eo++){var no=fo[Eo];ld(this.layoutVertexArray,no.x,no.y,0,0,1,1,0),oi.push(no.x),oi.push(no.y)}}}for(var co=U0(oi,si),Bs=0;Bs<co.length;Bs+=3)this.indexArray.emplaceBack(Wi+co[Bs],Wi+co[Bs+2],Wi+co[Bs+1]);Ir.primitiveLength+=co.length/3,Ir.vertexLength+=Pe}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,d,H,kt,ft)},De("FillExtrusionBucket",uf,{omit:["layers","features"]});function X0(d,z){return d.x===z.x&&(d.x<0||d.x>ji)||d.y===z.y&&(d.y<0||d.y>ji)}function $0(d){return d.every(function(z){return z.x<0})||d.every(function(z){return z.x>ji})||d.every(function(z){return z.y<0})||d.every(function(z){return z.y>ji})}var w_=new Ii({"fill-extrusion-opacity":new Cn(ga["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ia(ga["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Cn(ga["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Cn(ga["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new qa(ga["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ia(ga["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ia(ga["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Cn(ga["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),T_={paint:w_},k_=function(d){function z(H){d.call(this,H,T_)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.createBucket=function(H){return new uf(H)},z.prototype.queryRadius=function(){return Yh(this.paint.get("fill-extrusion-translate"))},z.prototype.is3D=function(){return!0},z.prototype.queryIntersectsFeature=function(H,ft,kt,It,Ht,ge,Pe,qe){var Ye=Ah(H,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),ge.angle,Pe),xr=this.paint.get("fill-extrusion-height").evaluate(ft,kt),Ir=this.paint.get("fill-extrusion-base").evaluate(ft,kt),Fr=oy(Ye,qe,ge,0),en=cm(It,Ir,xr,qe),kn=en[0],Zn=en[1];return mp(kn,Zn,Fr)},z}(Ha);function Rf(d,z){return d.x*z.x+d.y*z.y}function Yc(d,z){if(d.length===1){for(var H=0,ft=z[H++],kt;!kt||ft.equals(kt);)if(kt=z[H++],!kt)return 1/0;for(;H<z.length;H++){var It=z[H],Ht=d[0],ge=kt.sub(ft),Pe=It.sub(ft),qe=Ht.sub(ft),Ye=Rf(ge,ge),xr=Rf(ge,Pe),Ir=Rf(Pe,Pe),Fr=Rf(qe,ge),en=Rf(qe,Pe),kn=Ye*Ir-xr*xr,Zn=(Ir*Fr-xr*en)/kn,Hn=(Ye*en-xr*Fr)/kn,aa=1-Zn-Hn,ma=ft.z*aa+kt.z*Zn+It.z*Hn;if(isFinite(ma))return ma}return 1/0}else{for(var ra=1/0,Ea=0,Za=z;Ea<Za.length;Ea+=1){var oi=Za[Ea];ra=Math.min(ra,oi.z)}return ra}}function mp(d,z,H){var ft=1/0;uc(H,z)&&(ft=Yc(H,z[0]));for(var kt=0;kt<z.length;kt++)for(var It=z[kt],Ht=d[kt],ge=0;ge<It.length-1;ge++){var Pe=It[ge],qe=It[ge+1],Ye=Ht[ge],xr=Ht[ge+1],Ir=[Pe,qe,xr,Ye,Pe];Ss(H,Ir)&&(ft=Math.min(ft,Yc(H,Ir)))}return ft===1/0?!1:ft}function cm(d,z,H,ft){for(var kt=[],It=[],Ht=ft[8]*z,ge=ft[9]*z,Pe=ft[10]*z,qe=ft[11]*z,Ye=ft[8]*H,xr=ft[9]*H,Ir=ft[10]*H,Fr=ft[11]*H,en=0,kn=d;en<kn.length;en+=1){for(var Zn=kn[en],Hn=[],aa=[],ma=0,ra=Zn;ma<ra.length;ma+=1){var Ea=ra[ma],Za=Ea.x,oi=Ea.y,si=ft[0]*Za+ft[4]*oi+ft[12],Wi=ft[1]*Za+ft[5]*oi+ft[13],Zi=ft[2]*Za+ft[6]*oi+ft[14],ro=ft[3]*Za+ft[7]*oi+ft[15],fo=si+Ht,Eo=Wi+ge,no=Zi+Pe,co=ro+qe,Bs=si+Ye,xl=Wi+xr,jl=Zi+Ir,Ws=ro+Fr,_l=new o(fo/co,Eo/co);_l.z=no/co,Hn.push(_l);var Rs=new o(Bs/Ws,xl/Ws);Rs.z=jl/Ws,aa.push(Rs)}kt.push(Hn),It.push(aa)}return[kt,It]}function oy(d,z,H,ft){for(var kt=[],It=0,Ht=d;It<Ht.length;It+=1){var ge=Ht[It],Pe=[ge.x,ge.y,ft,1];O0(Pe,Pe,z),kt.push(new o(Pe[0]/Pe[3],Pe[1]/Pe[3]))}return kt}var sy=xa([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),hm=sy.members,A_=xa([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),ly=A_.members,uy=zp.VectorTileFeature.types,cy=63,hy=Math.cos(75/2*(Math.PI/180)),fm=15,pm=20,fy=15,ud=1/2,J0=Math.pow(2,fy-1)/ud,ph=function(d){var z=this;this.zoom=d.zoom,this.overscaling=d.overscaling,this.layers=d.layers,this.layerIds=this.layers.map(function(H){return H.id}),this.index=d.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(H){z.gradients[H.id]={}}),this.layoutVertexArray=new ki,this.layoutVertexArray2=new hi,this.indexArray=new Oo,this.programConfigurations=new pa(d.layers,d.zoom),this.segments=new zs,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(H){return H.isStateDependent()}).map(function(H){return H.id})};ph.prototype.populate=function(d,z,H){this.hasPattern=W0("line",this.layers,z);for(var ft=this.layers[0].layout.get("line-sort-key"),kt=[],It=0,Ht=d;It<Ht.length;It+=1){var ge=Ht[It],Pe=ge.feature,qe=ge.id,Ye=ge.index,xr=ge.sourceLayerIndex,Ir=this.layers[0]._featureFilter.needGeometry,Fr=hs(Pe,Ir);if(this.layers[0]._featureFilter.filter(new Yo(this.zoom),Fr,H)){var en=ft?ft.evaluate(Fr,{},H):void 0,kn={id:qe,properties:Pe.properties,type:Pe.type,sourceLayerIndex:xr,index:Ye,geometry:Ir?Fr.geometry:is(Pe),patterns:{},sortKey:en};kt.push(kn)}}ft&&kt.sort(function(Wi,Zi){return Wi.sortKey-Zi.sortKey});for(var Zn=0,Hn=kt;Zn<Hn.length;Zn+=1){var aa=Hn[Zn],ma=aa,ra=ma.geometry,Ea=ma.index,Za=ma.sourceLayerIndex;if(this.hasPattern){var oi=Z0("line",this.layers,aa,this.zoom,z);this.patternFeatures.push(oi)}else this.addFeature(aa,ra,Ea,H,{});var si=d[Ea].feature;z.featureIndex.insert(si,ra,Ea,Za,this.index)}},ph.prototype.update=function(d,z,H){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(d,z,this.stateDependentLayers,H)},ph.prototype.addFeatures=function(d,z,H){for(var ft=0,kt=this.patternFeatures;ft<kt.length;ft+=1){var It=kt[ft];this.addFeature(It,It.geometry,It.index,z,H)}},ph.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},ph.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ph.prototype.upload=function(d){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=d.createVertexBuffer(this.layoutVertexArray2,ly)),this.layoutVertexBuffer=d.createVertexBuffer(this.layoutVertexArray,hm),this.indexBuffer=d.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(d),this.uploaded=!0},ph.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ph.prototype.lineFeatureClips=function(d){if(d.properties&&d.properties.hasOwnProperty("mapbox_clip_start")&&d.properties.hasOwnProperty("mapbox_clip_end")){var z=+d.properties.mapbox_clip_start,H=+d.properties.mapbox_clip_end;return{start:z,end:H}}},ph.prototype.addFeature=function(d,z,H,ft,kt){var It=this.layers[0].layout,Ht=It.get("line-join").evaluate(d,{}),ge=It.get("line-cap"),Pe=It.get("line-miter-limit"),qe=It.get("line-round-limit");this.lineClips=this.lineFeatureClips(d);for(var Ye=0,xr=z;Ye<xr.length;Ye+=1){var Ir=xr[Ye];this.addLine(Ir,d,Ht,ge,Pe,qe)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,d,H,kt,ft)},ph.prototype.addLine=function(d,z,H,ft,kt,It){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var Ht=0;Ht<d.length-1;Ht++)this.totalDistance+=d[Ht].dist(d[Ht+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var ge=uy[z.type]==="Polygon",Pe=d.length;Pe>=2&&d[Pe-1].equals(d[Pe-2]);)Pe--;for(var qe=0;qe<Pe-1&&d[qe].equals(d[qe+1]);)qe++;if(!(Pe<(ge?3:2))){H==="bevel"&&(kt=1.05);var Ye=this.overscaling<=16?fm*ji/(512*this.overscaling):0,xr=this.segments.prepareSegment(Pe*10,this.layoutVertexArray,this.indexArray),Ir,Fr=void 0,en=void 0,kn=void 0,Zn=void 0;this.e1=this.e2=-1,ge&&(Ir=d[Pe-2],Zn=d[qe].sub(Ir)._unit()._perp());for(var Hn=qe;Hn<Pe;Hn++)if(en=Hn===Pe-1?ge?d[qe+1]:void 0:d[Hn+1],!(en&&d[Hn].equals(en))){Zn&&(kn=Zn),Ir&&(Fr=Ir),Ir=d[Hn],Zn=en?en.sub(Ir)._unit()._perp():kn,kn=kn||Zn;var aa=kn.add(Zn);(aa.x!==0||aa.y!==0)&&aa._unit();var ma=kn.x*Zn.x+kn.y*Zn.y,ra=aa.x*Zn.x+aa.y*Zn.y,Ea=ra!==0?1/ra:1/0,Za=2*Math.sqrt(2-2*ra),oi=ra<hy&&Fr&&en,si=kn.x*Zn.y-kn.y*Zn.x>0;if(oi&&Hn>qe){var Wi=Ir.dist(Fr);if(Wi>2*Ye){var Zi=Ir.sub(Ir.sub(Fr)._mult(Ye/Wi)._round());this.updateDistance(Fr,Zi),this.addCurrentVertex(Zi,kn,0,0,xr),Fr=Zi}}var ro=Fr&&en,fo=ro?H:ge?"butt":ft;if(ro&&fo==="round"&&(Ea<It?fo="miter":Ea<=2&&(fo="fakeround")),fo==="miter"&&Ea>kt&&(fo="bevel"),fo==="bevel"&&(Ea>2&&(fo="flipbevel"),Ea<kt&&(fo="miter")),Fr&&this.updateDistance(Fr,Ir),fo==="miter")aa._mult(Ea),this.addCurrentVertex(Ir,aa,0,0,xr);else if(fo==="flipbevel"){if(Ea>100)aa=Zn.mult(-1);else{var Eo=Ea*kn.add(Zn).mag()/kn.sub(Zn).mag();aa._perp()._mult(Eo*(si?-1:1))}this.addCurrentVertex(Ir,aa,0,0,xr),this.addCurrentVertex(Ir,aa.mult(-1),0,0,xr)}else if(fo==="bevel"||fo==="fakeround"){var no=-Math.sqrt(Ea*Ea-1),co=si?no:0,Bs=si?0:no;if(Fr&&this.addCurrentVertex(Ir,kn,co,Bs,xr),fo==="fakeround")for(var xl=Math.round(Za*180/Math.PI/pm),jl=1;jl<xl;jl++){var Ws=jl/xl;if(Ws!==.5){var _l=Ws-.5,Rs=1.0904+ma*(-3.2452+ma*(3.55645-ma*1.43519)),cu=.848013+ma*(-1.06021+ma*.215638);Ws=Ws+Ws*_l*(Ws-1)*(Rs*_l*_l+cu)}var zl=Zn.sub(kn)._mult(Ws)._add(kn)._unit()._mult(si?-1:1);this.addHalfVertex(Ir,zl.x,zl.y,!1,si,0,xr)}en&&this.addCurrentVertex(Ir,Zn,-co,-Bs,xr)}else if(fo==="butt")this.addCurrentVertex(Ir,aa,0,0,xr);else if(fo==="square"){var hc=Fr?1:-1;this.addCurrentVertex(Ir,aa,hc,hc,xr)}else fo==="round"&&(Fr&&(this.addCurrentVertex(Ir,kn,0,0,xr),this.addCurrentVertex(Ir,kn,1,1,xr,!0)),en&&(this.addCurrentVertex(Ir,Zn,-1,-1,xr,!0),this.addCurrentVertex(Ir,Zn,0,0,xr)));if(oi&&Hn<Pe-1){var mh=Ir.dist(en);if(mh>2*Ye){var Ec=Ir.add(en.sub(Ir)._mult(Ye/mh)._round());this.updateDistance(Ir,Ec),this.addCurrentVertex(Ec,Zn,0,0,xr),Ir=Ec}}}}},ph.prototype.addCurrentVertex=function(d,z,H,ft,kt,It){It===void 0&&(It=!1);var Ht=z.x+z.y*H,ge=z.y-z.x*H,Pe=-z.x+z.y*ft,qe=-z.y-z.x*ft;this.addHalfVertex(d,Ht,ge,It,!1,H,kt),this.addHalfVertex(d,Pe,qe,It,!0,-ft,kt),this.distance>J0/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(d,z,H,ft,kt,It))},ph.prototype.addHalfVertex=function(d,z,H,ft,kt,It,Ht){var ge=d.x,Pe=d.y,qe=this.lineClips?this.scaledDistance*(J0-1):this.scaledDistance,Ye=qe*ud;if(this.layoutVertexArray.emplaceBack((ge<<1)+(ft?1:0),(Pe<<1)+(kt?1:0),Math.round(cy*z)+128,Math.round(cy*H)+128,(It===0?0:It<0?-1:1)+1|(Ye&63)<<2,Ye>>6),this.lineClips){var xr=this.scaledDistance-this.lineClips.start,Ir=this.lineClips.end-this.lineClips.start,Fr=xr/Ir;this.layoutVertexArray2.emplaceBack(Fr,this.lineClipsArray.length)}var en=Ht.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,en),Ht.primitiveLength++),kt?this.e2=en:this.e1=en},ph.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},ph.prototype.updateDistance=function(d,z){this.distance+=d.dist(z),this.updateScaledDistance()},De("LineBucket",ph,{omit:["layers","patternFeatures"]});var dm=new Ii({"line-cap":new Cn(ga.layout_line["line-cap"]),"line-join":new ia(ga.layout_line["line-join"]),"line-miter-limit":new Cn(ga.layout_line["line-miter-limit"]),"line-round-limit":new Cn(ga.layout_line["line-round-limit"]),"line-sort-key":new ia(ga.layout_line["line-sort-key"])}),Q0=new Ii({"line-opacity":new ia(ga.paint_line["line-opacity"]),"line-color":new ia(ga.paint_line["line-color"]),"line-translate":new Cn(ga.paint_line["line-translate"]),"line-translate-anchor":new Cn(ga.paint_line["line-translate-anchor"]),"line-width":new ia(ga.paint_line["line-width"]),"line-gap-width":new ia(ga.paint_line["line-gap-width"]),"line-offset":new ia(ga.paint_line["line-offset"]),"line-blur":new ia(ga.paint_line["line-blur"]),"line-dasharray":new Ra(ga.paint_line["line-dasharray"]),"line-pattern":new qa(ga.paint_line["line-pattern"]),"line-gradient":new ei(ga.paint_line["line-gradient"])}),cd={paint:Q0,layout:dm},gm=function(d){function z(){d.apply(this,arguments)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.possiblyEvaluate=function(H,ft){return ft=new Yo(Math.floor(ft.zoom),{now:ft.now,fadeDuration:ft.fadeDuration,zoomHistory:ft.zoomHistory,transition:ft.transition}),d.prototype.possiblyEvaluate.call(this,H,ft)},z.prototype.evaluate=function(H,ft,kt,It){return ft=M({},ft,{zoom:Math.floor(ft.zoom)}),d.prototype.evaluate.call(this,H,ft,kt,It)},z}(ia),Y0=new gm(cd.paint.properties["line-width"].specification);Y0.useIntegerZoom=!0;var mm=function(d){function z(H){d.call(this,H,cd),this.gradientVersion=0}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype._handleSpecialPaintPropertyUpdate=function(H){if(H==="line-gradient"){var ft=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=ft._styleExpression.expression instanceof Xl,this.gradientVersion=(this.gradientVersion+1)%v}},z.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},z.prototype.recalculate=function(H,ft){d.prototype.recalculate.call(this,H,ft),this.paint._values["line-floorwidth"]=Y0.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,H)},z.prototype.createBucket=function(H){return new ph(H)},z.prototype.queryRadius=function(H){var ft=H,kt=py(Qh("line-width",this,ft),Qh("line-gap-width",this,ft)),It=Qh("line-offset",this,ft);return kt/2+Math.abs(It)+Yh(this.paint.get("line-translate"))},z.prototype.queryIntersectsFeature=function(H,ft,kt,It,Ht,ge,Pe){var qe=Ah(H,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),ge.angle,Pe),Ye=Pe/2*py(this.paint.get("line-width").evaluate(ft,kt),this.paint.get("line-gap-width").evaluate(ft,kt)),xr=this.paint.get("line-offset").evaluate(ft,kt);return xr&&(It=U(It,xr*Pe)),lf(qe,It,Ye)},z.prototype.isTileClipped=function(){return!0},z}(Ha);function py(d,z){return z>0?z+2*d:d}function U(d,z){for(var H=[],ft=new o(0,0),kt=0;kt<d.length;kt++){for(var It=d[kt],Ht=[],ge=0;ge<It.length;ge++){var Pe=It[ge-1],qe=It[ge],Ye=It[ge+1],xr=ge===0?ft:qe.sub(Pe)._unit()._perp(),Ir=ge===It.length-1?ft:Ye.sub(qe)._unit()._perp(),Fr=xr._add(Ir)._unit(),en=Fr.x*Ir.x+Fr.y*Ir.y;Fr._mult(1/en),Ht.push(Fr._mult(z)._add(qe))}H.push(Ht)}return H}var C=xa([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),J=xa([{name:"a_projected_pos",components:3,type:"Float32"}],4);xa([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var ht=xa([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);xa([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);var At=xa([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Bt=xa([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);xa([{name:"triangle",components:3,type:"Uint16"}]),xa([{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"}]),xa([{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"}]),xa([{type:"Float32",name:"offsetX"}]),xa([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function jt(d,z,H){var ft=z.layout.get("text-transform").evaluate(H,{});return ft==="uppercase"?d=d.toLocaleUpperCase():ft==="lowercase"&&(d=d.toLocaleLowerCase()),us.applyArabicShaping&&(d=us.applyArabicShaping(d)),d}function ae(d,z,H){return d.sections.forEach(function(ft){ft.text=jt(ft.text,z,H)}),d}function me(d){var z={},H={},ft=[],kt=0;function It(Hn){ft.push(d[Hn]),kt++}function Ht(Hn,aa,ma){var ra=H[Hn];return delete H[Hn],H[aa]=ra,ft[ra].geometry[0].pop(),ft[ra].geometry[0]=ft[ra].geometry[0].concat(ma[0]),ra}function ge(Hn,aa,ma){var ra=z[aa];return delete z[aa],z[Hn]=ra,ft[ra].geometry[0].shift(),ft[ra].geometry[0]=ma[0].concat(ft[ra].geometry[0]),ra}function Pe(Hn,aa,ma){var ra=ma?aa[0][aa[0].length-1]:aa[0][0];return Hn+":"+ra.x+":"+ra.y}for(var qe=0;qe<d.length;qe++){var Ye=d[qe],xr=Ye.geometry,Ir=Ye.text?Ye.text.toString():null;if(!Ir){It(qe);continue}var Fr=Pe(Ir,xr),en=Pe(Ir,xr,!0);if(Fr in H&&en in z&&H[Fr]!==z[en]){var kn=ge(Fr,en,xr),Zn=Ht(Fr,en,ft[kn].geometry);delete z[Fr],delete H[en],H[Pe(Ir,ft[Zn].geometry,!0)]=Zn,ft[kn].geometry=null}else Fr in H?Ht(Fr,en,xr):en in z?ge(Fr,en,xr):(It(qe),z[Fr]=kt-1,H[en]=kt-1)}return ft.filter(function(Hn){return Hn.geometry})}var Ie={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Ge(d){for(var z="",H=0;H<d.length;H++){var ft=d.charCodeAt(H+1)||null,kt=d.charCodeAt(H-1)||null,It=(!ft||!xn(ft)||Ie[d[H+1]])&&(!kt||!xn(kt)||Ie[d[H-1]]);It&&Ie[d[H]]?z+=Ie[d[H]]:z+=d[H]}return z}var Ke=24,vr=function(d,z,H,ft,kt){var It,Ht,ge=kt*8-ft-1,Pe=(1<<ge)-1,qe=Pe>>1,Ye=-7,xr=H?kt-1:0,Ir=H?-1:1,Fr=d[z+xr];for(xr+=Ir,It=Fr&(1<<-Ye)-1,Fr>>=-Ye,Ye+=ge;Ye>0;It=It*256+d[z+xr],xr+=Ir,Ye-=8);for(Ht=It&(1<<-Ye)-1,It>>=-Ye,Ye+=ft;Ye>0;Ht=Ht*256+d[z+xr],xr+=Ir,Ye-=8);if(It===0)It=1-qe;else{if(It===Pe)return Ht?NaN:(Fr?-1:1)*(1/0);Ht=Ht+Math.pow(2,ft),It=It-qe}return(Fr?-1:1)*Ht*Math.pow(2,It-ft)},Cr=function(d,z,H,ft,kt,It){var Ht,ge,Pe,qe=It*8-kt-1,Ye=(1<<qe)-1,xr=Ye>>1,Ir=kt===23?Math.pow(2,-24)-Math.pow(2,-77):0,Fr=ft?0:It-1,en=ft?1:-1,kn=z<0||z===0&&1/z<0?1:0;for(z=Math.abs(z),isNaN(z)||z===1/0?(ge=isNaN(z)?1:0,Ht=Ye):(Ht=Math.floor(Math.log(z)/Math.LN2),z*(Pe=Math.pow(2,-Ht))<1&&(Ht--,Pe*=2),Ht+xr>=1?z+=Ir/Pe:z+=Ir*Math.pow(2,1-xr),z*Pe>=2&&(Ht++,Pe/=2),Ht+xr>=Ye?(ge=0,Ht=Ye):Ht+xr>=1?(ge=(z*Pe-1)*Math.pow(2,kt),Ht=Ht+xr):(ge=z*Math.pow(2,xr-1)*Math.pow(2,kt),Ht=0));kt>=8;d[H+Fr]=ge&255,Fr+=en,ge/=256,kt-=8);for(Ht=Ht<<kt|ge,qe+=kt;qe>0;d[H+Fr]=Ht&255,Fr+=en,Ht/=256,qe-=8);d[H+Fr-en]|=kn*128},Nr={read:vr,write:Cr},$r=cn;function cn(d){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(d)?d:new Uint8Array(d||0),this.pos=0,this.type=0,this.length=this.buf.length}cn.Varint=0,cn.Fixed64=1,cn.Bytes=2,cn.Fixed32=5;var Pn=65536*65536,ua=1/Pn,Un=12,Kn=typeof TextDecoder>"u"?null:new TextDecoder("utf8");cn.prototype={destroy:function(){this.buf=null},readFields:function(d,z,H){for(H=H||this.length;this.pos<H;){var ft=this.readVarint(),kt=ft>>3,It=this.pos;this.type=ft&7,d(kt,z,this),this.pos===It&&this.skip(ft)}return z},readMessage:function(d,z){return this.readFields(d,z,this.readVarint()+this.pos)},readFixed32:function(){var d=Kh(this.buf,this.pos);return this.pos+=4,d},readSFixed32:function(){var d=kc(this.buf,this.pos);return this.pos+=4,d},readFixed64:function(){var d=Kh(this.buf,this.pos)+Kh(this.buf,this.pos+4)*Pn;return this.pos+=8,d},readSFixed64:function(){var d=Kh(this.buf,this.pos)+kc(this.buf,this.pos+4)*Pn;return this.pos+=8,d},readFloat:function(){var d=Nr.read(this.buf,this.pos,!0,23,4);return this.pos+=4,d},readDouble:function(){var d=Nr.read(this.buf,this.pos,!0,52,8);return this.pos+=8,d},readVarint:function(d){var z=this.buf,H,ft;return ft=z[this.pos++],H=ft&127,ft<128||(ft=z[this.pos++],H|=(ft&127)<<7,ft<128)||(ft=z[this.pos++],H|=(ft&127)<<14,ft<128)||(ft=z[this.pos++],H|=(ft&127)<<21,ft<128)?H:(ft=z[this.pos],H|=(ft&15)<<28,Sa(H,d,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var d=this.readVarint();return d%2===1?(d+1)/-2:d/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var d=this.readVarint()+this.pos,z=this.pos;return this.pos=d,d-z>=Un&&Kn?Rh(this.buf,z,d):Bh(this.buf,z,d)},readBytes:function(){var d=this.readVarint()+this.pos,z=this.buf.subarray(this.pos,d);return this.pos=d,z},readPackedVarint:function(d,z){if(this.type!==cn.Bytes)return d.push(this.readVarint(z));var H=Ya(this);for(d=d||[];this.pos<H;)d.push(this.readVarint(z));return d},readPackedSVarint:function(d){if(this.type!==cn.Bytes)return d.push(this.readSVarint());var z=Ya(this);for(d=d||[];this.pos<z;)d.push(this.readSVarint());return d},readPackedBoolean:function(d){if(this.type!==cn.Bytes)return d.push(this.readBoolean());var z=Ya(this);for(d=d||[];this.pos<z;)d.push(this.readBoolean());return d},readPackedFloat:function(d){if(this.type!==cn.Bytes)return d.push(this.readFloat());var z=Ya(this);for(d=d||[];this.pos<z;)d.push(this.readFloat());return d},readPackedDouble:function(d){if(this.type!==cn.Bytes)return d.push(this.readDouble());var z=Ya(this);for(d=d||[];this.pos<z;)d.push(this.readDouble());return d},readPackedFixed32:function(d){if(this.type!==cn.Bytes)return d.push(this.readFixed32());var z=Ya(this);for(d=d||[];this.pos<z;)d.push(this.readFixed32());return d},readPackedSFixed32:function(d){if(this.type!==cn.Bytes)return d.push(this.readSFixed32());var z=Ya(this);for(d=d||[];this.pos<z;)d.push(this.readSFixed32());return d},readPackedFixed64:function(d){if(this.type!==cn.Bytes)return d.push(this.readFixed64());var z=Ya(this);for(d=d||[];this.pos<z;)d.push(this.readFixed64());return d},readPackedSFixed64:function(d){if(this.type!==cn.Bytes)return d.push(this.readSFixed64());var z=Ya(this);for(d=d||[];this.pos<z;)d.push(this.readSFixed64());return d},skip:function(d){var z=d&7;if(z===cn.Varint)for(;this.buf[this.pos++]>127;);else if(z===cn.Bytes)this.pos=this.readVarint()+this.pos;else if(z===cn.Fixed32)this.pos+=4;else if(z===cn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+z)},writeTag:function(d,z){this.writeVarint(d<<3|z)},realloc:function(d){for(var z=this.length||16;z<this.pos+d;)z*=2;if(z!==this.length){var H=new Uint8Array(z);H.set(this.buf),this.buf=H,this.length=z}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(d){this.realloc(4),cc(this.buf,d,this.pos),this.pos+=4},writeSFixed32:function(d){this.realloc(4),cc(this.buf,d,this.pos),this.pos+=4},writeFixed64:function(d){this.realloc(8),cc(this.buf,d&-1,this.pos),cc(this.buf,Math.floor(d*ua),this.pos+4),this.pos+=8},writeSFixed64:function(d){this.realloc(8),cc(this.buf,d&-1,this.pos),cc(this.buf,Math.floor(d*ua),this.pos+4),this.pos+=8},writeVarint:function(d){if(d=+d||0,d>268435455||d<0){Vo(d,this);return}this.realloc(4),this.buf[this.pos++]=d&127|(d>127?128:0),!(d<=127)&&(this.buf[this.pos++]=(d>>>=7)&127|(d>127?128:0),!(d<=127)&&(this.buf[this.pos++]=(d>>>=7)&127|(d>127?128:0),!(d<=127)&&(this.buf[this.pos++]=d>>>7&127)))},writeSVarint:function(d){this.writeVarint(d<0?-d*2-1:d*2)},writeBoolean:function(d){this.writeVarint(!!d)},writeString:function(d){d=String(d),this.realloc(d.length*4),this.pos++;var z=this.pos;this.pos=jh(this.buf,d,this.pos);var H=this.pos-z;H>=128&&xo(z,H,this),this.pos=z-1,this.writeVarint(H),this.pos+=H},writeFloat:function(d){this.realloc(4),Nr.write(this.buf,d,this.pos,!0,23,4),this.pos+=4},writeDouble:function(d){this.realloc(8),Nr.write(this.buf,d,this.pos,!0,52,8),this.pos+=8},writeBytes:function(d){var z=d.length;this.writeVarint(z),this.realloc(z);for(var H=0;H<z;H++)this.buf[this.pos++]=d[H]},writeRawMessage:function(d,z){this.pos++;var H=this.pos;d(z,this);var ft=this.pos-H;ft>=128&&xo(H,ft,this),this.pos=H-1,this.writeVarint(ft),this.pos+=ft},writeMessage:function(d,z,H){this.writeTag(d,cn.Bytes),this.writeRawMessage(z,H)},writePackedVarint:function(d,z){z.length&&this.writeMessage(d,so,z)},writePackedSVarint:function(d,z){z.length&&this.writeMessage(d,Ki,z)},writePackedBoolean:function(d,z){z.length&&this.writeMessage(d,_o,z)},writePackedFloat:function(d,z){z.length&&this.writeMessage(d,Oa,z)},writePackedDouble:function(d,z){z.length&&this.writeMessage(d,To,z)},writePackedFixed32:function(d,z){z.length&&this.writeMessage(d,Ko,z)},writePackedSFixed32:function(d,z){z.length&&this.writeMessage(d,Bl,z)},writePackedFixed64:function(d,z){z.length&&this.writeMessage(d,Dl,z)},writePackedSFixed64:function(d,z){z.length&&this.writeMessage(d,Uc,z)},writeBytesField:function(d,z){this.writeTag(d,cn.Bytes),this.writeBytes(z)},writeFixed32Field:function(d,z){this.writeTag(d,cn.Fixed32),this.writeFixed32(z)},writeSFixed32Field:function(d,z){this.writeTag(d,cn.Fixed32),this.writeSFixed32(z)},writeFixed64Field:function(d,z){this.writeTag(d,cn.Fixed64),this.writeFixed64(z)},writeSFixed64Field:function(d,z){this.writeTag(d,cn.Fixed64),this.writeSFixed64(z)},writeVarintField:function(d,z){this.writeTag(d,cn.Varint),this.writeVarint(z)},writeSVarintField:function(d,z){this.writeTag(d,cn.Varint),this.writeSVarint(z)},writeStringField:function(d,z){this.writeTag(d,cn.Bytes),this.writeString(z)},writeFloatField:function(d,z){this.writeTag(d,cn.Fixed32),this.writeFloat(z)},writeDoubleField:function(d,z){this.writeTag(d,cn.Fixed64),this.writeDouble(z)},writeBooleanField:function(d,z){this.writeVarintField(d,!!z)}};function Sa(d,z,H){var ft=H.buf,kt,It;if(It=ft[H.pos++],kt=(It&112)>>4,It<128||(It=ft[H.pos++],kt|=(It&127)<<3,It<128)||(It=ft[H.pos++],kt|=(It&127)<<10,It<128)||(It=ft[H.pos++],kt|=(It&127)<<17,It<128)||(It=ft[H.pos++],kt|=(It&127)<<24,It<128)||(It=ft[H.pos++],kt|=(It&1)<<31,It<128))return Qi(d,kt,z);throw new Error("Expected varint not more than 10 bytes")}function Ya(d){return d.type===cn.Bytes?d.readVarint()+d.pos:d.pos+1}function Qi(d,z,H){return H?z*4294967296+(d>>>0):(z>>>0)*4294967296+(d>>>0)}function Vo(d,z){var H,ft;if(d>=0?(H=d%4294967296|0,ft=d/4294967296|0):(H=~(-d%4294967296),ft=~(-d/4294967296),H^4294967295?H=H+1|0:(H=0,ft=ft+1|0)),d>=18446744073709552e3||d<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");z.realloc(10),Vi(H,ft,z),zi(ft,z)}function Vi(d,z,H){H.buf[H.pos++]=d&127|128,d>>>=7,H.buf[H.pos++]=d&127|128,d>>>=7,H.buf[H.pos++]=d&127|128,d>>>=7,H.buf[H.pos++]=d&127|128,d>>>=7,H.buf[H.pos]=d&127}function zi(d,z){var H=(d&7)<<4;z.buf[z.pos++]|=H|((d>>>=3)?128:0),d&&(z.buf[z.pos++]=d&127|((d>>>=7)?128:0),d&&(z.buf[z.pos++]=d&127|((d>>>=7)?128:0),d&&(z.buf[z.pos++]=d&127|((d>>>=7)?128:0),d&&(z.buf[z.pos++]=d&127|((d>>>=7)?128:0),d&&(z.buf[z.pos++]=d&127)))))}function xo(d,z,H){var ft=z<=16383?1:z<=2097151?2:z<=268435455?3:Math.floor(Math.log(z)/(Math.LN2*7));H.realloc(ft);for(var kt=H.pos-1;kt>=d;kt--)H.buf[kt+ft]=H.buf[kt]}function so(d,z){for(var H=0;H<d.length;H++)z.writeVarint(d[H])}function Ki(d,z){for(var H=0;H<d.length;H++)z.writeSVarint(d[H])}function Oa(d,z){for(var H=0;H<d.length;H++)z.writeFloat(d[H])}function To(d,z){for(var H=0;H<d.length;H++)z.writeDouble(d[H])}function _o(d,z){for(var H=0;H<d.length;H++)z.writeBoolean(d[H])}function Ko(d,z){for(var H=0;H<d.length;H++)z.writeFixed32(d[H])}function Bl(d,z){for(var H=0;H<d.length;H++)z.writeSFixed32(d[H])}function Dl(d,z){for(var H=0;H<d.length;H++)z.writeFixed64(d[H])}function Uc(d,z){for(var H=0;H<d.length;H++)z.writeSFixed64(d[H])}function Kh(d,z){return(d[z]|d[z+1]<<8|d[z+2]<<16)+d[z+3]*16777216}function cc(d,z,H){d[H]=z,d[H+1]=z>>>8,d[H+2]=z>>>16,d[H+3]=z>>>24}function kc(d,z){return(d[z]|d[z+1]<<8|d[z+2]<<16)+(d[z+3]<<24)}function Bh(d,z,H){for(var ft="",kt=z;kt<H;){var It=d[kt],Ht=null,ge=It>239?4:It>223?3:It>191?2:1;if(kt+ge>H)break;var Pe,qe,Ye;ge===1?It<128&&(Ht=It):ge===2?(Pe=d[kt+1],(Pe&192)===128&&(Ht=(It&31)<<6|Pe&63,Ht<=127&&(Ht=null))):ge===3?(Pe=d[kt+1],qe=d[kt+2],(Pe&192)===128&&(qe&192)===128&&(Ht=(It&15)<<12|(Pe&63)<<6|qe&63,(Ht<=2047||Ht>=55296&&Ht<=57343)&&(Ht=null))):ge===4&&(Pe=d[kt+1],qe=d[kt+2],Ye=d[kt+3],(Pe&192)===128&&(qe&192)===128&&(Ye&192)===128&&(Ht=(It&15)<<18|(Pe&63)<<12|(qe&63)<<6|Ye&63,(Ht<=65535||Ht>=1114112)&&(Ht=null))),Ht===null?(Ht=65533,ge=1):Ht>65535&&(Ht-=65536,ft+=String.fromCharCode(Ht>>>10&1023|55296),Ht=56320|Ht&1023),ft+=String.fromCharCode(Ht),kt+=ge}return ft}function Rh(d,z,H){return Kn.decode(d.subarray(z,H))}function jh(d,z,H){for(var ft=0,kt,It;ft<z.length;ft++){if(kt=z.charCodeAt(ft),kt>55295&&kt<57344)if(It)if(kt<56320){d[H++]=239,d[H++]=191,d[H++]=189,It=kt;continue}else kt=It-55296<<10|kt-56320|65536,It=null;else{kt>56319||ft+1===z.length?(d[H++]=239,d[H++]=191,d[H++]=189):It=kt;continue}else It&&(d[H++]=239,d[H++]=191,d[H++]=189,It=null);kt<128?d[H++]=kt:(kt<2048?d[H++]=kt>>6|192:(kt<65536?d[H++]=kt>>12|224:(d[H++]=kt>>18|240,d[H++]=kt>>12&63|128),d[H++]=kt>>6&63|128),d[H++]=kt&63|128)}return H}var Ou=3;function Vc(d,z,H){d===1&&H.readMessage(Mh,z)}function Mh(d,z,H){if(d===3){var ft=H.readMessage(dh,{}),kt=ft.id,It=ft.bitmap,Ht=ft.width,ge=ft.height,Pe=ft.left,qe=ft.top,Ye=ft.advance;z.push({id:kt,bitmap:new Tc({width:Ht+2*Ou,height:ge+2*Ou},It),metrics:{width:Ht,height:ge,left:Pe,top:qe,advance:Ye}})}}function dh(d,z,H){d===1?z.id=H.readVarint():d===2?z.bitmap=H.readBytes():d===3?z.width=H.readVarint():d===4?z.height=H.readVarint():d===5?z.left=H.readSVarint():d===6?z.top=H.readSVarint():d===7&&(z.advance=H.readVarint())}function Nh(d){return new $r(d).readFields(Vc,[])}var Kc=Ou;function cf(d){for(var z=0,H=0,ft=0,kt=d;ft<kt.length;ft+=1){var It=kt[ft];z+=It.w*It.h,H=Math.max(H,It.w)}d.sort(function(Zn,Hn){return Hn.h-Zn.h});for(var Ht=Math.max(Math.ceil(Math.sqrt(z/.95)),H),ge=[{x:0,y:0,w:Ht,h:1/0}],Pe=0,qe=0,Ye=0,xr=d;Ye<xr.length;Ye+=1)for(var Ir=xr[Ye],Fr=ge.length-1;Fr>=0;Fr--){var en=ge[Fr];if(!(Ir.w>en.w||Ir.h>en.h)){if(Ir.x=en.x,Ir.y=en.y,qe=Math.max(qe,Ir.y+Ir.h),Pe=Math.max(Pe,Ir.x+Ir.w),Ir.w===en.w&&Ir.h===en.h){var kn=ge.pop();Fr<ge.length&&(ge[Fr]=kn)}else Ir.h===en.h?(en.x+=Ir.w,en.w-=Ir.w):Ir.w===en.w?(en.y+=Ir.h,en.h-=Ir.h):(ge.push({x:en.x+Ir.w,y:en.y,w:en.w-Ir.w,h:Ir.h}),en.y+=Ir.h,en.h-=Ir.h);break}}return{w:Pe,h:qe,fill:z/(Pe*qe)||0}}var iu=1,Js=function(d,z){var H=z.pixelRatio,ft=z.version,kt=z.stretchX,It=z.stretchY,Ht=z.content;this.paddedRect=d,this.pixelRatio=H,this.stretchX=kt,this.stretchY=It,this.content=Ht,this.version=ft},yl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};yl.tl.get=function(){return[this.paddedRect.x+iu,this.paddedRect.y+iu]},yl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-iu,this.paddedRect.y+this.paddedRect.h-iu]},yl.tlbr.get=function(){return this.tl.concat(this.br)},yl.displaySize.get=function(){return[(this.paddedRect.w-iu*2)/this.pixelRatio,(this.paddedRect.h-iu*2)/this.pixelRatio]},Object.defineProperties(Js.prototype,yl);var Al=function(d,z){var H={},ft={};this.haveRenderCallbacks=[];var kt=[];this.addImages(d,H,kt),this.addImages(z,ft,kt);var It=cf(kt),Ht=It.w,ge=It.h,Pe=new fh({width:Ht||1,height:ge||1});for(var qe in d){var Ye=d[qe],xr=H[qe].paddedRect;fh.copy(Ye.data,Pe,{x:0,y:0},{x:xr.x+iu,y:xr.y+iu},Ye.data)}for(var Ir in z){var Fr=z[Ir],en=ft[Ir].paddedRect,kn=en.x+iu,Zn=en.y+iu,Hn=Fr.data.width,aa=Fr.data.height;fh.copy(Fr.data,Pe,{x:0,y:0},{x:kn,y:Zn},Fr.data),fh.copy(Fr.data,Pe,{x:0,y:aa-1},{x:kn,y:Zn-1},{width:Hn,height:1}),fh.copy(Fr.data,Pe,{x:0,y:0},{x:kn,y:Zn+aa},{width:Hn,height:1}),fh.copy(Fr.data,Pe,{x:Hn-1,y:0},{x:kn-1,y:Zn},{width:1,height:aa}),fh.copy(Fr.data,Pe,{x:0,y:0},{x:kn+Hn,y:Zn},{width:1,height:aa})}this.image=Pe,this.iconPositions=H,this.patternPositions=ft};Al.prototype.addImages=function(d,z,H){for(var ft in d){var kt=d[ft],It={x:0,y:0,w:kt.data.width+2*iu,h:kt.data.height+2*iu};H.push(It),z[ft]=new Js(It,kt),kt.hasRenderCallback&&this.haveRenderCallbacks.push(ft)}},Al.prototype.patchUpdatedImages=function(d,z){d.dispatchRenderCallbacks(this.haveRenderCallbacks);for(var H in d.updatedImages)this.patchUpdatedImage(this.iconPositions[H],d.getImage(H),z),this.patchUpdatedImage(this.patternPositions[H],d.getImage(H),z)},Al.prototype.patchUpdatedImage=function(d,z,H){if(!(!d||!z)&&d.version!==z.version){d.version=z.version;var ft=d.tl,kt=ft[0],It=ft[1];H.update(z.data,void 0,{x:kt,y:It})}},De("ImagePosition",Js),De("ImageAtlas",Al);var ku={horizontal:1,vertical:2,horizontalOnly:3},ou=-17;function hd(d){for(var z=0,H=d;z<H.length;z+=1){var ft=H[z];if(ft.positionedGlyphs.length!==0)return!1}return!0}var Mf=57344,Sf=63743,Sh=function(){this.scale=1,this.fontStack="",this.imageName=null};Sh.forText=function(d,z){var H=new Sh;return H.scale=d||1,H.fontStack=z,H},Sh.forImage=function(d){var z=new Sh;return z.imageName=d,z};var Rl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};Rl.fromFeature=function(d,z){for(var H=new Rl,ft=0;ft<d.sections.length;ft++){var kt=d.sections[ft];kt.image?H.addImageSection(kt):H.addTextSection(kt,z)}return H},Rl.prototype.length=function(){return this.text.length},Rl.prototype.getSection=function(d){return this.sections[this.sectionIndex[d]]},Rl.prototype.getSectionIndex=function(d){return this.sectionIndex[d]},Rl.prototype.getCharCode=function(d){return this.text.charCodeAt(d)},Rl.prototype.verticalizePunctuation=function(){this.text=Ge(this.text)},Rl.prototype.trim=function(){for(var d=0,z=0;z<this.text.length&&hf[this.text.charCodeAt(z)];z++)d++;for(var H=this.text.length,ft=this.text.length-1;ft>=0&&ft>=d&&hf[this.text.charCodeAt(ft)];ft--)H--;this.text=this.text.substring(d,H),this.sectionIndex=this.sectionIndex.slice(d,H)},Rl.prototype.substring=function(d,z){var H=new Rl;return H.text=this.text.substring(d,z),H.sectionIndex=this.sectionIndex.slice(d,z),H.sections=this.sections,H},Rl.prototype.toString=function(){return this.text},Rl.prototype.getMaxScale=function(){var d=this;return this.sectionIndex.reduce(function(z,H){return Math.max(z,d.sections[H].scale)},0)},Rl.prototype.addTextSection=function(d,z){this.text+=d.text,this.sections.push(Sh.forText(d.scale,d.fontStack||z));for(var H=this.sections.length-1,ft=0;ft<d.text.length;++ft)this.sectionIndex.push(H)},Rl.prototype.addImageSection=function(d){var z=d.image?d.image.name:"";if(z.length===0){j("Can't add FormattedSection with an empty image.");return}var H=this.getNextImageSectionCharCode();if(!H){j("Reached maximum number of images "+(Sf-Mf+2));return}this.text+=String.fromCharCode(H),this.sections.push(Sh.forImage(z)),this.sectionIndex.push(this.sections.length-1)},Rl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=Sf?null:++this.imageSectionID:(this.imageSectionID=Mf,this.imageSectionID)};function th(d,z){for(var H=[],ft=d.text,kt=0,It=0,Ht=z;It<Ht.length;It+=1){var ge=Ht[It];H.push(d.substring(kt,ge)),kt=ge}return kt<ft.length&&H.push(d.substring(kt,ft.length)),H}function bf(d,z,H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir,Fr,en,kn){var Zn=Rl.fromFeature(d,kt);xr===ku.vertical&&Zn.verticalizePunctuation();var Hn,aa=us.processBidirectionalText,ma=us.processStyledBidirectionalText;if(aa&&Zn.sections.length===1){Hn=[];for(var ra=aa(Zn.toString(),bm(Zn,qe,It,z,ft,Fr,en)),Ea=0,Za=ra;Ea<Za.length;Ea+=1){var oi=Za[Ea],si=new Rl;si.text=oi,si.sections=Zn.sections;for(var Wi=0;Wi<oi.length;Wi++)si.sectionIndex.push(0);Hn.push(si)}}else if(ma){Hn=[];for(var Zi=ma(Zn.text,Zn.sectionIndex,bm(Zn,qe,It,z,ft,Fr,en)),ro=0,fo=Zi;ro<fo.length;ro+=1){var Eo=fo[ro],no=new Rl;no.text=Eo[0],no.sectionIndex=Eo[1],no.sections=Zn.sections,Hn.push(no)}}else Hn=th(Zn,bm(Zn,qe,It,z,ft,Fr,en));var co=[],Bs={positionedLines:co,text:Zn.toString(),top:Ye[1],bottom:Ye[1],left:Ye[0],right:Ye[0],writingMode:xr,iconsInText:!1,verticalizable:!1};return M_(Bs,z,H,ft,Hn,Ht,ge,Pe,xr,qe,Ir,kn),hd(co)?!1:Bs}var hf={};hf[9]=!0,hf[10]=!0,hf[11]=!0,hf[12]=!0,hf[13]=!0,hf[32]=!0;var Uh={};Uh[10]=!0,Uh[32]=!0,Uh[38]=!0,Uh[40]=!0,Uh[41]=!0,Uh[43]=!0,Uh[45]=!0,Uh[47]=!0,Uh[173]=!0,Uh[183]=!0,Uh[8203]=!0,Uh[8208]=!0,Uh[8211]=!0,Uh[8231]=!0;function vm(d,z,H,ft,kt,It){if(z.imageName){var Ht=ft[z.imageName];return Ht?Ht.displaySize[0]*z.scale*Ke/It+kt:0}else{var ge=H[z.fontStack],Pe=ge&&ge[d];return Pe?Pe.metrics.advance*z.scale+kt:0}}function ym(d,z,H,ft,kt,It){for(var Ht=0,ge=0;ge<d.length();ge++){var Pe=d.getSection(ge);Ht+=vm(d.getCharCode(ge),Pe,ft,kt,z,It)}var qe=Math.max(1,Math.ceil(Ht/H));return Ht/qe}function K0(d,z,H,ft){var kt=Math.pow(d-z,2);return ft?d<z?kt/2:kt*2:kt+Math.abs(H)*H}function Qf(d,z,H){var ft=0;return d===10&&(ft-=1e4),H&&(ft+=150),(d===40||d===65288)&&(ft+=50),(z===41||z===65289)&&(ft+=50),ft}function xm(d,z,H,ft,kt,It){for(var Ht=null,ge=K0(z,H,kt,It),Pe=0,qe=ft;Pe<qe.length;Pe+=1){var Ye=qe[Pe],xr=z-Ye.x,Ir=K0(xr,H,kt,It)+Ye.badness;Ir<=ge&&(Ht=Ye,ge=Ir)}return{index:d,x:z,priorBreak:Ht,badness:ge}}function _m(d){return d?_m(d.priorBreak).concat(d.index):[]}function bm(d,z,H,ft,kt,It,Ht){if(It!=="point")return[];if(!d)return[];for(var ge=[],Pe=ym(d,z,H,ft,kt,Ht),qe=d.text.indexOf("")>=0,Ye=0,xr=0;xr<d.length();xr++){var Ir=d.getSection(xr),Fr=d.getCharCode(xr);if(hf[Fr]||(Ye+=vm(Fr,Ir,ft,kt,z,Ht)),xr<d.length()-1){var en=In(Fr);(Uh[Fr]||en||Ir.imageName)&&ge.push(xm(xr+1,Ye,Pe,ge,Qf(Fr,d.getCharCode(xr+1),en&&qe),!1))}}return _m(xm(d.length(),Ye,Pe,ge,0,!0))}function wm(d){var z=.5,H=.5;switch(d){case"right":case"top-right":case"bottom-right":z=1;break;case"left":case"top-left":case"bottom-left":z=0;break}switch(d){case"bottom":case"bottom-right":case"bottom-left":H=1;break;case"top":case"top-right":case"top-left":H=0;break}return{horizontalAlign:z,verticalAlign:H}}function M_(d,z,H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr){for(var Ir=0,Fr=ou,en=0,kn=0,Zn=ge==="right"?1:ge==="left"?0:.5,Hn=0,aa=0,ma=kt;aa<ma.length;aa+=1){var ra=ma[aa];ra.trim();var Ea=ra.getMaxScale(),Za=(Ea-1)*Ke,oi={positionedGlyphs:[],lineOffset:0};d.positionedLines[Hn]=oi;var si=oi.positionedGlyphs,Wi=0;if(!ra.length()){Fr+=It,++Hn;continue}for(var Zi=0;Zi<ra.length();Zi++){var ro=ra.getSection(Zi),fo=ra.getSectionIndex(Zi),Eo=ra.getCharCode(Zi),no=0,co=null,Bs=null,xl=null,jl=Ke,Ws=!(Pe===ku.horizontal||!Ye&&!Dn(Eo)||Ye&&(hf[Eo]||_a(Eo)));if(ro.imageName){var _l=ft[ro.imageName];if(!_l)continue;xl=ro.imageName,d.iconsInText=d.iconsInText||!0,Bs=_l.paddedRect;var Rs=_l.displaySize;ro.scale=ro.scale*Ke/xr,co={width:Rs[0],height:Rs[1],left:iu,top:-Kc,advance:Ws?Rs[1]:Rs[0]};var cu=Ke-Rs[1]*ro.scale;no=Za+cu,jl=co.advance;var zl=Ws?Rs[0]*ro.scale-Ke*Ea:Rs[1]*ro.scale-Ke*Ea;zl>0&&zl>Wi&&(Wi=zl)}else{var hc=H[ro.fontStack],mh=hc&&hc[Eo];if(mh&&mh.rect)Bs=mh.rect,co=mh.metrics;else{var Ec=z[ro.fontStack],Vh=Ec&&Ec[Eo];if(!Vh)continue;co=Vh.metrics}no=(Ea-ro.scale)*Ke}Ws?(d.verticalizable=!0,si.push({glyph:Eo,imageName:xl,x:Ir,y:Fr+no,vertical:Ws,scale:ro.scale,fontStack:ro.fontStack,sectionIndex:fo,metrics:co,rect:Bs}),Ir+=jl*ro.scale+qe):(si.push({glyph:Eo,imageName:xl,x:Ir,y:Fr+no,vertical:Ws,scale:ro.scale,fontStack:ro.fontStack,sectionIndex:fo,metrics:co,rect:Bs}),Ir+=co.advance*ro.scale+qe)}if(si.length!==0){var qh=Ir-qe;en=Math.max(qh,en),S_(si,0,si.length-1,Zn,Wi)}Ir=0;var Hh=It*Ea+Wi;oi.lineOffset=Math.max(Wi,Za),Fr+=Hh,kn=Math.max(Hh,kn),++Hn}var rh=Fr-ou,tf=wm(Ht),ef=tf.horizontalAlign,qc=tf.verticalAlign;E_(d.positionedLines,Zn,ef,qc,en,kn,It,rh,kt.length),d.top+=-qc*rh,d.bottom=d.top+rh,d.left+=-ef*en,d.right=d.left+en}function S_(d,z,H,ft,kt){if(!(!ft&&!kt))for(var It=d[H],Ht=It.metrics.advance*It.scale,ge=(d[H].x+Ht)*ft,Pe=z;Pe<=H;Pe++)d[Pe].x-=ge,d[Pe].y+=kt}function E_(d,z,H,ft,kt,It,Ht,ge,Pe){var qe=(z-H)*kt,Ye=0;It!==Ht?Ye=-ge*ft-ou:Ye=(-ft*Pe+.5)*Ht;for(var xr=0,Ir=d;xr<Ir.length;xr+=1)for(var Fr=Ir[xr],en=0,kn=Fr.positionedGlyphs;en<kn.length;en+=1){var Zn=kn[en];Zn.x+=qe,Zn.y+=Ye}}function P_(d,z,H){var ft=wm(H),kt=ft.horizontalAlign,It=ft.verticalAlign,Ht=z[0],ge=z[1],Pe=Ht-d.displaySize[0]*kt,qe=Pe+d.displaySize[0],Ye=ge-d.displaySize[1]*It,xr=Ye+d.displaySize[1];return{image:d,top:Ye,bottom:xr,left:Pe,right:qe}}function dy(d,z,H,ft,kt,It){var Ht=d.image,ge;if(Ht.content){var Pe=Ht.content,qe=Ht.pixelRatio||1;ge=[Pe[0]/qe,Pe[1]/qe,Ht.displaySize[0]-Pe[2]/qe,Ht.displaySize[1]-Pe[3]/qe]}var Ye=z.left*It,xr=z.right*It,Ir,Fr,en,kn;H==="width"||H==="both"?(kn=kt[0]+Ye-ft[3],Fr=kt[0]+xr+ft[1]):(kn=kt[0]+(Ye+xr-Ht.displaySize[0])/2,Fr=kn+Ht.displaySize[0]);var Zn=z.top*It,Hn=z.bottom*It;return H==="height"||H==="both"?(Ir=kt[1]+Zn-ft[0],en=kt[1]+Hn+ft[2]):(Ir=kt[1]+(Zn+Hn-Ht.displaySize[1])/2,en=Ir+Ht.displaySize[1]),{image:Ht,top:Ir,right:Fr,bottom:en,left:kn,collisionPadding:ge}}var fd=function(d){function z(H,ft,kt,It){d.call(this,H,ft),this.angle=kt,It!==void 0&&(this.segment=It)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.clone=function(){return new z(this.x,this.y,this.angle,this.segment)},z}(o);De("Anchor",fd);var Ac=128;function pd(d,z){var H=z.expression;if(H.kind==="constant"){var ft=H.evaluate(new Yo(d+1));return{kind:"constant",layoutSize:ft}}else{if(H.kind==="source")return{kind:"source"};for(var kt=H.zoomStops,It=H.interpolationType,Ht=0;Ht<kt.length&&kt[Ht]<=d;)Ht++;Ht=Math.max(0,Ht-1);for(var ge=Ht;ge<kt.length&&kt[ge]<d+1;)ge++;ge=Math.min(kt.length-1,ge);var Pe=kt[Ht],qe=kt[ge];if(H.kind==="composite")return{kind:"composite",minZoom:Pe,maxZoom:qe,interpolationType:It};var Ye=H.evaluate(new Yo(Pe)),xr=H.evaluate(new Yo(qe));return{kind:"camera",minZoom:Pe,maxZoom:qe,minSize:Ye,maxSize:xr,interpolationType:It}}}function Tm(d,z,H){var ft=z.uSize,kt=z.uSizeT,It=H.lowerSize,Ht=H.upperSize;return d.kind==="source"?It/Ac:d.kind==="composite"?Ds(It/Ac,Ht/Ac,kt):ft}function gy(d,z){var H=0,ft=0;if(d.kind==="constant")ft=d.layoutSize;else if(d.kind!=="source"){var kt=d.interpolationType,It=d.minZoom,Ht=d.maxZoom,ge=kt?l(cl.interpolationFactor(kt,z,It,Ht),0,1):0;d.kind==="camera"?ft=Ds(d.minSize,d.maxSize,ge):H=ge}return{uSizeT:H,uSize:ft}}var I_=Object.freeze({__proto__:null,getSizeData:pd,evaluateSizeForFeature:Tm,evaluateSizeForZoom:gy,SIZE_PACK_FACTOR:Ac});function my(d,z,H,ft,kt){if(z.segment===void 0)return!0;for(var It=z,Ht=z.segment+1,ge=0;ge>-H/2;){if(Ht--,Ht<0)return!1;ge-=d[Ht].dist(It),It=d[Ht]}ge+=d[Ht].dist(d[Ht+1]),Ht++;for(var Pe=[],qe=0;ge<H/2;){var Ye=d[Ht-1],xr=d[Ht],Ir=d[Ht+1];if(!Ir)return!1;var Fr=Ye.angleTo(xr)-xr.angleTo(Ir);for(Fr=Math.abs((Fr+3*Math.PI)%(Math.PI*2)-Math.PI),Pe.push({distance:ge,angleDelta:Fr}),qe+=Fr;ge-Pe[0].distance>ft;)qe-=Pe.shift().angleDelta;if(qe>kt)return!1;Ht++,ge+=xr.dist(Ir)}return!0}function gh(d){for(var z=0,H=0;H<d.length-1;H++)z+=d[H].dist(d[H+1]);return z}function ff(d,z,H){return d?3/5*z*H:0}function vp(d,z){return Math.max(d?d.right-d.left:0,z?z.right-z.left:0)}function Ef(d,z,H,ft,kt,It){for(var Ht=ff(H,kt,It),ge=vp(H,ft)*It,Pe=0,qe=gh(d)/2,Ye=0;Ye<d.length-1;Ye++){var xr=d[Ye],Ir=d[Ye+1],Fr=xr.dist(Ir);if(Pe+Fr>qe){var en=(qe-Pe)/Fr,kn=Ds(xr.x,Ir.x,en),Zn=Ds(xr.y,Ir.y,en),Hn=new fd(kn,Zn,Ir.angleTo(xr),Ye);return Hn._round(),!Ht||my(d,Hn,ge,Ht,z)?Hn:void 0}Pe+=Fr}}function Op(d,z,H,ft,kt,It,Ht,ge,Pe){var qe=ff(ft,It,Ht),Ye=vp(ft,kt),xr=Ye*Ht,Ir=d[0].x===0||d[0].x===Pe||d[0].y===0||d[0].y===Pe;z-xr<z/4&&(z=xr+z/4);var Fr=It*2,en=Ir?z/2*ge%z:(Ye/2+Fr)*Ht*ge%z;return Pf(d,en,z,qe,H,xr,Ir,!1,Pe)}function Pf(d,z,H,ft,kt,It,Ht,ge,Pe){for(var qe=It/2,Ye=gh(d),xr=0,Ir=z-H,Fr=[],en=0;en<d.length-1;en++){for(var kn=d[en],Zn=d[en+1],Hn=kn.dist(Zn),aa=Zn.angleTo(kn);Ir+H<xr+Hn;){Ir+=H;var ma=(Ir-xr)/Hn,ra=Ds(kn.x,Zn.x,ma),Ea=Ds(kn.y,Zn.y,ma);if(ra>=0&&ra<Pe&&Ea>=0&&Ea<Pe&&Ir-qe>=0&&Ir+qe<=Ye){var Za=new fd(ra,Ea,aa,en);Za._round(),(!ft||my(d,Za,It,ft,kt))&&Fr.push(Za)}}xr+=Hn}return!ge&&!Fr.length&&!Ht&&(Fr=Pf(d,xr/2,H,ft,kt,It,Ht,!0,Pe)),Fr}function nT(d,z,H,ft,kt){for(var It=[],Ht=0;Ht<d.length;Ht++)for(var ge=d[Ht],Pe=void 0,qe=0;qe<ge.length-1;qe++){var Ye=ge[qe],xr=ge[qe+1];Ye.x<z&&xr.x<z||(Ye.x<z?Ye=new o(z,Ye.y+(xr.y-Ye.y)*((z-Ye.x)/(xr.x-Ye.x)))._round():xr.x<z&&(xr=new o(z,Ye.y+(xr.y-Ye.y)*((z-Ye.x)/(xr.x-Ye.x)))._round()),!(Ye.y<H&&xr.y<H)&&(Ye.y<H?Ye=new o(Ye.x+(xr.x-Ye.x)*((H-Ye.y)/(xr.y-Ye.y)),H)._round():xr.y<H&&(xr=new o(Ye.x+(xr.x-Ye.x)*((H-Ye.y)/(xr.y-Ye.y)),H)._round()),!(Ye.x>=ft&&xr.x>=ft)&&(Ye.x>=ft?Ye=new o(ft,Ye.y+(xr.y-Ye.y)*((ft-Ye.x)/(xr.x-Ye.x)))._round():xr.x>=ft&&(xr=new o(ft,Ye.y+(xr.y-Ye.y)*((ft-Ye.x)/(xr.x-Ye.x)))._round()),!(Ye.y>=kt&&xr.y>=kt)&&(Ye.y>=kt?Ye=new o(Ye.x+(xr.x-Ye.x)*((kt-Ye.y)/(xr.y-Ye.y)),kt)._round():xr.y>=kt&&(xr=new o(Ye.x+(xr.x-Ye.x)*((kt-Ye.y)/(xr.y-Ye.y)),kt)._round()),(!Pe||!Ye.equals(Pe[Pe.length-1]))&&(Pe=[Ye],It.push(Pe)),Pe.push(xr)))))}return It}var tg=iu;function aT(d,z,H,ft){var kt=[],It=d.image,Ht=It.pixelRatio,ge=It.paddedRect.w-2*tg,Pe=It.paddedRect.h-2*tg,qe=d.right-d.left,Ye=d.bottom-d.top,xr=It.stretchX||[[0,ge]],Ir=It.stretchY||[[0,Pe]],Fr=function(_l,Rs){return _l+Rs[1]-Rs[0]},en=xr.reduce(Fr,0),kn=Ir.reduce(Fr,0),Zn=ge-en,Hn=Pe-kn,aa=0,ma=en,ra=0,Ea=kn,Za=0,oi=Zn,si=0,Wi=Hn;if(It.content&&ft){var Zi=It.content;aa=vy(xr,0,Zi[0]),ra=vy(Ir,0,Zi[1]),ma=vy(xr,Zi[0],Zi[2]),Ea=vy(Ir,Zi[1],Zi[3]),Za=Zi[0]-aa,si=Zi[1]-ra,oi=Zi[2]-Zi[0]-ma,Wi=Zi[3]-Zi[1]-Ea}var ro=function(_l,Rs,cu,zl){var hc=yy(_l.stretch-aa,ma,qe,d.left),mh=xy(_l.fixed-Za,oi,_l.stretch,en),Ec=yy(Rs.stretch-ra,Ea,Ye,d.top),Vh=xy(Rs.fixed-si,Wi,Rs.stretch,kn),qh=yy(cu.stretch-aa,ma,qe,d.left),Hh=xy(cu.fixed-Za,oi,cu.stretch,en),rh=yy(zl.stretch-ra,Ea,Ye,d.top),tf=xy(zl.fixed-si,Wi,zl.stretch,kn),ef=new o(hc,Ec),qc=new o(qh,Ec),rf=new o(qh,rh),wf=new o(hc,rh),Rp=new o(mh/Ht,Vh/Ht),md=new o(Hh/Ht,tf/Ht),vd=z*Math.PI/180;if(vd){var yd=Math.sin(vd),lg=Math.cos(vd),jf=[lg,-yd,yd,lg];ef._matMult(jf),qc._matMult(jf),wf._matMult(jf),rf._matMult(jf)}var Ay=_l.stretch+_l.fixed,R_=cu.stretch+cu.fixed,My=Rs.stretch+Rs.fixed,j_=zl.stretch+zl.fixed,If={x:It.paddedRect.x+tg+Ay,y:It.paddedRect.y+tg+My,w:R_-Ay,h:j_-My},ug=oi/Ht/qe,Sy=Wi/Ht/Ye;return{tl:ef,tr:qc,bl:wf,br:rf,tex:If,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Rp,pixelOffsetBR:md,minFontScaleX:ug,minFontScaleY:Sy,isSDF:H}};if(!ft||!It.stretchX&&!It.stretchY)kt.push(ro({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:ge+1},{fixed:0,stretch:Pe+1}));else for(var fo=iT(xr,Zn,en),Eo=iT(Ir,Hn,kn),no=0;no<fo.length-1;no++)for(var co=fo[no],Bs=fo[no+1],xl=0;xl<Eo.length-1;xl++){var jl=Eo[xl],Ws=Eo[xl+1];kt.push(ro(co,jl,Bs,Ws))}return kt}function vy(d,z,H){for(var ft=0,kt=0,It=d;kt<It.length;kt+=1){var Ht=It[kt];ft+=Math.max(z,Math.min(H,Ht[1]))-Math.max(z,Math.min(H,Ht[0]))}return ft}function iT(d,z,H){for(var ft=[{fixed:-tg,stretch:0}],kt=0,It=d;kt<It.length;kt+=1){var Ht=It[kt],ge=Ht[0],Pe=Ht[1],qe=ft[ft.length-1];ft.push({fixed:ge-qe.stretch,stretch:qe.stretch}),ft.push({fixed:ge-qe.stretch,stretch:qe.stretch+(Pe-ge)})}return ft.push({fixed:z+tg,stretch:H}),ft}function yy(d,z,H,ft){return d/z*H+ft}function xy(d,z,H,ft){return d-z*H/ft}function kD(d,z,H,ft,kt,It,Ht,ge){for(var Pe=ft.layout.get("text-rotate").evaluate(It,{})*Math.PI/180,qe=[],Ye=0,xr=z.positionedLines;Ye<xr.length;Ye+=1)for(var Ir=xr[Ye],Fr=0,en=Ir.positionedGlyphs;Fr<en.length;Fr+=1){var kn=en[Fr];if(kn.rect){var Zn=kn.rect||{},Hn=1,aa=Kc+Hn,ma=!0,ra=1,Ea=0,Za=(kt||ge)&&kn.vertical,oi=kn.metrics.advance*kn.scale/2;if(ge&&z.verticalizable){var si=(kn.scale-1)*Ke,Wi=(Ke-kn.metrics.width*kn.scale)/2;Ea=Ir.lineOffset/2-(kn.imageName?-Wi:si)}if(kn.imageName){var Zi=Ht[kn.imageName];ma=Zi.sdf,ra=Zi.pixelRatio,aa=iu/ra}var ro=kt?[kn.x+oi,kn.y]:[0,0],fo=kt?[0,0]:[kn.x+oi+H[0],kn.y+H[1]-Ea],Eo=[0,0];Za&&(Eo=fo,fo=[0,0]);var no=(kn.metrics.left-aa)*kn.scale-oi+fo[0],co=(-kn.metrics.top-aa)*kn.scale+fo[1],Bs=no+Zn.w*kn.scale/ra,xl=co+Zn.h*kn.scale/ra,jl=new o(no,co),Ws=new o(Bs,co),_l=new o(no,xl),Rs=new o(Bs,xl);if(Za){var cu=new o(-oi,oi-ou),zl=-Math.PI/2,hc=Ke/2-oi,mh=kn.imageName?hc:0,Ec=new o(5-ou-hc,-mh),Vh=new(Function.prototype.bind.apply(o,[null].concat(Eo)));jl._rotateAround(zl,cu)._add(Ec)._add(Vh),Ws._rotateAround(zl,cu)._add(Ec)._add(Vh),_l._rotateAround(zl,cu)._add(Ec)._add(Vh),Rs._rotateAround(zl,cu)._add(Ec)._add(Vh)}if(Pe){var qh=Math.sin(Pe),Hh=Math.cos(Pe),rh=[Hh,-qh,qh,Hh];jl._matMult(rh),Ws._matMult(rh),_l._matMult(rh),Rs._matMult(rh)}var tf=new o(0,0),ef=new o(0,0),qc=0,rf=0;qe.push({tl:jl,tr:Ws,bl:_l,br:Rs,tex:Zn,writingMode:z.writingMode,glyphOffset:ro,sectionIndex:kn.sectionIndex,isSDF:ma,pixelOffsetTL:tf,pixelOffsetBR:ef,minFontScaleX:qc,minFontScaleY:rf})}}return qe}var _y=function(d,z,H,ft,kt,It,Ht,ge,Pe,qe){if(this.boxStartIndex=d.length,Pe){var Ye=It.top,xr=It.bottom,Ir=It.collisionPadding;Ir&&(Ye-=Ir[1],xr+=Ir[3]);var Fr=xr-Ye;Fr>0&&(Fr=Math.max(10,Fr),this.circleDiameter=Fr)}else{var en=It.top*Ht-ge,kn=It.bottom*Ht+ge,Zn=It.left*Ht-ge,Hn=It.right*Ht+ge,aa=It.collisionPadding;if(aa&&(Zn-=aa[0]*Ht,en-=aa[1]*Ht,Hn+=aa[2]*Ht,kn+=aa[3]*Ht),qe){var ma=new o(Zn,en),ra=new o(Hn,en),Ea=new o(Zn,kn),Za=new o(Hn,kn),oi=qe*Math.PI/180;ma._rotate(oi),ra._rotate(oi),Ea._rotate(oi),Za._rotate(oi),Zn=Math.min(ma.x,ra.x,Ea.x,Za.x),Hn=Math.max(ma.x,ra.x,Ea.x,Za.x),en=Math.min(ma.y,ra.y,Ea.y,Za.y),kn=Math.max(ma.y,ra.y,Ea.y,Za.y)}d.emplaceBack(z.x,z.y,Zn,en,Hn,kn,H,ft,kt)}this.boxEndIndex=d.length},eg=function(d,z){if(d===void 0&&(d=[]),z===void 0&&(z=AD),this.data=d,this.length=this.data.length,this.compare=z,this.length>0)for(var H=(this.length>>1)-1;H>=0;H--)this._down(H)};eg.prototype.push=function(d){this.data.push(d),this.length++,this._up(this.length-1)},eg.prototype.pop=function(){if(this.length!==0){var d=this.data[0],z=this.data.pop();return this.length--,this.length>0&&(this.data[0]=z,this._down(0)),d}},eg.prototype.peek=function(){return this.data[0]},eg.prototype._up=function(d){for(var z=this,H=z.data,ft=z.compare,kt=H[d];d>0;){var It=d-1>>1,Ht=H[It];if(ft(kt,Ht)>=0)break;H[d]=Ht,d=It}H[d]=kt},eg.prototype._down=function(d){for(var z=this,H=z.data,ft=z.compare,kt=this.length>>1,It=H[d];d<kt;){var Ht=(d<<1)+1,ge=H[Ht],Pe=Ht+1;if(Pe<this.length&&ft(H[Pe],ge)<0&&(Ht=Pe,ge=H[Pe]),ft(ge,It)>=0)break;H[d]=ge,d=Ht}H[d]=It};function AD(d,z){return d<z?-1:d>z?1:0}function MD(d,z,H){H===void 0&&(H=!1);for(var ft=1/0,kt=1/0,It=-1/0,Ht=-1/0,ge=d[0],Pe=0;Pe<ge.length;Pe++){var qe=ge[Pe];(!Pe||qe.x<ft)&&(ft=qe.x),(!Pe||qe.y<kt)&&(kt=qe.y),(!Pe||qe.x>It)&&(It=qe.x),(!Pe||qe.y>Ht)&&(Ht=qe.y)}var Ye=It-ft,xr=Ht-kt,Ir=Math.min(Ye,xr),Fr=Ir/2,en=new eg([],SD);if(Ir===0)return new o(ft,kt);for(var kn=ft;kn<It;kn+=Ir)for(var Zn=kt;Zn<Ht;Zn+=Ir)en.push(new rg(kn+Fr,Zn+Fr,Fr,d));for(var Hn=PD(d),aa=en.length;en.length;){var ma=en.pop();(ma.d>Hn.d||!Hn.d)&&(Hn=ma,H&&console.log("found best %d after %d probes",Math.round(1e4*ma.d)/1e4,aa)),!(ma.max-Hn.d<=z)&&(Fr=ma.h/2,en.push(new rg(ma.p.x-Fr,ma.p.y-Fr,Fr,d)),en.push(new rg(ma.p.x+Fr,ma.p.y-Fr,Fr,d)),en.push(new rg(ma.p.x-Fr,ma.p.y+Fr,Fr,d)),en.push(new rg(ma.p.x+Fr,ma.p.y+Fr,Fr,d)),aa+=4)}return H&&(console.log("num probes: "+aa),console.log("best distance: "+Hn.d)),Hn.p}function SD(d,z){return z.max-d.max}function rg(d,z,H,ft){this.p=new o(d,z),this.h=H,this.d=ED(this.p,ft),this.max=this.d+this.h*Math.SQRT2}function ED(d,z){for(var H=!1,ft=1/0,kt=0;kt<z.length;kt++)for(var It=z[kt],Ht=0,ge=It.length,Pe=ge-1;Ht<ge;Pe=Ht++){var qe=It[Ht],Ye=It[Pe];qe.y>d.y!=Ye.y>d.y&&d.x<(Ye.x-qe.x)*(d.y-qe.y)/(Ye.y-qe.y)+qe.x&&(H=!H),ft=Math.min(ft,kh(d,qe,Ye))}return(H?1:-1)*Math.sqrt(ft)}function PD(d){for(var z=0,H=0,ft=0,kt=d[0],It=0,Ht=kt.length,ge=Ht-1;It<Ht;ge=It++){var Pe=kt[It],qe=kt[ge],Ye=Pe.x*qe.y-qe.x*Pe.y;H+=(Pe.x+qe.x)*Ye,ft+=(Pe.y+qe.y)*Ye,z+=Ye*3}return new rg(H/z,ft/z,0,d)}var ng=7,L_=Number.POSITIVE_INFINITY;function oT(d,z){function H(kt,It){var Ht=0,ge=0;It<0&&(It=0);var Pe=It/Math.sqrt(2);switch(kt){case"top-right":case"top-left":ge=Pe-ng;break;case"bottom-right":case"bottom-left":ge=-Pe+ng;break;case"bottom":ge=-It+ng;break;case"top":ge=It-ng;break}switch(kt){case"top-right":case"bottom-right":Ht=-Pe;break;case"top-left":case"bottom-left":Ht=Pe;break;case"left":Ht=It;break;case"right":Ht=-It;break}return[Ht,ge]}function ft(kt,It,Ht){var ge=0,Pe=0;switch(It=Math.abs(It),Ht=Math.abs(Ht),kt){case"top-right":case"top-left":case"top":Pe=Ht-ng;break;case"bottom-right":case"bottom-left":case"bottom":Pe=-Ht+ng;break}switch(kt){case"top-right":case"bottom-right":case"right":ge=-It;break;case"top-left":case"bottom-left":case"left":ge=It;break}return[ge,Pe]}return z[1]!==L_?ft(d,z[0],z[1]):H(d,z[0])}function ID(d,z,H,ft,kt,It,Ht){d.createArrays();var ge=512*d.overscaling;d.tilePixelRatio=ji/ge,d.compareText={},d.iconsNeedLinear=!1;var Pe=d.layers[0].layout,qe=d.layers[0]._unevaluatedLayout._values,Ye={};if(d.textSizeData.kind==="composite"){var xr=d.textSizeData,Ir=xr.minZoom,Fr=xr.maxZoom;Ye.compositeTextSizes=[qe["text-size"].possiblyEvaluate(new Yo(Ir),Ht),qe["text-size"].possiblyEvaluate(new Yo(Fr),Ht)]}if(d.iconSizeData.kind==="composite"){var en=d.iconSizeData,kn=en.minZoom,Zn=en.maxZoom;Ye.compositeIconSizes=[qe["icon-size"].possiblyEvaluate(new Yo(kn),Ht),qe["icon-size"].possiblyEvaluate(new Yo(Zn),Ht)]}Ye.layoutTextSize=qe["text-size"].possiblyEvaluate(new Yo(d.zoom+1),Ht),Ye.layoutIconSize=qe["icon-size"].possiblyEvaluate(new Yo(d.zoom+1),Ht),Ye.textMaxSize=qe["text-size"].possiblyEvaluate(new Yo(18));for(var Hn=Pe.get("text-line-height")*Ke,aa=Pe.get("text-rotation-alignment")==="map"&&Pe.get("symbol-placement")!=="point",ma=Pe.get("text-keep-upright"),ra=Pe.get("text-size"),Ea=function(){var si=oi[Za],Wi=Pe.get("text-font").evaluate(si,{},Ht).join(","),Zi=ra.evaluate(si,{},Ht),ro=Ye.layoutTextSize.evaluate(si,{},Ht),fo=Ye.layoutIconSize.evaluate(si,{},Ht),Eo={horizontal:{},vertical:void 0},no=si.text,co=[0,0];if(no){var Bs=no.toString(),xl=Pe.get("text-letter-spacing").evaluate(si,{},Ht)*Ke,jl=sn(Bs)?xl:0,Ws=Pe.get("text-anchor").evaluate(si,{},Ht),_l=Pe.get("text-variable-anchor");if(!_l){var Rs=Pe.get("text-radial-offset").evaluate(si,{},Ht);Rs?co=oT(Ws,[Rs*Ke,L_]):co=Pe.get("text-offset").evaluate(si,{},Ht).map(function(Rp){return Rp*Ke})}var cu=aa?"center":Pe.get("text-justify").evaluate(si,{},Ht),zl=Pe.get("symbol-placement"),hc=zl==="point"?Pe.get("text-max-width").evaluate(si,{},Ht)*Ke:0,mh=function(){d.allowVerticalPlacement&&Rn(Bs)&&(Eo.vertical=bf(no,z,H,kt,Wi,hc,Hn,Ws,"left",jl,co,ku.vertical,!0,zl,ro,Zi))};if(!aa&&_l){for(var Ec=cu==="auto"?_l.map(function(Rp){return C_(Rp)}):[cu],Vh=!1,qh=0;qh<Ec.length;qh++){var Hh=Ec[qh];if(!Eo.horizontal[Hh])if(Vh)Eo.horizontal[Hh]=Eo.horizontal[0];else{var rh=bf(no,z,H,kt,Wi,hc,Hn,"center",Hh,jl,co,ku.horizontal,!1,zl,ro,Zi);rh&&(Eo.horizontal[Hh]=rh,Vh=rh.positionedLines.length===1)}}mh()}else{cu==="auto"&&(cu=C_(Ws));var tf=bf(no,z,H,kt,Wi,hc,Hn,Ws,cu,jl,co,ku.horizontal,!1,zl,ro,Zi);tf&&(Eo.horizontal[cu]=tf),mh(),Rn(Bs)&&aa&&ma&&(Eo.vertical=bf(no,z,H,kt,Wi,hc,Hn,Ws,cu,jl,co,ku.vertical,!1,zl,ro,Zi))}}var ef=void 0,qc=!1;if(si.icon&&si.icon.name){var rf=ft[si.icon.name];rf&&(ef=P_(kt[si.icon.name],Pe.get("icon-offset").evaluate(si,{},Ht),Pe.get("icon-anchor").evaluate(si,{},Ht)),qc=rf.sdf,d.sdfIcons===void 0?d.sdfIcons=rf.sdf:d.sdfIcons!==rf.sdf&&j("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(rf.pixelRatio!==d.pixelRatio||Pe.get("icon-rotate").constantOr(1)!==0)&&(d.iconsNeedLinear=!0))}var wf=lT(Eo.horizontal)||Eo.vertical;d.iconsInText=wf?wf.iconsInText:!1,(wf||ef)&&LD(d,si,Eo,ef,ft,Ye,ro,fo,co,qc,Ht)},Za=0,oi=d.features;Za<oi.length;Za+=1)Ea();It&&d.generateCollisionDebugBuffers()}function C_(d){switch(d){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function LD(d,z,H,ft,kt,It,Ht,ge,Pe,qe,Ye){var xr=It.textMaxSize.evaluate(z,{});xr===void 0&&(xr=Ht);var Ir=d.layers[0].layout,Fr=Ir.get("icon-offset").evaluate(z,{},Ye),en=lT(H.horizontal),kn=24,Zn=Ht/kn,Hn=d.tilePixelRatio*Zn,aa=d.tilePixelRatio*xr/kn,ma=d.tilePixelRatio*ge,ra=d.tilePixelRatio*Ir.get("symbol-spacing"),Ea=Ir.get("text-padding")*d.tilePixelRatio,Za=Ir.get("icon-padding")*d.tilePixelRatio,oi=Ir.get("text-max-angle")/180*Math.PI,si=Ir.get("text-rotation-alignment")==="map"&&Ir.get("symbol-placement")!=="point",Wi=Ir.get("icon-rotation-alignment")==="map"&&Ir.get("symbol-placement")!=="point",Zi=Ir.get("symbol-placement"),ro=ra/2,fo=Ir.get("icon-text-fit"),Eo;ft&&fo!=="none"&&(d.allowVerticalPlacement&&H.vertical&&(Eo=dy(ft,H.vertical,fo,Ir.get("icon-text-fit-padding"),Fr,Zn)),en&&(ft=dy(ft,en,fo,Ir.get("icon-text-fit-padding"),Fr,Zn)));var no=function(lg,jf){jf.x<0||jf.x>=ji||jf.y<0||jf.y>=ji||CD(d,jf,lg,H,ft,kt,Eo,d.layers[0],d.collisionBoxArray,z.index,z.sourceLayerIndex,d.index,Hn,Ea,si,Pe,ma,Za,Wi,Fr,z,It,qe,Ye,Ht)};if(Zi==="line")for(var co=0,Bs=nT(z.geometry,0,0,ji,ji);co<Bs.length;co+=1)for(var xl=Bs[co],jl=Op(xl,ra,oi,H.vertical||en,ft,kn,aa,d.overscaling,ji),Ws=0,_l=jl;Ws<_l.length;Ws+=1){var Rs=_l[Ws],cu=en;(!cu||!DD(d,cu.text,ro,Rs))&&no(xl,Rs)}else if(Zi==="line-center")for(var zl=0,hc=z.geometry;zl<hc.length;zl+=1){var mh=hc[zl];if(mh.length>1){var Ec=Ef(mh,oi,H.vertical||en,ft,kn,aa);Ec&&no(mh,Ec)}}else if(z.type==="Polygon")for(var Vh=0,qh=Bf(z.geometry,0);Vh<qh.length;Vh+=1){var Hh=qh[Vh],rh=MD(Hh,16);no(Hh[0],new fd(rh.x,rh.y,0))}else if(z.type==="LineString")for(var tf=0,ef=z.geometry;tf<ef.length;tf+=1){var qc=ef[tf];no(qc,new fd(qc[0].x,qc[0].y,0))}else if(z.type==="Point")for(var rf=0,wf=z.geometry;rf<wf.length;rf+=1)for(var Rp=wf[rf],md=0,vd=Rp;md<vd.length;md+=1){var yd=vd[md];no([yd],new fd(yd.x,yd.y,0))}}var km=255,dd=km*Ac;function sT(d,z,H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir,Fr,en){var kn=kD(z,H,ge,kt,It,Ht,ft,d.allowVerticalPlacement),Zn=d.textSizeData,Hn=null;Zn.kind==="source"?(Hn=[Ac*kt.layout.get("text-size").evaluate(Ht,{})],Hn[0]>dd&&j(d.layerIds[0]+': Value for "text-size" is >= '+km+'. Reduce your "text-size".')):Zn.kind==="composite"&&(Hn=[Ac*Fr.compositeTextSizes[0].evaluate(Ht,{},en),Ac*Fr.compositeTextSizes[1].evaluate(Ht,{},en)],(Hn[0]>dd||Hn[1]>dd)&&j(d.layerIds[0]+': Value for "text-size" is >= '+km+'. Reduce your "text-size".')),d.addSymbols(d.text,kn,Hn,ge,It,Ht,qe,z,Pe.lineStartIndex,Pe.lineLength,Ir,en);for(var aa=0,ma=Ye;aa<ma.length;aa+=1){var ra=ma[aa];xr[ra]=d.text.placedSymbolArray.length-1}return kn.length*4}function lT(d){for(var z in d)return d[z];return null}function CD(d,z,H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir,Fr,en,kn,Zn,Hn,aa,ma,ra,Ea,Za,oi,si){var Wi,Zi=d.addToLineVertexArray(z,H),ro,fo,Eo,no,co=0,Bs=0,xl=0,jl=0,Ws=-1,_l=-1,Rs={},cu=Ct(""),zl=0,hc=0;if(ge._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Wi=ge.layout.get("text-offset").evaluate(ra,{},oi).map(function(Sm){return Sm*Ke}),zl=Wi[0],hc=Wi[1]):(zl=ge.layout.get("text-radial-offset").evaluate(ra,{},oi)*Ke,hc=L_),d.allowVerticalPlacement&&ft.vertical){var mh=ge.layout.get("text-rotate").evaluate(ra,{},oi),Ec=mh+90,Vh=ft.vertical;Eo=new _y(Pe,z,qe,Ye,xr,Vh,Ir,Fr,en,Ec),Ht&&(no=new _y(Pe,z,qe,Ye,xr,Ht,Zn,Hn,en,Ec))}if(kt){var qh=ge.layout.get("icon-rotate").evaluate(ra,{}),Hh=ge.layout.get("icon-text-fit")!=="none",rh=aT(kt,qh,Za,Hh),tf=Ht?aT(Ht,qh,Za,Hh):void 0;fo=new _y(Pe,z,qe,Ye,xr,kt,Zn,Hn,!1,qh),co=rh.length*4;var ef=d.iconSizeData,qc=null;ef.kind==="source"?(qc=[Ac*ge.layout.get("icon-size").evaluate(ra,{})],qc[0]>dd&&j(d.layerIds[0]+': Value for "icon-size" is >= '+km+'. Reduce your "icon-size".')):ef.kind==="composite"&&(qc=[Ac*Ea.compositeIconSizes[0].evaluate(ra,{},oi),Ac*Ea.compositeIconSizes[1].evaluate(ra,{},oi)],(qc[0]>dd||qc[1]>dd)&&j(d.layerIds[0]+': Value for "icon-size" is >= '+km+'. Reduce your "icon-size".')),d.addSymbols(d.icon,rh,qc,ma,aa,ra,!1,z,Zi.lineStartIndex,Zi.lineLength,-1,oi),Ws=d.icon.placedSymbolArray.length-1,tf&&(Bs=tf.length*4,d.addSymbols(d.icon,tf,qc,ma,aa,ra,ku.vertical,z,Zi.lineStartIndex,Zi.lineLength,-1,oi),_l=d.icon.placedSymbolArray.length-1)}for(var rf in ft.horizontal){var wf=ft.horizontal[rf];if(!ro){cu=Ct(wf.text);var Rp=ge.layout.get("text-rotate").evaluate(ra,{},oi);ro=new _y(Pe,z,qe,Ye,xr,wf,Ir,Fr,en,Rp)}var md=wf.positionedLines.length===1;if(xl+=sT(d,z,wf,It,ge,en,ra,kn,Zi,ft.vertical?ku.horizontal:ku.horizontalOnly,md?Object.keys(ft.horizontal):[rf],Rs,Ws,Ea,oi),md)break}ft.vertical&&(jl+=sT(d,z,ft.vertical,It,ge,en,ra,kn,Zi,ku.vertical,["vertical"],Rs,_l,Ea,oi));var vd=ro?ro.boxStartIndex:d.collisionBoxArray.length,yd=ro?ro.boxEndIndex:d.collisionBoxArray.length,lg=Eo?Eo.boxStartIndex:d.collisionBoxArray.length,jf=Eo?Eo.boxEndIndex:d.collisionBoxArray.length,Ay=fo?fo.boxStartIndex:d.collisionBoxArray.length,R_=fo?fo.boxEndIndex:d.collisionBoxArray.length,My=no?no.boxStartIndex:d.collisionBoxArray.length,j_=no?no.boxEndIndex:d.collisionBoxArray.length,If=-1,ug=function(Sm,kT){return Sm&&Sm.circleDiameter?Math.max(Sm.circleDiameter,kT):kT};If=ug(ro,If),If=ug(Eo,If),If=ug(fo,If),If=ug(no,If);var Sy=If>-1?1:0;Sy&&(If*=si/Ke),d.glyphOffsetArray.length>=Ml.MAX_GLYPHS&&j("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ra.sortKey!==void 0&&d.addToSortKeyRanges(d.symbolInstances.length,ra.sortKey),d.symbolInstances.emplaceBack(z.x,z.y,Rs.right>=0?Rs.right:-1,Rs.center>=0?Rs.center:-1,Rs.left>=0?Rs.left:-1,Rs.vertical||-1,Ws,_l,cu,vd,yd,lg,jf,Ay,R_,My,j_,qe,xl,jl,co,Bs,Sy,0,Ir,zl,hc,If)}function DD(d,z,H,ft){var kt=d.compareText;if(!(z in kt))kt[z]=[];else for(var It=kt[z],Ht=It.length-1;Ht>=0;Ht--)if(ft.dist(It[Ht])<H)return!0;return kt[z].push(ft),!1}var zD=zp.VectorTileFeature.types,OD=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function by(d,z,H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr,Ir){var Fr=ge?Math.min(dd,Math.round(ge[0])):0,en=ge?Math.min(dd,Math.round(ge[1])):0;d.emplaceBack(z,H,Math.round(ft*32),Math.round(kt*32),It,Ht,(Fr<<1)+(Pe?1:0),en,qe*16,Ye*16,xr*256,Ir*256)}function D_(d,z,H){d.emplaceBack(z.x,z.y,H),d.emplaceBack(z.x,z.y,H),d.emplaceBack(z.x,z.y,H),d.emplaceBack(z.x,z.y,H)}function FD(d){for(var z=0,H=d.sections;z<H.length;z+=1){var ft=H[z];if(ti(ft.text))return!0}return!1}var ag=function(d){this.layoutVertexArray=new Qa,this.indexArray=new Oo,this.programConfigurations=d,this.segments=new zs,this.dynamicLayoutVertexArray=new xi,this.opacityVertexArray=new Wo,this.placedSymbolArray=new Cu};ag.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},ag.prototype.upload=function(d,z,H,ft){this.isEmpty()||(H&&(this.layoutVertexBuffer=d.createVertexBuffer(this.layoutVertexArray,C.members),this.indexBuffer=d.createIndexBuffer(this.indexArray,z),this.dynamicLayoutVertexBuffer=d.createVertexBuffer(this.dynamicLayoutVertexArray,J.members,!0),this.opacityVertexBuffer=d.createVertexBuffer(this.opacityVertexArray,OD,!0),this.opacityVertexBuffer.itemSize=1),(H||ft)&&this.programConfigurations.upload(d))},ag.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},De("SymbolBuffers",ag);var Am=function(d,z,H){this.layoutVertexArray=new d,this.layoutAttributes=z,this.indexArray=new H,this.segments=new zs,this.collisionVertexArray=new mo};Am.prototype.upload=function(d){this.layoutVertexBuffer=d.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=d.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=d.createVertexBuffer(this.collisionVertexArray,ht.members,!0)},Am.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},De("CollisionBuffers",Am);var Ml=function(d){this.collisionBoxArray=d.collisionBoxArray,this.zoom=d.zoom,this.overscaling=d.overscaling,this.layers=d.layers,this.layerIds=this.layers.map(function(ge){return ge.id}),this.index=d.index,this.pixelRatio=d.pixelRatio,this.sourceLayerIndex=d.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=kf([]),this.placementViewportMatrix=kf([]);var z=this.layers[0],H=z._unevaluatedLayout._values;this.textSizeData=pd(this.zoom,H["text-size"]),this.iconSizeData=pd(this.zoom,H["icon-size"]);var ft=this.layers[0].layout,kt=ft.get("symbol-sort-key"),It=ft.get("symbol-z-order");this.canOverlap=ft.get("text-allow-overlap")||ft.get("icon-allow-overlap")||ft.get("text-ignore-placement")||ft.get("icon-ignore-placement"),this.sortFeaturesByKey=It!=="viewport-y"&&kt.constantOr(1)!==void 0;var Ht=It==="viewport-y"||It==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=Ht&&this.canOverlap,ft.get("symbol-placement")==="point"&&(this.writingModes=ft.get("text-writing-mode").map(function(ge){return ku[ge]})),this.stateDependentLayerIds=this.layers.filter(function(ge){return ge.isStateDependent()}).map(function(ge){return ge.id}),this.sourceID=d.sourceID};Ml.prototype.createArrays=function(){this.text=new ag(new pa(this.layers,this.zoom,function(d){return/^text/.test(d)})),this.icon=new ag(new pa(this.layers,this.zoom,function(d){return/^icon/.test(d)})),this.glyphOffsetArray=new tl,this.lineVertexArray=new au,this.symbolInstances=new uu},Ml.prototype.calculateGlyphDependencies=function(d,z,H,ft,kt){for(var It=0;It<d.length;It++)if(z[d.charCodeAt(It)]=!0,(H||ft)&&kt){var Ht=Ie[d.charAt(It)];Ht&&(z[Ht.charCodeAt(0)]=!0)}},Ml.prototype.populate=function(d,z,H){var ft=this.layers[0],kt=ft.layout,It=kt.get("text-font"),Ht=kt.get("text-field"),ge=kt.get("icon-image"),Pe=(Ht.value.kind!=="constant"||Ht.value.value instanceof ll&&!Ht.value.value.isEmpty()||Ht.value.value.toString().length>0)&&(It.value.kind!=="constant"||It.value.value.length>0),qe=ge.value.kind!=="constant"||!!ge.value.value||Object.keys(ge.parameters).length>0,Ye=kt.get("symbol-sort-key");if(this.features=[],!(!Pe&&!qe)){for(var xr=z.iconDependencies,Ir=z.glyphDependencies,Fr=z.availableImages,en=new Yo(this.zoom),kn=0,Zn=d;kn<Zn.length;kn+=1){var Hn=Zn[kn],aa=Hn.feature,ma=Hn.id,ra=Hn.index,Ea=Hn.sourceLayerIndex,Za=ft._featureFilter.needGeometry,oi=hs(aa,Za);if(ft._featureFilter.filter(en,oi,H)){Za||(oi.geometry=is(aa));var si=void 0;if(Pe){var Wi=ft.getValueAndResolveTokens("text-field",oi,H,Fr),Zi=ll.factory(Wi);FD(Zi)&&(this.hasRTLText=!0),(!this.hasRTLText||Ja()==="unavailable"||this.hasRTLText&&us.isParsed())&&(si=ae(Zi,ft,oi))}var ro=void 0;if(qe){var fo=ft.getValueAndResolveTokens("icon-image",oi,H,Fr);fo instanceof el?ro=fo:ro=el.fromString(fo)}if(!(!si&&!ro)){var Eo=this.sortFeaturesByKey?Ye.evaluate(oi,{},H):void 0,no={id:ma,text:si,icon:ro,index:ra,sourceLayerIndex:Ea,geometry:oi.geometry,properties:aa.properties,type:zD[aa.type],sortKey:Eo};if(this.features.push(no),ro&&(xr[ro.name]=!0),si){var co=It.evaluate(oi,{},H).join(","),Bs=kt.get("text-rotation-alignment")==="map"&&kt.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ku.vertical)>=0;for(var xl=0,jl=si.sections;xl<jl.length;xl+=1){var Ws=jl[xl];if(Ws.image)xr[Ws.image.name]=!0;else{var _l=Rn(si.toString()),Rs=Ws.fontStack||co,cu=Ir[Rs]=Ir[Rs]||{};this.calculateGlyphDependencies(Ws.text,cu,Bs,this.allowVerticalPlacement,_l)}}}}}}kt.get("symbol-placement")==="line"&&(this.features=me(this.features)),this.sortFeaturesByKey&&this.features.sort(function(zl,hc){return zl.sortKey-hc.sortKey})}},Ml.prototype.update=function(d,z,H){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(d,z,this.layers,H),this.icon.programConfigurations.updatePaintArrays(d,z,this.layers,H))},Ml.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Ml.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Ml.prototype.upload=function(d){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(d),this.iconCollisionBox.upload(d)),this.text.upload(d,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(d,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Ml.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Ml.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Ml.prototype.addToLineVertexArray=function(d,z){var H=this.lineVertexArray.length;if(d.segment!==void 0){for(var ft=d.dist(z[d.segment+1]),kt=d.dist(z[d.segment]),It={},Ht=d.segment+1;Ht<z.length;Ht++)It[Ht]={x:z[Ht].x,y:z[Ht].y,tileUnitDistanceFromAnchor:ft},Ht<z.length-1&&(ft+=z[Ht+1].dist(z[Ht]));for(var ge=d.segment||0;ge>=0;ge--)It[ge]={x:z[ge].x,y:z[ge].y,tileUnitDistanceFromAnchor:kt},ge>0&&(kt+=z[ge-1].dist(z[ge]));for(var Pe=0;Pe<z.length;Pe++){var qe=It[Pe];this.lineVertexArray.emplaceBack(qe.x,qe.y,qe.tileUnitDistanceFromAnchor)}}return{lineStartIndex:H,lineLength:this.lineVertexArray.length-H}},Ml.prototype.addSymbols=function(d,z,H,ft,kt,It,Ht,ge,Pe,qe,Ye,xr){for(var Ir=d.indexArray,Fr=d.layoutVertexArray,en=d.segments.prepareSegment(4*z.length,Fr,Ir,this.canOverlap?It.sortKey:void 0),kn=this.glyphOffsetArray.length,Zn=en.vertexLength,Hn=this.allowVerticalPlacement&&Ht===ku.vertical?Math.PI/2:0,aa=It.text&&It.text.sections,ma=0;ma<z.length;ma++){var ra=z[ma],Ea=ra.tl,Za=ra.tr,oi=ra.bl,si=ra.br,Wi=ra.tex,Zi=ra.pixelOffsetTL,ro=ra.pixelOffsetBR,fo=ra.minFontScaleX,Eo=ra.minFontScaleY,no=ra.glyphOffset,co=ra.isSDF,Bs=ra.sectionIndex,xl=en.vertexLength,jl=no[1];by(Fr,ge.x,ge.y,Ea.x,jl+Ea.y,Wi.x,Wi.y,H,co,Zi.x,Zi.y,fo,Eo),by(Fr,ge.x,ge.y,Za.x,jl+Za.y,Wi.x+Wi.w,Wi.y,H,co,ro.x,Zi.y,fo,Eo),by(Fr,ge.x,ge.y,oi.x,jl+oi.y,Wi.x,Wi.y+Wi.h,H,co,Zi.x,ro.y,fo,Eo),by(Fr,ge.x,ge.y,si.x,jl+si.y,Wi.x+Wi.w,Wi.y+Wi.h,H,co,ro.x,ro.y,fo,Eo),D_(d.dynamicLayoutVertexArray,ge,Hn),Ir.emplaceBack(xl,xl+1,xl+2),Ir.emplaceBack(xl+1,xl+2,xl+3),en.vertexLength+=4,en.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(no[0]),(ma===z.length-1||Bs!==z[ma+1].sectionIndex)&&d.programConfigurations.populatePaintArrays(Fr.length,It,It.index,{},xr,aa&&aa[Bs])}d.placedSymbolArray.emplaceBack(ge.x,ge.y,kn,this.glyphOffsetArray.length-kn,Zn,Pe,qe,ge.segment,H?H[0]:0,H?H[1]:0,ft[0],ft[1],Ht,0,!1,0,Ye)},Ml.prototype._addCollisionDebugVertex=function(d,z,H,ft,kt,It){return z.emplaceBack(0,0),d.emplaceBack(H.x,H.y,ft,kt,Math.round(It.x),Math.round(It.y))},Ml.prototype.addCollisionDebugVertices=function(d,z,H,ft,kt,It,Ht){var ge=kt.segments.prepareSegment(4,kt.layoutVertexArray,kt.indexArray),Pe=ge.vertexLength,qe=kt.layoutVertexArray,Ye=kt.collisionVertexArray,xr=Ht.anchorX,Ir=Ht.anchorY;this._addCollisionDebugVertex(qe,Ye,It,xr,Ir,new o(d,z)),this._addCollisionDebugVertex(qe,Ye,It,xr,Ir,new o(H,z)),this._addCollisionDebugVertex(qe,Ye,It,xr,Ir,new o(H,ft)),this._addCollisionDebugVertex(qe,Ye,It,xr,Ir,new o(d,ft)),ge.vertexLength+=4;var Fr=kt.indexArray;Fr.emplaceBack(Pe,Pe+1),Fr.emplaceBack(Pe+1,Pe+2),Fr.emplaceBack(Pe+2,Pe+3),Fr.emplaceBack(Pe+3,Pe),ge.primitiveLength+=4},Ml.prototype.addDebugCollisionBoxes=function(d,z,H,ft){for(var kt=d;kt<z;kt++){var It=this.collisionBoxArray.get(kt),Ht=It.x1,ge=It.y1,Pe=It.x2,qe=It.y2;this.addCollisionDebugVertices(Ht,ge,Pe,qe,ft?this.textCollisionBox:this.iconCollisionBox,It.anchorPoint,H)}},Ml.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Am(mi,At.members,al),this.iconCollisionBox=new Am(mi,At.members,al);for(var d=0;d<this.symbolInstances.length;d++){var z=this.symbolInstances.get(d);this.addDebugCollisionBoxes(z.textBoxStartIndex,z.textBoxEndIndex,z,!0),this.addDebugCollisionBoxes(z.verticalTextBoxStartIndex,z.verticalTextBoxEndIndex,z,!0),this.addDebugCollisionBoxes(z.iconBoxStartIndex,z.iconBoxEndIndex,z,!1),this.addDebugCollisionBoxes(z.verticalIconBoxStartIndex,z.verticalIconBoxEndIndex,z,!1)}},Ml.prototype._deserializeCollisionBoxesForSymbol=function(d,z,H,ft,kt,It,Ht,ge,Pe){for(var qe={},Ye=z;Ye<H;Ye++){var xr=d.get(Ye);qe.textBox={x1:xr.x1,y1:xr.y1,x2:xr.x2,y2:xr.y2,anchorPointX:xr.anchorPointX,anchorPointY:xr.anchorPointY},qe.textFeatureIndex=xr.featureIndex;break}for(var Ir=ft;Ir<kt;Ir++){var Fr=d.get(Ir);qe.verticalTextBox={x1:Fr.x1,y1:Fr.y1,x2:Fr.x2,y2:Fr.y2,anchorPointX:Fr.anchorPointX,anchorPointY:Fr.anchorPointY},qe.verticalTextFeatureIndex=Fr.featureIndex;break}for(var en=It;en<Ht;en++){var kn=d.get(en);qe.iconBox={x1:kn.x1,y1:kn.y1,x2:kn.x2,y2:kn.y2,anchorPointX:kn.anchorPointX,anchorPointY:kn.anchorPointY},qe.iconFeatureIndex=kn.featureIndex;break}for(var Zn=ge;Zn<Pe;Zn++){var Hn=d.get(Zn);qe.verticalIconBox={x1:Hn.x1,y1:Hn.y1,x2:Hn.x2,y2:Hn.y2,anchorPointX:Hn.anchorPointX,anchorPointY:Hn.anchorPointY},qe.verticalIconFeatureIndex=Hn.featureIndex;break}return qe},Ml.prototype.deserializeCollisionBoxes=function(d){this.collisionArrays=[];for(var z=0;z<this.symbolInstances.length;z++){var H=this.symbolInstances.get(z);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(d,H.textBoxStartIndex,H.textBoxEndIndex,H.verticalTextBoxStartIndex,H.verticalTextBoxEndIndex,H.iconBoxStartIndex,H.iconBoxEndIndex,H.verticalIconBoxStartIndex,H.verticalIconBoxEndIndex))}},Ml.prototype.hasTextData=function(){return this.text.segments.get().length>0},Ml.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ml.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Ml.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Ml.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Ml.prototype.addIndicesForPlacedSymbol=function(d,z){for(var H=d.placedSymbolArray.get(z),ft=H.vertexStartIndex+H.numGlyphs*4,kt=H.vertexStartIndex;kt<ft;kt+=4)d.indexArray.emplaceBack(kt,kt+1,kt+2),d.indexArray.emplaceBack(kt+1,kt+2,kt+3)},Ml.prototype.getSortedSymbolIndexes=function(d){if(this.sortedAngle===d&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var z=Math.sin(d),H=Math.cos(d),ft=[],kt=[],It=[],Ht=0;Ht<this.symbolInstances.length;++Ht){It.push(Ht);var ge=this.symbolInstances.get(Ht);ft.push(Math.round(z*ge.anchorX+H*ge.anchorY)|0),kt.push(ge.featureIndex)}return It.sort(function(Pe,qe){return ft[Pe]-ft[qe]||kt[qe]-kt[Pe]}),It},Ml.prototype.addToSortKeyRanges=function(d,z){var H=this.sortKeyRanges[this.sortKeyRanges.length-1];H&&H.sortKey===z?H.symbolInstanceEnd=d+1:this.sortKeyRanges.push({sortKey:z,symbolInstanceStart:d,symbolInstanceEnd:d+1})},Ml.prototype.sortFeatures=function(d){var z=this;if(this.sortFeaturesByY&&this.sortedAngle!==d&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(d),this.sortedAngle=d,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var H=0,ft=this.symbolInstanceIndexes;H<ft.length;H+=1){var kt=ft[H],It=this.symbolInstances.get(kt);this.featureSortOrder.push(It.featureIndex),[It.rightJustifiedTextSymbolIndex,It.centerJustifiedTextSymbolIndex,It.leftJustifiedTextSymbolIndex].forEach(function(Ht,ge,Pe){Ht>=0&&Pe.indexOf(Ht)===ge&&z.addIndicesForPlacedSymbol(z.text,Ht)}),It.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,It.verticalPlacedTextSymbolIndex),It.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,It.placedIconSymbolIndex),It.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,It.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},De("SymbolBucket",Ml,{omit:["layers","collisionBoxArray","features","compareText"]}),Ml.MAX_GLYPHS=65535,Ml.addDynamicAttributes=D_;function BD(d,z){return z.replace(/{([^{}]+)}/g,function(H,ft){return ft in d?String(d[ft]):""})}var RD=new Ii({"symbol-placement":new Cn(ga.layout_symbol["symbol-placement"]),"symbol-spacing":new Cn(ga.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Cn(ga.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ia(ga.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Cn(ga.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Cn(ga.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Cn(ga.layout_symbol["icon-ignore-placement"]),"icon-optional":new Cn(ga.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Cn(ga.layout_symbol["icon-rotation-alignment"]),"icon-size":new ia(ga.layout_symbol["icon-size"]),"icon-text-fit":new Cn(ga.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Cn(ga.layout_symbol["icon-text-fit-padding"]),"icon-image":new ia(ga.layout_symbol["icon-image"]),"icon-rotate":new ia(ga.layout_symbol["icon-rotate"]),"icon-padding":new Cn(ga.layout_symbol["icon-padding"]),"icon-keep-upright":new Cn(ga.layout_symbol["icon-keep-upright"]),"icon-offset":new ia(ga.layout_symbol["icon-offset"]),"icon-anchor":new ia(ga.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Cn(ga.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Cn(ga.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Cn(ga.layout_symbol["text-rotation-alignment"]),"text-field":new ia(ga.layout_symbol["text-field"]),"text-font":new ia(ga.layout_symbol["text-font"]),"text-size":new ia(ga.layout_symbol["text-size"]),"text-max-width":new ia(ga.layout_symbol["text-max-width"]),"text-line-height":new Cn(ga.layout_symbol["text-line-height"]),"text-letter-spacing":new ia(ga.layout_symbol["text-letter-spacing"]),"text-justify":new ia(ga.layout_symbol["text-justify"]),"text-radial-offset":new ia(ga.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Cn(ga.layout_symbol["text-variable-anchor"]),"text-anchor":new ia(ga.layout_symbol["text-anchor"]),"text-max-angle":new Cn(ga.layout_symbol["text-max-angle"]),"text-writing-mode":new Cn(ga.layout_symbol["text-writing-mode"]),"text-rotate":new ia(ga.layout_symbol["text-rotate"]),"text-padding":new Cn(ga.layout_symbol["text-padding"]),"text-keep-upright":new Cn(ga.layout_symbol["text-keep-upright"]),"text-transform":new ia(ga.layout_symbol["text-transform"]),"text-offset":new ia(ga.layout_symbol["text-offset"]),"text-allow-overlap":new Cn(ga.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Cn(ga.layout_symbol["text-ignore-placement"]),"text-optional":new Cn(ga.layout_symbol["text-optional"])}),jD=new Ii({"icon-opacity":new ia(ga.paint_symbol["icon-opacity"]),"icon-color":new ia(ga.paint_symbol["icon-color"]),"icon-halo-color":new ia(ga.paint_symbol["icon-halo-color"]),"icon-halo-width":new ia(ga.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ia(ga.paint_symbol["icon-halo-blur"]),"icon-translate":new Cn(ga.paint_symbol["icon-translate"]),"icon-translate-anchor":new Cn(ga.paint_symbol["icon-translate-anchor"]),"text-opacity":new ia(ga.paint_symbol["text-opacity"]),"text-color":new ia(ga.paint_symbol["text-color"],{runtimeType:Ro,getOverride:function(d){return d.textColor},hasOverride:function(d){return!!d.textColor}}),"text-halo-color":new ia(ga.paint_symbol["text-halo-color"]),"text-halo-width":new ia(ga.paint_symbol["text-halo-width"]),"text-halo-blur":new ia(ga.paint_symbol["text-halo-blur"]),"text-translate":new Cn(ga.paint_symbol["text-translate"]),"text-translate-anchor":new Cn(ga.paint_symbol["text-translate-anchor"])}),z_={paint:jD,layout:RD},ig=function(d){this.type=d.property.overrides?d.property.overrides.runtimeType:hl,this.defaultValue=d};ig.prototype.evaluate=function(d){if(d.formattedSection){var z=this.defaultValue.property.overrides;if(z&&z.hasOverride(d.formattedSection))return z.getOverride(d.formattedSection)}return d.feature&&d.featureState?this.defaultValue.evaluate(d.feature,d.featureState):this.defaultValue.property.specification.default},ig.prototype.eachChild=function(d){if(!this.defaultValue.isConstant()){var z=this.defaultValue.value;d(z._styleExpression.expression)}},ig.prototype.outputDefined=function(){return!1},ig.prototype.serialize=function(){return null},De("FormatSectionOverride",ig,{omit:["defaultValue"]});var ND=function(d){function z(H){d.call(this,H,z_)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.recalculate=function(H,ft){if(d.prototype.recalculate.call(this,H,ft),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var kt=this.layout.get("text-writing-mode");if(kt){for(var It=[],Ht=0,ge=kt;Ht<ge.length;Ht+=1){var Pe=ge[Ht];It.indexOf(Pe)<0&&It.push(Pe)}this.layout._values["text-writing-mode"]=It}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},z.prototype.getValueAndResolveTokens=function(H,ft,kt,It){var Ht=this.layout.get(H).evaluate(ft,{},kt,It),ge=this._unevaluatedLayout._values[H];return!ge.isDataDriven()&&!Ri(ge.value)&&Ht?BD(ft.properties,Ht):Ht},z.prototype.createBucket=function(H){return new Ml(H)},z.prototype.queryRadius=function(){return 0},z.prototype.queryIntersectsFeature=function(){return!1},z.prototype._setPaintOverrides=function(){for(var H=0,ft=z_.paint.overridableProperties;H<ft.length;H+=1){var kt=ft[H];if(z.hasPaintOverride(this.layout,kt)){var It=this.paint.get(kt),Ht=new ig(It),ge=new ec(Ht,It.property.specification),Pe=null;It.value.kind==="constant"||It.value.kind==="source"?Pe=new bu("source",ge):Pe=new Cl("composite",ge,It.value.zoomStops,It.value._interpolationType),this.paint._values[kt]=new Ta(It.property,Pe,It.parameters)}}},z.prototype._handleOverridablePaintPropertyUpdate=function(H,ft,kt){return!this.layout||ft.isDataDriven()||kt.isDataDriven()?!1:z.hasPaintOverride(this.layout,H)},z.hasPaintOverride=function(H,ft){var kt=H.get("text-field"),It=z_.paint.properties[ft],Ht=!1,ge=function(Ye){for(var xr=0,Ir=Ye;xr<Ir.length;xr+=1){var Fr=Ir[xr];if(It.overrides&&It.overrides.hasOverride(Fr)){Ht=!0;return}}};if(kt.value.kind==="constant"&&kt.value.value instanceof ll)ge(kt.value.value.sections);else if(kt.value.kind==="source"){var Pe=function(Ye){if(!Ht)if(Ye instanceof $o&&ys(Ye.value)===Zs){var xr=Ye.value;ge(xr.sections)}else Ye instanceof Xu?ge(Ye.sections):Ye.eachChild(Pe)},qe=kt.value;qe._styleExpression&&Pe(qe._styleExpression.expression)}return Ht},z}(Ha),UD=new Ii({"background-color":new Cn(ga.paint_background["background-color"]),"background-pattern":new Ra(ga.paint_background["background-pattern"]),"background-opacity":new Cn(ga.paint_background["background-opacity"])}),VD={paint:UD},qD=function(d){function z(H){d.call(this,H,VD)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z}(Ha),HD=new Ii({"raster-opacity":new Cn(ga.paint_raster["raster-opacity"]),"raster-hue-rotate":new Cn(ga.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Cn(ga.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Cn(ga.paint_raster["raster-brightness-max"]),"raster-saturation":new Cn(ga.paint_raster["raster-saturation"]),"raster-contrast":new Cn(ga.paint_raster["raster-contrast"]),"raster-resampling":new Cn(ga.paint_raster["raster-resampling"]),"raster-fade-duration":new Cn(ga.paint_raster["raster-fade-duration"])}),GD={paint:HD},WD=function(d){function z(H){d.call(this,H,GD)}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z}(Ha);function ZD(d){var z=[],H=d.id;return H===void 0&&z.push({message:"layers."+H+': missing required property "id"'}),d.render===void 0&&z.push({message:"layers."+H+': missing required method "render"'}),d.renderingMode&&d.renderingMode!=="2d"&&d.renderingMode!=="3d"&&z.push({message:"layers."+H+': property "renderingMode" must be either "2d" or "3d"'}),z}var XD=function(d){function z(H){d.call(this,H,{}),this.implementation=H}return d&&(z.__proto__=d),z.prototype=Object.create(d&&d.prototype),z.prototype.constructor=z,z.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},z.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},z.prototype.recalculate=function(){},z.prototype.updateTransitions=function(){},z.prototype.hasTransition=function(){},z.prototype.serialize=function(){},z.prototype.onAdd=function(H){this.implementation.onAdd&&this.implementation.onAdd(H,H.painter.context.gl)},z.prototype.onRemove=function(H){this.implementation.onRemove&&this.implementation.onRemove(H,H.painter.context.gl)},z}(Ha),$D={circle:Jg,heatmap:Zd,hillshade:N0,fill:lm,"fill-extrusion":k_,line:mm,symbol:ND,background:qD,raster:WD};function JD(d){return d.type==="custom"?new XD(d):new $D[d.type](d)}var uT=s.HTMLImageElement,cT=s.HTMLCanvasElement,hT=s.HTMLVideoElement,fT=s.ImageData,wy=s.ImageBitmap,t0=function(d,z,H,ft){this.context=d,this.format=H,this.texture=d.gl.createTexture(),this.update(z,ft)};t0.prototype.update=function(d,z,H){var ft=d.width,kt=d.height,It=(!this.size||this.size[0]!==ft||this.size[1]!==kt)&&!H,Ht=this,ge=Ht.context,Pe=ge.gl;if(this.useMipmap=!!(z&&z.useMipmap),Pe.bindTexture(Pe.TEXTURE_2D,this.texture),ge.pixelStoreUnpackFlipY.set(!1),ge.pixelStoreUnpack.set(1),ge.pixelStoreUnpackPremultiplyAlpha.set(this.format===Pe.RGBA&&(!z||z.premultiply!==!1)),It)this.size=[ft,kt],d instanceof uT||d instanceof cT||d instanceof hT||d instanceof fT||wy&&d instanceof wy?Pe.texImage2D(Pe.TEXTURE_2D,0,this.format,this.format,Pe.UNSIGNED_BYTE,d):Pe.texImage2D(Pe.TEXTURE_2D,0,this.format,ft,kt,0,this.format,Pe.UNSIGNED_BYTE,d.data);else{var qe=H||{x:0,y:0},Ye=qe.x,xr=qe.y;d instanceof uT||d instanceof cT||d instanceof hT||d instanceof fT||wy&&d instanceof wy?Pe.texSubImage2D(Pe.TEXTURE_2D,0,Ye,xr,Pe.RGBA,Pe.UNSIGNED_BYTE,d):Pe.texSubImage2D(Pe.TEXTURE_2D,0,Ye,xr,ft,kt,Pe.RGBA,Pe.UNSIGNED_BYTE,d.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Pe.generateMipmap(Pe.TEXTURE_2D)},t0.prototype.bind=function(d,z,H){var ft=this,kt=ft.context,It=kt.gl;It.bindTexture(It.TEXTURE_2D,this.texture),H===It.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(H=It.LINEAR),d!==this.filter&&(It.texParameteri(It.TEXTURE_2D,It.TEXTURE_MAG_FILTER,d),It.texParameteri(It.TEXTURE_2D,It.TEXTURE_MIN_FILTER,H||d),this.filter=d),z!==this.wrap&&(It.texParameteri(It.TEXTURE_2D,It.TEXTURE_WRAP_S,z),It.texParameteri(It.TEXTURE_2D,It.TEXTURE_WRAP_T,z),this.wrap=z)},t0.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0},t0.prototype.destroy=function(){var d=this.context,z=d.gl;z.deleteTexture(this.texture),this.texture=null};var O_=function(d){var z=this;this._callback=d,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){z._triggered=!1,z._callback()})};O_.prototype.trigger=function(){var d=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){d._triggered=!1,d._callback()},0))},O_.prototype.remove=function(){delete this._channel,this._callback=function(){}};var og=function(d,z,H){this.target=d,this.parent=z,this.mapId=H,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},I(["receive","process"],this),this.invoker=new O_(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=lt()?d:s};og.prototype.send=function(d,z,H,ft,kt){var It=this;kt===void 0&&(kt=!1);var Ht=Math.round(Math.random()*1e18).toString(36).substring(0,10);H&&(this.callbacks[Ht]=H);var ge=st(this.globalScope)?void 0:[];return this.target.postMessage({id:Ht,type:d,hasCallback:!!H,targetMapId:ft,mustQueue:kt,sourceMapId:this.mapId,data:br(z,ge)},ge),{cancel:function(){H&&delete It.callbacks[Ht],It.target.postMessage({id:Ht,type:"<cancel>",targetMapId:ft,sourceMapId:It.mapId})}}},og.prototype.receive=function(d){var z=d.data,H=z.id;if(H&&!(z.targetMapId&&this.mapId!==z.targetMapId))if(z.type==="<cancel>"){delete this.tasks[H];var ft=this.cancelCallbacks[H];delete this.cancelCallbacks[H],ft&&ft()}else lt()||z.mustQueue?(this.tasks[H]=z,this.taskQueue.push(H),this.invoker.trigger()):this.processTask(H,z)},og.prototype.process=function(){if(this.taskQueue.length){var d=this.taskQueue.shift(),z=this.tasks[d];delete this.tasks[d],this.taskQueue.length&&this.invoker.trigger(),z&&this.processTask(d,z)}},og.prototype.processTask=function(d,z){var H=this;if(z.type==="<response>"){var ft=this.callbacks[d];delete this.callbacks[d],ft&&(z.error?ft(jr(z.error)):ft(null,jr(z.data)))}else{var kt=!1,It=st(this.globalScope)?void 0:[],Ht=z.hasCallback?function(xr,Ir){kt=!0,delete H.cancelCallbacks[d],H.target.postMessage({id:d,type:"<response>",sourceMapId:H.mapId,error:xr?br(xr):null,data:br(Ir,It)},It)}:function(xr){kt=!0},ge=null,Pe=jr(z.data);if(this.parent[z.type])ge=this.parent[z.type](z.sourceMapId,Pe,Ht);else if(this.parent.getWorkerSource){var qe=z.type.split("."),Ye=this.parent.getWorkerSource(z.sourceMapId,qe[0],Pe.source);ge=Ye[qe[1]](Pe,Ht)}else Ht(new Error("Could not find function "+z.type));!kt&&ge&&ge.cancel&&(this.cancelCallbacks[d]=ge.cancel)}},og.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function QD(d,z,H){z=Math.pow(2,H)-z-1;var ft=pT(d*256,z*256,H),kt=pT((d+1)*256,(z+1)*256,H);return ft[0]+","+ft[1]+","+kt[0]+","+kt[1]}function pT(d,z,H){var ft=2*Math.PI*6378137/256/Math.pow(2,H),kt=d*ft-2*Math.PI*6378137/2,It=z*ft-2*Math.PI*6378137/2;return[kt,It]}var Mc=function(d,z){d&&(z?this.setSouthWest(d).setNorthEast(z):d.length===4?this.setSouthWest([d[0],d[1]]).setNorthEast([d[2],d[3]]):this.setSouthWest(d[0]).setNorthEast(d[1]))};Mc.prototype.setNorthEast=function(d){return this._ne=d instanceof Au?new Au(d.lng,d.lat):Au.convert(d),this},Mc.prototype.setSouthWest=function(d){return this._sw=d instanceof Au?new Au(d.lng,d.lat):Au.convert(d),this},Mc.prototype.extend=function(d){var z=this._sw,H=this._ne,ft,kt;if(d instanceof Au)ft=d,kt=d;else if(d instanceof Mc){if(ft=d._sw,kt=d._ne,!ft||!kt)return this}else{if(Array.isArray(d))if(d.length===4||d.every(Array.isArray)){var It=d;return this.extend(Mc.convert(It))}else{var Ht=d;return this.extend(Au.convert(Ht))}return this}return!z&&!H?(this._sw=new Au(ft.lng,ft.lat),this._ne=new Au(kt.lng,kt.lat)):(z.lng=Math.min(ft.lng,z.lng),z.lat=Math.min(ft.lat,z.lat),H.lng=Math.max(kt.lng,H.lng),H.lat=Math.max(kt.lat,H.lat)),this},Mc.prototype.getCenter=function(){return new Au((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Mc.prototype.getSouthWest=function(){return this._sw},Mc.prototype.getNorthEast=function(){return this._ne},Mc.prototype.getNorthWest=function(){return new Au(this.getWest(),this.getNorth())},Mc.prototype.getSouthEast=function(){return new Au(this.getEast(),this.getSouth())},Mc.prototype.getWest=function(){return this._sw.lng},Mc.prototype.getSouth=function(){return this._sw.lat},Mc.prototype.getEast=function(){return this._ne.lng},Mc.prototype.getNorth=function(){return this._ne.lat},Mc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Mc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Mc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Mc.prototype.contains=function(d){var z=Au.convert(d),H=z.lng,ft=z.lat,kt=this._sw.lat<=ft&&ft<=this._ne.lat,It=this._sw.lng<=H&&H<=this._ne.lng;return this._sw.lng>this._ne.lng&&(It=this._sw.lng>=H&&H>=this._ne.lng),kt&&It},Mc.convert=function(d){return!d||d instanceof Mc?d:new Mc(d)};var dT=63710088e-1,Au=function(d,z){if(isNaN(d)||isNaN(z))throw new Error("Invalid LngLat object: ("+d+", "+z+")");if(this.lng=+d,this.lat=+z,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Au.prototype.wrap=function(){return new Au(x(this.lng,-180,180),this.lat)},Au.prototype.toArray=function(){return[this.lng,this.lat]},Au.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Au.prototype.distanceTo=function(d){var z=Math.PI/180,H=this.lat*z,ft=d.lat*z,kt=Math.sin(H)*Math.sin(ft)+Math.cos(H)*Math.cos(ft)*Math.cos((d.lng-this.lng)*z),It=dT*Math.acos(Math.min(kt,1));return It},Au.prototype.toBounds=function(d){d===void 0&&(d=0);var z=40075017,H=360*d/z,ft=H/Math.cos(Math.PI/180*this.lat);return new Mc(new Au(this.lng-ft,this.lat-H),new Au(this.lng+ft,this.lat+H))},Au.convert=function(d){if(d instanceof Au)return d;if(Array.isArray(d)&&(d.length===2||d.length===3))return new Au(Number(d[0]),Number(d[1]));if(!Array.isArray(d)&&typeof d=="object"&&d!==null)return new Au(Number("lng"in d?d.lng:d.lon),Number(d.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var gT=2*Math.PI*dT;function mT(d){return gT*Math.cos(d*Math.PI/180)}function vT(d){return(180+d)/360}function yT(d){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+d*Math.PI/360)))/360}function xT(d,z){return d/mT(z)}function YD(d){return d*360-180}function F_(d){var z=180-d*360;return 360/Math.PI*Math.atan(Math.exp(z*Math.PI/180))-90}function KD(d,z){return d*mT(F_(z))}function tz(d){return 1/Math.cos(d*Math.PI/180)}var e0=function(d,z,H){H===void 0&&(H=0),this.x=+d,this.y=+z,this.z=+H};e0.fromLngLat=function(d,z){z===void 0&&(z=0);var H=Au.convert(d);return new e0(vT(H.lng),yT(H.lat),xT(z,H.lat))},e0.prototype.toLngLat=function(){return new Au(YD(this.x),F_(this.y))},e0.prototype.toAltitude=function(){return KD(this.z,this.y)},e0.prototype.meterInMercatorCoordinateUnits=function(){return 1/gT*tz(F_(this.y))};var r0=function(d,z,H){this.z=d,this.x=z,this.y=H,this.key=Mm(0,d,d,z,H)};r0.prototype.equals=function(d){return this.z===d.z&&this.x===d.x&&this.y===d.y},r0.prototype.url=function(d,z){var H=QD(this.x,this.y,this.z),ft=ez(this.z,this.x,this.y);return d[(this.x+this.y)%d.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(z==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",ft).replace("{bbox-epsg-3857}",H)},r0.prototype.getTilePoint=function(d){var z=Math.pow(2,this.z);return new o((d.x*z-this.x)*ji,(d.y*z-this.y)*ji)},r0.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var _T=function(d,z){this.wrap=d,this.canonical=z,this.key=Mm(d,z.z,z.z,z.x,z.y)},Sc=function(d,z,H,ft,kt){this.overscaledZ=d,this.wrap=z,this.canonical=new r0(H,+ft,+kt),this.key=Mm(z,d,H,ft,kt)};Sc.prototype.equals=function(d){return this.overscaledZ===d.overscaledZ&&this.wrap===d.wrap&&this.canonical.equals(d.canonical)},Sc.prototype.scaledTo=function(d){var z=this.canonical.z-d;return d>this.canonical.z?new Sc(d,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Sc(d,this.wrap,d,this.canonical.x>>z,this.canonical.y>>z)},Sc.prototype.calculateScaledKey=function(d,z){var H=this.canonical.z-d;return d>this.canonical.z?Mm(this.wrap*+z,d,this.canonical.z,this.canonical.x,this.canonical.y):Mm(this.wrap*+z,d,d,this.canonical.x>>H,this.canonical.y>>H)},Sc.prototype.isChildOf=function(d){if(d.wrap!==this.wrap)return!1;var z=this.canonical.z-d.canonical.z;return d.overscaledZ===0||d.overscaledZ<this.overscaledZ&&d.canonical.x===this.canonical.x>>z&&d.canonical.y===this.canonical.y>>z},Sc.prototype.children=function(d){if(this.overscaledZ>=d)return[new Sc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var z=this.canonical.z+1,H=this.canonical.x*2,ft=this.canonical.y*2;return[new Sc(z,this.wrap,z,H,ft),new Sc(z,this.wrap,z,H+1,ft),new Sc(z,this.wrap,z,H,ft+1),new Sc(z,this.wrap,z,H+1,ft+1)]},Sc.prototype.isLessThan=function(d){return this.wrap<d.wrap?!0:this.wrap>d.wrap?!1:this.overscaledZ<d.overscaledZ?!0:this.overscaledZ>d.overscaledZ?!1:this.canonical.x<d.canonical.x?!0:this.canonical.x>d.canonical.x?!1:this.canonical.y<d.canonical.y},Sc.prototype.wrapped=function(){return new Sc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Sc.prototype.unwrapTo=function(d){return new Sc(this.overscaledZ,d,this.canonical.z,this.canonical.x,this.canonical.y)},Sc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Sc.prototype.toUnwrapped=function(){return new _T(this.wrap,this.canonical)},Sc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Sc.prototype.getTilePoint=function(d){return this.canonical.getTilePoint(new e0(d.x-this.wrap,d.y))};function Mm(d,z,H,ft,kt){d*=2,d<0&&(d=d*-1-1);var It=1<<H;return(It*It*d+It*kt+ft).toString(36)+H.toString(36)+z.toString(36)}function ez(d,z,H){for(var ft="",kt,It=d;It>0;It--)kt=1<<It-1,ft+=(z&kt?1:0)+(H&kt?2:0);return ft}De("CanonicalTileID",r0),De("OverscaledTileID",Sc,{omit:["posMatrix"]});var Fp=function(d,z,H){if(this.uid=d,z.height!==z.width)throw new RangeError("DEM tiles must be square");if(H&&H!=="mapbox"&&H!=="terrarium")return j('"'+H+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=z.height;var ft=this.dim=z.height-2;this.data=new Uint32Array(z.data.buffer),this.encoding=H||"mapbox";for(var kt=0;kt<ft;kt++)this.data[this._idx(-1,kt)]=this.data[this._idx(0,kt)],this.data[this._idx(ft,kt)]=this.data[this._idx(ft-1,kt)],this.data[this._idx(kt,-1)]=this.data[this._idx(kt,0)],this.data[this._idx(kt,ft)]=this.data[this._idx(kt,ft-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(ft,-1)]=this.data[this._idx(ft-1,0)],this.data[this._idx(-1,ft)]=this.data[this._idx(0,ft-1)],this.data[this._idx(ft,ft)]=this.data[this._idx(ft-1,ft-1)]};Fp.prototype.get=function(d,z){var H=new Uint8Array(this.data.buffer),ft=this._idx(d,z)*4,kt=this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox;return kt(H[ft],H[ft+1],H[ft+2])},Fp.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Fp.prototype._idx=function(d,z){if(d<-1||d>=this.dim+1||z<-1||z>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(z+1)*this.stride+(d+1)},Fp.prototype._unpackMapbox=function(d,z,H){return(d*256*256+z*256+H)/10-1e4},Fp.prototype._unpackTerrarium=function(d,z,H){return d*256+z+H/256-32768},Fp.prototype.getPixels=function(){return new fh({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Fp.prototype.backfillBorder=function(d,z,H){if(this.dim!==d.dim)throw new Error("dem dimension mismatch");var ft=z*this.dim,kt=z*this.dim+this.dim,It=H*this.dim,Ht=H*this.dim+this.dim;switch(z){case-1:ft=kt-1;break;case 1:kt=ft+1;break}switch(H){case-1:It=Ht-1;break;case 1:Ht=It+1;break}for(var ge=-z*this.dim,Pe=-H*this.dim,qe=It;qe<Ht;qe++)for(var Ye=ft;Ye<kt;Ye++)this.data[this._idx(Ye,qe)]=d.data[this._idx(Ye+ge,qe+Pe)]},De("DEMData",Fp);function rz(d,z){var H={};if(!z)return H;for(var ft=function(){var Ht=It[kt],ge=Ht.layerIds.map(function(xr){return z.getLayer(xr)}).filter(Boolean);if(ge.length!==0){Ht.layers=ge,Ht.stateDependentLayerIds&&(Ht.stateDependentLayers=Ht.stateDependentLayerIds.map(function(xr){return ge.filter(function(Ir){return Ir.id===xr})[0]}));for(var Pe=0,qe=ge;Pe<qe.length;Pe+=1){var Ye=qe[Pe];H[Ye.id]=Ht}}},kt=0,It=d;kt<It.length;kt+=1)ft();return H}var Ty=function(d){this._stringToNumber={},this._numberToString=[];for(var z=0;z<d.length;z++){var H=d[z];this._stringToNumber[H]=z,this._numberToString[z]=H}};Ty.prototype.encode=function(d){return this._stringToNumber[d]},Ty.prototype.decode=function(d){return this._numberToString[d]};var ky=function(d,z,H,ft,kt){this.type="Feature",this._vectorTileFeature=d,d._z=z,d._x=H,d._y=ft,this.properties=d.properties,this.id=kt},B_={geometry:{configurable:!0}};B_.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},B_.geometry.set=function(d){this._geometry=d},ky.prototype.toJSON=function(){var d={geometry:this.geometry};for(var z in this)z==="_geometry"||z==="_vectorTileFeature"||(d[z]=this[z]);return d},Object.defineProperties(ky.prototype,B_);var sg=function(){this.state={},this.stateChanges={},this.deletedStates={}};sg.prototype.updateState=function(d,z,H){var ft=String(z);if(this.stateChanges[d]=this.stateChanges[d]||{},this.stateChanges[d][ft]=this.stateChanges[d][ft]||{},M(this.stateChanges[d][ft],H),this.deletedStates[d]===null){this.deletedStates[d]={};for(var kt in this.state[d])kt!==ft&&(this.deletedStates[d][kt]=null)}else{var It=this.deletedStates[d]&&this.deletedStates[d][ft]===null;if(It){this.deletedStates[d][ft]={};for(var Ht in this.state[d][ft])H[Ht]||(this.deletedStates[d][ft][Ht]=null)}else for(var ge in H){var Pe=this.deletedStates[d]&&this.deletedStates[d][ft]&&this.deletedStates[d][ft][ge]===null;Pe&&delete this.deletedStates[d][ft][ge]}}},sg.prototype.removeFeatureState=function(d,z,H){var ft=this.deletedStates[d]===null;if(!ft){var kt=String(z);if(this.deletedStates[d]=this.deletedStates[d]||{},H&&z!==void 0)this.deletedStates[d][kt]!==null&&(this.deletedStates[d][kt]=this.deletedStates[d][kt]||{},this.deletedStates[d][kt][H]=null);else if(z!==void 0){var It=this.stateChanges[d]&&this.stateChanges[d][kt];if(It){this.deletedStates[d][kt]={};for(H in this.stateChanges[d][kt])this.deletedStates[d][kt][H]=null}else this.deletedStates[d][kt]=null}else this.deletedStates[d]=null}},sg.prototype.getState=function(d,z){var H=String(z),ft=this.state[d]||{},kt=this.stateChanges[d]||{},It=M({},ft[H],kt[H]);if(this.deletedStates[d]===null)return{};if(this.deletedStates[d]){var Ht=this.deletedStates[d][z];if(Ht===null)return{};for(var ge in Ht)delete It[ge]}return It},sg.prototype.initializeTileState=function(d,z){d.setFeatureState(this.state,z)},sg.prototype.coalesceChanges=function(d,z){var H={};for(var ft in this.stateChanges){this.state[ft]=this.state[ft]||{};var kt={};for(var It in this.stateChanges[ft])this.state[ft][It]||(this.state[ft][It]={}),M(this.state[ft][It],this.stateChanges[ft][It]),kt[It]=this.state[ft][It];H[ft]=kt}for(var Ht in this.deletedStates){this.state[Ht]=this.state[Ht]||{};var ge={};if(this.deletedStates[Ht]===null)for(var Pe in this.state[Ht])ge[Pe]={},this.state[Ht][Pe]={};else for(var qe in this.deletedStates[Ht]){var Ye=this.deletedStates[Ht][qe]===null;if(Ye)this.state[Ht][qe]={};else for(var xr=0,Ir=Object.keys(this.deletedStates[Ht][qe]);xr<Ir.length;xr+=1){var Fr=Ir[xr];delete this.state[Ht][qe][Fr]}ge[qe]=this.state[Ht][qe]}H[Ht]=H[Ht]||{},M(H[Ht],ge)}if(this.stateChanges={},this.deletedStates={},Object.keys(H).length!==0)for(var en in d){var kn=d[en];kn.setFeatureState(H,z)}};var Bp=function(d,z){this.tileID=d,this.x=d.canonical.x,this.y=d.canonical.y,this.z=d.canonical.z,this.grid=new mt(ji,16,0),this.grid3D=new mt(ji,16,0),this.featureIndexArray=new Ho,this.promoteId=z};Bp.prototype.insert=function(d,z,H,ft,kt,It){var Ht=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(H,ft,kt);for(var ge=It?this.grid3D:this.grid,Pe=0;Pe<z.length;Pe++){for(var qe=z[Pe],Ye=[1/0,1/0,-1/0,-1/0],xr=0;xr<qe.length;xr++){var Ir=qe[xr];Ye[0]=Math.min(Ye[0],Ir.x),Ye[1]=Math.min(Ye[1],Ir.y),Ye[2]=Math.max(Ye[2],Ir.x),Ye[3]=Math.max(Ye[3],Ir.y)}Ye[0]<ji&&Ye[1]<ji&&Ye[2]>=0&&Ye[3]>=0&&ge.insert(Ht,Ye[0],Ye[1],Ye[2],Ye[3])}},Bp.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new zp.VectorTile(new $r(this.rawTileData)).layers,this.sourceLayerCoder=new Ty(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Bp.prototype.query=function(d,z,H,ft){var kt=this;this.loadVTLayers();for(var It=d.params||{},Ht=ji/d.tileSize/d.scale,ge=Gt(It.filter),Pe=d.queryGeometry,qe=d.queryPadding*Ht,Ye=wT(Pe),xr=this.grid.query(Ye.minX-qe,Ye.minY-qe,Ye.maxX+qe,Ye.maxY+qe),Ir=wT(d.cameraQueryGeometry),Fr=this.grid3D.query(Ir.minX-qe,Ir.minY-qe,Ir.maxX+qe,Ir.maxY+qe,function(Ea,Za,oi,si){return Of(d.cameraQueryGeometry,Ea-qe,Za-qe,oi+qe,si+qe)}),en=0,kn=Fr;en<kn.length;en+=1){var Zn=kn[en];xr.push(Zn)}xr.sort(nz);for(var Hn={},aa,ma=function(Ea){var Za=xr[Ea];if(Za!==aa){aa=Za;var oi=kt.featureIndexArray.get(Za),si=null;kt.loadMatchingFeature(Hn,oi.bucketIndex,oi.sourceLayerIndex,oi.featureIndex,ge,It.layers,It.availableImages,z,H,ft,function(Wi,Zi,ro){return si||(si=is(Wi)),Zi.queryIntersectsFeature(Pe,Wi,ro,si,kt.z,d.transform,Ht,d.pixelPosMatrix)})}},ra=0;ra<xr.length;ra++)ma(ra);return Hn},Bp.prototype.loadMatchingFeature=function(d,z,H,ft,kt,It,Ht,ge,Pe,qe,Ye){var xr=this.bucketLayerIDs[z];if(!(It&&!F(It,xr))){var Ir=this.sourceLayerCoder.decode(H),Fr=this.vtLayers[Ir],en=Fr.feature(ft);if(kt.needGeometry){var kn=hs(en,!0);if(!kt.filter(new Yo(this.tileID.overscaledZ),kn,this.tileID.canonical))return}else if(!kt.filter(new Yo(this.tileID.overscaledZ),en))return;for(var Zn=this.getId(en,Ir),Hn=0;Hn<xr.length;Hn++){var aa=xr[Hn];if(!(It&&It.indexOf(aa)<0)){var ma=ge[aa];if(ma){var ra={};Zn!==void 0&&qe&&(ra=qe.getState(ma.sourceLayer||"_geojsonTileLayer",Zn));var Ea=M({},Pe[aa]);Ea.paint=bT(Ea.paint,ma.paint,en,ra,Ht),Ea.layout=bT(Ea.layout,ma.layout,en,ra,Ht);var Za=!Ye||Ye(en,ma,ra);if(Za){var oi=new ky(en,this.z,this.x,this.y,Zn);oi.layer=Ea;var si=d[aa];si===void 0&&(si=d[aa]=[]),si.push({featureIndex:ft,feature:oi,intersectionZ:Za})}}}}}},Bp.prototype.lookupSymbolFeatures=function(d,z,H,ft,kt,It,Ht,ge){var Pe={};this.loadVTLayers();for(var qe=Gt(kt),Ye=0,xr=d;Ye<xr.length;Ye+=1){var Ir=xr[Ye];this.loadMatchingFeature(Pe,H,ft,Ir,qe,It,Ht,ge,z)}return Pe},Bp.prototype.hasLayer=function(d){for(var z=0,H=this.bucketLayerIDs;z<H.length;z+=1)for(var ft=H[z],kt=0,It=ft;kt<It.length;kt+=1){var Ht=It[kt];if(d===Ht)return!0}return!1},Bp.prototype.getId=function(d,z){var H=d.id;if(this.promoteId){var ft=typeof this.promoteId=="string"?this.promoteId:this.promoteId[z];H=d.properties[ft],typeof H=="boolean"&&(H=Number(H))}return H},De("FeatureIndex",Bp,{omit:["rawTileData","sourceLayerCoder"]});function bT(d,z,H,ft,kt){return B(d,function(It,Ht){var ge=z instanceof ka?z.get(Ht):null;return ge&&ge.evaluate?ge.evaluate(H,ft,kt):ge})}function wT(d){for(var z=1/0,H=1/0,ft=-1/0,kt=-1/0,It=0,Ht=d;It<Ht.length;It+=1){var ge=Ht[It];z=Math.min(z,ge.x),H=Math.min(H,ge.y),ft=Math.max(ft,ge.x),kt=Math.max(kt,ge.y)}return{minX:z,minY:H,maxX:ft,maxY:kt}}function nz(d,z){return z-d}var az=3e4,eh=function(d,z){this.tileID=d,this.uid=f(),this.uses=0,this.tileSize=z,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};eh.prototype.registerFadeDuration=function(d){var z=d+this.timeAdded;z<wt.now()||this.fadeEndTime&&z<this.fadeEndTime||(this.fadeEndTime=z)},eh.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},eh.prototype.loadVectorData=function(d,z,H){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!d){this.collisionBoxArray=new Lu;return}d.featureIndex&&(this.latestFeatureIndex=d.featureIndex,d.rawTileData?(this.latestRawTileData=d.rawTileData,this.latestFeatureIndex.rawTileData=d.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=d.collisionBoxArray,this.buckets=rz(d.buckets,z.style),this.hasSymbolBuckets=!1;for(var ft in this.buckets){var kt=this.buckets[ft];if(kt instanceof Ml)if(this.hasSymbolBuckets=!0,H)kt.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var It in this.buckets){var Ht=this.buckets[It];if(Ht instanceof Ml&&Ht.hasRTLText){this.hasRTLText=!0,eu();break}}this.queryPadding=0;for(var ge in this.buckets){var Pe=this.buckets[ge];this.queryPadding=Math.max(this.queryPadding,z.style.getLayer(ge).queryRadius(Pe))}d.imageAtlas&&(this.imageAtlas=d.imageAtlas),d.glyphAtlasImage&&(this.glyphAtlasImage=d.glyphAtlasImage)},eh.prototype.unloadVectorData=function(){for(var d in this.buckets)this.buckets[d].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},eh.prototype.getBucket=function(d){return this.buckets[d.id]},eh.prototype.upload=function(d){for(var z in this.buckets){var H=this.buckets[z];H.uploadPending()&&H.upload(d)}var ft=d.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new t0(d,this.imageAtlas.image,ft.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new t0(d,this.glyphAtlasImage,ft.ALPHA),this.glyphAtlasImage=null)},eh.prototype.prepare=function(d){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(d,this.imageAtlasTexture)},eh.prototype.queryRenderedFeatures=function(d,z,H,ft,kt,It,Ht,ge,Pe,qe){return!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData?{}:this.latestFeatureIndex.query({queryGeometry:ft,cameraQueryGeometry:kt,scale:It,tileSize:this.tileSize,pixelPosMatrix:qe,transform:ge,params:Ht,queryPadding:this.queryPadding*Pe},d,z,H)},eh.prototype.querySourceFeatures=function(d,z){var H=this.latestFeatureIndex;if(!(!H||!H.rawTileData)){var ft=H.loadVTLayers(),kt=z?z.sourceLayer:"",It=ft._geojsonTileLayer||ft[kt];if(It)for(var Ht=Gt(z&&z.filter),ge=this.tileID.canonical,Pe=ge.z,qe=ge.x,Ye=ge.y,xr={z:Pe,x:qe,y:Ye},Ir=0;Ir<It.length;Ir++){var Fr=It.feature(Ir);if(Ht.needGeometry){var en=hs(Fr,!0);if(!Ht.filter(new Yo(this.tileID.overscaledZ),en,this.tileID.canonical))continue}else if(!Ht.filter(new Yo(this.tileID.overscaledZ),Fr))continue;var kn=H.getId(Fr,kt),Zn=new ky(Fr,Pe,qe,Ye,kn);Zn.tile=xr,d.push(Zn)}}},eh.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},eh.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},eh.prototype.setExpiryData=function(d){var z=this.expirationTime;if(d.cacheControl){var H=tt(d.cacheControl);H["max-age"]&&(this.expirationTime=Date.now()+H["max-age"]*1e3)}else d.expires&&(this.expirationTime=new Date(d.expires).getTime());if(this.expirationTime){var ft=Date.now(),kt=!1;if(this.expirationTime>ft)kt=!1;else if(!z)kt=!0;else if(this.expirationTime<z)kt=!0;else{var It=this.expirationTime-z;It?this.expirationTime=ft+Math.max(It,az):kt=!0}kt?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},eh.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)},eh.prototype.setFeatureState=function(d,z){if(!(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(d).length===0)){var H=this.latestFeatureIndex.loadVTLayers();for(var ft in this.buckets)if(z.style.hasLayer(ft)){var kt=this.buckets[ft],It=kt.layers[0].sourceLayer||"_geojsonTileLayer",Ht=H[It],ge=d[It];if(!(!Ht||!ge||Object.keys(ge).length===0)){kt.update(ge,Ht,this.imageAtlas&&this.imageAtlas.patternPositions||{});var Pe=z&&z.style&&z.style.getLayer(ft);Pe&&(this.queryPadding=Math.max(this.queryPadding,Pe.queryRadius(kt)))}}}},eh.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},eh.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<wt.now()},eh.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},eh.prototype.setHoldDuration=function(d){this.symbolFadeHoldUntil=wt.now()+d},eh.prototype.setDependencies=function(d,z){for(var H={},ft=0,kt=z;ft<kt.length;ft+=1){var It=kt[ft];H[It]=!0}this.dependencies[d]=H},eh.prototype.hasDependency=function(d,z){for(var H=0,ft=d;H<ft.length;H+=1){var kt=ft[H],It=this.dependencies[kt];if(It)for(var Ht=0,ge=z;Ht<ge.length;Ht+=1){var Pe=ge[Ht];if(It[Pe])return!0}}return!1};var iz=["type","source","source-layer","minzoom","maxzoom","filter","layout"],gd=s.performance,TT=function(d){this._marks={start:[d.url,"start"].join("#"),end:[d.url,"end"].join("#"),measure:d.url.toString()},gd.mark(this._marks.start)};TT.prototype.finish=function(){gd.mark(this._marks.end);var d=gd.getEntriesByName(this._marks.measure);return d.length===0&&(gd.measure(this._marks.measure,this._marks.start,this._marks.end),d=gd.getEntriesByName(this._marks.measure),gd.clearMarks(this._marks.start),gd.clearMarks(this._marks.end),gd.clearMeasures(this._marks.measure)),d},t.Actor=og,t.AlphaImage=Tc,t.CanonicalTileID=r0,t.CollisionBoxArray=Lu,t.Color=ns,t.DEMData=Fp,t.DataConstantProperty=Cn,t.DictionaryCoder=Ty,t.EXTENT=ji,t.ErrorEvent=Dr,t.EvaluationParameters=Yo,t.Event=Er,t.Evented=Ar,t.FeatureIndex=Bp,t.FillBucket=_f,t.FillExtrusionBucket=uf,t.ImageAtlas=Al,t.ImagePosition=Js,t.LineBucket=ph,t.LngLat=Au,t.LngLatBounds=Mc,t.MercatorCoordinate=e0,t.ONE_EM=Ke,t.OverscaledTileID=Sc,t.Point=o,t.Point$1=o,t.Properties=Ii,t.Protobuf=$r,t.RGBAImage=fh,t.RequestManager=vt,t.RequestPerformance=TT,t.ResourceType=On,t.SegmentVector=zs,t.SourceFeatureState=sg,t.StructArrayLayout1ui2=Tu,t.StructArrayLayout2f1f2i16=Li,t.StructArrayLayout2i4=_i,t.StructArrayLayout3ui6=Oo,t.StructArrayLayout4i8=Ia,t.SymbolBucket=Ml,t.Texture=t0,t.Tile=eh,t.Transitionable=sr,t.Uniform1f=wr,t.Uniform1i=pr,t.Uniform2f=rr,t.Uniform3f=cr,t.Uniform4f=hr,t.UniformColor=Vr,t.UniformMatrix4f=wn,t.UnwrappedTileID=_T,t.ValidationError=Xa,t.WritingMode=ku,t.ZoomHistory=Yr,t.add=Af,t.addDynamicAttributes=D_,t.asyncAll=b,t.bezier=p,t.bindAll=I,t.browser=wt,t.cacheEntryPossiblyAdded=ln,t.clamp=l,t.clearTileCache=vn,t.clipLine=nT,t.clone=Qp,t.clone$1=L,t.clone$2=Ip,t.collisionCircleLayout=Bt,t.config=xt,t.create=Jp,t.create$1=jc,t.create$2=Xf,t.createCommonjsModule=e,t.createExpression=oo,t.createLayout=xa,t.createStyleLayer=JD,t.cross=o_,t.deepEqual=h,t.dot=i_,t.dot$1=h_,t.ease=y,t.emitValidationErrors=lu,t.endsWith=O,t.enforceCacheSizeLimit=an,t.evaluateSizeForFeature=Tm,t.evaluateSizeForZoom=gy,t.evaluateVariableOffset=oT,t.evented=_s,t.extend=M,t.featureFilter=Gt,t.filterObject=R,t.fromRotation=hp,t.getAnchorAlignment=wm,t.getAnchorJustification=C_,t.getArrayBuffer=rn,t.getImage=Pr,t.getJSON=Xr,t.getRTLTextPluginStatus=Ja,t.getReferrer=ke,t.getVideo=Sr,t.identity=kf,t.invert=Ep,t.isChar=tn,t.isMapboxURL=Ut,t.keysDifference=T,t.makeRequest=_r,t.mapObject=B,t.mercatorXfromLng=vT,t.mercatorYfromLat=yT,t.mercatorZfromAltitude=xT,t.mul=$f,t.multiply=zu,t.mvt=zp,t.nextPowerOfTwo=_,t.normalize=a_,t.number=Ds,t.offscreenCanvasSupported=pn,t.ortho=vl,t.parseGlyphPBF=Nh,t.pbf=$r,t.performSymbolLayout=ID,t.perspective=D0,t.pick=w,t.plugin=us,t.polygonIntersectsPolygon=Ss,t.postMapLoadEvent=zt,t.postTurnstileEvent=Dt,t.potpack=cf,t.refProperties=iz,t.register=De,t.registerForPluginStateChange=yo,t.renderColorRamp=ed,t.rotate=Sp,t.rotateX=Pp,t.rotateZ=Yp,t.scale=ol,t.scale$1=c_,t.scale$2=Kp,t.setCacheLimits=Sn,t.setRTLTextPlugin=Lo,t.sphericalToCartesian=ct,t.sqrLen=Fv,t.styleSpec=ga,t.sub=l_,t.symbolSize=I_,t.transformMat3=s_,t.transformMat4=O0,t.translate=Nc,t.triggerPluginCompletionEvent=qo,t.uniqueId=f,t.validateCustomStyleLayer=ZD,t.validateLight=wo,t.validateStyle=bo,t.values=S,t.vectorTile=zp,t.version=r,t.warnOnce=j,t.webpSupported=Ft,t.window=s,t.wrap=x}),A(["./shared"],function(t){function e(ke){var ze=typeof ke;if(ze==="number"||ze==="boolean"||ze==="string"||ke===void 0||ke===null)return JSON.stringify(ke);if(Array.isArray(ke)){for(var je="[",Ne=0,_r=ke;Ne<_r.length;Ne+=1){var Xr=_r[Ne];je+=e(Xr)+","}return je+"]"}for(var rn=Object.keys(ke).sort(),Br="{",_n=0;_n<rn.length;_n++)Br+=JSON.stringify(rn[_n])+":"+e(ke[rn[_n]])+",";return Br+"}"}function r(ke){for(var ze="",je=0,Ne=t.refProperties;je<Ne.length;je+=1){var _r=Ne[je];ze+="/"+e(ke[_r])}return ze}function i(ke,ze){for(var je={},Ne=0;Ne<ke.length;Ne++){var _r=ze&&ze[ke[Ne].id]||r(ke[Ne]);ze&&(ze[ke[Ne].id]=_r);var Xr=je[_r];Xr||(Xr=je[_r]=[]),Xr.push(ke[Ne])}var rn=[];for(var Br in je)rn.push(je[Br]);return rn}var n=function(ke){this.keyCache={},ke&&this.replace(ke)};n.prototype.replace=function(ke){this._layerConfigs={},this._layers={},this.update(ke,[])},n.prototype.update=function(ke,ze){for(var je=this,Ne=0,_r=ke;Ne<_r.length;Ne+=1){var Xr=_r[Ne];this._layerConfigs[Xr.id]=Xr;var rn=this._layers[Xr.id]=t.createStyleLayer(Xr);rn._featureFilter=t.featureFilter(rn.filter),this.keyCache[Xr.id]&&delete this.keyCache[Xr.id]}for(var Br=0,_n=ze;Br<_n.length;Br+=1){var bn=_n[Br];delete this.keyCache[bn],delete this._layerConfigs[bn],delete this._layers[bn]}this.familiesBySource={};for(var Fn=i(t.values(this._layerConfigs),this.keyCache),on=0,Bn=Fn;on<Bn.length;on+=1){var ue=Bn[on],xe=ue.map(function(Dr){return je._layers[Dr.id]}),Pr=xe[0];if(Pr.visibility!=="none"){var Sr=Pr.source||"",gr=this.familiesBySource[Sr];gr||(gr=this.familiesBySource[Sr]={});var dr=Pr.sourceLayer||"_geojsonTileLayer",Er=gr[dr];Er||(Er=gr[dr]=[]),Er.push(xe)}}};var o=1,a=function(ke){var ze={},je=[];for(var Ne in ke){var _r=ke[Ne],Xr=ze[Ne]={};for(var rn in _r){var Br=_r[+rn];if(!(!Br||Br.bitmap.width===0||Br.bitmap.height===0)){var _n={x:0,y:0,w:Br.bitmap.width+2*o,h:Br.bitmap.height+2*o};je.push(_n),Xr[rn]={rect:_n,metrics:Br.metrics}}}}var bn=t.potpack(je),Fn=bn.w,on=bn.h,Bn=new t.AlphaImage({width:Fn||1,height:on||1});for(var ue in ke){var xe=ke[ue];for(var Pr in xe){var Sr=xe[+Pr];if(!(!Sr||Sr.bitmap.width===0||Sr.bitmap.height===0)){var gr=ze[ue][Pr].rect;t.AlphaImage.copy(Sr.bitmap,Bn,{x:0,y:0},{x:gr.x+o,y:gr.y+o},Sr.bitmap)}}}this.image=Bn,this.positions=ze};t.register("GlyphAtlas",a);var s=function(ke){this.tileID=new t.OverscaledTileID(ke.tileID.overscaledZ,ke.tileID.wrap,ke.tileID.canonical.z,ke.tileID.canonical.x,ke.tileID.canonical.y),this.uid=ke.uid,this.zoom=ke.zoom,this.pixelRatio=ke.pixelRatio,this.tileSize=ke.tileSize,this.source=ke.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=ke.showCollisionBoxes,this.collectResourceTiming=!!ke.collectResourceTiming,this.returnDependencies=!!ke.returnDependencies,this.promoteId=ke.promoteId};s.prototype.parse=function(ke,ze,je,Ne,_r){var Xr=this;this.status="parsing",this.data=ke,this.collisionBoxArray=new t.CollisionBoxArray;var rn=new t.DictionaryCoder(Object.keys(ke.layers).sort()),Br=new t.FeatureIndex(this.tileID,this.promoteId);Br.bucketLayerIDs=[];var _n={},bn={featureIndex:Br,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:je},Fn=ze.familiesBySource[this.source];for(var on in Fn){var Bn=ke.layers[on];if(Bn){Bn.version===1&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+on+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var ue=rn.encode(on),xe=[],Pr=0;Pr<Bn.length;Pr++){var Sr=Bn.feature(Pr),gr=Br.getId(Sr,on);xe.push({feature:Sr,id:gr,index:Pr,sourceLayerIndex:ue})}for(var dr=0,Er=Fn[on];dr<Er.length;dr+=1){var Dr=Er[dr],Ar=Dr[0];if(!(Ar.minzoom&&this.zoom<Math.floor(Ar.minzoom))&&!(Ar.maxzoom&&this.zoom>=Ar.maxzoom)&&Ar.visibility!=="none"){h(Dr,this.zoom,je);var Gr=_n[Ar.id]=Ar.createBucket({index:Br.bucketLayerIDs.length,layers:Dr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ue,sourceID:this.source});Gr.populate(xe,bn,this.tileID.canonical),Br.bucketLayerIDs.push(Dr.map(function(dn){return dn.id}))}}}}var Wr,Jr,_e,Je,yr=t.mapObject(bn.glyphDependencies,function(dn){return Object.keys(dn).map(Number)});Object.keys(yr).length?Ne.send("getGlyphs",{uid:this.uid,stacks:yr},function(dn,Kr){Wr||(Wr=dn,Jr=Kr,En.call(Xr))}):Jr={};var Hr=Object.keys(bn.iconDependencies);Hr.length?Ne.send("getImages",{icons:Hr,source:this.source,tileID:this.tileID,type:"icons"},function(dn,Kr){Wr||(Wr=dn,_e=Kr,En.call(Xr))}):_e={};var hn=Object.keys(bn.patternDependencies);hn.length?Ne.send("getImages",{icons:hn,source:this.source,tileID:this.tileID,type:"patterns"},function(dn,Kr){Wr||(Wr=dn,Je=Kr,En.call(Xr))}):Je={},En.call(this);function En(){if(Wr)return _r(Wr);if(Jr&&_e&&Je){var dn=new a(Jr),Kr=new t.ImageAtlas(_e,Je);for(var Tn in _n){var ta=_n[Tn];ta instanceof t.SymbolBucket?(h(ta.layers,this.zoom,je),t.performSymbolLayout(ta,Jr,dn.positions,_e,Kr.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):ta.hasPattern&&(ta instanceof t.LineBucket||ta instanceof t.FillBucket||ta instanceof t.FillExtrusionBucket)&&(h(ta.layers,this.zoom,je),ta.addFeatures(bn,this.tileID.canonical,Kr.patternPositions))}this.status="done",_r(null,{buckets:t.values(_n).filter(function(Qn){return!Qn.isEmpty()}),featureIndex:Br,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:dn.image,imageAtlas:Kr,glyphMap:this.returnDependencies?Jr:null,iconMap:this.returnDependencies?_e:null,glyphPositions:this.returnDependencies?dn.positions:null})}}};function h(ke,ze,je){for(var Ne=new t.EvaluationParameters(ze),_r=0,Xr=ke;_r<Xr.length;_r+=1){var rn=Xr[_r];rn.recalculate(Ne,je)}}function v(ke,ze){var je=t.getArrayBuffer(ke.request,function(Ne,_r,Xr,rn){Ne?ze(Ne):_r&&ze(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(_r)),rawData:_r,cacheControl:Xr,expires:rn})});return function(){je.cancel(),ze()}}var m=function(ke,ze,je,Ne){this.actor=ke,this.layerIndex=ze,this.availableImages=je,this.loadVectorData=Ne||v,this.loading={},this.loaded={}};m.prototype.loadTile=function(ke,ze){var je=this,Ne=ke.uid;this.loading||(this.loading={});var _r=ke&&ke.request&&ke.request.collectResourceTiming?new t.RequestPerformance(ke.request):!1,Xr=this.loading[Ne]=new s(ke);Xr.abort=this.loadVectorData(ke,function(rn,Br){if(delete je.loading[Ne],rn||!Br)return Xr.status="done",je.loaded[Ne]=Xr,ze(rn);var _n=Br.rawData,bn={};Br.expires&&(bn.expires=Br.expires),Br.cacheControl&&(bn.cacheControl=Br.cacheControl);var Fn={};if(_r){var on=_r.finish();on&&(Fn.resourceTiming=JSON.parse(JSON.stringify(on)))}Xr.vectorTile=Br.vectorTile,Xr.parse(Br.vectorTile,je.layerIndex,je.availableImages,je.actor,function(Bn,ue){if(Bn||!ue)return ze(Bn);ze(null,t.extend({rawTileData:_n.slice(0)},ue,bn,Fn))}),je.loaded=je.loaded||{},je.loaded[Ne]=Xr})},m.prototype.reloadTile=function(ke,ze){var je=this,Ne=this.loaded,_r=ke.uid,Xr=this;if(Ne&&Ne[_r]){var rn=Ne[_r];rn.showCollisionBoxes=ke.showCollisionBoxes;var Br=function(_n,bn){var Fn=rn.reloadCallback;Fn&&(delete rn.reloadCallback,rn.parse(rn.vectorTile,Xr.layerIndex,je.availableImages,Xr.actor,Fn)),ze(_n,bn)};rn.status==="parsing"?rn.reloadCallback=Br:rn.status==="done"&&(rn.vectorTile?rn.parse(rn.vectorTile,this.layerIndex,this.availableImages,this.actor,Br):Br())}},m.prototype.abortTile=function(ke,ze){var je=this.loading,Ne=ke.uid;je&&je[Ne]&&je[Ne].abort&&(je[Ne].abort(),delete je[Ne]),ze()},m.prototype.removeTile=function(ke,ze){var je=this.loaded,Ne=ke.uid;je&&je[Ne]&&delete je[Ne],ze()};var p=t.window.ImageBitmap,y=function(){this.loaded={}};y.prototype.loadTile=function(ke,ze){var je=ke.uid,Ne=ke.encoding,_r=ke.rawImageData,Xr=p&&_r instanceof p?this.getImageData(_r):_r,rn=new t.DEMData(je,Xr,Ne);this.loaded=this.loaded||{},this.loaded[je]=rn,ze(null,rn)},y.prototype.getImageData=function(ke){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(ke.width,ke.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=ke.width,this.offscreenCanvas.height=ke.height,this.offscreenCanvasContext.drawImage(ke,0,0,ke.width,ke.height);var ze=this.offscreenCanvasContext.getImageData(-1,-1,ke.width+2,ke.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:ze.width,height:ze.height},ze.data)},y.prototype.removeTile=function(ke){var ze=this.loaded,je=ke.uid;ze&&ze[je]&&delete ze[je]};var l=x;function x(ke,ze){var je=ke&&ke.type,Ne;if(je==="FeatureCollection")for(Ne=0;Ne<ke.features.length;Ne++)x(ke.features[Ne],ze);else if(je==="GeometryCollection")for(Ne=0;Ne<ke.geometries.length;Ne++)x(ke.geometries[Ne],ze);else if(je==="Feature")x(ke.geometry,ze);else if(je==="Polygon")b(ke.coordinates,ze);else if(je==="MultiPolygon")for(Ne=0;Ne<ke.coordinates.length;Ne++)b(ke.coordinates[Ne],ze);return ke}function b(ke,ze){if(ke.length!==0){S(ke[0],ze);for(var je=1;je<ke.length;je++)S(ke[je],!ze)}}function S(ke,ze){for(var je=0,Ne=0,_r=ke.length,Xr=_r-1;Ne<_r;Xr=Ne++)je+=(ke[Ne][0]-ke[Xr][0])*(ke[Xr][1]+ke[Ne][1]);je>=0!=!!ze&&ke.reverse()}var T=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,M=function(ke){this._feature=ke,this.extent=t.EXTENT,this.type=ke.type,this.properties=ke.tags,"id"in ke&&!isNaN(ke.id)&&(this.id=parseInt(ke.id,10))};M.prototype.loadGeometry=function(){if(this._feature.type===1){for(var ke=[],ze=0,je=this._feature.geometry;ze<je.length;ze+=1){var Ne=je[ze];ke.push([new t.Point$1(Ne[0],Ne[1])])}return ke}else{for(var _r=[],Xr=0,rn=this._feature.geometry;Xr<rn.length;Xr+=1){for(var Br=rn[Xr],_n=[],bn=0,Fn=Br;bn<Fn.length;bn+=1){var on=Fn[bn];_n.push(new t.Point$1(on[0],on[1]))}_r.push(_n)}return _r}},M.prototype.toGeoJSON=function(ke,ze,je){return T.call(this,ke,ze,je)};var w=function(ke){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=ke.length,this._features=ke};w.prototype.feature=function(ke){return new M(this._features[ke])};var u=t.vectorTile.VectorTileFeature,f=k;function k(ke,ze){this.options=ze||{},this.features=ke,this.length=ke.length}k.prototype.feature=function(ke){return new _(this.features[ke],this.options.extent)};function _(ke,ze){this.id=typeof ke.id=="number"?ke.id:void 0,this.type=ke.type,this.rawGeometry=ke.type===1?[ke.geometry]:ke.geometry,this.properties=ke.tags,this.extent=ze||4096}_.prototype.loadGeometry=function(){var ke=this.rawGeometry;this.geometry=[];for(var ze=0;ze<ke.length;ze++){for(var je=ke[ze],Ne=[],_r=0;_r<je.length;_r++)Ne.push(new t.Point$1(je[_r][0],je[_r][1]));this.geometry.push(Ne)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var ke=this.geometry,ze=1/0,je=-1/0,Ne=1/0,_r=-1/0,Xr=0;Xr<ke.length;Xr++)for(var rn=ke[Xr],Br=0;Br<rn.length;Br++){var _n=rn[Br];ze=Math.min(ze,_n.x),je=Math.max(je,_n.x),Ne=Math.min(Ne,_n.y),_r=Math.max(_r,_n.y)}return[ze,Ne,je,_r]},_.prototype.toGeoJSON=u.prototype.toGeoJSON;var D=R,I=R,O=L,B=f;function R(ke){var ze=new t.pbf;return F(ke,ze),ze.finish()}function L(ke,ze){ze=ze||{};var je={};for(var Ne in ke)je[Ne]=new f(ke[Ne].features,ze),je[Ne].name=Ne,je[Ne].version=ze.version,je[Ne].extent=ze.extent;return R({layers:je})}function F(ke,ze){for(var je in ke.layers)ze.writeMessage(3,N,ke.layers[je])}function N(ke,ze){ze.writeVarintField(15,ke.version||1),ze.writeStringField(1,ke.name||""),ze.writeVarintField(5,ke.extent||4096);var je,Ne={keys:[],values:[],keycache:{},valuecache:{}};for(je=0;je<ke.length;je++)Ne.feature=ke.feature(je),ze.writeMessage(2,j,Ne);var _r=Ne.keys;for(je=0;je<_r.length;je++)ze.writeStringField(3,_r[je]);var Xr=Ne.values;for(je=0;je<Xr.length;je++)ze.writeMessage(4,tt,Xr[je])}function j(ke,ze){var je=ke.feature;je.id!==void 0&&ze.writeVarintField(1,je.id),ze.writeMessage(2,G,ke),ze.writeVarintField(3,je.type),ze.writeMessage(4,lt,je)}function G(ke,ze){var je=ke.feature,Ne=ke.keys,_r=ke.values,Xr=ke.keycache,rn=ke.valuecache;for(var Br in je.properties){var _n=Xr[Br];typeof _n>"u"&&(Ne.push(Br),_n=Ne.length-1,Xr[Br]=_n),ze.writeVarint(_n);var bn=je.properties[Br],Fn=typeof bn;Fn!=="string"&&Fn!=="boolean"&&Fn!=="number"&&(bn=JSON.stringify(bn));var on=Fn+":"+bn,Bn=rn[on];typeof Bn>"u"&&(_r.push(bn),Bn=_r.length-1,rn[on]=Bn),ze.writeVarint(Bn)}}function rt(ke,ze){return(ze<<3)+(ke&7)}function ct(ke){return ke<<1^ke>>31}function lt(ke,ze){for(var je=ke.loadGeometry(),Ne=ke.type,_r=0,Xr=0,rn=je.length,Br=0;Br<rn;Br++){var _n=je[Br],bn=1;Ne===1&&(bn=_n.length),ze.writeVarint(rt(1,bn));for(var Fn=Ne===3?_n.length-1:_n.length,on=0;on<Fn;on++){on===1&&Ne!==1&&ze.writeVarint(rt(2,Fn-1));var Bn=_n[on].x-_r,ue=_n[on].y-Xr;ze.writeVarint(ct(Bn)),ze.writeVarint(ct(ue)),_r+=Bn,Xr+=ue}Ne===3&&ze.writeVarint(rt(7,1))}}function tt(ke,ze){var je=typeof ke;je==="string"?ze.writeStringField(1,ke):je==="boolean"?ze.writeBooleanField(7,ke):je==="number"&&(ke%1!==0?ze.writeDoubleField(3,ke):ke<0?ze.writeSVarintField(6,ke):ze.writeVarintField(5,ke))}D.fromVectorTileJs=I,D.fromGeojsonVt=O,D.GeoJSONWrapper=B;function Z(ke,ze,je,Ne,_r,Xr){if(!(_r-Ne<=je)){var rn=Ne+_r>>1;st(ke,ze,rn,Ne,_r,Xr%2),Z(ke,ze,je,Ne,rn-1,Xr+1),Z(ke,ze,je,rn+1,_r,Xr+1)}}function st(ke,ze,je,Ne,_r,Xr){for(;_r>Ne;){if(_r-Ne>600){var rn=_r-Ne+1,Br=je-Ne+1,_n=Math.log(rn),bn=.5*Math.exp(2*_n/3),Fn=.5*Math.sqrt(_n*bn*(rn-bn)/rn)*(Br-rn/2<0?-1:1),on=Math.max(Ne,Math.floor(je-Br*bn/rn+Fn)),Bn=Math.min(_r,Math.floor(je+(rn-Br)*bn/rn+Fn));st(ke,ze,je,on,Bn,Xr)}var ue=ze[2*je+Xr],xe=Ne,Pr=_r;for($(ke,ze,Ne,je),ze[2*_r+Xr]>ue&&$(ke,ze,Ne,_r);xe<Pr;){for($(ke,ze,xe,Pr),xe++,Pr--;ze[2*xe+Xr]<ue;)xe++;for(;ze[2*Pr+Xr]>ue;)Pr--}ze[2*Ne+Xr]===ue?$(ke,ze,Ne,Pr):(Pr++,$(ke,ze,Pr,_r)),Pr<=je&&(Ne=Pr+1),je<=Pr&&(_r=Pr-1)}}function $(ke,ze,je,Ne){Q(ke,je,Ne),Q(ze,2*je,2*Ne),Q(ze,2*je+1,2*Ne+1)}function Q(ke,ze,je){var Ne=ke[ze];ke[ze]=ke[je],ke[je]=Ne}function nt(ke,ze,je,Ne,_r,Xr,rn){for(var Br=[0,ke.length-1,0],_n=[],bn,Fn;Br.length;){var on=Br.pop(),Bn=Br.pop(),ue=Br.pop();if(Bn-ue<=rn){for(var xe=ue;xe<=Bn;xe++)bn=ze[2*xe],Fn=ze[2*xe+1],bn>=je&&bn<=_r&&Fn>=Ne&&Fn<=Xr&&_n.push(ke[xe]);continue}var Pr=Math.floor((ue+Bn)/2);bn=ze[2*Pr],Fn=ze[2*Pr+1],bn>=je&&bn<=_r&&Fn>=Ne&&Fn<=Xr&&_n.push(ke[Pr]);var Sr=(on+1)%2;(on===0?je<=bn:Ne<=Fn)&&(Br.push(ue),Br.push(Pr-1),Br.push(Sr)),(on===0?_r>=bn:Xr>=Fn)&&(Br.push(Pr+1),Br.push(Bn),Br.push(Sr))}return _n}function Y(ke,ze,je,Ne,_r,Xr){for(var rn=[0,ke.length-1,0],Br=[],_n=_r*_r;rn.length;){var bn=rn.pop(),Fn=rn.pop(),on=rn.pop();if(Fn-on<=Xr){for(var Bn=on;Bn<=Fn;Bn++)q(ze[2*Bn],ze[2*Bn+1],je,Ne)<=_n&&Br.push(ke[Bn]);continue}var ue=Math.floor((on+Fn)/2),xe=ze[2*ue],Pr=ze[2*ue+1];q(xe,Pr,je,Ne)<=_n&&Br.push(ke[ue]);var Sr=(bn+1)%2;(bn===0?je-_r<=xe:Ne-_r<=Pr)&&(rn.push(on),rn.push(ue-1),rn.push(Sr)),(bn===0?je+_r>=xe:Ne+_r>=Pr)&&(rn.push(ue+1),rn.push(Fn),rn.push(Sr))}return Br}function q(ke,ze,je,Ne){var _r=ke-je,Xr=ze-Ne;return _r*_r+Xr*Xr}var ot=function(ke){return ke[0]},it=function(ke){return ke[1]},dt=function(ke,ze,je,Ne,_r){ze===void 0&&(ze=ot),je===void 0&&(je=it),Ne===void 0&&(Ne=64),_r===void 0&&(_r=Float64Array),this.nodeSize=Ne,this.points=ke;for(var Xr=ke.length<65536?Uint16Array:Uint32Array,rn=this.ids=new Xr(ke.length),Br=this.coords=new _r(ke.length*2),_n=0;_n<ke.length;_n++)rn[_n]=_n,Br[2*_n]=ze(ke[_n]),Br[2*_n+1]=je(ke[_n]);Z(rn,Br,Ne,0,rn.length-1,0)};dt.prototype.range=function(ke,ze,je,Ne){return nt(this.ids,this.coords,ke,ze,je,Ne,this.nodeSize)},dt.prototype.within=function(ke,ze,je){return Y(this.ids,this.coords,ke,ze,je,this.nodeSize)};var wt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(ke){return ke}},xt=function(ke){this.options=bt(Object.create(wt),ke),this.trees=new Array(this.options.maxZoom+1)};xt.prototype.load=function(ke){var ze=this.options,je=ze.log,Ne=ze.minZoom,_r=ze.maxZoom,Xr=ze.nodeSize;je&&console.time("total time");var rn="prepare "+ke.length+" points";je&&console.time(rn),this.points=ke;for(var Br=[],_n=0;_n<ke.length;_n++)ke[_n].geometry&&Br.push(Et(ke[_n],_n));this.trees[_r+1]=new dt(Br,vt,Ut,Xr,Float32Array),je&&console.timeEnd(rn);for(var bn=_r;bn>=Ne;bn--){var Fn=+Date.now();Br=this._cluster(Br,bn),this.trees[bn]=new dt(Br,vt,Ut,Xr,Float32Array),je&&console.log("z%d: %d clusters in %dms",bn,Br.length,+Date.now()-Fn)}return je&&console.timeEnd("total time"),this},xt.prototype.getClusters=function(ke,ze){var je=((ke[0]+180)%360+360)%360-180,Ne=Math.max(-90,Math.min(90,ke[1])),_r=ke[2]===180?180:((ke[2]+180)%360+360)%360-180,Xr=Math.max(-90,Math.min(90,ke[3]));if(ke[2]-ke[0]>=360)je=-180,_r=180;else if(je>_r){var rn=this.getClusters([je,Ne,180,Xr],ze),Br=this.getClusters([-180,Ne,_r,Xr],ze);return rn.concat(Br)}for(var _n=this.trees[this._limitZoom(ze)],bn=_n.range(Jt(je),Qt(Xr),Jt(_r),Qt(Ne)),Fn=[],on=0,Bn=bn;on<Bn.length;on+=1){var ue=Bn[on],xe=_n.points[ue];Fn.push(xe.numPoints?Nt(xe):this.points[xe.index])}return Fn},xt.prototype.getChildren=function(ke){var ze=this._getOriginId(ke),je=this._getOriginZoom(ke),Ne="No cluster with the specified id.",_r=this.trees[je];if(!_r)throw new Error(Ne);var Xr=_r.points[ze];if(!Xr)throw new Error(Ne);for(var rn=this.options.radius/(this.options.extent*Math.pow(2,je-1)),Br=_r.within(Xr.x,Xr.y,rn),_n=[],bn=0,Fn=Br;bn<Fn.length;bn+=1){var on=Fn[bn],Bn=_r.points[on];Bn.parentId===ke&&_n.push(Bn.numPoints?Nt(Bn):this.points[Bn.index])}if(_n.length===0)throw new Error(Ne);return _n},xt.prototype.getLeaves=function(ke,ze,je){ze=ze||10,je=je||0;var Ne=[];return this._appendLeaves(Ne,ke,ze,je,0),Ne},xt.prototype.getTile=function(ke,ze,je){var Ne=this.trees[this._limitZoom(ke)],_r=Math.pow(2,ke),Xr=this.options,rn=Xr.extent,Br=Xr.radius,_n=Br/rn,bn=(je-_n)/_r,Fn=(je+1+_n)/_r,on={features:[]};return this._addTileFeatures(Ne.range((ze-_n)/_r,bn,(ze+1+_n)/_r,Fn),Ne.points,ze,je,_r,on),ze===0&&this._addTileFeatures(Ne.range(1-_n/_r,bn,1,Fn),Ne.points,_r,je,_r,on),ze===_r-1&&this._addTileFeatures(Ne.range(0,bn,_n/_r,Fn),Ne.points,-1,je,_r,on),on.features.length?on:null},xt.prototype.getClusterExpansionZoom=function(ke){for(var ze=this._getOriginZoom(ke)-1;ze<=this.options.maxZoom;){var je=this.getChildren(ke);if(ze++,je.length!==1)break;ke=je[0].properties.cluster_id}return ze},xt.prototype._appendLeaves=function(ke,ze,je,Ne,_r){for(var Xr=this.getChildren(ze),rn=0,Br=Xr;rn<Br.length;rn+=1){var _n=Br[rn],bn=_n.properties;if(bn&&bn.cluster?_r+bn.point_count<=Ne?_r+=bn.point_count:_r=this._appendLeaves(ke,bn.cluster_id,je,Ne,_r):_r<Ne?_r++:ke.push(_n),ke.length===je)break}return _r},xt.prototype._addTileFeatures=function(ke,ze,je,Ne,_r,Xr){for(var rn=0,Br=ke;rn<Br.length;rn+=1){var _n=Br[rn],bn=ze[_n],Fn=bn.numPoints,on={type:1,geometry:[[Math.round(this.options.extent*(bn.x*_r-je)),Math.round(this.options.extent*(bn.y*_r-Ne))]],tags:Fn?te(bn):this.points[bn.index].properties},Bn=void 0;Fn?Bn=bn.id:this.options.generateId?Bn=bn.index:this.points[bn.index].id&&(Bn=this.points[bn.index].id),Bn!==void 0&&(on.id=Bn),Xr.features.push(on)}},xt.prototype._limitZoom=function(ke){return Math.max(this.options.minZoom,Math.min(+ke,this.options.maxZoom+1))},xt.prototype._cluster=function(ke,ze){for(var je=[],Ne=this.options,_r=Ne.radius,Xr=Ne.extent,rn=Ne.reduce,Br=Ne.minPoints,_n=_r/(Xr*Math.pow(2,ze)),bn=0;bn<ke.length;bn++){var Fn=ke[bn];if(!(Fn.zoom<=ze)){Fn.zoom=ze;for(var on=this.trees[ze+1],Bn=on.within(Fn.x,Fn.y,_n),ue=Fn.numPoints||1,xe=ue,Pr=0,Sr=Bn;Pr<Sr.length;Pr+=1){var gr=Sr[Pr],dr=on.points[gr];dr.zoom>ze&&(xe+=dr.numPoints||1)}if(xe>=Br){for(var Er=Fn.x*ue,Dr=Fn.y*ue,Ar=rn&&ue>1?this._map(Fn,!0):null,Gr=(bn<<5)+(ze+1)+this.points.length,Wr=0,Jr=Bn;Wr<Jr.length;Wr+=1){var _e=Jr[Wr],Je=on.points[_e];if(!(Je.zoom<=ze)){Je.zoom=ze;var yr=Je.numPoints||1;Er+=Je.x*yr,Dr+=Je.y*yr,Je.parentId=Gr,rn&&(Ar||(Ar=this._map(Fn,!0)),rn(Ar,this._map(Je)))}}Fn.parentId=Gr,je.push(Ft(Er/xe,Dr/xe,Gr,xe,Ar))}else if(je.push(Fn),xe>1)for(var Hr=0,hn=Bn;Hr<hn.length;Hr+=1){var En=hn[Hr],dn=on.points[En];dn.zoom<=ze||(dn.zoom=ze,je.push(dn))}}}return je},xt.prototype._getOriginId=function(ke){return ke-this.points.length>>5},xt.prototype._getOriginZoom=function(ke){return(ke-this.points.length)%32},xt.prototype._map=function(ke,ze){if(ke.numPoints)return ze?bt({},ke.properties):ke.properties;var je=this.points[ke.index].properties,Ne=this.options.map(je);return ze&&Ne===je?bt({},Ne):Ne};function Ft(ke,ze,je,Ne,_r){return{x:ke,y:ze,zoom:1/0,id:je,parentId:-1,numPoints:Ne,properties:_r}}function Et(ke,ze){var je=ke.geometry.coordinates,Ne=je[0],_r=je[1];return{x:Jt(Ne),y:Qt(_r),zoom:1/0,index:ze,parentId:-1}}function Nt(ke){return{type:"Feature",id:ke.id,properties:te(ke),geometry:{type:"Point",coordinates:[Wt(ke.x),gt(ke.y)]}}}function te(ke){var ze=ke.numPoints,je=ze>=1e4?Math.round(ze/1e3)+"k":ze>=1e3?Math.round(ze/100)/10+"k":ze;return bt(bt({},ke.properties),{cluster:!0,cluster_id:ke.id,point_count:ze,point_count_abbreviated:je})}function Jt(ke){return ke/360+.5}function Qt(ke){var ze=Math.sin(ke*Math.PI/180),je=.5-.25*Math.log((1+ze)/(1-ze))/Math.PI;return je<0?0:je>1?1:je}function Wt(ke){return(ke-.5)*360}function gt(ke){var ze=(180-ke*360)*Math.PI/180;return 360*Math.atan(Math.exp(ze))/Math.PI-90}function bt(ke,ze){for(var je in ze)ke[je]=ze[je];return ke}function vt(ke){return ke.x}function Ut(ke){return ke.y}function Kt(ke,ze,je,Ne){for(var _r=Ne,Xr=je-ze>>1,rn=je-ze,Br,_n=ke[ze],bn=ke[ze+1],Fn=ke[je],on=ke[je+1],Bn=ze+3;Bn<je;Bn+=3){var ue=Zt(ke[Bn],ke[Bn+1],_n,bn,Fn,on);if(ue>_r)Br=Bn,_r=ue;else if(ue===_r){var xe=Math.abs(Bn-Xr);xe<rn&&(Br=Bn,rn=xe)}}_r>Ne&&(Br-ze>3&&Kt(ke,ze,Br,Ne),ke[Br+2]=_r,je-Br>3&&Kt(ke,Br,je,Ne))}function Zt(ke,ze,je,Ne,_r,Xr){var rn=_r-je,Br=Xr-Ne;if(rn!==0||Br!==0){var _n=((ke-je)*rn+(ze-Ne)*Br)/(rn*rn+Br*Br);_n>1?(je=_r,Ne=Xr):_n>0&&(je+=rn*_n,Ne+=Br*_n)}return rn=ke-je,Br=ze-Ne,rn*rn+Br*Br}function le(ke,ze,je,Ne){var _r={id:typeof ke>"u"?null:ke,type:ze,geometry:je,tags:Ne,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Te(_r),_r}function Te(ke){var ze=ke.geometry,je=ke.type;if(je==="Point"||je==="MultiPoint"||je==="LineString")Se(ke,ze);else if(je==="Polygon"||je==="MultiLineString")for(var Ne=0;Ne<ze.length;Ne++)Se(ke,ze[Ne]);else if(je==="MultiPolygon")for(Ne=0;Ne<ze.length;Ne++)for(var _r=0;_r<ze[Ne].length;_r++)Se(ke,ze[Ne][_r])}function Se(ke,ze){for(var je=0;je<ze.length;je+=3)ke.minX=Math.min(ke.minX,ze[je]),ke.minY=Math.min(ke.minY,ze[je+1]),ke.maxX=Math.max(ke.maxX,ze[je]),ke.maxY=Math.max(ke.maxY,ze[je+1])}function Fe(ke,ze){var je=[];if(ke.type==="FeatureCollection")for(var Ne=0;Ne<ke.features.length;Ne++)Oe(je,ke.features[Ne],ze,Ne);else ke.type==="Feature"?Oe(je,ke,ze):Oe(je,{geometry:ke},ze);return je}function Oe(ke,ze,je,Ne){if(ze.geometry){var _r=ze.geometry.coordinates,Xr=ze.geometry.type,rn=Math.pow(je.tolerance/((1<<je.maxZoom)*je.extent),2),Br=[],_n=ze.id;if(je.promoteId?_n=ze.properties[je.promoteId]:je.generateId&&(_n=Ne||0),Xr==="Point")ur(_r,Br);else if(Xr==="MultiPoint")for(var bn=0;bn<_r.length;bn++)ur(_r[bn],Br);else if(Xr==="LineString")fr(_r,Br,rn,!1);else if(Xr==="MultiLineString")if(je.lineMetrics){for(bn=0;bn<_r.length;bn++)Br=[],fr(_r[bn],Br,rn,!1),ke.push(le(_n,"LineString",Br,ze.properties));return}else We(_r,Br,rn,!1);else if(Xr==="Polygon")We(_r,Br,rn,!0);else if(Xr==="MultiPolygon")for(bn=0;bn<_r.length;bn++){var Fn=[];We(_r[bn],Fn,rn,!0),Br.push(Fn)}else if(Xr==="GeometryCollection"){for(bn=0;bn<ze.geometry.geometries.length;bn++)Oe(ke,{id:_n,geometry:ze.geometry.geometries[bn],properties:ze.properties},je,Ne);return}else throw new Error("Input data is not a valid GeoJSON object.");ke.push(le(_n,Xr,Br,ze.properties))}}function ur(ke,ze){ze.push(Lr(ke[0])),ze.push(kr(ke[1])),ze.push(0)}function fr(ke,ze,je,Ne){for(var _r,Xr,rn=0,Br=0;Br<ke.length;Br++){var _n=Lr(ke[Br][0]),bn=kr(ke[Br][1]);ze.push(_n),ze.push(bn),ze.push(0),Br>0&&(Ne?rn+=(_r*bn-_n*Xr)/2:rn+=Math.sqrt(Math.pow(_n-_r,2)+Math.pow(bn-Xr,2))),_r=_n,Xr=bn}var Fn=ze.length-3;ze[2]=1,Kt(ze,0,Fn,je),ze[Fn+2]=1,ze.size=Math.abs(rn),ze.start=0,ze.end=ze.size}function We(ke,ze,je,Ne){for(var _r=0;_r<ke.length;_r++){var Xr=[];fr(ke[_r],Xr,je,Ne),ze.push(Xr)}}function Lr(ke){return ke/360+.5}function kr(ke){var ze=Math.sin(ke*Math.PI/180),je=.5-.25*Math.log((1+ze)/(1-ze))/Math.PI;return je<0?0:je>1?1:je}function he(ke,ze,je,Ne,_r,Xr,rn,Br){if(je/=ze,Ne/=ze,Xr>=je&&rn<Ne)return ke;if(rn<je||Xr>=Ne)return null;for(var _n=[],bn=0;bn<ke.length;bn++){var Fn=ke[bn],on=Fn.geometry,Bn=Fn.type,ue=_r===0?Fn.minX:Fn.minY,xe=_r===0?Fn.maxX:Fn.maxY;if(ue>=je&&xe<Ne){_n.push(Fn);continue}else if(xe<je||ue>=Ne)continue;var Pr=[];if(Bn==="Point"||Bn==="MultiPoint")Dt(on,Pr,je,Ne,_r);else if(Bn==="LineString")qt(on,Pr,je,Ne,_r,!1,Br.lineMetrics);else if(Bn==="MultiLineString")ut(on,Pr,je,Ne,_r,!1);else if(Bn==="Polygon")ut(on,Pr,je,Ne,_r,!0);else if(Bn==="MultiPolygon")for(var Sr=0;Sr<on.length;Sr++){var gr=[];ut(on[Sr],gr,je,Ne,_r,!0),gr.length&&Pr.push(gr)}if(Pr.length){if(Br.lineMetrics&&Bn==="LineString"){for(Sr=0;Sr<Pr.length;Sr++)_n.push(le(Fn.id,Bn,Pr[Sr],Fn.tags));continue}(Bn==="LineString"||Bn==="MultiLineString")&&(Pr.length===1?(Bn="LineString",Pr=Pr[0]):Bn="MultiLineString"),(Bn==="Point"||Bn==="MultiPoint")&&(Bn=Pr.length===3?"Point":"MultiPoint"),_n.push(le(Fn.id,Bn,Pr,Fn.tags))}}return _n.length?_n:null}function Dt(ke,ze,je,Ne,_r){for(var Xr=0;Xr<ke.length;Xr+=3){var rn=ke[Xr+_r];rn>=je&&rn<=Ne&&(ze.push(ke[Xr]),ze.push(ke[Xr+1]),ze.push(ke[Xr+2]))}}function qt(ke,ze,je,Ne,_r,Xr,rn){for(var Br=zt(ke),_n=_r===0?Mt:Ot,bn=ke.start,Fn,on,Bn=0;Bn<ke.length-3;Bn+=3){var ue=ke[Bn],xe=ke[Bn+1],Pr=ke[Bn+2],Sr=ke[Bn+3],gr=ke[Bn+4],dr=_r===0?ue:xe,Er=_r===0?Sr:gr,Dr=!1;rn&&(Fn=Math.sqrt(Math.pow(ue-Sr,2)+Math.pow(xe-gr,2))),dr<je?Er>je&&(on=_n(Br,ue,xe,Sr,gr,je),rn&&(Br.start=bn+Fn*on)):dr>Ne?Er<Ne&&(on=_n(Br,ue,xe,Sr,gr,Ne),rn&&(Br.start=bn+Fn*on)):yt(Br,ue,xe,Pr),Er<je&&dr>=je&&(on=_n(Br,ue,xe,Sr,gr,je),Dr=!0),Er>Ne&&dr<=Ne&&(on=_n(Br,ue,xe,Sr,gr,Ne),Dr=!0),!Xr&&Dr&&(rn&&(Br.end=bn+Fn*on),ze.push(Br),Br=zt(ke)),rn&&(bn+=Fn)}var Ar=ke.length-3;ue=ke[Ar],xe=ke[Ar+1],Pr=ke[Ar+2],dr=_r===0?ue:xe,dr>=je&&dr<=Ne&&yt(Br,ue,xe,Pr),Ar=Br.length-3,Xr&&Ar>=3&&(Br[Ar]!==Br[0]||Br[Ar+1]!==Br[1])&&yt(Br,Br[0],Br[1],Br[2]),Br.length&&ze.push(Br)}function zt(ke){var ze=[];return ze.size=ke.size,ze.start=ke.start,ze.end=ke.end,ze}function ut(ke,ze,je,Ne,_r,Xr){for(var rn=0;rn<ke.length;rn++)qt(ke[rn],ze,je,Ne,_r,Xr,!1)}function yt(ke,ze,je,Ne){ke.push(ze),ke.push(je),ke.push(Ne)}function Mt(ke,ze,je,Ne,_r,Xr){var rn=(Xr-ze)/(Ne-ze);return ke.push(Xr),ke.push(je+(_r-je)*rn),ke.push(1),rn}function Ot(ke,ze,je,Ne,_r,Xr){var rn=(Xr-je)/(_r-je);return ke.push(ze+(Ne-ze)*rn),ke.push(Xr),ke.push(1),rn}function $t(ke,ze){var je=ze.buffer/ze.extent,Ne=ke,_r=he(ke,1,-1-je,je,0,-1,2,ze),Xr=he(ke,1,1-je,2+je,0,-1,2,ze);return(_r||Xr)&&(Ne=he(ke,1,-je,1+je,0,-1,2,ze)||[],_r&&(Ne=ee(_r,1).concat(Ne)),Xr&&(Ne=Ne.concat(ee(Xr,-1)))),Ne}function ee(ke,ze){for(var je=[],Ne=0;Ne<ke.length;Ne++){var _r=ke[Ne],Xr=_r.type,rn;if(Xr==="Point"||Xr==="MultiPoint"||Xr==="LineString")rn=we(_r.geometry,ze);else if(Xr==="MultiLineString"||Xr==="Polygon"){rn=[];for(var Br=0;Br<_r.geometry.length;Br++)rn.push(we(_r.geometry[Br],ze))}else if(Xr==="MultiPolygon")for(rn=[],Br=0;Br<_r.geometry.length;Br++){for(var _n=[],bn=0;bn<_r.geometry[Br].length;bn++)_n.push(we(_r.geometry[Br][bn],ze));rn.push(_n)}je.push(le(_r.id,Xr,rn,_r.tags))}return je}function we(ke,ze){var je=[];je.size=ke.size,ke.start!==void 0&&(je.start=ke.start,je.end=ke.end);for(var Ne=0;Ne<ke.length;Ne+=3)je.push(ke[Ne]+ze,ke[Ne+1],ke[Ne+2]);return je}function Me(ke,ze){if(ke.transformed)return ke;var je=1<<ke.z,Ne=ke.x,_r=ke.y,Xr,rn,Br;for(Xr=0;Xr<ke.features.length;Xr++){var _n=ke.features[Xr],bn=_n.geometry,Fn=_n.type;if(_n.geometry=[],Fn===1)for(rn=0;rn<bn.length;rn+=2)_n.geometry.push(Re(bn[rn],bn[rn+1],ze,je,Ne,_r));else for(rn=0;rn<bn.length;rn++){var on=[];for(Br=0;Br<bn[rn].length;Br+=2)on.push(Re(bn[rn][Br],bn[rn][Br+1],ze,je,Ne,_r));_n.geometry.push(on)}}return ke.transformed=!0,ke}function Re(ke,ze,je,Ne,_r,Xr){return[Math.round(je*(ke*Ne-_r)),Math.round(je*(ze*Ne-Xr))]}function Be(ke,ze,je,Ne,_r){for(var Xr=ze===_r.maxZoom?0:_r.tolerance/((1<<ze)*_r.extent),rn={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:je,y:Ne,z:ze,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},Br=0;Br<ke.length;Br++){rn.numFeatures++,Ze(rn,ke[Br],Xr,_r);var _n=ke[Br].minX,bn=ke[Br].minY,Fn=ke[Br].maxX,on=ke[Br].maxY;_n<rn.minX&&(rn.minX=_n),bn<rn.minY&&(rn.minY=bn),Fn>rn.maxX&&(rn.maxX=Fn),on>rn.maxY&&(rn.maxY=on)}return rn}function Ze(ke,ze,je,Ne){var _r=ze.geometry,Xr=ze.type,rn=[];if(Xr==="Point"||Xr==="MultiPoint")for(var Br=0;Br<_r.length;Br+=3)rn.push(_r[Br]),rn.push(_r[Br+1]),ke.numPoints++,ke.numSimplified++;else if(Xr==="LineString")Ue(rn,_r,ke,je,!1,!1);else if(Xr==="MultiLineString"||Xr==="Polygon")for(Br=0;Br<_r.length;Br++)Ue(rn,_r[Br],ke,je,Xr==="Polygon",Br===0);else if(Xr==="MultiPolygon")for(var _n=0;_n<_r.length;_n++){var bn=_r[_n];for(Br=0;Br<bn.length;Br++)Ue(rn,bn[Br],ke,je,!0,Br===0)}if(rn.length){var Fn=ze.tags||null;if(Xr==="LineString"&&Ne.lineMetrics){Fn={};for(var on in ze.tags)Fn[on]=ze.tags[on];Fn.mapbox_clip_start=_r.start/_r.size,Fn.mapbox_clip_end=_r.end/_r.size}var Bn={geometry:rn,type:Xr==="Polygon"||Xr==="MultiPolygon"?3:Xr==="LineString"||Xr==="MultiLineString"?2:1,tags:Fn};ze.id!==null&&(Bn.id=ze.id),ke.features.push(Bn)}}function Ue(ke,ze,je,Ne,_r,Xr){var rn=Ne*Ne;if(Ne>0&&ze.size<(_r?rn:Ne)){je.numPoints+=ze.length/3;return}for(var Br=[],_n=0;_n<ze.length;_n+=3)(Ne===0||ze[_n+2]>rn)&&(je.numSimplified++,Br.push(ze[_n]),Br.push(ze[_n+1])),je.numPoints++;_r&&mr(Br,Xr),ke.push(Br)}function mr(ke,ze){for(var je=0,Ne=0,_r=ke.length,Xr=_r-2;Ne<_r;Xr=Ne,Ne+=2)je+=(ke[Ne]-ke[Xr])*(ke[Ne+1]+ke[Xr+1]);if(je>0===ze)for(Ne=0,_r=ke.length;Ne<_r/2;Ne+=2){var rn=ke[Ne],Br=ke[Ne+1];ke[Ne]=ke[_r-2-Ne],ke[Ne+1]=ke[_r-1-Ne],ke[_r-2-Ne]=rn,ke[_r-1-Ne]=Br}}function ln(ke,ze){return new an(ke,ze)}function an(ke,ze){ze=this.options=Sn(Object.create(this.options),ze);var je=ze.debug;if(je&&console.time("preprocess data"),ze.maxZoom<0||ze.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(ze.promoteId&&ze.generateId)throw new Error("promoteId and generateId cannot be used together.");var Ne=Fe(ke,ze);this.tiles={},this.tileCoords=[],je&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",ze.indexMaxZoom,ze.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Ne=$t(Ne,ze),Ne.length&&this.splitTile(Ne,0,0,0),je&&(Ne.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}an.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},an.prototype.splitTile=function(ke,ze,je,Ne,_r,Xr,rn){for(var Br=[ke,ze,je,Ne],_n=this.options,bn=_n.debug;Br.length;){Ne=Br.pop(),je=Br.pop(),ze=Br.pop(),ke=Br.pop();var Fn=1<<ze,on=vn(ze,je,Ne),Bn=this.tiles[on];if(!Bn&&(bn>1&&console.time("creation"),Bn=this.tiles[on]=Be(ke,ze,je,Ne,_n),this.tileCoords.push({z:ze,x:je,y:Ne}),bn)){bn>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ze,je,Ne,Bn.numFeatures,Bn.numPoints,Bn.numSimplified),console.timeEnd("creation"));var ue="z"+ze;this.stats[ue]=(this.stats[ue]||0)+1,this.total++}if(Bn.source=ke,_r){if(ze===_n.maxZoom||ze===_r)continue;var xe=1<<_r-ze;if(je!==Math.floor(Xr/xe)||Ne!==Math.floor(rn/xe))continue}else if(ze===_n.indexMaxZoom||Bn.numPoints<=_n.indexMaxPoints)continue;if(Bn.source=null,ke.length!==0){bn>1&&console.time("clipping");var Pr=.5*_n.buffer/_n.extent,Sr=.5-Pr,gr=.5+Pr,dr=1+Pr,Er,Dr,Ar,Gr,Wr,Jr;Er=Dr=Ar=Gr=null,Wr=he(ke,Fn,je-Pr,je+gr,0,Bn.minX,Bn.maxX,_n),Jr=he(ke,Fn,je+Sr,je+dr,0,Bn.minX,Bn.maxX,_n),ke=null,Wr&&(Er=he(Wr,Fn,Ne-Pr,Ne+gr,1,Bn.minY,Bn.maxY,_n),Dr=he(Wr,Fn,Ne+Sr,Ne+dr,1,Bn.minY,Bn.maxY,_n),Wr=null),Jr&&(Ar=he(Jr,Fn,Ne-Pr,Ne+gr,1,Bn.minY,Bn.maxY,_n),Gr=he(Jr,Fn,Ne+Sr,Ne+dr,1,Bn.minY,Bn.maxY,_n),Jr=null),bn>1&&console.timeEnd("clipping"),Br.push(Er||[],ze+1,je*2,Ne*2),Br.push(Dr||[],ze+1,je*2,Ne*2+1),Br.push(Ar||[],ze+1,je*2+1,Ne*2),Br.push(Gr||[],ze+1,je*2+1,Ne*2+1)}}},an.prototype.getTile=function(ke,ze,je){var Ne=this.options,_r=Ne.extent,Xr=Ne.debug;if(ke<0||ke>24)return null;var rn=1<<ke;ze=(ze%rn+rn)%rn;var Br=vn(ke,ze,je);if(this.tiles[Br])return Me(this.tiles[Br],_r);Xr>1&&console.log("drilling down to z%d-%d-%d",ke,ze,je);for(var _n=ke,bn=ze,Fn=je,on;!on&&_n>0;)_n--,bn=Math.floor(bn/2),Fn=Math.floor(Fn/2),on=this.tiles[vn(_n,bn,Fn)];return!on||!on.source?null:(Xr>1&&console.log("found parent tile z%d-%d-%d",_n,bn,Fn),Xr>1&&console.time("drilling down"),this.splitTile(on.source,_n,bn,Fn,ke,ze,je),Xr>1&&console.timeEnd("drilling down"),this.tiles[Br]?Me(this.tiles[Br],_r):null)};function vn(ke,ze,je){return((1<<ke)*je+ze)*32+ke}function Sn(ke,ze){for(var je in ze)ke[je]=ze[je];return ke}function An(ke,ze){var je=ke.tileID.canonical;if(!this._geoJSONIndex)return ze(null,null);var Ne=this._geoJSONIndex.getTile(je.z,je.x,je.y);if(!Ne)return ze(null,null);var _r=new w(Ne.features),Xr=D(_r);(Xr.byteOffset!==0||Xr.byteLength!==Xr.buffer.byteLength)&&(Xr=new Uint8Array(Xr)),ze(null,{vectorTile:_r,rawData:Xr.buffer})}var pn=function(ke){function ze(je,Ne,_r,Xr){ke.call(this,je,Ne,_r,An),Xr&&(this.loadGeoJSON=Xr)}return ke&&(ze.__proto__=ke),ze.prototype=Object.create(ke&&ke.prototype),ze.prototype.constructor=ze,ze.prototype.loadData=function(je,Ne){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=Ne,this._pendingLoadDataParams=je,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},ze.prototype._loadData=function(){var je=this;if(!(!this._pendingCallback||!this._pendingLoadDataParams)){var Ne=this._pendingCallback,_r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var Xr=_r&&_r.request&&_r.request.collectResourceTiming?new t.RequestPerformance(_r.request):!1;this.loadGeoJSON(_r,function(rn,Br){if(rn||!Br)return Ne(rn);if(typeof Br!="object")return Ne(new Error("Input data given to '"+_r.source+"' is not a valid GeoJSON object."));l(Br,!0);try{if(_r.filter){var _n=t.createExpression(_r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(_n.result==="error")throw new Error(_n.value.map(function(Bn){return Bn.key+": "+Bn.message}).join(", "));var bn=Br.features.filter(function(Bn){return _n.value.evaluate({zoom:0},Bn)});Br={type:"FeatureCollection",features:bn}}je._geoJSONIndex=_r.cluster?new xt(On(_r)).load(Br.features):ln(Br,_r.geojsonVtOptions)}catch(Bn){return Ne(Bn)}je.loaded={};var Fn={};if(Xr){var on=Xr.finish();on&&(Fn.resourceTiming={},Fn.resourceTiming[_r.source]=JSON.parse(JSON.stringify(on)))}Ne(null,Fn)})}},ze.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},ze.prototype.reloadTile=function(je,Ne){var _r=this.loaded,Xr=je.uid;return _r&&_r[Xr]?ke.prototype.reloadTile.call(this,je,Ne):this.loadTile(je,Ne)},ze.prototype.loadGeoJSON=function(je,Ne){if(je.request)t.getJSON(je.request,Ne);else if(typeof je.data=="string")try{return Ne(null,JSON.parse(je.data))}catch{return Ne(new Error("Input data given to '"+je.source+"' is not a valid GeoJSON object."))}else return Ne(new Error("Input data given to '"+je.source+"' is not a valid GeoJSON object."))},ze.prototype.removeSource=function(je,Ne){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),Ne()},ze.prototype.getClusterExpansionZoom=function(je,Ne){try{Ne(null,this._geoJSONIndex.getClusterExpansionZoom(je.clusterId))}catch(_r){Ne(_r)}},ze.prototype.getClusterChildren=function(je,Ne){try{Ne(null,this._geoJSONIndex.getChildren(je.clusterId))}catch(_r){Ne(_r)}},ze.prototype.getClusterLeaves=function(je,Ne){try{Ne(null,this._geoJSONIndex.getLeaves(je.clusterId,je.limit,je.offset))}catch(_r){Ne(_r)}},ze}(m);function On(ke){var ze=ke.superclusterOptions,je=ke.clusterProperties;if(!je||!ze)return ze;for(var Ne={},_r={},Xr={accumulated:null,zoom:0},rn={properties:null},Br=Object.keys(je),_n=0,bn=Br;_n<bn.length;_n+=1){var Fn=bn[_n],on=je[Fn],Bn=on[0],ue=on[1],xe=t.createExpression(ue),Pr=t.createExpression(typeof Bn=="string"?[Bn,["accumulated"],["get",Fn]]:Bn);Ne[Fn]=xe.value,_r[Fn]=Pr.value}return ze.map=function(Sr){rn.properties=Sr;for(var gr={},dr=0,Er=Br;dr<Er.length;dr+=1){var Dr=Er[dr];gr[Dr]=Ne[Dr].evaluate(Xr,rn)}return gr},ze.reduce=function(Sr,gr){rn.properties=gr;for(var dr=0,Er=Br;dr<Er.length;dr+=1){var Dr=Er[dr];Xr.accumulated=Sr[Dr],Sr[Dr]=_r[Dr].evaluate(Xr,rn)}},ze}var Nn=function(ke){var ze=this;this.self=ke,this.actor=new t.Actor(ke,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:m,geojson:pn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(je,Ne){if(ze.workerSourceTypes[je])throw new Error('Worker source with name "'+je+'" already registered.');ze.workerSourceTypes[je]=Ne},this.self.registerRTLTextPlugin=function(je){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=je.applyArabicShaping,t.plugin.processBidirectionalText=je.processBidirectionalText,t.plugin.processStyledBidirectionalText=je.processStyledBidirectionalText}};return Nn.prototype.setReferrer=function(ke,ze){this.referrer=ze},Nn.prototype.setImages=function(ke,ze,je){this.availableImages[ke]=ze;for(var Ne in this.workerSources[ke]){var _r=this.workerSources[ke][Ne];for(var Xr in _r)_r[Xr].availableImages=ze}je()},Nn.prototype.setLayers=function(ke,ze,je){this.getLayerIndex(ke).replace(ze),je()},Nn.prototype.updateLayers=function(ke,ze,je){this.getLayerIndex(ke).update(ze.layers,ze.removedIds),je()},Nn.prototype.loadTile=function(ke,ze,je){this.getWorkerSource(ke,ze.type,ze.source).loadTile(ze,je)},Nn.prototype.loadDEMTile=function(ke,ze,je){this.getDEMWorkerSource(ke,ze.source).loadTile(ze,je)},Nn.prototype.reloadTile=function(ke,ze,je){this.getWorkerSource(ke,ze.type,ze.source).reloadTile(ze,je)},Nn.prototype.abortTile=function(ke,ze,je){this.getWorkerSource(ke,ze.type,ze.source).abortTile(ze,je)},Nn.prototype.removeTile=function(ke,ze,je){this.getWorkerSource(ke,ze.type,ze.source).removeTile(ze,je)},Nn.prototype.removeDEMTile=function(ke,ze){this.getDEMWorkerSource(ke,ze.source).removeTile(ze)},Nn.prototype.removeSource=function(ke,ze,je){if(!(!this.workerSources[ke]||!this.workerSources[ke][ze.type]||!this.workerSources[ke][ze.type][ze.source])){var Ne=this.workerSources[ke][ze.type][ze.source];delete this.workerSources[ke][ze.type][ze.source],Ne.removeSource!==void 0?Ne.removeSource(ze,je):je()}},Nn.prototype.loadWorkerSource=function(ke,ze,je){try{this.self.importScripts(ze.url),je()}catch(Ne){je(Ne.toString())}},Nn.prototype.syncRTLPluginState=function(ke,ze,je){try{t.plugin.setState(ze);var Ne=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&Ne!=null){this.self.importScripts(Ne);var _r=t.plugin.isParsed(),Xr=_r?void 0:new Error("RTL Text Plugin failed to import scripts from "+Ne);je(Xr,_r)}}catch(rn){je(rn.toString())}},Nn.prototype.getAvailableImages=function(ke){var ze=this.availableImages[ke];return ze||(ze=[]),ze},Nn.prototype.getLayerIndex=function(ke){var ze=this.layerIndexes[ke];return ze||(ze=this.layerIndexes[ke]=new n),ze},Nn.prototype.getWorkerSource=function(ke,ze,je){var Ne=this;if(this.workerSources[ke]||(this.workerSources[ke]={}),this.workerSources[ke][ze]||(this.workerSources[ke][ze]={}),!this.workerSources[ke][ze][je]){var _r={send:function(Xr,rn,Br){Ne.actor.send(Xr,rn,Br,ke)}};this.workerSources[ke][ze][je]=new this.workerSourceTypes[ze](_r,this.getLayerIndex(ke),this.getAvailableImages(ke))}return this.workerSources[ke][ze][je]},Nn.prototype.getDEMWorkerSource=function(ke,ze){return this.demWorkerSources[ke]||(this.demWorkerSources[ke]={}),this.demWorkerSources[ke][ze]||(this.demWorkerSources[ke][ze]=new y),this.demWorkerSources[ke][ze]},Nn.prototype.enforceCacheSizeLimit=function(ke,ze){t.enforceCacheSizeLimit(ze)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Nn(self)),Nn}),A(["./shared"],function(t){var e=t.createCommonjsModule(function(W){W.exports?W.exports=et:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=et,window.mapboxgl.notSupportedReason=K);function et(cr){return!K(cr)}function K(cr){if(!pt())return"not a browser";if(!Ct())return"insufficent Array support";if(!Yt())return"insufficient Function support";if(!ce())return"insufficient Object support";if(!re())return"insufficient JSON support";if(!ye())return"insufficient worker support";if(!Le())return"insufficient Uint8ClampedArray support";if(!tr())return"insufficient ArrayBuffer support";if(!$e())return"insufficient Canvas/getImageData support";if(!pr(cr&&cr.failIfMajorPerformanceCaveat))return"insufficient WebGL support"}function pt(){return typeof window<"u"&&typeof document<"u"}function Ct(){return 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 Yt(){return Function.prototype&&Function.prototype.bind}function ce(){return 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}function re(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function ye(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var cr=new Blob([""],{type:"text/javascript"}),hr=URL.createObjectURL(cr),Vr,yn;try{yn=new Worker(hr),Vr=!0}catch{Vr=!1}return yn&&yn.terminate(),URL.revokeObjectURL(hr),Vr}function Le(){return"Uint8ClampedArray"in window}function tr(){return ArrayBuffer.isView}function $e(){var cr=document.createElement("canvas");cr.width=cr.height=1;var hr=cr.getContext("2d");if(!hr)return!1;var Vr=hr.getImageData(0,0,1,1);return Vr&&Vr.width===cr.width}var er={};function pr(cr){return er[cr]===void 0&&(er[cr]=rr(cr)),er[cr]}et.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};function wr(cr){var hr=document.createElement("canvas"),Vr=Object.create(et.webGLContextAttributes);return Vr.failIfMajorPerformanceCaveat=cr,hr.probablySupportsContext?hr.probablySupportsContext("webgl",Vr)||hr.probablySupportsContext("experimental-webgl",Vr):hr.supportsContext?hr.supportsContext("webgl",Vr)||hr.supportsContext("experimental-webgl",Vr):hr.getContext("webgl",Vr)||hr.getContext("experimental-webgl",Vr)}function rr(cr){var hr=wr(cr);if(!hr)return!1;var Vr=hr.createShader(hr.VERTEX_SHADER);return!Vr||hr.isContextLost()?!1:(hr.shaderSource(Vr,"void main() {}"),hr.compileShader(Vr),hr.getShaderParameter(Vr,hr.COMPILE_STATUS)===!0)}}),r={};r.create=function(W,et,K){var pt=t.window.document.createElement(W);return et!==void 0&&(pt.className=et),K&&K.appendChild(pt),pt},r.createNS=function(W,et){var K=t.window.document.createElementNS(W,et);return K};var i=t.window.document&&t.window.document.documentElement.style;function n(W){if(!i)return W[0];for(var et=0;et<W.length;et++)if(W[et]in i)return W[et];return W[0]}var o=n(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),a;r.disableDrag=function(){i&&o&&(a=i[o],i[o]="none")},r.enableDrag=function(){i&&o&&(i[o]=a)};var s=n(["transform","WebkitTransform"]);r.setTransform=function(W,et){W.style[s]=et};var h=!1;try{var v=Object.defineProperty({},"passive",{get:function(){h=!0}});t.window.addEventListener("test",v,v),t.window.removeEventListener("test",v,v)}catch{h=!1}r.addEventListener=function(W,et,K,pt){pt===void 0&&(pt={}),"passive"in pt&&h?W.addEventListener(et,K,pt):W.addEventListener(et,K,pt.capture)},r.removeEventListener=function(W,et,K,pt){pt===void 0&&(pt={}),"passive"in pt&&h?W.removeEventListener(et,K,pt):W.removeEventListener(et,K,pt.capture)};var m=function(W){W.preventDefault(),W.stopPropagation(),t.window.removeEventListener("click",m,!0)};r.suppressClick=function(){t.window.addEventListener("click",m,!0),t.window.setTimeout(function(){t.window.removeEventListener("click",m,!0)},0)},r.mousePos=function(W,et){var K=W.getBoundingClientRect();return new t.Point(et.clientX-K.left-W.clientLeft,et.clientY-K.top-W.clientTop)},r.touchPos=function(W,et){for(var K=W.getBoundingClientRect(),pt=[],Ct=0;Ct<et.length;Ct++)pt.push(new t.Point(et[Ct].clientX-K.left-W.clientLeft,et[Ct].clientY-K.top-W.clientTop));return pt},r.mouseButton=function(W){return typeof t.window.InstallTrigger<"u"&&W.button===2&&W.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:W.button},r.remove=function(W){W.parentNode&&W.parentNode.removeChild(W)};function p(W,et,K){var pt,Ct,Yt,ce=t.browser.devicePixelRatio>1?"@2x":"",re=t.getJSON(et.transformRequest(et.normalizeSpriteURL(W,ce,".json"),t.ResourceType.SpriteJSON),function(tr,$e){re=null,Yt||(Yt=tr,pt=$e,Le())}),ye=t.getImage(et.transformRequest(et.normalizeSpriteURL(W,ce,".png"),t.ResourceType.SpriteImage),function(tr,$e){ye=null,Yt||(Yt=tr,Ct=$e,Le())});function Le(){if(Yt)K(Yt);else if(pt&&Ct){var tr=t.browser.getImageData(Ct),$e={};for(var er in pt){var pr=pt[er],wr=pr.width,rr=pr.height,cr=pr.x,hr=pr.y,Vr=pr.sdf,yn=pr.pixelRatio,wn=pr.stretchX,$n=pr.stretchY,Xn=pr.content,Vn=new t.RGBAImage({width:wr,height:rr});t.RGBAImage.copy(tr,Vn,{x:cr,y:hr},{x:0,y:0},{width:wr,height:rr}),$e[er]={data:Vn,pixelRatio:yn,sdf:Vr,stretchX:wn,stretchY:$n,content:Xn}}K(null,$e)}}return{cancel:function(){re&&(re.cancel(),re=null),ye&&(ye.cancel(),ye=null)}}}function y(W){var et=W.userImage;if(et&&et.render){var K=et.render();if(K)return W.data.replace(new Uint8Array(et.data.buffer)),!0}return!1}var l=1,x=function(W){function et(){W.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.isLoaded=function(){return this.loaded},et.prototype.setLoaded=function(K){if(this.loaded!==K&&(this.loaded=K,K)){for(var pt=0,Ct=this.requestors;pt<Ct.length;pt+=1){var Yt=Ct[pt],ce=Yt.ids,re=Yt.callback;this._notify(ce,re)}this.requestors=[]}},et.prototype.getImage=function(K){return this.images[K]},et.prototype.addImage=function(K,pt){this._validate(K,pt)&&(this.images[K]=pt)},et.prototype._validate=function(K,pt){var Ct=!0;return this._validateStretch(pt.stretchX,pt.data&&pt.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+K+'" has invalid "stretchX" value'))),Ct=!1),this._validateStretch(pt.stretchY,pt.data&&pt.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+K+'" has invalid "stretchY" value'))),Ct=!1),this._validateContent(pt.content,pt)||(this.fire(new t.ErrorEvent(new Error('Image "'+K+'" has invalid "content" value'))),Ct=!1),Ct},et.prototype._validateStretch=function(K,pt){if(!K)return!0;for(var Ct=0,Yt=0,ce=K;Yt<ce.length;Yt+=1){var re=ce[Yt];if(re[0]<Ct||re[1]<re[0]||pt<re[1])return!1;Ct=re[1]}return!0},et.prototype._validateContent=function(K,pt){return K?!(K.length!==4||K[0]<0||pt.data.width<K[0]||K[1]<0||pt.data.height<K[1]||K[2]<0||pt.data.width<K[2]||K[3]<0||pt.data.height<K[3]||K[2]<K[0]||K[3]<K[1]):!0},et.prototype.updateImage=function(K,pt){var Ct=this.images[K];pt.version=Ct.version+1,this.images[K]=pt,this.updatedImages[K]=!0},et.prototype.removeImage=function(K){var pt=this.images[K];delete this.images[K],delete this.patterns[K],pt.userImage&&pt.userImage.onRemove&&pt.userImage.onRemove()},et.prototype.listImages=function(){return Object.keys(this.images)},et.prototype.getImages=function(K,pt){var Ct=!0;if(!this.isLoaded())for(var Yt=0,ce=K;Yt<ce.length;Yt+=1){var re=ce[Yt];this.images[re]||(Ct=!1)}this.isLoaded()||Ct?this._notify(K,pt):this.requestors.push({ids:K,callback:pt})},et.prototype._notify=function(K,pt){for(var Ct={},Yt=0,ce=K;Yt<ce.length;Yt+=1){var re=ce[Yt];this.images[re]||this.fire(new t.Event("styleimagemissing",{id:re}));var ye=this.images[re];ye?Ct[re]={data:ye.data.clone(),pixelRatio:ye.pixelRatio,sdf:ye.sdf,version:ye.version,stretchX:ye.stretchX,stretchY:ye.stretchY,content:ye.content,hasRenderCallback:!!(ye.userImage&&ye.userImage.render)}:t.warnOnce('Image "'+re+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}pt(null,Ct)},et.prototype.getPixelSize=function(){var K=this.atlasImage,pt=K.width,Ct=K.height;return{width:pt,height:Ct}},et.prototype.getPattern=function(K){var pt=this.patterns[K],Ct=this.getImage(K);if(!Ct)return null;if(pt&&pt.position.version===Ct.version)return pt.position;if(pt)pt.position.version=Ct.version;else{var Yt=Ct.data.width+l*2,ce=Ct.data.height+l*2,re={w:Yt,h:ce,x:0,y:0},ye=new t.ImagePosition(re,Ct);this.patterns[K]={bin:re,position:ye}}return this._updatePatternAtlas(),this.patterns[K].position},et.prototype.bind=function(K){var pt=K.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(K,this.atlasImage,pt.RGBA),this.atlasTexture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE)},et.prototype._updatePatternAtlas=function(){var K=[];for(var pt in this.patterns)K.push(this.patterns[pt].bin);var Ct=t.potpack(K),Yt=Ct.w,ce=Ct.h,re=this.atlasImage;re.resize({width:Yt||1,height:ce||1});for(var ye in this.patterns){var Le=this.patterns[ye],tr=Le.bin,$e=tr.x+l,er=tr.y+l,pr=this.images[ye].data,wr=pr.width,rr=pr.height;t.RGBAImage.copy(pr,re,{x:0,y:0},{x:$e,y:er},{width:wr,height:rr}),t.RGBAImage.copy(pr,re,{x:0,y:rr-1},{x:$e,y:er-1},{width:wr,height:1}),t.RGBAImage.copy(pr,re,{x:0,y:0},{x:$e,y:er+rr},{width:wr,height:1}),t.RGBAImage.copy(pr,re,{x:wr-1,y:0},{x:$e-1,y:er},{width:1,height:rr}),t.RGBAImage.copy(pr,re,{x:0,y:0},{x:$e+wr,y:er},{width:1,height:rr})}this.dirty=!0},et.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},et.prototype.dispatchRenderCallbacks=function(K){for(var pt=0,Ct=K;pt<Ct.length;pt+=1){var Yt=Ct[pt];if(!this.callbackDispatchedThisFrame[Yt]){this.callbackDispatchedThisFrame[Yt]=!0;var ce=this.images[Yt],re=y(ce);re&&this.updateImage(Yt,ce)}}},et}(t.Evented);function b(W,et,K,pt,Ct){var Yt=et*256,ce=Yt+255,re=pt.transformRequest(pt.normalizeGlyphsURL(K).replace("{fontstack}",W).replace("{range}",Yt+"-"+ce),t.ResourceType.Glyphs);t.getArrayBuffer(re,function(ye,Le){if(ye)Ct(ye);else if(Le){for(var tr={},$e=0,er=t.parseGlyphPBF(Le);$e<er.length;$e+=1){var pr=er[$e];tr[pr.id]=pr}Ct(null,tr)}})}var S=w,T=w,M=1e20;function w(W,et,K,pt,Ct,Yt){this.fontSize=W||24,this.buffer=et===void 0?3:et,this.cutoff=pt||.25,this.fontFamily=Ct||"sans-serif",this.fontWeight=Yt||"normal",this.radius=K||8;var ce=this.size=this.fontSize+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=ce,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(ce*ce),this.gridInner=new Float64Array(ce*ce),this.f=new Float64Array(ce),this.d=new Float64Array(ce),this.z=new Float64Array(ce+1),this.v=new Int16Array(ce),this.middle=Math.round(ce/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}w.prototype.draw=function(W){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(W,this.buffer,this.middle);for(var et=this.ctx.getImageData(0,0,this.size,this.size),K=new Uint8ClampedArray(this.size*this.size),pt=0;pt<this.size*this.size;pt++){var Ct=et.data[pt*4+3]/255;this.gridOuter[pt]=Ct===1?0:Ct===0?M:Math.pow(Math.max(0,.5-Ct),2),this.gridInner[pt]=Ct===1?M:Ct===0?0:Math.pow(Math.max(0,Ct-.5),2)}for(u(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),u(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),pt=0;pt<this.size*this.size;pt++){var Yt=this.gridOuter[pt]-this.gridInner[pt];K[pt]=Math.max(0,Math.min(255,Math.round(255-255*(Yt/this.radius+this.cutoff))))}return K};function u(W,et,K,pt,Ct,Yt,ce){for(var re=0;re<et;re++){for(var ye=0;ye<K;ye++)pt[ye]=W[ye*et+re];for(f(pt,Ct,Yt,ce,K),ye=0;ye<K;ye++)W[ye*et+re]=Ct[ye]}for(ye=0;ye<K;ye++){for(re=0;re<et;re++)pt[re]=W[ye*et+re];for(f(pt,Ct,Yt,ce,et),re=0;re<et;re++)W[ye*et+re]=Math.sqrt(Ct[re])}}function f(W,et,K,pt,Ct){K[0]=0,pt[0]=-M,pt[1]=+M;for(var Yt=1,ce=0;Yt<Ct;Yt++){for(var re=(W[Yt]+Yt*Yt-(W[K[ce]]+K[ce]*K[ce]))/(2*Yt-2*K[ce]);re<=pt[ce];)ce--,re=(W[Yt]+Yt*Yt-(W[K[ce]]+K[ce]*K[ce]))/(2*Yt-2*K[ce]);ce++,K[ce]=Yt,pt[ce]=re,pt[ce+1]=+M}for(Yt=0,ce=0;Yt<Ct;Yt++){for(;pt[ce+1]<Yt;)ce++;et[Yt]=(Yt-K[ce])*(Yt-K[ce])+W[K[ce]]}}S.default=T;var k=function(W,et){this.requestManager=W,this.localIdeographFontFamily=et,this.entries={}};k.prototype.setURL=function(W){this.url=W},k.prototype.getGlyphs=function(W,et){var K=this,pt=[];for(var Ct in W)for(var Yt=0,ce=W[Ct];Yt<ce.length;Yt+=1){var re=ce[Yt];pt.push({stack:Ct,id:re})}t.asyncAll(pt,function(ye,Le){var tr=ye.stack,$e=ye.id,er=K.entries[tr];er||(er=K.entries[tr]={glyphs:{},requests:{},ranges:{}});var pr=er.glyphs[$e];if(pr!==void 0){Le(null,{stack:tr,id:$e,glyph:pr});return}if(pr=K._tinySDF(er,tr,$e),pr){er.glyphs[$e]=pr,Le(null,{stack:tr,id:$e,glyph:pr});return}var wr=Math.floor($e/256);if(wr*256>65535){Le(new Error("glyphs > 65535 not supported"));return}if(er.ranges[wr]){Le(null,{stack:tr,id:$e,glyph:pr});return}var rr=er.requests[wr];rr||(rr=er.requests[wr]=[],k.loadGlyphRange(tr,wr,K.url,K.requestManager,function(cr,hr){if(hr){for(var Vr in hr)K._doesCharSupportLocalGlyph(+Vr)||(er.glyphs[+Vr]=hr[+Vr]);er.ranges[wr]=!0}for(var yn=0,wn=rr;yn<wn.length;yn+=1){var $n=wn[yn];$n(cr,hr)}delete er.requests[wr]})),rr.push(function(cr,hr){cr?Le(cr):hr&&Le(null,{stack:tr,id:$e,glyph:hr[$e]||null})})},function(ye,Le){if(ye)et(ye);else if(Le){for(var tr={},$e=0,er=Le;$e<er.length;$e+=1){var pr=er[$e],wr=pr.stack,rr=pr.id,cr=pr.glyph;(tr[wr]||(tr[wr]={}))[rr]=cr&&{id:cr.id,bitmap:cr.bitmap.clone(),metrics:cr.metrics}}et(null,tr)}})},k.prototype._doesCharSupportLocalGlyph=function(W){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](W)||t.isChar["Hangul Syllables"](W)||t.isChar.Hiragana(W)||t.isChar.Katakana(W))},k.prototype._tinySDF=function(W,et,K){var pt=this.localIdeographFontFamily;if(pt&&this._doesCharSupportLocalGlyph(K)){var Ct=W.tinySDF;if(!Ct){var Yt="400";/bold/i.test(et)?Yt="900":/medium/i.test(et)?Yt="500":/light/i.test(et)&&(Yt="200"),Ct=W.tinySDF=new k.TinySDF(24,3,8,.25,pt,Yt)}return{id:K,bitmap:new t.AlphaImage({width:30,height:30},Ct.draw(String.fromCharCode(K))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},k.loadGlyphRange=b,k.TinySDF=S;var _=function(){this.specification=t.styleSpec.light.position};_.prototype.possiblyEvaluate=function(W,et){return t.sphericalToCartesian(W.expression.evaluate(et))},_.prototype.interpolate=function(W,et,K){return{x:t.number(W.x,et.x,K),y:t.number(W.y,et.y,K),z:t.number(W.z,et.z,K)}};var D=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new _,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),I="-transition",O=function(W){function et(K){W.call(this),this._transitionable=new t.Transitionable(D),this.setLight(K),this._transitioning=this._transitionable.untransitioned()}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getLight=function(){return this._transitionable.serialize()},et.prototype.setLight=function(K,pt){if(pt===void 0&&(pt={}),!this._validate(t.validateLight,K,pt))for(var Ct in K){var Yt=K[Ct];t.endsWith(Ct,I)?this._transitionable.setTransition(Ct.slice(0,-I.length),Yt):this._transitionable.setValue(Ct,Yt)}},et.prototype.updateTransitions=function(K){this._transitioning=this._transitionable.transitioned(K,this._transitioning)},et.prototype.hasTransition=function(){return this._transitioning.hasTransition()},et.prototype.recalculate=function(K){this.properties=this._transitioning.possiblyEvaluate(K)},et.prototype._validate=function(K,pt,Ct){return Ct&&Ct.validate===!1?!1:t.emitValidationErrors(this,K.call(t.validateStyle,t.extend({value:pt,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},et}(t.Evented),B=function(W,et){this.width=W,this.height=et,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};B.prototype.getDash=function(W,et){var K=W.join(",")+String(et);return this.dashEntry[K]||(this.dashEntry[K]=this.addDash(W,et)),this.dashEntry[K]},B.prototype.getDashRanges=function(W,et,K){var pt=W.length%2===1,Ct=[],Yt=pt?-W[W.length-1]*K:0,ce=W[0]*K,re=!0;Ct.push({left:Yt,right:ce,isDash:re,zeroLength:W[0]===0});for(var ye=W[0],Le=1;Le<W.length;Le++){re=!re;var tr=W[Le];Yt=ye*K,ye+=tr,ce=ye*K,Ct.push({left:Yt,right:ce,isDash:re,zeroLength:tr===0})}return Ct},B.prototype.addRoundDash=function(W,et,K){for(var pt=et/2,Ct=-K;Ct<=K;Ct++)for(var Yt=this.nextRow+K+Ct,ce=this.width*Yt,re=0,ye=W[re],Le=0;Le<this.width;Le++){Le/ye.right>1&&(ye=W[++re]);var tr=Math.abs(Le-ye.left),$e=Math.abs(Le-ye.right),er=Math.min(tr,$e),pr=void 0,wr=Ct/K*(pt+1);if(ye.isDash){var rr=pt-Math.abs(wr);pr=Math.sqrt(er*er+rr*rr)}else pr=pt-Math.sqrt(er*er+wr*wr);this.data[ce+Le]=Math.max(0,Math.min(255,pr+128))}},B.prototype.addRegularDash=function(W){for(var et=W.length-1;et>=0;--et){var K=W[et],pt=W[et+1];K.zeroLength?W.splice(et,1):pt&&pt.isDash===K.isDash&&(pt.left=K.left,W.splice(et,1))}var Ct=W[0],Yt=W[W.length-1];Ct.isDash===Yt.isDash&&(Ct.left=Yt.left-this.width,Yt.right=Ct.right+this.width);for(var ce=this.width*this.nextRow,re=0,ye=W[re],Le=0;Le<this.width;Le++){Le/ye.right>1&&(ye=W[++re]);var tr=Math.abs(Le-ye.left),$e=Math.abs(Le-ye.right),er=Math.min(tr,$e),pr=ye.isDash?er:-er;this.data[ce+Le]=Math.max(0,Math.min(255,pr+128))}},B.prototype.addDash=function(W,et){var K=et?7:0,pt=2*K+1;if(this.nextRow+pt>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var Ct=0,Yt=0;Yt<W.length;Yt++)Ct+=W[Yt];if(Ct!==0){var ce=this.width/Ct,re=this.getDashRanges(W,this.width,ce);et?this.addRoundDash(re,ce,K):this.addRegularDash(re)}var ye={y:(this.nextRow+K+.5)/this.height,height:2*K/this.height,width:Ct};return this.nextRow+=pt,this.dirty=!0,ye},B.prototype.bind=function(W){var et=W.gl;this.texture?(et.bindTexture(et.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,et.texSubImage2D(et.TEXTURE_2D,0,0,0,this.width,this.height,et.ALPHA,et.UNSIGNED_BYTE,this.data))):(this.texture=et.createTexture(),et.bindTexture(et.TEXTURE_2D,this.texture),et.texParameteri(et.TEXTURE_2D,et.TEXTURE_WRAP_S,et.REPEAT),et.texParameteri(et.TEXTURE_2D,et.TEXTURE_WRAP_T,et.REPEAT),et.texParameteri(et.TEXTURE_2D,et.TEXTURE_MIN_FILTER,et.LINEAR),et.texParameteri(et.TEXTURE_2D,et.TEXTURE_MAG_FILTER,et.LINEAR),et.texImage2D(et.TEXTURE_2D,0,et.ALPHA,this.width,this.height,0,et.ALPHA,et.UNSIGNED_BYTE,this.data))};var R=function W(et,K){this.workerPool=et,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var pt=this.workerPool.acquire(this.id),Ct=0;Ct<pt.length;Ct++){var Yt=pt[Ct],ce=new W.Actor(Yt,K,this.id);ce.name="Worker "+Ct,this.actors.push(ce)}};R.prototype.broadcast=function(W,et,K){K=K||function(){},t.asyncAll(this.actors,function(pt,Ct){pt.send(W,et,Ct)},K)},R.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},R.prototype.remove=function(){this.actors.forEach(function(W){W.remove()}),this.actors=[],this.workerPool.release(this.id)},R.Actor=t.Actor;function L(W,et,K){var pt=function(Ct,Yt){if(Ct)return K(Ct);if(Yt){var ce=t.pick(t.extend(Yt,W),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);Yt.vector_layers&&(ce.vectorLayers=Yt.vector_layers,ce.vectorLayerIds=ce.vectorLayers.map(function(re){return re.id})),ce.tiles=et.canonicalizeTileset(ce,W.url),K(null,ce)}};return W.url?t.getJSON(et.transformRequest(et.normalizeSourceURL(W.url),t.ResourceType.Source),pt):t.browser.frame(function(){return pt(null,W)})}var F=function(W,et,K){this.bounds=t.LngLatBounds.convert(this.validateBounds(W)),this.minzoom=et||0,this.maxzoom=K||24};F.prototype.validateBounds=function(W){return!Array.isArray(W)||W.length!==4?[-180,-90,180,90]:[Math.max(-180,W[0]),Math.max(-90,W[1]),Math.min(180,W[2]),Math.min(90,W[3])]},F.prototype.contains=function(W){var et=Math.pow(2,W.z),K={minX:Math.floor(t.mercatorXfromLng(this.bounds.getWest())*et),minY:Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*et),maxX:Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*et),maxY:Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*et)},pt=W.x>=K.minX&&W.x<K.maxX&&W.y>=K.minY&&W.y<K.maxY;return pt};var N=function(W){function et(K,pt,Ct,Yt){if(W.call(this),this.id=K,this.dispatcher=Ct,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(pt,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},pt),this._collectResourceTiming=pt.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(Yt)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.load=function(){var K=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=L(this._options,this.map._requestManager,function(pt,Ct){K._tileJSONRequest=null,K._loaded=!0,pt?K.fire(new t.ErrorEvent(pt)):Ct&&(t.extend(K,Ct),Ct.bounds&&(K.tileBounds=new F(Ct.bounds,K.minzoom,K.maxzoom)),t.postTurnstileEvent(Ct.tiles,K.map._requestManager._customAccessToken),t.postMapLoadEvent(Ct.tiles,K.map._getMapId(),K.map._requestManager._skuToken,K.map._requestManager._customAccessToken),K.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),K.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})},et.prototype.loaded=function(){return this._loaded},et.prototype.hasTile=function(K){return!this.tileBounds||this.tileBounds.contains(K.canonical)},et.prototype.onAdd=function(K){this.map=K,this.load()},et.prototype.setSourceProperty=function(K){this._tileJSONRequest&&this._tileJSONRequest.cancel(),K();var pt=this.map.style.sourceCaches[this.id];pt.clearTiles(),this.load()},et.prototype.setTiles=function(K){var pt=this;return this.setSourceProperty(function(){pt._options.tiles=K}),this},et.prototype.setUrl=function(K){var pt=this;return this.setSourceProperty(function(){pt.url=K,pt._options.url=K}),this},et.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},et.prototype.serialize=function(){return t.extend({},this._options)},et.prototype.loadTile=function(K,pt){var Ct=this.map._requestManager.normalizeTileURL(K.tileID.canonical.url(this.tiles,this.scheme)),Yt={request:this.map._requestManager.transformRequest(Ct,t.ResourceType.Tile),uid:K.uid,tileID:K.tileID,zoom:K.tileID.overscaledZ,tileSize:this.tileSize*K.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Yt.request.collectResourceTiming=this._collectResourceTiming,!K.actor||K.state==="expired"?(K.actor=this.dispatcher.getActor(),K.request=K.actor.send("loadTile",Yt,ce.bind(this))):K.state==="loading"?K.reloadCallback=pt:K.request=K.actor.send("reloadTile",Yt,ce.bind(this));function ce(re,ye){if(delete K.request,K.aborted)return pt(null);if(re&&re.status!==404)return pt(re);ye&&ye.resourceTiming&&(K.resourceTiming=ye.resourceTiming),this.map._refreshExpiredTiles&&ye&&K.setExpiryData(ye),K.loadVectorData(ye,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),pt(null),K.reloadCallback&&(this.loadTile(K,K.reloadCallback),K.reloadCallback=null)}},et.prototype.abortTile=function(K){K.request&&(K.request.cancel(),delete K.request),K.actor&&K.actor.send("abortTile",{uid:K.uid,type:this.type,source:this.id},void 0)},et.prototype.unloadTile=function(K){K.unloadVectorData(),K.actor&&K.actor.send("removeTile",{uid:K.uid,type:this.type,source:this.id},void 0)},et.prototype.hasTransition=function(){return!1},et}(t.Evented),j=function(W){function et(K,pt,Ct,Yt){W.call(this),this.id=K,this.dispatcher=Ct,this.setEventedParent(Yt),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},pt),t.extend(this,t.pick(pt,["url","scheme","tileSize"]))}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.load=function(){var K=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=L(this._options,this.map._requestManager,function(pt,Ct){K._tileJSONRequest=null,K._loaded=!0,pt?K.fire(new t.ErrorEvent(pt)):Ct&&(t.extend(K,Ct),Ct.bounds&&(K.tileBounds=new F(Ct.bounds,K.minzoom,K.maxzoom)),t.postTurnstileEvent(Ct.tiles),t.postMapLoadEvent(Ct.tiles,K.map._getMapId(),K.map._requestManager._skuToken),K.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),K.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})},et.prototype.loaded=function(){return this._loaded},et.prototype.onAdd=function(K){this.map=K,this.load()},et.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},et.prototype.serialize=function(){return t.extend({},this._options)},et.prototype.hasTile=function(K){return!this.tileBounds||this.tileBounds.contains(K.canonical)},et.prototype.loadTile=function(K,pt){var Ct=this,Yt=this.map._requestManager.normalizeTileURL(K.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);K.request=t.getImage(this.map._requestManager.transformRequest(Yt,t.ResourceType.Tile),function(ce,re){if(delete K.request,K.aborted)K.state="unloaded",pt(null);else if(ce)K.state="errored",pt(ce);else if(re){Ct.map._refreshExpiredTiles&&K.setExpiryData(re),delete re.cacheControl,delete re.expires;var ye=Ct.map.painter.context,Le=ye.gl;K.texture=Ct.map.painter.getTileTexture(re.width),K.texture?K.texture.update(re,{useMipmap:!0}):(K.texture=new t.Texture(ye,re,Le.RGBA,{useMipmap:!0}),K.texture.bind(Le.LINEAR,Le.CLAMP_TO_EDGE,Le.LINEAR_MIPMAP_NEAREST),ye.extTextureFilterAnisotropic&&Le.texParameterf(Le.TEXTURE_2D,ye.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,ye.extTextureFilterAnisotropicMax)),K.state="loaded",t.cacheEntryPossiblyAdded(Ct.dispatcher),pt(null)}})},et.prototype.abortTile=function(K,pt){K.request&&(K.request.cancel(),delete K.request),pt()},et.prototype.unloadTile=function(K,pt){K.texture&&this.map.painter.saveTileTexture(K.texture),pt()},et.prototype.hasTransition=function(){return!1},et}(t.Evented),G=function(W){function et(K,pt,Ct,Yt){W.call(this,K,pt,Ct,Yt),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},pt),this.encoding=pt.encoding||"mapbox"}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},et.prototype.loadTile=function(K,pt){var Ct=this.map._requestManager.normalizeTileURL(K.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);K.request=t.getImage(this.map._requestManager.transformRequest(Ct,t.ResourceType.Tile),Yt.bind(this)),K.neighboringTiles=this._getNeighboringTiles(K.tileID);function Yt(re,ye){if(delete K.request,K.aborted)K.state="unloaded",pt(null);else if(re)K.state="errored",pt(re);else if(ye){this.map._refreshExpiredTiles&&K.setExpiryData(ye),delete ye.cacheControl,delete ye.expires;var Le=t.window.ImageBitmap&&ye instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported(),tr=Le?ye:t.browser.getImageData(ye,1),$e={uid:K.uid,coord:K.tileID,source:this.id,rawImageData:tr,encoding:this.encoding};(!K.actor||K.state==="expired")&&(K.actor=this.dispatcher.getActor(),K.actor.send("loadDEMTile",$e,ce.bind(this)))}}function ce(re,ye){re&&(K.state="errored",pt(re)),ye&&(K.dem=ye,K.needsHillshadePrepare=!0,K.state="loaded",pt(null))}},et.prototype._getNeighboringTiles=function(K){var pt=K.canonical,Ct=Math.pow(2,pt.z),Yt=(pt.x-1+Ct)%Ct,ce=pt.x===0?K.wrap-1:K.wrap,re=(pt.x+1+Ct)%Ct,ye=pt.x+1===Ct?K.wrap+1:K.wrap,Le={};return Le[new t.OverscaledTileID(K.overscaledZ,ce,pt.z,Yt,pt.y).key]={backfilled:!1},Le[new t.OverscaledTileID(K.overscaledZ,ye,pt.z,re,pt.y).key]={backfilled:!1},pt.y>0&&(Le[new t.OverscaledTileID(K.overscaledZ,ce,pt.z,Yt,pt.y-1).key]={backfilled:!1},Le[new t.OverscaledTileID(K.overscaledZ,K.wrap,pt.z,pt.x,pt.y-1).key]={backfilled:!1},Le[new t.OverscaledTileID(K.overscaledZ,ye,pt.z,re,pt.y-1).key]={backfilled:!1}),pt.y+1<Ct&&(Le[new t.OverscaledTileID(K.overscaledZ,ce,pt.z,Yt,pt.y+1).key]={backfilled:!1},Le[new t.OverscaledTileID(K.overscaledZ,K.wrap,pt.z,pt.x,pt.y+1).key]={backfilled:!1},Le[new t.OverscaledTileID(K.overscaledZ,ye,pt.z,re,pt.y+1).key]={backfilled:!1}),Le},et.prototype.unloadTile=function(K){K.demTexture&&this.map.painter.saveTileTexture(K.demTexture),K.fbo&&(K.fbo.destroy(),delete K.fbo),K.dem&&delete K.dem,delete K.neighboringTiles,K.state="unloaded",K.actor&&K.actor.send("removeDEMTile",{uid:K.uid,source:this.id})},et}(j),rt=function(W){function et(K,pt,Ct,Yt){W.call(this),this.id=K,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=Ct.getActor(),this.setEventedParent(Yt),this._data=pt.data,this._options=t.extend({},pt),this._collectResourceTiming=pt.collectResourceTiming,this._resourceTiming=[],pt.maxzoom!==void 0&&(this.maxzoom=pt.maxzoom),pt.type&&(this.type=pt.type),pt.attribution&&(this.attribution=pt.attribution),this.promoteId=pt.promoteId;var ce=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:pt.cluster||!1,geojsonVtOptions:{buffer:(pt.buffer!==void 0?pt.buffer:128)*ce,tolerance:(pt.tolerance!==void 0?pt.tolerance:.375)*ce,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:pt.lineMetrics||!1,generateId:pt.generateId||!1},superclusterOptions:{maxZoom:pt.clusterMaxZoom!==void 0?Math.min(pt.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,pt.clusterMinPoints||2),extent:t.EXTENT,radius:(pt.clusterRadius||50)*ce,log:!1,generateId:pt.generateId||!1},clusterProperties:pt.clusterProperties,filter:pt.filter},pt.workerOptions)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.load=function(){var K=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(pt){if(pt){K.fire(new t.ErrorEvent(pt));return}var Ct={dataType:"source",sourceDataType:"metadata"};K._collectResourceTiming&&K._resourceTiming&&K._resourceTiming.length>0&&(Ct.resourceTiming=K._resourceTiming,K._resourceTiming=[]),K.fire(new t.Event("data",Ct))})},et.prototype.onAdd=function(K){this.map=K,this.load()},et.prototype.setData=function(K){var pt=this;return this._data=K,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(Ct){if(Ct){pt.fire(new t.ErrorEvent(Ct));return}var Yt={dataType:"source",sourceDataType:"content"};pt._collectResourceTiming&&pt._resourceTiming&&pt._resourceTiming.length>0&&(Yt.resourceTiming=pt._resourceTiming,pt._resourceTiming=[]),pt.fire(new t.Event("data",Yt))}),this},et.prototype.getClusterExpansionZoom=function(K,pt){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:K,source:this.id},pt),this},et.prototype.getClusterChildren=function(K,pt){return this.actor.send("geojson.getClusterChildren",{clusterId:K,source:this.id},pt),this},et.prototype.getClusterLeaves=function(K,pt,Ct,Yt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:K,limit:pt,offset:Ct},Yt),this},et.prototype._updateWorkerData=function(K){var pt=this;this._loaded=!1;var Ct=t.extend({},this.workerOptions),Yt=this._data;typeof Yt=="string"?(Ct.request=this.map._requestManager.transformRequest(t.browser.resolveURL(Yt),t.ResourceType.Source),Ct.request.collectResourceTiming=this._collectResourceTiming):Ct.data=JSON.stringify(Yt),this.actor.send(this.type+".loadData",Ct,function(ce,re){pt._removed||re&&re.abandoned||(pt._loaded=!0,re&&re.resourceTiming&&re.resourceTiming[pt.id]&&(pt._resourceTiming=re.resourceTiming[pt.id].slice(0)),pt.actor.send(pt.type+".coalesce",{source:Ct.source},null),K(ce))})},et.prototype.loaded=function(){return this._loaded},et.prototype.loadTile=function(K,pt){var Ct=this,Yt=K.actor?"reloadTile":"loadTile";K.actor=this.actor;var ce={type:this.type,uid:K.uid,tileID:K.tileID,zoom:K.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};K.request=this.actor.send(Yt,ce,function(re,ye){return delete K.request,K.unloadVectorData(),K.aborted?pt(null):re?pt(re):(K.loadVectorData(ye,Ct.map.painter,Yt==="reloadTile"),pt(null))})},et.prototype.abortTile=function(K){K.request&&(K.request.cancel(),delete K.request),K.aborted=!0},et.prototype.unloadTile=function(K){K.unloadVectorData(),this.actor.send("removeTile",{uid:K.uid,type:this.type,source:this.id})},et.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},et.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},et.prototype.hasTransition=function(){return!1},et}(t.Evented),ct=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),lt=function(W){function et(K,pt,Ct,Yt){W.call(this),this.id=K,this.dispatcher=Ct,this.coordinates=pt.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Yt),this.options=pt}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.load=function(K,pt){var Ct=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),function(Yt,ce){Ct._loaded=!0,Yt?Ct.fire(new t.ErrorEvent(Yt)):ce&&(Ct.image=ce,K&&(Ct.coordinates=K),pt&&pt(),Ct._finishLoading())})},et.prototype.loaded=function(){return this._loaded},et.prototype.updateImage=function(K){var pt=this;return!this.image||!K.url?this:(this.options.url=K.url,this.load(K.coordinates,function(){pt.texture=null}),this)},et.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},et.prototype.onAdd=function(K){this.map=K,this.load()},et.prototype.setCoordinates=function(K){var pt=this;this.coordinates=K;var Ct=K.map(t.MercatorCoordinate.fromLngLat);this.tileID=tt(Ct),this.minzoom=this.maxzoom=this.tileID.z;var Yt=Ct.map(function(ce){return pt.tileID.getTilePoint(ce)._round()});return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(Yt[0].x,Yt[0].y,0,0),this._boundsArray.emplaceBack(Yt[1].x,Yt[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(Yt[3].x,Yt[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(Yt[2].x,Yt[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},et.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var K=this.map.painter.context,pt=K.gl;this.boundsBuffer||(this.boundsBuffer=K.createVertexBuffer(this._boundsArray,ct.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(K,this.image,pt.RGBA),this.texture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE));for(var Ct in this.tiles){var Yt=this.tiles[Ct];Yt.state!=="loaded"&&(Yt.state="loaded",Yt.texture=this.texture)}}},et.prototype.loadTile=function(K,pt){this.tileID&&this.tileID.equals(K.tileID.canonical)?(this.tiles[String(K.tileID.wrap)]=K,K.buckets={},pt(null)):(K.state="errored",pt(null))},et.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},et.prototype.hasTransition=function(){return!1},et}(t.Evented);function tt(W){for(var et=1/0,K=1/0,pt=-1/0,Ct=-1/0,Yt=0,ce=W;Yt<ce.length;Yt+=1){var re=ce[Yt];et=Math.min(et,re.x),K=Math.min(K,re.y),pt=Math.max(pt,re.x),Ct=Math.max(Ct,re.y)}var ye=pt-et,Le=Ct-K,tr=Math.max(ye,Le),$e=Math.max(0,Math.floor(-Math.log(tr)/Math.LN2)),er=Math.pow(2,$e);return new t.CanonicalTileID($e,Math.floor((et+pt)/2*er),Math.floor((K+Ct)/2*er))}var Z=function(W){function et(K,pt,Ct,Yt){W.call(this,K,pt,Ct,Yt),this.roundZoom=!0,this.type="video",this.options=pt}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.load=function(){var K=this;this._loaded=!1;var pt=this.options;this.urls=[];for(var Ct=0,Yt=pt.urls;Ct<Yt.length;Ct+=1){var ce=Yt[Ct];this.urls.push(this.map._requestManager.transformRequest(ce,t.ResourceType.Source).url)}t.getVideo(this.urls,function(re,ye){K._loaded=!0,re?K.fire(new t.ErrorEvent(re)):ye&&(K.video=ye,K.video.loop=!0,K.video.addEventListener("playing",function(){K.map.triggerRepaint()}),K.map&&K.video.play(),K._finishLoading())})},et.prototype.pause=function(){this.video&&this.video.pause()},et.prototype.play=function(){this.video&&this.video.play()},et.prototype.seek=function(K){if(this.video){var pt=this.video.seekable;K<pt.start(0)||K>pt.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+pt.start(0)+" and "+pt.end(0)+"-second mark."))):this.video.currentTime=K}},et.prototype.getVideo=function(){return this.video},et.prototype.onAdd=function(K){this.map||(this.map=K,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},et.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var K=this.map.painter.context,pt=K.gl;this.boundsBuffer||(this.boundsBuffer=K.createVertexBuffer(this._boundsArray,ct.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE),pt.texSubImage2D(pt.TEXTURE_2D,0,0,0,pt.RGBA,pt.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(K,this.video,pt.RGBA),this.texture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE));for(var Ct in this.tiles){var Yt=this.tiles[Ct];Yt.state!=="loaded"&&(Yt.state="loaded",Yt.texture=this.texture)}}},et.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},et.prototype.hasTransition=function(){return this.video&&!this.video.paused},et}(lt),st=function(W){function et(K,pt,Ct,Yt){W.call(this,K,pt,Ct,Yt),pt.coordinates?(!Array.isArray(pt.coordinates)||pt.coordinates.length!==4||pt.coordinates.some(function(ce){return!Array.isArray(ce)||ce.length!==2||ce.some(function(re){return typeof re!="number"})}))&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+K,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+K,null,'missing required property "coordinates"'))),pt.animate&&typeof pt.animate!="boolean"&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+K,null,'optional "animate" property must be a boolean value'))),pt.canvas?typeof pt.canvas!="string"&&!(pt.canvas instanceof t.window.HTMLCanvasElement)&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+K,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 t.ErrorEvent(new t.ValidationError("sources."+K,null,'missing required property "canvas"'))),this.options=pt,this.animate=pt.animate!==void 0?pt.animate:!0}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},et.prototype.getCanvas=function(){return this.canvas},et.prototype.onAdd=function(K){this.map=K,this.load(),this.canvas&&this.animate&&this.play()},et.prototype.onRemove=function(){this.pause()},et.prototype.prepare=function(){var K=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,K=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,K=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var pt=this.map.painter.context,Ct=pt.gl;this.boundsBuffer||(this.boundsBuffer=pt.createVertexBuffer(this._boundsArray,ct.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(K||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(pt,this.canvas,Ct.RGBA,{premultiply:!0});for(var Yt in this.tiles){var ce=this.tiles[Yt];ce.state!=="loaded"&&(ce.state="loaded",ce.texture=this.texture)}}},et.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},et.prototype.hasTransition=function(){return this._playing},et.prototype._hasInvalidDimensions=function(){for(var K=0,pt=[this.canvas.width,this.canvas.height];K<pt.length;K+=1){var Ct=pt[K];if(isNaN(Ct)||Ct<=0)return!0}return!1},et}(lt),$={vector:N,raster:j,"raster-dem":G,geojson:rt,video:Z,image:lt,canvas:st},Q=function(W,et,K,pt){var Ct=new $[et.type](W,et,K,pt);if(Ct.id!==W)throw new Error("Expected Source id to be "+W+" instead of "+Ct.id);return t.bindAll(["load","abort","unload","serialize","prepare"],Ct),Ct},nt=function(W){return $[W]},Y=function(W,et){$[W]=et};function q(W,et){var K=t.identity([]);return t.translate(K,K,[1,1,0]),t.scale(K,K,[W.width*.5,W.height*.5,1]),t.multiply(K,K,W.calculatePosMatrix(et.toUnwrapped()))}function ot(W,et,K){if(W)for(var pt=0,Ct=W;pt<Ct.length;pt+=1){var Yt=Ct[pt],ce=et[Yt];if(ce&&ce.source===K&&ce.type==="fill-extrusion")return!0}else for(var re in et){var ye=et[re];if(ye.source===K&&ye.type==="fill-extrusion")return!0}return!1}function it(W,et,K,pt,Ct,Yt){var ce=ot(Ct&&Ct.layers,et,W.id),re=Yt.maxPitchScaleFactor(),ye=W.tilesIn(pt,re,ce);ye.sort(xt);for(var Le=[],tr=0,$e=ye;tr<$e.length;tr+=1){var er=$e[tr];Le.push({wrappedTileID:er.tileID.wrapped().key,queryResults:er.tile.queryRenderedFeatures(et,K,W._state,er.queryGeometry,er.cameraQueryGeometry,er.scale,Ct,Yt,re,q(W.transform,er.tileID))})}var pr=Ft(Le);for(var wr in pr)pr[wr].forEach(function(rr){var cr=rr.feature,hr=W.getFeatureState(cr.layer["source-layer"],cr.id);cr.source=cr.layer.source,cr.layer["source-layer"]&&(cr.sourceLayer=cr.layer["source-layer"]),cr.state=hr});return pr}function dt(W,et,K,pt,Ct,Yt,ce){for(var re={},ye=Yt.queryRenderedSymbols(pt),Le=[],tr=0,$e=Object.keys(ye).map(Number);tr<$e.length;tr+=1){var er=$e[tr];Le.push(ce[er])}Le.sort(xt);for(var pr=function(){var Vr=rr[wr],yn=Vr.featureIndex.lookupSymbolFeatures(ye[Vr.bucketInstanceId],et,Vr.bucketIndex,Vr.sourceLayerIndex,Ct.filter,Ct.layers,Ct.availableImages,W);for(var wn in yn){var $n=re[wn]=re[wn]||[],Xn=yn[wn];Xn.sort(function(wa,da){var pa=Vr.featureSortOrder;if(pa){var Ua=pa.indexOf(wa.featureIndex),Di=pa.indexOf(da.featureIndex);return Di-Ua}else return da.featureIndex-wa.featureIndex});for(var Vn=0,ca=Xn;Vn<ca.length;Vn+=1){var ea=ca[Vn];$n.push(ea)}}},wr=0,rr=Le;wr<rr.length;wr+=1)pr();var cr=function(Vr){re[Vr].forEach(function(yn){var wn=yn.feature,$n=W[Vr],Xn=K[$n.source],Vn=Xn.getFeatureState(wn.layer["source-layer"],wn.id);wn.source=wn.layer.source,wn.layer["source-layer"]&&(wn.sourceLayer=wn.layer["source-layer"]),wn.state=Vn})};for(var hr in re)cr(hr);return re}function wt(W,et){for(var K=W.getRenderableIds().map(function(ye){return W.getTileByID(ye)}),pt=[],Ct={},Yt=0;Yt<K.length;Yt++){var ce=K[Yt],re=ce.tileID.canonical.key;Ct[re]||(Ct[re]=!0,ce.querySourceFeatures(pt,et))}return pt}function xt(W,et){var K=W.tileID,pt=et.tileID;return K.overscaledZ-pt.overscaledZ||K.canonical.y-pt.canonical.y||K.wrap-pt.wrap||K.canonical.x-pt.canonical.x}function Ft(W){for(var et={},K={},pt=0,Ct=W;pt<Ct.length;pt+=1){var Yt=Ct[pt],ce=Yt.queryResults,re=Yt.wrappedTileID,ye=K[re]=K[re]||{};for(var Le in ce)for(var tr=ce[Le],$e=ye[Le]=ye[Le]||{},er=et[Le]=et[Le]||[],pr=0,wr=tr;pr<wr.length;pr+=1){var rr=wr[pr];$e[rr.featureIndex]||($e[rr.featureIndex]=!0,er.push(rr))}}return et}var Et=function(W,et){this.max=W,this.onRemove=et,this.reset()};Et.prototype.reset=function(){for(var W in this.data)for(var et=0,K=this.data[W];et<K.length;et+=1){var pt=K[et];pt.timeout&&clearTimeout(pt.timeout),this.onRemove(pt.value)}return this.data={},this.order=[],this},Et.prototype.add=function(W,et,K){var pt=this,Ct=W.wrapped().key;this.data[Ct]===void 0&&(this.data[Ct]=[]);var Yt={value:et,timeout:void 0};if(K!==void 0&&(Yt.timeout=setTimeout(function(){pt.remove(W,Yt)},K)),this.data[Ct].push(Yt),this.order.push(Ct),this.order.length>this.max){var ce=this._getAndRemoveByKey(this.order[0]);ce&&this.onRemove(ce)}return this},Et.prototype.has=function(W){return W.wrapped().key in this.data},Et.prototype.getAndRemove=function(W){return this.has(W)?this._getAndRemoveByKey(W.wrapped().key):null},Et.prototype._getAndRemoveByKey=function(W){var et=this.data[W].shift();return et.timeout&&clearTimeout(et.timeout),this.data[W].length===0&&delete this.data[W],this.order.splice(this.order.indexOf(W),1),et.value},Et.prototype.getByKey=function(W){var et=this.data[W];return et?et[0].value:null},Et.prototype.get=function(W){if(!this.has(W))return null;var et=this.data[W.wrapped().key][0];return et.value},Et.prototype.remove=function(W,et){if(!this.has(W))return this;var K=W.wrapped().key,pt=et===void 0?0:this.data[K].indexOf(et),Ct=this.data[K][pt];return this.data[K].splice(pt,1),Ct.timeout&&clearTimeout(Ct.timeout),this.data[K].length===0&&delete this.data[K],this.onRemove(Ct.value),this.order.splice(this.order.indexOf(K),1),this},Et.prototype.setMaxSize=function(W){for(this.max=W;this.order.length>this.max;){var et=this._getAndRemoveByKey(this.order[0]);et&&this.onRemove(et)}return this},Et.prototype.filter=function(W){var et=[];for(var K in this.data)for(var pt=0,Ct=this.data[K];pt<Ct.length;pt+=1){var Yt=Ct[pt];W(Yt.value)||et.push(Yt)}for(var ce=0,re=et;ce<re.length;ce+=1){var ye=re[ce];this.remove(ye.value.tileID,ye)}};var Nt=function(W,et,K){this.context=W;var pt=W.gl;this.buffer=pt.createBuffer(),this.dynamicDraw=!!K,this.context.unbindVAO(),W.bindElementBuffer.set(this.buffer),pt.bufferData(pt.ELEMENT_ARRAY_BUFFER,et.arrayBuffer,this.dynamicDraw?pt.DYNAMIC_DRAW:pt.STATIC_DRAW),this.dynamicDraw||delete et.arrayBuffer};Nt.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Nt.prototype.updateData=function(W){var et=this.context.gl;this.context.unbindVAO(),this.bind(),et.bufferSubData(et.ELEMENT_ARRAY_BUFFER,0,W.arrayBuffer)},Nt.prototype.destroy=function(){var W=this.context.gl;this.buffer&&(W.deleteBuffer(this.buffer),delete this.buffer)};var te={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Jt=function(W,et,K,pt){this.length=et.length,this.attributes=K,this.itemSize=et.bytesPerElement,this.dynamicDraw=pt,this.context=W;var Ct=W.gl;this.buffer=Ct.createBuffer(),W.bindVertexBuffer.set(this.buffer),Ct.bufferData(Ct.ARRAY_BUFFER,et.arrayBuffer,this.dynamicDraw?Ct.DYNAMIC_DRAW:Ct.STATIC_DRAW),this.dynamicDraw||delete et.arrayBuffer};Jt.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Jt.prototype.updateData=function(W){var et=this.context.gl;this.bind(),et.bufferSubData(et.ARRAY_BUFFER,0,W.arrayBuffer)},Jt.prototype.enableAttributes=function(W,et){for(var K=0;K<this.attributes.length;K++){var pt=this.attributes[K],Ct=et.attributes[pt.name];Ct!==void 0&&W.enableVertexAttribArray(Ct)}},Jt.prototype.setVertexAttribPointers=function(W,et,K){for(var pt=0;pt<this.attributes.length;pt++){var Ct=this.attributes[pt],Yt=et.attributes[Ct.name];Yt!==void 0&&W.vertexAttribPointer(Yt,Ct.components,W[te[Ct.type]],!1,this.itemSize,Ct.offset+this.itemSize*(K||0))}},Jt.prototype.destroy=function(){var W=this.context.gl;this.buffer&&(W.deleteBuffer(this.buffer),delete this.buffer)};var Qt=function(W){this.gl=W.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};Qt.prototype.get=function(){return this.current},Qt.prototype.set=function(W){},Qt.prototype.getDefault=function(){return this.default},Qt.prototype.setDefault=function(){this.set(this.default)};var Wt=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return t.Color.transparent},et.prototype.set=function(K){var pt=this.current;K.r===pt.r&&K.g===pt.g&&K.b===pt.b&&K.a===pt.a&&!this.dirty||(this.gl.clearColor(K.r,K.g,K.b,K.a),this.current=K,this.dirty=!1)},et}(Qt),gt=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return 1},et.prototype.set=function(K){K===this.current&&!this.dirty||(this.gl.clearDepth(K),this.current=K,this.dirty=!1)},et}(Qt),bt=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return 0},et.prototype.set=function(K){K===this.current&&!this.dirty||(this.gl.clearStencil(K),this.current=K,this.dirty=!1)},et}(Qt),vt=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return[!0,!0,!0,!0]},et.prototype.set=function(K){var pt=this.current;K[0]===pt[0]&&K[1]===pt[1]&&K[2]===pt[2]&&K[3]===pt[3]&&!this.dirty||(this.gl.colorMask(K[0],K[1],K[2],K[3]),this.current=K,this.dirty=!1)},et}(Qt),Ut=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return!0},et.prototype.set=function(K){K===this.current&&!this.dirty||(this.gl.depthMask(K),this.current=K,this.dirty=!1)},et}(Qt),Kt=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return 255},et.prototype.set=function(K){K===this.current&&!this.dirty||(this.gl.stencilMask(K),this.current=K,this.dirty=!1)},et}(Qt),Zt=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},et.prototype.set=function(K){var pt=this.current;K.func===pt.func&&K.ref===pt.ref&&K.mask===pt.mask&&!this.dirty||(this.gl.stencilFunc(K.func,K.ref,K.mask),this.current=K,this.dirty=!1)},et}(Qt),le=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){var K=this.gl;return[K.KEEP,K.KEEP,K.KEEP]},et.prototype.set=function(K){var pt=this.current;K[0]===pt[0]&&K[1]===pt[1]&&K[2]===pt[2]&&!this.dirty||(this.gl.stencilOp(K[0],K[1],K[2]),this.current=K,this.dirty=!1)},et}(Qt),Te=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return!1},et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){var pt=this.gl;K?pt.enable(pt.STENCIL_TEST):pt.disable(pt.STENCIL_TEST),this.current=K,this.dirty=!1}},et}(Qt),Se=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return[0,1]},et.prototype.set=function(K){var pt=this.current;K[0]===pt[0]&&K[1]===pt[1]&&!this.dirty||(this.gl.depthRange(K[0],K[1]),this.current=K,this.dirty=!1)},et}(Qt),Fe=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return!1},et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){var pt=this.gl;K?pt.enable(pt.DEPTH_TEST):pt.disable(pt.DEPTH_TEST),this.current=K,this.dirty=!1}},et}(Qt),Oe=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return this.gl.LESS},et.prototype.set=function(K){K===this.current&&!this.dirty||(this.gl.depthFunc(K),this.current=K,this.dirty=!1)},et}(Qt),ur=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return!1},et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){var pt=this.gl;K?pt.enable(pt.BLEND):pt.disable(pt.BLEND),this.current=K,this.dirty=!1}},et}(Qt),fr=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){var K=this.gl;return[K.ONE,K.ZERO]},et.prototype.set=function(K){var pt=this.current;K[0]===pt[0]&&K[1]===pt[1]&&!this.dirty||(this.gl.blendFunc(K[0],K[1]),this.current=K,this.dirty=!1)},et}(Qt),We=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return t.Color.transparent},et.prototype.set=function(K){var pt=this.current;K.r===pt.r&&K.g===pt.g&&K.b===pt.b&&K.a===pt.a&&!this.dirty||(this.gl.blendColor(K.r,K.g,K.b,K.a),this.current=K,this.dirty=!1)},et}(Qt),Lr=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return this.gl.FUNC_ADD},et.prototype.set=function(K){K===this.current&&!this.dirty||(this.gl.blendEquation(K),this.current=K,this.dirty=!1)},et}(Qt),kr=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return!1},et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){var pt=this.gl;K?pt.enable(pt.CULL_FACE):pt.disable(pt.CULL_FACE),this.current=K,this.dirty=!1}},et}(Qt),he=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return this.gl.BACK},et.prototype.set=function(K){K===this.current&&!this.dirty||(this.gl.cullFace(K),this.current=K,this.dirty=!1)},et}(Qt),Dt=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return this.gl.CCW},et.prototype.set=function(K){K===this.current&&!this.dirty||(this.gl.frontFace(K),this.current=K,this.dirty=!1)},et}(Qt),qt=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return null},et.prototype.set=function(K){K===this.current&&!this.dirty||(this.gl.useProgram(K),this.current=K,this.dirty=!1)},et}(Qt),zt=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return this.gl.TEXTURE0},et.prototype.set=function(K){K===this.current&&!this.dirty||(this.gl.activeTexture(K),this.current=K,this.dirty=!1)},et}(Qt),ut=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){var K=this.gl;return[0,0,K.drawingBufferWidth,K.drawingBufferHeight]},et.prototype.set=function(K){var pt=this.current;K[0]===pt[0]&&K[1]===pt[1]&&K[2]===pt[2]&&K[3]===pt[3]&&!this.dirty||(this.gl.viewport(K[0],K[1],K[2],K[3]),this.current=K,this.dirty=!1)},et}(Qt),yt=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return null},et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){var pt=this.gl;pt.bindFramebuffer(pt.FRAMEBUFFER,K),this.current=K,this.dirty=!1}},et}(Qt),Mt=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return null},et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){var pt=this.gl;pt.bindRenderbuffer(pt.RENDERBUFFER,K),this.current=K,this.dirty=!1}},et}(Qt),Ot=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return null},et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){var pt=this.gl;pt.bindTexture(pt.TEXTURE_2D,K),this.current=K,this.dirty=!1}},et}(Qt),$t=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return null},et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){var pt=this.gl;pt.bindBuffer(pt.ARRAY_BUFFER,K),this.current=K,this.dirty=!1}},et}(Qt),ee=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return null},et.prototype.set=function(K){var pt=this.gl;pt.bindBuffer(pt.ELEMENT_ARRAY_BUFFER,K),this.current=K,this.dirty=!1},et}(Qt),we=function(W){function et(K){W.call(this,K),this.vao=K.extVertexArrayObject}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return null},et.prototype.set=function(K){!this.vao||K===this.current&&!this.dirty||(this.vao.bindVertexArrayOES(K),this.current=K,this.dirty=!1)},et}(Qt),Me=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return 4},et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){var pt=this.gl;pt.pixelStorei(pt.UNPACK_ALIGNMENT,K),this.current=K,this.dirty=!1}},et}(Qt),Re=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return!1},et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){var pt=this.gl;pt.pixelStorei(pt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K),this.current=K,this.dirty=!1}},et}(Qt),Be=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return!1},et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){var pt=this.gl;pt.pixelStorei(pt.UNPACK_FLIP_Y_WEBGL,K),this.current=K,this.dirty=!1}},et}(Qt),Ze=function(W){function et(K,pt){W.call(this,K),this.context=K,this.parent=pt}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getDefault=function(){return null},et}(Qt),Ue=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.setDirty=function(){this.dirty=!0},et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var pt=this.gl;pt.framebufferTexture2D(pt.FRAMEBUFFER,pt.COLOR_ATTACHMENT0,pt.TEXTURE_2D,K,0),this.current=K,this.dirty=!1}},et}(Ze),mr=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.set=function(K){if(!(K===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var pt=this.gl;pt.framebufferRenderbuffer(pt.FRAMEBUFFER,pt.DEPTH_ATTACHMENT,pt.RENDERBUFFER,K),this.current=K,this.dirty=!1}},et}(Ze),ln=function(W,et,K,pt){this.context=W,this.width=et,this.height=K;var Ct=W.gl,Yt=this.framebuffer=Ct.createFramebuffer();this.colorAttachment=new Ue(W,Yt),pt&&(this.depthAttachment=new mr(W,Yt))};ln.prototype.destroy=function(){var W=this.context.gl,et=this.colorAttachment.get();if(et&&W.deleteTexture(et),this.depthAttachment){var K=this.depthAttachment.get();K&&W.deleteRenderbuffer(K)}W.deleteFramebuffer(this.framebuffer)};var an=519,vn=function(W,et,K){this.func=W,this.mask=et,this.range=K};vn.ReadOnly=!1,vn.ReadWrite=!0,vn.disabled=new vn(an,vn.ReadOnly,[0,1]);var Sn=519,An=7680,pn=function(W,et,K,pt,Ct,Yt){this.test=W,this.ref=et,this.mask=K,this.fail=pt,this.depthFail=Ct,this.pass=Yt};pn.disabled=new pn({func:Sn,mask:0},0,0,An,An,An);var On=0,Nn=1,ke=771,ze=function(W,et,K){this.blendFunction=W,this.blendColor=et,this.mask=K};ze.Replace=[Nn,On],ze.disabled=new ze(ze.Replace,t.Color.transparent,[!1,!1,!1,!1]),ze.unblended=new ze(ze.Replace,t.Color.transparent,[!0,!0,!0,!0]),ze.alphaBlended=new ze([Nn,ke],t.Color.transparent,[!0,!0,!0,!0]);var je=1029,Ne=2305,_r=function(W,et,K){this.enable=W,this.mode=et,this.frontFace=K};_r.disabled=new _r(!1,je,Ne),_r.backCCW=new _r(!0,je,Ne);var Xr=function(W){this.gl=W,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Wt(this),this.clearDepth=new gt(this),this.clearStencil=new bt(this),this.colorMask=new vt(this),this.depthMask=new Ut(this),this.stencilMask=new Kt(this),this.stencilFunc=new Zt(this),this.stencilOp=new le(this),this.stencilTest=new Te(this),this.depthRange=new Se(this),this.depthTest=new Fe(this),this.depthFunc=new Oe(this),this.blend=new ur(this),this.blendFunc=new fr(this),this.blendColor=new We(this),this.blendEquation=new Lr(this),this.cullFace=new kr(this),this.cullFaceSide=new he(this),this.frontFace=new Dt(this),this.program=new qt(this),this.activeTexture=new zt(this),this.viewport=new ut(this),this.bindFramebuffer=new yt(this),this.bindRenderbuffer=new Mt(this),this.bindTexture=new Ot(this),this.bindVertexBuffer=new $t(this),this.bindElementBuffer=new ee(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new we(this),this.pixelStoreUnpack=new Me(this),this.pixelStoreUnpackPremultiplyAlpha=new Re(this),this.pixelStoreUnpackFlipY=new Be(this),this.extTextureFilterAnisotropic=W.getExtension("EXT_texture_filter_anisotropic")||W.getExtension("MOZ_EXT_texture_filter_anisotropic")||W.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=W.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=W.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(W.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=W.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=W.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=W.getParameter(W.MAX_TEXTURE_SIZE)};Xr.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Xr.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Xr.prototype.createIndexBuffer=function(W,et){return new Nt(this,W,et)},Xr.prototype.createVertexBuffer=function(W,et,K){return new Jt(this,W,et,K)},Xr.prototype.createRenderbuffer=function(W,et,K){var pt=this.gl,Ct=pt.createRenderbuffer();return this.bindRenderbuffer.set(Ct),pt.renderbufferStorage(pt.RENDERBUFFER,W,et,K),this.bindRenderbuffer.set(null),Ct},Xr.prototype.createFramebuffer=function(W,et,K){return new ln(this,W,et,K)},Xr.prototype.clear=function(W){var et=W.color,K=W.depth,pt=this.gl,Ct=0;et&&(Ct|=pt.COLOR_BUFFER_BIT,this.clearColor.set(et),this.colorMask.set([!0,!0,!0,!0])),typeof K<"u"&&(Ct|=pt.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(K),this.depthMask.set(!0)),pt.clear(Ct)},Xr.prototype.setCullFace=function(W){W.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(W.mode),this.frontFace.set(W.frontFace))},Xr.prototype.setDepthMode=function(W){W.func===this.gl.ALWAYS&&!W.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(W.func),this.depthMask.set(W.mask),this.depthRange.set(W.range))},Xr.prototype.setStencilMode=function(W){W.test.func===this.gl.ALWAYS&&!W.mask?this.stencilTest.set(!1):(this.stencilTest.set(!0),this.stencilMask.set(W.mask),this.stencilOp.set([W.fail,W.depthFail,W.pass]),this.stencilFunc.set({func:W.test.func,ref:W.ref,mask:W.test.mask}))},Xr.prototype.setColorMode=function(W){t.deepEqual(W.blendFunction,ze.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(W.blendFunction),this.blendColor.set(W.blendColor)),this.colorMask.set(W.mask)},Xr.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var rn=function(W){function et(K,pt,Ct){var Yt=this;W.call(this),this.id=K,this.dispatcher=Ct,this.on("data",function(ce){ce.dataType==="source"&&ce.sourceDataType==="metadata"&&(Yt._sourceLoaded=!0),Yt._sourceLoaded&&!Yt._paused&&ce.dataType==="source"&&ce.sourceDataType==="content"&&(Yt.reload(),Yt.transform&&Yt.update(Yt.transform))}),this.on("error",function(){Yt._sourceErrored=!0}),this._source=Q(K,pt,Ct,this),this._tiles={},this._cache=new Et(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.onAdd=function(K){this.map=K,this._maxTileCacheSize=K?K._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(K)},et.prototype.onRemove=function(K){this._source&&this._source.onRemove&&this._source.onRemove(K)},et.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var K in this._tiles){var pt=this._tiles[K];if(pt.state!=="loaded"&&pt.state!=="errored")return!1}return!0},et.prototype.getSource=function(){return this._source},et.prototype.pause=function(){this._paused=!0},et.prototype.resume=function(){if(this._paused){var K=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,K&&this.reload(),this.transform&&this.update(this.transform)}},et.prototype._loadTile=function(K,pt){return this._source.loadTile(K,pt)},et.prototype._unloadTile=function(K){if(this._source.unloadTile)return this._source.unloadTile(K,function(){})},et.prototype._abortTile=function(K){if(this._source.abortTile)return this._source.abortTile(K,function(){})},et.prototype.serialize=function(){return this._source.serialize()},et.prototype.prepare=function(K){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(var pt in this._tiles){var Ct=this._tiles[pt];Ct.upload(K),Ct.prepare(this.map.style.imageManager)}},et.prototype.getIds=function(){return t.values(this._tiles).map(function(K){return K.tileID}).sort(Br).map(function(K){return K.key})},et.prototype.getRenderableIds=function(K){var pt=this,Ct=[];for(var Yt in this._tiles)this._isIdRenderable(Yt,K)&&Ct.push(this._tiles[Yt]);return K?Ct.sort(function(ce,re){var ye=ce.tileID,Le=re.tileID,tr=new t.Point(ye.canonical.x,ye.canonical.y)._rotate(pt.transform.angle),$e=new t.Point(Le.canonical.x,Le.canonical.y)._rotate(pt.transform.angle);return ye.overscaledZ-Le.overscaledZ||$e.y-tr.y||$e.x-tr.x}).map(function(ce){return ce.tileID.key}):Ct.map(function(ce){return ce.tileID}).sort(Br).map(function(ce){return ce.key})},et.prototype.hasRenderableParent=function(K){var pt=this.findLoadedParent(K,0);return pt?this._isIdRenderable(pt.tileID.key):!1},et.prototype._isIdRenderable=function(K,pt){return this._tiles[K]&&this._tiles[K].hasData()&&!this._coveredTiles[K]&&(pt||!this._tiles[K].holdingForFade())},et.prototype.reload=function(){if(this._paused){this._shouldReloadOnResume=!0;return}this._cache.reset();for(var K in this._tiles)this._tiles[K].state!=="errored"&&this._reloadTile(K,"reloading")},et.prototype._reloadTile=function(K,pt){var Ct=this._tiles[K];Ct&&(Ct.state!=="loading"&&(Ct.state=pt),this._loadTile(Ct,this._tileLoaded.bind(this,Ct,K,pt)))},et.prototype._tileLoaded=function(K,pt,Ct,Yt){if(Yt){K.state="errored",Yt.status!==404?this._source.fire(new t.ErrorEvent(Yt,{tile:K})):this.update(this.transform);return}K.timeAdded=t.browser.now(),Ct==="expired"&&(K.refreshedUponExpiration=!0),this._setTileReloadTimer(pt,K),this.getSource().type==="raster-dem"&&K.dem&&this._backfillDEM(K),this._state.initializeTileState(K,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:K,coord:K.tileID}))},et.prototype._backfillDEM=function(K){for(var pt=this.getRenderableIds(),Ct=0;Ct<pt.length;Ct++){var Yt=pt[Ct];if(K.neighboringTiles&&K.neighboringTiles[Yt]){var ce=this.getTileByID(Yt);re(K,ce),re(ce,K)}}function re(ye,Le){ye.needsHillshadePrepare=!0;var tr=Le.tileID.canonical.x-ye.tileID.canonical.x,$e=Le.tileID.canonical.y-ye.tileID.canonical.y,er=Math.pow(2,ye.tileID.canonical.z),pr=Le.tileID.key;tr===0&&$e===0||Math.abs($e)>1||(Math.abs(tr)>1&&(Math.abs(tr+er)===1?tr+=er:Math.abs(tr-er)===1&&(tr-=er)),!(!Le.dem||!ye.dem)&&(ye.dem.backfillBorder(Le.dem,tr,$e),ye.neighboringTiles&&ye.neighboringTiles[pr]&&(ye.neighboringTiles[pr].backfilled=!0)))}},et.prototype.getTile=function(K){return this.getTileByID(K.key)},et.prototype.getTileByID=function(K){return this._tiles[K]},et.prototype._retainLoadedChildren=function(K,pt,Ct,Yt){for(var ce in this._tiles){var re=this._tiles[ce];if(!(Yt[ce]||!re.hasData()||re.tileID.overscaledZ<=pt||re.tileID.overscaledZ>Ct)){for(var ye=re.tileID;re&&re.tileID.overscaledZ>pt+1;){var Le=re.tileID.scaledTo(re.tileID.overscaledZ-1);re=this._tiles[Le.key],re&&re.hasData()&&(ye=Le)}for(var tr=ye;tr.overscaledZ>pt;)if(tr=tr.scaledTo(tr.overscaledZ-1),K[tr.key]){Yt[ye.key]=ye;break}}}},et.prototype.findLoadedParent=function(K,pt){if(K.key in this._loadedParentTiles){var Ct=this._loadedParentTiles[K.key];return Ct&&Ct.tileID.overscaledZ>=pt?Ct:null}for(var Yt=K.overscaledZ-1;Yt>=pt;Yt--){var ce=K.scaledTo(Yt),re=this._getLoadedTile(ce);if(re)return re}},et.prototype._getLoadedTile=function(K){var pt=this._tiles[K.key];if(pt&&pt.hasData())return pt;var Ct=this._cache.getByKey(K.wrapped().key);return Ct},et.prototype.updateCacheSize=function(K){var pt=Math.ceil(K.width/this._source.tileSize)+1,Ct=Math.ceil(K.height/this._source.tileSize)+1,Yt=pt*Ct,ce=5,re=Math.floor(Yt*ce),ye=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,re):re;this._cache.setMaxSize(ye)},et.prototype.handleWrapJump=function(K){var pt=this._prevLng===void 0?K:this._prevLng,Ct=K-pt,Yt=Ct/360,ce=Math.round(Yt);if(this._prevLng=K,ce){var re={};for(var ye in this._tiles){var Le=this._tiles[ye];Le.tileID=Le.tileID.unwrapTo(Le.tileID.wrap+ce),re[Le.tileID.key]=Le}this._tiles=re;for(var tr in this._timers)clearTimeout(this._timers[tr]),delete this._timers[tr];for(var $e in this._tiles){var er=this._tiles[$e];this._setTileReloadTimer($e,er)}}},et.prototype.update=function(K){var pt=this;if(this.transform=K,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(K),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var Ct;this.used?this._source.tileID?Ct=K.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(ea){return new t.OverscaledTileID(ea.canonical.z,ea.wrap,ea.canonical.z,ea.canonical.x,ea.canonical.y)}):(Ct=K.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(Ct=Ct.filter(function(ea){return pt._source.hasTile(ea)}))):Ct=[];var Yt=K.coveringZoomLevel(this._source),ce=Math.max(Yt-et.maxOverzooming,this._source.minzoom),re=Math.max(Yt+et.maxUnderzooming,this._source.minzoom),ye=this._updateRetainedTiles(Ct,Yt);if(_n(this._source.type)){for(var Le={},tr={},$e=Object.keys(ye),er=0,pr=$e;er<pr.length;er+=1){var wr=pr[er],rr=ye[wr],cr=this._tiles[wr];if(!(!cr||cr.fadeEndTime&&cr.fadeEndTime<=t.browser.now())){var hr=this.findLoadedParent(rr,ce);hr&&(this._addTile(hr.tileID),Le[hr.tileID.key]=hr.tileID),tr[wr]=rr}}this._retainLoadedChildren(tr,Yt,re,ye);for(var Vr in Le)ye[Vr]||(this._coveredTiles[Vr]=!0,ye[Vr]=Le[Vr])}for(var yn in ye)this._tiles[yn].clearFadeHold();for(var wn=t.keysDifference(this._tiles,ye),$n=0,Xn=wn;$n<Xn.length;$n+=1){var Vn=Xn[$n],ca=this._tiles[Vn];ca.hasSymbolBuckets&&!ca.holdingForFade()?ca.setHoldDuration(this.map._fadeDuration):(!ca.hasSymbolBuckets||ca.symbolFadeFinished())&&this._removeTile(Vn)}this._updateLoadedParentTileCache()}},et.prototype.releaseSymbolFadeTiles=function(){for(var K in this._tiles)this._tiles[K].holdingForFade()&&this._removeTile(K)},et.prototype._updateRetainedTiles=function(K,pt){for(var Ct={},Yt={},ce=Math.max(pt-et.maxOverzooming,this._source.minzoom),re=Math.max(pt+et.maxUnderzooming,this._source.minzoom),ye={},Le=0,tr=K;Le<tr.length;Le+=1){var $e=tr[Le],er=this._addTile($e);Ct[$e.key]=$e,!er.hasData()&&pt<this._source.maxzoom&&(ye[$e.key]=$e)}this._retainLoadedChildren(ye,pt,re,Ct);for(var pr=0,wr=K;pr<wr.length;pr+=1){var rr=wr[pr],cr=this._tiles[rr.key];if(!cr.hasData()){if(pt+1>this._source.maxzoom){var hr=rr.children(this._source.maxzoom)[0],Vr=this.getTile(hr);if(Vr&&Vr.hasData()){Ct[hr.key]=hr;continue}}else{var yn=rr.children(this._source.maxzoom);if(Ct[yn[0].key]&&Ct[yn[1].key]&&Ct[yn[2].key]&&Ct[yn[3].key])continue}for(var wn=cr.wasRequested(),$n=rr.overscaledZ-1;$n>=ce;--$n){var Xn=rr.scaledTo($n);if(Yt[Xn.key]||(Yt[Xn.key]=!0,cr=this.getTile(Xn),!cr&&wn&&(cr=this._addTile(Xn)),cr&&(Ct[Xn.key]=Xn,wn=cr.wasRequested(),cr.hasData())))break}}}return Ct},et.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var K in this._tiles){for(var pt=[],Ct=void 0,Yt=this._tiles[K].tileID;Yt.overscaledZ>0;){if(Yt.key in this._loadedParentTiles){Ct=this._loadedParentTiles[Yt.key];break}pt.push(Yt.key);var ce=Yt.scaledTo(Yt.overscaledZ-1);if(Ct=this._getLoadedTile(ce),Ct)break;Yt=ce}for(var re=0,ye=pt;re<ye.length;re+=1){var Le=ye[re];this._loadedParentTiles[Le]=Ct}}},et.prototype._addTile=function(K){var pt=this._tiles[K.key];if(pt)return pt;pt=this._cache.getAndRemove(K),pt&&(this._setTileReloadTimer(K.key,pt),pt.tileID=K,this._state.initializeTileState(pt,this.map?this.map.painter:null),this._cacheTimers[K.key]&&(clearTimeout(this._cacheTimers[K.key]),delete this._cacheTimers[K.key],this._setTileReloadTimer(K.key,pt)));var Ct=!!pt;return Ct||(pt=new t.Tile(K,this._source.tileSize*K.overscaleFactor()),this._loadTile(pt,this._tileLoaded.bind(this,pt,K.key,pt.state))),pt?(pt.uses++,this._tiles[K.key]=pt,Ct||this._source.fire(new t.Event("dataloading",{tile:pt,coord:pt.tileID,dataType:"source"})),pt):null},et.prototype._setTileReloadTimer=function(K,pt){var Ct=this;K in this._timers&&(clearTimeout(this._timers[K]),delete this._timers[K]);var Yt=pt.getExpiryTimeout();Yt&&(this._timers[K]=setTimeout(function(){Ct._reloadTile(K,"expired"),delete Ct._timers[K]},Yt))},et.prototype._removeTile=function(K){var pt=this._tiles[K];pt&&(pt.uses--,delete this._tiles[K],this._timers[K]&&(clearTimeout(this._timers[K]),delete this._timers[K]),!(pt.uses>0)&&(pt.hasData()&&pt.state!=="reloading"?this._cache.add(pt.tileID,pt,pt.getExpiryTimeout()):(pt.aborted=!0,this._abortTile(pt),this._unloadTile(pt))))},et.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var K in this._tiles)this._removeTile(K);this._cache.reset()},et.prototype.tilesIn=function(K,pt,Ct){var Yt=this,ce=[],re=this.transform;if(!re)return ce;for(var ye=Ct?re.getCameraQueryGeometry(K):K,Le=K.map(function($n){return re.pointCoordinate($n)}),tr=ye.map(function($n){return re.pointCoordinate($n)}),$e=this.getIds(),er=1/0,pr=1/0,wr=-1/0,rr=-1/0,cr=0,hr=tr;cr<hr.length;cr+=1){var Vr=hr[cr];er=Math.min(er,Vr.x),pr=Math.min(pr,Vr.y),wr=Math.max(wr,Vr.x),rr=Math.max(rr,Vr.y)}for(var yn=function($n){var Xn=Yt._tiles[$e[$n]];if(!Xn.holdingForFade()){var Vn=Xn.tileID,ca=Math.pow(2,re.zoom-Xn.tileID.overscaledZ),ea=pt*Xn.queryPadding*t.EXTENT/Xn.tileSize/ca,wa=[Vn.getTilePoint(new t.MercatorCoordinate(er,pr)),Vn.getTilePoint(new t.MercatorCoordinate(wr,rr))];if(wa[0].x-ea<t.EXTENT&&wa[0].y-ea<t.EXTENT&&wa[1].x+ea>=0&&wa[1].y+ea>=0){var da=Le.map(function(Ua){return Vn.getTilePoint(Ua)}),pa=tr.map(function(Ua){return Vn.getTilePoint(Ua)});ce.push({tile:Xn,tileID:Vn,queryGeometry:da,cameraQueryGeometry:pa,scale:ca})}}},wn=0;wn<$e.length;wn++)yn(wn);return ce},et.prototype.getVisibleCoordinates=function(K){for(var pt=this,Ct=this.getRenderableIds(K).map(function(ye){return pt._tiles[ye].tileID}),Yt=0,ce=Ct;Yt<ce.length;Yt+=1){var re=ce[Yt];re.posMatrix=this.transform.calculatePosMatrix(re.toUnwrapped())}return Ct},et.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(_n(this._source.type))for(var K in this._tiles){var pt=this._tiles[K];if(pt.fadeEndTime!==void 0&&pt.fadeEndTime>=t.browser.now())return!0}return!1},et.prototype.setFeatureState=function(K,pt,Ct){K=K||"_geojsonTileLayer",this._state.updateState(K,pt,Ct)},et.prototype.removeFeatureState=function(K,pt,Ct){K=K||"_geojsonTileLayer",this._state.removeFeatureState(K,pt,Ct)},et.prototype.getFeatureState=function(K,pt){return K=K||"_geojsonTileLayer",this._state.getState(K,pt)},et.prototype.setDependencies=function(K,pt,Ct){var Yt=this._tiles[K];Yt&&Yt.setDependencies(pt,Ct)},et.prototype.reloadTilesForDependencies=function(K,pt){for(var Ct in this._tiles){var Yt=this._tiles[Ct];Yt.hasDependency(K,pt)&&this._reloadTile(Ct,"reloading")}this._cache.filter(function(ce){return!ce.hasDependency(K,pt)})},et}(t.Evented);rn.maxOverzooming=10,rn.maxUnderzooming=3;function Br(W,et){var K=Math.abs(W.wrap*2)-+(W.wrap<0),pt=Math.abs(et.wrap*2)-+(et.wrap<0);return W.overscaledZ-et.overscaledZ||pt-K||et.canonical.y-W.canonical.y||et.canonical.x-W.canonical.x}function _n(W){return W==="raster"||W==="image"||W==="video"}function bn(){return new t.window.Worker(zs.workerUrl)}var Fn="mapboxgl_preloaded_worker_pool",on=function(){this.active={}};on.prototype.acquire=function(W){if(!this.workers)for(this.workers=[];this.workers.length<on.workerCount;)this.workers.push(new bn);return this.active[W]=!0,this.workers.slice()},on.prototype.release=function(W){delete this.active[W],this.numActive()===0&&(this.workers.forEach(function(et){et.terminate()}),this.workers=null)},on.prototype.isPreloaded=function(){return!!this.active[Fn]},on.prototype.numActive=function(){return Object.keys(this.active).length};var Bn=Math.floor(t.browser.hardwareConcurrency/2);on.workerCount=Math.max(Math.min(Bn,6),1);var ue;function xe(){return ue||(ue=new on),ue}function Pr(){var W=xe();W.acquire(Fn)}function Sr(){var W=ue;W&&(W.isPreloaded()&&W.numActive()===1?(W.release(Fn),ue=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()"))}function gr(W,et){var K={};for(var pt in W)pt!=="ref"&&(K[pt]=W[pt]);return t.refProperties.forEach(function(Ct){Ct in et&&(K[Ct]=et[Ct])}),K}function dr(W){W=W.slice();for(var et=Object.create(null),K=0;K<W.length;K++)et[W[K].id]=W[K];for(var pt=0;pt<W.length;pt++)"ref"in W[pt]&&(W[pt]=gr(W[pt],et[W[pt].ref]));return W}function Er(){var W={},et=t.styleSpec.$version;for(var K in t.styleSpec.$root){var pt=t.styleSpec.$root[K];if(pt.required){var Ct=null;K==="version"?Ct=et:pt.type==="array"?Ct=[]:Ct={},Ct!=null&&(W[K]=Ct)}}return W}var Dr={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Ar(W,et,K){K.push({command:Dr.addSource,args:[W,et[W]]})}function Gr(W,et,K){et.push({command:Dr.removeSource,args:[W]}),K[W]=!0}function Wr(W,et,K,pt){Gr(W,K,pt),Ar(W,et,K)}function Jr(W,et,K){var pt;for(pt in W[K])if(W[K].hasOwnProperty(pt)&&pt!=="data"&&!t.deepEqual(W[K][pt],et[K][pt]))return!1;for(pt in et[K])if(et[K].hasOwnProperty(pt)&&pt!=="data"&&!t.deepEqual(W[K][pt],et[K][pt]))return!1;return!0}function _e(W,et,K,pt){W=W||{},et=et||{};var Ct;for(Ct in W)W.hasOwnProperty(Ct)&&(et.hasOwnProperty(Ct)||Gr(Ct,K,pt));for(Ct in et)et.hasOwnProperty(Ct)&&(W.hasOwnProperty(Ct)?t.deepEqual(W[Ct],et[Ct])||(W[Ct].type==="geojson"&&et[Ct].type==="geojson"&&Jr(W,et,Ct)?K.push({command:Dr.setGeoJSONSourceData,args:[Ct,et[Ct].data]}):Wr(Ct,et,K,pt)):Ar(Ct,et,K))}function Je(W,et,K,pt,Ct,Yt){W=W||{},et=et||{};var ce;for(ce in W)W.hasOwnProperty(ce)&&(t.deepEqual(W[ce],et[ce])||K.push({command:Yt,args:[pt,ce,et[ce],Ct]}));for(ce in et)!et.hasOwnProperty(ce)||W.hasOwnProperty(ce)||t.deepEqual(W[ce],et[ce])||K.push({command:Yt,args:[pt,ce,et[ce],Ct]})}function yr(W){return W.id}function Hr(W,et){return W[et.id]=et,W}function hn(W,et,K){W=W||[],et=et||[];var pt=W.map(yr),Ct=et.map(yr),Yt=W.reduce(Hr,{}),ce=et.reduce(Hr,{}),re=pt.slice(),ye=Object.create(null),Le,tr,$e,er,pr,wr,rr;for(Le=0,tr=0;Le<pt.length;Le++)$e=pt[Le],ce.hasOwnProperty($e)?tr++:(K.push({command:Dr.removeLayer,args:[$e]}),re.splice(re.indexOf($e,tr),1));for(Le=0,tr=0;Le<Ct.length;Le++)$e=Ct[Ct.length-1-Le],re[re.length-1-Le]!==$e&&(Yt.hasOwnProperty($e)?(K.push({command:Dr.removeLayer,args:[$e]}),re.splice(re.lastIndexOf($e,re.length-tr),1)):tr++,wr=re[re.length-Le],K.push({command:Dr.addLayer,args:[ce[$e],wr]}),re.splice(re.length-Le,0,$e),ye[$e]=!0);for(Le=0;Le<Ct.length;Le++)if($e=Ct[Le],er=Yt[$e],pr=ce[$e],!(ye[$e]||t.deepEqual(er,pr))){if(!t.deepEqual(er.source,pr.source)||!t.deepEqual(er["source-layer"],pr["source-layer"])||!t.deepEqual(er.type,pr.type)){K.push({command:Dr.removeLayer,args:[$e]}),wr=re[re.lastIndexOf($e)+1],K.push({command:Dr.addLayer,args:[pr,wr]});continue}Je(er.layout,pr.layout,K,$e,null,Dr.setLayoutProperty),Je(er.paint,pr.paint,K,$e,null,Dr.setPaintProperty),t.deepEqual(er.filter,pr.filter)||K.push({command:Dr.setFilter,args:[$e,pr.filter]}),(!t.deepEqual(er.minzoom,pr.minzoom)||!t.deepEqual(er.maxzoom,pr.maxzoom))&&K.push({command:Dr.setLayerZoomRange,args:[$e,pr.minzoom,pr.maxzoom]});for(rr in er)er.hasOwnProperty(rr)&&(rr==="layout"||rr==="paint"||rr==="filter"||rr==="metadata"||rr==="minzoom"||rr==="maxzoom"||(rr.indexOf("paint.")===0?Je(er[rr],pr[rr],K,$e,rr.slice(6),Dr.setPaintProperty):t.deepEqual(er[rr],pr[rr])||K.push({command:Dr.setLayerProperty,args:[$e,rr,pr[rr]]})));for(rr in pr)!pr.hasOwnProperty(rr)||er.hasOwnProperty(rr)||rr==="layout"||rr==="paint"||rr==="filter"||rr==="metadata"||rr==="minzoom"||rr==="maxzoom"||(rr.indexOf("paint.")===0?Je(er[rr],pr[rr],K,$e,rr.slice(6),Dr.setPaintProperty):t.deepEqual(er[rr],pr[rr])||K.push({command:Dr.setLayerProperty,args:[$e,rr,pr[rr]]}))}}function En(W,et){if(!W)return[{command:Dr.setStyle,args:[et]}];var K=[];try{if(!t.deepEqual(W.version,et.version))return[{command:Dr.setStyle,args:[et]}];t.deepEqual(W.center,et.center)||K.push({command:Dr.setCenter,args:[et.center]}),t.deepEqual(W.zoom,et.zoom)||K.push({command:Dr.setZoom,args:[et.zoom]}),t.deepEqual(W.bearing,et.bearing)||K.push({command:Dr.setBearing,args:[et.bearing]}),t.deepEqual(W.pitch,et.pitch)||K.push({command:Dr.setPitch,args:[et.pitch]}),t.deepEqual(W.sprite,et.sprite)||K.push({command:Dr.setSprite,args:[et.sprite]}),t.deepEqual(W.glyphs,et.glyphs)||K.push({command:Dr.setGlyphs,args:[et.glyphs]}),t.deepEqual(W.transition,et.transition)||K.push({command:Dr.setTransition,args:[et.transition]}),t.deepEqual(W.light,et.light)||K.push({command:Dr.setLight,args:[et.light]});var pt={},Ct=[];_e(W.sources,et.sources,Ct,pt);var Yt=[];W.layers&&W.layers.forEach(function(ce){pt[ce.source]?K.push({command:Dr.removeLayer,args:[ce.id]}):Yt.push(ce)}),K=K.concat(Ct),hn(Yt,et.layers,K)}catch(ce){console.warn("Unable to compute style diff:",ce),K=[{command:Dr.setStyle,args:[et]}]}return K}var dn=function(W,et){this.reset(W,et)};dn.prototype.reset=function(W,et){this.points=W||[],this._distances=[0];for(var K=1;K<this.points.length;K++)this._distances[K]=this._distances[K-1]+this.points[K].dist(this.points[K-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(et||0,this.length*.5),this.paddedLength=this.length-this.padding*2},dn.prototype.lerp=function(W){if(this.points.length===1)return this.points[0];W=t.clamp(W,0,1);for(var et=1,K=this._distances[et],pt=W*this.paddedLength+this.padding;K<pt&&et<this._distances.length;)K=this._distances[++et];var Ct=et-1,Yt=this._distances[Ct],ce=K-Yt,re=ce>0?(pt-Yt)/ce:0;return this.points[Ct].mult(1-re).add(this.points[et].mult(re))};var Kr=function(W,et,K){var pt=this.boxCells=[],Ct=this.circleCells=[];this.xCellCount=Math.ceil(W/K),this.yCellCount=Math.ceil(et/K);for(var Yt=0;Yt<this.xCellCount*this.yCellCount;Yt++)pt.push([]),Ct.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=W,this.height=et,this.xScale=this.xCellCount/W,this.yScale=this.yCellCount/et,this.boxUid=0,this.circleUid=0};Kr.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kr.prototype.insert=function(W,et,K,pt,Ct){this._forEachCell(et,K,pt,Ct,this._insertBoxCell,this.boxUid++),this.boxKeys.push(W),this.bboxes.push(et),this.bboxes.push(K),this.bboxes.push(pt),this.bboxes.push(Ct)},Kr.prototype.insertCircle=function(W,et,K,pt){this._forEachCell(et-pt,K-pt,et+pt,K+pt,this._insertCircleCell,this.circleUid++),this.circleKeys.push(W),this.circles.push(et),this.circles.push(K),this.circles.push(pt)},Kr.prototype._insertBoxCell=function(W,et,K,pt,Ct,Yt){this.boxCells[Ct].push(Yt)},Kr.prototype._insertCircleCell=function(W,et,K,pt,Ct,Yt){this.circleCells[Ct].push(Yt)},Kr.prototype._query=function(W,et,K,pt,Ct,Yt){if(K<0||W>this.width||pt<0||et>this.height)return Ct?!1:[];var ce=[];if(W<=0&&et<=0&&this.width<=K&&this.height<=pt){if(Ct)return!0;for(var re=0;re<this.boxKeys.length;re++)ce.push({key:this.boxKeys[re],x1:this.bboxes[re*4],y1:this.bboxes[re*4+1],x2:this.bboxes[re*4+2],y2:this.bboxes[re*4+3]});for(var ye=0;ye<this.circleKeys.length;ye++){var Le=this.circles[ye*3],tr=this.circles[ye*3+1],$e=this.circles[ye*3+2];ce.push({key:this.circleKeys[ye],x1:Le-$e,y1:tr-$e,x2:Le+$e,y2:tr+$e})}return Yt?ce.filter(Yt):ce}else{var er={hitTest:Ct,seenUids:{box:{},circle:{}}};return this._forEachCell(W,et,K,pt,this._queryCell,ce,er,Yt),Ct?ce.length>0:ce}},Kr.prototype._queryCircle=function(W,et,K,pt,Ct){var Yt=W-K,ce=W+K,re=et-K,ye=et+K;if(ce<0||Yt>this.width||ye<0||re>this.height)return pt?!1:[];var Le=[],tr={hitTest:pt,circle:{x:W,y:et,radius:K},seenUids:{box:{},circle:{}}};return this._forEachCell(Yt,re,ce,ye,this._queryCellCircle,Le,tr,Ct),pt?Le.length>0:Le},Kr.prototype.query=function(W,et,K,pt,Ct){return this._query(W,et,K,pt,!1,Ct)},Kr.prototype.hitTest=function(W,et,K,pt,Ct){return this._query(W,et,K,pt,!0,Ct)},Kr.prototype.hitTestCircle=function(W,et,K,pt){return this._queryCircle(W,et,K,!0,pt)},Kr.prototype._queryCell=function(W,et,K,pt,Ct,Yt,ce,re){var ye=ce.seenUids,Le=this.boxCells[Ct];if(Le!==null)for(var tr=this.bboxes,$e=0,er=Le;$e<er.length;$e+=1){var pr=er[$e];if(!ye.box[pr]){ye.box[pr]=!0;var wr=pr*4;if(W<=tr[wr+2]&&et<=tr[wr+3]&&K>=tr[wr+0]&&pt>=tr[wr+1]&&(!re||re(this.boxKeys[pr]))){if(ce.hitTest)return Yt.push(!0),!0;Yt.push({key:this.boxKeys[pr],x1:tr[wr],y1:tr[wr+1],x2:tr[wr+2],y2:tr[wr+3]})}}}var rr=this.circleCells[Ct];if(rr!==null)for(var cr=this.circles,hr=0,Vr=rr;hr<Vr.length;hr+=1){var yn=Vr[hr];if(!ye.circle[yn]){ye.circle[yn]=!0;var wn=yn*3;if(this._circleAndRectCollide(cr[wn],cr[wn+1],cr[wn+2],W,et,K,pt)&&(!re||re(this.circleKeys[yn]))){if(ce.hitTest)return Yt.push(!0),!0;var $n=cr[wn],Xn=cr[wn+1],Vn=cr[wn+2];Yt.push({key:this.circleKeys[yn],x1:$n-Vn,y1:Xn-Vn,x2:$n+Vn,y2:Xn+Vn})}}}},Kr.prototype._queryCellCircle=function(W,et,K,pt,Ct,Yt,ce,re){var ye=ce.circle,Le=ce.seenUids,tr=this.boxCells[Ct];if(tr!==null)for(var $e=this.bboxes,er=0,pr=tr;er<pr.length;er+=1){var wr=pr[er];if(!Le.box[wr]){Le.box[wr]=!0;var rr=wr*4;if(this._circleAndRectCollide(ye.x,ye.y,ye.radius,$e[rr+0],$e[rr+1],$e[rr+2],$e[rr+3])&&(!re||re(this.boxKeys[wr])))return Yt.push(!0),!0}}var cr=this.circleCells[Ct];if(cr!==null)for(var hr=this.circles,Vr=0,yn=cr;Vr<yn.length;Vr+=1){var wn=yn[Vr];if(!Le.circle[wn]){Le.circle[wn]=!0;var $n=wn*3;if(this._circlesCollide(hr[$n],hr[$n+1],hr[$n+2],ye.x,ye.y,ye.radius)&&(!re||re(this.circleKeys[wn])))return Yt.push(!0),!0}}},Kr.prototype._forEachCell=function(W,et,K,pt,Ct,Yt,ce,re){for(var ye=this._convertToXCellCoord(W),Le=this._convertToYCellCoord(et),tr=this._convertToXCellCoord(K),$e=this._convertToYCellCoord(pt),er=ye;er<=tr;er++)for(var pr=Le;pr<=$e;pr++){var wr=this.xCellCount*pr+er;if(Ct.call(this,W,et,K,pt,wr,Yt,ce,re))return}},Kr.prototype._convertToXCellCoord=function(W){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(W*this.xScale)))},Kr.prototype._convertToYCellCoord=function(W){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(W*this.yScale)))},Kr.prototype._circlesCollide=function(W,et,K,pt,Ct,Yt){var ce=pt-W,re=Ct-et,ye=K+Yt;return ye*ye>ce*ce+re*re},Kr.prototype._circleAndRectCollide=function(W,et,K,pt,Ct,Yt,ce){var re=(Yt-pt)/2,ye=Math.abs(W-(pt+re));if(ye>re+K)return!1;var Le=(ce-Ct)/2,tr=Math.abs(et-(Ct+Le));if(tr>Le+K)return!1;if(ye<=re||tr<=Le)return!0;var $e=ye-re,er=tr-Le;return $e*$e+er*er<=K*K};function Tn(W,et,K,pt,Ct){var Yt=t.create();return et?(t.scale(Yt,Yt,[1/Ct,1/Ct,1]),K||t.rotateZ(Yt,Yt,pt.angle)):t.multiply(Yt,pt.labelPlaneMatrix,W),Yt}function ta(W,et,K,pt,Ct){if(et){var Yt=t.clone(W);return t.scale(Yt,Yt,[Ct,Ct,1]),K||t.rotateZ(Yt,Yt,-pt.angle),Yt}else return pt.glCoordMatrix}function Qn(W,et){var K=[W.x,W.y,0,1];Bo(K,K,et);var pt=K[3];return{point:new t.Point(K[0]/pt,K[1]/pt),signedDistanceFromCamera:pt}}function Va(W,et){return .5+.5*(W/et)}function ja(W,et){var K=W[0]/W[3],pt=W[1]/W[3],Ct=K>=-et[0]&&K<=et[0]&&pt>=-et[1]&&pt<=et[1];return Ct}function ci(W,et,K,pt,Ct,Yt,ce,re){var ye=pt?W.textSizeData:W.iconSizeData,Le=t.evaluateSizeForZoom(ye,K.transform.zoom),tr=[256/K.width*2+1,256/K.height*2+1],$e=pt?W.text.dynamicLayoutVertexArray:W.icon.dynamicLayoutVertexArray;$e.clear();for(var er=W.lineVertexArray,pr=pt?W.text.placedSymbolArray:W.icon.placedSymbolArray,wr=K.transform.width/K.transform.height,rr=!1,cr=0;cr<pr.length;cr++){var hr=pr.get(cr);if(hr.hidden||hr.writingMode===t.WritingMode.vertical&&!rr){Co(hr.numGlyphs,$e);continue}rr=!1;var Vr=[hr.anchorX,hr.anchorY,0,1];if(t.transformMat4(Vr,Vr,et),!ja(Vr,tr)){Co(hr.numGlyphs,$e);continue}var yn=Vr[3],wn=Va(K.transform.cameraToCenterDistance,yn),$n=t.evaluateSizeForFeature(ye,Le,hr),Xn=ce?$n/wn:$n*wn,Vn=new t.Point(hr.anchorX,hr.anchorY),ca=Qn(Vn,Ct).point,ea={},wa=ri(hr,Xn,!1,re,et,Ct,Yt,W.glyphOffsetArray,er,$e,ca,Vn,ea,wr);rr=wa.useVertical,(wa.notEnoughRoom||rr||wa.needsFlipping&&ri(hr,Xn,!0,re,et,Ct,Yt,W.glyphOffsetArray,er,$e,ca,Vn,ea,wr).notEnoughRoom)&&Co(hr.numGlyphs,$e)}pt?W.text.dynamicLayoutVertexBuffer.updateData($e):W.icon.dynamicLayoutVertexBuffer.updateData($e)}function pi(W,et,K,pt,Ct,Yt,ce,re,ye,Le,tr){var $e=re.glyphStartIndex+re.numGlyphs,er=re.lineStartIndex,pr=re.lineStartIndex+re.lineLength,wr=et.getoffsetX(re.glyphStartIndex),rr=et.getoffsetX($e-1),cr=Ui(W*wr,K,pt,Ct,Yt,ce,re.segment,er,pr,ye,Le,tr);if(!cr)return null;var hr=Ui(W*rr,K,pt,Ct,Yt,ce,re.segment,er,pr,ye,Le,tr);return hr?{first:cr,last:hr}:null}function bi(W,et,K,pt){if(W===t.WritingMode.horizontal){var Ct=Math.abs(K.y-et.y),Yt=Math.abs(K.x-et.x)*pt;if(Ct>Yt)return{useVertical:!0}}return(W===t.WritingMode.vertical?et.y<K.y:et.x>K.x)?{needsFlipping:!0}:null}function ri(W,et,K,pt,Ct,Yt,ce,re,ye,Le,tr,$e,er,pr){var wr=et/24,rr=W.lineOffsetX*wr,cr=W.lineOffsetY*wr,hr;if(W.numGlyphs>1){var Vr=W.glyphStartIndex+W.numGlyphs,yn=W.lineStartIndex,wn=W.lineStartIndex+W.lineLength,$n=pi(wr,re,rr,cr,K,tr,$e,W,ye,Yt,er);if(!$n)return{notEnoughRoom:!0};var Xn=Qn($n.first.point,ce).point,Vn=Qn($n.last.point,ce).point;if(pt&&!K){var ca=bi(W.writingMode,Xn,Vn,pr);if(ca)return ca}hr=[$n.first];for(var ea=W.glyphStartIndex+1;ea<Vr-1;ea++)hr.push(Ui(wr*re.getoffsetX(ea),rr,cr,K,tr,$e,W.segment,yn,wn,ye,Yt,er));hr.push($n.last)}else{if(pt&&!K){var wa=Qn($e,Ct).point,da=W.lineStartIndex+W.segment+1,pa=new t.Point(ye.getx(da),ye.gety(da)),Ua=Qn(pa,Ct),Di=Ua.signedDistanceFromCamera>0?Ua.point:Da($e,pa,wa,1,Ct),ui=bi(W.writingMode,wa,Di,pr);if(ui)return ui}var ji=Ui(wr*re.getoffsetX(W.glyphStartIndex),rr,cr,K,tr,$e,W.segment,W.lineStartIndex,W.lineStartIndex+W.lineLength,ye,Yt,er);if(!ji)return{notEnoughRoom:!0};hr=[ji]}for(var uo=0,cs=hr;uo<cs.length;uo+=1){var Ts=cs[uo];t.addDynamicAttributes(Le,Ts.point,Ts.angle)}return{}}function Da(W,et,K,pt,Ct){var Yt=Qn(W.add(W.sub(et)._unit()),Ct).point,ce=K.sub(Yt);return K.add(ce._mult(pt/ce.mag()))}function Ui(W,et,K,pt,Ct,Yt,ce,re,ye,Le,tr,$e){var er=pt?W-et:W+et,pr=er>0?1:-1,wr=0;pt&&(pr*=-1,wr=Math.PI),pr<0&&(wr+=Math.PI);for(var rr=pr>0?re+ce:re+ce+1,cr=Ct,hr=Ct,Vr=0,yn=0,wn=Math.abs(er),$n=[];Vr+yn<=wn;){if(rr+=pr,rr<re||rr>=ye)return null;if(hr=cr,$n.push(cr),cr=$e[rr],cr===void 0){var Xn=new t.Point(Le.getx(rr),Le.gety(rr)),Vn=Qn(Xn,tr);if(Vn.signedDistanceFromCamera>0)cr=$e[rr]=Vn.point;else{var ca=rr-pr,ea=Vr===0?Yt:new t.Point(Le.getx(ca),Le.gety(ca));cr=Da(ea,Xn,hr,wn-Vr+1,tr)}}Vr+=yn,yn=hr.dist(cr)}var wa=(wn-Vr)/yn,da=cr.sub(hr),pa=da.mult(wa)._add(hr);pa._add(da._unit()._perp()._mult(K*pr));var Ua=wr+Math.atan2(cr.y-hr.y,cr.x-hr.x);return $n.push(pa),{point:pa,angle:Ua,path:$n}}var lo=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Co(W,et){for(var K=0;K<W;K++){var pt=et.length;et.resize(pt+4),et.float32.set(lo,pt*3)}}function Bo(W,et,K){var pt=et[0],Ct=et[1];return W[0]=K[0]*pt+K[4]*Ct+K[12],W[1]=K[1]*pt+K[5]*Ct+K[13],W[3]=K[3]*pt+K[7]*Ct+K[15],W}var ai=100,yi=function(W,et,K){et===void 0&&(et=new Kr(W.width+2*ai,W.height+2*ai,25)),K===void 0&&(K=new Kr(W.width+2*ai,W.height+2*ai,25)),this.transform=W,this.grid=et,this.ignoredGrid=K,this.pitchfactor=Math.cos(W._pitch)*W.cameraToCenterDistance,this.screenRightBoundary=W.width+ai,this.screenBottomBoundary=W.height+ai,this.gridRightBoundary=W.width+2*ai,this.gridBottomBoundary=W.height+2*ai};yi.prototype.placeCollisionBox=function(W,et,K,pt,Ct){var Yt=this.projectAndGetPerspectiveRatio(pt,W.anchorPointX,W.anchorPointY),ce=K*Yt.perspectiveRatio,re=W.x1*ce+Yt.point.x,ye=W.y1*ce+Yt.point.y,Le=W.x2*ce+Yt.point.x,tr=W.y2*ce+Yt.point.y;return!this.isInsideGrid(re,ye,Le,tr)||!et&&this.grid.hitTest(re,ye,Le,tr,Ct)?{box:[],offscreen:!1}:{box:[re,ye,Le,tr],offscreen:this.isOffscreen(re,ye,Le,tr)}},yi.prototype.placeCollisionCircles=function(W,et,K,pt,Ct,Yt,ce,re,ye,Le,tr,$e,er){var pr=[],wr=new t.Point(et.anchorX,et.anchorY),rr=Qn(wr,Yt),cr=Va(this.transform.cameraToCenterDistance,rr.signedDistanceFromCamera),hr=Le?Ct/cr:Ct*cr,Vr=hr/t.ONE_EM,yn=Qn(wr,ce).point,wn={},$n=et.lineOffsetX*Vr,Xn=et.lineOffsetY*Vr,Vn=pi(Vr,pt,$n,Xn,!1,yn,wr,et,K,ce,wn),ca=!1,ea=!1,wa=!0;if(Vn){for(var da=$e*.5*cr+er,pa=new t.Point(-ai,-ai),Ua=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),Di=new dn,ui=Vn.first,ji=Vn.last,uo=[],cs=ui.path.length-1;cs>=1;cs--)uo.push(ui.path[cs]);for(var Ts=1;Ts<ji.path.length;Ts++)uo.push(ji.path[Ts]);var is=da*2.5;if(re){var hs=uo.map(function(Ah){return Qn(Ah,re)});hs.some(function(Ah){return Ah.signedDistanceFromCamera<=0})?uo=[]:uo=hs.map(function(Ah){return Ah.point})}var il=[];if(uo.length>0){for(var eo=uo[0].clone(),Ss=uo[0].clone(),Du=1;Du<uo.length;Du++)eo.x=Math.min(eo.x,uo[Du].x),eo.y=Math.min(eo.y,uo[Du].y),Ss.x=Math.max(Ss.x,uo[Du].x),Ss.y=Math.max(Ss.y,uo[Du].y);eo.x>=pa.x&&Ss.x<=Ua.x&&eo.y>=pa.y&&Ss.y<=Ua.y?il=[uo]:Ss.x<pa.x||eo.x>Ua.x||Ss.y<pa.y||eo.y>Ua.y?il=[]:il=t.clipLine([uo],pa.x,pa.y,Ua.x,Ua.y)}for(var uc=0,lf=il;uc<lf.length;uc+=1){var xf=lf[uc];Di.reset(xf,da*.25);var Xh=0;Di.length<=.5*da?Xh=1:Xh=Math.ceil(Di.paddedLength/is)+1;for(var $h=0;$h<Xh;$h++){var Tf=$h/Math.max(Xh-1,1),kh=Di.lerp(Tf),Jh=kh.x+ai,hh=kh.y+ai;pr.push(Jh,hh,da,0);var Of=Jh-da,lp=hh-da,Qh=Jh+da,Yh=hh+da;if(wa=wa&&this.isOffscreen(Of,lp,Qh,Yh),ea=ea||this.isInsideGrid(Of,lp,Qh,Yh),!W&&this.grid.hitTestCircle(Jh,hh,da,tr)&&(ca=!0,!ye))return{circles:[],offscreen:!1,collisionDetected:ca}}}}return{circles:!ye&&ca||!ea?[]:pr,offscreen:wa,collisionDetected:ca}},yi.prototype.queryRenderedSymbols=function(W){if(W.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var et=[],K=1/0,pt=1/0,Ct=-1/0,Yt=-1/0,ce=0,re=W;ce<re.length;ce+=1){var ye=re[ce],Le=new t.Point(ye.x+ai,ye.y+ai);K=Math.min(K,Le.x),pt=Math.min(pt,Le.y),Ct=Math.max(Ct,Le.x),Yt=Math.max(Yt,Le.y),et.push(Le)}for(var tr=this.grid.query(K,pt,Ct,Yt).concat(this.ignoredGrid.query(K,pt,Ct,Yt)),$e={},er={},pr=0,wr=tr;pr<wr.length;pr+=1){var rr=wr[pr],cr=rr.key;if($e[cr.bucketInstanceId]===void 0&&($e[cr.bucketInstanceId]={}),!$e[cr.bucketInstanceId][cr.featureIndex]){var hr=[new t.Point(rr.x1,rr.y1),new t.Point(rr.x2,rr.y1),new t.Point(rr.x2,rr.y2),new t.Point(rr.x1,rr.y2)];t.polygonIntersectsPolygon(et,hr)&&($e[cr.bucketInstanceId][cr.featureIndex]=!0,er[cr.bucketInstanceId]===void 0&&(er[cr.bucketInstanceId]=[]),er[cr.bucketInstanceId].push(cr.featureIndex))}}return er},yi.prototype.insertCollisionBox=function(W,et,K,pt,Ct){var Yt=et?this.ignoredGrid:this.grid,ce={bucketInstanceId:K,featureIndex:pt,collisionGroupID:Ct};Yt.insert(ce,W[0],W[1],W[2],W[3])},yi.prototype.insertCollisionCircles=function(W,et,K,pt,Ct){for(var Yt=et?this.ignoredGrid:this.grid,ce={bucketInstanceId:K,featureIndex:pt,collisionGroupID:Ct},re=0;re<W.length;re+=4)Yt.insertCircle(ce,W[re],W[re+1],W[re+2])},yi.prototype.projectAndGetPerspectiveRatio=function(W,et,K){var pt=[et,K,0,1];Bo(pt,pt,W);var Ct=new t.Point((pt[0]/pt[3]+1)/2*this.transform.width+ai,(-pt[1]/pt[3]+1)/2*this.transform.height+ai);return{point:Ct,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/pt[3])}},yi.prototype.isOffscreen=function(W,et,K,pt){return K<ai||W>=this.screenRightBoundary||pt<ai||et>this.screenBottomBoundary},yi.prototype.isInsideGrid=function(W,et,K,pt){return K>=0&&W<this.gridRightBoundary&&pt>=0&&et<this.gridBottomBoundary},yi.prototype.getViewportMatrix=function(){var W=t.identity([]);return t.translate(W,W,[-ai,-ai,0]),W};function Si(W,et,K){return et*(t.EXTENT/(W.tileSize*Math.pow(2,K-W.tileID.overscaledZ)))}var ko=function(W,et,K,pt){W?this.opacity=Math.max(0,Math.min(1,W.opacity+(W.placed?et:-et))):this.opacity=pt&&K?1:0,this.placed=K};ko.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Ao=function(W,et,K,pt,Ct){this.text=new ko(W?W.text:null,et,K,Ct),this.icon=new ko(W?W.icon:null,et,pt,Ct)};Ao.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Do=function(W,et,K){this.text=W,this.icon=et,this.skipFade=K},Pi=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},Yi=function(W,et,K,pt,Ct){this.bucketInstanceId=W,this.featureIndex=et,this.sourceLayerIndex=K,this.bucketIndex=pt,this.tileID=Ct},vs=function(W){this.crossSourceCollisions=W,this.maxGroupID=0,this.collisionGroups={}};vs.prototype.get=function(W){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[W]){var et=++this.maxGroupID;this.collisionGroups[W]={ID:et,predicate:function(K){return K.collisionGroupID===et}}}return this.collisionGroups[W]};function es(W,et,K,pt,Ct){var Yt=t.getAnchorAlignment(W),ce=Yt.horizontalAlign,re=Yt.verticalAlign,ye=-(ce-.5)*et,Le=-(re-.5)*K,tr=t.evaluateVariableOffset(W,pt);return new t.Point(ye+tr[0]*Ct,Le+tr[1]*Ct)}function ls(W,et,K,pt,Ct,Yt){var ce=W.x1,re=W.x2,ye=W.y1,Le=W.y2,tr=W.anchorPointX,$e=W.anchorPointY,er=new t.Point(et,K);return pt&&er._rotate(Ct?Yt:-Yt),{x1:ce+er.x,y1:ye+er.y,x2:re+er.x,y2:Le+er.y,anchorPointX:tr,anchorPointY:$e}}var Xi=function(W,et,K,pt){this.transform=W.clone(),this.collisionIndex=new yi(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=et,this.retainedQueryData={},this.collisionGroups=new vs(K),this.collisionCircleArrays={},this.prevPlacement=pt,pt&&(pt.prevPlacement=void 0),this.placedOrientations={}};Xi.prototype.getBucketParts=function(W,et,K,pt){var Ct=K.getBucket(et),Yt=K.latestFeatureIndex;if(!(!Ct||!Yt||et.id!==Ct.layerIds[0])){var ce=K.collisionBoxArray,re=Ct.layers[0].layout,ye=Math.pow(2,this.transform.zoom-K.tileID.overscaledZ),Le=K.tileSize/t.EXTENT,tr=this.transform.calculatePosMatrix(K.tileID.toUnwrapped()),$e=re.get("text-pitch-alignment")==="map",er=re.get("text-rotation-alignment")==="map",pr=Si(K,1,this.transform.zoom),wr=Tn(tr,$e,er,this.transform,pr),rr=null;if($e){var cr=ta(tr,$e,er,this.transform,pr);rr=t.multiply([],this.transform.labelPlaneMatrix,cr)}this.retainedQueryData[Ct.bucketInstanceId]=new Yi(Ct.bucketInstanceId,Yt,Ct.sourceLayerIndex,Ct.index,K.tileID);var hr={bucket:Ct,layout:re,posMatrix:tr,textLabelPlaneMatrix:wr,labelToScreenMatrix:rr,scale:ye,textPixelRatio:Le,holdingForFade:K.holdingForFade(),collisionBoxArray:ce,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(Ct.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Ct.sourceID)};if(pt)for(var Vr=0,yn=Ct.sortKeyRanges;Vr<yn.length;Vr+=1){var wn=yn[Vr],$n=wn.sortKey,Xn=wn.symbolInstanceStart,Vn=wn.symbolInstanceEnd;W.push({sortKey:$n,symbolInstanceStart:Xn,symbolInstanceEnd:Vn,parameters:hr})}else W.push({symbolInstanceStart:0,symbolInstanceEnd:Ct.symbolInstances.length,parameters:hr})}},Xi.prototype.attemptAnchorPlacement=function(W,et,K,pt,Ct,Yt,ce,re,ye,Le,tr,$e,er,pr,wr){var rr=[$e.textOffset0,$e.textOffset1],cr=es(W,K,pt,rr,Ct),hr=this.collisionIndex.placeCollisionBox(ls(et,cr.x,cr.y,Yt,ce,this.transform.angle),tr,re,ye,Le.predicate);if(wr){var Vr=this.collisionIndex.placeCollisionBox(ls(wr,cr.x,cr.y,Yt,ce,this.transform.angle),tr,re,ye,Le.predicate);if(Vr.box.length===0)return}if(hr.box.length>0){var yn;return this.prevPlacement&&this.prevPlacement.variableOffsets[$e.crossTileID]&&this.prevPlacement.placements[$e.crossTileID]&&this.prevPlacement.placements[$e.crossTileID].text&&(yn=this.prevPlacement.variableOffsets[$e.crossTileID].anchor),this.variableOffsets[$e.crossTileID]={textOffset:rr,width:K,height:pt,anchor:W,textBoxScale:Ct,prevAnchor:yn},this.markUsedJustification(er,W,$e,pr),er.allowVerticalPlacement&&(this.markUsedOrientation(er,pr,$e),this.placedOrientations[$e.crossTileID]=pr),{shift:cr,placedGlyphBoxes:hr}}},Xi.prototype.placeLayerBucketPart=function(W,et,K){var pt=this,Ct=W.parameters,Yt=Ct.bucket,ce=Ct.layout,re=Ct.posMatrix,ye=Ct.textLabelPlaneMatrix,Le=Ct.labelToScreenMatrix,tr=Ct.textPixelRatio,$e=Ct.holdingForFade,er=Ct.collisionBoxArray,pr=Ct.partiallyEvaluatedTextSize,wr=Ct.collisionGroup,rr=ce.get("text-optional"),cr=ce.get("icon-optional"),hr=ce.get("text-allow-overlap"),Vr=ce.get("icon-allow-overlap"),yn=ce.get("text-rotation-alignment")==="map",wn=ce.get("text-pitch-alignment")==="map",$n=ce.get("icon-text-fit")!=="none",Xn=ce.get("symbol-z-order")==="viewport-y",Vn=hr&&(Vr||!Yt.hasIconData()||cr),ca=Vr&&(hr||!Yt.hasTextData()||rr);!Yt.collisionArrays&&er&&Yt.deserializeCollisionBoxes(er);var ea=function(ui,ji){if(!et[ui.crossTileID]){if($e){pt.placements[ui.crossTileID]=new Do(!1,!1,!1);return}var uo=!1,cs=!1,Ts=!0,is=null,hs={box:null,offscreen:null},il={box:null,offscreen:null},eo=null,Ss=null,Du=null,uc=0,lf=0,xf=0;ji.textFeatureIndex?uc=ji.textFeatureIndex:ui.useRuntimeCollisionCircles&&(uc=ui.featureIndex),ji.verticalTextFeatureIndex&&(lf=ji.verticalTextFeatureIndex);var Xh=ji.textBox;if(Xh){var $h=function(zu){var Nc=t.WritingMode.horizontal;if(Yt.allowVerticalPlacement&&!zu&&pt.prevPlacement){var ol=pt.prevPlacement.placedOrientations[ui.crossTileID];ol&&(pt.placedOrientations[ui.crossTileID]=ol,Nc=ol,pt.markUsedOrientation(Yt,Nc,ui))}return Nc},Tf=function(zu,Nc){if(Yt.allowVerticalPlacement&&ui.numVerticalGlyphVertices>0&&ji.verticalTextBox)for(var ol=0,Pp=Yt.writingModes;ol<Pp.length;ol+=1){var Yp=Pp[ol];if(Yp===t.WritingMode.vertical?(hs=Nc(),il=hs):hs=zu(),hs&&hs.box&&hs.box.length)break}else hs=zu()};if(ce.get("text-variable-anchor")){var kh=ce.get("text-variable-anchor");if(pt.prevPlacement&&pt.prevPlacement.variableOffsets[ui.crossTileID]){var Jh=pt.prevPlacement.variableOffsets[ui.crossTileID];kh.indexOf(Jh.anchor)>0&&(kh=kh.filter(function(zu){return zu!==Jh.anchor}),kh.unshift(Jh.anchor))}var hh=function(zu,Nc,ol){for(var Pp=zu.x2-zu.x1,Yp=zu.y2-zu.y1,D0=ui.textBoxScale,vl=$n&&!Vr?Nc:null,$f={box:[],offscreen:!1},z0=hr?kh.length*2:kh.length,Ip=0;Ip<z0;++Ip){var Af=kh[Ip%kh.length],$g=Ip>=kh.length,Kp=pt.attemptAnchorPlacement(Af,zu,Pp,Yp,D0,yn,wn,tr,re,wr,$g,ui,Yt,ol,vl);if(Kp&&($f=Kp.placedGlyphBoxes,$f&&$f.box&&$f.box.length)){uo=!0,is=Kp.shift;break}}return $f},Of=function(){return hh(Xh,ji.iconBox,t.WritingMode.horizontal)},lp=function(){var zu=ji.verticalTextBox,Nc=hs&&hs.box&&hs.box.length;return Yt.allowVerticalPlacement&&!Nc&&ui.numVerticalGlyphVertices>0&&zu?hh(zu,ji.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}};Tf(Of,lp),hs&&(uo=hs.box,Ts=hs.offscreen);var Qh=$h(hs&&hs.box);if(!uo&&pt.prevPlacement){var Yh=pt.prevPlacement.variableOffsets[ui.crossTileID];Yh&&(pt.variableOffsets[ui.crossTileID]=Yh,pt.markUsedJustification(Yt,Yh.anchor,ui,Qh))}}else{var Ah=function(zu,Nc){var ol=pt.collisionIndex.placeCollisionBox(zu,hr,tr,re,wr.predicate);return ol&&ol.box&&ol.box.length&&(pt.markUsedOrientation(Yt,Nc,ui),pt.placedOrientations[ui.crossTileID]=Nc),ol},up=function(){return Ah(Xh,t.WritingMode.horizontal)},Mp=function(){var zu=ji.verticalTextBox;return Yt.allowVerticalPlacement&&ui.numVerticalGlyphVertices>0&&zu?Ah(zu,t.WritingMode.vertical):{box:null,offscreen:null}};Tf(up,Mp),$h(hs&&hs.box&&hs.box.length)}}if(eo=hs,uo=eo&&eo.box&&eo.box.length>0,Ts=eo&&eo.offscreen,ui.useRuntimeCollisionCircles){var cp=Yt.text.placedSymbolArray.get(ui.centerJustifiedTextSymbolIndex),Rc=t.evaluateSizeForFeature(Yt.textSizeData,pr,cp),Xf=ce.get("text-padding"),Sp=ui.collisionCircleDiameter;Ss=pt.collisionIndex.placeCollisionCircles(hr,cp,Yt.lineVertexArray,Yt.glyphOffsetArray,Rc,re,ye,Le,K,wn,wr.predicate,Sp,Xf),uo=hr||Ss.circles.length>0&&!Ss.collisionDetected,Ts=Ts&&Ss.offscreen}if(ji.iconFeatureIndex&&(xf=ji.iconFeatureIndex),ji.iconBox){var jc=function(zu){var Nc=$n&&is?ls(zu,is.x,is.y,yn,wn,pt.transform.angle):zu;return pt.collisionIndex.placeCollisionBox(Nc,Vr,tr,re,wr.predicate)};il&&il.box&&il.box.length&&ji.verticalIconBox?(Du=jc(ji.verticalIconBox),cs=Du.box.length>0):(Du=jc(ji.iconBox),cs=Du.box.length>0),Ts=Ts&&Du.offscreen}var hp=rr||ui.numHorizontalGlyphVertices===0&&ui.numVerticalGlyphVertices===0,Jp=cr||ui.numIconVertices===0;if(!hp&&!Jp?cs=uo=cs&&uo:Jp?hp||(cs=cs&&uo):uo=cs&&uo,uo&&eo&&eo.box&&(il&&il.box&&lf?pt.collisionIndex.insertCollisionBox(eo.box,ce.get("text-ignore-placement"),Yt.bucketInstanceId,lf,wr.ID):pt.collisionIndex.insertCollisionBox(eo.box,ce.get("text-ignore-placement"),Yt.bucketInstanceId,uc,wr.ID)),cs&&Du&&pt.collisionIndex.insertCollisionBox(Du.box,ce.get("icon-ignore-placement"),Yt.bucketInstanceId,xf,wr.ID),Ss&&(uo&&pt.collisionIndex.insertCollisionCircles(Ss.circles,ce.get("text-ignore-placement"),Yt.bucketInstanceId,uc,wr.ID),K)){var Qp=Yt.bucketInstanceId,kf=pt.collisionCircleArrays[Qp];kf===void 0&&(kf=pt.collisionCircleArrays[Qp]=new Pi);for(var Ep=0;Ep<Ss.circles.length;Ep+=4)kf.circles.push(Ss.circles[Ep+0]),kf.circles.push(Ss.circles[Ep+1]),kf.circles.push(Ss.circles[Ep+2]),kf.circles.push(Ss.collisionDetected?1:0)}pt.placements[ui.crossTileID]=new Do(uo||Vn,cs||ca,Ts||Yt.justReloaded),et[ui.crossTileID]=!0}};if(Xn)for(var wa=Yt.getSortedSymbolIndexes(this.transform.angle),da=wa.length-1;da>=0;--da){var pa=wa[da];ea(Yt.symbolInstances.get(pa),Yt.collisionArrays[pa])}else for(var Ua=W.symbolInstanceStart;Ua<W.symbolInstanceEnd;Ua++)ea(Yt.symbolInstances.get(Ua),Yt.collisionArrays[Ua]);if(K&&Yt.bucketInstanceId in this.collisionCircleArrays){var Di=this.collisionCircleArrays[Yt.bucketInstanceId];t.invert(Di.invProjMatrix,re),Di.viewportMatrix=this.collisionIndex.getViewportMatrix()}Yt.justReloaded=!1},Xi.prototype.markUsedJustification=function(W,et,K,pt){var Ct={left:K.leftJustifiedTextSymbolIndex,center:K.centerJustifiedTextSymbolIndex,right:K.rightJustifiedTextSymbolIndex},Yt;pt===t.WritingMode.vertical?Yt=K.verticalPlacedTextSymbolIndex:Yt=Ct[t.getAnchorJustification(et)];for(var ce=[K.leftJustifiedTextSymbolIndex,K.centerJustifiedTextSymbolIndex,K.rightJustifiedTextSymbolIndex,K.verticalPlacedTextSymbolIndex],re=0,ye=ce;re<ye.length;re+=1){var Le=ye[re];Le>=0&&(Yt>=0&&Le!==Yt?W.text.placedSymbolArray.get(Le).crossTileID=0:W.text.placedSymbolArray.get(Le).crossTileID=K.crossTileID)}},Xi.prototype.markUsedOrientation=function(W,et,K){for(var pt=et===t.WritingMode.horizontal||et===t.WritingMode.horizontalOnly?et:0,Ct=et===t.WritingMode.vertical?et:0,Yt=[K.leftJustifiedTextSymbolIndex,K.centerJustifiedTextSymbolIndex,K.rightJustifiedTextSymbolIndex],ce=0,re=Yt;ce<re.length;ce+=1){var ye=re[ce];W.text.placedSymbolArray.get(ye).placedOrientation=pt}K.verticalPlacedTextSymbolIndex&&(W.text.placedSymbolArray.get(K.verticalPlacedTextSymbolIndex).placedOrientation=Ct)},Xi.prototype.commit=function(W){this.commitTime=W,this.zoomAtLastRecencyCheck=this.transform.zoom;var et=this.prevPlacement,K=!1;this.prevZoomAdjustment=et?et.zoomAdjustment(this.transform.zoom):0;var pt=et?et.symbolFadeChange(W):1,Ct=et?et.opacities:{},Yt=et?et.variableOffsets:{},ce=et?et.placedOrientations:{};for(var re in this.placements){var ye=this.placements[re],Le=Ct[re];Le?(this.opacities[re]=new Ao(Le,pt,ye.text,ye.icon),K=K||ye.text!==Le.text.placed||ye.icon!==Le.icon.placed):(this.opacities[re]=new Ao(null,pt,ye.text,ye.icon,ye.skipFade),K=K||ye.text||ye.icon)}for(var tr in Ct){var $e=Ct[tr];if(!this.opacities[tr]){var er=new Ao($e,pt,!1,!1);er.isHidden()||(this.opacities[tr]=er,K=K||$e.text.placed||$e.icon.placed)}}for(var pr in Yt)!this.variableOffsets[pr]&&this.opacities[pr]&&!this.opacities[pr].isHidden()&&(this.variableOffsets[pr]=Yt[pr]);for(var wr in ce)!this.placedOrientations[wr]&&this.opacities[wr]&&!this.opacities[wr].isHidden()&&(this.placedOrientations[wr]=ce[wr]);K?this.lastPlacementChangeTime=W:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=et?et.lastPlacementChangeTime:W)},Xi.prototype.updateLayerOpacities=function(W,et){for(var K={},pt=0,Ct=et;pt<Ct.length;pt+=1){var Yt=Ct[pt],ce=Yt.getBucket(W);ce&&Yt.latestFeatureIndex&&W.id===ce.layerIds[0]&&this.updateBucketOpacities(ce,K,Yt.collisionBoxArray)}},Xi.prototype.updateBucketOpacities=function(W,et,K){var pt=this;W.hasTextData()&&W.text.opacityVertexArray.clear(),W.hasIconData()&&W.icon.opacityVertexArray.clear(),W.hasIconCollisionBoxData()&&W.iconCollisionBox.collisionVertexArray.clear(),W.hasTextCollisionBoxData()&&W.textCollisionBox.collisionVertexArray.clear();var Ct=W.layers[0].layout,Yt=new Ao(null,0,!1,!1,!0),ce=Ct.get("text-allow-overlap"),re=Ct.get("icon-allow-overlap"),ye=Ct.get("text-variable-anchor"),Le=Ct.get("text-rotation-alignment")==="map",tr=Ct.get("text-pitch-alignment")==="map",$e=Ct.get("icon-text-fit")!=="none",er=new Ao(null,0,ce&&(re||!W.hasIconData()||Ct.get("icon-optional")),re&&(ce||!W.hasTextData()||Ct.get("text-optional")),!0);!W.collisionArrays&&K&&(W.hasIconCollisionBoxData()||W.hasTextCollisionBoxData())&&W.deserializeCollisionBoxes(K);for(var pr=function(hr,Vr,yn){for(var wn=0;wn<Vr/4;wn++)hr.opacityVertexArray.emplaceBack(yn)},wr=function(hr){var Vr=W.symbolInstances.get(hr),yn=Vr.numHorizontalGlyphVertices,wn=Vr.numVerticalGlyphVertices,$n=Vr.crossTileID,Xn=et[$n],Vn=pt.opacities[$n];Xn?Vn=Yt:Vn||(Vn=er,pt.opacities[$n]=Vn),et[$n]=!0;var ca=yn>0||wn>0,ea=Vr.numIconVertices>0,wa=pt.placedOrientations[Vr.crossTileID],da=wa===t.WritingMode.vertical,pa=wa===t.WritingMode.horizontal||wa===t.WritingMode.horizontalOnly;if(ca){var Ua=hl(Vn.text),Di=da?za:Ua;pr(W.text,yn,Di);var ui=pa?za:Ua;pr(W.text,wn,ui);var ji=Vn.text.isHidden();[Vr.rightJustifiedTextSymbolIndex,Vr.centerJustifiedTextSymbolIndex,Vr.leftJustifiedTextSymbolIndex].forEach(function(xf){xf>=0&&(W.text.placedSymbolArray.get(xf).hidden=ji||da?1:0)}),Vr.verticalPlacedTextSymbolIndex>=0&&(W.text.placedSymbolArray.get(Vr.verticalPlacedTextSymbolIndex).hidden=ji||pa?1:0);var uo=pt.variableOffsets[Vr.crossTileID];uo&&pt.markUsedJustification(W,uo.anchor,Vr,wa);var cs=pt.placedOrientations[Vr.crossTileID];cs&&(pt.markUsedJustification(W,"left",Vr,cs),pt.markUsedOrientation(W,cs,Vr))}if(ea){var Ts=hl(Vn.icon),is=!($e&&Vr.verticalPlacedIconSymbolIndex&&da);if(Vr.placedIconSymbolIndex>=0){var hs=is?Ts:za;pr(W.icon,Vr.numIconVertices,hs),W.icon.placedSymbolArray.get(Vr.placedIconSymbolIndex).hidden=Vn.icon.isHidden()}if(Vr.verticalPlacedIconSymbolIndex>=0){var il=is?za:Ts;pr(W.icon,Vr.numVerticalIconVertices,il),W.icon.placedSymbolArray.get(Vr.verticalPlacedIconSymbolIndex).hidden=Vn.icon.isHidden()}}if(W.hasIconCollisionBoxData()||W.hasTextCollisionBoxData()){var eo=W.collisionArrays[hr];if(eo){var Ss=new t.Point(0,0);if(eo.textBox||eo.verticalTextBox){var Du=!0;if(ye){var uc=pt.variableOffsets[$n];uc?(Ss=es(uc.anchor,uc.width,uc.height,uc.textOffset,uc.textBoxScale),Le&&Ss._rotate(tr?pt.transform.angle:-pt.transform.angle)):Du=!1}eo.textBox&&ga(W.textCollisionBox.collisionVertexArray,Vn.text.placed,!Du||da,Ss.x,Ss.y),eo.verticalTextBox&&ga(W.textCollisionBox.collisionVertexArray,Vn.text.placed,!Du||pa,Ss.x,Ss.y)}var lf=!!(!pa&&eo.verticalIconBox);eo.iconBox&&ga(W.iconCollisionBox.collisionVertexArray,Vn.icon.placed,lf,$e?Ss.x:0,$e?Ss.y:0),eo.verticalIconBox&&ga(W.iconCollisionBox.collisionVertexArray,Vn.icon.placed,!lf,$e?Ss.x:0,$e?Ss.y:0)}}},rr=0;rr<W.symbolInstances.length;rr++)wr(rr);if(W.sortFeatures(this.transform.angle),this.retainedQueryData[W.bucketInstanceId]&&(this.retainedQueryData[W.bucketInstanceId].featureSortOrder=W.featureSortOrder),W.hasTextData()&&W.text.opacityVertexBuffer&&W.text.opacityVertexBuffer.updateData(W.text.opacityVertexArray),W.hasIconData()&&W.icon.opacityVertexBuffer&&W.icon.opacityVertexBuffer.updateData(W.icon.opacityVertexArray),W.hasIconCollisionBoxData()&&W.iconCollisionBox.collisionVertexBuffer&&W.iconCollisionBox.collisionVertexBuffer.updateData(W.iconCollisionBox.collisionVertexArray),W.hasTextCollisionBoxData()&&W.textCollisionBox.collisionVertexBuffer&&W.textCollisionBox.collisionVertexBuffer.updateData(W.textCollisionBox.collisionVertexArray),W.bucketInstanceId in this.collisionCircleArrays){var cr=this.collisionCircleArrays[W.bucketInstanceId];W.placementInvProjMatrix=cr.invProjMatrix,W.placementViewportMatrix=cr.viewportMatrix,W.collisionCircleArray=cr.circles,delete this.collisionCircleArrays[W.bucketInstanceId]}},Xi.prototype.symbolFadeChange=function(W){return this.fadeDuration===0?1:(W-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Xi.prototype.zoomAdjustment=function(W){return Math.max(0,(this.transform.zoom-W)/1.5)},Xi.prototype.hasTransitions=function(W){return this.stale||W-this.lastPlacementChangeTime<this.fadeDuration},Xi.prototype.stillRecent=function(W,et){var K=this.zoomAtLastRecencyCheck===et?1-this.zoomAdjustment(et):1;return this.zoomAtLastRecencyCheck=et,this.commitTime+this.fadeDuration*K>W},Xi.prototype.setStale=function(){this.stale=!0};function ga(W,et,K,pt,Ct){W.emplaceBack(et?1:0,K?1:0,pt||0,Ct||0),W.emplaceBack(et?1:0,K?1:0,pt||0,Ct||0),W.emplaceBack(et?1:0,K?1:0,pt||0,Ct||0),W.emplaceBack(et?1:0,K?1:0,pt||0,Ct||0)}var Xa=Math.pow(2,25),Ls=Math.pow(2,24),fs=Math.pow(2,17),qi=Math.pow(2,16),ms=Math.pow(2,9),Po=Math.pow(2,8),rs=Math.pow(2,1);function hl(W){if(W.opacity===0&&!W.placed)return 0;if(W.opacity===1&&W.placed)return 4294967295;var et=W.placed?1:0,K=Math.floor(W.opacity*127);return K*Xa+et*Ls+K*fs+et*qi+K*ms+et*Po+K*rs+et}var za=0,Oi=function(W){this._sortAcrossTiles=W.layout.get("symbol-z-order")!=="viewport-y"&&W.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Oi.prototype.continuePlacement=function(W,et,K,pt,Ct){for(var Yt=this._bucketParts;this._currentTileIndex<W.length;){var ce=W[this._currentTileIndex];if(et.getBucketParts(Yt,pt,ce,this._sortAcrossTiles),this._currentTileIndex++,Ct())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,Yt.sort(function(ye,Le){return ye.sortKey-Le.sortKey}));this._currentPartIndex<Yt.length;){var re=Yt[this._currentPartIndex];if(et.placeLayerBucketPart(re,this._seenCrossTileIDs,K),this._currentPartIndex++,Ct())return!0}return!1};var Bi=function(W,et,K,pt,Ct,Yt,ce){this.placement=new Xi(W,Ct,Yt,ce),this._currentPlacementIndex=et.length-1,this._forceFullPlacement=K,this._showCollisionBoxes=pt,this._done=!1};Bi.prototype.isDone=function(){return this._done},Bi.prototype.continuePlacement=function(W,et,K){for(var pt=this,Ct=t.browser.now(),Yt=function(){var tr=t.browser.now()-Ct;return pt._forceFullPlacement?!1:tr>2};this._currentPlacementIndex>=0;){var ce=W[this._currentPlacementIndex],re=et[ce],ye=this.placement.collisionIndex.transform.zoom;if(re.type==="symbol"&&(!re.minzoom||re.minzoom<=ye)&&(!re.maxzoom||re.maxzoom>ye)){this._inProgressLayer||(this._inProgressLayer=new Oi(re));var Le=this._inProgressLayer.continuePlacement(K[re.source],this.placement,this._showCollisionBoxes,re,Yt);if(Le)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Bi.prototype.commit=function(W){return this.placement.commit(W),this.placement};var Ro=512/t.EXTENT/2,Fo=function(W,et,K){this.tileID=W,this.indexedSymbolInstances={},this.bucketInstanceId=K;for(var pt=0;pt<et.length;pt++){var Ct=et.get(pt),Yt=Ct.key;this.indexedSymbolInstances[Yt]||(this.indexedSymbolInstances[Yt]=[]),this.indexedSymbolInstances[Yt].push({crossTileID:Ct.crossTileID,coord:this.getScaledCoordinates(Ct,W)})}};Fo.prototype.getScaledCoordinates=function(W,et){var K=et.canonical.z-this.tileID.canonical.z,pt=Ro/Math.pow(2,K);return{x:Math.floor((et.canonical.x*t.EXTENT+W.anchorX)*pt),y:Math.floor((et.canonical.y*t.EXTENT+W.anchorY)*pt)}},Fo.prototype.findMatches=function(W,et,K){for(var pt=this.tileID.canonical.z<et.canonical.z?1:Math.pow(2,this.tileID.canonical.z-et.canonical.z),Ct=0;Ct<W.length;Ct++){var Yt=W.get(Ct);if(!Yt.crossTileID){var ce=this.indexedSymbolInstances[Yt.key];if(ce)for(var re=this.getScaledCoordinates(Yt,et),ye=0,Le=ce;ye<Le.length;ye+=1){var tr=Le[ye];if(Math.abs(tr.coord.x-re.x)<=pt&&Math.abs(tr.coord.y-re.y)<=pt&&!K[tr.crossTileID]){K[tr.crossTileID]=!0,Yt.crossTileID=tr.crossTileID;break}}}}};var Ci=function(){this.maxCrossTileID=0};Ci.prototype.generate=function(){return++this.maxCrossTileID};var fl=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};fl.prototype.handleWrapJump=function(W){var et=Math.round((W-this.lng)/360);if(et!==0)for(var K in this.indexes){var pt=this.indexes[K],Ct={};for(var Yt in pt){var ce=pt[Yt];ce.tileID=ce.tileID.unwrapTo(ce.tileID.wrap+et),Ct[ce.tileID.key]=ce}this.indexes[K]=Ct}this.lng=W},fl.prototype.addBucket=function(W,et,K){if(this.indexes[W.overscaledZ]&&this.indexes[W.overscaledZ][W.key]){if(this.indexes[W.overscaledZ][W.key].bucketInstanceId===et.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(W.overscaledZ,this.indexes[W.overscaledZ][W.key])}for(var pt=0;pt<et.symbolInstances.length;pt++){var Ct=et.symbolInstances.get(pt);Ct.crossTileID=0}this.usedCrossTileIDs[W.overscaledZ]||(this.usedCrossTileIDs[W.overscaledZ]={});var Yt=this.usedCrossTileIDs[W.overscaledZ];for(var ce in this.indexes){var re=this.indexes[ce];if(Number(ce)>W.overscaledZ)for(var ye in re){var Le=re[ye];Le.tileID.isChildOf(W)&&Le.findMatches(et.symbolInstances,W,Yt)}else{var tr=W.scaledTo(Number(ce)),$e=re[tr.key];$e&&$e.findMatches(et.symbolInstances,W,Yt)}}for(var er=0;er<et.symbolInstances.length;er++){var pr=et.symbolInstances.get(er);pr.crossTileID||(pr.crossTileID=K.generate(),Yt[pr.crossTileID]=!0)}return this.indexes[W.overscaledZ]===void 0&&(this.indexes[W.overscaledZ]={}),this.indexes[W.overscaledZ][W.key]=new Fo(W,et.symbolInstances,et.bucketInstanceId),!0},fl.prototype.removeBucketCrossTileIDs=function(W,et){for(var K in et.indexedSymbolInstances)for(var pt=0,Ct=et.indexedSymbolInstances[K];pt<Ct.length;pt+=1){var Yt=Ct[pt];delete this.usedCrossTileIDs[W][Yt.crossTileID]}},fl.prototype.removeStaleBuckets=function(W){var et=!1;for(var K in this.indexes){var pt=this.indexes[K];for(var Ct in pt)W[pt[Ct].bucketInstanceId]||(this.removeBucketCrossTileIDs(K,pt[Ct]),delete pt[Ct],et=!0)}return et};var ql=function(){this.layerIndexes={},this.crossTileIDs=new Ci,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};ql.prototype.addLayer=function(W,et,K){var pt=this.layerIndexes[W.id];pt===void 0&&(pt=this.layerIndexes[W.id]=new fl);var Ct=!1,Yt={};pt.handleWrapJump(K);for(var ce=0,re=et;ce<re.length;ce+=1){var ye=re[ce],Le=ye.getBucket(W);!Le||W.id!==Le.layerIds[0]||(Le.bucketInstanceId||(Le.bucketInstanceId=++this.maxBucketInstanceId),pt.addBucket(ye.tileID,Le,this.crossTileIDs)&&(Ct=!0),Yt[Le.bucketInstanceId]=!0)}return pt.removeStaleBuckets(Yt)&&(Ct=!0),Ct},ql.prototype.pruneUnusedLayers=function(W){var et={};W.forEach(function(pt){et[pt]=!0});for(var K in this.layerIndexes)et[K]||delete this.layerIndexes[K]};var Zs=function(W,et){return t.emitValidationErrors(W,et&&et.filter(function(K){return K.identifier!=="source.canvas"}))},Hl=t.pick(Dr,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Us=t.pick(Dr,["setCenter","setZoom","setBearing","setPitch"]),Es=Er(),El=function(W){function et(K,pt){var Ct=this;pt===void 0&&(pt={}),W.call(this),this.map=K,this.dispatcher=new R(xe(),this),this.imageManager=new x,this.imageManager.setEventedParent(this),this.glyphManager=new k(K._requestManager,pt.localIdeographFontFamily),this.lineAtlas=new B(256,512),this.crossTileSymbolIndex=new ql,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var Yt=this;this._rtlTextPluginCallback=et.registerForPluginStateChange(function(ce){var re={pluginStatus:ce.pluginStatus,pluginURL:ce.pluginURL};Yt.dispatcher.broadcast("syncRTLPluginState",re,function(ye,Le){if(t.triggerPluginCompletionEvent(ye),Le){var tr=Le.every(function(er){return er});if(tr)for(var $e in Yt.sourceCaches)Yt.sourceCaches[$e].reload()}})}),this.on("data",function(ce){if(!(ce.dataType!=="source"||ce.sourceDataType!=="metadata")){var re=Ct.sourceCaches[ce.sourceId];if(re){var ye=re.getSource();if(!(!ye||!ye.vectorLayerIds))for(var Le in Ct._layers){var tr=Ct._layers[Le];tr.source===ye.id&&Ct._validateLayer(tr)}}}})}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.loadURL=function(K,pt){var Ct=this;pt===void 0&&(pt={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var Yt=typeof pt.validate=="boolean"?pt.validate:!t.isMapboxURL(K);K=this.map._requestManager.normalizeStyleURL(K,pt.accessToken);var ce=this.map._requestManager.transformRequest(K,t.ResourceType.Style);this._request=t.getJSON(ce,function(re,ye){Ct._request=null,re?Ct.fire(new t.ErrorEvent(re)):ye&&Ct._load(ye,Yt)})},et.prototype.loadJSON=function(K,pt){var Ct=this;pt===void 0&&(pt={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame(function(){Ct._request=null,Ct._load(K,pt.validate!==!1)})},et.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Es,!1)},et.prototype._load=function(K,pt){if(!(pt&&Zs(this,t.validateStyle(K)))){this._loaded=!0,this.stylesheet=K;for(var Ct in K.sources)this.addSource(Ct,K.sources[Ct],{validate:!1});K.sprite?this._loadSprite(K.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(K.glyphs);var Yt=dr(this.stylesheet.layers);this._order=Yt.map(function(Le){return Le.id}),this._layers={},this._serializedLayers={};for(var ce=0,re=Yt;ce<re.length;ce+=1){var ye=re[ce];ye=t.createStyleLayer(ye),ye.setEventedParent(this,{layer:{id:ye.id}}),this._layers[ye.id]=ye,this._serializedLayers[ye.id]=ye.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new O(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},et.prototype._loadSprite=function(K){var pt=this;this._spriteRequest=p(K,this.map._requestManager,function(Ct,Yt){if(pt._spriteRequest=null,Ct)pt.fire(new t.ErrorEvent(Ct));else if(Yt)for(var ce in Yt)pt.imageManager.addImage(ce,Yt[ce]);pt.imageManager.setLoaded(!0),pt._availableImages=pt.imageManager.listImages(),pt.dispatcher.broadcast("setImages",pt._availableImages),pt.fire(new t.Event("data",{dataType:"style"}))})},et.prototype._validateLayer=function(K){var pt=this.sourceCaches[K.source];if(pt){var Ct=K.sourceLayer;if(Ct){var Yt=pt.getSource();(Yt.type==="geojson"||Yt.vectorLayerIds&&Yt.vectorLayerIds.indexOf(Ct)===-1)&&this.fire(new t.ErrorEvent(new Error('Source layer "'+Ct+'" does not exist on source "'+Yt.id+'" as specified by style layer "'+K.id+'"')))}}},et.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var K in this.sourceCaches)if(!this.sourceCaches[K].loaded())return!1;return!!this.imageManager.isLoaded()},et.prototype._serializeLayers=function(K){for(var pt=[],Ct=0,Yt=K;Ct<Yt.length;Ct+=1){var ce=Yt[Ct],re=this._layers[ce];re.type!=="custom"&&pt.push(re.serialize())}return pt},et.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var K in this.sourceCaches)if(this.sourceCaches[K].hasTransition())return!0;for(var pt in this._layers)if(this._layers[pt].hasTransition())return!0;return!1},et.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},et.prototype.update=function(K){if(this._loaded){var pt=this._changed;if(this._changed){var Ct=Object.keys(this._updatedLayers),Yt=Object.keys(this._removedLayers);(Ct.length||Yt.length)&&this._updateWorkerLayers(Ct,Yt);for(var ce in this._updatedSources){var re=this._updatedSources[ce];re==="reload"?this._reloadSource(ce):re==="clear"&&this._clearSource(ce)}this._updateTilesForChangedImages();for(var ye in this._updatedPaintProps)this._layers[ye].updateTransitions(K);this.light.updateTransitions(K),this._resetUpdates()}var Le={};for(var tr in this.sourceCaches){var $e=this.sourceCaches[tr];Le[tr]=$e.used,$e.used=!1}for(var er=0,pr=this._order;er<pr.length;er+=1){var wr=pr[er],rr=this._layers[wr];rr.recalculate(K,this._availableImages),!rr.isHidden(K.zoom)&&rr.source&&(this.sourceCaches[rr.source].used=!0)}for(var cr in Le){var hr=this.sourceCaches[cr];Le[cr]!==hr.used&&hr.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:cr}))}this.light.recalculate(K),this.z=K.zoom,pt&&this.fire(new t.Event("data",{dataType:"style"}))}},et.prototype._updateTilesForChangedImages=function(){var K=Object.keys(this._changedImages);if(K.length){for(var pt in this.sourceCaches)this.sourceCaches[pt].reloadTilesForDependencies(["icons","patterns"],K);this._changedImages={}}},et.prototype._updateWorkerLayers=function(K,pt){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(K),removedIds:pt})},et.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},et.prototype.setState=function(K){var pt=this;if(this._checkLoaded(),Zs(this,t.validateStyle(K)))return!1;K=t.clone$1(K),K.layers=dr(K.layers);var Ct=En(this.serialize(),K).filter(function(ce){return!(ce.command in Us)});if(Ct.length===0)return!1;var Yt=Ct.filter(function(ce){return!(ce.command in Hl)});if(Yt.length>0)throw new Error("Unimplemented: "+Yt.map(function(ce){return ce.command}).join(", ")+".");return Ct.forEach(function(ce){ce.command!=="setTransition"&&pt[ce.command].apply(pt,ce.args)}),this.stylesheet=K,!0},et.prototype.addImage=function(K,pt){if(this.getImage(K))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(K,pt),this._afterImageUpdated(K)},et.prototype.updateImage=function(K,pt){this.imageManager.updateImage(K,pt)},et.prototype.getImage=function(K){return this.imageManager.getImage(K)},et.prototype.removeImage=function(K){if(!this.getImage(K))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(K),this._afterImageUpdated(K)},et.prototype._afterImageUpdated=function(K){this._availableImages=this.imageManager.listImages(),this._changedImages[K]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},et.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},et.prototype.addSource=function(K,pt,Ct){var Yt=this;if(Ct===void 0&&(Ct={}),this._checkLoaded(),this.sourceCaches[K]!==void 0)throw new Error("There is already a source with this ID");if(!pt.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(pt).join(", ")+".");var ce=["vector","raster","geojson","video","image"],re=ce.indexOf(pt.type)>=0;if(!(re&&this._validate(t.validateStyle.source,"sources."+K,pt,null,Ct))){this.map&&this.map._collectResourceTiming&&(pt.collectResourceTiming=!0);var ye=this.sourceCaches[K]=new rn(K,pt,this.dispatcher);ye.style=this,ye.setEventedParent(this,function(){return{isSourceLoaded:Yt.loaded(),source:ye.serialize(),sourceId:K}}),ye.onAdd(this.map),this._changed=!0}},et.prototype.removeSource=function(K){if(this._checkLoaded(),this.sourceCaches[K]===void 0)throw new Error("There is no source with this ID");for(var pt in this._layers)if(this._layers[pt].source===K)return this.fire(new t.ErrorEvent(new Error('Source "'+K+'" cannot be removed while layer "'+pt+'" is using it.')));var Ct=this.sourceCaches[K];delete this.sourceCaches[K],delete this._updatedSources[K],Ct.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:K})),Ct.setEventedParent(null),Ct.clearTiles(),Ct.onRemove&&Ct.onRemove(this.map),this._changed=!0},et.prototype.setGeoJSONSourceData=function(K,pt){this._checkLoaded();var Ct=this.sourceCaches[K].getSource();Ct.setData(pt),this._changed=!0},et.prototype.getSource=function(K){return this.sourceCaches[K]&&this.sourceCaches[K].getSource()},et.prototype.addLayer=function(K,pt,Ct){Ct===void 0&&(Ct={}),this._checkLoaded();var Yt=K.id;if(this.getLayer(Yt)){this.fire(new t.ErrorEvent(new Error('Layer with id "'+Yt+'" already exists on this map')));return}var ce;if(K.type==="custom"){if(Zs(this,t.validateCustomStyleLayer(K)))return;ce=t.createStyleLayer(K)}else{if(typeof K.source=="object"&&(this.addSource(Yt,K.source),K=t.clone$1(K),K=t.extend(K,{source:Yt})),this._validate(t.validateStyle.layer,"layers."+Yt,K,{arrayIndex:-1},Ct))return;ce=t.createStyleLayer(K),this._validateLayer(ce),ce.setEventedParent(this,{layer:{id:Yt}}),this._serializedLayers[ce.id]=ce.serialize()}var re=pt?this._order.indexOf(pt):this._order.length;if(pt&&re===-1){this.fire(new t.ErrorEvent(new Error('Layer with id "'+pt+'" does not exist on this map.')));return}if(this._order.splice(re,0,Yt),this._layerOrderChanged=!0,this._layers[Yt]=ce,this._removedLayers[Yt]&&ce.source&&ce.type!=="custom"){var ye=this._removedLayers[Yt];delete this._removedLayers[Yt],ye.type!==ce.type?this._updatedSources[ce.source]="clear":(this._updatedSources[ce.source]="reload",this.sourceCaches[ce.source].pause())}this._updateLayer(ce),ce.onAdd&&ce.onAdd(this.map)},et.prototype.moveLayer=function(K,pt){this._checkLoaded(),this._changed=!0;var Ct=this._layers[K];if(!Ct){this.fire(new t.ErrorEvent(new Error("The layer '"+K+"' does not exist in the map's style and cannot be moved.")));return}if(K!==pt){var Yt=this._order.indexOf(K);this._order.splice(Yt,1);var ce=pt?this._order.indexOf(pt):this._order.length;if(pt&&ce===-1){this.fire(new t.ErrorEvent(new Error('Layer with id "'+pt+'" does not exist on this map.')));return}this._order.splice(ce,0,K),this._layerOrderChanged=!0}},et.prototype.removeLayer=function(K){this._checkLoaded();var pt=this._layers[K];if(!pt){this.fire(new t.ErrorEvent(new Error("The layer '"+K+"' does not exist in the map's style and cannot be removed.")));return}pt.setEventedParent(null);var Ct=this._order.indexOf(K);this._order.splice(Ct,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[K]=pt,delete this._layers[K],delete this._serializedLayers[K],delete this._updatedLayers[K],delete this._updatedPaintProps[K],pt.onRemove&&pt.onRemove(this.map)},et.prototype.getLayer=function(K){return this._layers[K]},et.prototype.hasLayer=function(K){return K in this._layers},et.prototype.setLayerZoomRange=function(K,pt,Ct){this._checkLoaded();var Yt=this.getLayer(K);if(!Yt){this.fire(new t.ErrorEvent(new Error("The layer '"+K+"' does not exist in the map's style and cannot have zoom extent.")));return}Yt.minzoom===pt&&Yt.maxzoom===Ct||(pt!=null&&(Yt.minzoom=pt),Ct!=null&&(Yt.maxzoom=Ct),this._updateLayer(Yt))},et.prototype.setFilter=function(K,pt,Ct){Ct===void 0&&(Ct={}),this._checkLoaded();var Yt=this.getLayer(K);if(!Yt){this.fire(new t.ErrorEvent(new Error("The layer '"+K+"' does not exist in the map's style and cannot be filtered.")));return}if(!t.deepEqual(Yt.filter,pt)){if(pt==null){Yt.filter=void 0,this._updateLayer(Yt);return}this._validate(t.validateStyle.filter,"layers."+Yt.id+".filter",pt,null,Ct)||(Yt.filter=t.clone$1(pt),this._updateLayer(Yt))}},et.prototype.getFilter=function(K){return t.clone$1(this.getLayer(K).filter)},et.prototype.setLayoutProperty=function(K,pt,Ct,Yt){Yt===void 0&&(Yt={}),this._checkLoaded();var ce=this.getLayer(K);if(!ce){this.fire(new t.ErrorEvent(new Error("The layer '"+K+"' does not exist in the map's style and cannot be styled.")));return}t.deepEqual(ce.getLayoutProperty(pt),Ct)||(ce.setLayoutProperty(pt,Ct,Yt),this._updateLayer(ce))},et.prototype.getLayoutProperty=function(K,pt){var Ct=this.getLayer(K);if(!Ct){this.fire(new t.ErrorEvent(new Error("The layer '"+K+"' does not exist in the map's style.")));return}return Ct.getLayoutProperty(pt)},et.prototype.setPaintProperty=function(K,pt,Ct,Yt){Yt===void 0&&(Yt={}),this._checkLoaded();var ce=this.getLayer(K);if(!ce){this.fire(new t.ErrorEvent(new Error("The layer '"+K+"' does not exist in the map's style and cannot be styled.")));return}if(!t.deepEqual(ce.getPaintProperty(pt),Ct)){var re=ce.setPaintProperty(pt,Ct,Yt);re&&this._updateLayer(ce),this._changed=!0,this._updatedPaintProps[K]=!0}},et.prototype.getPaintProperty=function(K,pt){return this.getLayer(K).getPaintProperty(pt)},et.prototype.setFeatureState=function(K,pt){this._checkLoaded();var Ct=K.source,Yt=K.sourceLayer,ce=this.sourceCaches[Ct];if(ce===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+Ct+"' does not exist in the map's style.")));return}var re=ce.getSource().type;if(re==="geojson"&&Yt){this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(re==="vector"&&!Yt){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}K.id===void 0&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),ce.setFeatureState(Yt,K.id,pt)},et.prototype.removeFeatureState=function(K,pt){this._checkLoaded();var Ct=K.source,Yt=this.sourceCaches[Ct];if(Yt===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+Ct+"' does not exist in the map's style.")));return}var ce=Yt.getSource().type,re=ce==="vector"?K.sourceLayer:void 0;if(ce==="vector"&&!re){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(pt&&typeof K.id!="string"&&typeof K.id!="number"){this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}Yt.removeFeatureState(re,K.id,pt)},et.prototype.getFeatureState=function(K){this._checkLoaded();var pt=K.source,Ct=K.sourceLayer,Yt=this.sourceCaches[pt];if(Yt===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+pt+"' does not exist in the map's style.")));return}var ce=Yt.getSource().type;if(ce==="vector"&&!Ct){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return K.id===void 0&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),Yt.getFeatureState(Ct,K.id)},et.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},et.prototype.serialize=function(){return t.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:t.mapObject(this.sourceCaches,function(K){return K.serialize()}),layers:this._serializeLayers(this._order)},function(K){return K!==void 0})},et.prototype._updateLayer=function(K){this._updatedLayers[K.id]=!0,K.source&&!this._updatedSources[K.source]&&this.sourceCaches[K.source].getSource().type!=="raster"&&(this._updatedSources[K.source]="reload",this.sourceCaches[K.source].pause()),this._changed=!0},et.prototype._flattenAndSortRenderedFeatures=function(K){for(var pt=this,Ct=function(pa){return pt._layers[pa].type==="fill-extrusion"},Yt={},ce=[],re=this._order.length-1;re>=0;re--){var ye=this._order[re];if(Ct(ye)){Yt[ye]=re;for(var Le=0,tr=K;Le<tr.length;Le+=1){var $e=tr[Le],er=$e[ye];if(er)for(var pr=0,wr=er;pr<wr.length;pr+=1){var rr=wr[pr];ce.push(rr)}}}}ce.sort(function(pa,Ua){return Ua.intersectionZ-pa.intersectionZ});for(var cr=[],hr=this._order.length-1;hr>=0;hr--){var Vr=this._order[hr];if(Ct(Vr))for(var yn=ce.length-1;yn>=0;yn--){var wn=ce[yn].feature;if(Yt[wn.layer.id]<hr)break;cr.push(wn),ce.pop()}else for(var $n=0,Xn=K;$n<Xn.length;$n+=1){var Vn=Xn[$n],ca=Vn[Vr];if(ca)for(var ea=0,wa=ca;ea<wa.length;ea+=1){var da=wa[ea];cr.push(da.feature)}}}return cr},et.prototype.queryRenderedFeatures=function(K,pt,Ct){pt&&pt.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",pt.filter,null,pt);var Yt={};if(pt&&pt.layers){if(!Array.isArray(pt.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var ce=0,re=pt.layers;ce<re.length;ce+=1){var ye=re[ce],Le=this._layers[ye];if(!Le)return this.fire(new t.ErrorEvent(new Error("The layer '"+ye+"' does not exist in the map's style and cannot be queried for features."))),[];Yt[Le.source]=!0}}var tr=[];pt.availableImages=this._availableImages;for(var $e in this.sourceCaches)pt.layers&&!Yt[$e]||tr.push(it(this.sourceCaches[$e],this._layers,this._serializedLayers,K,pt,Ct));return this.placement&&tr.push(dt(this._layers,this._serializedLayers,this.sourceCaches,K,pt,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(tr)},et.prototype.querySourceFeatures=function(K,pt){pt&&pt.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",pt.filter,null,pt);var Ct=this.sourceCaches[K];return Ct?wt(Ct,pt):[]},et.prototype.addSourceType=function(K,pt,Ct){if(et.getSourceType(K))return Ct(new Error('A source type called "'+K+'" already exists.'));if(et.setSourceType(K,pt),!pt.workerSourceURL)return Ct(null,null);this.dispatcher.broadcast("loadWorkerSource",{name:K,url:pt.workerSourceURL},Ct)},et.prototype.getLight=function(){return this.light.getLight()},et.prototype.setLight=function(K,pt){pt===void 0&&(pt={}),this._checkLoaded();var Ct=this.light.getLight(),Yt=!1;for(var ce in K)if(!t.deepEqual(K[ce],Ct[ce])){Yt=!0;break}if(Yt){var re={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(K,pt),this.light.updateTransitions(re)}},et.prototype._validate=function(K,pt,Ct,Yt,ce){return ce===void 0&&(ce={}),ce&&ce.validate===!1?!1:Zs(this,K.call(t.validateStyle,t.extend({key:pt,style:this.serialize(),value:Ct,styleSpec:t.styleSpec},Yt)))},et.prototype._remove=function(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(var K in this._layers){var pt=this._layers[K];pt.setEventedParent(null)}for(var Ct in this.sourceCaches)this.sourceCaches[Ct].clearTiles(),this.sourceCaches[Ct].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},et.prototype._clearSource=function(K){this.sourceCaches[K].clearTiles()},et.prototype._reloadSource=function(K){this.sourceCaches[K].resume(),this.sourceCaches[K].reload()},et.prototype._updateSources=function(K){for(var pt in this.sourceCaches)this.sourceCaches[pt].update(K)},et.prototype._generateCollisionBoxes=function(){for(var K in this.sourceCaches)this._reloadSource(K)},et.prototype._updatePlacement=function(K,pt,Ct,Yt,ce){ce===void 0&&(ce=!1);for(var re=!1,ye=!1,Le={},tr=0,$e=this._order;tr<$e.length;tr+=1){var er=$e[tr],pr=this._layers[er];if(pr.type==="symbol"){if(!Le[pr.source]){var wr=this.sourceCaches[pr.source];Le[pr.source]=wr.getRenderableIds(!0).map(function($n){return wr.getTileByID($n)}).sort(function($n,Xn){return Xn.tileID.overscaledZ-$n.tileID.overscaledZ||($n.tileID.isLessThan(Xn.tileID)?-1:1)})}var rr=this.crossTileSymbolIndex.addLayer(pr,Le[pr.source],K.center.lng);re=re||rr}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),ce=ce||this._layerOrderChanged||Ct===0,(ce||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),K.zoom))&&(this.pauseablePlacement=new Bi(K,this._order,ce,pt,Ct,Yt,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Le),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),ye=!0),re&&this.pauseablePlacement.placement.setStale()),ye||re)for(var cr=0,hr=this._order;cr<hr.length;cr+=1){var Vr=hr[cr],yn=this._layers[Vr];yn.type==="symbol"&&this.placement.updateLayerOpacities(yn,Le[yn.source])}var wn=!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now());return wn},et.prototype._releaseSymbolFadeTiles=function(){for(var K in this.sourceCaches)this.sourceCaches[K].releaseSymbolFadeTiles()},et.prototype.getImages=function(K,pt,Ct){this.imageManager.getImages(pt.icons,Ct),this._updateTilesForChangedImages();var Yt=this.sourceCaches[pt.source];Yt&&Yt.setDependencies(pt.tileID.key,pt.type,pt.icons)},et.prototype.getGlyphs=function(K,pt,Ct){this.glyphManager.getGlyphs(pt.stacks,Ct)},et.prototype.getResource=function(K,pt,Ct){return t.makeRequest(pt,Ct)},et}(t.Evented);El.getSourceType=nt,El.setSourceType=Y,El.registerForPluginStateChange=t.registerForPluginStateChange;var Wu=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),Mu=`#ifdef GL_ES
|
||
precision mediump float;
|
||
#else
|
||
#if !defined(lowp)
|
||
#define lowp
|
||
#endif
|
||
#if !defined(mediump)
|
||
#define mediump
|
||
#endif
|
||
#if !defined(highp)
|
||
#define highp
|
||
#endif
|
||
#endif`,Fu=`#ifdef GL_ES
|
||
precision highp float;
|
||
#else
|
||
#if !defined(lowp)
|
||
#define lowp
|
||
#endif
|
||
#if !defined(mediump)
|
||
#define mediump
|
||
#endif
|
||
#if !defined(highp)
|
||
#define highp
|
||
#endif
|
||
#endif
|
||
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
|
||
);}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;}`,_h=`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,ih="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}",ns=`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;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,du="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);}",Ic=`varying vec3 v_data;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define mediump float radius
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define highp vec4 stroke_color
|
||
#pragma mapbox: define mediump float stroke_width
|
||
#pragma mapbox: define lowp float stroke_opacity
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize mediump float radius
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize highp vec4 stroke_color
|
||
#pragma mapbox: initialize mediump float stroke_width
|
||
#pragma mapbox: initialize lowp float stroke_opacity
|
||
vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,ll=`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;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define mediump float radius
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define highp vec4 stroke_color
|
||
#pragma mapbox: define mediump float stroke_width
|
||
#pragma mapbox: define lowp float stroke_opacity
|
||
void main(void) {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize mediump float radius
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize highp vec4 stroke_color
|
||
#pragma mapbox: initialize mediump float stroke_width
|
||
#pragma mapbox: initialize lowp float stroke_opacity
|
||
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);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,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,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);}`,el="void main() {gl_FragColor=vec4(1.0);}",ul="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}",Zu=`uniform highp float u_intensity;varying vec2 v_extrude;
|
||
#pragma mapbox: define highp float weight
|
||
#define GAUSS_COEF 0.3989422804014327
|
||
void main() {
|
||
#pragma mapbox: initialize highp float weight
|
||
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,ys=`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;
|
||
#pragma mapbox: define highp float weight
|
||
#pragma mapbox: define mediump float radius
|
||
const highp float ZERO=1.0/255.0/16.0;
|
||
#define GAUSS_COEF 0.3989422804014327
|
||
void main(void) {
|
||
#pragma mapbox: initialize highp float weight
|
||
#pragma mapbox: initialize mediump float radius
|
||
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`,pl=`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;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(0.0);
|
||
#endif
|
||
}`,$o="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;}",ks="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;}}",Bu="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,0.0,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;}",Ol="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;}",Xu="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);}",Cs="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);}",zh="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,0,1);}",Mo=`#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
gl_FragColor=color*opacity;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,Oh=`attribute vec2 a_pos;uniform mat4 u_matrix;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
gl_Position=u_matrix*vec4(a_pos,0,1);}`,as=`varying vec2 v_pos;
|
||
#pragma mapbox: define highp vec4 outline_color
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 outline_color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,io=`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
|
||
#pragma mapbox: define highp vec4 outline_color
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 outline_color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`,pc=`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;
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,gu=`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;
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
#pragma mapbox: define lowp float pixel_ratio_from
|
||
#pragma mapbox: define lowp float pixel_ratio_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
#pragma mapbox: initialize lowp float pixel_ratio_from
|
||
#pragma mapbox: initialize lowp float pixel_ratio_to
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`,Pl=`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,Wc=`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;
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
#pragma mapbox: define lowp float pixel_ratio_from
|
||
#pragma mapbox: define lowp float pixel_ratio_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
#pragma mapbox: initialize lowp float pixel_ratio_from
|
||
#pragma mapbox: initialize lowp float pixel_ratio_to
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`,$u=`varying vec4 v_color;void main() {gl_FragColor=v_color;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,dc=`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;varying vec4 v_color;
|
||
#pragma mapbox: define highp float base
|
||
#pragma mapbox: define highp float height
|
||
#pragma mapbox: define highp vec4 color
|
||
void main() {
|
||
#pragma mapbox: initialize highp float base
|
||
#pragma mapbox: initialize highp float height
|
||
#pragma mapbox: initialize highp vec4 color
|
||
vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,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;}`,rl=`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;
|
||
#pragma mapbox: define lowp float base
|
||
#pragma mapbox: define lowp float height
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
#pragma mapbox: define lowp float pixel_ratio_from
|
||
#pragma mapbox: define lowp float pixel_ratio_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float base
|
||
#pragma mapbox: initialize lowp float height
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
#pragma mapbox: initialize lowp float pixel_ratio_from
|
||
#pragma mapbox: initialize lowp float pixel_ratio_to
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,oh=`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;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
||
#pragma mapbox: define lowp float base
|
||
#pragma mapbox: define lowp float height
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
#pragma mapbox: define lowp float pixel_ratio_from
|
||
#pragma mapbox: define lowp float pixel_ratio_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float base
|
||
#pragma mapbox: initialize lowp float height
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
#pragma mapbox: initialize lowp float pixel_ratio_from
|
||
#pragma mapbox: initialize lowp float pixel_ratio_to
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,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
|
||
? a_pos
|
||
: 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;}`,Zc=`#ifdef GL_ES
|
||
precision highp float;
|
||
#endif
|
||
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,Lc="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;}",Ju=`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;
|
||
#define PI 3.141592653589793
|
||
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,Cc="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;}",Xc=`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,mu=`
|
||
#define scale 0.015873016
|
||
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define mediump float gapwidth
|
||
#pragma mapbox: define lowp float offset
|
||
#pragma mapbox: define mediump float width
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump float gapwidth
|
||
#pragma mapbox: initialize lowp float offset
|
||
#pragma mapbox: initialize mediump float width
|
||
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,$c=`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;
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,nc=`
|
||
#define scale 0.015873016
|
||
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define mediump float gapwidth
|
||
#pragma mapbox: define lowp float offset
|
||
#pragma mapbox: define mediump float width
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump float gapwidth
|
||
#pragma mapbox: initialize lowp float offset
|
||
#pragma mapbox: initialize mediump float width
|
||
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,vu=`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
#pragma mapbox: define lowp float pixel_ratio_from
|
||
#pragma mapbox: define lowp float pixel_ratio_to
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
#pragma mapbox: initialize lowp float pixel_ratio_from
|
||
#pragma mapbox: initialize lowp float pixel_ratio_to
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,Gl=`
|
||
#define scale 0.015873016
|
||
#define LINE_DISTANCE_SCALE 2.0
|
||
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp float offset
|
||
#pragma mapbox: define mediump float gapwidth
|
||
#pragma mapbox: define mediump float width
|
||
#pragma mapbox: define lowp float floorwidth
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
#pragma mapbox: define lowp float pixel_ratio_from
|
||
#pragma mapbox: define lowp float pixel_ratio_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize lowp float offset
|
||
#pragma mapbox: initialize mediump float gapwidth
|
||
#pragma mapbox: initialize mediump float width
|
||
#pragma mapbox: initialize lowp float floorwidth
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
#pragma mapbox: initialize lowp float pixel_ratio_from
|
||
#pragma mapbox: initialize lowp float pixel_ratio_to
|
||
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`,yc=`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;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define mediump float width
|
||
#pragma mapbox: define lowp float floorwidth
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump float width
|
||
#pragma mapbox: initialize lowp float floorwidth
|
||
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,Jc=`
|
||
#define scale 0.015873016
|
||
#define LINE_DISTANCE_SCALE 2.0
|
||
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define mediump float gapwidth
|
||
#pragma mapbox: define lowp float offset
|
||
#pragma mapbox: define mediump float width
|
||
#pragma mapbox: define lowp float floorwidth
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump float gapwidth
|
||
#pragma mapbox: initialize lowp float offset
|
||
#pragma mapbox: initialize mediump float width
|
||
#pragma mapbox: initialize lowp float floorwidth
|
||
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`,ps=`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);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,Dc="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;}",Fh=`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float opacity
|
||
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,sh=`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;
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float opacity
|
||
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;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,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
||
camera_to_anchor_distance/u_camera_to_center_distance :
|
||
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,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,0.0,1.0);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),0.0,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;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`,xc=`#define SDF_PX 8.0
|
||
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
|
||
#pragma mapbox: define highp vec4 fill_color
|
||
#pragma mapbox: define highp vec4 halo_color
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp float halo_width
|
||
#pragma mapbox: define lowp float halo_blur
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 fill_color
|
||
#pragma mapbox: initialize highp vec4 halo_color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize lowp float halo_width
|
||
#pragma mapbox: initialize lowp float halo_blur
|
||
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,lh=`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;
|
||
#pragma mapbox: define highp vec4 fill_color
|
||
#pragma mapbox: define highp vec4 halo_color
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp float halo_width
|
||
#pragma mapbox: define lowp float halo_blur
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 fill_color
|
||
#pragma mapbox: initialize highp vec4 halo_color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize lowp float halo_width
|
||
#pragma mapbox: initialize lowp float halo_blur
|
||
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;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,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
||
camera_to_anchor_distance/u_camera_to_center_distance :
|
||
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,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,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`,Wl=`#define SDF_PX 8.0
|
||
#define SDF 1.0
|
||
#define ICON 0.0
|
||
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
|
||
#pragma mapbox: define highp vec4 fill_color
|
||
#pragma mapbox: define highp vec4 halo_color
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp float halo_width
|
||
#pragma mapbox: define lowp float halo_blur
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 fill_color
|
||
#pragma mapbox: initialize highp vec4 halo_color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize lowp float halo_width
|
||
#pragma mapbox: initialize lowp float halo_blur
|
||
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,uh=`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;
|
||
#pragma mapbox: define highp vec4 fill_color
|
||
#pragma mapbox: define highp vec4 halo_color
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp float halo_width
|
||
#pragma mapbox: define lowp float halo_blur
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 fill_color
|
||
#pragma mapbox: initialize highp vec4 halo_color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize lowp float halo_width
|
||
#pragma mapbox: initialize lowp float halo_blur
|
||
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;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,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
||
camera_to_anchor_distance/u_camera_to_center_distance :
|
||
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,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,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,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);}`,Il=Ps(Mu,Fu),Zl=Ps(_h,ih),Ru=Ps(ns,du),Xs=Ps(Ic,ll),Qu=Ps(el,ul),yu=Ps(Zu,ys),Xl=Ps(pl,$o),Ds=Ps(ks,Bu),gc=Ps(Ol,Xu),Su=Ps(Cs,zh),Yu=Ps(Mo,Oh),_c=Ps(as,io),bh=Ps(pc,gu),Zh=Ps(Pl,Wc),ac=Ps($u,dc),bc=Ps(rl,oh),Ll=Ps(Zc,Lc),zc=Ps(Ju,Cc),$l=Ps(Xc,mu),ic=Ps($c,nc),Oc=Ps(vu,Gl),Ku=Ps(yc,Jc),Os=Ps(ps,Dc),Eu=Ps(Fh,sh),Jl=Ps(xc,lh),ch=Ps(Wl,uh);function Ps(W,et){var K=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,pt=et.match(/attribute ([\w]+) ([\w]+)/g),Ct=W.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Yt=et.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ce=Yt?Yt.concat(Ct):Ct,re={};return W=W.replace(K,function(ye,Le,tr,$e,er){return re[er]=!0,Le==="define"?`
|
||
#ifndef HAS_UNIFORM_u_`+er+`
|
||
varying `+tr+" "+$e+" "+er+`;
|
||
#else
|
||
uniform `+tr+" "+$e+" u_"+er+`;
|
||
#endif
|
||
`:`
|
||
#ifdef HAS_UNIFORM_u_`+er+`
|
||
`+tr+" "+$e+" "+er+" = u_"+er+`;
|
||
#endif
|
||
`}),et=et.replace(K,function(ye,Le,tr,$e,er){var pr=$e==="float"?"vec2":"vec4",wr=er.match(/color/)?"color":pr;return re[er]?Le==="define"?`
|
||
#ifndef HAS_UNIFORM_u_`+er+`
|
||
uniform lowp float u_`+er+`_t;
|
||
attribute `+tr+" "+pr+" a_"+er+`;
|
||
varying `+tr+" "+$e+" "+er+`;
|
||
#else
|
||
uniform `+tr+" "+$e+" u_"+er+`;
|
||
#endif
|
||
`:wr==="vec4"?`
|
||
#ifndef HAS_UNIFORM_u_`+er+`
|
||
`+er+" = a_"+er+`;
|
||
#else
|
||
`+tr+" "+$e+" "+er+" = u_"+er+`;
|
||
#endif
|
||
`:`
|
||
#ifndef HAS_UNIFORM_u_`+er+`
|
||
`+er+" = unpack_mix_"+wr+"(a_"+er+", u_"+er+`_t);
|
||
#else
|
||
`+tr+" "+$e+" "+er+" = u_"+er+`;
|
||
#endif
|
||
`:Le==="define"?`
|
||
#ifndef HAS_UNIFORM_u_`+er+`
|
||
uniform lowp float u_`+er+`_t;
|
||
attribute `+tr+" "+pr+" a_"+er+`;
|
||
#else
|
||
uniform `+tr+" "+$e+" u_"+er+`;
|
||
#endif
|
||
`:wr==="vec4"?`
|
||
#ifndef HAS_UNIFORM_u_`+er+`
|
||
`+tr+" "+$e+" "+er+" = a_"+er+`;
|
||
#else
|
||
`+tr+" "+$e+" "+er+" = u_"+er+`;
|
||
#endif
|
||
`:`
|
||
#ifndef HAS_UNIFORM_u_`+er+`
|
||
`+tr+" "+$e+" "+er+" = unpack_mix_"+wr+"(a_"+er+", u_"+er+`_t);
|
||
#else
|
||
`+tr+" "+$e+" "+er+" = u_"+er+`;
|
||
#endif
|
||
`}),{fragmentSource:W,vertexSource:et,staticAttributes:pt,staticUniforms:ce}}var mc=Object.freeze({__proto__:null,prelude:Il,background:Zl,backgroundPattern:Ru,circle:Xs,clippingMask:Qu,heatmap:yu,heatmapTexture:Xl,collisionBox:Ds,collisionCircle:gc,debug:Su,fill:Yu,fillOutline:_c,fillOutlinePattern:bh,fillPattern:Zh,fillExtrusion:ac,fillExtrusionPattern:bc,hillshadePrepare:Ll,hillshade:zc,line:$l,lineGradient:ic,linePattern:Oc,lineSDF:Ku,raster:Os,symbolIcon:Eu,symbolSDF:Jl,symbolTextAndIcon:ch}),ju=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};ju.prototype.bind=function(W,et,K,pt,Ct,Yt,ce,re){this.context=W;for(var ye=this.boundPaintVertexBuffers.length!==pt.length,Le=0;!ye&&Le<pt.length;Le++)this.boundPaintVertexBuffers[Le]!==pt[Le]&&(ye=!0);var tr=!this.vao||this.boundProgram!==et||this.boundLayoutVertexBuffer!==K||ye||this.boundIndexBuffer!==Ct||this.boundVertexOffset!==Yt||this.boundDynamicVertexBuffer!==ce||this.boundDynamicVertexBuffer2!==re;!W.extVertexArrayObject||tr?this.freshBind(et,K,pt,Ct,Yt,ce,re):(W.bindVertexArrayOES.set(this.vao),ce&&ce.bind(),Ct&&Ct.dynamicDraw&&Ct.bind(),re&&re.bind())},ju.prototype.freshBind=function(W,et,K,pt,Ct,Yt,ce){var re,ye=W.numAttributes,Le=this.context,tr=Le.gl;if(Le.extVertexArrayObject)this.vao&&this.destroy(),this.vao=Le.extVertexArrayObject.createVertexArrayOES(),Le.bindVertexArrayOES.set(this.vao),re=0,this.boundProgram=W,this.boundLayoutVertexBuffer=et,this.boundPaintVertexBuffers=K,this.boundIndexBuffer=pt,this.boundVertexOffset=Ct,this.boundDynamicVertexBuffer=Yt,this.boundDynamicVertexBuffer2=ce;else{re=Le.currentNumAttributes||0;for(var $e=ye;$e<re;$e++)tr.disableVertexAttribArray($e)}et.enableAttributes(tr,W);for(var er=0,pr=K;er<pr.length;er+=1){var wr=pr[er];wr.enableAttributes(tr,W)}Yt&&Yt.enableAttributes(tr,W),ce&&ce.enableAttributes(tr,W),et.bind(),et.setVertexAttribPointers(tr,W,Ct);for(var rr=0,cr=K;rr<cr.length;rr+=1){var hr=cr[rr];hr.bind(),hr.setVertexAttribPointers(tr,W,Ct)}Yt&&(Yt.bind(),Yt.setVertexAttribPointers(tr,W,Ct)),pt&&pt.bind(),ce&&(ce.bind(),ce.setVertexAttribPointers(tr,W,Ct)),Le.currentNumAttributes=ye},ju.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};function Ql(W){for(var et=[],K=0;K<W.length;K++)if(W[K]!==null){var pt=W[K].split(" ");et.push(pt.pop())}return et}var oc=function(W,et,K,pt,Ct,Yt){var ce=W.gl;this.program=ce.createProgram();for(var re=Ql(K.staticAttributes),ye=pt?pt.getBinderAttributes():[],Le=re.concat(ye),tr=K.staticUniforms?Ql(K.staticUniforms):[],$e=pt?pt.getBinderUniforms():[],er=tr.concat($e),pr=[],wr=0,rr=er;wr<rr.length;wr+=1){var cr=rr[wr];pr.indexOf(cr)<0&&pr.push(cr)}var hr=pt?pt.defines():[];Yt&&hr.push("#define OVERDRAW_INSPECTOR;");var Vr=hr.concat(Il.fragmentSource,K.fragmentSource).join(`
|
||
`),yn=hr.concat(Il.vertexSource,K.vertexSource).join(`
|
||
`),wn=ce.createShader(ce.FRAGMENT_SHADER);if(ce.isContextLost()){this.failedToCreate=!0;return}ce.shaderSource(wn,Vr),ce.compileShader(wn),ce.attachShader(this.program,wn);var $n=ce.createShader(ce.VERTEX_SHADER);if(ce.isContextLost()){this.failedToCreate=!0;return}ce.shaderSource($n,yn),ce.compileShader($n),ce.attachShader(this.program,$n),this.attributes={};var Xn={};this.numAttributes=Le.length;for(var Vn=0;Vn<this.numAttributes;Vn++)Le[Vn]&&(ce.bindAttribLocation(this.program,Vn,Le[Vn]),this.attributes[Le[Vn]]=Vn);ce.linkProgram(this.program),ce.deleteShader($n),ce.deleteShader(wn);for(var ca=0;ca<pr.length;ca++){var ea=pr[ca];if(ea&&!Xn[ea]){var wa=ce.getUniformLocation(this.program,ea);wa&&(Xn[ea]=wa)}}this.fixedUniforms=Ct(W,Xn),this.binderUniforms=pt?pt.getUniforms(W,Xn):[]};oc.prototype.draw=function(W,et,K,pt,Ct,Yt,ce,re,ye,Le,tr,$e,er,pr,wr,rr){var cr,hr=W.gl;if(!this.failedToCreate){W.program.set(this.program),W.setDepthMode(K),W.setStencilMode(pt),W.setColorMode(Ct),W.setCullFace(Yt);for(var Vr in this.fixedUniforms)this.fixedUniforms[Vr].set(ce[Vr]);pr&&pr.setUniforms(W,this.binderUniforms,$e,{zoom:er});for(var yn=(cr={},cr[hr.LINES]=2,cr[hr.TRIANGLES]=3,cr[hr.LINE_STRIP]=1,cr)[et],wn=0,$n=tr.get();wn<$n.length;wn+=1){var Xn=$n[wn],Vn=Xn.vaos||(Xn.vaos={}),ca=Vn[re]||(Vn[re]=new ju);ca.bind(W,this,ye,pr?pr.getPaintVertexBuffers():[],Le,Xn.vertexOffset,wr,rr),hr.drawElements(et,Xn.primitiveLength*yn,hr.UNSIGNED_SHORT,Xn.primitiveOffset*yn*2)}}};function Nu(W,et,K){var pt=1/Si(K,1,et.transform.tileZoom),Ct=Math.pow(2,K.tileID.overscaledZ),Yt=K.tileSize*Math.pow(2,et.transform.tileZoom)/Ct,ce=Yt*(K.tileID.canonical.x+K.tileID.wrap*Ct),re=Yt*K.tileID.canonical.y;return{u_image:0,u_texsize:K.imageAtlasTexture.size,u_scale:[pt,W.fromScale,W.toScale],u_fade:W.t,u_pixel_coord_upper:[ce>>16,re>>16],u_pixel_coord_lower:[ce&65535,re&65535]}}function vc(W,et,K,pt){var Ct=K.imageManager.getPattern(W.from.toString()),Yt=K.imageManager.getPattern(W.to.toString()),ce=K.imageManager.getPixelSize(),re=ce.width,ye=ce.height,Le=Math.pow(2,pt.tileID.overscaledZ),tr=pt.tileSize*Math.pow(2,K.transform.tileZoom)/Le,$e=tr*(pt.tileID.canonical.x+pt.tileID.wrap*Le),er=tr*pt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Ct.tl,u_pattern_br_a:Ct.br,u_pattern_tl_b:Yt.tl,u_pattern_br_b:Yt.br,u_texsize:[re,ye],u_mix:et.t,u_pattern_size_a:Ct.displaySize,u_pattern_size_b:Yt.displaySize,u_scale_a:et.fromScale,u_scale_b:et.toScale,u_tile_units_to_pixels:1/Si(pt,1,K.transform.tileZoom),u_pixel_coord_upper:[$e>>16,er>>16],u_pixel_coord_lower:[$e&65535,er&65535]}}var wh=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_lightpos:new t.Uniform3f(W,et.u_lightpos),u_lightintensity:new t.Uniform1f(W,et.u_lightintensity),u_lightcolor:new t.Uniform3f(W,et.u_lightcolor),u_vertical_gradient:new t.Uniform1f(W,et.u_vertical_gradient),u_opacity:new t.Uniform1f(W,et.u_opacity)}},cl=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_lightpos:new t.Uniform3f(W,et.u_lightpos),u_lightintensity:new t.Uniform1f(W,et.u_lightintensity),u_lightcolor:new t.Uniform3f(W,et.u_lightcolor),u_vertical_gradient:new t.Uniform1f(W,et.u_vertical_gradient),u_height_factor:new t.Uniform1f(W,et.u_height_factor),u_image:new t.Uniform1i(W,et.u_image),u_texsize:new t.Uniform2f(W,et.u_texsize),u_pixel_coord_upper:new t.Uniform2f(W,et.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(W,et.u_pixel_coord_lower),u_scale:new t.Uniform3f(W,et.u_scale),u_fade:new t.Uniform1f(W,et.u_fade),u_opacity:new t.Uniform1f(W,et.u_opacity)}},Qc=function(W,et,K,pt){var Ct=et.style.light,Yt=Ct.properties.get("position"),ce=[Yt.x,Yt.y,Yt.z],re=t.create$1();Ct.properties.get("anchor")==="viewport"&&t.fromRotation(re,-et.transform.angle),t.transformMat3(ce,ce,re);var ye=Ct.properties.get("color");return{u_matrix:W,u_lightpos:ce,u_lightintensity:Ct.properties.get("intensity"),u_lightcolor:[ye.r,ye.g,ye.b],u_vertical_gradient:+K,u_opacity:pt}},Yl=function(W,et,K,pt,Ct,Yt,ce){return t.extend(Qc(W,et,K,pt),Nu(Yt,et,ce),{u_height_factor:-Math.pow(2,Ct.overscaledZ)/ce.tileSize/8})},Pu=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix)}},xu=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_image:new t.Uniform1i(W,et.u_image),u_texsize:new t.Uniform2f(W,et.u_texsize),u_pixel_coord_upper:new t.Uniform2f(W,et.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(W,et.u_pixel_coord_lower),u_scale:new t.Uniform3f(W,et.u_scale),u_fade:new t.Uniform1f(W,et.u_fade)}},Vs=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_world:new t.Uniform2f(W,et.u_world)}},qs=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_world:new t.Uniform2f(W,et.u_world),u_image:new t.Uniform1i(W,et.u_image),u_texsize:new t.Uniform2f(W,et.u_texsize),u_pixel_coord_upper:new t.Uniform2f(W,et.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(W,et.u_pixel_coord_lower),u_scale:new t.Uniform3f(W,et.u_scale),u_fade:new t.Uniform1f(W,et.u_fade)}},Iu=function(W){return{u_matrix:W}},sc=function(W,et,K,pt){return t.extend(Iu(W),Nu(K,et,pt))},_u=function(W,et){return{u_matrix:W,u_world:et}},wc=function(W,et,K,pt,Ct){return t.extend(sc(W,et,K,pt),{u_world:Ct})},Ve=function(W,et){return{u_camera_to_center_distance:new t.Uniform1f(W,et.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(W,et.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(W,et.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(W,et.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(W,et.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(W,et.u_matrix)}},lr=function(W,et,K,pt){var Ct=W.transform,Yt,ce;if(pt.paint.get("circle-pitch-alignment")==="map"){var re=Si(K,1,Ct.zoom);Yt=!0,ce=[re,re]}else Yt=!1,ce=Ct.pixelsToGLUnits;return{u_camera_to_center_distance:Ct.cameraToCenterDistance,u_scale_with_map:+(pt.paint.get("circle-pitch-scale")==="map"),u_matrix:W.translatePosMatrix(et.posMatrix,K,pt.paint.get("circle-translate"),pt.paint.get("circle-translate-anchor")),u_pitch_with_map:+Yt,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:ce}},Ur=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_camera_to_center_distance:new t.Uniform1f(W,et.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(W,et.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(W,et.u_extrude_scale),u_overscale_factor:new t.Uniform1f(W,et.u_overscale_factor)}},Or=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_inv_matrix:new t.UniformMatrix4f(W,et.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(W,et.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(W,et.u_viewport_size)}},un=function(W,et,K){var pt=Si(K,1,et.zoom),Ct=Math.pow(2,et.zoom-K.tileID.overscaledZ),Yt=K.tileID.overscaleFactor();return{u_matrix:W,u_camera_to_center_distance:et.cameraToCenterDistance,u_pixels_to_tile_units:pt,u_extrude_scale:[et.pixelsToGLUnits[0]/(pt*Ct),et.pixelsToGLUnits[1]/(pt*Ct)],u_overscale_factor:Yt}},Ln=function(W,et,K){return{u_matrix:W,u_inv_matrix:et,u_camera_to_center_distance:K.cameraToCenterDistance,u_viewport_size:[K.width,K.height]}},Gn=function(W,et){return{u_color:new t.UniformColor(W,et.u_color),u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_overlay:new t.Uniform1i(W,et.u_overlay),u_overlay_scale:new t.Uniform1f(W,et.u_overlay_scale)}},oa=function(W,et,K){return K===void 0&&(K=1),{u_matrix:W,u_color:et,u_overlay:0,u_overlay_scale:K}},ya=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix)}},Pa=function(W){return{u_matrix:W}},Jn=function(W,et){return{u_extrude_scale:new t.Uniform1f(W,et.u_extrude_scale),u_intensity:new t.Uniform1f(W,et.u_intensity),u_matrix:new t.UniformMatrix4f(W,et.u_matrix)}},va=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_world:new t.Uniform2f(W,et.u_world),u_image:new t.Uniform1i(W,et.u_image),u_color_ramp:new t.Uniform1i(W,et.u_color_ramp),u_opacity:new t.Uniform1f(W,et.u_opacity)}},sa=function(W,et,K,pt){return{u_matrix:W,u_extrude_scale:Si(et,1,K),u_intensity:pt}},qn=function(W,et,K,pt){var Ct=t.create();t.ortho(Ct,0,W.width,W.height,0,0,1);var Yt=W.context.gl;return{u_matrix:Ct,u_world:[Yt.drawingBufferWidth,Yt.drawingBufferHeight],u_image:K,u_color_ramp:pt,u_opacity:et.paint.get("heatmap-opacity")}},Fa=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_image:new t.Uniform1i(W,et.u_image),u_latrange:new t.Uniform2f(W,et.u_latrange),u_light:new t.Uniform2f(W,et.u_light),u_shadow:new t.UniformColor(W,et.u_shadow),u_highlight:new t.UniformColor(W,et.u_highlight),u_accent:new t.UniformColor(W,et.u_accent)}},Fi=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_image:new t.Uniform1i(W,et.u_image),u_dimension:new t.Uniform2f(W,et.u_dimension),u_zoom:new t.Uniform1f(W,et.u_zoom),u_unpack:new t.Uniform4f(W,et.u_unpack)}},Ei=function(W,et,K){var pt=K.paint.get("hillshade-shadow-color"),Ct=K.paint.get("hillshade-highlight-color"),Yt=K.paint.get("hillshade-accent-color"),ce=K.paint.get("hillshade-illumination-direction")*(Math.PI/180);K.paint.get("hillshade-illumination-anchor")==="viewport"&&(ce-=W.transform.angle);var re=!W.options.moving;return{u_matrix:W.transform.calculatePosMatrix(et.tileID.toUnwrapped(),re),u_image:0,u_latrange:Hi(W,et.tileID),u_light:[K.paint.get("hillshade-exaggeration"),ce],u_shadow:pt,u_highlight:Ct,u_accent:Yt}},Ni=function(W,et){var K=et.stride,pt=t.create();return t.ortho(pt,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(pt,pt,[0,-t.EXTENT,0]),{u_matrix:pt,u_image:1,u_dimension:[K,K],u_zoom:W.overscaledZ,u_unpack:et.getUnpackVector()}};function Hi(W,et){var K=Math.pow(2,et.canonical.z),pt=et.canonical.y;return[new t.MercatorCoordinate(0,pt/K).toLngLat().lat,new t.MercatorCoordinate(0,(pt+1)/K).toLngLat().lat]}var Ba=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_ratio:new t.Uniform1f(W,et.u_ratio),u_device_pixel_ratio:new t.Uniform1f(W,et.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(W,et.u_units_to_pixels)}},ba=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_ratio:new t.Uniform1f(W,et.u_ratio),u_device_pixel_ratio:new t.Uniform1f(W,et.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(W,et.u_units_to_pixels),u_image:new t.Uniform1i(W,et.u_image),u_image_height:new t.Uniform1f(W,et.u_image_height)}},$i=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_texsize:new t.Uniform2f(W,et.u_texsize),u_ratio:new t.Uniform1f(W,et.u_ratio),u_device_pixel_ratio:new t.Uniform1f(W,et.u_device_pixel_ratio),u_image:new t.Uniform1i(W,et.u_image),u_units_to_pixels:new t.Uniform2f(W,et.u_units_to_pixels),u_scale:new t.Uniform3f(W,et.u_scale),u_fade:new t.Uniform1f(W,et.u_fade)}},So=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_ratio:new t.Uniform1f(W,et.u_ratio),u_device_pixel_ratio:new t.Uniform1f(W,et.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(W,et.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(W,et.u_patternscale_a),u_patternscale_b:new t.Uniform2f(W,et.u_patternscale_b),u_sdfgamma:new t.Uniform1f(W,et.u_sdfgamma),u_image:new t.Uniform1i(W,et.u_image),u_tex_y_a:new t.Uniform1f(W,et.u_tex_y_a),u_tex_y_b:new t.Uniform1f(W,et.u_tex_y_b),u_mix:new t.Uniform1f(W,et.u_mix)}},Jo=function(W,et,K){var pt=W.transform;return{u_matrix:Qs(W,et,K),u_ratio:1/Si(et,1,pt.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/pt.pixelsToGLUnits[0],1/pt.pixelsToGLUnits[1]]}},As=function(W,et,K,pt){return t.extend(Jo(W,et,K),{u_image:0,u_image_height:pt})},os=function(W,et,K,pt){var Ct=W.transform,Yt=No(et,Ct);return{u_matrix:Qs(W,et,K),u_texsize:et.imageAtlasTexture.size,u_ratio:1/Si(et,1,Ct.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[Yt,pt.fromScale,pt.toScale],u_fade:pt.t,u_units_to_pixels:[1/Ct.pixelsToGLUnits[0],1/Ct.pixelsToGLUnits[1]]}},xs=function(W,et,K,pt,Ct){var Yt=W.transform,ce=W.lineAtlas,re=No(et,Yt),ye=K.layout.get("line-cap")==="round",Le=ce.getDash(pt.from,ye),tr=ce.getDash(pt.to,ye),$e=Le.width*Ct.fromScale,er=tr.width*Ct.toScale;return t.extend(Jo(W,et,K),{u_patternscale_a:[re/$e,-Le.height/2],u_patternscale_b:[re/er,-tr.height/2],u_sdfgamma:ce.width/(Math.min($e,er)*256*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:Le.y,u_tex_y_b:tr.y,u_mix:Ct.t})};function No(W,et){return 1/Si(W,1,et.tileZoom)}function Qs(W,et,K){return W.translatePosMatrix(et.tileID.posMatrix,et,K.paint.get("line-translate"),K.paint.get("line-translate-anchor"))}var Hs=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_tl_parent:new t.Uniform2f(W,et.u_tl_parent),u_scale_parent:new t.Uniform1f(W,et.u_scale_parent),u_buffer_scale:new t.Uniform1f(W,et.u_buffer_scale),u_fade_t:new t.Uniform1f(W,et.u_fade_t),u_opacity:new t.Uniform1f(W,et.u_opacity),u_image0:new t.Uniform1i(W,et.u_image0),u_image1:new t.Uniform1i(W,et.u_image1),u_brightness_low:new t.Uniform1f(W,et.u_brightness_low),u_brightness_high:new t.Uniform1f(W,et.u_brightness_high),u_saturation_factor:new t.Uniform1f(W,et.u_saturation_factor),u_contrast_factor:new t.Uniform1f(W,et.u_contrast_factor),u_spin_weights:new t.Uniform3f(W,et.u_spin_weights)}},Ms=function(W,et,K,pt,Ct){return{u_matrix:W,u_tl_parent:et,u_scale_parent:K,u_buffer_scale:1,u_fade_t:pt.mix,u_opacity:pt.opacity*Ct.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Ct.paint.get("raster-brightness-min"),u_brightness_high:Ct.paint.get("raster-brightness-max"),u_saturation_factor:ds(Ct.paint.get("raster-saturation")),u_contrast_factor:to(Ct.paint.get("raster-contrast")),u_spin_weights:ni(Ct.paint.get("raster-hue-rotate"))}};function ni(W){W*=Math.PI/180;var et=Math.sin(W),K=Math.cos(W);return[(2*K+1)/3,(-Math.sqrt(3)*et-K+1)/3,(Math.sqrt(3)*et-K+1)/3]}function to(W){return W>0?1/(1-W):1+W}function ds(W){return W>0?1-1/(1.001-W):-W}var Qo=function(W,et){return{u_is_size_zoom_constant:new t.Uniform1i(W,et.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(W,et.u_is_size_feature_constant),u_size_t:new t.Uniform1f(W,et.u_size_t),u_size:new t.Uniform1f(W,et.u_size),u_camera_to_center_distance:new t.Uniform1f(W,et.u_camera_to_center_distance),u_pitch:new t.Uniform1f(W,et.u_pitch),u_rotate_symbol:new t.Uniform1i(W,et.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(W,et.u_aspect_ratio),u_fade_change:new t.Uniform1f(W,et.u_fade_change),u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(W,et.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(W,et.u_coord_matrix),u_is_text:new t.Uniform1i(W,et.u_is_text),u_pitch_with_map:new t.Uniform1i(W,et.u_pitch_with_map),u_texsize:new t.Uniform2f(W,et.u_texsize),u_texture:new t.Uniform1i(W,et.u_texture)}},Tl=function(W,et){return{u_is_size_zoom_constant:new t.Uniform1i(W,et.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(W,et.u_is_size_feature_constant),u_size_t:new t.Uniform1f(W,et.u_size_t),u_size:new t.Uniform1f(W,et.u_size),u_camera_to_center_distance:new t.Uniform1f(W,et.u_camera_to_center_distance),u_pitch:new t.Uniform1f(W,et.u_pitch),u_rotate_symbol:new t.Uniform1i(W,et.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(W,et.u_aspect_ratio),u_fade_change:new t.Uniform1f(W,et.u_fade_change),u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(W,et.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(W,et.u_coord_matrix),u_is_text:new t.Uniform1i(W,et.u_is_text),u_pitch_with_map:new t.Uniform1i(W,et.u_pitch_with_map),u_texsize:new t.Uniform2f(W,et.u_texsize),u_texture:new t.Uniform1i(W,et.u_texture),u_gamma_scale:new t.Uniform1f(W,et.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(W,et.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(W,et.u_is_halo)}},Kl=function(W,et){return{u_is_size_zoom_constant:new t.Uniform1i(W,et.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(W,et.u_is_size_feature_constant),u_size_t:new t.Uniform1f(W,et.u_size_t),u_size:new t.Uniform1f(W,et.u_size),u_camera_to_center_distance:new t.Uniform1f(W,et.u_camera_to_center_distance),u_pitch:new t.Uniform1f(W,et.u_pitch),u_rotate_symbol:new t.Uniform1i(W,et.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(W,et.u_aspect_ratio),u_fade_change:new t.Uniform1f(W,et.u_fade_change),u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(W,et.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(W,et.u_coord_matrix),u_is_text:new t.Uniform1i(W,et.u_is_text),u_pitch_with_map:new t.Uniform1i(W,et.u_pitch_with_map),u_texsize:new t.Uniform2f(W,et.u_texsize),u_texsize_icon:new t.Uniform2f(W,et.u_texsize_icon),u_texture:new t.Uniform1i(W,et.u_texture),u_texture_icon:new t.Uniform1i(W,et.u_texture_icon),u_gamma_scale:new t.Uniform1f(W,et.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(W,et.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(W,et.u_is_halo)}},Fl=function(W,et,K,pt,Ct,Yt,ce,re,ye,Le){var tr=Ct.transform;return{u_is_size_zoom_constant:+(W==="constant"||W==="source"),u_is_size_feature_constant:+(W==="constant"||W==="camera"),u_size_t:et?et.uSizeT:0,u_size:et?et.uSize:0,u_camera_to_center_distance:tr.cameraToCenterDistance,u_pitch:tr.pitch/360*2*Math.PI,u_rotate_symbol:+K,u_aspect_ratio:tr.width/tr.height,u_fade_change:Ct.options.fadeDuration?Ct.symbolFadeChange:1,u_matrix:Yt,u_label_plane_matrix:ce,u_coord_matrix:re,u_is_text:+ye,u_pitch_with_map:+pt,u_texsize:Le,u_texture:0}},tc=function(W,et,K,pt,Ct,Yt,ce,re,ye,Le,tr){var $e=Ct.transform;return t.extend(Fl(W,et,K,pt,Ct,Yt,ce,re,ye,Le),{u_gamma_scale:pt?Math.cos($e._pitch)*$e.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+tr})},tu=function(W,et,K,pt,Ct,Yt,ce,re,ye,Le){return t.extend(tc(W,et,K,pt,Ct,Yt,ce,re,!0,ye,!0),{u_texsize_icon:Le,u_texture_icon:1})},Uu=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_opacity:new t.Uniform1f(W,et.u_opacity),u_color:new t.UniformColor(W,et.u_color)}},$s=function(W,et){return{u_matrix:new t.UniformMatrix4f(W,et.u_matrix),u_opacity:new t.Uniform1f(W,et.u_opacity),u_image:new t.Uniform1i(W,et.u_image),u_pattern_tl_a:new t.Uniform2f(W,et.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(W,et.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(W,et.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(W,et.u_pattern_br_b),u_texsize:new t.Uniform2f(W,et.u_texsize),u_mix:new t.Uniform1f(W,et.u_mix),u_pattern_size_a:new t.Uniform2f(W,et.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(W,et.u_pattern_size_b),u_scale_a:new t.Uniform1f(W,et.u_scale_a),u_scale_b:new t.Uniform1f(W,et.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(W,et.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(W,et.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(W,et.u_tile_units_to_pixels)}},ec=function(W,et,K){return{u_matrix:W,u_opacity:et,u_color:K}},Ri=function(W,et,K,pt,Ct,Yt){return t.extend(vc(pt,Yt,K,Ct),{u_matrix:W,u_opacity:et})},oo={fillExtrusion:wh,fillExtrusionPattern:cl,fill:Pu,fillPattern:xu,fillOutline:Vs,fillOutlinePattern:qs,circle:Ve,collisionBox:Ur,collisionCircle:Or,debug:Gn,clippingMask:ya,heatmap:Jn,heatmapTexture:va,hillshade:Fa,hillshadePrepare:Fi,line:Ba,lineGradient:ba,linePattern:$i,lineSDF:So,raster:Hs,symbolIcon:Qo,symbolSDF:Tl,symbolTextAndIcon:Kl,background:Uu,backgroundPattern:$s},bu;function Cl(W,et,K,pt,Ct,Yt,ce){for(var re=W.context,ye=re.gl,Le=W.useProgram("collisionBox"),tr=[],$e=0,er=0,pr=0;pr<pt.length;pr++){var wr=pt[pr],rr=et.getTile(wr),cr=rr.getBucket(K);if(cr){var hr=wr.posMatrix;(Ct[0]!==0||Ct[1]!==0)&&(hr=W.translatePosMatrix(wr.posMatrix,rr,Ct,Yt));var Vr=ce?cr.textCollisionBox:cr.iconCollisionBox,yn=cr.collisionCircleArray;if(yn.length>0){var wn=t.create(),$n=hr;t.mul(wn,cr.placementInvProjMatrix,W.transform.glCoordMatrix),t.mul(wn,wn,cr.placementViewportMatrix),tr.push({circleArray:yn,circleOffset:er,transform:$n,invTransform:wn}),$e+=yn.length/4,er=$e}Vr&&Le.draw(re,ye.LINES,vn.disabled,pn.disabled,W.colorModeForRenderPass(),_r.disabled,un(hr,W.transform,rr),K.id,Vr.layoutVertexBuffer,Vr.indexBuffer,Vr.segments,null,W.transform.zoom,null,null,Vr.collisionVertexBuffer)}}if(!(!ce||!tr.length)){var Xn=W.useProgram("collisionCircle"),Vn=new t.StructArrayLayout2f1f2i16;Vn.resize($e*4),Vn._trim();for(var ca=0,ea=0,wa=tr;ea<wa.length;ea+=1)for(var da=wa[ea],pa=0;pa<da.circleArray.length/4;pa++){var Ua=pa*4,Di=da.circleArray[Ua+0],ui=da.circleArray[Ua+1],ji=da.circleArray[Ua+2],uo=da.circleArray[Ua+3];Vn.emplace(ca++,Di,ui,ji,uo,0),Vn.emplace(ca++,Di,ui,ji,uo,1),Vn.emplace(ca++,Di,ui,ji,uo,2),Vn.emplace(ca++,Di,ui,ji,uo,3)}(!bu||bu.length<$e*2)&&(bu=Th($e));for(var cs=re.createIndexBuffer(bu,!0),Ts=re.createVertexBuffer(Vn,t.collisionCircleLayout.members,!0),is=0,hs=tr;is<hs.length;is+=1){var il=hs[is],eo=Ln(il.transform,il.invTransform,W.transform);Xn.draw(re,ye.TRIANGLES,vn.disabled,pn.disabled,W.colorModeForRenderPass(),_r.disabled,eo,K.id,Ts,cs,t.SegmentVector.simpleSegment(0,il.circleOffset*2,il.circleArray.length,il.circleArray.length/2),null,W.transform.zoom,null,null,null)}Ts.destroy(),cs.destroy()}}function Th(W){var et=W*2,K=new t.StructArrayLayout3ui6;K.resize(et),K._trim();for(var pt=0;pt<et;pt++){var Ct=pt*6;K.uint16[Ct+0]=pt*4+0,K.uint16[Ct+1]=pt*4+1,K.uint16[Ct+2]=pt*4+2,K.uint16[Ct+3]=pt*4+2,K.uint16[Ct+4]=pt*4+3,K.uint16[Ct+5]=pt*4+0}return K}var Lt=t.identity(new Float32Array(16));function P(W,et,K,pt,Ct){if(W.renderPass==="translucent"){var Yt=pn.disabled,ce=W.colorModeForRenderPass(),re=K.layout.get("text-variable-anchor");re&&_t(pt,W,K,et,K.layout.get("text-rotation-alignment"),K.layout.get("text-pitch-alignment"),Ct),K.paint.get("icon-opacity").constantOr(1)!==0&&ie(W,et,K,pt,!1,K.paint.get("icon-translate"),K.paint.get("icon-translate-anchor"),K.layout.get("icon-rotation-alignment"),K.layout.get("icon-pitch-alignment"),K.layout.get("icon-keep-upright"),Yt,ce),K.paint.get("text-opacity").constantOr(1)!==0&&ie(W,et,K,pt,!0,K.paint.get("text-translate"),K.paint.get("text-translate-anchor"),K.layout.get("text-rotation-alignment"),K.layout.get("text-pitch-alignment"),K.layout.get("text-keep-upright"),Yt,ce),et.map.showCollisionBoxes&&(Cl(W,et,K,pt,K.paint.get("text-translate"),K.paint.get("text-translate-anchor"),!0),Cl(W,et,K,pt,K.paint.get("icon-translate"),K.paint.get("icon-translate-anchor"),!1))}}function at(W,et,K,pt,Ct,Yt){var ce=t.getAnchorAlignment(W),re=ce.horizontalAlign,ye=ce.verticalAlign,Le=-(re-.5)*et,tr=-(ye-.5)*K,$e=t.evaluateVariableOffset(W,pt);return new t.Point((Le/Ct+$e[0])*Yt,(tr/Ct+$e[1])*Yt)}function _t(W,et,K,pt,Ct,Yt,ce){for(var re=et.transform,ye=Ct==="map",Le=Yt==="map",tr=0,$e=W;tr<$e.length;tr+=1){var er=$e[tr],pr=pt.getTile(er),wr=pr.getBucket(K);if(!(!wr||!wr.text||!wr.text.segments.get().length)){var rr=wr.textSizeData,cr=t.evaluateSizeForZoom(rr,re.zoom),hr=Si(pr,1,et.transform.zoom),Vr=Tn(er.posMatrix,Le,ye,et.transform,hr),yn=K.layout.get("icon-text-fit")!=="none"&&wr.hasIconData();if(cr){var wn=Math.pow(2,re.zoom-pr.tileID.overscaledZ);Tt(wr,ye,Le,ce,t.symbolSize,re,Vr,er.posMatrix,wn,cr,yn)}}}}function Tt(W,et,K,pt,Ct,Yt,ce,re,ye,Le,tr){var $e=W.text.placedSymbolArray,er=W.text.dynamicLayoutVertexArray,pr=W.icon.dynamicLayoutVertexArray,wr={};er.clear();for(var rr=0;rr<$e.length;rr++){var cr=$e.get(rr),hr=W.allowVerticalPlacement&&!cr.placedOrientation,Vr=!cr.hidden&&cr.crossTileID&&!hr?pt[cr.crossTileID]:null;if(!Vr)Co(cr.numGlyphs,er);else{var yn=new t.Point(cr.anchorX,cr.anchorY),wn=Qn(yn,K?re:ce),$n=Va(Yt.cameraToCenterDistance,wn.signedDistanceFromCamera),Xn=Ct.evaluateSizeForFeature(W.textSizeData,Le,cr)*$n/t.ONE_EM;K&&(Xn*=W.tilePixelRatio/ye);for(var Vn=Vr.width,ca=Vr.height,ea=Vr.anchor,wa=Vr.textOffset,da=Vr.textBoxScale,pa=at(ea,Vn,ca,wa,da,Xn),Ua=K?Qn(yn.add(pa),ce).point:wn.point.add(et?pa.rotate(-Yt.angle):pa),Di=W.allowVerticalPlacement&&cr.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,ui=0;ui<cr.numGlyphs;ui++)t.addDynamicAttributes(er,Ua,Di);tr&&cr.associatedIconIndex>=0&&(wr[cr.associatedIconIndex]={shiftedAnchor:Ua,angle:Di})}}if(tr){pr.clear();for(var ji=W.icon.placedSymbolArray,uo=0;uo<ji.length;uo++){var cs=ji.get(uo);if(cs.hidden)Co(cs.numGlyphs,pr);else{var Ts=wr[uo];if(!Ts)Co(cs.numGlyphs,pr);else for(var is=0;is<cs.numGlyphs;is++)t.addDynamicAttributes(pr,Ts.shiftedAnchor,Ts.angle)}}W.icon.dynamicLayoutVertexBuffer.updateData(pr)}W.text.dynamicLayoutVertexBuffer.updateData(er)}function Pt(W,et,K){return K.iconsInText&&et?"symbolTextAndIcon":W?"symbolSDF":"symbolIcon"}function ie(W,et,K,pt,Ct,Yt,ce,re,ye,Le,tr,$e){for(var er=W.context,pr=er.gl,wr=W.transform,rr=re==="map",cr=ye==="map",hr=rr&&K.layout.get("symbol-placement")!=="point",Vr=rr&&!cr&&!hr,yn=K.layout.get("symbol-sort-key").constantOr(1)!==void 0,wn=!1,$n=W.depthModeForSublayer(0,vn.ReadOnly),Xn=K.layout.get("text-variable-anchor"),Vn=[],ca=0,ea=pt;ca<ea.length;ca+=1){var wa=ea[ca],da=et.getTile(wa),pa=da.getBucket(K);if(pa){var Ua=Ct?pa.text:pa.icon;if(!(!Ua||!Ua.segments.get().length)){var Di=Ua.programConfigurations.get(K.id),ui=Ct||pa.sdfIcons,ji=Ct?pa.textSizeData:pa.iconSizeData,uo=cr||wr.pitch!==0,cs=W.useProgram(Pt(ui,Ct,pa),Di),Ts=t.evaluateSizeForZoom(ji,wr.zoom),is=void 0,hs=[0,0],il=void 0,eo=void 0,Ss=null,Du=void 0;if(Ct){if(il=da.glyphAtlasTexture,eo=pr.LINEAR,is=da.glyphAtlasTexture.size,pa.iconsInText){hs=da.imageAtlasTexture.size,Ss=da.imageAtlasTexture;var uc=ji.kind==="composite"||ji.kind==="camera";Du=uo||W.options.rotating||W.options.zooming||uc?pr.LINEAR:pr.NEAREST}}else{var lf=K.layout.get("icon-size").constantOr(0)!==1||pa.iconsNeedLinear;il=da.imageAtlasTexture,eo=ui||W.options.rotating||W.options.zooming||lf||uo?pr.LINEAR:pr.NEAREST,is=da.imageAtlasTexture.size}var xf=Si(da,1,W.transform.zoom),Xh=Tn(wa.posMatrix,cr,rr,W.transform,xf),$h=ta(wa.posMatrix,cr,rr,W.transform,xf),Tf=Xn&&pa.hasTextData(),kh=K.layout.get("icon-text-fit")!=="none"&&Tf&&pa.hasIconData();hr&&ci(pa,wa.posMatrix,W,Ct,Xh,$h,cr,Le);var Jh=W.translatePosMatrix(wa.posMatrix,da,Yt,ce),hh=hr||Ct&&Xn||kh?Lt:Xh,Of=W.translatePosMatrix($h,da,Yt,ce,!0),lp=ui&&K.paint.get(Ct?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Qh=void 0;ui?pa.iconsInText?Qh=tu(ji.kind,Ts,Vr,cr,W,Jh,hh,Of,is,hs):Qh=tc(ji.kind,Ts,Vr,cr,W,Jh,hh,Of,Ct,is,!0):Qh=Fl(ji.kind,Ts,Vr,cr,W,Jh,hh,Of,Ct,is);var Yh={program:cs,buffers:Ua,uniformValues:Qh,atlasTexture:il,atlasTextureIcon:Ss,atlasInterpolation:eo,atlasInterpolationIcon:Du,isSDF:ui,hasHalo:lp};if(yn&&pa.canOverlap){wn=!0;for(var Ah=Ua.segments.get(),up=0,Mp=Ah;up<Mp.length;up+=1){var cp=Mp[up];Vn.push({segments:new t.SegmentVector([cp]),sortKey:cp.sortKey,state:Yh})}}else Vn.push({segments:Ua.segments,sortKey:0,state:Yh})}}}wn&&Vn.sort(function(Jp,Qp){return Jp.sortKey-Qp.sortKey});for(var Rc=0,Xf=Vn;Rc<Xf.length;Rc+=1){var Sp=Xf[Rc],jc=Sp.state;if(er.activeTexture.set(pr.TEXTURE0),jc.atlasTexture.bind(jc.atlasInterpolation,pr.CLAMP_TO_EDGE),jc.atlasTextureIcon&&(er.activeTexture.set(pr.TEXTURE1),jc.atlasTextureIcon&&jc.atlasTextureIcon.bind(jc.atlasInterpolationIcon,pr.CLAMP_TO_EDGE)),jc.isSDF){var hp=jc.uniformValues;jc.hasHalo&&(hp.u_is_halo=1,de(jc.buffers,Sp.segments,K,W,jc.program,$n,tr,$e,hp)),hp.u_is_halo=0}de(jc.buffers,Sp.segments,K,W,jc.program,$n,tr,$e,jc.uniformValues)}}function de(W,et,K,pt,Ct,Yt,ce,re,ye){var Le=pt.context,tr=Le.gl;Ct.draw(Le,tr.TRIANGLES,Yt,ce,re,_r.disabled,ye,K.id,W.layoutVertexBuffer,W.indexBuffer,et,K.paint,pt.transform.zoom,W.programConfigurations.get(K.id),W.dynamicLayoutVertexBuffer,W.opacityVertexBuffer)}function Ee(W,et,K,pt){if(W.renderPass==="translucent"){var Ct=K.paint.get("circle-opacity"),Yt=K.paint.get("circle-stroke-width"),ce=K.paint.get("circle-stroke-opacity"),re=K.layout.get("circle-sort-key").constantOr(1)!==void 0;if(!(Ct.constantOr(1)===0&&(Yt.constantOr(1)===0||ce.constantOr(1)===0))){for(var ye=W.context,Le=ye.gl,tr=W.depthModeForSublayer(0,vn.ReadOnly),$e=pn.disabled,er=W.colorModeForRenderPass(),pr=[],wr=0;wr<pt.length;wr++){var rr=pt[wr],cr=et.getTile(rr),hr=cr.getBucket(K);if(hr){var Vr=hr.programConfigurations.get(K.id),yn=W.useProgram("circle",Vr),wn=hr.layoutVertexBuffer,$n=hr.indexBuffer,Xn=lr(W,rr,cr,K),Vn={programConfiguration:Vr,program:yn,layoutVertexBuffer:wn,indexBuffer:$n,uniformValues:Xn};if(re)for(var ca=hr.segments.get(),ea=0,wa=ca;ea<wa.length;ea+=1){var da=wa[ea];pr.push({segments:new t.SegmentVector([da]),sortKey:da.sortKey,state:Vn})}else pr.push({segments:hr.segments,sortKey:0,state:Vn})}}re&&pr.sort(function(il,eo){return il.sortKey-eo.sortKey});for(var pa=0,Ua=pr;pa<Ua.length;pa+=1){var Di=Ua[pa],ui=Di.state,ji=ui.programConfiguration,uo=ui.program,cs=ui.layoutVertexBuffer,Ts=ui.indexBuffer,is=ui.uniformValues,hs=Di.segments;uo.draw(ye,Le.TRIANGLES,tr,$e,er,_r.disabled,is,K.id,cs,Ts,hs,K.paint,W.transform.zoom,ji)}}}}function He(W,et,K,pt){if(K.paint.get("heatmap-opacity")!==0)if(W.renderPass==="offscreen"){var Ct=W.context,Yt=Ct.gl,ce=pn.disabled,re=new ze([Yt.ONE,Yt.ONE],t.Color.transparent,[!0,!0,!0,!0]);ar(Ct,W,K),Ct.clear({color:t.Color.transparent});for(var ye=0;ye<pt.length;ye++){var Le=pt[ye];if(!et.hasRenderableParent(Le)){var tr=et.getTile(Le),$e=tr.getBucket(K);if($e){var er=$e.programConfigurations.get(K.id),pr=W.useProgram("heatmap",er),wr=W.transform,rr=wr.zoom;pr.draw(Ct,Yt.TRIANGLES,vn.disabled,ce,re,_r.disabled,sa(Le.posMatrix,tr,rr,K.paint.get("heatmap-intensity")),K.id,$e.layoutVertexBuffer,$e.indexBuffer,$e.segments,K.paint,W.transform.zoom,er)}}}Ct.viewport.set([0,0,W.width,W.height])}else W.renderPass==="translucent"&&(W.context.setColorMode(W.colorModeForRenderPass()),zr(W,K))}function ar(W,et,K){var pt=W.gl;W.activeTexture.set(pt.TEXTURE1),W.viewport.set([0,0,et.width/4,et.height/4]);var Ct=K.heatmapFbo;if(Ct)pt.bindTexture(pt.TEXTURE_2D,Ct.colorAttachment.get()),W.bindFramebuffer.set(Ct.framebuffer);else{var Yt=pt.createTexture();pt.bindTexture(pt.TEXTURE_2D,Yt),pt.texParameteri(pt.TEXTURE_2D,pt.TEXTURE_WRAP_S,pt.CLAMP_TO_EDGE),pt.texParameteri(pt.TEXTURE_2D,pt.TEXTURE_WRAP_T,pt.CLAMP_TO_EDGE),pt.texParameteri(pt.TEXTURE_2D,pt.TEXTURE_MIN_FILTER,pt.LINEAR),pt.texParameteri(pt.TEXTURE_2D,pt.TEXTURE_MAG_FILTER,pt.LINEAR),Ct=K.heatmapFbo=W.createFramebuffer(et.width/4,et.height/4,!1),ir(W,et,Yt,Ct)}}function ir(W,et,K,pt){var Ct=W.gl,Yt=W.extRenderToTextureHalfFloat?W.extTextureHalfFloat.HALF_FLOAT_OES:Ct.UNSIGNED_BYTE;Ct.texImage2D(Ct.TEXTURE_2D,0,Ct.RGBA,et.width/4,et.height/4,0,Ct.RGBA,Yt,null),pt.colorAttachment.set(K)}function zr(W,et){var K=W.context,pt=K.gl,Ct=et.heatmapFbo;if(Ct){K.activeTexture.set(pt.TEXTURE0),pt.bindTexture(pt.TEXTURE_2D,Ct.colorAttachment.get()),K.activeTexture.set(pt.TEXTURE1);var Yt=et.colorRampTexture;Yt||(Yt=et.colorRampTexture=new t.Texture(K,et.colorRamp,pt.RGBA)),Yt.bind(pt.LINEAR,pt.CLAMP_TO_EDGE),W.useProgram("heatmapTexture").draw(K,pt.TRIANGLES,vn.disabled,pn.disabled,W.colorModeForRenderPass(),_r.disabled,qn(W,et,0,1),et.id,W.viewportBuffer,W.quadTriangleIndexBuffer,W.viewportSegments,et.paint,W.transform.zoom)}}function Zr(W,et,K,pt){if(W.renderPass==="translucent"){var Ct=K.paint.get("line-opacity"),Yt=K.paint.get("line-width");if(!(Ct.constantOr(1)===0||Yt.constantOr(1)===0))for(var ce=W.depthModeForSublayer(0,vn.ReadOnly),re=W.colorModeForRenderPass(),ye=K.paint.get("line-dasharray"),Le=K.paint.get("line-pattern"),tr=Le.constantOr(1),$e=K.paint.get("line-gradient"),er=K.getCrossfadeParameters(),pr=tr?"linePattern":ye?"lineSDF":$e?"lineGradient":"line",wr=W.context,rr=wr.gl,cr=!0,hr=0,Vr=pt;hr<Vr.length;hr+=1){var yn=Vr[hr],wn=et.getTile(yn);if(!(tr&&!wn.patternsLoaded())){var $n=wn.getBucket(K);if($n){var Xn=$n.programConfigurations.get(K.id),Vn=W.context.program.get(),ca=W.useProgram(pr,Xn),ea=cr||ca.program!==Vn,wa=Le.constantOr(null);if(wa&&wn.imageAtlas){var da=wn.imageAtlas,pa=da.patternPositions[wa.to.toString()],Ua=da.patternPositions[wa.from.toString()];pa&&Ua&&Xn.setConstantPatternPositions(pa,Ua)}var Di=tr?os(W,wn,K,er):ye?xs(W,wn,K,ye,er):$e?As(W,wn,K,$n.lineClipsArray.length):Jo(W,wn,K);if(tr)wr.activeTexture.set(rr.TEXTURE0),wn.imageAtlasTexture.bind(rr.LINEAR,rr.CLAMP_TO_EDGE),Xn.updatePaintBuffers(er);else if(ye&&(ea||W.lineAtlas.dirty))wr.activeTexture.set(rr.TEXTURE0),W.lineAtlas.bind(wr);else if($e){var ui=$n.gradients[K.id],ji=ui.texture;if(K.gradientVersion!==ui.version){var uo=256;if(K.stepInterpolant){var cs=et.getSource().maxzoom,Ts=yn.canonical.z===cs?Math.ceil(1<<W.transform.maxZoom-yn.canonical.z):1,is=$n.maxLineLength/t.EXTENT,hs=1024,il=is*hs*Ts;uo=t.clamp(t.nextPowerOfTwo(il),256,wr.maxTextureSize)}ui.gradient=t.renderColorRamp({expression:K.gradientExpression(),evaluationKey:"lineProgress",resolution:uo,image:ui.gradient||void 0,clips:$n.lineClipsArray}),ui.texture?ui.texture.update(ui.gradient):ui.texture=new t.Texture(wr,ui.gradient,rr.RGBA),ui.version=K.gradientVersion,ji=ui.texture}wr.activeTexture.set(rr.TEXTURE0),ji.bind(K.stepInterpolant?rr.NEAREST:rr.LINEAR,rr.CLAMP_TO_EDGE)}ca.draw(wr,rr.TRIANGLES,ce,W.stencilModeForClipping(yn),re,_r.disabled,Di,K.id,$n.layoutVertexBuffer,$n.indexBuffer,$n.segments,K.paint,W.transform.zoom,Xn,$n.layoutVertexBuffer2),cr=!1}}}}}function Rt(W,et,K,pt){var Ct=K.paint.get("fill-color"),Yt=K.paint.get("fill-opacity");if(Yt.constantOr(1)!==0){var ce=W.colorModeForRenderPass(),re=K.paint.get("fill-pattern"),ye=W.opaquePassEnabledForLayer()&&!re.constantOr(1)&&Ct.constantOr(t.Color.transparent).a===1&&Yt.constantOr(0)===1?"opaque":"translucent";if(W.renderPass===ye){var Le=W.depthModeForSublayer(1,W.renderPass==="opaque"?vn.ReadWrite:vn.ReadOnly);Gt(W,et,K,pt,Le,ce,!1)}if(W.renderPass==="translucent"&&K.paint.get("fill-antialias")){var tr=W.depthModeForSublayer(K.getPaintProperty("fill-outline-color")?2:0,vn.ReadOnly);Gt(W,et,K,pt,tr,ce,!0)}}}function Gt(W,et,K,pt,Ct,Yt,ce){var re=W.context.gl,ye=K.paint.get("fill-pattern"),Le=ye&&ye.constantOr(1),tr=K.getCrossfadeParameters(),$e,er,pr,wr,rr;ce?(er=Le&&!K.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",$e=re.LINES):(er=Le?"fillPattern":"fill",$e=re.TRIANGLES);for(var cr=0,hr=pt;cr<hr.length;cr+=1){var Vr=hr[cr],yn=et.getTile(Vr);if(!(Le&&!yn.patternsLoaded())){var wn=yn.getBucket(K);if(wn){var $n=wn.programConfigurations.get(K.id),Xn=W.useProgram(er,$n);Le&&(W.context.activeTexture.set(re.TEXTURE0),yn.imageAtlasTexture.bind(re.LINEAR,re.CLAMP_TO_EDGE),$n.updatePaintBuffers(tr));var Vn=ye.constantOr(null);if(Vn&&yn.imageAtlas){var ca=yn.imageAtlas,ea=ca.patternPositions[Vn.to.toString()],wa=ca.patternPositions[Vn.from.toString()];ea&&wa&&$n.setConstantPatternPositions(ea,wa)}var da=W.translatePosMatrix(Vr.posMatrix,yn,K.paint.get("fill-translate"),K.paint.get("fill-translate-anchor"));if(!ce)wr=wn.indexBuffer,rr=wn.segments,pr=Le?sc(da,W,tr,yn):Iu(da);else{wr=wn.indexBuffer2,rr=wn.segments2;var pa=[re.drawingBufferWidth,re.drawingBufferHeight];pr=er==="fillOutlinePattern"&&Le?wc(da,W,tr,yn,pa):_u(da,pa)}Xn.draw(W.context,$e,Ct,W.stencilModeForClipping(Vr),Yt,_r.disabled,pr,K.id,wn.layoutVertexBuffer,wr,rr,K.paint,W.transform.zoom,$n)}}}}function ne(W,et,K,pt){var Ct=K.paint.get("fill-extrusion-opacity");if(Ct!==0&&W.renderPass==="translucent"){var Yt=new vn(W.context.gl.LEQUAL,vn.ReadWrite,W.depthRangeFor3D);if(Ct===1&&!K.paint.get("fill-extrusion-pattern").constantOr(1)){var ce=W.colorModeForRenderPass();oe(W,et,K,pt,Yt,pn.disabled,ce)}else oe(W,et,K,pt,Yt,pn.disabled,ze.disabled),oe(W,et,K,pt,Yt,W.stencilModeFor3D(),W.colorModeForRenderPass())}}function oe(W,et,K,pt,Ct,Yt,ce){for(var re=W.context,ye=re.gl,Le=K.paint.get("fill-extrusion-pattern"),tr=Le.constantOr(1),$e=K.getCrossfadeParameters(),er=K.paint.get("fill-extrusion-opacity"),pr=0,wr=pt;pr<wr.length;pr+=1){var rr=wr[pr],cr=et.getTile(rr),hr=cr.getBucket(K);if(hr){var Vr=hr.programConfigurations.get(K.id),yn=W.useProgram(tr?"fillExtrusionPattern":"fillExtrusion",Vr);tr&&(W.context.activeTexture.set(ye.TEXTURE0),cr.imageAtlasTexture.bind(ye.LINEAR,ye.CLAMP_TO_EDGE),Vr.updatePaintBuffers($e));var wn=Le.constantOr(null);if(wn&&cr.imageAtlas){var $n=cr.imageAtlas,Xn=$n.patternPositions[wn.to.toString()],Vn=$n.patternPositions[wn.from.toString()];Xn&&Vn&&Vr.setConstantPatternPositions(Xn,Vn)}var ca=W.translatePosMatrix(rr.posMatrix,cr,K.paint.get("fill-extrusion-translate"),K.paint.get("fill-extrusion-translate-anchor")),ea=K.paint.get("fill-extrusion-vertical-gradient"),wa=tr?Yl(ca,W,ea,er,rr,$e,cr):Qc(ca,W,ea,er);yn.draw(re,re.gl.TRIANGLES,Ct,Yt,ce,_r.backCCW,wa,K.id,hr.layoutVertexBuffer,hr.indexBuffer,hr.segments,K.paint,W.transform.zoom,Vr)}}}function be(W,et,K,pt){if(!(W.renderPass!=="offscreen"&&W.renderPass!=="translucent")){for(var Ct=W.context,Yt=W.depthModeForSublayer(0,vn.ReadOnly),ce=W.colorModeForRenderPass(),re=W.renderPass==="translucent"?W.stencilConfigForOverlap(pt):[{},pt],ye=re[0],Le=re[1],tr=0,$e=Le;tr<$e.length;tr+=1){var er=$e[tr],pr=et.getTile(er);pr.needsHillshadePrepare&&W.renderPass==="offscreen"?Ae(W,pr,K,Yt,pn.disabled,ce):W.renderPass==="translucent"&&pe(W,pr,K,Yt,ye[er.overscaledZ],ce)}Ct.viewport.set([0,0,W.width,W.height])}}function pe(W,et,K,pt,Ct,Yt){var ce=W.context,re=ce.gl,ye=et.fbo;if(ye){var Le=W.useProgram("hillshade");ce.activeTexture.set(re.TEXTURE0),re.bindTexture(re.TEXTURE_2D,ye.colorAttachment.get());var tr=Ei(W,et,K);Le.draw(ce,re.TRIANGLES,pt,Ct,Yt,_r.disabled,tr,K.id,W.rasterBoundsBuffer,W.quadTriangleIndexBuffer,W.rasterBoundsSegments)}}function Ae(W,et,K,pt,Ct,Yt){var ce=W.context,re=ce.gl,ye=et.dem;if(ye&&ye.data){var Le=ye.dim,tr=ye.stride,$e=ye.getPixels();if(ce.activeTexture.set(re.TEXTURE1),ce.pixelStoreUnpackPremultiplyAlpha.set(!1),et.demTexture=et.demTexture||W.getTileTexture(tr),et.demTexture){var er=et.demTexture;er.update($e,{premultiply:!1}),er.bind(re.NEAREST,re.CLAMP_TO_EDGE)}else et.demTexture=new t.Texture(ce,$e,re.RGBA,{premultiply:!1}),et.demTexture.bind(re.NEAREST,re.CLAMP_TO_EDGE);ce.activeTexture.set(re.TEXTURE0);var pr=et.fbo;if(!pr){var wr=new t.Texture(ce,{width:Le,height:Le,data:null},re.RGBA);wr.bind(re.LINEAR,re.CLAMP_TO_EDGE),pr=et.fbo=ce.createFramebuffer(Le,Le,!0),pr.colorAttachment.set(wr.texture)}ce.bindFramebuffer.set(pr.framebuffer),ce.viewport.set([0,0,Le,Le]),W.useProgram("hillshadePrepare").draw(ce,re.TRIANGLES,pt,Ct,Yt,_r.disabled,Ni(et.tileID,ye),K.id,W.rasterBoundsBuffer,W.quadTriangleIndexBuffer,W.rasterBoundsSegments),et.needsHillshadePrepare=!1}}function Xe(W,et,K,pt){if(W.renderPass==="translucent"&&K.paint.get("raster-opacity")!==0&&pt.length)for(var Ct=W.context,Yt=Ct.gl,ce=et.getSource(),re=W.useProgram("raster"),ye=W.colorModeForRenderPass(),Le=ce instanceof lt?[{},pt]:W.stencilConfigForOverlap(pt),tr=Le[0],$e=Le[1],er=$e[$e.length-1].overscaledZ,pr=!W.options.moving,wr=0,rr=$e;wr<rr.length;wr+=1){var cr=rr[wr],hr=W.depthModeForSublayer(cr.overscaledZ-er,K.paint.get("raster-opacity")===1?vn.ReadWrite:vn.ReadOnly,Yt.LESS),Vr=et.getTile(cr),yn=W.transform.calculatePosMatrix(cr.toUnwrapped(),pr);Vr.registerFadeDuration(K.paint.get("raster-fade-duration"));var wn=et.findLoadedParent(cr,0),$n=nr(Vr,wn,et,K,W.transform),Xn=void 0,Vn=void 0,ca=K.paint.get("raster-resampling")==="nearest"?Yt.NEAREST:Yt.LINEAR;Ct.activeTexture.set(Yt.TEXTURE0),Vr.texture.bind(ca,Yt.CLAMP_TO_EDGE,Yt.LINEAR_MIPMAP_NEAREST),Ct.activeTexture.set(Yt.TEXTURE1),wn?(wn.texture.bind(ca,Yt.CLAMP_TO_EDGE,Yt.LINEAR_MIPMAP_NEAREST),Xn=Math.pow(2,wn.tileID.overscaledZ-Vr.tileID.overscaledZ),Vn=[Vr.tileID.canonical.x*Xn%1,Vr.tileID.canonical.y*Xn%1]):Vr.texture.bind(ca,Yt.CLAMP_TO_EDGE,Yt.LINEAR_MIPMAP_NEAREST);var ea=Ms(yn,Vn||[0,0],Xn||1,$n,K);ce instanceof lt?re.draw(Ct,Yt.TRIANGLES,hr,pn.disabled,ye,_r.disabled,ea,K.id,ce.boundsBuffer,W.quadTriangleIndexBuffer,ce.boundsSegments):re.draw(Ct,Yt.TRIANGLES,hr,tr[cr.overscaledZ],ye,_r.disabled,ea,K.id,W.rasterBoundsBuffer,W.quadTriangleIndexBuffer,W.rasterBoundsSegments)}}function nr(W,et,K,pt,Ct){var Yt=pt.paint.get("raster-fade-duration");if(Yt>0){var ce=t.browser.now(),re=(ce-W.timeAdded)/Yt,ye=et?(ce-et.timeAdded)/Yt:-1,Le=K.getSource(),tr=Ct.coveringZoomLevel({tileSize:Le.tileSize,roundZoom:Le.roundZoom}),$e=!et||Math.abs(et.tileID.overscaledZ-tr)>Math.abs(W.tileID.overscaledZ-tr),er=$e&&W.refreshedUponExpiration?1:t.clamp($e?re:1-ye,0,1);return W.refreshedUponExpiration&&re>=1&&(W.refreshedUponExpiration=!1),et?{opacity:1,mix:1-er}:{opacity:er,mix:0}}else return{opacity:1,mix:0}}function or(W,et,K){var pt=K.paint.get("background-color"),Ct=K.paint.get("background-opacity");if(Ct!==0){var Yt=W.context,ce=Yt.gl,re=W.transform,ye=re.tileSize,Le=K.paint.get("background-pattern");if(!W.isPatternMissing(Le)){var tr=!Le&&pt.a===1&&Ct===1&&W.opaquePassEnabledForLayer()?"opaque":"translucent";if(W.renderPass===tr){var $e=pn.disabled,er=W.depthModeForSublayer(0,tr==="opaque"?vn.ReadWrite:vn.ReadOnly),pr=W.colorModeForRenderPass(),wr=W.useProgram(Le?"backgroundPattern":"background"),rr=re.coveringTiles({tileSize:ye});Le&&(Yt.activeTexture.set(ce.TEXTURE0),W.imageManager.bind(W.context));for(var cr=K.getCrossfadeParameters(),hr=0,Vr=rr;hr<Vr.length;hr+=1){var yn=Vr[hr],wn=W.transform.calculatePosMatrix(yn.toUnwrapped()),$n=Le?Ri(wn,Ct,W,Le,{tileID:yn,tileSize:ye},cr):ec(wn,Ct,pt);wr.draw(Yt,ce.TRIANGLES,er,$e,pr,_r.disabled,$n,K.id,W.tileExtentBuffer,W.quadTriangleIndexBuffer,W.tileExtentSegments)}}}}}var Tr=new t.Color(1,0,0,1),Rr=new t.Color(0,1,0,1),Qr=new t.Color(0,0,1,1),nn=new t.Color(1,0,1,1),mn=new t.Color(0,1,1,1);function zn(W){var et=W.transform.padding,K=3;Yn(W,W.transform.height-(et.top||0),K,Tr),Yn(W,et.bottom||0,K,Rr),la(W,et.left||0,K,Qr),la(W,W.transform.width-(et.right||0),K,nn);var pt=W.transform.centerPoint;na(W,pt.x,W.transform.height-pt.y,mn)}function na(W,et,K,pt){var Ct=20,Yt=2;Na(W,et-Yt/2,K-Ct/2,Yt,Ct,pt),Na(W,et-Ct/2,K-Yt/2,Ct,Yt,pt)}function Yn(W,et,K,pt){Na(W,0,et+K/2,W.transform.width,K,pt)}function la(W,et,K,pt){Na(W,et-K/2,0,K,W.transform.height,pt)}function Na(W,et,K,pt,Ct,Yt){var ce=W.context,re=ce.gl;re.enable(re.SCISSOR_TEST),re.scissor(et*t.browser.devicePixelRatio,K*t.browser.devicePixelRatio,pt*t.browser.devicePixelRatio,Ct*t.browser.devicePixelRatio),ce.clear({color:Yt}),re.disable(re.SCISSOR_TEST)}function li(W,et,K){for(var pt=0;pt<K.length;pt++)Ka(W,et,K[pt])}function Ka(W,et,K){var pt=W.context,Ct=pt.gl,Yt=K.posMatrix,ce=W.useProgram("debug"),re=vn.disabled,ye=pn.disabled,Le=W.colorModeForRenderPass(),tr="$debug";pt.activeTexture.set(Ct.TEXTURE0),W.emptyTexture.bind(Ct.LINEAR,Ct.CLAMP_TO_EDGE),ce.draw(pt,Ct.LINE_STRIP,re,ye,Le,_r.disabled,oa(Yt,t.Color.red),tr,W.debugBuffer,W.tileBorderIndexBuffer,W.debugSegments);var $e=et.getTileByID(K.key).latestRawTileData,er=$e&&$e.byteLength||0,pr=Math.floor(er/1024),wr=et.getTile(K).tileSize,rr=512/Math.min(wr,512)*(K.overscaledZ/W.transform.zoom)*.5,cr=K.canonical.toString();K.overscaledZ!==K.canonical.z&&(cr+=" => "+K.overscaledZ);var hr=cr+" "+pr+"kb";Gi(W,hr),ce.draw(pt,Ct.TRIANGLES,re,ye,ze.alphaBlended,_r.disabled,oa(Yt,t.Color.transparent,rr),tr,W.debugBuffer,W.quadTriangleIndexBuffer,W.debugSegments)}function Gi(W,et){W.initDebugOverlayCanvas();var K=W.debugOverlayCanvas,pt=W.context.gl,Ct=W.debugOverlayCanvas.getContext("2d");Ct.clearRect(0,0,K.width,K.height),Ct.shadowColor="white",Ct.shadowBlur=2,Ct.lineWidth=1.5,Ct.strokeStyle="white",Ct.textBaseline="top",Ct.font="bold 36px Open Sans, sans-serif",Ct.fillText(et,5,5),Ct.strokeText(et,5,5),W.debugOverlayTexture.update(K),W.debugOverlayTexture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE)}function jo(W,et,K){var pt=W.context,Ct=K.implementation;if(W.renderPass==="offscreen"){var Yt=Ct.prerender;Yt&&(W.setCustomLayerDefaults(),pt.setColorMode(W.colorModeForRenderPass()),Yt.call(Ct,pt.gl,W.transform.customLayerMatrix()),pt.setDirty(),W.setBaseState())}else if(W.renderPass==="translucent"){W.setCustomLayerDefaults(),pt.setColorMode(W.colorModeForRenderPass()),pt.setStencilMode(pn.disabled);var ce=Ct.renderingMode==="3d"?new vn(W.context.gl.LEQUAL,vn.ReadWrite,W.depthRangeFor3D):W.depthModeForSublayer(0,vn.ReadOnly);pt.setDepthMode(ce),Ct.render(pt.gl,W.transform.customLayerMatrix()),pt.setDirty(),W.setBaseState(),pt.bindFramebuffer.set(null)}}var Uo={symbol:P,circle:Ee,heatmap:He,line:Zr,fill:Rt,"fill-extrusion":ne,hillshade:be,raster:Xe,background:or,debug:li,custom:jo},ho=function(W,et){this.context=new Xr(W),this.transform=et,this._tileTextures={},this.setup(),this.numSublayers=rn.maxUnderzooming+rn.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ql,this.gpuTimers={}};ho.prototype.resize=function(W,et){if(this.width=W*t.browser.devicePixelRatio,this.height=et*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var K=0,pt=this.style._order;K<pt.length;K+=1){var Ct=pt[K];this.style._layers[Ct].resize()}},ho.prototype.setup=function(){var W=this.context,et=new t.StructArrayLayout2i4;et.emplaceBack(0,0),et.emplaceBack(t.EXTENT,0),et.emplaceBack(0,t.EXTENT),et.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=W.createVertexBuffer(et,Wu.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var K=new t.StructArrayLayout2i4;K.emplaceBack(0,0),K.emplaceBack(t.EXTENT,0),K.emplaceBack(0,t.EXTENT),K.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=W.createVertexBuffer(K,Wu.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var pt=new t.StructArrayLayout4i8;pt.emplaceBack(0,0,0,0),pt.emplaceBack(t.EXTENT,0,t.EXTENT,0),pt.emplaceBack(0,t.EXTENT,0,t.EXTENT),pt.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=W.createVertexBuffer(pt,ct.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var Ct=new t.StructArrayLayout2i4;Ct.emplaceBack(0,0),Ct.emplaceBack(1,0),Ct.emplaceBack(0,1),Ct.emplaceBack(1,1),this.viewportBuffer=W.createVertexBuffer(Ct,Wu.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var Yt=new t.StructArrayLayout1ui2;Yt.emplaceBack(0),Yt.emplaceBack(1),Yt.emplaceBack(3),Yt.emplaceBack(2),Yt.emplaceBack(0),this.tileBorderIndexBuffer=W.createIndexBuffer(Yt);var ce=new t.StructArrayLayout3ui6;ce.emplaceBack(0,1,2),ce.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=W.createIndexBuffer(ce),this.emptyTexture=new t.Texture(W,{width:1,height:1,data:new Uint8Array([0,0,0,0])},W.gl.RGBA);var re=this.context.gl;this.stencilClearMode=new pn({func:re.ALWAYS,mask:0},0,255,re.ZERO,re.ZERO,re.ZERO)},ho.prototype.clearStencil=function(){var W=this.context,et=W.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var K=t.create();t.ortho(K,0,this.width,this.height,0,0,1),t.scale(K,K,[et.drawingBufferWidth,et.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(W,et.TRIANGLES,vn.disabled,this.stencilClearMode,ze.disabled,_r.disabled,Pa(K),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},ho.prototype._renderTileClippingMasks=function(W,et){if(!(this.currentStencilSource===W.source||!W.isTileClipped()||!et||!et.length)){this.currentStencilSource=W.source;var K=this.context,pt=K.gl;this.nextStencilID+et.length>256&&this.clearStencil(),K.setColorMode(ze.disabled),K.setDepthMode(vn.disabled);var Ct=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var Yt=0,ce=et;Yt<ce.length;Yt+=1){var re=ce[Yt],ye=this._tileClippingMaskIDs[re.key]=this.nextStencilID++;Ct.draw(K,pt.TRIANGLES,vn.disabled,new pn({func:pt.ALWAYS,mask:0},ye,255,pt.KEEP,pt.KEEP,pt.REPLACE),ze.disabled,_r.disabled,Pa(re.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},ho.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var W=this.nextStencilID++,et=this.context.gl;return new pn({func:et.NOTEQUAL,mask:255},W,255,et.KEEP,et.KEEP,et.REPLACE)},ho.prototype.stencilModeForClipping=function(W){var et=this.context.gl;return new pn({func:et.EQUAL,mask:255},this._tileClippingMaskIDs[W.key],0,et.KEEP,et.KEEP,et.REPLACE)},ho.prototype.stencilConfigForOverlap=function(W){var et,K=this.context.gl,pt=W.sort(function(ye,Le){return Le.overscaledZ-ye.overscaledZ}),Ct=pt[pt.length-1].overscaledZ,Yt=pt[0].overscaledZ-Ct+1;if(Yt>1){this.currentStencilSource=void 0,this.nextStencilID+Yt>256&&this.clearStencil();for(var ce={},re=0;re<Yt;re++)ce[re+Ct]=new pn({func:K.GEQUAL,mask:255},re+this.nextStencilID,255,K.KEEP,K.KEEP,K.REPLACE);return this.nextStencilID+=Yt,[ce,pt]}return[(et={},et[Ct]=pn.disabled,et),pt]},ho.prototype.colorModeForRenderPass=function(){var W=this.context.gl;if(this._showOverdrawInspector){var et=8,K=1/et;return new ze([W.CONSTANT_COLOR,W.ONE],new t.Color(K,K,K,0),[!0,!0,!0,!0])}else return this.renderPass==="opaque"?ze.unblended:ze.alphaBlended},ho.prototype.depthModeForSublayer=function(W,et,K){if(!this.opaquePassEnabledForLayer())return vn.disabled;var pt=1-((1+this.currentLayer)*this.numSublayers+W)*this.depthEpsilon;return new vn(K||this.context.gl.LEQUAL,et,[pt,pt])},ho.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},ho.prototype.render=function(W,et){var K=this;this.style=W,this.options=et,this.lineAtlas=W.lineAtlas,this.imageManager=W.imageManager,this.glyphManager=W.glyphManager,this.symbolFadeChange=W.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var pt=this.style._order,Ct=this.style.sourceCaches;for(var Yt in Ct){var ce=Ct[Yt];ce.used&&ce.prepare(this.context)}var re={},ye={},Le={};for(var tr in Ct){var $e=Ct[tr];re[tr]=$e.getVisibleCoordinates(),ye[tr]=re[tr].slice().reverse(),Le[tr]=$e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var er=0;er<pt.length;er++){var pr=pt[er];if(this.style._layers[pr].is3D()){this.opaquePassCutoff=er;break}}this.renderPass="offscreen";for(var wr=0,rr=pt;wr<rr.length;wr+=1){var cr=rr[wr],hr=this.style._layers[cr];if(!(!hr.hasOffscreenPass()||hr.isHidden(this.transform.zoom))){var Vr=ye[hr.source];hr.type!=="custom"&&!Vr.length||this.renderLayer(this,Ct[hr.source],hr,Vr)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:et.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=et.showOverdrawInspector,this.depthRangeFor3D=[0,1-(W._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=pt.length-1;this.currentLayer>=0;this.currentLayer--){var yn=this.style._layers[pt[this.currentLayer]],wn=Ct[yn.source],$n=re[yn.source];this._renderTileClippingMasks(yn,$n),this.renderLayer(this,wn,yn,$n)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<pt.length;this.currentLayer++){var Xn=this.style._layers[pt[this.currentLayer]],Vn=Ct[Xn.source],ca=(Xn.type==="symbol"?Le:ye)[Xn.source];this._renderTileClippingMasks(Xn,re[Xn.source]),this.renderLayer(this,Vn,Xn,ca)}if(this.options.showTileBoundaries){var ea,wa,da=t.values(this.style._layers);da.forEach(function(pa){pa.source&&!pa.isHidden(K.transform.zoom)&&(pa.source!==(wa&&wa.id)&&(wa=K.style.sourceCaches[pa.source]),(!ea||ea.getSource().maxzoom<wa.getSource().maxzoom)&&(ea=wa))}),ea&&Uo.debug(this,ea,ea.getVisibleCoordinates())}this.options.showPadding&&zn(this),this.context.setDefault()},ho.prototype.renderLayer=function(W,et,K,pt){K.isHidden(this.transform.zoom)||K.type!=="background"&&K.type!=="custom"&&!pt.length||(this.id=K.id,this.gpuTimingStart(K),Uo[K.type](W,et,K,pt,this.style.placement.variableOffsets),this.gpuTimingEnd())},ho.prototype.gpuTimingStart=function(W){if(this.options.gpuTiming){var et=this.context.extTimerQuery,K=this.gpuTimers[W.id];K||(K=this.gpuTimers[W.id]={calls:0,cpuTime:0,query:et.createQueryEXT()}),K.calls++,et.beginQueryEXT(et.TIME_ELAPSED_EXT,K.query)}},ho.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var W=this.context.extTimerQuery;W.endQueryEXT(W.TIME_ELAPSED_EXT)}},ho.prototype.collectGpuTimers=function(){var W=this.gpuTimers;return this.gpuTimers={},W},ho.prototype.queryGpuTimers=function(W){var et={};for(var K in W){var pt=W[K],Ct=this.context.extTimerQuery,Yt=Ct.getQueryObjectEXT(pt.query,Ct.QUERY_RESULT_EXT)/(1e3*1e3);Ct.deleteQueryEXT(pt.query),et[K]=Yt}return et},ho.prototype.translatePosMatrix=function(W,et,K,pt,Ct){if(!K[0]&&!K[1])return W;var Yt=Ct?pt==="map"?this.transform.angle:0:pt==="viewport"?-this.transform.angle:0;if(Yt){var ce=Math.sin(Yt),re=Math.cos(Yt);K=[K[0]*re-K[1]*ce,K[0]*ce+K[1]*re]}var ye=[Ct?K[0]:Si(et,K[0],this.transform.zoom),Ct?K[1]:Si(et,K[1],this.transform.zoom),0],Le=new Float32Array(16);return t.translate(Le,W,ye),Le},ho.prototype.saveTileTexture=function(W){var et=this._tileTextures[W.size[0]];et?et.push(W):this._tileTextures[W.size[0]]=[W]},ho.prototype.getTileTexture=function(W){var et=this._tileTextures[W];return et&&et.length>0?et.pop():null},ho.prototype.isPatternMissing=function(W){if(!W)return!1;if(!W.from||!W.to)return!0;var et=this.imageManager.getPattern(W.from.toString()),K=this.imageManager.getPattern(W.to.toString());return!et||!K},ho.prototype.useProgram=function(W,et){this.cache=this.cache||{};var K=""+W+(et?et.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[K]||(this.cache[K]=new oc(this.context,W,mc[W],et,oo[W],this._showOverdrawInspector)),this.cache[K]},ho.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},ho.prototype.setBaseState=function(){var W=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(W.FUNC_ADD)},ho.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var W=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,W.RGBA)}},ho.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Go=function(W,et){this.points=W,this.planes=et};Go.fromInvProjectionMatrix=function(W,et,K){var pt=[[-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]],Ct=Math.pow(2,K),Yt=pt.map(function(ye){return t.transformMat4([],ye,W)}).map(function(ye){return t.scale$1([],ye,1/ye[3]/et*Ct)}),ce=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],re=ce.map(function(ye){var Le=t.sub([],Yt[ye[0]],Yt[ye[1]]),tr=t.sub([],Yt[ye[2]],Yt[ye[1]]),$e=t.normalize([],t.cross([],Le,tr)),er=-t.dot($e,Yt[ye[1]]);return $e.concat(er)});return new Go(Yt,re)};var js=function(W,et){this.min=W,this.max=et,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};js.prototype.quadrant=function(W){for(var et=[W%2===0,W<2],K=t.clone$2(this.min),pt=t.clone$2(this.max),Ct=0;Ct<et.length;Ct++)K[Ct]=et[Ct]?this.min[Ct]:this.center[Ct],pt[Ct]=et[Ct]?this.center[Ct]:this.max[Ct];return pt[2]=this.max[2],new js(K,pt)},js.prototype.distanceX=function(W){var et=Math.max(Math.min(this.max[0],W[0]),this.min[0]);return et-W[0]},js.prototype.distanceY=function(W){var et=Math.max(Math.min(this.max[1],W[1]),this.min[1]);return et-W[1]},js.prototype.intersects=function(W){for(var et=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],K=!0,pt=0;pt<W.planes.length;pt++){for(var Ct=W.planes[pt],Yt=0,ce=0;ce<et.length;ce++)Yt+=t.dot$1(Ct,et[ce])>=0;if(Yt===0)return 0;Yt!==et.length&&(K=!1)}if(K)return 2;for(var re=0;re<3;re++){for(var ye=Number.MAX_VALUE,Le=-Number.MAX_VALUE,tr=0;tr<W.points.length;tr++){var $e=W.points[tr][re]-this.min[re];ye=Math.min(ye,$e),Le=Math.max(Le,$e)}if(Le<0||ye>this.max[re]-this.min[re])return 0}return 1};var Is=function(W,et,K,pt){if(W===void 0&&(W=0),et===void 0&&(et=0),K===void 0&&(K=0),pt===void 0&&(pt=0),isNaN(W)||W<0||isNaN(et)||et<0||isNaN(K)||K<0||isNaN(pt)||pt<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=W,this.bottom=et,this.left=K,this.right=pt};Is.prototype.interpolate=function(W,et,K){return et.top!=null&&W.top!=null&&(this.top=t.number(W.top,et.top,K)),et.bottom!=null&&W.bottom!=null&&(this.bottom=t.number(W.bottom,et.bottom,K)),et.left!=null&&W.left!=null&&(this.left=t.number(W.left,et.left,K)),et.right!=null&&W.right!=null&&(this.right=t.number(W.right,et.right,K)),this},Is.prototype.getCenter=function(W,et){var K=t.clamp((this.left+W-this.right)/2,0,W),pt=t.clamp((this.top+et-this.bottom)/2,0,et);return new t.Point(K,pt)},Is.prototype.equals=function(W){return this.top===W.top&&this.bottom===W.bottom&&this.left===W.left&&this.right===W.right},Is.prototype.clone=function(){return new Is(this.top,this.bottom,this.left,this.right)},Is.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var bo=function(W,et,K,pt,Ct){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=Ct===void 0?!0:Ct,this._minZoom=W||0,this._maxZoom=et||22,this._minPitch=K??0,this._maxPitch=pt??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Is,this._posMatrixCache={},this._alignedPosMatrixCache={}},wo={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};bo.prototype.clone=function(){var W=new bo(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return W.tileSize=this.tileSize,W.latRange=this.latRange,W.width=this.width,W.height=this.height,W._center=this._center,W.zoom=this.zoom,W.angle=this.angle,W._fov=this._fov,W._pitch=this._pitch,W._unmodified=this._unmodified,W._edgeInsets=this._edgeInsets.clone(),W._calcMatrices(),W},wo.minZoom.get=function(){return this._minZoom},wo.minZoom.set=function(W){this._minZoom!==W&&(this._minZoom=W,this.zoom=Math.max(this.zoom,W))},wo.maxZoom.get=function(){return this._maxZoom},wo.maxZoom.set=function(W){this._maxZoom!==W&&(this._maxZoom=W,this.zoom=Math.min(this.zoom,W))},wo.minPitch.get=function(){return this._minPitch},wo.minPitch.set=function(W){this._minPitch!==W&&(this._minPitch=W,this.pitch=Math.max(this.pitch,W))},wo.maxPitch.get=function(){return this._maxPitch},wo.maxPitch.set=function(W){this._maxPitch!==W&&(this._maxPitch=W,this.pitch=Math.min(this.pitch,W))},wo.renderWorldCopies.get=function(){return this._renderWorldCopies},wo.renderWorldCopies.set=function(W){W===void 0?W=!0:W===null&&(W=!1),this._renderWorldCopies=W},wo.worldSize.get=function(){return this.tileSize*this.scale},wo.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},wo.size.get=function(){return new t.Point(this.width,this.height)},wo.bearing.get=function(){return-this.angle/Math.PI*180},wo.bearing.set=function(W){var et=-t.wrap(W,-180,180)*Math.PI/180;this.angle!==et&&(this._unmodified=!1,this.angle=et,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},wo.pitch.get=function(){return this._pitch/Math.PI*180},wo.pitch.set=function(W){var et=t.clamp(W,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==et&&(this._unmodified=!1,this._pitch=et,this._calcMatrices())},wo.fov.get=function(){return this._fov/Math.PI*180},wo.fov.set=function(W){W=Math.max(.01,Math.min(60,W)),this._fov!==W&&(this._unmodified=!1,this._fov=W/180*Math.PI,this._calcMatrices())},wo.zoom.get=function(){return this._zoom},wo.zoom.set=function(W){var et=Math.min(Math.max(W,this.minZoom),this.maxZoom);this._zoom!==et&&(this._unmodified=!1,this._zoom=et,this.scale=this.zoomScale(et),this.tileZoom=Math.floor(et),this.zoomFraction=et-this.tileZoom,this._constrain(),this._calcMatrices())},wo.center.get=function(){return this._center},wo.center.set=function(W){W.lat===this._center.lat&&W.lng===this._center.lng||(this._unmodified=!1,this._center=W,this._constrain(),this._calcMatrices())},wo.padding.get=function(){return this._edgeInsets.toJSON()},wo.padding.set=function(W){this._edgeInsets.equals(W)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,W,1),this._calcMatrices())},wo.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},bo.prototype.isPaddingEqual=function(W){return this._edgeInsets.equals(W)},bo.prototype.interpolatePadding=function(W,et,K){this._unmodified=!1,this._edgeInsets.interpolate(W,et,K),this._constrain(),this._calcMatrices()},bo.prototype.coveringZoomLevel=function(W){var et=(W.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/W.tileSize));return Math.max(0,et)},bo.prototype.getVisibleUnwrappedCoordinates=function(W){var et=[new t.UnwrappedTileID(0,W)];if(this._renderWorldCopies)for(var K=this.pointCoordinate(new t.Point(0,0)),pt=this.pointCoordinate(new t.Point(this.width,0)),Ct=this.pointCoordinate(new t.Point(this.width,this.height)),Yt=this.pointCoordinate(new t.Point(0,this.height)),ce=Math.floor(Math.min(K.x,pt.x,Ct.x,Yt.x)),re=Math.floor(Math.max(K.x,pt.x,Ct.x,Yt.x)),ye=1,Le=ce-ye;Le<=re+ye;Le++)Le!==0&&et.push(new t.UnwrappedTileID(Le,W));return et},bo.prototype.coveringTiles=function(W){var et=this.coveringZoomLevel(W),K=et;if(W.minzoom!==void 0&&et<W.minzoom)return[];W.maxzoom!==void 0&&et>W.maxzoom&&(et=W.maxzoom);var pt=t.MercatorCoordinate.fromLngLat(this.center),Ct=Math.pow(2,et),Yt=[Ct*pt.x,Ct*pt.y,0],ce=Go.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,et),re=W.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(re=et);var ye=3,Le=function(da){return{aabb:new js([da*Ct,0,0],[(da+1)*Ct,Ct,0]),zoom:0,x:0,y:0,wrap:da,fullyVisible:!1}},tr=[],$e=[],er=et,pr=W.reparseOverscaled?K:et;if(this._renderWorldCopies)for(var wr=1;wr<=3;wr++)tr.push(Le(-wr)),tr.push(Le(wr));for(tr.push(Le(0));tr.length>0;){var rr=tr.pop(),cr=rr.x,hr=rr.y,Vr=rr.fullyVisible;if(!Vr){var yn=rr.aabb.intersects(ce);if(yn===0)continue;Vr=yn===2}var wn=rr.aabb.distanceX(Yt),$n=rr.aabb.distanceY(Yt),Xn=Math.max(Math.abs(wn),Math.abs($n)),Vn=ye+(1<<er-rr.zoom)-2;if(rr.zoom===er||Xn>Vn&&rr.zoom>=re){$e.push({tileID:new t.OverscaledTileID(rr.zoom===er?pr:rr.zoom,rr.wrap,rr.zoom,cr,hr),distanceSq:t.sqrLen([Yt[0]-.5-cr,Yt[1]-.5-hr])});continue}for(var ca=0;ca<4;ca++){var ea=(cr<<1)+ca%2,wa=(hr<<1)+(ca>>1);tr.push({aabb:rr.aabb.quadrant(ca),zoom:rr.zoom+1,x:ea,y:wa,wrap:rr.wrap,fullyVisible:Vr})}}return $e.sort(function(da,pa){return da.distanceSq-pa.distanceSq}).map(function(da){return da.tileID})},bo.prototype.resize=function(W,et){this.width=W,this.height=et,this.pixelsToGLUnits=[2/W,-2/et],this._constrain(),this._calcMatrices()},wo.unmodified.get=function(){return this._unmodified},bo.prototype.zoomScale=function(W){return Math.pow(2,W)},bo.prototype.scaleZoom=function(W){return Math.log(W)/Math.LN2},bo.prototype.project=function(W){var et=t.clamp(W.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(W.lng)*this.worldSize,t.mercatorYfromLat(et)*this.worldSize)},bo.prototype.unproject=function(W){return new t.MercatorCoordinate(W.x/this.worldSize,W.y/this.worldSize).toLngLat()},wo.point.get=function(){return this.project(this.center)},bo.prototype.setLocationAtPoint=function(W,et){var K=this.pointCoordinate(et),pt=this.pointCoordinate(this.centerPoint),Ct=this.locationCoordinate(W),Yt=new t.MercatorCoordinate(Ct.x-(K.x-pt.x),Ct.y-(K.y-pt.y));this.center=this.coordinateLocation(Yt),this._renderWorldCopies&&(this.center=this.center.wrap())},bo.prototype.locationPoint=function(W){return this.coordinatePoint(this.locationCoordinate(W))},bo.prototype.pointLocation=function(W){return this.coordinateLocation(this.pointCoordinate(W))},bo.prototype.locationCoordinate=function(W){return t.MercatorCoordinate.fromLngLat(W)},bo.prototype.coordinateLocation=function(W){return W.toLngLat()},bo.prototype.pointCoordinate=function(W){var et=0,K=[W.x,W.y,0,1],pt=[W.x,W.y,1,1];t.transformMat4(K,K,this.pixelMatrixInverse),t.transformMat4(pt,pt,this.pixelMatrixInverse);var Ct=K[3],Yt=pt[3],ce=K[0]/Ct,re=pt[0]/Yt,ye=K[1]/Ct,Le=pt[1]/Yt,tr=K[2]/Ct,$e=pt[2]/Yt,er=tr===$e?0:(et-tr)/($e-tr);return new t.MercatorCoordinate(t.number(ce,re,er)/this.worldSize,t.number(ye,Le,er)/this.worldSize)},bo.prototype.coordinatePoint=function(W){var et=[W.x*this.worldSize,W.y*this.worldSize,0,1];return t.transformMat4(et,et,this.pixelMatrix),new t.Point(et[0]/et[3],et[1]/et[3])},bo.prototype.getBounds=function(){return new t.LngLatBounds().extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},bo.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},bo.prototype.setMaxBounds=function(W){W?(this.lngRange=[W.getWest(),W.getEast()],this.latRange=[W.getSouth(),W.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},bo.prototype.calculatePosMatrix=function(W,et){et===void 0&&(et=!1);var K=W.key,pt=et?this._alignedPosMatrixCache:this._posMatrixCache;if(pt[K])return pt[K];var Ct=W.canonical,Yt=this.worldSize/this.zoomScale(Ct.z),ce=Ct.x+Math.pow(2,Ct.z)*W.wrap,re=t.identity(new Float64Array(16));return t.translate(re,re,[ce*Yt,Ct.y*Yt,0]),t.scale(re,re,[Yt/t.EXTENT,Yt/t.EXTENT,1]),t.multiply(re,et?this.alignedProjMatrix:this.projMatrix,re),pt[K]=new Float32Array(re),pt[K]},bo.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},bo.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var W=-90,et=90,K=-180,pt=180,Ct,Yt,ce,re,ye=this.size,Le=this._unmodified;if(this.latRange){var tr=this.latRange;W=t.mercatorYfromLat(tr[1])*this.worldSize,et=t.mercatorYfromLat(tr[0])*this.worldSize,Ct=et-W<ye.y?ye.y/(et-W):0}if(this.lngRange){var $e=this.lngRange;K=t.mercatorXfromLng($e[0])*this.worldSize,pt=t.mercatorXfromLng($e[1])*this.worldSize,Yt=pt-K<ye.x?ye.x/(pt-K):0}var er=this.point,pr=Math.max(Yt||0,Ct||0);if(pr){this.center=this.unproject(new t.Point(Yt?(pt+K)/2:er.x,Ct?(et+W)/2:er.y)),this.zoom+=this.scaleZoom(pr),this._unmodified=Le,this._constraining=!1;return}if(this.latRange){var wr=er.y,rr=ye.y/2;wr-rr<W&&(re=W+rr),wr+rr>et&&(re=et-rr)}if(this.lngRange){var cr=er.x,hr=ye.x/2;cr-hr<K&&(ce=K+hr),cr+hr>pt&&(ce=pt-hr)}(ce!==void 0||re!==void 0)&&(this.center=this.unproject(new t.Point(ce!==void 0?ce:er.x,re!==void 0?re:er.y))),this._unmodified=Le,this._constraining=!1}},bo.prototype._calcMatrices=function(){if(this.height){var W=this._fov/2,et=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(W)*this.height;var K=Math.PI/2+this._pitch,pt=this._fov*(.5+et.y/this.height),Ct=Math.sin(pt)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-K-pt,.01,Math.PI-.01)),Yt=this.point,ce=Yt.x,re=Yt.y,ye=Math.cos(Math.PI/2-this._pitch)*Ct+this.cameraToCenterDistance,Le=ye*1.01,tr=this.height/50,$e=new Float64Array(16);t.perspective($e,this._fov,this.width/this.height,tr,Le),$e[8]=-et.x*2/this.width,$e[9]=et.y*2/this.height,t.scale($e,$e,[1,-1,1]),t.translate($e,$e,[0,0,-this.cameraToCenterDistance]),t.rotateX($e,$e,this._pitch),t.rotateZ($e,$e,this.angle),t.translate($e,$e,[-ce,-re,0]),this.mercatorMatrix=t.scale([],$e,[this.worldSize,this.worldSize,this.worldSize]),t.scale($e,$e,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=$e,this.invProjMatrix=t.invert([],this.projMatrix);var er=this.width%2/2,pr=this.height%2/2,wr=Math.cos(this.angle),rr=Math.sin(this.angle),cr=ce-Math.round(ce)+wr*er+rr*pr,hr=re-Math.round(re)+wr*pr+rr*er,Vr=new Float64Array($e);if(t.translate(Vr,Vr,[cr>.5?cr-1:cr,hr>.5?hr-1:hr,0]),this.alignedProjMatrix=Vr,$e=t.create(),t.scale($e,$e,[this.width/2,-this.height/2,1]),t.translate($e,$e,[1,-1,0]),this.labelPlaneMatrix=$e,$e=t.create(),t.scale($e,$e,[1,-1,1]),t.translate($e,$e,[-1,-1,0]),t.scale($e,$e,[2/this.width,2/this.height,1]),this.glCoordMatrix=$e,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),$e=t.invert(new Float64Array(16),this.pixelMatrix),!$e)throw new Error("failed to invert matrix");this.pixelMatrixInverse=$e,this._posMatrixCache={},this._alignedPosMatrixCache={}}},bo.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var W=this.pointCoordinate(new t.Point(0,0)),et=[W.x*this.worldSize,W.y*this.worldSize,0,1],K=t.transformMat4(et,et,this.pixelMatrix);return K[3]/this.cameraToCenterDistance},bo.prototype.getCameraPoint=function(){var W=this._pitch,et=Math.tan(W)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,et))},bo.prototype.getCameraQueryGeometry=function(W){var et=this.getCameraPoint();if(W.length===1)return[W[0],et];for(var K=et.x,pt=et.y,Ct=et.x,Yt=et.y,ce=0,re=W;ce<re.length;ce+=1){var ye=re[ce];K=Math.min(K,ye.x),pt=Math.min(pt,ye.y),Ct=Math.max(Ct,ye.x),Yt=Math.max(Yt,ye.y)}return[new t.Point(K,pt),new t.Point(Ct,pt),new t.Point(Ct,Yt),new t.Point(K,Yt),new t.Point(K,pt)]},Object.defineProperties(bo.prototype,wo);function nl(W,et){var K=!1,pt=null,Ct=function(){pt=null,K&&(W(),pt=setTimeout(Ct,et),K=!1)};return function(){return K=!0,pt||Ct(),pt}}var dl=function(W){this._hashName=W&&encodeURIComponent(W),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=nl(this._updateHashUnthrottled.bind(this),30*1e3/100)};dl.prototype.addTo=function(W){return this._map=W,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},dl.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},dl.prototype.getHashString=function(W){var et=this._map.getCenter(),K=Math.round(this._map.getZoom()*100)/100,pt=Math.ceil((K*Math.LN2+Math.log(512/360/.5))/Math.LN10),Ct=Math.pow(10,pt),Yt=Math.round(et.lng*Ct)/Ct,ce=Math.round(et.lat*Ct)/Ct,re=this._map.getBearing(),ye=this._map.getPitch(),Le="";if(W?Le+="/"+Yt+"/"+ce+"/"+K:Le+=K+"/"+ce+"/"+Yt,(re||ye)&&(Le+="/"+Math.round(re*10)/10),ye&&(Le+="/"+Math.round(ye)),this._hashName){var tr=this._hashName,$e=!1,er=t.window.location.hash.slice(1).split("&").map(function(pr){var wr=pr.split("=")[0];return wr===tr?($e=!0,wr+"="+Le):pr}).filter(function(pr){return pr});return $e||er.push(tr+"="+Le),"#"+er.join("&")}return"#"+Le},dl.prototype._getCurrentHash=function(){var W=this,et=t.window.location.hash.replace("#","");if(this._hashName){var K;return et.split("&").map(function(pt){return pt.split("=")}).forEach(function(pt){pt[0]===W._hashName&&(K=pt)}),(K&&K[1]||"").split("/")}return et.split("/")},dl.prototype._onHashChange=function(){var W=this._getCurrentHash();if(W.length>=3&&!W.some(function(K){return isNaN(K)})){var et=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(W[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+W[2],+W[1]],zoom:+W[0],bearing:et,pitch:+(W[4]||0)}),!0}return!1},dl.prototype._updateHashUnthrottled=function(){var W=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,W)}catch{}};var lu={linearity:.3,easing:t.bezier(0,0,.3,1)},mt=t.extend({deceleration:2500,maxSpeed:1400},lu),St=t.extend({deceleration:20,maxSpeed:1400},lu),Xt=t.extend({deceleration:1e3,maxSpeed:360},lu),se=t.extend({deceleration:1e3,maxSpeed:90},lu),fe=function(W){this._map=W,this.clear()};fe.prototype.clear=function(){this._inertiaBuffer=[]},fe.prototype.record=function(W){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:W})},fe.prototype._drainInertiaBuffer=function(){for(var W=this._inertiaBuffer,et=t.browser.now(),K=160;W.length>0&&et-W[0].time>K;)W.shift()},fe.prototype._onMoveEnd=function(W){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var et={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},K=0,pt=this._inertiaBuffer;K<pt.length;K+=1){var Ct=pt[K],Yt=Ct.settings;et.zoom+=Yt.zoomDelta||0,et.bearing+=Yt.bearingDelta||0,et.pitch+=Yt.pitchDelta||0,Yt.panDelta&&et.pan._add(Yt.panDelta),Yt.around&&(et.around=Yt.around),Yt.pinchAround&&(et.pinchAround=Yt.pinchAround)}var ce=this._inertiaBuffer[this._inertiaBuffer.length-1],re=ce.time-this._inertiaBuffer[0].time,ye={};if(et.pan.mag()){var Le=De(et.pan.mag(),re,t.extend({},mt,W||{}));ye.offset=et.pan.mult(Le.amount/et.pan.mag()),ye.center=this._map.transform.center,ve(ye,Le)}if(et.zoom){var tr=De(et.zoom,re,St);ye.zoom=this._map.transform.zoom+tr.amount,ve(ye,tr)}if(et.bearing){var $e=De(et.bearing,re,Xt);ye.bearing=this._map.transform.bearing+t.clamp($e.amount,-179,179),ve(ye,$e)}if(et.pitch){var er=De(et.pitch,re,se);ye.pitch=this._map.transform.pitch+er.amount,ve(ye,er)}if(ye.zoom||ye.bearing){var pr=et.pinchAround===void 0?et.around:et.pinchAround;ye.around=pr?this._map.unproject(pr):this._map.getCenter()}return this.clear(),t.extend(ye,{noMoveStart:!0})}};function ve(W,et){(!W.duration||W.duration<et.duration)&&(W.duration=et.duration,W.easing=et.easing)}function De(W,et,K){var pt=K.maxSpeed,Ct=K.linearity,Yt=K.deceleration,ce=t.clamp(W*Ct/(et/1e3),-pt,pt),re=Math.abs(ce)/(Yt*Ct);return{easing:K.easing,duration:re*1e3,amount:ce*(re/2)}}var Ce=function(W){function et(pt,Ct,Yt,ce){ce===void 0&&(ce={});var re=r.mousePos(Ct.getCanvasContainer(),Yt),ye=Ct.unproject(re);W.call(this,pt,t.extend({point:re,lngLat:ye,originalEvent:Yt},ce)),this._defaultPrevented=!1,this.target=Ct}W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et;var K={defaultPrevented:{configurable:!0}};return et.prototype.preventDefault=function(){this._defaultPrevented=!0},K.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(et.prototype,K),et}(t.Event),Qe=function(W){function et(pt,Ct,Yt){var ce=pt==="touchend"?Yt.changedTouches:Yt.touches,re=r.touchPos(Ct.getCanvasContainer(),ce),ye=re.map(function($e){return Ct.unproject($e)}),Le=re.reduce(function($e,er,pr,wr){return $e.add(er.div(wr.length))},new t.Point(0,0)),tr=Ct.unproject(Le);W.call(this,pt,{points:re,point:Le,lngLats:ye,lngLat:tr,originalEvent:Yt}),this._defaultPrevented=!1}W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et;var K={defaultPrevented:{configurable:!0}};return et.prototype.preventDefault=function(){this._defaultPrevented=!0},K.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(et.prototype,K),et}(t.Event),Mr=function(W){function et(pt,Ct,Yt){W.call(this,pt,{originalEvent:Yt}),this._defaultPrevented=!1}W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et;var K={defaultPrevented:{configurable:!0}};return et.prototype.preventDefault=function(){this._defaultPrevented=!0},K.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(et.prototype,K),et}(t.Event),br=function(W,et){this._map=W,this._clickTolerance=et.clickTolerance};br.prototype.reset=function(){delete this._mousedownPos},br.prototype.wheel=function(W){return this._firePreventable(new Mr(W.type,this._map,W))},br.prototype.mousedown=function(W,et){return this._mousedownPos=et,this._firePreventable(new Ce(W.type,this._map,W))},br.prototype.mouseup=function(W){this._map.fire(new Ce(W.type,this._map,W))},br.prototype.click=function(W,et){this._mousedownPos&&this._mousedownPos.dist(et)>=this._clickTolerance||this._map.fire(new Ce(W.type,this._map,W))},br.prototype.dblclick=function(W){return this._firePreventable(new Ce(W.type,this._map,W))},br.prototype.mouseover=function(W){this._map.fire(new Ce(W.type,this._map,W))},br.prototype.mouseout=function(W){this._map.fire(new Ce(W.type,this._map,W))},br.prototype.touchstart=function(W){return this._firePreventable(new Qe(W.type,this._map,W))},br.prototype.touchmove=function(W){this._map.fire(new Qe(W.type,this._map,W))},br.prototype.touchend=function(W){this._map.fire(new Qe(W.type,this._map,W))},br.prototype.touchcancel=function(W){this._map.fire(new Qe(W.type,this._map,W))},br.prototype._firePreventable=function(W){if(this._map.fire(W),W.defaultPrevented)return{}},br.prototype.isEnabled=function(){return!0},br.prototype.isActive=function(){return!1},br.prototype.enable=function(){},br.prototype.disable=function(){};var jr=function(W){this._map=W};jr.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},jr.prototype.mousemove=function(W){this._map.fire(new Ce(W.type,this._map,W))},jr.prototype.mousedown=function(){this._delayContextMenu=!0},jr.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ce("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},jr.prototype.contextmenu=function(W){this._delayContextMenu?this._contextMenuEvent=W:this._map.fire(new Ce(W.type,this._map,W)),this._map.listens("contextmenu")&&W.preventDefault()},jr.prototype.isEnabled=function(){return!0},jr.prototype.isActive=function(){return!1},jr.prototype.enable=function(){},jr.prototype.disable=function(){};var Yr=function(W,et){this._map=W,this._el=W.getCanvasContainer(),this._container=W.getContainer(),this._clickTolerance=et.clickTolerance||1};Yr.prototype.isEnabled=function(){return!!this._enabled},Yr.prototype.isActive=function(){return!!this._active},Yr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Yr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Yr.prototype.mousedown=function(W,et){this.isEnabled()&&W.shiftKey&&W.button===0&&(r.disableDrag(),this._startPos=this._lastPos=et,this._active=!0)},Yr.prototype.mousemoveWindow=function(W,et){if(this._active){var K=et;if(!(this._lastPos.equals(K)||!this._box&&K.dist(this._startPos)<this._clickTolerance)){var pt=this._startPos;this._lastPos=K,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",W));var Ct=Math.min(pt.x,K.x),Yt=Math.max(pt.x,K.x),ce=Math.min(pt.y,K.y),re=Math.max(pt.y,K.y);r.setTransform(this._box,"translate("+Ct+"px,"+ce+"px)"),this._box.style.width=Yt-Ct+"px",this._box.style.height=re-ce+"px"}}},Yr.prototype.mouseupWindow=function(W,et){var K=this;if(this._active&&W.button===0){var pt=this._startPos,Ct=et;if(this.reset(),r.suppressClick(),pt.x===Ct.x&&pt.y===Ct.y)this._fireEvent("boxzoomcancel",W);else return this._map.fire(new t.Event("boxzoomend",{originalEvent:W})),{cameraAnimation:function(Yt){return Yt.fitScreenCoordinates(pt,Ct,K._map.getBearing(),{linear:!0})}}}},Yr.prototype.keydown=function(W){this._active&&W.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",W))},Yr.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},Yr.prototype._fireEvent=function(W,et){return this._map.fire(new t.Event(W,{originalEvent:et}))};function tn(W,et){for(var K={},pt=0;pt<W.length;pt++)K[W[pt].identifier]=et[pt];return K}function Rn(W){for(var et=new t.Point(0,0),K=0,pt=W;K<pt.length;K+=1){var Ct=pt[K];et._add(Ct)}return et.div(W.length)}var sn=500,Mn=500,In=30,Dn=function(W){this.reset(),this.numTouches=W.numTouches};Dn.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Dn.prototype.touchstart=function(W,et,K){(this.centroid||K.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=W.timeStamp),K.length===this.numTouches&&(this.centroid=Rn(et),this.touches=tn(K,et)))},Dn.prototype.touchmove=function(W,et,K){if(!(this.aborted||!this.centroid)){var pt=tn(K,et);for(var Ct in this.touches){var Yt=this.touches[Ct],ce=pt[Ct];(!ce||ce.dist(Yt)>In)&&(this.aborted=!0)}}},Dn.prototype.touchend=function(W,et,K){if((!this.centroid||W.timeStamp-this.startTime>Mn)&&(this.aborted=!0),K.length===0){var pt=!this.aborted&&this.centroid;if(this.reset(),pt)return pt}};var jn=function(W){this.singleTap=new Dn(W),this.numTaps=W.numTaps,this.reset()};jn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},jn.prototype.touchstart=function(W,et,K){this.singleTap.touchstart(W,et,K)},jn.prototype.touchmove=function(W,et,K){this.singleTap.touchmove(W,et,K)},jn.prototype.touchend=function(W,et,K){var pt=this.singleTap.touchend(W,et,K);if(pt){var Ct=W.timeStamp-this.lastTime<sn,Yt=!this.lastTap||this.lastTap.dist(pt)<In;if((!Ct||!Yt)&&this.reset(),this.count++,this.lastTime=W.timeStamp,this.lastTap=pt,this.count===this.numTaps)return this.reset(),pt}};var xn=function(){this._zoomIn=new jn({numTouches:1,numTaps:2}),this._zoomOut=new jn({numTouches:2,numTaps:1}),this.reset()};xn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},xn.prototype.touchstart=function(W,et,K){this._zoomIn.touchstart(W,et,K),this._zoomOut.touchstart(W,et,K)},xn.prototype.touchmove=function(W,et,K){this._zoomIn.touchmove(W,et,K),this._zoomOut.touchmove(W,et,K)},xn.prototype.touchend=function(W,et,K){var pt=this,Ct=this._zoomIn.touchend(W,et,K),Yt=this._zoomOut.touchend(W,et,K);if(Ct)return this._active=!0,W.preventDefault(),setTimeout(function(){return pt.reset()},0),{cameraAnimation:function(ce){return ce.easeTo({duration:300,zoom:ce.getZoom()+1,around:ce.unproject(Ct)},{originalEvent:W})}};if(Yt)return this._active=!0,W.preventDefault(),setTimeout(function(){return pt.reset()},0),{cameraAnimation:function(ce){return ce.easeTo({duration:300,zoom:ce.getZoom()-1,around:ce.unproject(Yt)},{originalEvent:W})}}},xn.prototype.touchcancel=function(){this.reset()},xn.prototype.enable=function(){this._enabled=!0},xn.prototype.disable=function(){this._enabled=!1,this.reset()},xn.prototype.isEnabled=function(){return this._enabled},xn.prototype.isActive=function(){return this._active};var _a=0,La=2,$a={};$a[_a]=1,$a[La]=2;function ti(W,et){var K=$a[et];return W.buttons===void 0||(W.buttons&K)!==K}var ii=function(W){this.reset(),this._clickTolerance=W.clickTolerance||1};ii.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},ii.prototype._correctButton=function(W,et){return!1},ii.prototype._move=function(W,et){return{}},ii.prototype.mousedown=function(W,et){if(!this._lastPoint){var K=r.mouseButton(W);this._correctButton(W,K)&&(this._lastPoint=et,this._eventButton=K)}},ii.prototype.mousemoveWindow=function(W,et){var K=this._lastPoint;if(K){if(W.preventDefault(),ti(W,this._eventButton)){this.reset();return}if(!(!this._moved&&et.dist(K)<this._clickTolerance))return this._moved=!0,this._lastPoint=et,this._move(K,et)}},ii.prototype.mouseupWindow=function(W){if(this._lastPoint){var et=r.mouseButton(W);et===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())}},ii.prototype.enable=function(){this._enabled=!0},ii.prototype.disable=function(){this._enabled=!1,this.reset()},ii.prototype.isEnabled=function(){return this._enabled},ii.prototype.isActive=function(){return this._active};var di=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.mousedown=function(K,pt){W.prototype.mousedown.call(this,K,pt),this._lastPoint&&(this._active=!0)},et.prototype._correctButton=function(K,pt){return pt===_a&&!K.ctrlKey},et.prototype._move=function(K,pt){return{around:pt,panDelta:pt.sub(K)}},et}(ii),Io=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype._correctButton=function(K,pt){return pt===_a&&K.ctrlKey||pt===La},et.prototype._move=function(K,pt){var Ct=.8,Yt=(pt.x-K.x)*Ct;if(Yt)return this._active=!0,{bearingDelta:Yt}},et.prototype.contextmenu=function(K){K.preventDefault()},et}(ii),gi=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype._correctButton=function(K,pt){return pt===_a&&K.ctrlKey||pt===La},et.prototype._move=function(K,pt){var Ct=-.5,Yt=(pt.y-K.y)*Ct;if(Yt)return this._active=!0,{pitchDelta:Yt}},et.prototype.contextmenu=function(K){K.preventDefault()},et}(ii),Ji=function(W){this._minTouches=1,this._clickTolerance=W.clickTolerance||1,this.reset()};Ji.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},Ji.prototype.touchstart=function(W,et,K){return this._calculateTransform(W,et,K)},Ji.prototype.touchmove=function(W,et,K){if(!(!this._active||K.length<this._minTouches))return W.preventDefault(),this._calculateTransform(W,et,K)},Ji.prototype.touchend=function(W,et,K){this._calculateTransform(W,et,K),this._active&&K.length<this._minTouches&&this.reset()},Ji.prototype.touchcancel=function(){this.reset()},Ji.prototype._calculateTransform=function(W,et,K){K.length>0&&(this._active=!0);var pt=tn(K,et),Ct=new t.Point(0,0),Yt=new t.Point(0,0),ce=0;for(var re in pt){var ye=pt[re],Le=this._touches[re];Le&&(Ct._add(ye),Yt._add(ye.sub(Le)),ce++,pt[re]=ye)}if(this._touches=pt,!(ce<this._minTouches||!Yt.mag())){var tr=Yt.div(ce);if(this._sum._add(tr),!(this._sum.mag()<this._clickTolerance)){var $e=Ct.div(ce);return{around:$e,panDelta:tr}}}},Ji.prototype.enable=function(){this._enabled=!0},Ji.prototype.disable=function(){this._enabled=!1,this.reset()},Ji.prototype.isEnabled=function(){return this._enabled},Ji.prototype.isActive=function(){return this._active};var qo=function(){this.reset()};qo.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},qo.prototype._start=function(W){},qo.prototype._move=function(W,et,K){return{}},qo.prototype.touchstart=function(W,et,K){this._firstTwoTouches||K.length<2||(this._firstTwoTouches=[K[0].identifier,K[1].identifier],this._start([et[0],et[1]]))},qo.prototype.touchmove=function(W,et,K){if(this._firstTwoTouches){W.preventDefault();var pt=this._firstTwoTouches,Ct=pt[0],Yt=pt[1],ce=Ys(K,et,Ct),re=Ys(K,et,Yt);if(!(!ce||!re)){var ye=this._aroundCenter?null:ce.add(re).div(2);return this._move([ce,re],ye,W)}}},qo.prototype.touchend=function(W,et,K){if(this._firstTwoTouches){var pt=this._firstTwoTouches,Ct=pt[0],Yt=pt[1],ce=Ys(K,et,Ct),re=Ys(K,et,Yt);ce&&re||(this._active&&r.suppressClick(),this.reset())}},qo.prototype.touchcancel=function(){this.reset()},qo.prototype.enable=function(W){this._enabled=!0,this._aroundCenter=!!W&&W.around==="center"},qo.prototype.disable=function(){this._enabled=!1,this.reset()},qo.prototype.isEnabled=function(){return this._enabled},qo.prototype.isActive=function(){return this._active};function Ys(W,et,K){for(var pt=0;pt<W.length;pt++)if(W[pt].identifier===K)return et[pt]}var _s=.1;function Ja(W,et){return Math.log(W/et)/Math.LN2}var yo=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.reset=function(){W.prototype.reset.call(this),delete this._distance,delete this._startDistance},et.prototype._start=function(K){this._startDistance=this._distance=K[0].dist(K[1])},et.prototype._move=function(K,pt){var Ct=this._distance;if(this._distance=K[0].dist(K[1]),!(!this._active&&Math.abs(Ja(this._distance,this._startDistance))<_s))return this._active=!0,{zoomDelta:Ja(this._distance,Ct),pinchAround:pt}},et}(qo),Lo=25;function bs(W,et){return W.angleWith(et)*180/Math.PI}var us=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.reset=function(){W.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},et.prototype._start=function(K){this._startVector=this._vector=K[0].sub(K[1]),this._minDiameter=K[0].dist(K[1])},et.prototype._move=function(K,pt){var Ct=this._vector;if(this._vector=K[0].sub(K[1]),!(!this._active&&this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:bs(this._vector,Ct),pinchAround:pt}},et.prototype._isBelowThreshold=function(K){this._minDiameter=Math.min(this._minDiameter,K.mag());var pt=Math.PI*this._minDiameter,Ct=Lo/pt*360,Yt=bs(K,this._startVector);return Math.abs(Yt)<Ct},et}(qo);function eu(W){return Math.abs(W.y)>Math.abs(W.x)}var Yo=100,gs=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.reset=function(){W.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},et.prototype._start=function(K){this._lastPoints=K,eu(K[0].sub(K[1]))&&(this._valid=!1)},et.prototype._move=function(K,pt,Ct){var Yt=K[0].sub(this._lastPoints[0]),ce=K[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(Yt,ce,Ct.timeStamp),!!this._valid){this._lastPoints=K,this._active=!0;var re=(Yt.y+ce.y)/2,ye=-.5;return{pitchDelta:re*ye}}},et.prototype.gestureBeginsVertically=function(K,pt,Ct){if(this._valid!==void 0)return this._valid;var Yt=2,ce=K.mag()>=Yt,re=pt.mag()>=Yt;if(!(!ce&&!re)){if(!ce||!re)return this._firstMove===void 0&&(this._firstMove=Ct),Ct-this._firstMove<Yo?void 0:!1;var ye=K.y>0==pt.y>0;return eu(K)&&eu(pt)&&ye}},et}(qo),wu={panStep:100,bearingStep:15,pitchStep:10},sr=function(){var W=wu;this._panStep=W.panStep,this._bearingStep=W.bearingStep,this._pitchStep=W.pitchStep,this._rotationDisabled=!1};sr.prototype.reset=function(){this._active=!1},sr.prototype.keydown=function(W){var et=this;if(!(W.altKey||W.ctrlKey||W.metaKey)){var K=0,pt=0,Ct=0,Yt=0,ce=0;switch(W.keyCode){case 61:case 107:case 171:case 187:K=1;break;case 189:case 109:case 173:K=-1;break;case 37:W.shiftKey?pt=-1:(W.preventDefault(),Yt=-1);break;case 39:W.shiftKey?pt=1:(W.preventDefault(),Yt=1);break;case 38:W.shiftKey?Ct=1:(W.preventDefault(),ce=-1);break;case 40:W.shiftKey?Ct=-1:(W.preventDefault(),ce=1);break;default:return}return this._rotationDisabled&&(pt=0,Ct=0),{cameraAnimation:function(re){var ye=re.getZoom();re.easeTo({duration:300,easeId:"keyboardHandler",easing:fn,zoom:K?Math.round(ye)+K*(W.shiftKey?2:1):ye,bearing:re.getBearing()+pt*et._bearingStep,pitch:re.getPitch()+Ct*et._pitchStep,offset:[-Yt*et._panStep,-ce*et._panStep],center:re.getCenter()},{originalEvent:W})}}}},sr.prototype.enable=function(){this._enabled=!0},sr.prototype.disable=function(){this._enabled=!1,this.reset()},sr.prototype.isEnabled=function(){return this._enabled},sr.prototype.isActive=function(){return this._active},sr.prototype.disableRotation=function(){this._rotationDisabled=!0},sr.prototype.enableRotation=function(){this._rotationDisabled=!1};function fn(W){return W*(2-W)}var gn=4.000244140625,ha=1/100,Ta=1/450,ka=2,Cn=function(W,et){this._map=W,this._el=W.getCanvasContainer(),this._handler=et,this._delta=0,this._defaultZoomRate=ha,this._wheelZoomRate=Ta,t.bindAll(["_onTimeout"],this)};Cn.prototype.setZoomRate=function(W){this._defaultZoomRate=W},Cn.prototype.setWheelZoomRate=function(W){this._wheelZoomRate=W},Cn.prototype.isEnabled=function(){return!!this._enabled},Cn.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Cn.prototype.isZooming=function(){return!!this._zooming},Cn.prototype.enable=function(W){this.isEnabled()||(this._enabled=!0,this._aroundCenter=W&&W.around==="center")},Cn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Cn.prototype.wheel=function(W){if(this.isEnabled()){var et=W.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?W.deltaY*40:W.deltaY,K=t.browser.now(),pt=K-(this._lastWheelEventTime||0);this._lastWheelEventTime=K,et!==0&&et%gn===0?this._type="wheel":et!==0&&Math.abs(et)<4?this._type="trackpad":pt>400?(this._type=null,this._lastValue=et,this._timeout=setTimeout(this._onTimeout,40,W)):this._type||(this._type=Math.abs(pt*et)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,et+=this._lastValue)),W.shiftKey&&et&&(et=et/4),this._type&&(this._lastWheelEvent=W,this._delta-=et,this._active||this._start(W)),W.preventDefault()}},Cn.prototype._onTimeout=function(W){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(W)},Cn.prototype._start=function(W){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var et=r.mousePos(this._el,W);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(et)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Cn.prototype.renderFrame=function(){var W=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var et=this._map.transform;if(this._delta!==0){var K=this._type==="wheel"&&Math.abs(this._delta)>gn?this._wheelZoomRate:this._defaultZoomRate,pt=ka/(1+Math.exp(-Math.abs(this._delta*K)));this._delta<0&&pt!==0&&(pt=1/pt);var Ct=typeof this._targetZoom=="number"?et.zoomScale(this._targetZoom):et.scale;this._targetZoom=Math.min(et.maxZoom,Math.max(et.minZoom,et.scaleZoom(Ct*pt))),this._type==="wheel"&&(this._startZoom=et.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var Yt=typeof this._targetZoom=="number"?this._targetZoom:et.zoom,ce=this._startZoom,re=this._easing,ye=!1,Le;if(this._type==="wheel"&&ce&&re){var tr=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),$e=re(tr);Le=t.number(ce,Yt,$e),tr<1?this._frameId||(this._frameId=!0):ye=!0}else Le=Yt,ye=!0;return this._active=!0,ye&&(this._active=!1,this._finishTimeout=setTimeout(function(){W._zooming=!1,W._handler._triggerRenderFrame(),delete W._targetZoom,delete W._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ye,zoomDelta:Le-et.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Cn.prototype._smoothOutEasing=function(W){var et=t.ease;if(this._prevEase){var K=this._prevEase,pt=(t.browser.now()-K.start)/K.duration,Ct=K.easing(pt+.01)-K.easing(pt),Yt=.27/Math.sqrt(Ct*Ct+1e-4)*.01,ce=Math.sqrt(.27*.27-Yt*Yt);et=t.bezier(Yt,ce,.25,1)}return this._prevEase={start:t.browser.now(),duration:W,easing:et},et},Cn.prototype.reset=function(){this._active=!1};var ia=function(W,et){this._clickZoom=W,this._tapZoom=et};ia.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ia.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ia.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ia.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var qa=function(){this.reset()};qa.prototype.reset=function(){this._active=!1},qa.prototype.dblclick=function(W,et){return W.preventDefault(),{cameraAnimation:function(K){K.easeTo({duration:300,zoom:K.getZoom()+(W.shiftKey?-1:1),around:K.unproject(et)},{originalEvent:W})}}},qa.prototype.enable=function(){this._enabled=!0},qa.prototype.disable=function(){this._enabled=!1,this.reset()},qa.prototype.isEnabled=function(){return this._enabled},qa.prototype.isActive=function(){return this._active};var Ra=function(){this._tap=new jn({numTouches:1,numTaps:1}),this.reset()};Ra.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Ra.prototype.touchstart=function(W,et,K){this._swipePoint||(this._tapTime&&W.timeStamp-this._tapTime>sn&&this.reset(),this._tapTime?K.length>0&&(this._swipePoint=et[0],this._swipeTouch=K[0].identifier):this._tap.touchstart(W,et,K))},Ra.prototype.touchmove=function(W,et,K){if(!this._tapTime)this._tap.touchmove(W,et,K);else if(this._swipePoint){if(K[0].identifier!==this._swipeTouch)return;var pt=et[0],Ct=pt.y-this._swipePoint.y;return this._swipePoint=pt,W.preventDefault(),this._active=!0,{zoomDelta:Ct/128}}},Ra.prototype.touchend=function(W,et,K){if(this._tapTime)this._swipePoint&&K.length===0&&this.reset();else{var pt=this._tap.touchend(W,et,K);pt&&(this._tapTime=W.timeStamp)}},Ra.prototype.touchcancel=function(){this.reset()},Ra.prototype.enable=function(){this._enabled=!0},Ra.prototype.disable=function(){this._enabled=!1,this.reset()},Ra.prototype.isEnabled=function(){return this._enabled},Ra.prototype.isActive=function(){return this._active};var ei=function(W,et,K){this._el=W,this._mousePan=et,this._touchPan=K};ei.prototype.enable=function(W){this._inertiaOptions=W||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},ei.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},ei.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},ei.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Ii=function(W,et,K){this._pitchWithRotate=W.pitchWithRotate,this._mouseRotate=et,this._mousePitch=K};Ii.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Ii.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Ii.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Ii.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var wi=function(W,et,K,pt){this._el=W,this._touchZoom=et,this._touchRotate=K,this._tapDragZoom=pt,this._rotationDisabled=!1,this._enabled=!0};wi.prototype.enable=function(W){this._touchZoom.enable(W),this._rotationDisabled||this._touchRotate.enable(W),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},wi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},wi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},wi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},wi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},wi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Ha=function(W){return W.zoom||W.drag||W.pitch||W.rotate},Ca=function(W){function et(){W.apply(this,arguments)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et}(t.Event);function Wn(W){return W.panDelta&&W.panDelta.mag()||W.zoomDelta||W.bearingDelta||W.pitchDelta}var fa=function(W,et){this._map=W,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new fe(W),this._bearingSnap=et.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(et),t.bindAll(["handleEvent","handleWindowEvent"],this);var K=this._el;this._listeners=[[K,"touchstart",{passive:!0}],[K,"touchmove",{passive:!1}],[K,"touchend",void 0],[K,"touchcancel",void 0],[K,"mousedown",void 0],[K,"mousemove",void 0],[K,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[K,"mouseover",void 0],[K,"mouseout",void 0],[K,"dblclick",void 0],[K,"click",void 0],[K,"keydown",{capture:!1}],[K,"keyup",void 0],[K,"wheel",{passive:!1}],[K,"contextmenu",void 0],[t.window,"blur",void 0]];for(var pt=0,Ct=this._listeners;pt<Ct.length;pt+=1){var Yt=Ct[pt],ce=Yt[0],re=Yt[1],ye=Yt[2];r.addEventListener(ce,re,ce===t.window.document?this.handleWindowEvent:this.handleEvent,ye)}};fa.prototype.destroy=function(){for(var W=0,et=this._listeners;W<et.length;W+=1){var K=et[W],pt=K[0],Ct=K[1],Yt=K[2];r.removeEventListener(pt,Ct,pt===t.window.document?this.handleWindowEvent:this.handleEvent,Yt)}},fa.prototype._addDefaultHandlers=function(W){var et=this._map,K=et.getCanvasContainer();this._add("mapEvent",new br(et,W));var pt=et.boxZoom=new Yr(et,W);this._add("boxZoom",pt);var Ct=new xn,Yt=new qa;et.doubleClickZoom=new ia(Yt,Ct),this._add("tapZoom",Ct),this._add("clickZoom",Yt);var ce=new Ra;this._add("tapDragZoom",ce);var re=et.touchPitch=new gs;this._add("touchPitch",re);var ye=new Io(W),Le=new gi(W);et.dragRotate=new Ii(W,ye,Le),this._add("mouseRotate",ye,["mousePitch"]),this._add("mousePitch",Le,["mouseRotate"]);var tr=new di(W),$e=new Ji(W);et.dragPan=new ei(K,tr,$e),this._add("mousePan",tr),this._add("touchPan",$e,["touchZoom","touchRotate"]);var er=new us,pr=new yo;et.touchZoomRotate=new wi(K,pr,er,ce),this._add("touchRotate",er,["touchPan","touchZoom"]),this._add("touchZoom",pr,["touchPan","touchRotate"]);var wr=et.scrollZoom=new Cn(et,this);this._add("scrollZoom",wr,["mousePan"]);var rr=et.keyboard=new sr;this._add("keyboard",rr),this._add("blockableMapEvent",new jr(et));for(var cr=0,hr=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];cr<hr.length;cr+=1){var Vr=hr[cr];W.interactive&&W[Vr]&&et[Vr].enable(W[Vr])}},fa.prototype._add=function(W,et,K){this._handlers.push({handlerName:W,handler:et,allowed:K}),this._handlersById[W]=et},fa.prototype.stop=function(W){if(!this._updatingCamera){for(var et=0,K=this._handlers;et<K.length;et+=1){var pt=K[et],Ct=pt.handler;Ct.reset()}this._inertia.clear(),this._fireEvents({},{},W),this._changes=[]}},fa.prototype.isActive=function(){for(var W=0,et=this._handlers;W<et.length;W+=1){var K=et[W],pt=K.handler;if(pt.isActive())return!0}return!1},fa.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},fa.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},fa.prototype.isMoving=function(){return!!Ha(this._eventsInProgress)||this.isZooming()},fa.prototype._blockedByActive=function(W,et,K){for(var pt in W)if(pt!==K&&(!et||et.indexOf(pt)<0))return!0;return!1},fa.prototype.handleWindowEvent=function(W){this.handleEvent(W,W.type+"Window")},fa.prototype._getMapTouches=function(W){for(var et=[],K=0,pt=W;K<pt.length;K+=1){var Ct=pt[K],Yt=Ct.target;this._el.contains(Yt)&&et.push(Ct)}return et},fa.prototype.handleEvent=function(W,et){if(W.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;for(var K=W.type==="renderFrame"?void 0:W,pt={needsRenderFrame:!1},Ct={},Yt={},ce=W.touches?this._getMapTouches(W.touches):void 0,re=ce?r.touchPos(this._el,ce):r.mousePos(this._el,W),ye=0,Le=this._handlers;ye<Le.length;ye+=1){var tr=Le[ye],$e=tr.handlerName,er=tr.handler,pr=tr.allowed;if(er.isEnabled()){var wr=void 0;this._blockedByActive(Yt,pr,$e)?er.reset():er[et||W.type]&&(wr=er[et||W.type](W,re,ce),this.mergeHandlerResult(pt,Ct,wr,$e,K),wr&&wr.needsRenderFrame&&this._triggerRenderFrame()),(wr||er.isActive())&&(Yt[$e]=er)}}var rr={};for(var cr in this._previousActiveHandlers)Yt[cr]||(rr[cr]=K);this._previousActiveHandlers=Yt,(Object.keys(rr).length||Wn(pt))&&(this._changes.push([pt,Ct,rr]),this._triggerRenderFrame()),(Object.keys(Yt).length||Wn(pt))&&this._map._stop(!0),this._updatingCamera=!1;var hr=pt.cameraAnimation;hr&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],hr(this._map))},fa.prototype.mergeHandlerResult=function(W,et,K,pt,Ct){if(K){t.extend(W,K);var Yt={handlerName:pt,originalEvent:K.originalEvent||Ct};K.zoomDelta!==void 0&&(et.zoom=Yt),K.panDelta!==void 0&&(et.drag=Yt),K.pitchDelta!==void 0&&(et.pitch=Yt),K.bearingDelta!==void 0&&(et.rotate=Yt)}},fa.prototype._applyChanges=function(){for(var W={},et={},K={},pt=0,Ct=this._changes;pt<Ct.length;pt+=1){var Yt=Ct[pt],ce=Yt[0],re=Yt[1],ye=Yt[2];ce.panDelta&&(W.panDelta=(W.panDelta||new t.Point(0,0))._add(ce.panDelta)),ce.zoomDelta&&(W.zoomDelta=(W.zoomDelta||0)+ce.zoomDelta),ce.bearingDelta&&(W.bearingDelta=(W.bearingDelta||0)+ce.bearingDelta),ce.pitchDelta&&(W.pitchDelta=(W.pitchDelta||0)+ce.pitchDelta),ce.around!==void 0&&(W.around=ce.around),ce.pinchAround!==void 0&&(W.pinchAround=ce.pinchAround),ce.noInertia&&(W.noInertia=ce.noInertia),t.extend(et,re),t.extend(K,ye)}this._updateMapTransform(W,et,K),this._changes=[]},fa.prototype._updateMapTransform=function(W,et,K){var pt=this._map,Ct=pt.transform;if(!Wn(W))return this._fireEvents(et,K,!0);var Yt=W.panDelta,ce=W.zoomDelta,re=W.bearingDelta,ye=W.pitchDelta,Le=W.around,tr=W.pinchAround;tr!==void 0&&(Le=tr),pt._stop(!0),Le=Le||pt.transform.centerPoint;var $e=Ct.pointLocation(Yt?Le.sub(Yt):Le);re&&(Ct.bearing+=re),ye&&(Ct.pitch+=ye),ce&&(Ct.zoom+=ce),Ct.setLocationAtPoint($e,Le),this._map._update(),W.noInertia||this._inertia.record(W),this._fireEvents(et,K,!0)},fa.prototype._fireEvents=function(W,et,K){var pt=this,Ct=Ha(this._eventsInProgress),Yt=Ha(W),ce={};for(var re in W){var ye=W[re],Le=ye.originalEvent;this._eventsInProgress[re]||(ce[re+"start"]=Le),this._eventsInProgress[re]=W[re]}!Ct&&Yt&&this._fireEvent("movestart",Yt.originalEvent);for(var tr in ce)this._fireEvent(tr,ce[tr]);Yt&&this._fireEvent("move",Yt.originalEvent);for(var $e in W){var er=W[$e],pr=er.originalEvent;this._fireEvent($e,pr)}var wr={},rr;for(var cr in this._eventsInProgress){var hr=this._eventsInProgress[cr],Vr=hr.handlerName,yn=hr.originalEvent;this._handlersById[Vr].isActive()||(delete this._eventsInProgress[cr],rr=et[Vr]||yn,wr[cr+"end"]=rr)}for(var wn in wr)this._fireEvent(wn,wr[wn]);var $n=Ha(this._eventsInProgress);if(K&&(Ct||Yt)&&!$n){this._updatingCamera=!0;var Xn=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Vn=function(ca){return ca!==0&&-pt._bearingSnap<ca&&ca<pt._bearingSnap};Xn?(Vn(Xn.bearing||this._map.getBearing())&&(Xn.bearing=0),this._map.easeTo(Xn,{originalEvent:rr})):(this._map.fire(new t.Event("moveend",{originalEvent:rr})),Vn(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},fa.prototype._fireEvent=function(W,et){this._map.fire(new t.Event(W,et?{originalEvent:et}:{}))},fa.prototype._requestFrame=function(){var W=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(et){delete W._frameId,W.handleEvent(new Ca("renderFrame",{timeStamp:et})),W._applyChanges()})},fa.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var Ga=function(W){function et(K,pt){W.call(this),this._moving=!1,this._zooming=!1,this.transform=K,this._bearingSnap=pt.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},et.prototype.setCenter=function(K,pt){return this.jumpTo({center:K},pt)},et.prototype.panBy=function(K,pt,Ct){return K=t.Point.convert(K).mult(-1),this.panTo(this.transform.center,t.extend({offset:K},pt),Ct)},et.prototype.panTo=function(K,pt,Ct){return this.easeTo(t.extend({center:K},pt),Ct)},et.prototype.getZoom=function(){return this.transform.zoom},et.prototype.setZoom=function(K,pt){return this.jumpTo({zoom:K},pt),this},et.prototype.zoomTo=function(K,pt,Ct){return this.easeTo(t.extend({zoom:K},pt),Ct)},et.prototype.zoomIn=function(K,pt){return this.zoomTo(this.getZoom()+1,K,pt),this},et.prototype.zoomOut=function(K,pt){return this.zoomTo(this.getZoom()-1,K,pt),this},et.prototype.getBearing=function(){return this.transform.bearing},et.prototype.setBearing=function(K,pt){return this.jumpTo({bearing:K},pt),this},et.prototype.getPadding=function(){return this.transform.padding},et.prototype.setPadding=function(K,pt){return this.jumpTo({padding:K},pt),this},et.prototype.rotateTo=function(K,pt,Ct){return this.easeTo(t.extend({bearing:K},pt),Ct)},et.prototype.resetNorth=function(K,pt){return this.rotateTo(0,t.extend({duration:1e3},K),pt),this},et.prototype.resetNorthPitch=function(K,pt){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},K),pt),this},et.prototype.snapToNorth=function(K,pt){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(K,pt):this},et.prototype.getPitch=function(){return this.transform.pitch},et.prototype.setPitch=function(K,pt){return this.jumpTo({pitch:K},pt),this},et.prototype.cameraForBounds=function(K,pt){K=t.LngLatBounds.convert(K);var Ct=pt&&pt.bearing||0;return this._cameraForBoxAndBearing(K.getNorthWest(),K.getSouthEast(),Ct,pt)},et.prototype._cameraForBoxAndBearing=function(K,pt,Ct,Yt){var ce={top:0,bottom:0,right:0,left:0};if(Yt=t.extend({padding:ce,offset:[0,0],maxZoom:this.transform.maxZoom},Yt),typeof Yt.padding=="number"){var re=Yt.padding;Yt.padding={top:re,bottom:re,right:re,left:re}}Yt.padding=t.extend(ce,Yt.padding);var ye=this.transform,Le=ye.padding,tr=ye.project(t.LngLat.convert(K)),$e=ye.project(t.LngLat.convert(pt)),er=tr.rotate(-Ct*Math.PI/180),pr=$e.rotate(-Ct*Math.PI/180),wr=new t.Point(Math.max(er.x,pr.x),Math.max(er.y,pr.y)),rr=new t.Point(Math.min(er.x,pr.x),Math.min(er.y,pr.y)),cr=wr.sub(rr),hr=(ye.width-(Le.left+Le.right+Yt.padding.left+Yt.padding.right))/cr.x,Vr=(ye.height-(Le.top+Le.bottom+Yt.padding.top+Yt.padding.bottom))/cr.y;if(Vr<0||hr<0){t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");return}var yn=Math.min(ye.scaleZoom(ye.scale*Math.min(hr,Vr)),Yt.maxZoom),wn=typeof Yt.offset.x=="number"?new t.Point(Yt.offset.x,Yt.offset.y):t.Point.convert(Yt.offset),$n=(Yt.padding.left-Yt.padding.right)/2,Xn=(Yt.padding.top-Yt.padding.bottom)/2,Vn=new t.Point($n,Xn),ca=Vn.rotate(Ct*Math.PI/180),ea=wn.add(ca),wa=ea.mult(ye.scale/ye.zoomScale(yn)),da=ye.unproject(tr.add($e).div(2).sub(wa));return{center:da,zoom:yn,bearing:Ct}},et.prototype.fitBounds=function(K,pt,Ct){return this._fitInternal(this.cameraForBounds(K,pt),pt,Ct)},et.prototype.fitScreenCoordinates=function(K,pt,Ct,Yt,ce){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(K)),this.transform.pointLocation(t.Point.convert(pt)),Ct,Yt),Yt,ce)},et.prototype._fitInternal=function(K,pt,Ct){return K?(pt=t.extend(K,pt),delete pt.padding,pt.linear?this.easeTo(pt,Ct):this.flyTo(pt,Ct)):this},et.prototype.jumpTo=function(K,pt){this.stop();var Ct=this.transform,Yt=!1,ce=!1,re=!1;return"zoom"in K&&Ct.zoom!==+K.zoom&&(Yt=!0,Ct.zoom=+K.zoom),K.center!==void 0&&(Ct.center=t.LngLat.convert(K.center)),"bearing"in K&&Ct.bearing!==+K.bearing&&(ce=!0,Ct.bearing=+K.bearing),"pitch"in K&&Ct.pitch!==+K.pitch&&(re=!0,Ct.pitch=+K.pitch),K.padding!=null&&!Ct.isPaddingEqual(K.padding)&&(Ct.padding=K.padding),this.fire(new t.Event("movestart",pt)).fire(new t.Event("move",pt)),Yt&&this.fire(new t.Event("zoomstart",pt)).fire(new t.Event("zoom",pt)).fire(new t.Event("zoomend",pt)),ce&&this.fire(new t.Event("rotatestart",pt)).fire(new t.Event("rotate",pt)).fire(new t.Event("rotateend",pt)),re&&this.fire(new t.Event("pitchstart",pt)).fire(new t.Event("pitch",pt)).fire(new t.Event("pitchend",pt)),this.fire(new t.Event("moveend",pt))},et.prototype.easeTo=function(K,pt){var Ct=this;this._stop(!1,K.easeId),K=t.extend({offset:[0,0],duration:500,easing:t.ease},K),(K.animate===!1||!K.essential&&t.browser.prefersReducedMotion)&&(K.duration=0);var Yt=this.transform,ce=this.getZoom(),re=this.getBearing(),ye=this.getPitch(),Le=this.getPadding(),tr="zoom"in K?+K.zoom:ce,$e="bearing"in K?this._normalizeBearing(K.bearing,re):re,er="pitch"in K?+K.pitch:ye,pr="padding"in K?K.padding:Yt.padding,wr=t.Point.convert(K.offset),rr=Yt.centerPoint.add(wr),cr=Yt.pointLocation(rr),hr=t.LngLat.convert(K.center||cr);this._normalizeCenter(hr);var Vr=Yt.project(cr),yn=Yt.project(hr).sub(Vr),wn=Yt.zoomScale(tr-ce),$n,Xn;K.around&&($n=t.LngLat.convert(K.around),Xn=Yt.locationPoint($n));var Vn={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||tr!==ce,this._rotating=this._rotating||re!==$e,this._pitching=this._pitching||er!==ye,this._padding=!Yt.isPaddingEqual(pr),this._easeId=K.easeId,this._prepareEase(pt,K.noMoveStart,Vn),this._ease(function(ca){if(Ct._zooming&&(Yt.zoom=t.number(ce,tr,ca)),Ct._rotating&&(Yt.bearing=t.number(re,$e,ca)),Ct._pitching&&(Yt.pitch=t.number(ye,er,ca)),Ct._padding&&(Yt.interpolatePadding(Le,pr,ca),rr=Yt.centerPoint.add(wr)),$n)Yt.setLocationAtPoint($n,Xn);else{var ea=Yt.zoomScale(Yt.zoom-ce),wa=tr>ce?Math.min(2,wn):Math.max(.5,wn),da=Math.pow(wa,1-ca),pa=Yt.unproject(Vr.add(yn.mult(ca*da)).mult(ea));Yt.setLocationAtPoint(Yt.renderWorldCopies?pa.wrap():pa,rr)}Ct._fireMoveEvents(pt)},function(ca){Ct._afterEase(pt,ca)},K),this},et.prototype._prepareEase=function(K,pt,Ct){Ct===void 0&&(Ct={}),this._moving=!0,!pt&&!Ct.moving&&this.fire(new t.Event("movestart",K)),this._zooming&&!Ct.zooming&&this.fire(new t.Event("zoomstart",K)),this._rotating&&!Ct.rotating&&this.fire(new t.Event("rotatestart",K)),this._pitching&&!Ct.pitching&&this.fire(new t.Event("pitchstart",K))},et.prototype._fireMoveEvents=function(K){this.fire(new t.Event("move",K)),this._zooming&&this.fire(new t.Event("zoom",K)),this._rotating&&this.fire(new t.Event("rotate",K)),this._pitching&&this.fire(new t.Event("pitch",K))},et.prototype._afterEase=function(K,pt){if(!(this._easeId&&pt&&this._easeId===pt)){delete this._easeId;var Ct=this._zooming,Yt=this._rotating,ce=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Ct&&this.fire(new t.Event("zoomend",K)),Yt&&this.fire(new t.Event("rotateend",K)),ce&&this.fire(new t.Event("pitchend",K)),this.fire(new t.Event("moveend",K))}},et.prototype.flyTo=function(K,pt){var Ct=this;if(!K.essential&&t.browser.prefersReducedMotion){var Yt=t.pick(K,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Yt,pt)}this.stop(),K=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},K);var ce=this.transform,re=this.getZoom(),ye=this.getBearing(),Le=this.getPitch(),tr=this.getPadding(),$e="zoom"in K?t.clamp(+K.zoom,ce.minZoom,ce.maxZoom):re,er="bearing"in K?this._normalizeBearing(K.bearing,ye):ye,pr="pitch"in K?+K.pitch:Le,wr="padding"in K?K.padding:ce.padding,rr=ce.zoomScale($e-re),cr=t.Point.convert(K.offset),hr=ce.centerPoint.add(cr),Vr=ce.pointLocation(hr),yn=t.LngLat.convert(K.center||Vr);this._normalizeCenter(yn);var wn=ce.project(Vr),$n=ce.project(yn).sub(wn),Xn=K.curve,Vn=Math.max(ce.width,ce.height),ca=Vn/rr,ea=$n.mag();if("minZoom"in K){var wa=t.clamp(Math.min(K.minZoom,re,$e),ce.minZoom,ce.maxZoom),da=Vn/ce.zoomScale(wa-re);Xn=Math.sqrt(da/ea*2)}var pa=Xn*Xn;function Ua(eo){var Ss=(ca*ca-Vn*Vn+(eo?-1:1)*pa*pa*ea*ea)/(2*(eo?ca:Vn)*pa*ea);return Math.log(Math.sqrt(Ss*Ss+1)-Ss)}function Di(eo){return(Math.exp(eo)-Math.exp(-eo))/2}function ui(eo){return(Math.exp(eo)+Math.exp(-eo))/2}function ji(eo){return Di(eo)/ui(eo)}var uo=Ua(0),cs=function(eo){return ui(uo)/ui(uo+Xn*eo)},Ts=function(eo){return Vn*((ui(uo)*ji(uo+Xn*eo)-Di(uo))/pa)/ea},is=(Ua(1)-uo)/Xn;if(Math.abs(ea)<1e-6||!isFinite(is)){if(Math.abs(Vn-ca)<1e-6)return this.easeTo(K,pt);var hs=ca<Vn?-1:1;is=Math.abs(Math.log(ca/Vn))/Xn,Ts=function(){return 0},cs=function(eo){return Math.exp(hs*Xn*eo)}}if("duration"in K)K.duration=+K.duration;else{var il="screenSpeed"in K?+K.screenSpeed/Xn:+K.speed;K.duration=1e3*is/il}return K.maxDuration&&K.duration>K.maxDuration&&(K.duration=0),this._zooming=!0,this._rotating=ye!==er,this._pitching=pr!==Le,this._padding=!ce.isPaddingEqual(wr),this._prepareEase(pt,!1),this._ease(function(eo){var Ss=eo*is,Du=1/cs(Ss);ce.zoom=eo===1?$e:re+ce.scaleZoom(Du),Ct._rotating&&(ce.bearing=t.number(ye,er,eo)),Ct._pitching&&(ce.pitch=t.number(Le,pr,eo)),Ct._padding&&(ce.interpolatePadding(tr,wr,eo),hr=ce.centerPoint.add(cr));var uc=eo===1?yn:ce.unproject(wn.add($n.mult(Ts(Ss))).mult(Du));ce.setLocationAtPoint(ce.renderWorldCopies?uc.wrap():uc,hr),Ct._fireMoveEvents(pt)},function(){return Ct._afterEase(pt)},K),this},et.prototype.isEasing=function(){return!!this._easeFrameId},et.prototype.stop=function(){return this._stop()},et.prototype._stop=function(K,pt){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var Ct=this._onEaseEnd;delete this._onEaseEnd,Ct.call(this,pt)}if(!K){var Yt=this.handlers;Yt&&Yt.stop(!1)}return this},et.prototype._ease=function(K,pt,Ct){Ct.animate===!1||Ct.duration===0?(K(1),pt()):(this._easeStart=t.browser.now(),this._easeOptions=Ct,this._onEaseFrame=K,this._onEaseEnd=pt,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},et.prototype._renderFrameCallback=function(){var K=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(K)),K<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},et.prototype._normalizeBearing=function(K,pt){K=t.wrap(K,-180,180);var Ct=Math.abs(K-pt);return Math.abs(K-360-pt)<Ct&&(K-=360),Math.abs(K+360-pt)<Ct&&(K+=360),K},et.prototype._normalizeCenter=function(K){var pt=this.transform;if(!(!pt.renderWorldCopies||pt.lngRange)){var Ct=K.lng-pt.center.lng;K.lng+=Ct>180?-360:Ct<-180?360:0}},et}(t.Evented),Aa=function(W){W===void 0&&(W={}),this.options=W,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Aa.prototype.getDefaultPosition=function(){return"bottom-right"},Aa.prototype.onAdd=function(W){var et=this.options&&this.options.compact;return this._map=W,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),et&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),et===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Aa.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Aa.prototype._setElementTitle=function(W,et){var K=this._map._getUIString("AttributionControl."+et);W.title=K,W.setAttribute("aria-label",K)},Aa.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Aa.prototype._updateEditLink=function(){var W=this._editLink;W||(W=this._editLink=this._container.querySelector(".mapbox-improve-map"));var et=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(W){var K=et.reduce(function(pt,Ct,Yt){return Ct.value&&(pt+=Ct.key+"="+Ct.value+(Yt<et.length-1?"&":"")),pt},"?");W.href=t.config.FEEDBACK_URL+"/"+K+(this._map._hash?this._map._hash.getHashString(!0):""),W.rel="noopener nofollow",this._setElementTitle(W,"MapFeedback")}},Aa.prototype._updateData=function(W){W&&(W.sourceDataType==="metadata"||W.sourceDataType==="visibility"||W.dataType==="style")&&(this._updateAttributions(),this._updateEditLink())},Aa.prototype._updateAttributions=function(){if(this._map.style){var W=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?W=W.concat(this.options.customAttribution.map(function(re){return typeof re!="string"?"":re})):typeof this.options.customAttribution=="string"&&W.push(this.options.customAttribution)),this._map.style.stylesheet){var et=this._map.style.stylesheet;this.styleOwner=et.owner,this.styleId=et.id}var K=this._map.style.sourceCaches;for(var pt in K){var Ct=K[pt];if(Ct.used){var Yt=Ct.getSource();Yt.attribution&&W.indexOf(Yt.attribution)<0&&W.push(Yt.attribution)}}W.sort(function(re,ye){return re.length-ye.length}),W=W.filter(function(re,ye){for(var Le=ye+1;Le<W.length;Le++)if(W[Le].indexOf(re)>=0)return!1;return!0});var ce=W.join(" | ");ce!==this._attribHTML&&(this._attribHTML=ce,W.length?(this._innerContainer.innerHTML=ce,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Aa.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var xa=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};xa.prototype.onAdd=function(W){this._map=W,this._container=r.create("div","mapboxgl-ctrl");var et=r.create("a","mapboxgl-ctrl-logo");return et.target="_blank",et.rel="noopener nofollow",et.href="https://www.mapbox.com/",et.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),et.setAttribute("rel","noopener nofollow"),this._container.appendChild(et),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},xa.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},xa.prototype.getDefaultPosition=function(){return"bottom-left"},xa.prototype._updateLogo=function(W){(!W||W.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},xa.prototype._logoRequired=function(){if(this._map.style){var W=this._map.style.sourceCaches;for(var et in W){var K=W[et].getSource();if(K.mapbox_logo)return!0}return!1}},xa.prototype._updateCompact=function(){var W=this._container.children;if(W.length){var et=W[0];this._map.getCanvasContainer().offsetWidth<250?et.classList.add("mapboxgl-compact"):et.classList.remove("mapboxgl-compact")}};var Ti=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ti.prototype.add=function(W){var et=++this._id,K=this._queue;return K.push({callback:W,id:et,cancelled:!1}),et},Ti.prototype.remove=function(W){for(var et=this._currentlyRunning,K=et?this._queue.concat(et):this._queue,pt=0,Ct=K;pt<Ct.length;pt+=1){var Yt=Ct[pt];if(Yt.id===W){Yt.cancelled=!0;return}}},Ti.prototype.run=function(W){W===void 0&&(W=0);var et=this._currentlyRunning=this._queue;this._queue=[];for(var K=0,pt=et;K<pt.length;K+=1){var Ct=pt[K];if(!Ct.cancelled&&(Ct.callback(W),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Ti.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var fi={"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"},_i=t.window.HTMLImageElement,Ia=t.window.HTMLElement,Ma=t.window.ImageBitmap,ki=-2,hi=22,Wa=0,Qa=60,xi={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:ki,maxZoom:hi,minPitch:Wa,maxPitch:Qa,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Wo=function(W){function et(pt){var Ct=this;if(pt=t.extend({},xi,pt),pt.minZoom!=null&&pt.maxZoom!=null&&pt.minZoom>pt.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(pt.minPitch!=null&&pt.maxPitch!=null&&pt.minPitch>pt.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(pt.minPitch!=null&&pt.minPitch<Wa)throw new Error("minPitch must be greater than or equal to "+Wa);if(pt.maxPitch!=null&&pt.maxPitch>Qa)throw new Error("maxPitch must be less than or equal to "+Qa);var Yt=new bo(pt.minZoom,pt.maxZoom,pt.minPitch,pt.maxPitch,pt.renderWorldCopies);if(W.call(this,Yt,pt),this._interactive=pt.interactive,this._maxTileCacheSize=pt.maxTileCacheSize,this._failIfMajorPerformanceCaveat=pt.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=pt.preserveDrawingBuffer,this._antialias=pt.antialias,this._trackResize=pt.trackResize,this._bearingSnap=pt.bearingSnap,this._refreshExpiredTiles=pt.refreshExpiredTiles,this._fadeDuration=pt.fadeDuration,this._crossSourceCollisions=pt.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=pt.collectResourceTiming,this._renderTaskQueue=new Ti,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},fi,pt.locale),this._clickTolerance=pt.clickTolerance,this._requestManager=new t.RequestManager(pt.transformRequest,pt.accessToken),typeof pt.container=="string"){if(this._container=t.window.document.getElementById(pt.container),!this._container)throw new Error("Container '"+pt.container+"' not found.")}else if(pt.container instanceof Ia)this._container=pt.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(pt.maxBounds&&this.setMaxBounds(pt.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return Ct._update(!1)}),this.on("moveend",function(){return Ct._update(!1)}),this.on("zoom",function(){return Ct._update(!0)}),typeof t.window<"u"&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new fa(this,pt);var ce=typeof pt.hash=="string"&&pt.hash||void 0;this._hash=pt.hash&&new dl(ce).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:pt.center,zoom:pt.zoom,bearing:pt.bearing,pitch:pt.pitch}),pt.bounds&&(this.resize(),this.fitBounds(pt.bounds,t.extend({},pt.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=pt.localIdeographFontFamily,pt.style&&this.setStyle(pt.style,{localIdeographFontFamily:pt.localIdeographFontFamily}),pt.attributionControl&&this.addControl(new Aa({customAttribution:pt.customAttribution})),this.addControl(new xa,pt.logoPosition),this.on("style.load",function(){Ct.transform.unmodified&&Ct.jumpTo(Ct.style.stylesheet)}),this.on("data",function(re){Ct._update(re.dataType==="style"),Ct.fire(new t.Event(re.dataType+"data",re))}),this.on("dataloading",function(re){Ct.fire(new t.Event(re.dataType+"dataloading",re))})}W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et;var K={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return et.prototype._getMapId=function(){return this._mapId},et.prototype.addControl=function(pt,Ct){if(Ct===void 0&&(pt.getDefaultPosition?Ct=pt.getDefaultPosition():Ct="top-right"),!pt||!pt.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var Yt=pt.onAdd(this);this._controls.push(pt);var ce=this._controlPositions[Ct];return Ct.indexOf("bottom")!==-1?ce.insertBefore(Yt,ce.firstChild):ce.appendChild(Yt),this},et.prototype.removeControl=function(pt){if(!pt||!pt.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var Ct=this._controls.indexOf(pt);return Ct>-1&&this._controls.splice(Ct,1),pt.onRemove(this),this},et.prototype.hasControl=function(pt){return this._controls.indexOf(pt)>-1},et.prototype.resize=function(pt){var Ct=this._containerDimensions(),Yt=Ct[0],ce=Ct[1];this._resizeCanvas(Yt,ce),this.transform.resize(Yt,ce),this.painter.resize(Yt,ce);var re=!this._moving;return re&&(this.stop(),this.fire(new t.Event("movestart",pt)).fire(new t.Event("move",pt))),this.fire(new t.Event("resize",pt)),re&&this.fire(new t.Event("moveend",pt)),this},et.prototype.getBounds=function(){return this.transform.getBounds()},et.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},et.prototype.setMaxBounds=function(pt){return this.transform.setMaxBounds(t.LngLatBounds.convert(pt)),this._update()},et.prototype.setMinZoom=function(pt){if(pt=pt??ki,pt>=ki&&pt<=this.transform.maxZoom)return this.transform.minZoom=pt,this._update(),this.getZoom()<pt&&this.setZoom(pt),this;throw new Error("minZoom must be between "+ki+" and the current maxZoom, inclusive")},et.prototype.getMinZoom=function(){return this.transform.minZoom},et.prototype.setMaxZoom=function(pt){if(pt=pt??hi,pt>=this.transform.minZoom)return this.transform.maxZoom=pt,this._update(),this.getZoom()>pt&&this.setZoom(pt),this;throw new Error("maxZoom must be greater than the current minZoom")},et.prototype.getMaxZoom=function(){return this.transform.maxZoom},et.prototype.setMinPitch=function(pt){if(pt=pt??Wa,pt<Wa)throw new Error("minPitch must be greater than or equal to "+Wa);if(pt>=Wa&&pt<=this.transform.maxPitch)return this.transform.minPitch=pt,this._update(),this.getPitch()<pt&&this.setPitch(pt),this;throw new Error("minPitch must be between "+Wa+" and the current maxPitch, inclusive")},et.prototype.getMinPitch=function(){return this.transform.minPitch},et.prototype.setMaxPitch=function(pt){if(pt=pt??Qa,pt>Qa)throw new Error("maxPitch must be less than or equal to "+Qa);if(pt>=this.transform.minPitch)return this.transform.maxPitch=pt,this._update(),this.getPitch()>pt&&this.setPitch(pt),this;throw new Error("maxPitch must be greater than the current minPitch")},et.prototype.getMaxPitch=function(){return this.transform.maxPitch},et.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},et.prototype.setRenderWorldCopies=function(pt){return this.transform.renderWorldCopies=pt,this._update()},et.prototype.project=function(pt){return this.transform.locationPoint(t.LngLat.convert(pt))},et.prototype.unproject=function(pt){return this.transform.pointLocation(t.Point.convert(pt))},et.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},et.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},et.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},et.prototype._createDelegatedListener=function(pt,Ct,Yt){var ce=this,re;if(pt==="mouseenter"||pt==="mouseover"){var ye=!1,Le=function(rr){var cr=ce.getLayer(Ct)?ce.queryRenderedFeatures(rr.point,{layers:[Ct]}):[];cr.length?ye||(ye=!0,Yt.call(ce,new Ce(pt,ce,rr.originalEvent,{features:cr}))):ye=!1},tr=function(){ye=!1};return{layer:Ct,listener:Yt,delegates:{mousemove:Le,mouseout:tr}}}else if(pt==="mouseleave"||pt==="mouseout"){var $e=!1,er=function(rr){var cr=ce.getLayer(Ct)?ce.queryRenderedFeatures(rr.point,{layers:[Ct]}):[];cr.length?$e=!0:$e&&($e=!1,Yt.call(ce,new Ce(pt,ce,rr.originalEvent)))},pr=function(rr){$e&&($e=!1,Yt.call(ce,new Ce(pt,ce,rr.originalEvent)))};return{layer:Ct,listener:Yt,delegates:{mousemove:er,mouseout:pr}}}else{var wr=function(rr){var cr=ce.getLayer(Ct)?ce.queryRenderedFeatures(rr.point,{layers:[Ct]}):[];cr.length&&(rr.features=cr,Yt.call(ce,rr),delete rr.features)};return{layer:Ct,listener:Yt,delegates:(re={},re[pt]=wr,re)}}},et.prototype.on=function(pt,Ct,Yt){if(Yt===void 0)return W.prototype.on.call(this,pt,Ct);var ce=this._createDelegatedListener(pt,Ct,Yt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[pt]=this._delegatedListeners[pt]||[],this._delegatedListeners[pt].push(ce);for(var re in ce.delegates)this.on(re,ce.delegates[re]);return this},et.prototype.once=function(pt,Ct,Yt){if(Yt===void 0)return W.prototype.once.call(this,pt,Ct);var ce=this._createDelegatedListener(pt,Ct,Yt);for(var re in ce.delegates)this.once(re,ce.delegates[re]);return this},et.prototype.off=function(pt,Ct,Yt){var ce=this;if(Yt===void 0)return W.prototype.off.call(this,pt,Ct);var re=function(ye){for(var Le=ye[pt],tr=0;tr<Le.length;tr++){var $e=Le[tr];if($e.layer===Ct&&$e.listener===Yt){for(var er in $e.delegates)ce.off(er,$e.delegates[er]);return Le.splice(tr,1),ce}}};return this._delegatedListeners&&this._delegatedListeners[pt]&&re(this._delegatedListeners),this},et.prototype.queryRenderedFeatures=function(pt,Ct){if(!this.style)return[];Ct===void 0&&pt!==void 0&&!(pt instanceof t.Point)&&!Array.isArray(pt)&&(Ct=pt,pt=void 0),Ct=Ct||{},pt=pt||[[0,0],[this.transform.width,this.transform.height]];var Yt;if(pt instanceof t.Point||typeof pt[0]=="number")Yt=[t.Point.convert(pt)];else{var ce=t.Point.convert(pt[0]),re=t.Point.convert(pt[1]);Yt=[ce,new t.Point(re.x,ce.y),re,new t.Point(ce.x,re.y),ce]}return this.style.queryRenderedFeatures(Yt,Ct,this.transform)},et.prototype.querySourceFeatures=function(pt,Ct){return this.style.querySourceFeatures(pt,Ct)},et.prototype.setStyle=function(pt,Ct){return Ct=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},Ct),Ct.diff!==!1&&Ct.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&pt?(this._diffStyle(pt,Ct),this):(this._localIdeographFontFamily=Ct.localIdeographFontFamily,this._updateStyle(pt,Ct))},et.prototype._getUIString=function(pt){var Ct=this._locale[pt];if(Ct==null)throw new Error("Missing UI string '"+pt+"'");return Ct},et.prototype._updateStyle=function(pt,Ct){if(this.style&&(this.style.setEventedParent(null),this.style._remove()),pt)this.style=new El(this,Ct||{});else return delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),typeof pt=="string"?this.style.loadURL(pt):this.style.loadJSON(pt),this},et.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new El(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},et.prototype._diffStyle=function(pt,Ct){var Yt=this;if(typeof pt=="string"){var ce=this._requestManager.normalizeStyleURL(pt),re=this._requestManager.transformRequest(ce,t.ResourceType.Style);t.getJSON(re,function(ye,Le){ye?Yt.fire(new t.ErrorEvent(ye)):Le&&Yt._updateDiff(Le,Ct)})}else typeof pt=="object"&&this._updateDiff(pt,Ct)},et.prototype._updateDiff=function(pt,Ct){try{this.style.setState(pt)&&this._update(!0)}catch(Yt){t.warnOnce("Unable to perform style diff: "+(Yt.message||Yt.error||Yt)+". Rebuilding the style from scratch."),this._updateStyle(pt,Ct)}},et.prototype.getStyle=function(){if(this.style)return this.style.serialize()},et.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},et.prototype.addSource=function(pt,Ct){return this._lazyInitEmptyStyle(),this.style.addSource(pt,Ct),this._update(!0)},et.prototype.isSourceLoaded=function(pt){var Ct=this.style&&this.style.sourceCaches[pt];if(Ct===void 0){this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+pt+"'")));return}return Ct.loaded()},et.prototype.areTilesLoaded=function(){var pt=this.style&&this.style.sourceCaches;for(var Ct in pt){var Yt=pt[Ct],ce=Yt._tiles;for(var re in ce){var ye=ce[re];if(!(ye.state==="loaded"||ye.state==="errored"))return!1}}return!0},et.prototype.addSourceType=function(pt,Ct,Yt){return this._lazyInitEmptyStyle(),this.style.addSourceType(pt,Ct,Yt)},et.prototype.removeSource=function(pt){return this.style.removeSource(pt),this._update(!0)},et.prototype.getSource=function(pt){return this.style.getSource(pt)},et.prototype.addImage=function(pt,Ct,Yt){Yt===void 0&&(Yt={});var ce=Yt.pixelRatio;ce===void 0&&(ce=1);var re=Yt.sdf;re===void 0&&(re=!1);var ye=Yt.stretchX,Le=Yt.stretchY,tr=Yt.content;this._lazyInitEmptyStyle();var $e=0;if(Ct instanceof _i||Ma&&Ct instanceof Ma){var er=t.browser.getImageData(Ct),pr=er.width,wr=er.height,rr=er.data;this.style.addImage(pt,{data:new t.RGBAImage({width:pr,height:wr},rr),pixelRatio:ce,stretchX:ye,stretchY:Le,content:tr,sdf:re,version:$e})}else{if(Ct.width===void 0||Ct.height===void 0)return this.fire(new t.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`")));var cr=Ct.width,hr=Ct.height,Vr=Ct.data,yn=Ct;this.style.addImage(pt,{data:new t.RGBAImage({width:cr,height:hr},new Uint8Array(Vr)),pixelRatio:ce,stretchX:ye,stretchY:Le,content:tr,sdf:re,version:$e,userImage:yn}),yn.onAdd&&yn.onAdd(this,pt)}},et.prototype.updateImage=function(pt,Ct){var Yt=this.style.getImage(pt);if(!Yt)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var ce=Ct instanceof _i||Ma&&Ct instanceof Ma?t.browser.getImageData(Ct):Ct,re=ce.width,ye=ce.height,Le=ce.data;if(re===void 0||ye===void 0)return this.fire(new t.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(re!==Yt.data.width||ye!==Yt.data.height)return this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var tr=!(Ct instanceof _i||Ma&&Ct instanceof Ma);Yt.data.replace(Le,tr),this.style.updateImage(pt,Yt)},et.prototype.hasImage=function(pt){return pt?!!this.style.getImage(pt):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},et.prototype.removeImage=function(pt){this.style.removeImage(pt)},et.prototype.loadImage=function(pt,Ct){t.getImage(this._requestManager.transformRequest(pt,t.ResourceType.Image),Ct)},et.prototype.listImages=function(){return this.style.listImages()},et.prototype.addLayer=function(pt,Ct){return this._lazyInitEmptyStyle(),this.style.addLayer(pt,Ct),this._update(!0)},et.prototype.moveLayer=function(pt,Ct){return this.style.moveLayer(pt,Ct),this._update(!0)},et.prototype.removeLayer=function(pt){return this.style.removeLayer(pt),this._update(!0)},et.prototype.getLayer=function(pt){return this.style.getLayer(pt)},et.prototype.setLayerZoomRange=function(pt,Ct,Yt){return this.style.setLayerZoomRange(pt,Ct,Yt),this._update(!0)},et.prototype.setFilter=function(pt,Ct,Yt){return Yt===void 0&&(Yt={}),this.style.setFilter(pt,Ct,Yt),this._update(!0)},et.prototype.getFilter=function(pt){return this.style.getFilter(pt)},et.prototype.setPaintProperty=function(pt,Ct,Yt,ce){return ce===void 0&&(ce={}),this.style.setPaintProperty(pt,Ct,Yt,ce),this._update(!0)},et.prototype.getPaintProperty=function(pt,Ct){return this.style.getPaintProperty(pt,Ct)},et.prototype.setLayoutProperty=function(pt,Ct,Yt,ce){return ce===void 0&&(ce={}),this.style.setLayoutProperty(pt,Ct,Yt,ce),this._update(!0)},et.prototype.getLayoutProperty=function(pt,Ct){return this.style.getLayoutProperty(pt,Ct)},et.prototype.setLight=function(pt,Ct){return Ct===void 0&&(Ct={}),this._lazyInitEmptyStyle(),this.style.setLight(pt,Ct),this._update(!0)},et.prototype.getLight=function(){return this.style.getLight()},et.prototype.setFeatureState=function(pt,Ct){return this.style.setFeatureState(pt,Ct),this._update()},et.prototype.removeFeatureState=function(pt,Ct){return this.style.removeFeatureState(pt,Ct),this._update()},et.prototype.getFeatureState=function(pt){return this.style.getFeatureState(pt)},et.prototype.getContainer=function(){return this._container},et.prototype.getCanvasContainer=function(){return this._canvasContainer},et.prototype.getCanvas=function(){return this._canvas},et.prototype._containerDimensions=function(){var pt=0,Ct=0;return this._container&&(pt=this._container.clientWidth||400,Ct=this._container.clientHeight||300),[pt,Ct]},et.prototype._detectMissingCSS=function(){var pt=t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color");pt!=="rgb(250, 128, 114)"&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},et.prototype._setupContainer=function(){var pt=this._container;pt.classList.add("mapboxgl-map");var Ct=this._missingCSSCanary=r.create("div","mapboxgl-canary",pt);Ct.style.visibility="hidden",this._detectMissingCSS();var Yt=this._canvasContainer=r.create("div","mapboxgl-canvas-container",pt);this._interactive&&Yt.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",Yt),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");var ce=this._containerDimensions();this._resizeCanvas(ce[0],ce[1]);var re=this._controlContainer=r.create("div","mapboxgl-control-container",pt),ye=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(Le){ye[Le]=r.create("div","mapboxgl-ctrl-"+Le,re)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},et.prototype._resizeCanvas=function(pt,Ct){var Yt=t.browser.devicePixelRatio||1;this._canvas.width=Yt*pt,this._canvas.height=Yt*Ct,this._canvas.style.width=pt+"px",this._canvas.style.height=Ct+"px"},et.prototype._setupPainter=function(){var pt=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),Ct=this._canvas.getContext("webgl",pt)||this._canvas.getContext("experimental-webgl",pt);if(!Ct){this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")));return}this.painter=new ho(Ct,this.transform),t.webpSupported.testSupport(Ct)},et.prototype._contextLost=function(pt){pt.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:pt}))},et.prototype._contextRestored=function(pt){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:pt}))},et.prototype._onMapScroll=function(pt){if(pt.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},et.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},et.prototype._update=function(pt){return this.style?(this._styleDirty=this._styleDirty||pt,this._sourcesDirty=!0,this.triggerRepaint(),this):this},et.prototype._requestRenderFrame=function(pt){return this._update(),this._renderTaskQueue.add(pt)},et.prototype._cancelRenderFrame=function(pt){this._renderTaskQueue.remove(pt)},et.prototype._render=function(pt){var Ct=this,Yt,ce=0,re=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(Yt=re.createQueryEXT(),re.beginQueryEXT(re.TIME_ELAPSED_EXT,Yt),ce=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(pt),!this._removed){var ye=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var Le=this.transform.zoom,tr=t.browser.now();this.style.zoomHistory.update(Le,tr);var $e=new t.EvaluationParameters(Le,{now:tr,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),er=$e.crossFadingFactor();(er!==1||er!==this._crossFadingFactor)&&(ye=!0,this._crossFadingFactor=er),this.style.update($e)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),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 t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||ye)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var pr=t.browser.now()-ce;re.endQueryEXT(re.TIME_ELAPSED_EXT,Yt),setTimeout(function(){var cr=re.getQueryObjectEXT(Yt,re.QUERY_RESULT_EXT)/1e6;re.deleteQueryEXT(Yt),Ct.fire(new t.Event("gpu-timing-frame",{cpuTime:pr,gpuTime:cr}))},50)}if(this.listens("gpu-timing-layer")){var wr=this.painter.collectGpuTimers();setTimeout(function(){var cr=Ct.painter.queryGpuTimers(wr);Ct.fire(new t.Event("gpu-timing-layer",{layerTimes:cr}))},50)}var rr=this._sourcesDirty||this._styleDirty||this._placementDirty;return rr||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),this._loaded&&!this._fullyLoaded&&!rr&&(this._fullyLoaded=!0),this}},et.prototype.remove=function(){this._hash&&this._hash.remove();for(var pt=0,Ct=this._controls;pt<Ct.length;pt+=1){var Yt=Ct[pt];Yt.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 t.window<"u"&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var ce=this.painter.context.gl.getExtension("WEBGL_lose_context");ce&&ce.loseContext&&ce.loseContext(),zo(this._canvasContainer),zo(this._controlContainer),zo(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},et.prototype.triggerRepaint=function(){var pt=this;this.style&&!this._frame&&(this._frame=t.browser.frame(function(Ct){pt._frame=null,pt._render(Ct)}))},et.prototype._onWindowOnline=function(){this._update()},et.prototype._onWindowResize=function(pt){this._trackResize&&this.resize({originalEvent:pt})._update()},K.showTileBoundaries.get=function(){return!!this._showTileBoundaries},K.showTileBoundaries.set=function(pt){this._showTileBoundaries!==pt&&(this._showTileBoundaries=pt,this._update())},K.showPadding.get=function(){return!!this._showPadding},K.showPadding.set=function(pt){this._showPadding!==pt&&(this._showPadding=pt,this._update())},K.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},K.showCollisionBoxes.set=function(pt){this._showCollisionBoxes!==pt&&(this._showCollisionBoxes=pt,pt?this.style._generateCollisionBoxes():this._update())},K.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},K.showOverdrawInspector.set=function(pt){this._showOverdrawInspector!==pt&&(this._showOverdrawInspector=pt,this._update())},K.repaint.get=function(){return!!this._repaint},K.repaint.set=function(pt){this._repaint!==pt&&(this._repaint=pt,this.triggerRepaint())},K.vertices.get=function(){return!!this._vertices},K.vertices.set=function(pt){this._vertices=pt,this._update()},et.prototype._setCacheLimits=function(pt,Ct){t.setCacheLimits(pt,Ct)},K.version.get=function(){return t.version},Object.defineProperties(et.prototype,K),et}(Ga);function zo(W){W.parentNode&&W.parentNode.removeChild(W)}var mi={showCompass:!0,showZoom:!0,visualizePitch:!1},Li=function(W){var et=this;this.options=t.extend({},mi,W),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(K){return K.preventDefault()}),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(K){return et._map.zoomIn({},{originalEvent:K})}),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(K){return et._map.zoomOut({},{originalEvent:K})}),r.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(K){et.options.visualizePitch?et._map.resetNorthPitch({},{originalEvent:K}):et._map.resetNorth({},{originalEvent:K})}),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Li.prototype._updateZoomButtons=function(){var W=this._map.getZoom(),et=W===this._map.getMaxZoom(),K=W===this._map.getMinZoom();this._zoomInButton.disabled=et,this._zoomOutButton.disabled=K,this._zoomInButton.setAttribute("aria-disabled",et.toString()),this._zoomOutButton.setAttribute("aria-disabled",K.toString())},Li.prototype._rotateCompassArrow=function(){var W=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=W},Li.prototype.onAdd=function(W){return this._map=W,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 mo(this._map,this._compass,this.options.visualizePitch)),this._container},Li.prototype.onRemove=function(){r.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},Li.prototype._createButton=function(W,et){var K=r.create("button",W,this._container);return K.type="button",K.addEventListener("click",et),K},Li.prototype._setButtonTitle=function(W,et){var K=this._map._getUIString("NavigationControl."+et);W.title=K,W.setAttribute("aria-label",K)};var mo=function(W,et,K){K===void 0&&(K=!1),this._clickTolerance=10,this.element=et,this.mouseRotate=new Io({clickTolerance:W.dragRotate._mouseRotate._clickTolerance}),this.map=W,K&&(this.mousePitch=new gi({clickTolerance:W.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(et,"mousedown",this.mousedown),r.addEventListener(et,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(et,"touchmove",this.touchmove),r.addEventListener(et,"touchend",this.touchend),r.addEventListener(et,"touchcancel",this.reset)};mo.prototype.down=function(W,et){this.mouseRotate.mousedown(W,et),this.mousePitch&&this.mousePitch.mousedown(W,et),r.disableDrag()},mo.prototype.move=function(W,et){var K=this.map,pt=this.mouseRotate.mousemoveWindow(W,et);if(pt&&pt.bearingDelta&&K.setBearing(K.getBearing()+pt.bearingDelta),this.mousePitch){var Ct=this.mousePitch.mousemoveWindow(W,et);Ct&&Ct.pitchDelta&&K.setPitch(K.getPitch()+Ct.pitchDelta)}},mo.prototype.off=function(){var W=this.element;r.removeEventListener(W,"mousedown",this.mousedown),r.removeEventListener(W,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(W,"touchmove",this.touchmove),r.removeEventListener(W,"touchend",this.touchend),r.removeEventListener(W,"touchcancel",this.reset),this.offTemp()},mo.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},mo.prototype.mousedown=function(W){this.down(t.extend({},W,{ctrlKey:!0,preventDefault:function(){return W.preventDefault()}}),r.mousePos(this.element,W)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},mo.prototype.mousemove=function(W){this.move(W,r.mousePos(this.element,W))},mo.prototype.mouseup=function(W){this.mouseRotate.mouseupWindow(W),this.mousePitch&&this.mousePitch.mouseupWindow(W),this.offTemp()},mo.prototype.touchstart=function(W){W.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,W.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return W.preventDefault()}},this._startPos))},mo.prototype.touchmove=function(W){W.targetTouches.length!==1?this.reset():(this._lastPos=r.touchPos(this.element,W.targetTouches)[0],this.move({preventDefault:function(){return W.preventDefault()}},this._lastPos))},mo.prototype.touchend=function(W){W.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},mo.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};function Oo(W,et,K){if(W=new t.LngLat(W.lng,W.lat),et){var pt=new t.LngLat(W.lng-360,W.lat),Ct=new t.LngLat(W.lng+360,W.lat),Yt=K.locationPoint(W).distSqr(et);K.locationPoint(pt).distSqr(et)<Yt?W=pt:K.locationPoint(Ct).distSqr(et)<Yt&&(W=Ct)}for(;Math.abs(W.lng-K.center.lng)>180;){var ce=K.locationPoint(W);if(ce.x>=0&&ce.y>=0&&ce.x<=K.width&&ce.y<=K.height)break;W.lng>K.center.lng?W.lng-=360:W.lng+=360}return W}var ss={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 ml(W,et,K){var pt=W.classList;for(var Ct in ss)pt.remove("mapboxgl-"+K+"-anchor-"+Ct);pt.add("mapboxgl-"+K+"-anchor-"+et)}var Gs=function(W){function et(K,pt){if(W.call(this),(K instanceof t.window.HTMLElement||pt)&&(K=t.extend({element:K},pt)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=K&&K.anchor||"center",this._color=K&&K.color||"#3FB1CE",this._scale=K&&K.scale||1,this._draggable=K&&K.draggable||!1,this._clickTolerance=K&&K.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=K&&K.rotation||0,this._rotationAlignment=K&&K.rotationAlignment||"auto",this._pitchAlignment=K&&K.pitchAlignment&&K.pitchAlignment!=="auto"?K.pitchAlignment:this._rotationAlignment,!K||!K.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var Ct=r.createNS("http://www.w3.org/2000/svg","svg"),Yt=41,ce=27;Ct.setAttributeNS(null,"display","block"),Ct.setAttributeNS(null,"height",Yt+"px"),Ct.setAttributeNS(null,"width",ce+"px"),Ct.setAttributeNS(null,"viewBox","0 0 "+ce+" "+Yt);var re=r.createNS("http://www.w3.org/2000/svg","g");re.setAttributeNS(null,"stroke","none"),re.setAttributeNS(null,"stroke-width","1"),re.setAttributeNS(null,"fill","none"),re.setAttributeNS(null,"fill-rule","evenodd");var ye=r.createNS("http://www.w3.org/2000/svg","g");ye.setAttributeNS(null,"fill-rule","nonzero");var Le=r.createNS("http://www.w3.org/2000/svg","g");Le.setAttributeNS(null,"transform","translate(3.0, 29.0)"),Le.setAttributeNS(null,"fill","#000000");for(var tr=[{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"}],$e=0,er=tr;$e<er.length;$e+=1){var pr=er[$e],wr=r.createNS("http://www.w3.org/2000/svg","ellipse");wr.setAttributeNS(null,"opacity","0.04"),wr.setAttributeNS(null,"cx","10.5"),wr.setAttributeNS(null,"cy","5.80029008"),wr.setAttributeNS(null,"rx",pr.rx),wr.setAttributeNS(null,"ry",pr.ry),Le.appendChild(wr)}var rr=r.createNS("http://www.w3.org/2000/svg","g");rr.setAttributeNS(null,"fill",this._color);var cr=r.createNS("http://www.w3.org/2000/svg","path");cr.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"),rr.appendChild(cr);var hr=r.createNS("http://www.w3.org/2000/svg","g");hr.setAttributeNS(null,"opacity","0.25"),hr.setAttributeNS(null,"fill","#000000");var Vr=r.createNS("http://www.w3.org/2000/svg","path");Vr.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"),hr.appendChild(Vr);var yn=r.createNS("http://www.w3.org/2000/svg","g");yn.setAttributeNS(null,"transform","translate(6.0, 7.0)"),yn.setAttributeNS(null,"fill","#FFFFFF");var wn=r.createNS("http://www.w3.org/2000/svg","g");wn.setAttributeNS(null,"transform","translate(8.0, 8.0)");var $n=r.createNS("http://www.w3.org/2000/svg","circle");$n.setAttributeNS(null,"fill","#000000"),$n.setAttributeNS(null,"opacity","0.25"),$n.setAttributeNS(null,"cx","5.5"),$n.setAttributeNS(null,"cy","5.5"),$n.setAttributeNS(null,"r","5.4999962");var Xn=r.createNS("http://www.w3.org/2000/svg","circle");Xn.setAttributeNS(null,"fill","#FFFFFF"),Xn.setAttributeNS(null,"cx","5.5"),Xn.setAttributeNS(null,"cy","5.5"),Xn.setAttributeNS(null,"r","5.4999962"),wn.appendChild($n),wn.appendChild(Xn),ye.appendChild(Le),ye.appendChild(rr),ye.appendChild(hr),ye.appendChild(yn),ye.appendChild(wn),Ct.appendChild(ye),Ct.setAttributeNS(null,"height",Yt*this._scale+"px"),Ct.setAttributeNS(null,"width",ce*this._scale+"px"),this._element.appendChild(Ct),this._offset=t.Point.convert(K&&K.offset||[0,-14])}else this._element=K.element,this._offset=t.Point.convert(K&&K.offset||[0,0]);this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(Vn){Vn.preventDefault()}),this._element.addEventListener("mousedown",function(Vn){Vn.preventDefault()}),ml(this._element,this._anchor,"marker"),this._popup=null}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.addTo=function(K){return this.remove(),this._map=K,K.getCanvasContainer().appendChild(this._element),K.on("move",this._update),K.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},et.prototype.remove=function(){return 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),r.remove(this._element),this._popup&&this._popup.remove(),this},et.prototype.getLngLat=function(){return this._lngLat},et.prototype.setLngLat=function(K){return this._lngLat=t.LngLat.convert(K),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},et.prototype.getElement=function(){return this._element},et.prototype.setPopup=function(K){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),K){if(!("offset"in K.options)){var pt=38.1,Ct=13.5,Yt=Math.sqrt(Math.pow(Ct,2)/2);K.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-pt],"bottom-left":[Yt,(pt-Ct+Yt)*-1],"bottom-right":[-Yt,(pt-Ct+Yt)*-1],left:[Ct,(pt-Ct)*-1],right:[-Ct,(pt-Ct)*-1]}:this._offset}this._popup=K,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},et.prototype._onKeyPress=function(K){var pt=K.code,Ct=K.charCode||K.keyCode;(pt==="Space"||pt==="Enter"||Ct===32||Ct===13)&&this.togglePopup()},et.prototype._onMapClick=function(K){var pt=K.originalEvent.target,Ct=this._element;this._popup&&(pt===Ct||Ct.contains(pt))&&this.togglePopup()},et.prototype.getPopup=function(){return this._popup},et.prototype.togglePopup=function(){var K=this._popup;if(K)K.isOpen()?K.remove():K.addTo(this._map);else return this;return this},et.prototype._update=function(K){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Oo(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var pt="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?pt="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(pt="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var Ct="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?Ct="rotateX(0deg)":this._pitchAlignment==="map"&&(Ct="rotateX("+this._map.getPitch()+"deg)"),(!K||K.type==="moveend")&&(this._pos=this._pos.round()),r.setTransform(this._element,ss[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+Ct+" "+pt)}},et.prototype.getOffset=function(){return this._offset},et.prototype.setOffset=function(K){return this._offset=t.Point.convert(K),this._update(),this},et.prototype._onMove=function(K){if(!this._isDragging){var pt=this._clickTolerance||this._map._clickTolerance;this._isDragging=K.point.dist(this._pointerdownPos)>=pt}this._isDragging&&(this._pos=K.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},et.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new t.Event("dragend")),this._state="inactive"},et.prototype._addDragHandler=function(K){this._element.contains(K.originalEvent.target)&&(K.preventDefault(),this._positionDelta=K.point.sub(this._pos).add(this._offset),this._pointerdownPos=K.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))},et.prototype.setDraggable=function(K){return this._draggable=!!K,this._map&&(K?(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},et.prototype.isDraggable=function(){return this._draggable},et.prototype.setRotation=function(K){return this._rotation=K||0,this._update(),this},et.prototype.getRotation=function(){return this._rotation},et.prototype.setRotationAlignment=function(K){return this._rotationAlignment=K||"auto",this._update(),this},et.prototype.getRotationAlignment=function(){return this._rotationAlignment},et.prototype.setPitchAlignment=function(K){return this._pitchAlignment=K&&K!=="auto"?K:this._rotationAlignment,this._update(),this},et.prototype.getPitchAlignment=function(){return this._pitchAlignment},et}(t.Evented),ws={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ru;function al(W){ru!==void 0?W(ru):t.window.navigator.permissions!==void 0?t.window.navigator.permissions.query({name:"geolocation"}).then(function(et){ru=et.state!=="denied",W(ru)}):(ru=!!t.window.navigator.geolocation,W(ru))}var Tu=0,lc=!1,Fc=function(W){function et(K){W.call(this),this.options=t.extend({},ws,K),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.onAdd=function(K){return this._map=K,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),al(this._setupUI),this._container},et.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(t.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(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Tu=0,lc=!1},et.prototype._isOutOfMapMaxBounds=function(K){var pt=this._map.getMaxBounds(),Ct=K.coords;return pt&&(Ct.longitude<pt.getWest()||Ct.longitude>pt.getEast()||Ct.latitude<pt.getSouth()||Ct.latitude>pt.getNorth())},et.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break}},et.prototype._onSuccess=function(K){if(this._map){if(this._isOutOfMapMaxBounds(K)){this._setErrorState(),this.fire(new t.Event("outofmaxbounds",K)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=K,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(K),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(K),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",K)),this._finish()}},et.prototype._updateCamera=function(K){var pt=new t.LngLat(K.coords.longitude,K.coords.latitude),Ct=K.coords.accuracy,Yt=this._map.getBearing(),ce=t.extend({bearing:Yt},this.options.fitBoundsOptions);this._map.fitBounds(pt.toBounds(Ct),ce,{geolocateSource:!0})},et.prototype._updateMarker=function(K){if(K){var pt=new t.LngLat(K.coords.longitude,K.coords.latitude);this._accuracyCircleMarker.setLngLat(pt).addTo(this._map),this._userLocationDotMarker.setLngLat(pt).addTo(this._map),this._accuracy=K.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},et.prototype._updateCircleRadius=function(){var K=this._map._container.clientHeight/2,pt=this._map.unproject([0,K]),Ct=this._map.unproject([1,K]),Yt=pt.distanceTo(Ct),ce=Math.ceil(2*this._accuracy/Yt);this._circleElement.style.width=ce+"px",this._circleElement.style.height=ce+"px"},et.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},et.prototype._onError=function(K){if(this._map){if(this.options.trackUserLocation)if(K.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var pt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=pt,this._geolocateButton.setAttribute("aria-label",pt),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(K.code===3&&lc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",K)),this._finish()}},et.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},et.prototype._setupUI=function(K){var pt=this;if(this._container.addEventListener("contextmenu",function(ce){return ce.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",K===!1){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var Ct=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=Ct,this._geolocateButton.setAttribute("aria-label",Ct)}else{var Yt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=Yt,this._geolocateButton.setAttribute("aria-label",Yt)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Gs(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Gs({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",function(ce){var re=ce.originalEvent&&ce.originalEvent.type==="resize";!ce.geolocateSource&&pt._watchState==="ACTIVE_LOCK"&&!re&&(pt._watchState="BACKGROUND",pt._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),pt._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),pt.fire(new t.Event("trackuserlocationend")))})},et.prototype.trigger=function(){if(!this._setup)return t.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 t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Tu--,lc=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"));break}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Tu++;var K;Tu>1?(K={maximumAge:6e5,timeout:0},lc=!0):(K=this.options.positionOptions,lc=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,K)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},et.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},et}(t.Evented),Lu={maxWidth:100,unit:"metric"},nu=function(W){this.options=t.extend({},Lu,W),t.bindAll(["_onMove","setUnit"],this)};nu.prototype.getDefaultPosition=function(){return"bottom-left"},nu.prototype._onMove=function(){Cu(this._map,this._container,this.options)},nu.prototype.onAdd=function(W){return this._map=W,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",W.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},nu.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},nu.prototype.setUnit=function(W){this.options.unit=W,Cu(this._map,this._container,this.options)};function Cu(W,et,K){var pt=K&&K.maxWidth||100,Ct=W._container.clientHeight/2,Yt=W.unproject([0,Ct]),ce=W.unproject([pt,Ct]),re=Yt.distanceTo(ce);if(K&&K.unit==="imperial"){var ye=3.2808*re;if(ye>5280){var Le=ye/5280;Xo(et,pt,Le,W._getUIString("ScaleControl.Miles"))}else Xo(et,pt,ye,W._getUIString("ScaleControl.Feet"))}else if(K&&K.unit==="nautical"){var tr=re/1852;Xo(et,pt,tr,W._getUIString("ScaleControl.NauticalMiles"))}else re>=1e3?Xo(et,pt,re/1e3,W._getUIString("ScaleControl.Kilometers")):Xo(et,pt,re,W._getUIString("ScaleControl.Meters"))}function Xo(W,et,K,pt){var Ct=tl(K),Yt=Ct/K;W.style.width=et*Yt+"px",W.innerHTML=Ct+" "+pt}function uu(W){var et=Math.pow(10,Math.ceil(-Math.log(W)/Math.LN10));return Math.round(W*et)/et}function tl(W){var et=Math.pow(10,(""+Math.floor(W)).length-1),K=W/et;return K=K>=10?10:K>=5?5:K>=3?3:K>=2?2:K>=1?1:uu(K),et*K}var au=function(W){this._fullscreen=!1,W&&W.container&&(W.container instanceof t.window.HTMLElement?this._container=W.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};au.prototype.onAdd=function(W){return this._map=W,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},au.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},au.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},au.prototype._setupUI=function(){var W=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",W).setAttribute("aria-hidden",!0),W.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},au.prototype._updateTitle=function(){var W=this._getTitle();this._fullscreenButton.setAttribute("aria-label",W),this._fullscreenButton.title=W},au.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},au.prototype._isFullscreen=function(){return this._fullscreen},au.prototype._changeIcon=function(){var W=t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement;W===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},au.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Bc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Ho=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Fs=function(W){function et(K){W.call(this),this.options=t.extend(Object.create(Bc),K),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return W&&(et.__proto__=W),et.prototype=Object.create(W&&W.prototype),et.prototype.constructor=et,et.prototype.addTo=function(K){return this._map&&this.remove(),this._map=K,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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},et.prototype.isOpen=function(){return!!this._map},et.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.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 t.Event("close")),this},et.prototype.getLngLat=function(){return this._lngLat},et.prototype.setLngLat=function(K){return this._lngLat=t.LngLat.convert(K),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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},et.prototype.trackPointer=function(){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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},et.prototype.getElement=function(){return this._container},et.prototype.setText=function(K){return this.setDOMContent(t.window.document.createTextNode(K))},et.prototype.setHTML=function(K){var pt=t.window.document.createDocumentFragment(),Ct=t.window.document.createElement("body"),Yt;for(Ct.innerHTML=K;Yt=Ct.firstChild,!!Yt;)pt.appendChild(Yt);return this.setDOMContent(pt)},et.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},et.prototype.setMaxWidth=function(K){return this.options.maxWidth=K,this._update(),this},et.prototype.setDOMContent=function(K){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(K),this._createCloseButton(),this._update(),this._focusFirstElement(),this},et.prototype.addClassName=function(K){this._container&&this._container.classList.add(K)},et.prototype.removeClassName=function(K){this._container&&this._container.classList.remove(K)},et.prototype.setOffset=function(K){return this.options.offset=K,this._update(),this},et.prototype.toggleClassName=function(K){if(this._container)return this._container.classList.toggle(K)},et.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-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))},et.prototype._onMouseUp=function(K){this._update(K.point)},et.prototype._onMouseMove=function(K){this._update(K.point)},et.prototype._onDrag=function(K){this._update(K.point)},et.prototype._update=function(K){var pt=this,Ct=this._lngLat||this._trackPointer;if(!(!this._map||!Ct||!this._content)&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(er){return pt._container.classList.add(er)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Oo(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!K))){var Yt=this._pos=this._trackPointer&&K?K:this._map.project(this._lngLat),ce=this.options.anchor,re=kl(this.options.offset);if(!ce){var ye=this._container.offsetWidth,Le=this._container.offsetHeight,tr;Yt.y+re.bottom.y<Le?tr=["top"]:Yt.y>this._map.transform.height-Le?tr=["bottom"]:tr=[],Yt.x<ye/2?tr.push("left"):Yt.x>this._map.transform.width-ye/2&&tr.push("right"),tr.length===0?ce="bottom":ce=tr.join("-")}var $e=Yt.add(re[ce]).round();r.setTransform(this._container,ss[ce]+" translate("+$e.x+"px,"+$e.y+"px)"),ml(this._container,ce,"popup")}},et.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var K=this._container.querySelector(Ho);K&&K.focus()}},et.prototype._onClose=function(){this.remove()},et}(t.Evented);function kl(W){if(W)if(typeof W=="number"){var et=Math.round(Math.sqrt(.5*Math.pow(W,2)));return{center:new t.Point(0,0),top:new t.Point(0,W),"top-left":new t.Point(et,et),"top-right":new t.Point(-et,et),bottom:new t.Point(0,-W),"bottom-left":new t.Point(et,-et),"bottom-right":new t.Point(-et,-et),left:new t.Point(W,0),right:new t.Point(-W,0)}}else if(W instanceof t.Point||Array.isArray(W)){var K=t.Point.convert(W);return{center:K,top:K,"top-left":K,"top-right":K,bottom:K,"bottom-left":K,"bottom-right":K,left:K,right:K}}else return{center:t.Point.convert(W.center||[0,0]),top:t.Point.convert(W.top||[0,0]),"top-left":t.Point.convert(W["top-left"]||[0,0]),"top-right":t.Point.convert(W["top-right"]||[0,0]),bottom:t.Point.convert(W.bottom||[0,0]),"bottom-left":t.Point.convert(W["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(W["bottom-right"]||[0,0]),left:t.Point.convert(W.left||[0,0]),right:t.Point.convert(W.right||[0,0])};else return kl(new t.Point(0,0))}var zs={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Wo,NavigationControl:Li,GeolocateControl:Fc,AttributionControl:Aa,ScaleControl:nu,FullscreenControl:au,Popup:Fs,Marker:Gs,Style:El,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:Pr,clearPrewarmedResources:Sr,get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(W){t.config.ACCESS_TOKEN=W},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(W){t.config.API_URL=W},get workerCount(){return on.workerCount},set workerCount(W){on.workerCount=W},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(W){t.config.MAX_PARALLEL_IMAGE_REQUESTS=W},clearStorage:function(W){t.clearTileCache(W)},workerUrl:""};return zs}),E})}),kI=Vt((X,V)=>{var c=qr(),g=sl().sanitizeHTML,E=g5(),A=$p();function t(o,a){this.subplot=o,this.uid=o.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=A.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var e=t.prototype;e.update=function(o){this.visible?this.needsNewImage(o)?this.updateImage(o):this.needsNewSource(o)?(this.removeLayer(),this.updateSource(o),this.updateLayer(o)):this.needsNewLayer(o)?this.updateLayer(o):this.updateStyle(o):(this.updateSource(o),this.updateLayer(o)),this.visible=r(o)},e.needsNewImage=function(o){var a=this.subplot.map;return a.getSource(this.idSource)&&this.sourceType==="image"&&o.sourcetype==="image"&&(this.source!==o.source||JSON.stringify(this.coordinates)!==JSON.stringify(o.coordinates))},e.needsNewSource=function(o){return this.sourceType!==o.sourcetype||JSON.stringify(this.source)!==JSON.stringify(o.source)||this.layerType!==o.type},e.needsNewLayer=function(o){return this.layerType!==o.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},e.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},e.updateImage=function(o){var a=this.subplot.map;a.getSource(this.idSource).updateImage({url:o.source,coordinates:o.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},e.updateSource=function(o){var a=this.subplot.map;if(a.getSource(this.idSource)&&a.removeSource(this.idSource),this.sourceType=o.sourcetype,this.source=o.source,!!r(o)){var s=n(o);a.addSource(this.idSource,s)}},e.findFollowingMapboxLayerId=function(o){if(o==="traces")for(var a=this.subplot.getMapLayers(),s=0;s<a.length;s++){var h=a[s].id;if(typeof h=="string"&&h.indexOf(A.traceLayerPrefix)===0){o=h;break}}return o},e.updateLayer=function(o){var a=this.subplot,s=i(o),h=this.lookupBelow(),v=this.findFollowingMapboxLayerId(h);this.removeLayer(),r(o)&&a.addLayer({id:this.idLayer,source:this.idSource,"source-layer":o.sourcelayer||"",type:o.type,minzoom:o.minzoom,maxzoom:o.maxzoom,layout:s.layout,paint:s.paint},v),this.layerType=o.type,this.below=h},e.updateStyle=function(o){if(r(o)){var a=i(o);this.subplot.setOptions(this.idLayer,"setLayoutProperty",a.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",a.paint)}},e.removeLayer=function(){var o=this.subplot.map;o.getLayer(this.idLayer)&&o.removeLayer(this.idLayer)},e.dispose=function(){var o=this.subplot.map;o.getLayer(this.idLayer)&&o.removeLayer(this.idLayer),o.getSource(this.idSource)&&o.removeSource(this.idSource)};function r(o){if(!o.visible)return!1;var a=o.source;if(Array.isArray(a)&&a.length>0){for(var s=0;s<a.length;s++)if(typeof a[s]!="string"||a[s].length===0)return!1;return!0}return c.isPlainObject(a)||typeof a=="string"&&a.length>0}function i(o){var a={},s={};switch(o.type){case"circle":c.extendFlat(s,{"circle-radius":o.circle.radius,"circle-color":o.color,"circle-opacity":o.opacity});break;case"line":c.extendFlat(s,{"line-width":o.line.width,"line-color":o.color,"line-opacity":o.opacity,"line-dasharray":o.line.dash});break;case"fill":c.extendFlat(s,{"fill-color":o.color,"fill-outline-color":o.fill.outlinecolor,"fill-opacity":o.opacity});break;case"symbol":var h=o.symbol,v=E(h.textposition,h.iconsize);c.extendFlat(a,{"icon-image":h.icon+"-15","icon-size":h.iconsize/10,"text-field":h.text,"text-size":h.textfont.size,"text-anchor":v.anchor,"text-offset":v.offset,"symbol-placement":h.placement}),c.extendFlat(s,{"icon-color":o.color,"text-color":h.textfont.color,"text-opacity":o.opacity});break;case"raster":c.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":o.opacity});break}return{layout:a,paint:s}}function n(o){var a=o.sourcetype,s=o.source,h={type:a},v;return a==="geojson"?v="data":a==="vector"?v=typeof s=="string"?"url":"tiles":a==="raster"?(v="tiles",h.tileSize=256):a==="image"&&(v="url",h.coordinates=o.coordinates),h[v]=s,o.sourceattribution&&(h.attribution=g(o.sourceattribution)),h}V.exports=function(o,a,s){var h=new t(o,a);return h.update(s),h}}),AI=Vt((X,V)=>{var c=m5(),g=qr(),E=Vd(),A=Mi(),t=ao(),e=af(),r=Hu(),i=ep(),n=i.drawMode,o=i.selectMode,a=fc().prepSelect,s=fc().clearOutline,h=fc().clearSelectionsCache,v=fc().selectOnClick,m=$p(),p=kI();function y(M,w){this.id=w,this.gd=M;var u=M._fullLayout,f=M._context;this.container=u._glcontainer.node(),this.isStatic=f.staticPlot,this.uid=u._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(u),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=y.prototype;l.plot=function(M,w,u){var f=this,k=w[f.id];f.map&&k.accesstoken!==f.accessToken&&(f.map.remove(),f.map=null,f.styleObj=null,f.traceHash={},f.layerList=[]);var _;f.map?_=new Promise(function(D,I){f.updateMap(M,w,D,I)}):_=new Promise(function(D,I){f.createMap(M,w,D,I)}),u.push(_)},l.createMap=function(M,w,u,f){var k=this,_=w[k.id],D=k.styleObj=b(_.style,w);k.accessToken=_.accesstoken;var I=_.bounds,O=I?[[I.west,I.south],[I.east,I.north]]:null,B=k.map=new c.Map({container:k.div,style:D.style,center:T(_.center),zoom:_.zoom,bearing:_.bearing,pitch:_.pitch,maxBounds:O,interactive:!k.isStatic,preserveDrawingBuffer:k.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new c.AttributionControl({compact:!0}));B._canvas.style.left="0px",B._canvas.style.top="0px",k.rejectOnError(f),k.isStatic||k.initFx(M,w);var R=[];R.push(new Promise(function(L){B.once("load",L)})),R=R.concat(E.fetchTraceGeoData(M)),Promise.all(R).then(function(){k.fillBelowLookup(M,w),k.updateData(M),k.updateLayout(w),k.resolveOnRender(u)}).catch(f)},l.updateMap=function(M,w,u,f){var k=this,_=k.map,D=w[this.id];k.rejectOnError(f);var I=[],O=b(D.style,w);JSON.stringify(k.styleObj)!==JSON.stringify(O)&&(k.styleObj=O,_.setStyle(O.style),k.traceHash={},I.push(new Promise(function(B){_.once("styledata",B)}))),I=I.concat(E.fetchTraceGeoData(M)),Promise.all(I).then(function(){k.fillBelowLookup(M,w),k.updateData(M),k.updateLayout(w),k.resolveOnRender(u)}).catch(f)},l.fillBelowLookup=function(M,w){var u=w[this.id],f=u.layers,k,_,D=this.belowLookup={},I=!1;for(k=0;k<M.length;k++){var O=M[k][0].trace,B=O._module;typeof O.below=="string"?_=O.below:B.getBelow&&(_=B.getBelow(O,this)),_===""&&(I=!0),D["trace-"+O.uid]=_||""}for(k=0;k<f.length;k++){var R=f[k];typeof R.below=="string"?_=R.below:I?_="traces":_="",D["layout-"+k]=_}var L={},F,N;for(F in D)_=D[F],L[_]?L[_].push(F):L[_]=[F];for(_ in L){var j=L[_];if(j.length>1)for(k=0;k<j.length;k++)F=j[k],F.indexOf("trace-")===0?(N=F.split("trace-")[1],this.traceHash[N]&&(this.traceHash[N].below=null)):F.indexOf("layout-")===0&&(N=F.split("layout-")[1],this.layerList[N]&&(this.layerList[N].below=null))}};var x={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};l.updateData=function(M){var w=this.traceHash,u,f,k,_,D=M.slice().sort(function(L,F){return x[L[0].trace.type]-x[F[0].trace.type]});for(k=0;k<D.length;k++){var I=D[k];f=I[0].trace,u=w[f.uid];var O=!1;u&&(u.type===f.type?(u.update(I),O=!0):u.dispose()),!O&&f._module&&(w[f.uid]=f._module.plot(this,I))}var B=Object.keys(w);t:for(k=0;k<B.length;k++){var R=B[k];for(_=0;_<M.length;_++)if(f=M[_][0].trace,R===f.uid)continue t;u=w[R],u.dispose(),delete w[R]}},l.updateLayout=function(M){var w=this.map,u=M[this.id];!this.dragging&&!this.wheeling&&(w.setCenter(T(u.center)),w.setZoom(u.zoom),w.setBearing(u.bearing),w.setPitch(u.pitch)),this.updateLayers(M),this.updateFramework(M),this.updateFx(M),this.map.resize(),this.gd._context._scrollZoom.mapbox?w.scrollZoom.enable():w.scrollZoom.disable()},l.resolveOnRender=function(M){var w=this.map;w.on("render",function u(){w.loaded()&&(w.off("render",u),setTimeout(M,10))})},l.rejectOnError=function(M){var w=this.map;function u(){M(new Error(m.mapOnErrorMsg))}w.once("error",u),w.once("style.error",u),w.once("source.error",u),w.once("tile.error",u),w.once("layer.error",u)},l.createFramework=function(M){var w=this,u=w.div=document.createElement("div");u.id=w.uid,u.style.position="absolute",w.container.appendChild(u),w.xaxis={_id:"x",c2p:function(f){return w.project(f).x}},w.yaxis={_id:"y",c2p:function(f){return w.project(f).y}},w.updateFramework(M),w.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},t.setConvert(w.mockAxis,M)},l.initFx=function(M,w){var u=this,f=u.gd,k=u.map;k.on("moveend",function(I){if(u.map){var O=f._fullLayout;if(I.originalEvent||u.wheeling){var B=O[u.id];A.call("_storeDirectGUIEdit",f.layout,O._preGUI,u.getViewEdits(B));var R=u.getView();B._input.center=B.center=R.center,B._input.zoom=B.zoom=R.zoom,B._input.bearing=B.bearing=R.bearing,B._input.pitch=B.pitch=R.pitch,f.emit("plotly_relayout",u.getViewEditsWithDerived(R))}I.originalEvent&&I.originalEvent.type==="mouseup"?u.dragging=!1:u.wheeling&&(u.wheeling=!1),O._rehover&&O._rehover()}}),k.on("wheel",function(){u.wheeling=!0}),k.on("mousemove",function(I){var O=u.div.getBoundingClientRect(),B=[I.originalEvent.offsetX,I.originalEvent.offsetY];I.target.getBoundingClientRect=function(){return O},u.xaxis.p2c=function(){return k.unproject(B).lng},u.yaxis.p2c=function(){return k.unproject(B).lat},f._fullLayout._rehover=function(){f._fullLayout._hoversubplot===u.id&&f._fullLayout[u.id]&&r.hover(f,I,u.id)},r.hover(f,I,u.id),f._fullLayout._hoversubplot=u.id});function _(){r.loneUnhover(w._hoverlayer)}k.on("dragstart",function(){u.dragging=!0,_()}),k.on("zoomstart",_),k.on("mouseout",function(){f._fullLayout._hoversubplot=null});function D(){var I=u.getView();f.emit("plotly_relayouting",u.getViewEditsWithDerived(I))}k.on("drag",D),k.on("zoom",D),k.on("dblclick",function(){var I=f._fullLayout[u.id];A.call("_storeDirectGUIEdit",f.layout,f._fullLayout._preGUI,u.getViewEdits(I));var O=u.viewInitial;k.setCenter(T(O.center)),k.setZoom(O.zoom),k.setBearing(O.bearing),k.setPitch(O.pitch);var B=u.getView();I._input.center=I.center=B.center,I._input.zoom=I.zoom=B.zoom,I._input.bearing=I.bearing=B.bearing,I._input.pitch=I.pitch=B.pitch,f.emit("plotly_doubleclick",null),f.emit("plotly_relayout",u.getViewEditsWithDerived(B))}),u.clearOutline=function(){h(u.dragOptions),s(u.dragOptions.gd)},u.onClickInPanFn=function(I){return function(O){var B=f._fullLayout.clickmode;B.indexOf("select")>-1&&v(O.originalEvent,f,[u.xaxis],[u.yaxis],u.id,I),B.indexOf("event")>-1&&r.click(f,O.originalEvent)}}},l.updateFx=function(M){var w=this,u=w.map,f=w.gd;if(w.isStatic)return;function k(O){var B=w.map.unproject(O);return[B.lng,B.lat]}var _=M.dragmode,D;D=function(O,B){if(B.isRect){var R=O.range={};R[w.id]=[k([B.xmin,B.ymin]),k([B.xmax,B.ymax])]}else{var L=O.lassoPoints={};L[w.id]=B.map(k)}};var I=w.dragOptions;w.dragOptions=g.extendDeep(I||{},{dragmode:M.dragmode,element:w.div,gd:f,plotinfo:{id:w.id,domain:M[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:D},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),u.off("click",w.onClickInPanHandler),o(_)||n(_)?(u.dragPan.disable(),u.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(O,B,R){a(O,B,R,w.dragOptions,_)},e.init(w.dragOptions)):(u.dragPan.enable(),u.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),u.on("click",w.onClickInPanHandler))},l.updateFramework=function(M){var w=M[this.id].domain,u=M._size,f=this.div.style;f.width=u.w*(w.x[1]-w.x[0])+"px",f.height=u.h*(w.y[1]-w.y[0])+"px",f.left=u.l+w.x[0]*u.w+"px",f.top=u.t+(1-w.y[1])*u.h+"px",this.xaxis._offset=u.l+w.x[0]*u.w,this.xaxis._length=u.w*(w.x[1]-w.x[0]),this.yaxis._offset=u.t+(1-w.y[1])*u.h,this.yaxis._length=u.h*(w.y[1]-w.y[0])},l.updateLayers=function(M){var w=M[this.id],u=w.layers,f=this.layerList,k;if(u.length!==f.length){for(k=0;k<f.length;k++)f[k].dispose();for(f=this.layerList=[],k=0;k<u.length;k++)f.push(p(this,k,u[k]))}else for(k=0;k<u.length;k++)f[k].update(u[k])},l.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},l.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},l.setOptions=function(M,w,u){for(var f in u)this.map[w](M,f,u[f])},l.getMapLayers=function(){return this.map.getStyle().layers},l.addLayer=function(M,w){var u=this.map;if(typeof w=="string"){if(w===""){u.addLayer(M,w);return}for(var f=this.getMapLayers(),k=0;k<f.length;k++)if(w===f[k].id){u.addLayer(M,w);return}g.warn(["Trying to add layer with *below* value",w,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}u.addLayer(M)},l.project=function(M){return this.map.project(new c.LngLat(M[0],M[1]))},l.getView=function(){var M=this.map,w=M.getCenter(),u=w.lng,f=w.lat,k={lon:u,lat:f},_=M.getCanvas(),D=parseInt(_.style.width),I=parseInt(_.style.height);return{center:k,zoom:M.getZoom(),bearing:M.getBearing(),pitch:M.getPitch(),_derived:{coordinates:[M.unproject([0,0]).toArray(),M.unproject([D,0]).toArray(),M.unproject([D,I]).toArray(),M.unproject([0,I]).toArray()]}}},l.getViewEdits=function(M){for(var w=this.id,u=["center","zoom","bearing","pitch"],f={},k=0;k<u.length;k++){var _=u[k];f[w+"."+_]=M[_]}return f},l.getViewEditsWithDerived=function(M){var w=this.id,u=this.getViewEdits(M);return u[w+"._derived"]=M._derived,u};function b(M,w){var u={};if(g.isPlainObject(M))u.id=M.id,u.style=M;else if(typeof M=="string")if(u.id=M,m.styleValuesMapbox.indexOf(M)!==-1)u.style=S(M);else if(m.stylesNonMapbox[M]){u.style=m.stylesNonMapbox[M];var f=u.style.sources["plotly-"+M],k=f?f.tiles:void 0;k&&k[0]&&k[0].slice(-9)==="?api_key="&&(k[0]+=w._mapboxAccessToken)}else u.style=M;else u.id=m.styleValueDflt,u.style=S(m.styleValueDflt);return u.transition={duration:0,delay:0},u}function S(M){return m.styleUrlPrefix+M+"-"+m.styleUrlSuffix}function T(M){return[M.lon,M.lat]}V.exports=y}),MI=Vt((X,V)=>{var c=qr(),g=Ld(),E=Gh(),A=Dv();V.exports=function(r,i,n){g(r,i,n,{type:"mapbox",attributes:A,handleDefaults:t,partition:"y",accessToken:i._mapboxAccessToken})};function t(r,i,n,o){n("accesstoken",o.accessToken),n("style"),n("center.lon"),n("center.lat"),n("zoom"),n("bearing"),n("pitch");var a=n("bounds.west"),s=n("bounds.east"),h=n("bounds.south"),v=n("bounds.north");(a===void 0||s===void 0||h===void 0||v===void 0)&&delete i.bounds,E(r,i,{name:"layers",handleItemDefaults:e}),i._input=r}function e(r,i){function n(m,p){return c.coerce(r,i,A.layers,m,p)}var o=n("visible");if(o){var a=n("sourcetype"),s=a==="raster"||a==="image";n("source"),n("sourceattribution"),a==="vector"&&n("sourcelayer"),a==="image"&&n("coordinates");var h;s&&(h="raster");var v=n("type",h);s&&v!=="raster"&&(v=i.type="raster",c.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),v==="circle"&&n("circle.radius"),v==="line"&&(n("line.width"),n("line.dash")),v==="fill"&&n("fill.outlinecolor"),v==="symbol"&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),c.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}}),Hx=Vt(X=>{var V=m5(),c=qr(),g=c.strTranslate,E=c.strScale,A=Ph().getSubplotCalcData,t=Cf(),e=Ai(),r=go(),i=sl(),n=AI(),o="mapbox",a=X.constants=$p();X.name=o,X.attr="subplot",X.idRoot=o,X.idRegex=X.attrRegex=c.counterRegex(o);var s=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");X.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},X.layoutAttributes=Dv(),X.supplyLayoutDefaults=MI();var h=!0;X.plot=function(p){h&&(h=!1,c.warn(s));var y=p._fullLayout,l=p.calcdata,x=y._subplots[o];if(V.version!==a.requiredVersion)throw new Error(a.wrongVersionErrorMsg);var b=v(p,x);V.accessToken=b;for(var S=0;S<x.length;S++){var T=x[S],M=A(l,o,T),w=y[T],u=w._subplot;u||(u=new n(p,T),y[T]._subplot=u),u.viewInitial||(u.viewInitial={center:c.extendFlat({},w.center),zoom:w.zoom,bearing:w.bearing,pitch:w.pitch}),u.plot(M,y,p._promises)}},X.clean=function(p,y,l,x){for(var b=x._subplots[o]||[],S=0;S<b.length;S++){var T=b[S];!y[T]&&x[T]._subplot&&x[T]._subplot.destroy()}},X.toSVG=function(p){for(var y=p._fullLayout,l=y._subplots[o],x=y._size,b=0;b<l.length;b++){var S=y[l[b]],T=S.domain,M=S._subplot,w=M.toImage("png"),u=y._glimages.append("svg:image");u.attr({xmlns:t.svg,"xlink:href":w,x:x.l+x.w*T.x[0],y:x.t+x.h*(1-T.y[1]),width:x.w*(T.x[1]-T.x[0]),height:x.h*(T.y[1]-T.y[0]),preserveAspectRatio:"none"});var f=e.select(S._subplot.div),k=f.select(".mapboxgl-ctrl-logo").node().offsetParent===null;if(!k){var _=y._glimages.append("g");_.attr("transform",g(x.l+x.w*T.x[0]+10,x.t+x.h*(1-T.y[0])-31)),_.append("path").attr("d",a.mapboxLogo.path0).style({opacity:.9,fill:"#ffffff","enable-background":"new"}),_.append("path").attr("d",a.mapboxLogo.path1).style("opacity",.35).style("enable-background","new"),_.append("path").attr("d",a.mapboxLogo.path2).style("opacity",.35).style("enable-background","new"),_.append("polygon").attr("points",a.mapboxLogo.polygon).style({opacity:.9,fill:"#ffffff","enable-background":"new"})}var D=f.select(".mapboxgl-ctrl-attrib").text().replace("Improve this map",""),I=y._glimages.append("g"),O=I.append("text");O.text(D).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":D});var B=r.bBox(O.node()),R=x.w*(T.x[1]-T.x[0]);if(B.width>R/2){var L=D.split("|").join("<br>");O.text(L).attr("data-unformatted",L).call(i.convertToTspans,p),B=r.bBox(O.node())}O.attr("transform",g(-3,-B.height+8)),I.insert("rect",".static-attribution").attr({x:-B.width-6,y:-B.height-3,width:B.width+6,height:B.height+3,fill:"rgba(255, 255, 255, 0.75)"});var F=1;B.width+6>R&&(F=R/(B.width+6));var N=[x.l+x.w*T.x[1],x.t+x.h*(1-T.y[0])];I.attr("transform",g(N[0],N[1])+E(F))}};function v(p,y){var l=p._fullLayout,x=p._context;if(x.mapboxAccessToken==="")return"";for(var b=[],S=[],T=!1,M=!1,w=0;w<y.length;w++){var u=l[y[w]],f=u.accesstoken;m(u.style)&&(f?c.pushUnique(b,f):(m(u._input.style)&&(c.error("Uses Mapbox map style, but did not set an access token."),T=!0),M=!0)),f&&c.pushUnique(S,f)}if(M){var k=T?a.noAccessTokenErrorMsg:a.missingStyleErrorMsg;throw c.error(k),new Error(k)}return b.length?(b.length>1&&c.warn(a.multipleTokensErrorMsg),b[0]):(S.length&&c.log(["Listed mapbox access token(s)",S.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function m(p){return typeof p=="string"&&(a.styleValuesMapbox.indexOf(p)!==-1||p.indexOf("mapbox://")===0||p.indexOf("stamen")===0)}X.updateFx=function(p){for(var y=p._fullLayout,l=y._subplots[o],x=0;x<l.length;x++){var b=y[l[x]]._subplot;b.updateFx(y)}}}),SI=Vt((X,V)=>{V.exports={attributes:Vx(),supplyDefaults:xI(),colorbar:Wh(),formatLabels:d5(),calc:kx(),plot:bI(),hoverPoints:qx().hoverPoints,eventData:wI(),selectPoints:TI(),styleOnSelect:function(c,g){if(g){var E=g[0].trace;E._glTrace.update(g)}},moduleType:"trace",name:"scattermapbox",basePlotModule:Hx(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}),EI=Vt((X,V)=>{V.exports=SI()}),v5=Vt((X,V)=>{var c=Wg(),g=wl(),E=Zo().hovertemplateAttrs,A=Ks(),t=po().extendFlat;V.exports=t({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:t({},c.featureidkey,{}),below:{valType:"string",editType:"plot"},text:c.text,hovertext:c.hovertext,marker:{line:{color:t({},c.marker.line.color,{editType:"plot"}),width:t({},c.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:t({},c.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:t({},c.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:t({},c.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:c.hoverinfo,hovertemplate:E({},{keys:["properties"]}),showlegend:t({},A.showlegend,{dflt:!1})},g("",{cLetter:"z",editTypeOverride:"calc"}))}),PI=Vt((X,V)=>{var c=qr(),g=ah(),E=v5();V.exports=function(A,t,e,r){function i(h,v){return c.coerce(A,t,E,h,v)}var n=i("locations"),o=i("z"),a=i("geojson");if(!c.isArrayOrTypedArray(n)||!n.length||!c.isArrayOrTypedArray(o)||!o.length||!(typeof a=="string"&&a!==""||c.isPlainObject(a))){t.visible=!1;return}i("featureidkey"),t._length=Math.min(n.length,o.length),i("below"),i("text"),i("hovertext"),i("hovertemplate");var s=i("marker.line.width");s&&i("marker.line.color"),i("marker.opacity"),g(A,t,r,i,{prefix:"",cLetter:"z"}),c.coerceSelectionMarkerOpacity(t,i)}}),y5=Vt((X,V)=>{var c=vo(),g=qr(),E=Ul(),A=go(),t=Ud().makeBlank,e=Vd();function r(n){var o=n[0].trace,a=o.visible===!0&&o._length!==0,s={layout:{visibility:"none"},paint:{}},h={layout:{visibility:"none"},paint:{}},v=o._opts={fill:s,line:h,geojson:t()};if(!a)return v;var m=e.extractTraceFeature(n);if(!m)return v;var p=E.makeColorScaleFuncFromTrace(o),y=o.marker,l=y.line||{},x;g.isArrayOrTypedArray(y.opacity)&&(x=function(k){var _=k.mo;return c(_)?+g.constrain(_,0,1):0});var b;g.isArrayOrTypedArray(l.color)&&(b=function(k){return k.mlc});var S;g.isArrayOrTypedArray(l.width)&&(S=function(k){return k.mlw});for(var T=0;T<n.length;T++){var M=n[T],w=M.fOut;if(w){var u=w.properties;u.fc=p(M.z),x&&(u.mo=x(M)),b&&(u.mlc=b(M)),S&&(u.mlw=S(M)),M.ct=u.ct,M._polygons=e.feature2polygons(w)}}var f=x?{type:"identity",property:"mo"}:y.opacity;return g.extendFlat(s.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":f}),g.extendFlat(h.paint,{"line-color":b?{type:"identity",property:"mlc"}:l.color,"line-width":S?{type:"identity",property:"mlw"}:l.width,"line-opacity":f}),s.layout.visibility="visible",h.layout.visibility="visible",v.geojson={type:"FeatureCollection",features:m},i(n),v}function i(n){var o=n[0].trace,a=o._opts,s;if(o.selectedpoints){for(var h=A.makeSelectedPointStyleFns(o),v=0;v<n.length;v++){var m=n[v];m.fOut&&(m.fOut.properties.mo2=h.selectedOpacityFn(m))}s={type:"identity",property:"mo2"}}else s=g.isArrayOrTypedArray(o.marker.opacity)?{type:"identity",property:"mo"}:o.marker.opacity;return g.extendFlat(a.fill.paint,{"fill-opacity":s}),g.extendFlat(a.line.paint,{"line-opacity":s}),a}V.exports={convert:r,convertOnSelect:i}}),II=Vt((X,V)=>{var c=y5().convert,g=y5().convertOnSelect,E=$p().traceLayerPrefix;function A(e,r){this.type="choroplethmapbox",this.subplot=e,this.uid=r,this.sourceId="source-"+r,this.layerList=[["fill",E+r+"-fill"],["line",E+r+"-line"]],this.below=null}var t=A.prototype;t.update=function(e){this._update(c(e)),e[0].trace._glTrace=this},t.updateOnSelect=function(e){this._update(g(e))},t._update=function(e){var r=this.subplot,i=this.layerList,n=r.belowLookup["trace-"+this.uid];r.map.getSource(this.sourceId).setData(e.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(e,n),this.below=n);for(var o=0;o<i.length;o++){var a=i[o],s=a[0],h=a[1],v=e[s];r.setOptions(h,"setLayoutProperty",v.layout),v.layout.visibility==="visible"&&r.setOptions(h,"setPaintProperty",v.paint)}},t._addLayers=function(e,r){for(var i=this.subplot,n=this.layerList,o=this.sourceId,a=0;a<n.length;a++){var s=n[a],h=s[0],v=e[h];i.addLayer({type:h,id:s[1],source:o,layout:v.layout,paint:v.paint},r)}},t._removeLayers=function(){for(var e=this.subplot.map,r=this.layerList,i=r.length-1;i>=0;i--)e.removeLayer(r[i][1])},t.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},V.exports=function(e,r){var i=r[0].trace,n=new A(e,i.uid),o=n.sourceId,a=c(r),s=n.below=e.belowLookup["trace-"+i.uid];return e.map.addSource(o,{type:"geojson",data:a.geojson}),n._addLayers(a,s),r[0].trace._glTrace=n,n}}),LI=Vt((X,V)=>{V.exports={attributes:v5(),supplyDefaults:PI(),colorbar:Id(),calc:Ex(),plot:II(),hoverPoints:Ix(),eventData:Lx(),selectPoints:Cx(),styleOnSelect:function(c,g){if(g){var E=g[0].trace;E._glTrace.updateOnSelect(g)}},getBelow:function(c,g){for(var E=g.getMapLayers(),A=E.length-2;A>=0;A--){var t=E[A].id;if(typeof t=="string"&&t.indexOf("water")===0){for(var e=A+1;e<E.length;e++)if(t=E[e].id,typeof t=="string"&&t.indexOf("plotly-")===-1)return t}}},moduleType:"trace",name:"choroplethmapbox",basePlotModule:Hx(),categories:["mapbox","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_mapbox"}}}),CI=Vt((X,V)=>{V.exports=LI()}),x5=Vt((X,V)=>{var c=wl(),g=Zo().hovertemplateAttrs,E=Ks(),A=Vx(),t=po().extendFlat;V.exports=t({lon:A.lon,lat:A.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:A.text,hovertext:A.hovertext,hoverinfo:t({},E.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:g(),showlegend:t({},E.showlegend,{dflt:!1})},c("",{cLetter:"z",editTypeOverride:"calc"}))}),DI=Vt((X,V)=>{var c=qr(),g=ah(),E=x5();V.exports=function(A,t,e,r){function i(s,h){return c.coerce(A,t,E,s,h)}var n=i("lon")||[],o=i("lat")||[],a=Math.min(n.length,o.length);if(!a){t.visible=!1;return}t._length=a,i("z"),i("radius"),i("below"),i("text"),i("hovertext"),i("hovertemplate"),g(A,t,r,i,{prefix:"",cLetter:"z"})}}),zI=Vt((X,V)=>{var c=vo(),g=qr().isArrayOrTypedArray,E=ts().BADNUM,A=df(),t=qr()._;V.exports=function(e,r){for(var i=r._length,n=new Array(i),o=r.z,a=g(o)&&o.length,s=0;s<i;s++){var h=n[s]={},v=r.lon[s],m=r.lat[s];if(h.lonlat=c(v)&&c(m)?[+v,+m]:[E,E],a){var p=o[s];h.z=c(p)?p:E}}return A(e,r,{vals:a?o:[0,1],containerStr:"",cLetter:"z"}),i&&(n[0].t={labels:{lat:t(e,"lat:")+" ",lon:t(e,"lon:")+" "}}),n}}),OI=Vt((X,V)=>{var c=vo(),g=qr(),E=vi(),A=Ul(),t=ts().BADNUM,e=Ud().makeBlank;V.exports=function(r){var i=r[0].trace,n=i.visible===!0&&i._length!==0,o={layout:{visibility:"none"},paint:{}},a=i._opts={heatmap:o,geojson:e()};if(!n)return a;var s=[],h,v=i.z,m=i.radius,p=g.isArrayOrTypedArray(v)&&v.length,y=g.isArrayOrTypedArray(m);for(h=0;h<r.length;h++){var l=r[h],x=l.lonlat;if(x[0]!==t){var b={};if(p){var S=l.z;b.z=S!==t?S:0}y&&(b.r=c(m[h])&&m[h]>0?+m[h]:0),s.push({type:"Feature",geometry:{type:"Point",coordinates:x},properties:b})}}var T=A.extractOpts(i),M=T.reversescale?A.flipScale(T.colorscale):T.colorscale,w=M[0][1],u=E.opacity(w)<1?w:E.addOpacity(w,0),f=["interpolate",["linear"],["heatmap-density"],0,u];for(h=1;h<M.length;h++)f.push(M[h][0],M[h][1]);var k=["interpolate",["linear"],["get","z"],T.min,0,T.max,1];return g.extendFlat(a.heatmap.paint,{"heatmap-weight":p?k:1/(T.max-T.min),"heatmap-color":f,"heatmap-radius":y?{type:"identity",property:"r"}:i.radius,"heatmap-opacity":i.opacity}),a.geojson={type:"FeatureCollection",features:s},a.heatmap.layout.visibility="visible",a}}),FI=Vt((X,V)=>{var c=OI(),g=$p().traceLayerPrefix;function E(t,e){this.type="densitymapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",g+e+"-heatmap"]],this.below=null}var A=E.prototype;A.update=function(t){var e=this.subplot,r=this.layerList,i=c(t),n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(i.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(i,n),this.below=n);for(var o=0;o<r.length;o++){var a=r[o],s=a[0],h=a[1],v=i[s];e.setOptions(h,"setLayoutProperty",v.layout),v.layout.visibility==="visible"&&e.setOptions(h,"setPaintProperty",v.paint)}},A._addLayers=function(t,e){for(var r=this.subplot,i=this.layerList,n=this.sourceId,o=0;o<i.length;o++){var a=i[o],s=a[0],h=t[s];r.addLayer({type:s,id:a[1],source:n,layout:h.layout,paint:h.paint},e)}},A._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},A.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},V.exports=function(t,e){var r=e[0].trace,i=new E(t,r.uid),n=i.sourceId,o=c(e),a=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(n,{type:"geojson",data:o.geojson}),i._addLayers(o,a),i}}),BI=Vt((X,V)=>{var c=ao(),g=qx().hoverPoints,E=qx().getExtraText;V.exports=function(A,t,e){var r=g(A,t,e);if(r){var i=r[0],n=i.cd,o=n[0].trace,a=n[i.index];if(delete i.color,"z"in a){var s=i.subplot.mockAxis;i.z=a.z,i.zLabel=c.tickText(s,s.c2l(a.z),"hover").text}return i.extraText=E(o,a,n[0].t.labels),[i]}}}),RI=Vt((X,V)=>{V.exports=function(c,g){return c.lon=g.lon,c.lat=g.lat,c.z=g.z,c}}),jI=Vt((X,V)=>{V.exports={attributes:x5(),supplyDefaults:DI(),colorbar:Id(),formatLabels:d5(),calc:zI(),plot:FI(),hoverPoints:BI(),eventData:RI(),getBelow:function(c,g){for(var E=g.getMapLayers(),A=0;A<E.length;A++){var t=E[A],e=t.id;if(t.type==="symbol"&&typeof e=="string"&&e.indexOf("plotly-")===-1)return e}},moduleType:"trace",name:"densitymapbox",basePlotModule:Hx(),categories:["mapbox","gl","showLegend"],meta:{hr_name:"density_mapbox"}}}),NI=Vt((X,V)=>{V.exports=jI()}),UI=Vt((X,V)=>{V.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © <a href='http://www.esri.com'>ESRI</a>"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin}
|
||
{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin}
|
||
{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin}
|
||
{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin}
|
||
{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin}
|
||
{name:nonlatin}`,"text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin}
|
||
{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":`{name:latin}
|
||
{name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":`{name:latin}
|
||
{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin}
|
||
{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin}
|
||
{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin}
|
||
{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}),VI=Vt((X,V)=>{V.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © <a href='http://www.esri.com'>ESRI</a>"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}),Wd=Vt((X,V)=>{var c=Td(),g=UI(),E=VI(),A='© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',t="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",e="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",r="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",n="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",a={basic:r,streets:r,outdoors:r,light:t,dark:e,satellite:E,"satellite-streets":g,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:A,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":t,"carto-darkmatter":e,"carto-voyager":r,"carto-positron-nolabels":i,"carto-darkmatter-nolabels":n,"carto-voyager-nolabels":o},s=c(a);V.exports={styleValueDflt:"basic",stylesMap:a,styleValuesMap:s,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",s.join(", "),"or use a tile service."].join(`
|
||
`),mapOnErrorMsg:"Map error."}}),zv=Vt((X,V)=>{var c=qr(),g=vi().defaultLine,E=pu().attributes,A=Nl(),t=Gu().textposition,e=su().overrideAll,r=Ns().templatedArray,i=Wd(),n=A({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var o=V.exports=e({_arrayAttrRegexps:[c.counterRegex("map",".layers",!0)],domain:E({name:"map"}),style:{valType:"any",values:i.styleValuesMap,dflt:i.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:g},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:g}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:n,textposition:c.extendFlat({},t,{arrayOk:!1})}})},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}),Gx=Vt((X,V)=>{var c=Zo().hovertemplateAttrs,g=Zo().texttemplateAttrs,E=rp(),A=E0(),t=Gu(),e=zv(),r=Ks(),i=wl(),n=po().extendFlat,o=su().overrideAll,a=zv(),s=A.line,h=A.marker;V.exports=o({lon:A.lon,lat:A.lat,cluster:{enabled:{valType:"boolean"},maxzoom:n({},a.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:n({},h.opacity,{dflt:1})},mode:n({},t.mode,{dflt:"markers"}),text:n({},t.text,{}),texttemplate:g({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:n({},t.hovertext,{}),line:{color:s.color,width:s.width},connectgaps:t.connectgaps,marker:n({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:h.opacity,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode},i("marker")),fill:A.fill,fillcolor:E(),textfont:e.layers.symbol.textfont,textposition:e.layers.symbol.textposition,below:{valType:"string"},selected:{marker:t.selected.marker},unselected:{marker:t.unselected.marker},hoverinfo:n({},r.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:c()},"calc","nested")}),_5=Vt((X,V)=>{var c=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];V.exports={isSupportedFont:function(g){return c.indexOf(g)!==-1}}}),qI=Vt((X,V)=>{var c=qr(),g=Sl(),E=Df(),A=Nf(),t=Uf(),e=ap(),r=Gx(),i=_5().isSupportedFont;V.exports=function(o,a,s,h){function v(f,k){return c.coerce(o,a,r,f,k)}function m(f,k){return c.coerce2(o,a,r,f,k)}var p=n(o,a,v);if(!p){a.visible=!1;return}if(v("text"),v("texttemplate"),v("hovertext"),v("hovertemplate"),v("mode"),v("below"),g.hasMarkers(a)){E(o,a,s,h,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("marker.angle");var y=a.marker;y.symbol!=="circle"&&(c.isArrayOrTypedArray(y.size)&&(y.size=y.size[0]),c.isArrayOrTypedArray(y.color)&&(y.color=y.color[0]))}g.hasLines(a)&&(A(o,a,s,h,v,{noDash:!0}),v("connectgaps"));var l=m("cluster.maxzoom"),x=m("cluster.step"),b=m("cluster.color",a.marker&&a.marker.color||s),S=m("cluster.size"),T=m("cluster.opacity"),M=l!==!1||x!==!1||b!==!1||S!==!1||T!==!1,w=v("cluster.enabled",M);if(w||g.hasText(a)){var u=h.font.family;t(o,a,h,v,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:i(u)?u:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}v("fill"),a.fill!=="none"&&e(o,a,s,v),c.coerceSelectionMarkerOpacity(a,v)};function n(o,a,s){var h=s("lon")||[],v=s("lat")||[],m=Math.min(h.length,v.length);return a._length=m,m}}),b5=Vt((X,V)=>{var c=ao();V.exports=function(g,E,A){var t={},e=A[E.subplot]._subplot,r=e.mockAxis,i=g.lonlat;return t.lonLabel=c.tickText(r,r.c2l(i[0]),!0).text,t.latLabel=c.tickText(r,r.c2l(i[1]),!0).text,t}}),w5=Vt((X,V)=>{var c=qr();V.exports=function(g,E){var A=g.split(" "),t=A[0],e=A[1],r=c.isArrayOrTypedArray(E)?c.mean(E):E,i=.5+r/100,n=1.5+r/100,o=["",""],a=[0,0];switch(t){case"top":o[0]="top",a[1]=-n;break;case"bottom":o[0]="bottom",a[1]=n;break}switch(e){case"left":o[1]="right",a[0]=-i;break;case"right":o[1]="left",a[0]=i;break}var s;return o[0]&&o[1]?s=o.join("-"):o[0]?s=o[0]:o[1]?s=o[1]:s="center",{anchor:s,offset:a}}}),HI=Vt((X,V)=>{var c=vo(),g=qr(),E=ts().BADNUM,A=Ud(),t=Ul(),e=go(),r=_g(),i=Sl(),n=_5().isSupportedFont,o=w5(),a=vf().appendArrayPointValue,s=sl().NEWLINES,h=sl().BR_TAG_ALL;V.exports=function(T,M){var w=M[0].trace,u=w.visible===!0&&w._length!==0,f=w.fill!=="none",k=i.hasLines(w),_=i.hasMarkers(w),D=i.hasText(w),I=_&&w.marker.symbol==="circle",O=_&&w.marker.symbol!=="circle",B=w.cluster&&w.cluster.enabled,R=v("fill"),L=v("line"),F=v("circle"),N=v("symbol"),j={fill:R,line:L,circle:F,symbol:N};if(!u)return j;var G;if((f||k)&&(G=A.calcTraceToLineCoords(M)),f&&(R.geojson=A.makePolygon(G),R.layout.visibility="visible",g.extendFlat(R.paint,{"fill-color":w.fillcolor})),k&&(L.geojson=A.makeLine(G),L.layout.visibility="visible",g.extendFlat(L.paint,{"line-width":w.line.width,"line-color":w.line.color,"line-opacity":w.opacity})),I){var rt=m(M);F.geojson=rt.geojson,F.layout.visibility="visible",B&&(F.filter=["!",["has","point_count"]],j.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":b(w.cluster.color,w.cluster.step),"circle-radius":b(w.cluster.size,w.cluster.step),"circle-opacity":b(w.cluster.opacity,w.cluster.step)}},j.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(w),"text-size":12}}),g.extendFlat(F.paint,{"circle-color":rt.mcc,"circle-radius":rt.mrc,"circle-opacity":rt.mo})}if(I&&B&&(F.filter=["!",["has","point_count"]]),(O||D)&&(N.geojson=p(M,T),g.extendFlat(N.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),O&&(g.extendFlat(N.layout,{"icon-size":w.marker.size/10}),"angle"in w.marker&&w.marker.angle!=="auto"&&g.extendFlat(N.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),N.layout["icon-allow-overlap"]=w.marker.allowoverlap,g.extendFlat(N.paint,{"icon-opacity":w.opacity*w.marker.opacity,"icon-color":w.marker.color})),D)){var ct=(w.marker||{}).size,lt=o(w.textposition,ct);g.extendFlat(N.layout,{"text-size":w.textfont.size,"text-anchor":lt.anchor,"text-offset":lt.offset,"text-font":S(w)}),g.extendFlat(N.paint,{"text-color":w.textfont.color,"text-opacity":w.opacity})}return j};function v(T){return{type:T,geojson:A.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function m(T){var M=T[0].trace,w=M.marker,u=M.selectedpoints,f=g.isArrayOrTypedArray(w.color),k=g.isArrayOrTypedArray(w.size),_=g.isArrayOrTypedArray(w.opacity),D;function I(lt){return M.opacity*lt}function O(lt){return lt/2}var B;f&&(t.hasColorscale(M,"marker")?B=t.makeColorScaleFuncFromTrace(w):B=g.identity);var R;k&&(R=r(M));var L;_&&(L=function(lt){var tt=c(lt)?+g.constrain(lt,0,1):0;return I(tt)});var F=[];for(D=0;D<T.length;D++){var N=T[D],j=N.lonlat;if(!x(j)){var G={};B&&(G.mcc=N.mcc=B(N.mc)),R&&(G.mrc=N.mrc=R(N.ms)),L&&(G.mo=L(N.mo)),u&&(G.selected=N.selected||0),F.push({type:"Feature",id:D+1,geometry:{type:"Point",coordinates:j},properties:G})}}var rt;if(u)for(rt=e.makeSelectedPointStyleFns(M),D=0;D<F.length;D++){var ct=F[D].properties;rt.selectedOpacityFn&&(ct.mo=I(rt.selectedOpacityFn(ct))),rt.selectedColorFn&&(ct.mcc=rt.selectedColorFn(ct)),rt.selectedSizeFn&&(ct.mrc=rt.selectedSizeFn(ct))}return{geojson:{type:"FeatureCollection",features:F},mcc:f||rt&&rt.selectedColorFn?{type:"identity",property:"mcc"}:w.color,mrc:k||rt&&rt.selectedSizeFn?{type:"identity",property:"mrc"}:O(w.size),mo:_||rt&&rt.selectedOpacityFn?{type:"identity",property:"mo"}:I(w.opacity)}}function p(T,M){for(var w=M._fullLayout,u=T[0].trace,f=u.marker||{},k=f.symbol,_=f.angle,D=k!=="circle"?y(k):l,I=_!=="auto"?y(_,!0):l,O=i.hasText(u)?y(u.text):l,B=[],R=0;R<T.length;R++){var L=T[R];if(!x(L.lonlat)){var F=u.texttemplate,N;if(F){var j=Array.isArray(F)?F[R]||"":F,G=u._module.formatLabels(L,u,w),rt={};a(rt,u,L.i);var ct=u._meta||{};N=g.texttemplateString(j,G,w._d3locale,rt,L,ct)}else N=O(R);N&&(N=N.replace(s,"").replace(h,`
|
||
`)),B.push({type:"Feature",geometry:{type:"Point",coordinates:L.lonlat},properties:{symbol:D(R),angle:I(R),text:N}})}}return{type:"FeatureCollection",features:B}}function y(T,M){return g.isArrayOrTypedArray(T)?M?function(w){return c(T[w])?+T[w]:0}:function(w){return T[w]}:T?function(){return T}:l}function l(){return""}function x(T){return T[0]===E}function b(T,M){var w;if(g.isArrayOrTypedArray(T)&&g.isArrayOrTypedArray(M)){w=["step",["get","point_count"],T[0]];for(var u=1;u<T.length;u++)w.push(M[u-1],T[u])}else w=T;return w}function S(T){var M=T.textfont,w=M.family,u=M.style,f=M.weight,k=w.split(" "),_=k[k.length-1]==="Italic";_&&k.pop(),_=_||u==="italic";var D=k.join(" ");f==="bold"&&k.indexOf("Bold")===-1?D+=" Bold":f<=1e3&&(k[0]==="Metropolis"?(D="Metropolis",f>850?D+=" Black":f>750?D+=" Extra Bold":f>650?D+=" Bold":f>550?D+=" Semi Bold":f>450?D+=" Medium":f>350?D+=" Regular":f>250?D+=" Light":f>150?D+=" Extra Light":D+=" Thin"):k.slice(0,2).join(" ")==="Open Sans"?(D="Open Sans",f>750?D+=" Extrabold":f>650?D+=" Bold":f>550?D+=" Semibold":f>350?D+=" Regular":D+=" Light"):k.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(D="Klokantech Noto Sans",k[3]==="CJK"&&(D+=" CJK"),D+=f>500?" Bold":" Regular")),_&&(D+=" Italic"),D==="Open Sans Regular Italic"?D="Open Sans Italic":D==="Open Sans Regular Bold"?D="Open Sans Bold":D==="Open Sans Regular Bold Italic"?D="Open Sans Bold Italic":D==="Klokantech Noto Sans Regular Italic"&&(D="Klokantech Noto Sans Italic"),n(D)||(D=w);var I=D.split(", ");return I}}),GI=Vt((X,V)=>{var c=qr(),g=HI(),E=Wd().traceLayerPrefix,A={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function t(r,i,n,o){this.type="scattermap",this.subplot=r,this.uid=i,this.clusterEnabled=n,this.isHidden=o,this.sourceIds={fill:"source-"+i+"-fill",line:"source-"+i+"-line",circle:"source-"+i+"-circle",symbol:"source-"+i+"-symbol",cluster:"source-"+i+"-circle",clusterCount:"source-"+i+"-circle"},this.layerIds={fill:E+i+"-fill",line:E+i+"-line",circle:E+i+"-circle",symbol:E+i+"-symbol",cluster:E+i+"-cluster",clusterCount:E+i+"-cluster-count"},this.below=null}var e=t.prototype;e.addSource=function(r,i,n){var o={type:"geojson",data:i.geojson};n&&n.enabled&&c.extendFlat(o,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[r]);a?a.setData(i.geojson):this.subplot.map.addSource(this.sourceIds[r],o)},e.setSourceData=function(r,i){this.subplot.map.getSource(this.sourceIds[r]).setData(i.geojson)},e.addLayer=function(r,i,n){var o={type:i.type,id:this.layerIds[r],source:this.sourceIds[r],layout:i.layout,paint:i.paint};i.filter&&(o.filter=i.filter);for(var a=this.layerIds[r],s,h=this.subplot.getMapLayers(),v=0;v<h.length;v++)if(h[v].id===a){s=!0;break}s?(this.subplot.setOptions(a,"setLayoutProperty",o.layout),o.layout.visibility==="visible"&&this.subplot.setOptions(a,"setPaintProperty",o.paint)):this.subplot.addLayer(o,n)},e.update=function(r){var i=r[0].trace,n=this.subplot,o=n.map,a=g(n.gd,r),s=n.belowLookup["trace-"+this.uid],h=!!(i.cluster&&i.cluster.enabled),v=!!this.clusterEnabled,m=this;function p(u){u||m.addSource("circle",a.circle,i.cluster);for(var f=A.cluster,k=0;k<f.length;k++){var _=f[k],D=a[_];m.addLayer(_,D,s)}}function y(u){for(var f=A.cluster,k=f.length-1;k>=0;k--){var _=f[k];o.removeLayer(m.layerIds[_])}u||o.removeSource(m.sourceIds.circle)}function l(u){for(var f=A.nonCluster,k=0;k<f.length;k++){var _=f[k],D=a[_];u||m.addSource(_,D),m.addLayer(_,D,s)}}function x(u){for(var f=A.nonCluster,k=f.length-1;k>=0;k--){var _=f[k];o.removeLayer(m.layerIds[_]),u||o.removeSource(m.sourceIds[_])}}function b(u){v?y(u):x(u)}function S(u){h?p(u):l(u)}function T(){for(var u=h?A.cluster:A.nonCluster,f=0;f<u.length;f++){var k=u[f],_=a[k];_&&(n.setOptions(m.layerIds[k],"setLayoutProperty",_.layout),_.layout.visibility==="visible"&&(k!=="cluster"&&m.setSourceData(k,_),n.setOptions(m.layerIds[k],"setPaintProperty",_.paint)))}}var M=this.isHidden,w=i.visible!==!0;w?M||b():M?w||S():v!==h?(b(),S()):(this.below!==s&&(b(!0),S(!0)),T()),this.clusterEnabled=h,this.isHidden=w,this.below=s,r[0].trace._glTrace=this},e.dispose=function(){for(var r=this.subplot.map,i=this.clusterEnabled?A.cluster:A.nonCluster,n=i.length-1;n>=0;n--){var o=i[n];r.removeLayer(this.layerIds[o]),r.removeSource(this.sourceIds[o])}},V.exports=function(r,i){var n=i[0].trace,o=n.cluster&&n.cluster.enabled,a=n.visible!==!0,s=new t(r,n.uid,o,a),h=g(r.gd,i),v=s.below=r.belowLookup["trace-"+n.uid],m,p,y;if(o)for(s.addSource("circle",h.circle,n.cluster),m=0;m<A.cluster.length;m++)p=A.cluster[m],y=h[p],s.addLayer(p,y,v);else for(m=0;m<A.nonCluster.length;m++)p=A.nonCluster[m],y=h[p],s.addSource(p,y,n.cluster),s.addLayer(p,y,v);return i[0].trace._glTrace=s,s}}),Wx=Vt((X,V)=>{var c=Hu(),g=qr(),E=Mg(),A=g.fillText,t=ts().BADNUM,e=Wd().traceLayerPrefix;function r(n,o,a){var s=n.cd,h=s[0].trace,v=n.xa,m=n.ya,p=n.subplot,y=[],l=e+h.uid+"-circle",x=h.cluster&&h.cluster.enabled;if(x){var b=p.map.queryRenderedFeatures(null,{layers:[l]});y=b.map(function(R){return R.id})}var S=o>=0?Math.floor((o+180)/360):Math.ceil((o-180)/360),T=S*360,M=o-T;function w(R){var L=R.lonlat;if(L[0]===t||x&&y.indexOf(R.i+1)===-1)return 1/0;var F=g.modHalf(L[0],360),N=L[1],j=p.project([F,N]),G=j.x-v.c2p([M,N]),rt=j.y-m.c2p([F,a]),ct=Math.max(3,R.mrc||0);return Math.max(Math.sqrt(G*G+rt*rt)-ct,1-3/ct)}if(c.getClosest(s,w,n),n.index!==!1){var u=s[n.index],f=u.lonlat,k=[g.modHalf(f[0],360)+T,f[1]],_=v.c2p(k),D=m.c2p(k),I=u.mrc||1;n.x0=_-I,n.x1=_+I,n.y0=D-I,n.y1=D+I;var O={};O[h.subplot]={_subplot:p};var B=h._module.formatLabels(u,h,O);return n.lonLabel=B.lonLabel,n.latLabel=B.latLabel,n.color=E(h,u),n.extraText=i(h,u,s[0].t.labels),n.hovertemplate=h.hovertemplate,[n]}}function i(n,o,a){if(n.hovertemplate)return;var s=o.hi||n.hoverinfo,h=s.split("+"),v=h.indexOf("all")!==-1,m=h.indexOf("lon")!==-1,p=h.indexOf("lat")!==-1,y=o.lonlat,l=[];function x(b){return b+"°"}return v||m&&p?l.push("("+x(y[1])+", "+x(y[0])+")"):m?l.push(a.lon+x(y[0])):p&&l.push(a.lat+x(y[1])),(v||h.indexOf("text")!==-1)&&A(o,n,l),l.join("<br>")}V.exports={hoverPoints:r,getExtraText:i}}),WI=Vt((X,V)=>{V.exports=function(c,g){return c.lon=g.lon,c.lat=g.lat,c}}),ZI=Vt((X,V)=>{var c=qr(),g=Sl(),E=ts().BADNUM;V.exports=function(A,t){var e=A.cd,r=A.xaxis,i=A.yaxis,n=[],o=e[0].trace,a;if(!g.hasMarkers(o))return[];if(t===!1)for(a=0;a<e.length;a++)e[a].selected=0;else for(a=0;a<e.length;a++){var s=e[a],h=s.lonlat;if(h[0]!==E){var v=[c.modHalf(h[0],360),h[1]],m=[r.c2p(v),i.c2p(v)];t.contains(m,null,a,A)?(n.push({pointNumber:a,lon:h[0],lat:h[1]}),s.selected=1):s.selected=0}}return n}}),XI=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?V.exports=g():(c=typeof globalThis<"u"?globalThis:c||self,c.maplibregl=g())})(X,function(){var c={},g={};function E(t,e,r){if(g[t]=r,t==="index"){var i="var sharedModule = {}; ("+g.shared+")(sharedModule); ("+g.worker+")(sharedModule);",n={};return g.shared(n),g.index(c,n),typeof window<"u"&&c.setWorkerUrl(window.URL.createObjectURL(new Blob([i],{type:"text/javascript"}))),c}}E("shared",["exports"],function(t){function e(U,C,J,ht){return new(J||(J=Promise))(function(At,Bt){function jt(Ie){try{me(ht.next(Ie))}catch(Ge){Bt(Ge)}}function ae(Ie){try{me(ht.throw(Ie))}catch(Ge){Bt(Ge)}}function me(Ie){var Ge;Ie.done?At(Ie.value):(Ge=Ie.value,Ge instanceof J?Ge:new J(function(Ke){Ke(Ge)})).then(jt,ae)}me((ht=ht.apply(U,C||[])).next())})}function r(U){return U&&U.__esModule&&Object.prototype.hasOwnProperty.call(U,"default")?U.default:U}typeof SuppressedError=="function"&&SuppressedError;var i=n;function n(U,C){this.x=U,this.y=C}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(U){return this.clone()._add(U)},sub:function(U){return this.clone()._sub(U)},multByPoint:function(U){return this.clone()._multByPoint(U)},divByPoint:function(U){return this.clone()._divByPoint(U)},mult:function(U){return this.clone()._mult(U)},div:function(U){return this.clone()._div(U)},rotate:function(U){return this.clone()._rotate(U)},rotateAround:function(U,C){return this.clone()._rotateAround(U,C)},matMult:function(U){return this.clone()._matMult(U)},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(U){return this.x===U.x&&this.y===U.y},dist:function(U){return Math.sqrt(this.distSqr(U))},distSqr:function(U){var C=U.x-this.x,J=U.y-this.y;return C*C+J*J},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(U){return Math.atan2(this.y-U.y,this.x-U.x)},angleWith:function(U){return this.angleWithSep(U.x,U.y)},angleWithSep:function(U,C){return Math.atan2(this.x*C-this.y*U,this.x*U+this.y*C)},_matMult:function(U){var C=U[2]*this.x+U[3]*this.y;return this.x=U[0]*this.x+U[1]*this.y,this.y=C,this},_add:function(U){return this.x+=U.x,this.y+=U.y,this},_sub:function(U){return this.x-=U.x,this.y-=U.y,this},_mult:function(U){return this.x*=U,this.y*=U,this},_div:function(U){return this.x/=U,this.y/=U,this},_multByPoint:function(U){return this.x*=U.x,this.y*=U.y,this},_divByPoint:function(U){return this.x/=U.x,this.y/=U.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var U=this.y;return this.y=this.x,this.x=-U,this},_rotate:function(U){var C=Math.cos(U),J=Math.sin(U),ht=J*this.x+C*this.y;return this.x=C*this.x-J*this.y,this.y=ht,this},_rotateAround:function(U,C){var J=Math.cos(U),ht=Math.sin(U),At=C.y+ht*(this.x-C.x)+J*(this.y-C.y);return this.x=C.x+J*(this.x-C.x)-ht*(this.y-C.y),this.y=At,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(U){return U instanceof n?U:Array.isArray(U)?new n(U[0],U[1]):U};var o=r(i),a=s;function s(U,C,J,ht){this.cx=3*U,this.bx=3*(J-U)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*C,this.by=3*(ht-C)-this.cy,this.ay=1-this.cy-this.by,this.p1x=U,this.p1y=C,this.p2x=J,this.p2y=ht}s.prototype={sampleCurveX:function(U){return((this.ax*U+this.bx)*U+this.cx)*U},sampleCurveY:function(U){return((this.ay*U+this.by)*U+this.cy)*U},sampleCurveDerivativeX:function(U){return(3*this.ax*U+2*this.bx)*U+this.cx},solveCurveX:function(U,C){if(C===void 0&&(C=1e-6),U<0)return 0;if(U>1)return 1;for(var J=U,ht=0;ht<8;ht++){var At=this.sampleCurveX(J)-U;if(Math.abs(At)<C)return J;var Bt=this.sampleCurveDerivativeX(J);if(Math.abs(Bt)<1e-6)break;J-=At/Bt}var jt=0,ae=1;for(J=U,ht=0;ht<20&&(At=this.sampleCurveX(J),!(Math.abs(At-U)<C));ht++)U>At?jt=J:ae=J,J=.5*(ae-jt)+jt;return J},solve:function(U,C){return this.sampleCurveY(this.solveCurveX(U,C))}};var h=r(a);let v,m;function p(){return v==null&&(v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),v}function y(){if(m==null&&(m=!1,p())){let U=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(U){for(let J=0;J<5*5;J++){let ht=4*J;U.fillStyle=`rgb(${ht},${ht+1},${ht+2})`,U.fillRect(J%5,Math.floor(J/5),1,1)}let C=U.getImageData(0,0,5,5).data;for(let J=0;J<5*5*4;J++)if(J%4!=3&&C[J]!==J){m=!0;break}}}return m||!1}function l(U,C,J,ht){let At=new h(U,C,J,ht);return Bt=>At.solve(Bt)}let x=l(.25,.1,.25,1);function b(U,C,J){return Math.min(J,Math.max(C,U))}function S(U,C,J){let ht=J-C,At=((U-C)%ht+ht)%ht+C;return At===C?J:At}function T(U,...C){for(let J of C)for(let ht in J)U[ht]=J[ht];return U}let M=1;function w(U,C,J){let ht={};for(let At in U)ht[At]=C.call(this,U[At],At,U);return ht}function u(U,C,J){let ht={};for(let At in U)C.call(this,U[At],At,U)&&(ht[At]=U[At]);return ht}function f(U){return Array.isArray(U)?U.map(f):typeof U=="object"&&U?w(U,f):U}let k={};function _(U){k[U]||(typeof console<"u"&&console.warn(U),k[U]=!0)}function D(U,C,J){return(J.y-U.y)*(C.x-U.x)>(C.y-U.y)*(J.x-U.x)}function I(U){return typeof WorkerGlobalScope<"u"&&U!==void 0&&U instanceof WorkerGlobalScope}let O=null;function B(U){return typeof ImageBitmap<"u"&&U instanceof ImageBitmap}let R="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function L(U,C,J,ht,At){return e(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let Bt=new VideoFrame(U,{timestamp:0});try{let jt=Bt?.format;if(!jt||!jt.startsWith("BGR")&&!jt.startsWith("RGB"))throw new Error(`Unrecognized format ${jt}`);let ae=jt.startsWith("BGR"),me=new Uint8ClampedArray(ht*At*4);if(yield Bt.copyTo(me,function(Ie,Ge,Ke,vr,Cr){let Nr=4*Math.max(-Ge,0),$r=(Math.max(0,Ke)-Ke)*vr*4+Nr,cn=4*vr,Pn=Math.max(0,Ge),ua=Math.max(0,Ke);return{rect:{x:Pn,y:ua,width:Math.min(Ie.width,Ge+vr)-Pn,height:Math.min(Ie.height,Ke+Cr)-ua},layout:[{offset:$r,stride:cn}]}}(U,C,J,ht,At)),ae)for(let Ie=0;Ie<me.length;Ie+=4){let Ge=me[Ie];me[Ie]=me[Ie+2],me[Ie+2]=Ge}return me}finally{Bt.close()}})}let F,N,j="AbortError";function G(){return new Error(j)}let rt={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function ct(U){return rt.REGISTERED_PROTOCOLS[U.substring(0,U.indexOf("://"))]}let lt="global-dispatcher";class tt extends Error{constructor(C,J,ht,At){super(`AJAXError: ${J} (${C}): ${ht}`),this.status=C,this.statusText=J,this.url=ht,this.body=At}}let Z=()=>I(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,st=function(U,C){if(/:\/\//.test(U.url)&&!/^https?:|^file:/.test(U.url)){let ht=ct(U.url);if(ht)return ht(U,C);if(I(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:U,targetMapId:lt},C)}if(!(/^file:/.test(J=U.url)||/^file:/.test(Z())&&!/^\w+:/.test(J))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(ht,At){return e(this,void 0,void 0,function*(){let Bt=new Request(ht.url,{method:ht.method||"GET",body:ht.body,credentials:ht.credentials,headers:ht.headers,cache:ht.cache,referrer:Z(),signal:At.signal});ht.type!=="json"||Bt.headers.has("Accept")||Bt.headers.set("Accept","application/json");let jt=yield fetch(Bt);if(!jt.ok){let Ie=yield jt.blob();throw new tt(jt.status,jt.statusText,ht.url,Ie)}let ae;ae=ht.type==="arrayBuffer"||ht.type==="image"?jt.arrayBuffer():ht.type==="json"?jt.json():jt.text();let me=yield ae;if(At.signal.aborted)throw G();return{data:me,cacheControl:jt.headers.get("Cache-Control"),expires:jt.headers.get("Expires")}})}(U,C);if(I(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:U,mustQueue:!0,targetMapId:lt},C)}var J;return function(ht,At){return new Promise((Bt,jt)=>{var ae;let me=new XMLHttpRequest;me.open(ht.method||"GET",ht.url,!0),ht.type!=="arrayBuffer"&&ht.type!=="image"||(me.responseType="arraybuffer");for(let Ie in ht.headers)me.setRequestHeader(Ie,ht.headers[Ie]);ht.type==="json"&&(me.responseType="text",!((ae=ht.headers)===null||ae===void 0)&&ae.Accept||me.setRequestHeader("Accept","application/json")),me.withCredentials=ht.credentials==="include",me.onerror=()=>{jt(new Error(me.statusText))},me.onload=()=>{if(!At.signal.aborted)if((me.status>=200&&me.status<300||me.status===0)&&me.response!==null){let Ie=me.response;if(ht.type==="json")try{Ie=JSON.parse(me.response)}catch(Ge){return void jt(Ge)}Bt({data:Ie,cacheControl:me.getResponseHeader("Cache-Control"),expires:me.getResponseHeader("Expires")})}else{let Ie=new Blob([me.response],{type:me.getResponseHeader("Content-Type")});jt(new tt(me.status,me.statusText,ht.url,Ie))}},At.signal.addEventListener("abort",()=>{me.abort(),jt(G())}),me.send(ht.body)})}(U,C)};function $(U){if(!U||U.indexOf("://")<=0||U.indexOf("data:image/")===0||U.indexOf("blob:")===0)return!0;let C=new URL(U),J=window.location;return C.protocol===J.protocol&&C.host===J.host}function Q(U,C,J){J[U]&&J[U].indexOf(C)!==-1||(J[U]=J[U]||[],J[U].push(C))}function nt(U,C,J){if(J&&J[U]){let ht=J[U].indexOf(C);ht!==-1&&J[U].splice(ht,1)}}class Y{constructor(C,J={}){T(this,J),this.type=C}}class q extends Y{constructor(C,J={}){super("error",T({error:C},J))}}class ot{on(C,J){return this._listeners=this._listeners||{},Q(C,J,this._listeners),this}off(C,J){return nt(C,J,this._listeners),nt(C,J,this._oneTimeListeners),this}once(C,J){return J?(this._oneTimeListeners=this._oneTimeListeners||{},Q(C,J,this._oneTimeListeners),this):new Promise(ht=>this.once(C,ht))}fire(C,J){typeof C=="string"&&(C=new Y(C,J||{}));let ht=C.type;if(this.listens(ht)){C.target=this;let At=this._listeners&&this._listeners[ht]?this._listeners[ht].slice():[];for(let ae of At)ae.call(this,C);let Bt=this._oneTimeListeners&&this._oneTimeListeners[ht]?this._oneTimeListeners[ht].slice():[];for(let ae of Bt)nt(ht,ae,this._oneTimeListeners),ae.call(this,C);let jt=this._eventedParent;jt&&(T(C,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),jt.fire(C))}else C instanceof q&&console.error(C.error);return this}listens(C){return this._listeners&&this._listeners[C]&&this._listeners[C].length>0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)}setEventedParent(C,J){return this._eventedParent=C,this._eventedParentData=J,this}}var it={$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"},sky:{type:"sky"},projection:{type:"projection"},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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},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":{}}},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}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},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"}}};let dt=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function wt(U,C){let J={};for(let ht in U)ht!=="ref"&&(J[ht]=U[ht]);return dt.forEach(ht=>{ht in C&&(J[ht]=C[ht])}),J}function xt(U,C){if(Array.isArray(U)){if(!Array.isArray(C)||U.length!==C.length)return!1;for(let J=0;J<U.length;J++)if(!xt(U[J],C[J]))return!1;return!0}if(typeof U=="object"&&U!==null&&C!==null){if(typeof C!="object"||Object.keys(U).length!==Object.keys(C).length)return!1;for(let J in U)if(!xt(U[J],C[J]))return!1;return!0}return U===C}function Ft(U,C){U.push(C)}function Et(U,C,J){Ft(J,{command:"addSource",args:[U,C[U]]})}function Nt(U,C,J){Ft(C,{command:"removeSource",args:[U]}),J[U]=!0}function te(U,C,J,ht){Nt(U,J,ht),Et(U,C,J)}function Jt(U,C,J){let ht;for(ht in U[J])if(Object.prototype.hasOwnProperty.call(U[J],ht)&&ht!=="data"&&!xt(U[J][ht],C[J][ht]))return!1;for(ht in C[J])if(Object.prototype.hasOwnProperty.call(C[J],ht)&&ht!=="data"&&!xt(U[J][ht],C[J][ht]))return!1;return!0}function Qt(U,C,J,ht,At,Bt){U=U||{},C=C||{};for(let jt in U)Object.prototype.hasOwnProperty.call(U,jt)&&(xt(U[jt],C[jt])||J.push({command:Bt,args:[ht,jt,C[jt],At]}));for(let jt in C)Object.prototype.hasOwnProperty.call(C,jt)&&!Object.prototype.hasOwnProperty.call(U,jt)&&(xt(U[jt],C[jt])||J.push({command:Bt,args:[ht,jt,C[jt],At]}))}function Wt(U){return U.id}function gt(U,C){return U[C.id]=C,U}class bt{constructor(C,J,ht,At){this.message=(C?`${C}: `:"")+ht,At&&(this.identifier=At),J!=null&&J.__line__&&(this.line=J.__line__)}}function vt(U,...C){for(let J of C)for(let ht in J)U[ht]=J[ht];return U}class Ut extends Error{constructor(C,J){super(J),this.message=J,this.key=C}}class Kt{constructor(C,J=[]){this.parent=C,this.bindings={};for(let[ht,At]of J)this.bindings[ht]=At}concat(C){return new Kt(this,C)}get(C){if(this.bindings[C])return this.bindings[C];if(this.parent)return this.parent.get(C);throw new Error(`${C} not found in scope.`)}has(C){return!!this.bindings[C]||!!this.parent&&this.parent.has(C)}}let Zt={kind:"null"},le={kind:"number"},Te={kind:"string"},Se={kind:"boolean"},Fe={kind:"color"},Oe={kind:"object"},ur={kind:"value"},fr={kind:"collator"},We={kind:"formatted"},Lr={kind:"padding"},kr={kind:"resolvedImage"},he={kind:"variableAnchorOffsetCollection"};function Dt(U,C){return{kind:"array",itemType:U,N:C}}function qt(U){if(U.kind==="array"){let C=qt(U.itemType);return typeof U.N=="number"?`array<${C}, ${U.N}>`:U.itemType.kind==="value"?"array":`array<${C}>`}return U.kind}let zt=[Zt,le,Te,Se,Fe,We,Oe,Dt(ur),Lr,kr,he];function ut(U,C){if(C.kind==="error")return null;if(U.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!ut(U.itemType,C.itemType))&&(typeof U.N!="number"||U.N===C.N))return null}else{if(U.kind===C.kind)return null;if(U.kind==="value"){for(let J of zt)if(!ut(J,C))return null}}return`Expected ${qt(U)} but found ${qt(C)} instead.`}function yt(U,C){return C.some(J=>J.kind===U.kind)}function Mt(U,C){return C.some(J=>J==="null"?U===null:J==="array"?Array.isArray(U):J==="object"?U&&!Array.isArray(U)&&typeof U=="object":J===typeof U)}function Ot(U,C){return U.kind==="array"&&C.kind==="array"?U.itemType.kind===C.itemType.kind&&typeof U.N=="number":U.kind===C.kind}let $t=.96422,ee=.82521,we=4/29,Me=6/29,Re=3*Me*Me,Be=Me*Me*Me,Ze=Math.PI/180,Ue=180/Math.PI;function mr(U){return(U%=360)<0&&(U+=360),U}function ln([U,C,J,ht]){let At,Bt,jt=vn((.2225045*(U=an(U))+.7168786*(C=an(C))+.0606169*(J=an(J)))/1);U===C&&C===J?At=Bt=jt:(At=vn((.4360747*U+.3850649*C+.1430804*J)/$t),Bt=vn((.0139322*U+.0971045*C+.7141733*J)/ee));let ae=116*jt-16;return[ae<0?0:ae,500*(At-jt),200*(jt-Bt),ht]}function an(U){return U<=.04045?U/12.92:Math.pow((U+.055)/1.055,2.4)}function vn(U){return U>Be?Math.pow(U,1/3):U/Re+we}function Sn([U,C,J,ht]){let At=(U+16)/116,Bt=isNaN(C)?At:At+C/500,jt=isNaN(J)?At:At-J/200;return At=1*pn(At),Bt=$t*pn(Bt),jt=ee*pn(jt),[An(3.1338561*Bt-1.6168667*At-.4906146*jt),An(-.9787684*Bt+1.9161415*At+.033454*jt),An(.0719453*Bt-.2289914*At+1.4052427*jt),ht]}function An(U){return(U=U<=.00304?12.92*U:1.055*Math.pow(U,1/2.4)-.055)<0?0:U>1?1:U}function pn(U){return U>Me?U*U*U:Re*(U-we)}function On(U){return parseInt(U.padEnd(2,U),16)/255}function Nn(U,C){return ke(C?U/100:U,0,1)}function ke(U,C,J){return Math.min(Math.max(C,U),J)}function ze(U){return!U.some(Number.isNaN)}let je={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Ne{constructor(C,J,ht,At=1,Bt=!0){this.r=C,this.g=J,this.b=ht,this.a=At,Bt||(this.r*=At,this.g*=At,this.b*=At,At||this.overwriteGetter("rgb",[C,J,ht,At]))}static parse(C){if(C instanceof Ne)return C;if(typeof C!="string")return;let J=function(ht){if((ht=ht.toLowerCase().trim())==="transparent")return[0,0,0,0];let At=je[ht];if(At){let[jt,ae,me]=At;return[jt/255,ae/255,me/255,1]}if(ht.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(ht)){let jt=ht.length<6?1:2,ae=1;return[On(ht.slice(ae,ae+=jt)),On(ht.slice(ae,ae+=jt)),On(ht.slice(ae,ae+=jt)),On(ht.slice(ae,ae+jt)||"ff")]}if(ht.startsWith("rgb")){let jt=ht.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(jt){let[ae,me,Ie,Ge,Ke,vr,Cr,Nr,$r,cn,Pn,ua]=jt,Un=[Ge||" ",Cr||" ",cn].join("");if(Un===" "||Un===" /"||Un===",,"||Un===",,,"){let Kn=[Ie,vr,$r].join(""),Sa=Kn==="%%%"?100:Kn===""?255:0;if(Sa){let Ya=[ke(+me/Sa,0,1),ke(+Ke/Sa,0,1),ke(+Nr/Sa,0,1),Pn?Nn(+Pn,ua):1];if(ze(Ya))return Ya}}return}}let Bt=ht.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Bt){let[jt,ae,me,Ie,Ge,Ke,vr,Cr,Nr]=Bt,$r=[me||" ",Ge||" ",vr].join("");if($r===" "||$r===" /"||$r===",,"||$r===",,,"){let cn=[+ae,ke(+Ie,0,100),ke(+Ke,0,100),Cr?Nn(+Cr,Nr):1];if(ze(cn))return function([Pn,ua,Un,Kn]){function Sa(Ya){let Qi=(Ya+Pn/30)%12,Vo=ua*Math.min(Un,1-Un);return Un-Vo*Math.max(-1,Math.min(Qi-3,9-Qi,1))}return Pn=mr(Pn),ua/=100,Un/=100,[Sa(0),Sa(8),Sa(4),Kn]}(cn)}}}(C);return J?new Ne(...J,!1):void 0}get rgb(){let{r:C,g:J,b:ht,a:At}=this,Bt=At||1/0;return this.overwriteGetter("rgb",[C/Bt,J/Bt,ht/Bt,At])}get hcl(){return this.overwriteGetter("hcl",function(C){let[J,ht,At,Bt]=ln(C),jt=Math.sqrt(ht*ht+At*At);return[Math.round(1e4*jt)?mr(Math.atan2(At,ht)*Ue):NaN,jt,J,Bt]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ln(this.rgb))}overwriteGetter(C,J){return Object.defineProperty(this,C,{value:J}),J}toString(){let[C,J,ht,At]=this.rgb;return`rgba(${[C,J,ht].map(Bt=>Math.round(255*Bt)).join(",")},${At})`}}Ne.black=new Ne(0,0,0,1),Ne.white=new Ne(1,1,1,1),Ne.transparent=new Ne(0,0,0,0),Ne.red=new Ne(1,0,0,1);class _r{constructor(C,J,ht){this.sensitivity=C?J?"variant":"case":J?"accent":"base",this.locale=ht,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(C,J){return this.collator.compare(C,J)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Xr{constructor(C,J,ht,At,Bt){this.text=C,this.image=J,this.scale=ht,this.fontStack=At,this.textColor=Bt}}class rn{constructor(C){this.sections=C}static fromString(C){return new rn([new Xr(C,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(C=>C.text.length!==0||C.image&&C.image.name.length!==0)}static factory(C){return C instanceof rn?C:rn.fromString(C)}toString(){return this.sections.length===0?"":this.sections.map(C=>C.text).join("")}}class Br{constructor(C){this.values=C.slice()}static parse(C){if(C instanceof Br)return C;if(typeof C=="number")return new Br([C,C,C,C]);if(Array.isArray(C)&&!(C.length<1||C.length>4)){for(let J of C)if(typeof J!="number")return;switch(C.length){case 1:C=[C[0],C[0],C[0],C[0]];break;case 2:C=[C[0],C[1],C[0],C[1]];break;case 3:C=[C[0],C[1],C[2],C[1]]}return new Br(C)}}toString(){return JSON.stringify(this.values)}}let _n=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class bn{constructor(C){this.values=C.slice()}static parse(C){if(C instanceof bn)return C;if(Array.isArray(C)&&!(C.length<1)&&C.length%2==0){for(let J=0;J<C.length;J+=2){let ht=C[J],At=C[J+1];if(typeof ht!="string"||!_n.has(ht)||!Array.isArray(At)||At.length!==2||typeof At[0]!="number"||typeof At[1]!="number")return}return new bn(C)}}toString(){return JSON.stringify(this.values)}}class Fn{constructor(C){this.name=C.name,this.available=C.available}toString(){return this.name}static fromString(C){return C?new Fn({name:C,available:!1}):null}}function on(U,C,J,ht){return typeof U=="number"&&U>=0&&U<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof J=="number"&&J>=0&&J<=255?ht===void 0||typeof ht=="number"&&ht>=0&&ht<=1?null:`Invalid rgba value [${[U,C,J,ht].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof ht=="number"?[U,C,J,ht]:[U,C,J]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Bn(U){if(U===null||typeof U=="string"||typeof U=="boolean"||typeof U=="number"||U instanceof Ne||U instanceof _r||U instanceof rn||U instanceof Br||U instanceof bn||U instanceof Fn)return!0;if(Array.isArray(U)){for(let C of U)if(!Bn(C))return!1;return!0}if(typeof U=="object"){for(let C in U)if(!Bn(U[C]))return!1;return!0}return!1}function ue(U){if(U===null)return Zt;if(typeof U=="string")return Te;if(typeof U=="boolean")return Se;if(typeof U=="number")return le;if(U instanceof Ne)return Fe;if(U instanceof _r)return fr;if(U instanceof rn)return We;if(U instanceof Br)return Lr;if(U instanceof bn)return he;if(U instanceof Fn)return kr;if(Array.isArray(U)){let C=U.length,J;for(let ht of U){let At=ue(ht);if(J){if(J===At)continue;J=ur;break}J=At}return Dt(J||ur,C)}return Oe}function xe(U){let C=typeof U;return U===null?"":C==="string"||C==="number"||C==="boolean"?String(U):U instanceof Ne||U instanceof rn||U instanceof Br||U instanceof bn||U instanceof Fn?U.toString():JSON.stringify(U)}class Pr{constructor(C,J){this.type=C,this.value=J}static parse(C,J){if(C.length!==2)return J.error(`'literal' expression requires exactly one argument, but found ${C.length-1} instead.`);if(!Bn(C[1]))return J.error("invalid value");let ht=C[1],At=ue(ht),Bt=J.expectedType;return At.kind!=="array"||At.N!==0||!Bt||Bt.kind!=="array"||typeof Bt.N=="number"&&Bt.N!==0||(At=Bt),new Pr(At,ht)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Sr{constructor(C){this.name="ExpressionEvaluationError",this.message=C}toJSON(){return this.message}}let gr={string:Te,number:le,boolean:Se,object:Oe};class dr{constructor(C,J){this.type=C,this.args=J}static parse(C,J){if(C.length<2)return J.error("Expected at least one argument.");let ht,At=1,Bt=C[0];if(Bt==="array"){let ae,me;if(C.length>2){let Ie=C[1];if(typeof Ie!="string"||!(Ie in gr)||Ie==="object")return J.error('The item type argument of "array" must be one of string, number, boolean',1);ae=gr[Ie],At++}else ae=ur;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return J.error('The length argument to "array" must be a positive integer literal',2);me=C[2],At++}ht=Dt(ae,me)}else{if(!gr[Bt])throw new Error(`Types doesn't contain name = ${Bt}`);ht=gr[Bt]}let jt=[];for(;At<C.length;At++){let ae=J.parse(C[At],At,ur);if(!ae)return null;jt.push(ae)}return new dr(ht,jt)}evaluate(C){for(let J=0;J<this.args.length;J++){let ht=this.args[J].evaluate(C);if(!ut(this.type,ue(ht)))return ht;if(J===this.args.length-1)throw new Sr(`Expected value to be of type ${qt(this.type)}, but found ${qt(ue(ht))} instead.`)}throw new Error}eachChild(C){this.args.forEach(C)}outputDefined(){return this.args.every(C=>C.outputDefined())}}let Er={"to-boolean":Se,"to-color":Fe,"to-number":le,"to-string":Te};class Dr{constructor(C,J){this.type=C,this.args=J}static parse(C,J){if(C.length<2)return J.error("Expected at least one argument.");let ht=C[0];if(!Er[ht])throw new Error(`Can't parse ${ht} as it is not part of the known types`);if((ht==="to-boolean"||ht==="to-string")&&C.length!==2)return J.error("Expected one argument.");let At=Er[ht],Bt=[];for(let jt=1;jt<C.length;jt++){let ae=J.parse(C[jt],jt,ur);if(!ae)return null;Bt.push(ae)}return new Dr(At,Bt)}evaluate(C){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(C);case"color":{let J,ht;for(let At of this.args){if(J=At.evaluate(C),ht=null,J instanceof Ne)return J;if(typeof J=="string"){let Bt=C.parseColor(J);if(Bt)return Bt}else if(Array.isArray(J)&&(ht=J.length<3||J.length>4?`Invalid rbga value ${JSON.stringify(J)}: expected an array containing either three or four numeric values.`:on(J[0],J[1],J[2],J[3]),!ht))return new Ne(J[0]/255,J[1]/255,J[2]/255,J[3])}throw new Sr(ht||`Could not parse color from value '${typeof J=="string"?J:JSON.stringify(J)}'`)}case"padding":{let J;for(let ht of this.args){J=ht.evaluate(C);let At=Br.parse(J);if(At)return At}throw new Sr(`Could not parse padding from value '${typeof J=="string"?J:JSON.stringify(J)}'`)}case"variableAnchorOffsetCollection":{let J;for(let ht of this.args){J=ht.evaluate(C);let At=bn.parse(J);if(At)return At}throw new Sr(`Could not parse variableAnchorOffsetCollection from value '${typeof J=="string"?J:JSON.stringify(J)}'`)}case"number":{let J=null;for(let ht of this.args){if(J=ht.evaluate(C),J===null)return 0;let At=Number(J);if(!isNaN(At))return At}throw new Sr(`Could not convert ${JSON.stringify(J)} to number.`)}case"formatted":return rn.fromString(xe(this.args[0].evaluate(C)));case"resolvedImage":return Fn.fromString(xe(this.args[0].evaluate(C)));default:return xe(this.args[0].evaluate(C))}}eachChild(C){this.args.forEach(C)}outputDefined(){return this.args.every(C=>C.outputDefined())}}let Ar=["Unknown","Point","LineString","Polygon"];class Gr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ar[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(C){let J=this._parseColorCache[C];return J||(J=this._parseColorCache[C]=Ne.parse(C)),J}}class Wr{constructor(C,J,ht=[],At,Bt=new Kt,jt=[]){this.registry=C,this.path=ht,this.key=ht.map(ae=>`[${ae}]`).join(""),this.scope=Bt,this.errors=jt,this.expectedType=At,this._isConstant=J}parse(C,J,ht,At,Bt={}){return J?this.concat(J,ht,At)._parse(C,Bt):this._parse(C,Bt)}_parse(C,J){function ht(At,Bt,jt){return jt==="assert"?new dr(Bt,[At]):jt==="coerce"?new Dr(Bt,[At]):At}if(C!==null&&typeof C!="string"&&typeof C!="boolean"&&typeof C!="number"||(C=["literal",C]),Array.isArray(C)){if(C.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let At=C[0];if(typeof At!="string")return this.error(`Expression name must be a string, but found ${typeof At} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let Bt=this.registry[At];if(Bt){let jt=Bt.parse(C,this);if(!jt)return null;if(this.expectedType){let ae=this.expectedType,me=jt.type;if(ae.kind!=="string"&&ae.kind!=="number"&&ae.kind!=="boolean"&&ae.kind!=="object"&&ae.kind!=="array"||me.kind!=="value")if(ae.kind!=="color"&&ae.kind!=="formatted"&&ae.kind!=="resolvedImage"||me.kind!=="value"&&me.kind!=="string")if(ae.kind!=="padding"||me.kind!=="value"&&me.kind!=="number"&&me.kind!=="array")if(ae.kind!=="variableAnchorOffsetCollection"||me.kind!=="value"&&me.kind!=="array"){if(this.checkSubtype(ae,me))return null}else jt=ht(jt,ae,J.typeAnnotation||"coerce");else jt=ht(jt,ae,J.typeAnnotation||"coerce");else jt=ht(jt,ae,J.typeAnnotation||"coerce");else jt=ht(jt,ae,J.typeAnnotation||"assert")}if(!(jt instanceof Pr)&&jt.type.kind!=="resolvedImage"&&this._isConstant(jt)){let ae=new Gr;try{jt=new Pr(jt.type,jt.evaluate(ae))}catch(me){return this.error(me.message),null}}return jt}return this.error(`Unknown expression "${At}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(C===void 0?"'undefined' value invalid. Use null instead.":typeof C=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof C} instead.`)}concat(C,J,ht){let At=typeof C=="number"?this.path.concat(C):this.path,Bt=ht?this.scope.concat(ht):this.scope;return new Wr(this.registry,this._isConstant,At,J||null,Bt,this.errors)}error(C,...J){let ht=`${this.key}${J.map(At=>`[${At}]`).join("")}`;this.errors.push(new Ut(ht,C))}checkSubtype(C,J){let ht=ut(C,J);return ht&&this.error(ht),ht}}class Jr{constructor(C,J){this.type=J.type,this.bindings=[].concat(C),this.result=J}evaluate(C){return this.result.evaluate(C)}eachChild(C){for(let J of this.bindings)C(J[1]);C(this.result)}static parse(C,J){if(C.length<4)return J.error(`Expected at least 3 arguments, but found ${C.length-1} instead.`);let ht=[];for(let Bt=1;Bt<C.length-1;Bt+=2){let jt=C[Bt];if(typeof jt!="string")return J.error(`Expected string, but found ${typeof jt} instead.`,Bt);if(/[^a-zA-Z0-9_]/.test(jt))return J.error("Variable names must contain only alphanumeric characters or '_'.",Bt);let ae=J.parse(C[Bt+1],Bt+1);if(!ae)return null;ht.push([jt,ae])}let At=J.parse(C[C.length-1],C.length-1,J.expectedType,ht);return At?new Jr(ht,At):null}outputDefined(){return this.result.outputDefined()}}class _e{constructor(C,J){this.type=J.type,this.name=C,this.boundExpression=J}static parse(C,J){if(C.length!==2||typeof C[1]!="string")return J.error("'var' expression requires exactly one string literal argument.");let ht=C[1];return J.scope.has(ht)?new _e(ht,J.scope.get(ht)):J.error(`Unknown variable "${ht}". Make sure "${ht}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(C){return this.boundExpression.evaluate(C)}eachChild(){}outputDefined(){return!1}}class Je{constructor(C,J,ht){this.type=C,this.index=J,this.input=ht}static parse(C,J){if(C.length!==3)return J.error(`Expected 2 arguments, but found ${C.length-1} instead.`);let ht=J.parse(C[1],1,le),At=J.parse(C[2],2,Dt(J.expectedType||ur));return ht&&At?new Je(At.type.itemType,ht,At):null}evaluate(C){let J=this.index.evaluate(C),ht=this.input.evaluate(C);if(J<0)throw new Sr(`Array index out of bounds: ${J} < 0.`);if(J>=ht.length)throw new Sr(`Array index out of bounds: ${J} > ${ht.length-1}.`);if(J!==Math.floor(J))throw new Sr(`Array index must be an integer, but found ${J} instead.`);return ht[J]}eachChild(C){C(this.index),C(this.input)}outputDefined(){return!1}}class yr{constructor(C,J){this.type=Se,this.needle=C,this.haystack=J}static parse(C,J){if(C.length!==3)return J.error(`Expected 2 arguments, but found ${C.length-1} instead.`);let ht=J.parse(C[1],1,ur),At=J.parse(C[2],2,ur);return ht&&At?yt(ht.type,[Se,Te,le,Zt,ur])?new yr(ht,At):J.error(`Expected first argument to be of type boolean, string, number or null, but found ${qt(ht.type)} instead`):null}evaluate(C){let J=this.needle.evaluate(C),ht=this.haystack.evaluate(C);if(!ht)return!1;if(!Mt(J,["boolean","string","number","null"]))throw new Sr(`Expected first argument to be of type boolean, string, number or null, but found ${qt(ue(J))} instead.`);if(!Mt(ht,["string","array"]))throw new Sr(`Expected second argument to be of type array or string, but found ${qt(ue(ht))} instead.`);return ht.indexOf(J)>=0}eachChild(C){C(this.needle),C(this.haystack)}outputDefined(){return!0}}class Hr{constructor(C,J,ht){this.type=le,this.needle=C,this.haystack=J,this.fromIndex=ht}static parse(C,J){if(C.length<=2||C.length>=5)return J.error(`Expected 3 or 4 arguments, but found ${C.length-1} instead.`);let ht=J.parse(C[1],1,ur),At=J.parse(C[2],2,ur);if(!ht||!At)return null;if(!yt(ht.type,[Se,Te,le,Zt,ur]))return J.error(`Expected first argument to be of type boolean, string, number or null, but found ${qt(ht.type)} instead`);if(C.length===4){let Bt=J.parse(C[3],3,le);return Bt?new Hr(ht,At,Bt):null}return new Hr(ht,At)}evaluate(C){let J=this.needle.evaluate(C),ht=this.haystack.evaluate(C);if(!Mt(J,["boolean","string","number","null"]))throw new Sr(`Expected first argument to be of type boolean, string, number or null, but found ${qt(ue(J))} instead.`);let At;if(this.fromIndex&&(At=this.fromIndex.evaluate(C)),Mt(ht,["string"])){let Bt=ht.indexOf(J,At);return Bt===-1?-1:[...ht.slice(0,Bt)].length}if(Mt(ht,["array"]))return ht.indexOf(J,At);throw new Sr(`Expected second argument to be of type array or string, but found ${qt(ue(ht))} instead.`)}eachChild(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)}outputDefined(){return!1}}class hn{constructor(C,J,ht,At,Bt,jt){this.inputType=C,this.type=J,this.input=ht,this.cases=At,this.outputs=Bt,this.otherwise=jt}static parse(C,J){if(C.length<5)return J.error(`Expected at least 4 arguments, but found only ${C.length-1}.`);if(C.length%2!=1)return J.error("Expected an even number of arguments.");let ht,At;J.expectedType&&J.expectedType.kind!=="value"&&(At=J.expectedType);let Bt={},jt=[];for(let Ie=2;Ie<C.length-1;Ie+=2){let Ge=C[Ie],Ke=C[Ie+1];Array.isArray(Ge)||(Ge=[Ge]);let vr=J.concat(Ie);if(Ge.length===0)return vr.error("Expected at least one branch label.");for(let Nr of Ge){if(typeof Nr!="number"&&typeof Nr!="string")return vr.error("Branch labels must be numbers or strings.");if(typeof Nr=="number"&&Math.abs(Nr)>Number.MAX_SAFE_INTEGER)return vr.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Nr=="number"&&Math.floor(Nr)!==Nr)return vr.error("Numeric branch labels must be integer values.");if(ht){if(vr.checkSubtype(ht,ue(Nr)))return null}else ht=ue(Nr);if(Bt[String(Nr)]!==void 0)return vr.error("Branch labels must be unique.");Bt[String(Nr)]=jt.length}let Cr=J.parse(Ke,Ie,At);if(!Cr)return null;At=At||Cr.type,jt.push(Cr)}let ae=J.parse(C[1],1,ur);if(!ae)return null;let me=J.parse(C[C.length-1],C.length-1,At);return me?ae.type.kind!=="value"&&J.concat(1).checkSubtype(ht,ae.type)?null:new hn(ht,At,ae,Bt,jt,me):null}evaluate(C){let J=this.input.evaluate(C);return(ue(J)===this.inputType&&this.outputs[this.cases[J]]||this.otherwise).evaluate(C)}eachChild(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)}outputDefined(){return this.outputs.every(C=>C.outputDefined())&&this.otherwise.outputDefined()}}class En{constructor(C,J,ht){this.type=C,this.branches=J,this.otherwise=ht}static parse(C,J){if(C.length<4)return J.error(`Expected at least 3 arguments, but found only ${C.length-1}.`);if(C.length%2!=0)return J.error("Expected an odd number of arguments.");let ht;J.expectedType&&J.expectedType.kind!=="value"&&(ht=J.expectedType);let At=[];for(let jt=1;jt<C.length-1;jt+=2){let ae=J.parse(C[jt],jt,Se);if(!ae)return null;let me=J.parse(C[jt+1],jt+1,ht);if(!me)return null;At.push([ae,me]),ht=ht||me.type}let Bt=J.parse(C[C.length-1],C.length-1,ht);if(!Bt)return null;if(!ht)throw new Error("Can't infer output type");return new En(ht,At,Bt)}evaluate(C){for(let[J,ht]of this.branches)if(J.evaluate(C))return ht.evaluate(C);return this.otherwise.evaluate(C)}eachChild(C){for(let[J,ht]of this.branches)C(J),C(ht);C(this.otherwise)}outputDefined(){return this.branches.every(([C,J])=>J.outputDefined())&&this.otherwise.outputDefined()}}class dn{constructor(C,J,ht,At){this.type=C,this.input=J,this.beginIndex=ht,this.endIndex=At}static parse(C,J){if(C.length<=2||C.length>=5)return J.error(`Expected 3 or 4 arguments, but found ${C.length-1} instead.`);let ht=J.parse(C[1],1,ur),At=J.parse(C[2],2,le);if(!ht||!At)return null;if(!yt(ht.type,[Dt(ur),Te,ur]))return J.error(`Expected first argument to be of type array or string, but found ${qt(ht.type)} instead`);if(C.length===4){let Bt=J.parse(C[3],3,le);return Bt?new dn(ht.type,ht,At,Bt):null}return new dn(ht.type,ht,At)}evaluate(C){let J=this.input.evaluate(C),ht=this.beginIndex.evaluate(C),At;if(this.endIndex&&(At=this.endIndex.evaluate(C)),Mt(J,["string"]))return[...J].slice(ht,At).join("");if(Mt(J,["array"]))return J.slice(ht,At);throw new Sr(`Expected first argument to be of type array or string, but found ${qt(ue(J))} instead.`)}eachChild(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)}outputDefined(){return!1}}function Kr(U,C){let J=U.length-1,ht,At,Bt=0,jt=J,ae=0;for(;Bt<=jt;)if(ae=Math.floor((Bt+jt)/2),ht=U[ae],At=U[ae+1],ht<=C){if(ae===J||C<At)return ae;Bt=ae+1}else{if(!(ht>C))throw new Sr("Input is not a number.");jt=ae-1}return 0}class Tn{constructor(C,J,ht){this.type=C,this.input=J,this.labels=[],this.outputs=[];for(let[At,Bt]of ht)this.labels.push(At),this.outputs.push(Bt)}static parse(C,J){if(C.length-1<4)return J.error(`Expected at least 4 arguments, but found only ${C.length-1}.`);if((C.length-1)%2!=0)return J.error("Expected an even number of arguments.");let ht=J.parse(C[1],1,le);if(!ht)return null;let At=[],Bt=null;J.expectedType&&J.expectedType.kind!=="value"&&(Bt=J.expectedType);for(let jt=1;jt<C.length;jt+=2){let ae=jt===1?-1/0:C[jt],me=C[jt+1],Ie=jt,Ge=jt+1;if(typeof ae!="number")return J.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Ie);if(At.length&&At[At.length-1][0]>=ae)return J.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Ie);let Ke=J.parse(me,Ge,Bt);if(!Ke)return null;Bt=Bt||Ke.type,At.push([ae,Ke])}return new Tn(Bt,ht,At)}evaluate(C){let J=this.labels,ht=this.outputs;if(J.length===1)return ht[0].evaluate(C);let At=this.input.evaluate(C);if(At<=J[0])return ht[0].evaluate(C);let Bt=J.length;return At>=J[Bt-1]?ht[Bt-1].evaluate(C):ht[Kr(J,At)].evaluate(C)}eachChild(C){C(this.input);for(let J of this.outputs)C(J)}outputDefined(){return this.outputs.every(C=>C.outputDefined())}}function ta(U){return U&&U.__esModule&&Object.prototype.hasOwnProperty.call(U,"default")?U.default:U}var Qn=Va;function Va(U,C,J,ht){this.cx=3*U,this.bx=3*(J-U)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*C,this.by=3*(ht-C)-this.cy,this.ay=1-this.cy-this.by,this.p1x=U,this.p1y=C,this.p2x=J,this.p2y=ht}Va.prototype={sampleCurveX:function(U){return((this.ax*U+this.bx)*U+this.cx)*U},sampleCurveY:function(U){return((this.ay*U+this.by)*U+this.cy)*U},sampleCurveDerivativeX:function(U){return(3*this.ax*U+2*this.bx)*U+this.cx},solveCurveX:function(U,C){if(C===void 0&&(C=1e-6),U<0)return 0;if(U>1)return 1;for(var J=U,ht=0;ht<8;ht++){var At=this.sampleCurveX(J)-U;if(Math.abs(At)<C)return J;var Bt=this.sampleCurveDerivativeX(J);if(Math.abs(Bt)<1e-6)break;J-=At/Bt}var jt=0,ae=1;for(J=U,ht=0;ht<20&&(At=this.sampleCurveX(J),!(Math.abs(At-U)<C));ht++)U>At?jt=J:ae=J,J=.5*(ae-jt)+jt;return J},solve:function(U,C){return this.sampleCurveY(this.solveCurveX(U,C))}};var ja=ta(Qn);function ci(U,C,J){return U+J*(C-U)}function pi(U,C,J){return U.map((ht,At)=>ci(ht,C[At],J))}let bi={number:ci,color:function(U,C,J,ht="rgb"){switch(ht){case"rgb":{let[At,Bt,jt,ae]=pi(U.rgb,C.rgb,J);return new Ne(At,Bt,jt,ae,!1)}case"hcl":{let[At,Bt,jt,ae]=U.hcl,[me,Ie,Ge,Ke]=C.hcl,vr,Cr;if(isNaN(At)||isNaN(me))isNaN(At)?isNaN(me)?vr=NaN:(vr=me,jt!==1&&jt!==0||(Cr=Ie)):(vr=At,Ge!==1&&Ge!==0||(Cr=Bt));else{let ua=me-At;me>At&&ua>180?ua-=360:me<At&&At-me>180&&(ua+=360),vr=At+J*ua}let[Nr,$r,cn,Pn]=function([ua,Un,Kn,Sa]){return ua=isNaN(ua)?0:ua*Ze,Sn([Kn,Math.cos(ua)*Un,Math.sin(ua)*Un,Sa])}([vr,Cr??ci(Bt,Ie,J),ci(jt,Ge,J),ci(ae,Ke,J)]);return new Ne(Nr,$r,cn,Pn,!1)}case"lab":{let[At,Bt,jt,ae]=Sn(pi(U.lab,C.lab,J));return new Ne(At,Bt,jt,ae,!1)}}},array:pi,padding:function(U,C,J){return new Br(pi(U.values,C.values,J))},variableAnchorOffsetCollection:function(U,C,J){let ht=U.values,At=C.values;if(ht.length!==At.length)throw new Sr(`Cannot interpolate values of different length. from: ${U.toString()}, to: ${C.toString()}`);let Bt=[];for(let jt=0;jt<ht.length;jt+=2){if(ht[jt]!==At[jt])throw new Sr(`Cannot interpolate values containing mismatched anchors. from[${jt}]: ${ht[jt]}, to[${jt}]: ${At[jt]}`);Bt.push(ht[jt]);let[ae,me]=ht[jt+1],[Ie,Ge]=At[jt+1];Bt.push([ci(ae,Ie,J),ci(me,Ge,J)])}return new bn(Bt)}};class ri{constructor(C,J,ht,At,Bt){this.type=C,this.operator=J,this.interpolation=ht,this.input=At,this.labels=[],this.outputs=[];for(let[jt,ae]of Bt)this.labels.push(jt),this.outputs.push(ae)}static interpolationFactor(C,J,ht,At){let Bt=0;if(C.name==="exponential")Bt=Da(J,C.base,ht,At);else if(C.name==="linear")Bt=Da(J,1,ht,At);else if(C.name==="cubic-bezier"){let jt=C.controlPoints;Bt=new ja(jt[0],jt[1],jt[2],jt[3]).solve(Da(J,1,ht,At))}return Bt}static parse(C,J){let[ht,At,Bt,...jt]=C;if(!Array.isArray(At)||At.length===0)return J.error("Expected an interpolation type expression.",1);if(At[0]==="linear")At={name:"linear"};else if(At[0]==="exponential"){let Ie=At[1];if(typeof Ie!="number")return J.error("Exponential interpolation requires a numeric base.",1,1);At={name:"exponential",base:Ie}}else{if(At[0]!=="cubic-bezier")return J.error(`Unknown interpolation type ${String(At[0])}`,1,0);{let Ie=At.slice(1);if(Ie.length!==4||Ie.some(Ge=>typeof Ge!="number"||Ge<0||Ge>1))return J.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);At={name:"cubic-bezier",controlPoints:Ie}}}if(C.length-1<4)return J.error(`Expected at least 4 arguments, but found only ${C.length-1}.`);if((C.length-1)%2!=0)return J.error("Expected an even number of arguments.");if(Bt=J.parse(Bt,2,le),!Bt)return null;let ae=[],me=null;ht==="interpolate-hcl"||ht==="interpolate-lab"?me=Fe:J.expectedType&&J.expectedType.kind!=="value"&&(me=J.expectedType);for(let Ie=0;Ie<jt.length;Ie+=2){let Ge=jt[Ie],Ke=jt[Ie+1],vr=Ie+3,Cr=Ie+4;if(typeof Ge!="number")return J.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',vr);if(ae.length&&ae[ae.length-1][0]>=Ge)return J.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',vr);let Nr=J.parse(Ke,Cr,me);if(!Nr)return null;me=me||Nr.type,ae.push([Ge,Nr])}return Ot(me,le)||Ot(me,Fe)||Ot(me,Lr)||Ot(me,he)||Ot(me,Dt(le))?new ri(me,ht,At,Bt,ae):J.error(`Type ${qt(me)} is not interpolatable.`)}evaluate(C){let J=this.labels,ht=this.outputs;if(J.length===1)return ht[0].evaluate(C);let At=this.input.evaluate(C);if(At<=J[0])return ht[0].evaluate(C);let Bt=J.length;if(At>=J[Bt-1])return ht[Bt-1].evaluate(C);let jt=Kr(J,At),ae=ri.interpolationFactor(this.interpolation,At,J[jt],J[jt+1]),me=ht[jt].evaluate(C),Ie=ht[jt+1].evaluate(C);switch(this.operator){case"interpolate":return bi[this.type.kind](me,Ie,ae);case"interpolate-hcl":return bi.color(me,Ie,ae,"hcl");case"interpolate-lab":return bi.color(me,Ie,ae,"lab")}}eachChild(C){C(this.input);for(let J of this.outputs)C(J)}outputDefined(){return this.outputs.every(C=>C.outputDefined())}}function Da(U,C,J,ht){let At=ht-J,Bt=U-J;return At===0?0:C===1?Bt/At:(Math.pow(C,Bt)-1)/(Math.pow(C,At)-1)}class Ui{constructor(C,J){this.type=C,this.args=J}static parse(C,J){if(C.length<2)return J.error("Expectected at least one argument.");let ht=null,At=J.expectedType;At&&At.kind!=="value"&&(ht=At);let Bt=[];for(let ae of C.slice(1)){let me=J.parse(ae,1+Bt.length,ht,void 0,{typeAnnotation:"omit"});if(!me)return null;ht=ht||me.type,Bt.push(me)}if(!ht)throw new Error("No output type");let jt=At&&Bt.some(ae=>ut(At,ae.type));return new Ui(jt?ur:ht,Bt)}evaluate(C){let J,ht=null,At=0;for(let Bt of this.args)if(At++,ht=Bt.evaluate(C),ht&&ht instanceof Fn&&!ht.available&&(J||(J=ht.name),ht=null,At===this.args.length&&(ht=J)),ht!==null)break;return ht}eachChild(C){this.args.forEach(C)}outputDefined(){return this.args.every(C=>C.outputDefined())}}function lo(U,C){return U==="=="||U==="!="?C.kind==="boolean"||C.kind==="string"||C.kind==="number"||C.kind==="null"||C.kind==="value":C.kind==="string"||C.kind==="number"||C.kind==="value"}function Co(U,C,J,ht){return ht.compare(C,J)===0}function Bo(U,C,J){let ht=U!=="=="&&U!=="!=";return class ST{constructor(Bt,jt,ae){this.type=Se,this.lhs=Bt,this.rhs=jt,this.collator=ae,this.hasUntypedArgument=Bt.type.kind==="value"||jt.type.kind==="value"}static parse(Bt,jt){if(Bt.length!==3&&Bt.length!==4)return jt.error("Expected two or three arguments.");let ae=Bt[0],me=jt.parse(Bt[1],1,ur);if(!me)return null;if(!lo(ae,me.type))return jt.concat(1).error(`"${ae}" comparisons are not supported for type '${qt(me.type)}'.`);let Ie=jt.parse(Bt[2],2,ur);if(!Ie)return null;if(!lo(ae,Ie.type))return jt.concat(2).error(`"${ae}" comparisons are not supported for type '${qt(Ie.type)}'.`);if(me.type.kind!==Ie.type.kind&&me.type.kind!=="value"&&Ie.type.kind!=="value")return jt.error(`Cannot compare types '${qt(me.type)}' and '${qt(Ie.type)}'.`);ht&&(me.type.kind==="value"&&Ie.type.kind!=="value"?me=new dr(Ie.type,[me]):me.type.kind!=="value"&&Ie.type.kind==="value"&&(Ie=new dr(me.type,[Ie])));let Ge=null;if(Bt.length===4){if(me.type.kind!=="string"&&Ie.type.kind!=="string"&&me.type.kind!=="value"&&Ie.type.kind!=="value")return jt.error("Cannot use collator to compare non-string types.");if(Ge=jt.parse(Bt[3],3,fr),!Ge)return null}return new ST(me,Ie,Ge)}evaluate(Bt){let jt=this.lhs.evaluate(Bt),ae=this.rhs.evaluate(Bt);if(ht&&this.hasUntypedArgument){let me=ue(jt),Ie=ue(ae);if(me.kind!==Ie.kind||me.kind!=="string"&&me.kind!=="number")throw new Sr(`Expected arguments for "${U}" to be (string, string) or (number, number), but found (${me.kind}, ${Ie.kind}) instead.`)}if(this.collator&&!ht&&this.hasUntypedArgument){let me=ue(jt),Ie=ue(ae);if(me.kind!=="string"||Ie.kind!=="string")return C(Bt,jt,ae)}return this.collator?J(Bt,jt,ae,this.collator.evaluate(Bt)):C(Bt,jt,ae)}eachChild(Bt){Bt(this.lhs),Bt(this.rhs),this.collator&&Bt(this.collator)}outputDefined(){return!0}}}let ai=Bo("==",function(U,C,J){return C===J},Co),yi=Bo("!=",function(U,C,J){return C!==J},function(U,C,J,ht){return!Co(0,C,J,ht)}),Si=Bo("<",function(U,C,J){return C<J},function(U,C,J,ht){return ht.compare(C,J)<0}),ko=Bo(">",function(U,C,J){return C>J},function(U,C,J,ht){return ht.compare(C,J)>0}),Ao=Bo("<=",function(U,C,J){return C<=J},function(U,C,J,ht){return ht.compare(C,J)<=0}),Do=Bo(">=",function(U,C,J){return C>=J},function(U,C,J,ht){return ht.compare(C,J)>=0});class Pi{constructor(C,J,ht){this.type=fr,this.locale=ht,this.caseSensitive=C,this.diacriticSensitive=J}static parse(C,J){if(C.length!==2)return J.error("Expected one argument.");let ht=C[1];if(typeof ht!="object"||Array.isArray(ht))return J.error("Collator options argument must be an object.");let At=J.parse(ht["case-sensitive"]!==void 0&&ht["case-sensitive"],1,Se);if(!At)return null;let Bt=J.parse(ht["diacritic-sensitive"]!==void 0&&ht["diacritic-sensitive"],1,Se);if(!Bt)return null;let jt=null;return ht.locale&&(jt=J.parse(ht.locale,1,Te),!jt)?null:new Pi(At,Bt,jt)}evaluate(C){return new _r(this.caseSensitive.evaluate(C),this.diacriticSensitive.evaluate(C),this.locale?this.locale.evaluate(C):null)}eachChild(C){C(this.caseSensitive),C(this.diacriticSensitive),this.locale&&C(this.locale)}outputDefined(){return!1}}class Yi{constructor(C,J,ht,At,Bt){this.type=Te,this.number=C,this.locale=J,this.currency=ht,this.minFractionDigits=At,this.maxFractionDigits=Bt}static parse(C,J){if(C.length!==3)return J.error("Expected two arguments.");let ht=J.parse(C[1],1,le);if(!ht)return null;let At=C[2];if(typeof At!="object"||Array.isArray(At))return J.error("NumberFormat options argument must be an object.");let Bt=null;if(At.locale&&(Bt=J.parse(At.locale,1,Te),!Bt))return null;let jt=null;if(At.currency&&(jt=J.parse(At.currency,1,Te),!jt))return null;let ae=null;if(At["min-fraction-digits"]&&(ae=J.parse(At["min-fraction-digits"],1,le),!ae))return null;let me=null;return At["max-fraction-digits"]&&(me=J.parse(At["max-fraction-digits"],1,le),!me)?null:new Yi(ht,Bt,jt,ae,me)}evaluate(C){return new Intl.NumberFormat(this.locale?this.locale.evaluate(C):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(C):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(C):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(C):void 0}).format(this.number.evaluate(C))}eachChild(C){C(this.number),this.locale&&C(this.locale),this.currency&&C(this.currency),this.minFractionDigits&&C(this.minFractionDigits),this.maxFractionDigits&&C(this.maxFractionDigits)}outputDefined(){return!1}}class vs{constructor(C){this.type=We,this.sections=C}static parse(C,J){if(C.length<2)return J.error("Expected at least one argument.");let ht=C[1];if(!Array.isArray(ht)&&typeof ht=="object")return J.error("First argument must be an image or text section.");let At=[],Bt=!1;for(let jt=1;jt<=C.length-1;++jt){let ae=C[jt];if(Bt&&typeof ae=="object"&&!Array.isArray(ae)){Bt=!1;let me=null;if(ae["font-scale"]&&(me=J.parse(ae["font-scale"],1,le),!me))return null;let Ie=null;if(ae["text-font"]&&(Ie=J.parse(ae["text-font"],1,Dt(Te)),!Ie))return null;let Ge=null;if(ae["text-color"]&&(Ge=J.parse(ae["text-color"],1,Fe),!Ge))return null;let Ke=At[At.length-1];Ke.scale=me,Ke.font=Ie,Ke.textColor=Ge}else{let me=J.parse(C[jt],1,ur);if(!me)return null;let Ie=me.type.kind;if(Ie!=="string"&&Ie!=="value"&&Ie!=="null"&&Ie!=="resolvedImage")return J.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Bt=!0,At.push({content:me,scale:null,font:null,textColor:null})}}return new vs(At)}evaluate(C){return new rn(this.sections.map(J=>{let ht=J.content.evaluate(C);return ue(ht)===kr?new Xr("",ht,null,null,null):new Xr(xe(ht),null,J.scale?J.scale.evaluate(C):null,J.font?J.font.evaluate(C).join(","):null,J.textColor?J.textColor.evaluate(C):null)}))}eachChild(C){for(let J of this.sections)C(J.content),J.scale&&C(J.scale),J.font&&C(J.font),J.textColor&&C(J.textColor)}outputDefined(){return!1}}class es{constructor(C){this.type=kr,this.input=C}static parse(C,J){if(C.length!==2)return J.error("Expected two arguments.");let ht=J.parse(C[1],1,Te);return ht?new es(ht):J.error("No image name provided.")}evaluate(C){let J=this.input.evaluate(C),ht=Fn.fromString(J);return ht&&C.availableImages&&(ht.available=C.availableImages.indexOf(J)>-1),ht}eachChild(C){C(this.input)}outputDefined(){return!1}}class ls{constructor(C){this.type=le,this.input=C}static parse(C,J){if(C.length!==2)return J.error(`Expected 1 argument, but found ${C.length-1} instead.`);let ht=J.parse(C[1],1);return ht?ht.type.kind!=="array"&&ht.type.kind!=="string"&&ht.type.kind!=="value"?J.error(`Expected argument of type string or array, but found ${qt(ht.type)} instead.`):new ls(ht):null}evaluate(C){let J=this.input.evaluate(C);if(typeof J=="string")return[...J].length;if(Array.isArray(J))return J.length;throw new Sr(`Expected value to be of type string or array, but found ${qt(ue(J))} instead.`)}eachChild(C){C(this.input)}outputDefined(){return!1}}let Xi=8192;function ga(U,C){let J=(180+U[0])/360,ht=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+U[1]*Math.PI/360)))/360,At=Math.pow(2,C.z);return[Math.round(J*At*Xi),Math.round(ht*At*Xi)]}function Xa(U,C){let J=Math.pow(2,C.z);return[(At=(U[0]/Xi+C.x)/J,360*At-180),(ht=(U[1]/Xi+C.y)/J,360/Math.PI*Math.atan(Math.exp((180-360*ht)*Math.PI/180))-90)];var ht,At}function Ls(U,C){U[0]=Math.min(U[0],C[0]),U[1]=Math.min(U[1],C[1]),U[2]=Math.max(U[2],C[0]),U[3]=Math.max(U[3],C[1])}function fs(U,C){return!(U[0]<=C[0]||U[2]>=C[2]||U[1]<=C[1]||U[3]>=C[3])}function qi(U,C,J){let ht=U[0]-C[0],At=U[1]-C[1],Bt=U[0]-J[0],jt=U[1]-J[1];return ht*jt-Bt*At==0&&ht*Bt<=0&&At*jt<=0}function ms(U,C,J,ht){return(At=[ht[0]-J[0],ht[1]-J[1]])[0]*(Bt=[C[0]-U[0],C[1]-U[1]])[1]-At[1]*Bt[0]!=0&&!(!Bi(U,C,J,ht)||!Bi(J,ht,U,C));var At,Bt}function Po(U,C,J){for(let ht of J)for(let At=0;At<ht.length-1;++At)if(ms(U,C,ht[At],ht[At+1]))return!0;return!1}function rs(U,C,J=!1){let ht=!1;for(let ae of C)for(let me=0;me<ae.length-1;me++){if(qi(U,ae[me],ae[me+1]))return J;(Bt=ae[me])[1]>(At=U)[1]!=(jt=ae[me+1])[1]>At[1]&&At[0]<(jt[0]-Bt[0])*(At[1]-Bt[1])/(jt[1]-Bt[1])+Bt[0]&&(ht=!ht)}var At,Bt,jt;return ht}function hl(U,C){for(let J of C)if(rs(U,J))return!0;return!1}function za(U,C){for(let J of U)if(!rs(J,C))return!1;for(let J=0;J<U.length-1;++J)if(Po(U[J],U[J+1],C))return!1;return!0}function Oi(U,C){for(let J of C)if(za(U,J))return!0;return!1}function Bi(U,C,J,ht){let At=ht[0]-J[0],Bt=ht[1]-J[1],jt=(U[0]-J[0])*Bt-At*(U[1]-J[1]),ae=(C[0]-J[0])*Bt-At*(C[1]-J[1]);return jt>0&&ae<0||jt<0&&ae>0}function Ro(U,C,J){let ht=[];for(let At=0;At<U.length;At++){let Bt=[];for(let jt=0;jt<U[At].length;jt++){let ae=ga(U[At][jt],J);Ls(C,ae),Bt.push(ae)}ht.push(Bt)}return ht}function Fo(U,C,J){let ht=[];for(let At=0;At<U.length;At++){let Bt=Ro(U[At],C,J);ht.push(Bt)}return ht}function Ci(U,C,J,ht){if(U[0]<J[0]||U[0]>J[2]){let At=.5*ht,Bt=U[0]-J[0]>At?-ht:J[0]-U[0]>At?ht:0;Bt===0&&(Bt=U[0]-J[2]>At?-ht:J[2]-U[0]>At?ht:0),U[0]+=Bt}Ls(C,U)}function fl(U,C,J,ht){let At=Math.pow(2,ht.z)*Xi,Bt=[ht.x*Xi,ht.y*Xi],jt=[];for(let ae of U)for(let me of ae){let Ie=[me.x+Bt[0],me.y+Bt[1]];Ci(Ie,C,J,At),jt.push(Ie)}return jt}function ql(U,C,J,ht){let At=Math.pow(2,ht.z)*Xi,Bt=[ht.x*Xi,ht.y*Xi],jt=[];for(let me of U){let Ie=[];for(let Ge of me){let Ke=[Ge.x+Bt[0],Ge.y+Bt[1]];Ls(C,Ke),Ie.push(Ke)}jt.push(Ie)}if(C[2]-C[0]<=At/2){(ae=C)[0]=ae[1]=1/0,ae[2]=ae[3]=-1/0;for(let me of jt)for(let Ie of me)Ci(Ie,C,J,At)}var ae;return jt}class Zs{constructor(C,J){this.type=Se,this.geojson=C,this.geometries=J}static parse(C,J){if(C.length!==2)return J.error(`'within' expression requires exactly one argument, but found ${C.length-1} instead.`);if(Bn(C[1])){let ht=C[1];if(ht.type==="FeatureCollection"){let At=[];for(let Bt of ht.features){let{type:jt,coordinates:ae}=Bt.geometry;jt==="Polygon"&&At.push(ae),jt==="MultiPolygon"&&At.push(...ae)}if(At.length)return new Zs(ht,{type:"MultiPolygon",coordinates:At})}else if(ht.type==="Feature"){let At=ht.geometry.type;if(At==="Polygon"||At==="MultiPolygon")return new Zs(ht,ht.geometry)}else if(ht.type==="Polygon"||ht.type==="MultiPolygon")return new Zs(ht,ht)}return J.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(C){if(C.geometry()!=null&&C.canonicalID()!=null){if(C.geometryType()==="Point")return function(J,ht){let At=[1/0,1/0,-1/0,-1/0],Bt=[1/0,1/0,-1/0,-1/0],jt=J.canonicalID();if(ht.type==="Polygon"){let ae=Ro(ht.coordinates,Bt,jt),me=fl(J.geometry(),At,Bt,jt);if(!fs(At,Bt))return!1;for(let Ie of me)if(!rs(Ie,ae))return!1}if(ht.type==="MultiPolygon"){let ae=Fo(ht.coordinates,Bt,jt),me=fl(J.geometry(),At,Bt,jt);if(!fs(At,Bt))return!1;for(let Ie of me)if(!hl(Ie,ae))return!1}return!0}(C,this.geometries);if(C.geometryType()==="LineString")return function(J,ht){let At=[1/0,1/0,-1/0,-1/0],Bt=[1/0,1/0,-1/0,-1/0],jt=J.canonicalID();if(ht.type==="Polygon"){let ae=Ro(ht.coordinates,Bt,jt),me=ql(J.geometry(),At,Bt,jt);if(!fs(At,Bt))return!1;for(let Ie of me)if(!za(Ie,ae))return!1}if(ht.type==="MultiPolygon"){let ae=Fo(ht.coordinates,Bt,jt),me=ql(J.geometry(),At,Bt,jt);if(!fs(At,Bt))return!1;for(let Ie of me)if(!Oi(Ie,ae))return!1}return!0}(C,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Hl=class{constructor(U=[],C=(J,ht)=>J<ht?-1:J>ht?1:0){if(this.data=U,this.length=this.data.length,this.compare=C,this.length>0)for(let J=(this.length>>1)-1;J>=0;J--)this._down(J)}push(U){this.data.push(U),this._up(this.length++)}pop(){if(this.length===0)return;let U=this.data[0],C=this.data.pop();return--this.length>0&&(this.data[0]=C,this._down(0)),U}peek(){return this.data[0]}_up(U){let{data:C,compare:J}=this,ht=C[U];for(;U>0;){let At=U-1>>1,Bt=C[At];if(J(ht,Bt)>=0)break;C[U]=Bt,U=At}C[U]=ht}_down(U){let{data:C,compare:J}=this,ht=this.length>>1,At=C[U];for(;U<ht;){let Bt=1+(U<<1),jt=Bt+1;if(jt<this.length&&J(C[jt],C[Bt])<0&&(Bt=jt),J(C[Bt],At)>=0)break;C[U]=C[Bt],U=Bt}C[U]=At}};function Us(U,C,J,ht,At){Es(U,C,J,ht||U.length-1,At||Wu)}function Es(U,C,J,ht,At){for(;ht>J;){if(ht-J>600){var Bt=ht-J+1,jt=C-J+1,ae=Math.log(Bt),me=.5*Math.exp(2*ae/3),Ie=.5*Math.sqrt(ae*me*(Bt-me)/Bt)*(jt-Bt/2<0?-1:1);Es(U,C,Math.max(J,Math.floor(C-jt*me/Bt+Ie)),Math.min(ht,Math.floor(C+(Bt-jt)*me/Bt+Ie)),At)}var Ge=U[C],Ke=J,vr=ht;for(El(U,J,C),At(U[ht],Ge)>0&&El(U,J,ht);Ke<vr;){for(El(U,Ke,vr),Ke++,vr--;At(U[Ke],Ge)<0;)Ke++;for(;At(U[vr],Ge)>0;)vr--}At(U[J],Ge)===0?El(U,J,vr):El(U,++vr,ht),vr<=C&&(J=vr+1),C<=vr&&(ht=vr-1)}}function El(U,C,J){var ht=U[C];U[C]=U[J],U[J]=ht}function Wu(U,C){return U<C?-1:U>C?1:0}function Mu(U,C){if(U.length<=1)return[U];let J=[],ht,At;for(let Bt of U){let jt=_h(Bt);jt!==0&&(Bt.area=Math.abs(jt),At===void 0&&(At=jt<0),At===jt<0?(ht&&J.push(ht),ht=[Bt]):ht.push(Bt))}if(ht&&J.push(ht),C>1)for(let Bt=0;Bt<J.length;Bt++)J[Bt].length<=C||(Us(J[Bt],C,1,J[Bt].length-1,Fu),J[Bt]=J[Bt].slice(0,C));return J}function Fu(U,C){return C.area-U.area}function _h(U){let C=0;for(let J,ht,At=0,Bt=U.length,jt=Bt-1;At<Bt;jt=At++)J=U[At],ht=U[jt],C+=(ht.x-J.x)*(J.y+ht.y);return C}let ih=1/298.257223563,ns=ih*(2-ih),du=Math.PI/180;class Ic{constructor(C){let J=6378.137*du*1e3,ht=Math.cos(C*du),At=1/(1-ns*(1-ht*ht)),Bt=Math.sqrt(At);this.kx=J*Bt*ht,this.ky=J*Bt*At*(1-ns)}distance(C,J){let ht=this.wrap(C[0]-J[0])*this.kx,At=(C[1]-J[1])*this.ky;return Math.sqrt(ht*ht+At*At)}pointOnLine(C,J){let ht,At,Bt,jt,ae=1/0;for(let me=0;me<C.length-1;me++){let Ie=C[me][0],Ge=C[me][1],Ke=this.wrap(C[me+1][0]-Ie)*this.kx,vr=(C[me+1][1]-Ge)*this.ky,Cr=0;Ke===0&&vr===0||(Cr=(this.wrap(J[0]-Ie)*this.kx*Ke+(J[1]-Ge)*this.ky*vr)/(Ke*Ke+vr*vr),Cr>1?(Ie=C[me+1][0],Ge=C[me+1][1]):Cr>0&&(Ie+=Ke/this.kx*Cr,Ge+=vr/this.ky*Cr)),Ke=this.wrap(J[0]-Ie)*this.kx,vr=(J[1]-Ge)*this.ky;let Nr=Ke*Ke+vr*vr;Nr<ae&&(ae=Nr,ht=Ie,At=Ge,Bt=me,jt=Cr)}return{point:[ht,At],index:Bt,t:Math.max(0,Math.min(1,jt))}}wrap(C){for(;C<-180;)C+=360;for(;C>180;)C-=360;return C}}function ll(U,C){return C[0]-U[0]}function el(U){return U[1]-U[0]+1}function ul(U,C){return U[1]>=U[0]&&U[1]<C}function Zu(U,C){if(U[0]>U[1])return[null,null];let J=el(U);if(C){if(J===2)return[U,null];let At=Math.floor(J/2);return[[U[0],U[0]+At],[U[0]+At,U[1]]]}if(J===1)return[U,null];let ht=Math.floor(J/2)-1;return[[U[0],U[0]+ht],[U[0]+ht+1,U[1]]]}function ys(U,C){if(!ul(C,U.length))return[1/0,1/0,-1/0,-1/0];let J=[1/0,1/0,-1/0,-1/0];for(let ht=C[0];ht<=C[1];++ht)Ls(J,U[ht]);return J}function pl(U){let C=[1/0,1/0,-1/0,-1/0];for(let J of U)for(let ht of J)Ls(C,ht);return C}function $o(U){return U[0]!==-1/0&&U[1]!==-1/0&&U[2]!==1/0&&U[3]!==1/0}function ks(U,C,J){if(!$o(U)||!$o(C))return NaN;let ht=0,At=0;return U[2]<C[0]&&(ht=C[0]-U[2]),U[0]>C[2]&&(ht=U[0]-C[2]),U[1]>C[3]&&(At=U[1]-C[3]),U[3]<C[1]&&(At=C[1]-U[3]),J.distance([0,0],[ht,At])}function Bu(U,C,J){let ht=J.pointOnLine(C,U);return J.distance(U,ht.point)}function Ol(U,C,J,ht,At){let Bt=Math.min(Bu(U,[J,ht],At),Bu(C,[J,ht],At)),jt=Math.min(Bu(J,[U,C],At),Bu(ht,[U,C],At));return Math.min(Bt,jt)}function Xu(U,C,J,ht,At){if(!ul(C,U.length)||!ul(ht,J.length))return 1/0;let Bt=1/0;for(let jt=C[0];jt<C[1];++jt){let ae=U[jt],me=U[jt+1];for(let Ie=ht[0];Ie<ht[1];++Ie){let Ge=J[Ie],Ke=J[Ie+1];if(ms(ae,me,Ge,Ke))return 0;Bt=Math.min(Bt,Ol(ae,me,Ge,Ke,At))}}return Bt}function Cs(U,C,J,ht,At){if(!ul(C,U.length)||!ul(ht,J.length))return NaN;let Bt=1/0;for(let jt=C[0];jt<=C[1];++jt)for(let ae=ht[0];ae<=ht[1];++ae)if(Bt=Math.min(Bt,At.distance(U[jt],J[ae])),Bt===0)return Bt;return Bt}function zh(U,C,J){if(rs(U,C,!0))return 0;let ht=1/0;for(let At of C){let Bt=At[0],jt=At[At.length-1];if(Bt!==jt&&(ht=Math.min(ht,Bu(U,[jt,Bt],J)),ht===0))return ht;let ae=J.pointOnLine(At,U);if(ht=Math.min(ht,J.distance(U,ae.point)),ht===0)return ht}return ht}function Mo(U,C,J,ht){if(!ul(C,U.length))return NaN;for(let Bt=C[0];Bt<=C[1];++Bt)if(rs(U[Bt],J,!0))return 0;let At=1/0;for(let Bt=C[0];Bt<C[1];++Bt){let jt=U[Bt],ae=U[Bt+1];for(let me of J)for(let Ie=0,Ge=me.length,Ke=Ge-1;Ie<Ge;Ke=Ie++){let vr=me[Ke],Cr=me[Ie];if(ms(jt,ae,vr,Cr))return 0;At=Math.min(At,Ol(jt,ae,vr,Cr,ht))}}return At}function Oh(U,C){for(let J of U)for(let ht of J)if(rs(ht,C,!0))return!0;return!1}function as(U,C,J,ht=1/0){let At=pl(U),Bt=pl(C);if(ht!==1/0&&ks(At,Bt,J)>=ht)return ht;if(fs(At,Bt)){if(Oh(U,C))return 0}else if(Oh(C,U))return 0;let jt=1/0;for(let ae of U)for(let me=0,Ie=ae.length,Ge=Ie-1;me<Ie;Ge=me++){let Ke=ae[Ge],vr=ae[me];for(let Cr of C)for(let Nr=0,$r=Cr.length,cn=$r-1;Nr<$r;cn=Nr++){let Pn=Cr[cn],ua=Cr[Nr];if(ms(Ke,vr,Pn,ua))return 0;jt=Math.min(jt,Ol(Ke,vr,Pn,ua,J))}}return jt}function io(U,C,J,ht,At,Bt){if(!Bt)return;let jt=ks(ys(ht,Bt),At,J);jt<C&&U.push([jt,Bt,[0,0]])}function pc(U,C,J,ht,At,Bt,jt){if(!Bt||!jt)return;let ae=ks(ys(ht,Bt),ys(At,jt),J);ae<C&&U.push([ae,Bt,jt])}function gu(U,C,J,ht,At=1/0){let Bt=Math.min(ht.distance(U[0],J[0][0]),At);if(Bt===0)return Bt;let jt=new Hl([[0,[0,U.length-1],[0,0]]],ll),ae=pl(J);for(;jt.length>0;){let me=jt.pop();if(me[0]>=Bt)continue;let Ie=me[1],Ge=C?50:100;if(el(Ie)<=Ge){if(!ul(Ie,U.length))return NaN;if(C){let Ke=Mo(U,Ie,J,ht);if(isNaN(Ke)||Ke===0)return Ke;Bt=Math.min(Bt,Ke)}else for(let Ke=Ie[0];Ke<=Ie[1];++Ke){let vr=zh(U[Ke],J,ht);if(Bt=Math.min(Bt,vr),Bt===0)return 0}}else{let Ke=Zu(Ie,C);io(jt,Bt,ht,U,ae,Ke[0]),io(jt,Bt,ht,U,ae,Ke[1])}}return Bt}function Pl(U,C,J,ht,At,Bt=1/0){let jt=Math.min(Bt,At.distance(U[0],J[0]));if(jt===0)return jt;let ae=new Hl([[0,[0,U.length-1],[0,J.length-1]]],ll);for(;ae.length>0;){let me=ae.pop();if(me[0]>=jt)continue;let Ie=me[1],Ge=me[2],Ke=C?50:100,vr=ht?50:100;if(el(Ie)<=Ke&&el(Ge)<=vr){if(!ul(Ie,U.length)&&ul(Ge,J.length))return NaN;let Cr;if(C&&ht)Cr=Xu(U,Ie,J,Ge,At),jt=Math.min(jt,Cr);else if(C&&!ht){let Nr=U.slice(Ie[0],Ie[1]+1);for(let $r=Ge[0];$r<=Ge[1];++$r)if(Cr=Bu(J[$r],Nr,At),jt=Math.min(jt,Cr),jt===0)return jt}else if(!C&&ht){let Nr=J.slice(Ge[0],Ge[1]+1);for(let $r=Ie[0];$r<=Ie[1];++$r)if(Cr=Bu(U[$r],Nr,At),jt=Math.min(jt,Cr),jt===0)return jt}else Cr=Cs(U,Ie,J,Ge,At),jt=Math.min(jt,Cr)}else{let Cr=Zu(Ie,C),Nr=Zu(Ge,ht);pc(ae,jt,At,U,J,Cr[0],Nr[0]),pc(ae,jt,At,U,J,Cr[0],Nr[1]),pc(ae,jt,At,U,J,Cr[1],Nr[0]),pc(ae,jt,At,U,J,Cr[1],Nr[1])}}return jt}function Wc(U){return U.type==="MultiPolygon"?U.coordinates.map(C=>({type:"Polygon",coordinates:C})):U.type==="MultiLineString"?U.coordinates.map(C=>({type:"LineString",coordinates:C})):U.type==="MultiPoint"?U.coordinates.map(C=>({type:"Point",coordinates:C})):[U]}class $u{constructor(C,J){this.type=le,this.geojson=C,this.geometries=J}static parse(C,J){if(C.length!==2)return J.error(`'distance' expression requires exactly one argument, but found ${C.length-1} instead.`);if(Bn(C[1])){let ht=C[1];if(ht.type==="FeatureCollection")return new $u(ht,ht.features.map(At=>Wc(At.geometry)).flat());if(ht.type==="Feature")return new $u(ht,Wc(ht.geometry));if("type"in ht&&"coordinates"in ht)return new $u(ht,Wc(ht))}return J.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(C){if(C.geometry()!=null&&C.canonicalID()!=null){if(C.geometryType()==="Point")return function(J,ht){let At=J.geometry(),Bt=At.flat().map(me=>Xa([me.x,me.y],J.canonical));if(At.length===0)return NaN;let jt=new Ic(Bt[0][1]),ae=1/0;for(let me of ht){switch(me.type){case"Point":ae=Math.min(ae,Pl(Bt,!1,[me.coordinates],!1,jt,ae));break;case"LineString":ae=Math.min(ae,Pl(Bt,!1,me.coordinates,!0,jt,ae));break;case"Polygon":ae=Math.min(ae,gu(Bt,!1,me.coordinates,jt,ae))}if(ae===0)return ae}return ae}(C,this.geometries);if(C.geometryType()==="LineString")return function(J,ht){let At=J.geometry(),Bt=At.flat().map(me=>Xa([me.x,me.y],J.canonical));if(At.length===0)return NaN;let jt=new Ic(Bt[0][1]),ae=1/0;for(let me of ht){switch(me.type){case"Point":ae=Math.min(ae,Pl(Bt,!0,[me.coordinates],!1,jt,ae));break;case"LineString":ae=Math.min(ae,Pl(Bt,!0,me.coordinates,!0,jt,ae));break;case"Polygon":ae=Math.min(ae,gu(Bt,!0,me.coordinates,jt,ae))}if(ae===0)return ae}return ae}(C,this.geometries);if(C.geometryType()==="Polygon")return function(J,ht){let At=J.geometry();if(At.length===0||At[0].length===0)return NaN;let Bt=Mu(At,0).map(me=>me.map(Ie=>Ie.map(Ge=>Xa([Ge.x,Ge.y],J.canonical)))),jt=new Ic(Bt[0][0][0][1]),ae=1/0;for(let me of ht)for(let Ie of Bt){switch(me.type){case"Point":ae=Math.min(ae,gu([me.coordinates],!1,Ie,jt,ae));break;case"LineString":ae=Math.min(ae,gu(me.coordinates,!0,Ie,jt,ae));break;case"Polygon":ae=Math.min(ae,as(Ie,me.coordinates,jt,ae))}if(ae===0)return ae}return ae}(C,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let dc={"==":ai,"!=":yi,">":ko,"<":Si,">=":Do,"<=":Ao,array:dr,at:Je,boolean:dr,case:En,coalesce:Ui,collator:Pi,format:vs,image:es,in:yr,"index-of":Hr,interpolate:ri,"interpolate-hcl":ri,"interpolate-lab":ri,length:ls,let:Jr,literal:Pr,match:hn,number:dr,"number-format":Yi,object:dr,slice:dn,step:Tn,string:dr,"to-boolean":Dr,"to-color":Dr,"to-number":Dr,"to-string":Dr,var:_e,within:Zs,distance:$u};class rl{constructor(C,J,ht,At){this.name=C,this.type=J,this._evaluate=ht,this.args=At}evaluate(C){return this._evaluate(C,this.args)}eachChild(C){this.args.forEach(C)}outputDefined(){return!1}static parse(C,J){let ht=C[0],At=rl.definitions[ht];if(!At)return J.error(`Unknown expression "${ht}". If you wanted a literal array, use ["literal", [...]].`,0);let Bt=Array.isArray(At)?At[0]:At.type,jt=Array.isArray(At)?[[At[1],At[2]]]:At.overloads,ae=jt.filter(([Ie])=>!Array.isArray(Ie)||Ie.length===C.length-1),me=null;for(let[Ie,Ge]of ae){me=new Wr(J.registry,Cc,J.path,null,J.scope);let Ke=[],vr=!1;for(let Cr=1;Cr<C.length;Cr++){let Nr=C[Cr],$r=Array.isArray(Ie)?Ie[Cr-1]:Ie.type,cn=me.parse(Nr,1+Ke.length,$r);if(!cn){vr=!0;break}Ke.push(cn)}if(!vr)if(Array.isArray(Ie)&&Ie.length!==Ke.length)me.error(`Expected ${Ie.length} arguments, but found ${Ke.length} instead.`);else{for(let Cr=0;Cr<Ke.length;Cr++){let Nr=Array.isArray(Ie)?Ie[Cr]:Ie.type,$r=Ke[Cr];me.concat(Cr+1).checkSubtype(Nr,$r.type)}if(me.errors.length===0)return new rl(ht,Bt,Ge,Ke)}}if(ae.length===1)J.errors.push(...me.errors);else{let Ie=(ae.length?ae:jt).map(([Ke])=>{return vr=Ke,Array.isArray(vr)?`(${vr.map(qt).join(", ")})`:`(${qt(vr.type)}...)`;var vr}).join(" | "),Ge=[];for(let Ke=1;Ke<C.length;Ke++){let vr=J.parse(C[Ke],1+Ge.length);if(!vr)return null;Ge.push(qt(vr.type))}J.error(`Expected arguments of type ${Ie}, but found (${Ge.join(", ")}) instead.`)}return null}static register(C,J){rl.definitions=J;for(let ht in J)C[ht]=rl}}function oh(U,[C,J,ht,At]){C=C.evaluate(U),J=J.evaluate(U),ht=ht.evaluate(U);let Bt=At?At.evaluate(U):1,jt=on(C,J,ht,Bt);if(jt)throw new Sr(jt);return new Ne(C/255,J/255,ht/255,Bt,!1)}function Zc(U,C){return U in C}function Lc(U,C){let J=C[U];return J===void 0?null:J}function Ju(U){return{type:U}}function Cc(U){if(U instanceof _e)return Cc(U.boundExpression);if(U instanceof rl&&U.name==="error"||U instanceof Pi||U instanceof Zs||U instanceof $u)return!1;let C=U instanceof Dr||U instanceof dr,J=!0;return U.eachChild(ht=>{J=C?J&&Cc(ht):J&&ht instanceof Pr}),!!J&&Xc(U)&&$c(U,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Xc(U){if(U instanceof rl&&(U.name==="get"&&U.args.length===1||U.name==="feature-state"||U.name==="has"&&U.args.length===1||U.name==="properties"||U.name==="geometry-type"||U.name==="id"||/^filter-/.test(U.name))||U instanceof Zs||U instanceof $u)return!1;let C=!0;return U.eachChild(J=>{C&&!Xc(J)&&(C=!1)}),C}function mu(U){if(U instanceof rl&&U.name==="feature-state")return!1;let C=!0;return U.eachChild(J=>{C&&!mu(J)&&(C=!1)}),C}function $c(U,C){if(U instanceof rl&&C.indexOf(U.name)>=0)return!1;let J=!0;return U.eachChild(ht=>{J&&!$c(ht,C)&&(J=!1)}),J}function nc(U){return{result:"success",value:U}}function vu(U){return{result:"error",value:U}}function Gl(U){return U["property-type"]==="data-driven"||U["property-type"]==="cross-faded-data-driven"}function yc(U){return!!U.expression&&U.expression.parameters.indexOf("zoom")>-1}function Jc(U){return!!U.expression&&U.expression.interpolated}function ps(U){return U instanceof Number?"number":U instanceof String?"string":U instanceof Boolean?"boolean":Array.isArray(U)?"array":U===null?"null":typeof U}function Dc(U){return typeof U=="object"&&U!==null&&!Array.isArray(U)}function Fh(U){return U}function sh(U,C){let J=C.type==="color",ht=U.stops&&typeof U.stops[0][0]=="object",At=ht||!(ht||U.property!==void 0),Bt=U.type||(Jc(C)?"exponential":"interval");if(J||C.type==="padding"){let Ge=J?Ne.parse:Br.parse;(U=vt({},U)).stops&&(U.stops=U.stops.map(Ke=>[Ke[0],Ge(Ke[1])])),U.default=Ge(U.default?U.default:C.default)}if(U.colorSpace&&(jt=U.colorSpace)!=="rgb"&&jt!=="hcl"&&jt!=="lab")throw new Error(`Unknown color space: "${U.colorSpace}"`);var jt;let ae,me,Ie;if(Bt==="exponential")ae=uh;else if(Bt==="interval")ae=Wl;else if(Bt==="categorical"){ae=lh,me=Object.create(null);for(let Ge of U.stops)me[Ge[0]]=Ge[1];Ie=typeof U.stops[0][0]}else{if(Bt!=="identity")throw new Error(`Unknown function type "${Bt}"`);ae=Il}if(ht){let Ge={},Ke=[];for(let Nr=0;Nr<U.stops.length;Nr++){let $r=U.stops[Nr],cn=$r[0].zoom;Ge[cn]===void 0&&(Ge[cn]={zoom:cn,type:U.type,property:U.property,default:U.default,stops:[]},Ke.push(cn)),Ge[cn].stops.push([$r[0].value,$r[1]])}let vr=[];for(let Nr of Ke)vr.push([Ge[Nr].zoom,sh(Ge[Nr],C)]);let Cr={name:"linear"};return{kind:"composite",interpolationType:Cr,interpolationFactor:ri.interpolationFactor.bind(void 0,Cr),zoomStops:vr.map(Nr=>Nr[0]),evaluate:({zoom:Nr},$r)=>uh({stops:vr,base:U.base},C,Nr).evaluate(Nr,$r)}}if(At){let Ge=Bt==="exponential"?{name:"exponential",base:U.base!==void 0?U.base:1}:null;return{kind:"camera",interpolationType:Ge,interpolationFactor:ri.interpolationFactor.bind(void 0,Ge),zoomStops:U.stops.map(Ke=>Ke[0]),evaluate:({zoom:Ke})=>ae(U,C,Ke,me,Ie)}}return{kind:"source",evaluate(Ge,Ke){let vr=Ke&&Ke.properties?Ke.properties[U.property]:void 0;return vr===void 0?xc(U.default,C.default):ae(U,C,vr,me,Ie)}}}function xc(U,C,J){return U!==void 0?U:C!==void 0?C:J!==void 0?J:void 0}function lh(U,C,J,ht,At){return xc(typeof J===At?ht[J]:void 0,U.default,C.default)}function Wl(U,C,J){if(ps(J)!=="number")return xc(U.default,C.default);let ht=U.stops.length;if(ht===1||J<=U.stops[0][0])return U.stops[0][1];if(J>=U.stops[ht-1][0])return U.stops[ht-1][1];let At=Kr(U.stops.map(Bt=>Bt[0]),J);return U.stops[At][1]}function uh(U,C,J){let ht=U.base!==void 0?U.base:1;if(ps(J)!=="number")return xc(U.default,C.default);let At=U.stops.length;if(At===1||J<=U.stops[0][0])return U.stops[0][1];if(J>=U.stops[At-1][0])return U.stops[At-1][1];let Bt=Kr(U.stops.map(Ge=>Ge[0]),J),jt=function(Ge,Ke,vr,Cr){let Nr=Cr-vr,$r=Ge-vr;return Nr===0?0:Ke===1?$r/Nr:(Math.pow(Ke,$r)-1)/(Math.pow(Ke,Nr)-1)}(J,ht,U.stops[Bt][0],U.stops[Bt+1][0]),ae=U.stops[Bt][1],me=U.stops[Bt+1][1],Ie=bi[C.type]||Fh;return typeof ae.evaluate=="function"?{evaluate(...Ge){let Ke=ae.evaluate.apply(void 0,Ge),vr=me.evaluate.apply(void 0,Ge);if(Ke!==void 0&&vr!==void 0)return Ie(Ke,vr,jt,U.colorSpace)}}:Ie(ae,me,jt,U.colorSpace)}function Il(U,C,J){switch(C.type){case"color":J=Ne.parse(J);break;case"formatted":J=rn.fromString(J.toString());break;case"resolvedImage":J=Fn.fromString(J.toString());break;case"padding":J=Br.parse(J);break;default:ps(J)===C.type||C.type==="enum"&&C.values[J]||(J=void 0)}return xc(J,U.default,C.default)}rl.register(dc,{error:[{kind:"error"},[Te],(U,[C])=>{throw new Sr(C.evaluate(U))}],typeof:[Te,[ur],(U,[C])=>qt(ue(C.evaluate(U)))],"to-rgba":[Dt(le,4),[Fe],(U,[C])=>{let[J,ht,At,Bt]=C.evaluate(U).rgb;return[255*J,255*ht,255*At,Bt]}],rgb:[Fe,[le,le,le],oh],rgba:[Fe,[le,le,le,le],oh],has:{type:Se,overloads:[[[Te],(U,[C])=>Zc(C.evaluate(U),U.properties())],[[Te,Oe],(U,[C,J])=>Zc(C.evaluate(U),J.evaluate(U))]]},get:{type:ur,overloads:[[[Te],(U,[C])=>Lc(C.evaluate(U),U.properties())],[[Te,Oe],(U,[C,J])=>Lc(C.evaluate(U),J.evaluate(U))]]},"feature-state":[ur,[Te],(U,[C])=>Lc(C.evaluate(U),U.featureState||{})],properties:[Oe,[],U=>U.properties()],"geometry-type":[Te,[],U=>U.geometryType()],id:[ur,[],U=>U.id()],zoom:[le,[],U=>U.globals.zoom],"heatmap-density":[le,[],U=>U.globals.heatmapDensity||0],"line-progress":[le,[],U=>U.globals.lineProgress||0],accumulated:[ur,[],U=>U.globals.accumulated===void 0?null:U.globals.accumulated],"+":[le,Ju(le),(U,C)=>{let J=0;for(let ht of C)J+=ht.evaluate(U);return J}],"*":[le,Ju(le),(U,C)=>{let J=1;for(let ht of C)J*=ht.evaluate(U);return J}],"-":{type:le,overloads:[[[le,le],(U,[C,J])=>C.evaluate(U)-J.evaluate(U)],[[le],(U,[C])=>-C.evaluate(U)]]},"/":[le,[le,le],(U,[C,J])=>C.evaluate(U)/J.evaluate(U)],"%":[le,[le,le],(U,[C,J])=>C.evaluate(U)%J.evaluate(U)],ln2:[le,[],()=>Math.LN2],pi:[le,[],()=>Math.PI],e:[le,[],()=>Math.E],"^":[le,[le,le],(U,[C,J])=>Math.pow(C.evaluate(U),J.evaluate(U))],sqrt:[le,[le],(U,[C])=>Math.sqrt(C.evaluate(U))],log10:[le,[le],(U,[C])=>Math.log(C.evaluate(U))/Math.LN10],ln:[le,[le],(U,[C])=>Math.log(C.evaluate(U))],log2:[le,[le],(U,[C])=>Math.log(C.evaluate(U))/Math.LN2],sin:[le,[le],(U,[C])=>Math.sin(C.evaluate(U))],cos:[le,[le],(U,[C])=>Math.cos(C.evaluate(U))],tan:[le,[le],(U,[C])=>Math.tan(C.evaluate(U))],asin:[le,[le],(U,[C])=>Math.asin(C.evaluate(U))],acos:[le,[le],(U,[C])=>Math.acos(C.evaluate(U))],atan:[le,[le],(U,[C])=>Math.atan(C.evaluate(U))],min:[le,Ju(le),(U,C)=>Math.min(...C.map(J=>J.evaluate(U)))],max:[le,Ju(le),(U,C)=>Math.max(...C.map(J=>J.evaluate(U)))],abs:[le,[le],(U,[C])=>Math.abs(C.evaluate(U))],round:[le,[le],(U,[C])=>{let J=C.evaluate(U);return J<0?-Math.round(-J):Math.round(J)}],floor:[le,[le],(U,[C])=>Math.floor(C.evaluate(U))],ceil:[le,[le],(U,[C])=>Math.ceil(C.evaluate(U))],"filter-==":[Se,[Te,ur],(U,[C,J])=>U.properties()[C.value]===J.value],"filter-id-==":[Se,[ur],(U,[C])=>U.id()===C.value],"filter-type-==":[Se,[Te],(U,[C])=>U.geometryType()===C.value],"filter-<":[Se,[Te,ur],(U,[C,J])=>{let ht=U.properties()[C.value],At=J.value;return typeof ht==typeof At&&ht<At}],"filter-id-<":[Se,[ur],(U,[C])=>{let J=U.id(),ht=C.value;return typeof J==typeof ht&&J<ht}],"filter->":[Se,[Te,ur],(U,[C,J])=>{let ht=U.properties()[C.value],At=J.value;return typeof ht==typeof At&&ht>At}],"filter-id->":[Se,[ur],(U,[C])=>{let J=U.id(),ht=C.value;return typeof J==typeof ht&&J>ht}],"filter-<=":[Se,[Te,ur],(U,[C,J])=>{let ht=U.properties()[C.value],At=J.value;return typeof ht==typeof At&&ht<=At}],"filter-id-<=":[Se,[ur],(U,[C])=>{let J=U.id(),ht=C.value;return typeof J==typeof ht&&J<=ht}],"filter->=":[Se,[Te,ur],(U,[C,J])=>{let ht=U.properties()[C.value],At=J.value;return typeof ht==typeof At&&ht>=At}],"filter-id->=":[Se,[ur],(U,[C])=>{let J=U.id(),ht=C.value;return typeof J==typeof ht&&J>=ht}],"filter-has":[Se,[ur],(U,[C])=>C.value in U.properties()],"filter-has-id":[Se,[],U=>U.id()!==null&&U.id()!==void 0],"filter-type-in":[Se,[Dt(Te)],(U,[C])=>C.value.indexOf(U.geometryType())>=0],"filter-id-in":[Se,[Dt(ur)],(U,[C])=>C.value.indexOf(U.id())>=0],"filter-in-small":[Se,[Te,Dt(ur)],(U,[C,J])=>J.value.indexOf(U.properties()[C.value])>=0],"filter-in-large":[Se,[Te,Dt(ur)],(U,[C,J])=>function(ht,At,Bt,jt){for(;Bt<=jt;){let ae=Bt+jt>>1;if(At[ae]===ht)return!0;At[ae]>ht?jt=ae-1:Bt=ae+1}return!1}(U.properties()[C.value],J.value,0,J.value.length-1)],all:{type:Se,overloads:[[[Se,Se],(U,[C,J])=>C.evaluate(U)&&J.evaluate(U)],[Ju(Se),(U,C)=>{for(let J of C)if(!J.evaluate(U))return!1;return!0}]]},any:{type:Se,overloads:[[[Se,Se],(U,[C,J])=>C.evaluate(U)||J.evaluate(U)],[Ju(Se),(U,C)=>{for(let J of C)if(J.evaluate(U))return!0;return!1}]]},"!":[Se,[Se],(U,[C])=>!C.evaluate(U)],"is-supported-script":[Se,[Te],(U,[C])=>{let J=U.globals&&U.globals.isSupportedScript;return!J||J(C.evaluate(U))}],upcase:[Te,[Te],(U,[C])=>C.evaluate(U).toUpperCase()],downcase:[Te,[Te],(U,[C])=>C.evaluate(U).toLowerCase()],concat:[Te,Ju(ur),(U,C)=>C.map(J=>xe(J.evaluate(U))).join("")],"resolved-locale":[Te,[fr],(U,[C])=>C.evaluate(U).resolvedLocale()]});class Zl{constructor(C,J){var ht;this.expression=C,this._warningHistory={},this._evaluator=new Gr,this._defaultValue=J?(ht=J).type==="color"&&Dc(ht.default)?new Ne(0,0,0,0):ht.type==="color"?Ne.parse(ht.default)||null:ht.type==="padding"?Br.parse(ht.default)||null:ht.type==="variableAnchorOffsetCollection"?bn.parse(ht.default)||null:ht.default===void 0?null:ht.default:null,this._enumValues=J&&J.type==="enum"?J.values:null}evaluateWithoutErrorHandling(C,J,ht,At,Bt,jt){return this._evaluator.globals=C,this._evaluator.feature=J,this._evaluator.featureState=ht,this._evaluator.canonical=At,this._evaluator.availableImages=Bt||null,this._evaluator.formattedSection=jt,this.expression.evaluate(this._evaluator)}evaluate(C,J,ht,At,Bt,jt){this._evaluator.globals=C,this._evaluator.feature=J||null,this._evaluator.featureState=ht||null,this._evaluator.canonical=At,this._evaluator.availableImages=Bt||null,this._evaluator.formattedSection=jt||null;try{let ae=this.expression.evaluate(this._evaluator);if(ae==null||typeof ae=="number"&&ae!=ae)return this._defaultValue;if(this._enumValues&&!(ae in this._enumValues))throw new Sr(`Expected value to be one of ${Object.keys(this._enumValues).map(me=>JSON.stringify(me)).join(", ")}, but found ${JSON.stringify(ae)} instead.`);return ae}catch(ae){return this._warningHistory[ae.message]||(this._warningHistory[ae.message]=!0,typeof console<"u"&&console.warn(ae.message)),this._defaultValue}}}function Ru(U){return Array.isArray(U)&&U.length>0&&typeof U[0]=="string"&&U[0]in dc}function Xs(U,C){let J=new Wr(dc,Cc,[],C?function(At){let Bt={color:Fe,string:Te,number:le,enum:Te,boolean:Se,formatted:We,padding:Lr,resolvedImage:kr,variableAnchorOffsetCollection:he};return At.type==="array"?Dt(Bt[At.value]||ur,At.length):Bt[At.type]}(C):void 0),ht=J.parse(U,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return ht?nc(new Zl(ht,C)):vu(J.errors)}class Qu{constructor(C,J){this.kind=C,this._styleExpression=J,this.isStateDependent=C!=="constant"&&!mu(J.expression)}evaluateWithoutErrorHandling(C,J,ht,At,Bt,jt){return this._styleExpression.evaluateWithoutErrorHandling(C,J,ht,At,Bt,jt)}evaluate(C,J,ht,At,Bt,jt){return this._styleExpression.evaluate(C,J,ht,At,Bt,jt)}}class yu{constructor(C,J,ht,At){this.kind=C,this.zoomStops=ht,this._styleExpression=J,this.isStateDependent=C!=="camera"&&!mu(J.expression),this.interpolationType=At}evaluateWithoutErrorHandling(C,J,ht,At,Bt,jt){return this._styleExpression.evaluateWithoutErrorHandling(C,J,ht,At,Bt,jt)}evaluate(C,J,ht,At,Bt,jt){return this._styleExpression.evaluate(C,J,ht,At,Bt,jt)}interpolationFactor(C,J,ht){return this.interpolationType?ri.interpolationFactor(this.interpolationType,C,J,ht):0}}function Xl(U,C){let J=Xs(U,C);if(J.result==="error")return J;let ht=J.value.expression,At=Xc(ht);if(!At&&!Gl(C))return vu([new Ut("","data expressions not supported")]);let Bt=$c(ht,["zoom"]);if(!Bt&&!yc(C))return vu([new Ut("","zoom expressions not supported")]);let jt=gc(ht);return jt||Bt?jt instanceof Ut?vu([jt]):jt instanceof ri&&!Jc(C)?vu([new Ut("",'"interpolate" expressions cannot be used with this property')]):nc(jt?new yu(At?"camera":"composite",J.value,jt.labels,jt instanceof ri?jt.interpolation:void 0):new Qu(At?"constant":"source",J.value)):vu([new Ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ds{constructor(C,J){this._parameters=C,this._specification=J,vt(this,sh(this._parameters,this._specification))}static deserialize(C){return new Ds(C._parameters,C._specification)}static serialize(C){return{_parameters:C._parameters,_specification:C._specification}}}function gc(U){let C=null;if(U instanceof Jr)C=gc(U.result);else if(U instanceof Ui){for(let J of U.args)if(C=gc(J),C)break}else(U instanceof Tn||U instanceof ri)&&U.input instanceof rl&&U.input.name==="zoom"&&(C=U);return C instanceof Ut||U.eachChild(J=>{let ht=gc(J);ht instanceof Ut?C=ht:!C&&ht?C=new Ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):C&&ht&&C!==ht&&(C=new Ut("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),C}function Su(U){if(U===!0||U===!1)return!0;if(!Array.isArray(U)||U.length===0)return!1;switch(U[0]){case"has":return U.length>=2&&U[1]!=="$id"&&U[1]!=="$type";case"in":return U.length>=3&&(typeof U[1]!="string"||Array.isArray(U[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return U.length!==3||Array.isArray(U[1])||Array.isArray(U[2]);case"any":case"all":for(let C of U.slice(1))if(!Su(C)&&typeof C!="boolean")return!1;return!0;default:return!0}}let Yu={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function _c(U){if(U==null)return{filter:()=>!0,needGeometry:!1};Su(U)||(U=ac(U));let C=Xs(U,Yu);if(C.result==="error")throw new Error(C.value.map(J=>`${J.key}: ${J.message}`).join(", "));return{filter:(J,ht,At)=>C.value.evaluate(J,ht,{},At),needGeometry:Zh(U)}}function bh(U,C){return U<C?-1:U>C?1:0}function Zh(U){if(!Array.isArray(U))return!1;if(U[0]==="within"||U[0]==="distance")return!0;for(let C=1;C<U.length;C++)if(Zh(U[C]))return!0;return!1}function ac(U){if(!U)return!0;let C=U[0];return U.length<=1?C!=="any":C==="=="?bc(U[1],U[2],"=="):C==="!="?$l(bc(U[1],U[2],"==")):C==="<"||C===">"||C==="<="||C===">="?bc(U[1],U[2],C):C==="any"?(J=U.slice(1),["any"].concat(J.map(ac))):C==="all"?["all"].concat(U.slice(1).map(ac)):C==="none"?["all"].concat(U.slice(1).map(ac).map($l)):C==="in"?Ll(U[1],U.slice(2)):C==="!in"?$l(Ll(U[1],U.slice(2))):C==="has"?zc(U[1]):C!=="!has"||$l(zc(U[1]));var J}function bc(U,C,J){switch(U){case"$type":return[`filter-type-${J}`,C];case"$id":return[`filter-id-${J}`,C];default:return[`filter-${J}`,U,C]}}function Ll(U,C){if(C.length===0)return!1;switch(U){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some(J=>typeof J!=typeof C[0])?["filter-in-large",U,["literal",C.sort(bh)]]:["filter-in-small",U,["literal",C]]}}function zc(U){switch(U){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",U]}}function $l(U){return["!",U]}function ic(U){let C=typeof U;if(C==="number"||C==="boolean"||C==="string"||U==null)return JSON.stringify(U);if(Array.isArray(U)){let At="[";for(let Bt of U)At+=`${ic(Bt)},`;return`${At}]`}let J=Object.keys(U).sort(),ht="{";for(let At=0;At<J.length;At++)ht+=`${JSON.stringify(J[At])}:${ic(U[J[At]])},`;return`${ht}}`}function Oc(U){let C="";for(let J of dt)C+=`/${ic(U[J])}`;return C}function Ku(U){let C=U.value;return C?[new bt(U.key,C,"constants have been deprecated as of v8")]:[]}function Os(U){return U instanceof Number||U instanceof String||U instanceof Boolean?U.valueOf():U}function Eu(U){if(Array.isArray(U))return U.map(Eu);if(U instanceof Object&&!(U instanceof Number||U instanceof String||U instanceof Boolean)){let C={};for(let J in U)C[J]=Eu(U[J]);return C}return Os(U)}function Jl(U){let C=U.key,J=U.value,ht=U.valueSpec||{},At=U.objectElementValidators||{},Bt=U.style,jt=U.styleSpec,ae=U.validateSpec,me=[],Ie=ps(J);if(Ie!=="object")return[new bt(C,J,`object expected, ${Ie} found`)];for(let Ge in J){let Ke=Ge.split(".")[0],vr=ht[Ke]||ht["*"],Cr;if(At[Ke])Cr=At[Ke];else if(ht[Ke])Cr=ae;else if(At["*"])Cr=At["*"];else{if(!ht["*"]){me.push(new bt(C,J[Ge],`unknown property "${Ge}"`));continue}Cr=ae}me=me.concat(Cr({key:(C&&`${C}.`)+Ge,value:J[Ge],valueSpec:vr,style:Bt,styleSpec:jt,object:J,objectKey:Ge,validateSpec:ae},J))}for(let Ge in ht)At[Ge]||ht[Ge].required&&ht[Ge].default===void 0&&J[Ge]===void 0&&me.push(new bt(C,J,`missing required property "${Ge}"`));return me}function ch(U){let C=U.value,J=U.valueSpec,ht=U.style,At=U.styleSpec,Bt=U.key,jt=U.arrayElementValidator||U.validateSpec;if(ps(C)!=="array")return[new bt(Bt,C,`array expected, ${ps(C)} found`)];if(J.length&&C.length!==J.length)return[new bt(Bt,C,`array length ${J.length} expected, length ${C.length} found`)];if(J["min-length"]&&C.length<J["min-length"])return[new bt(Bt,C,`array length at least ${J["min-length"]} expected, length ${C.length} found`)];let ae={type:J.value,values:J.values};At.$version<7&&(ae.function=J.function),ps(J.value)==="object"&&(ae=J.value);let me=[];for(let Ie=0;Ie<C.length;Ie++)me=me.concat(jt({array:C,arrayIndex:Ie,value:C[Ie],valueSpec:ae,validateSpec:U.validateSpec,style:ht,styleSpec:At,key:`${Bt}[${Ie}]`}));return me}function Ps(U){let C=U.key,J=U.value,ht=U.valueSpec,At=ps(J);return At==="number"&&J!=J&&(At="NaN"),At!=="number"?[new bt(C,J,`number expected, ${At} found`)]:"minimum"in ht&&J<ht.minimum?[new bt(C,J,`${J} is less than the minimum value ${ht.minimum}`)]:"maximum"in ht&&J>ht.maximum?[new bt(C,J,`${J} is greater than the maximum value ${ht.maximum}`)]:[]}function mc(U){let C=U.valueSpec,J=Os(U.value.type),ht,At,Bt,jt={},ae=J!=="categorical"&&U.value.property===void 0,me=!ae,Ie=ps(U.value.stops)==="array"&&ps(U.value.stops[0])==="array"&&ps(U.value.stops[0][0])==="object",Ge=Jl({key:U.key,value:U.value,valueSpec:U.styleSpec.function,validateSpec:U.validateSpec,style:U.style,styleSpec:U.styleSpec,objectElementValidators:{stops:function(Cr){if(J==="identity")return[new bt(Cr.key,Cr.value,'identity function may not have a "stops" property')];let Nr=[],$r=Cr.value;return Nr=Nr.concat(ch({key:Cr.key,value:$r,valueSpec:Cr.valueSpec,validateSpec:Cr.validateSpec,style:Cr.style,styleSpec:Cr.styleSpec,arrayElementValidator:Ke})),ps($r)==="array"&&$r.length===0&&Nr.push(new bt(Cr.key,$r,"array must have at least one stop")),Nr},default:function(Cr){return Cr.validateSpec({key:Cr.key,value:Cr.value,valueSpec:C,validateSpec:Cr.validateSpec,style:Cr.style,styleSpec:Cr.styleSpec})}}});return J==="identity"&&ae&&Ge.push(new bt(U.key,U.value,'missing required property "property"')),J==="identity"||U.value.stops||Ge.push(new bt(U.key,U.value,'missing required property "stops"')),J==="exponential"&&U.valueSpec.expression&&!Jc(U.valueSpec)&&Ge.push(new bt(U.key,U.value,"exponential functions not supported")),U.styleSpec.$version>=8&&(me&&!Gl(U.valueSpec)?Ge.push(new bt(U.key,U.value,"property functions not supported")):ae&&!yc(U.valueSpec)&&Ge.push(new bt(U.key,U.value,"zoom functions not supported"))),J!=="categorical"&&!Ie||U.value.property!==void 0||Ge.push(new bt(U.key,U.value,'"property" property is required')),Ge;function Ke(Cr){let Nr=[],$r=Cr.value,cn=Cr.key;if(ps($r)!=="array")return[new bt(cn,$r,`array expected, ${ps($r)} found`)];if($r.length!==2)return[new bt(cn,$r,`array length 2 expected, length ${$r.length} found`)];if(Ie){if(ps($r[0])!=="object")return[new bt(cn,$r,`object expected, ${ps($r[0])} found`)];if($r[0].zoom===void 0)return[new bt(cn,$r,"object stop key must have zoom")];if($r[0].value===void 0)return[new bt(cn,$r,"object stop key must have value")];if(Bt&&Bt>Os($r[0].zoom))return[new bt(cn,$r[0].zoom,"stop zoom values must appear in ascending order")];Os($r[0].zoom)!==Bt&&(Bt=Os($r[0].zoom),At=void 0,jt={}),Nr=Nr.concat(Jl({key:`${cn}[0]`,value:$r[0],valueSpec:{zoom:{}},validateSpec:Cr.validateSpec,style:Cr.style,styleSpec:Cr.styleSpec,objectElementValidators:{zoom:Ps,value:vr}}))}else Nr=Nr.concat(vr({key:`${cn}[0]`,value:$r[0],valueSpec:{},validateSpec:Cr.validateSpec,style:Cr.style,styleSpec:Cr.styleSpec},$r));return Ru(Eu($r[1]))?Nr.concat([new bt(`${cn}[1]`,$r[1],"expressions are not allowed in function stops.")]):Nr.concat(Cr.validateSpec({key:`${cn}[1]`,value:$r[1],valueSpec:C,validateSpec:Cr.validateSpec,style:Cr.style,styleSpec:Cr.styleSpec}))}function vr(Cr,Nr){let $r=ps(Cr.value),cn=Os(Cr.value),Pn=Cr.value!==null?Cr.value:Nr;if(ht){if($r!==ht)return[new bt(Cr.key,Pn,`${$r} stop domain type must match previous stop domain type ${ht}`)]}else ht=$r;if($r!=="number"&&$r!=="string"&&$r!=="boolean")return[new bt(Cr.key,Pn,"stop domain value must be a number, string, or boolean")];if($r!=="number"&&J!=="categorical"){let ua=`number expected, ${$r} found`;return Gl(C)&&J===void 0&&(ua+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new bt(Cr.key,Pn,ua)]}return J!=="categorical"||$r!=="number"||isFinite(cn)&&Math.floor(cn)===cn?J!=="categorical"&&$r==="number"&&At!==void 0&&cn<At?[new bt(Cr.key,Pn,"stop domain values must appear in ascending order")]:(At=cn,J==="categorical"&&cn in jt?[new bt(Cr.key,Pn,"stop domain values must be unique")]:(jt[cn]=!0,[])):[new bt(Cr.key,Pn,`integer expected, found ${cn}`)]}}function ju(U){let C=(U.expressionContext==="property"?Xl:Xs)(Eu(U.value),U.valueSpec);if(C.result==="error")return C.value.map(ht=>new bt(`${U.key}${ht.key}`,U.value,ht.message));let J=C.value.expression||C.value._styleExpression.expression;if(U.expressionContext==="property"&&U.propertyKey==="text-font"&&!J.outputDefined())return[new bt(U.key,U.value,`Invalid data expression for "${U.propertyKey}". Output values must be contained as literals within the expression.`)];if(U.expressionContext==="property"&&U.propertyType==="layout"&&!mu(J))return[new bt(U.key,U.value,'"feature-state" data expressions are not supported with layout properties.')];if(U.expressionContext==="filter"&&!mu(J))return[new bt(U.key,U.value,'"feature-state" data expressions are not supported with filters.')];if(U.expressionContext&&U.expressionContext.indexOf("cluster")===0){if(!$c(J,["zoom","feature-state"]))return[new bt(U.key,U.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(U.expressionContext==="cluster-initial"&&!Xc(J))return[new bt(U.key,U.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ql(U){let C=U.key,J=U.value,ht=U.valueSpec,At=[];return Array.isArray(ht.values)?ht.values.indexOf(Os(J))===-1&&At.push(new bt(C,J,`expected one of [${ht.values.join(", ")}], ${JSON.stringify(J)} found`)):Object.keys(ht.values).indexOf(Os(J))===-1&&At.push(new bt(C,J,`expected one of [${Object.keys(ht.values).join(", ")}], ${JSON.stringify(J)} found`)),At}function oc(U){return Su(Eu(U.value))?ju(vt({},U,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Nu(U)}function Nu(U){let C=U.value,J=U.key;if(ps(C)!=="array")return[new bt(J,C,`array expected, ${ps(C)} found`)];let ht=U.styleSpec,At,Bt=[];if(C.length<1)return[new bt(J,C,"filter array must have at least 1 element")];switch(Bt=Bt.concat(Ql({key:`${J}[0]`,value:C[0],valueSpec:ht.filter_operator,style:U.style,styleSpec:U.styleSpec})),Os(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&Os(C[1])==="$type"&&Bt.push(new bt(J,C,`"$type" cannot be use with operator "${C[0]}"`));case"==":case"!=":C.length!==3&&Bt.push(new bt(J,C,`filter array for operator "${C[0]}" must have 3 elements`));case"in":case"!in":C.length>=2&&(At=ps(C[1]),At!=="string"&&Bt.push(new bt(`${J}[1]`,C[1],`string expected, ${At} found`)));for(let jt=2;jt<C.length;jt++)At=ps(C[jt]),Os(C[1])==="$type"?Bt=Bt.concat(Ql({key:`${J}[${jt}]`,value:C[jt],valueSpec:ht.geometry_type,style:U.style,styleSpec:U.styleSpec})):At!=="string"&&At!=="number"&&At!=="boolean"&&Bt.push(new bt(`${J}[${jt}]`,C[jt],`string, number, or boolean expected, ${At} found`));break;case"any":case"all":case"none":for(let jt=1;jt<C.length;jt++)Bt=Bt.concat(Nu({key:`${J}[${jt}]`,value:C[jt],style:U.style,styleSpec:U.styleSpec}));break;case"has":case"!has":At=ps(C[1]),C.length!==2?Bt.push(new bt(J,C,`filter array for "${C[0]}" operator must have 2 elements`)):At!=="string"&&Bt.push(new bt(`${J}[1]`,C[1],`string expected, ${At} found`))}return Bt}function vc(U,C){let J=U.key,ht=U.validateSpec,At=U.style,Bt=U.styleSpec,jt=U.value,ae=U.objectKey,me=Bt[`${C}_${U.layerType}`];if(!me)return[];let Ie=ae.match(/^(.*)-transition$/);if(C==="paint"&&Ie&&me[Ie[1]]&&me[Ie[1]].transition)return ht({key:J,value:jt,valueSpec:Bt.transition,style:At,styleSpec:Bt});let Ge=U.valueSpec||me[ae];if(!Ge)return[new bt(J,jt,`unknown property "${ae}"`)];let Ke;if(ps(jt)==="string"&&Gl(Ge)&&!Ge.tokens&&(Ke=/^{([^}]+)}$/.exec(jt)))return[new bt(J,jt,`"${ae}" does not support interpolation syntax
|
||
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(Ke[1])} }\`.`)];let vr=[];return U.layerType==="symbol"&&(ae==="text-field"&&At&&!At.glyphs&&vr.push(new bt(J,jt,'use of "text-field" requires a style "glyphs" property')),ae==="text-font"&&Dc(Eu(jt))&&Os(jt.type)==="identity"&&vr.push(new bt(J,jt,'"text-font" does not support identity functions'))),vr.concat(ht({key:U.key,value:jt,valueSpec:Ge,style:At,styleSpec:Bt,expressionContext:"property",propertyType:C,propertyKey:ae}))}function wh(U){return vc(U,"paint")}function cl(U){return vc(U,"layout")}function Qc(U){let C=[],J=U.value,ht=U.key,At=U.style,Bt=U.styleSpec;J.type||J.ref||C.push(new bt(ht,J,'either "type" or "ref" is required'));let jt=Os(J.type),ae=Os(J.ref);if(J.id){let me=Os(J.id);for(let Ie=0;Ie<U.arrayIndex;Ie++){let Ge=At.layers[Ie];Os(Ge.id)===me&&C.push(new bt(ht,J.id,`duplicate layer id "${J.id}", previously used at line ${Ge.id.__line__}`))}}if("ref"in J){let me;["type","source","source-layer","filter","layout"].forEach(Ie=>{Ie in J&&C.push(new bt(ht,J[Ie],`"${Ie}" is prohibited for ref layers`))}),At.layers.forEach(Ie=>{Os(Ie.id)===ae&&(me=Ie)}),me?me.ref?C.push(new bt(ht,J.ref,"ref cannot reference another ref layer")):jt=Os(me.type):C.push(new bt(ht,J.ref,`ref layer "${ae}" not found`))}else if(jt!=="background")if(J.source){let me=At.sources&&At.sources[J.source],Ie=me&&Os(me.type);me?Ie==="vector"&&jt==="raster"?C.push(new bt(ht,J.source,`layer "${J.id}" requires a raster source`)):Ie!=="raster-dem"&&jt==="hillshade"?C.push(new bt(ht,J.source,`layer "${J.id}" requires a raster-dem source`)):Ie==="raster"&&jt!=="raster"?C.push(new bt(ht,J.source,`layer "${J.id}" requires a vector source`)):Ie!=="vector"||J["source-layer"]?Ie==="raster-dem"&&jt!=="hillshade"?C.push(new bt(ht,J.source,"raster-dem source can only be used with layer type 'hillshade'.")):jt!=="line"||!J.paint||!J.paint["line-gradient"]||Ie==="geojson"&&me.lineMetrics||C.push(new bt(ht,J,`layer "${J.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):C.push(new bt(ht,J,`layer "${J.id}" must specify a "source-layer"`)):C.push(new bt(ht,J.source,`source "${J.source}" not found`))}else C.push(new bt(ht,J,'missing required property "source"'));return C=C.concat(Jl({key:ht,value:J,valueSpec:Bt.layer,style:U.style,styleSpec:U.styleSpec,validateSpec:U.validateSpec,objectElementValidators:{"*":()=>[],type:()=>U.validateSpec({key:`${ht}.type`,value:J.type,valueSpec:Bt.layer.type,style:U.style,styleSpec:U.styleSpec,validateSpec:U.validateSpec,object:J,objectKey:"type"}),filter:oc,layout:me=>Jl({layer:J,key:me.key,value:me.value,style:me.style,styleSpec:me.styleSpec,validateSpec:me.validateSpec,objectElementValidators:{"*":Ie=>cl(vt({layerType:jt},Ie))}}),paint:me=>Jl({layer:J,key:me.key,value:me.value,style:me.style,styleSpec:me.styleSpec,validateSpec:me.validateSpec,objectElementValidators:{"*":Ie=>wh(vt({layerType:jt},Ie))}})}})),C}function Yl(U){let C=U.value,J=U.key,ht=ps(C);return ht!=="string"?[new bt(J,C,`string expected, ${ht} found`)]:[]}let Pu={promoteId:function({key:U,value:C}){if(ps(C)==="string")return Yl({key:U,value:C});{let J=[];for(let ht in C)J.push(...Yl({key:`${U}.${ht}`,value:C[ht]}));return J}}};function xu(U){let C=U.value,J=U.key,ht=U.styleSpec,At=U.style,Bt=U.validateSpec;if(!C.type)return[new bt(J,C,'"type" is required')];let jt=Os(C.type),ae;switch(jt){case"vector":case"raster":return ae=Jl({key:J,value:C,valueSpec:ht[`source_${jt.replace("-","_")}`],style:U.style,styleSpec:ht,objectElementValidators:Pu,validateSpec:Bt}),ae;case"raster-dem":return ae=function(me){var Ie;let Ge=(Ie=me.sourceName)!==null&&Ie!==void 0?Ie:"",Ke=me.value,vr=me.styleSpec,Cr=vr.source_raster_dem,Nr=me.style,$r=[],cn=ps(Ke);if(Ke===void 0)return $r;if(cn!=="object")return $r.push(new bt("source_raster_dem",Ke,`object expected, ${cn} found`)),$r;let Pn=Os(Ke.encoding)==="custom",ua=["redFactor","greenFactor","blueFactor","baseShift"],Un=me.value.encoding?`"${me.value.encoding}"`:"Default";for(let Kn in Ke)!Pn&&ua.includes(Kn)?$r.push(new bt(Kn,Ke[Kn],`In "${Ge}": "${Kn}" is only valid when "encoding" is set to "custom". ${Un} encoding found`)):Cr[Kn]?$r=$r.concat(me.validateSpec({key:Kn,value:Ke[Kn],valueSpec:Cr[Kn],validateSpec:me.validateSpec,style:Nr,styleSpec:vr})):$r.push(new bt(Kn,Ke[Kn],`unknown property "${Kn}"`));return $r}({sourceName:J,value:C,style:U.style,styleSpec:ht,validateSpec:Bt}),ae;case"geojson":if(ae=Jl({key:J,value:C,valueSpec:ht.source_geojson,style:At,styleSpec:ht,validateSpec:Bt,objectElementValidators:Pu}),C.cluster)for(let me in C.clusterProperties){let[Ie,Ge]=C.clusterProperties[me],Ke=typeof Ie=="string"?[Ie,["accumulated"],["get",me]]:Ie;ae.push(...ju({key:`${J}.${me}.map`,value:Ge,validateSpec:Bt,expressionContext:"cluster-map"})),ae.push(...ju({key:`${J}.${me}.reduce`,value:Ke,validateSpec:Bt,expressionContext:"cluster-reduce"}))}return ae;case"video":return Jl({key:J,value:C,valueSpec:ht.source_video,style:At,validateSpec:Bt,styleSpec:ht});case"image":return Jl({key:J,value:C,valueSpec:ht.source_image,style:At,validateSpec:Bt,styleSpec:ht});case"canvas":return[new bt(J,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ql({key:`${J}.type`,value:C.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:At,validateSpec:Bt,styleSpec:ht})}}function Vs(U){let C=U.value,J=U.styleSpec,ht=J.light,At=U.style,Bt=[],jt=ps(C);if(C===void 0)return Bt;if(jt!=="object")return Bt=Bt.concat([new bt("light",C,`object expected, ${jt} found`)]),Bt;for(let ae in C){let me=ae.match(/^(.*)-transition$/);Bt=Bt.concat(me&&ht[me[1]]&&ht[me[1]].transition?U.validateSpec({key:ae,value:C[ae],valueSpec:J.transition,validateSpec:U.validateSpec,style:At,styleSpec:J}):ht[ae]?U.validateSpec({key:ae,value:C[ae],valueSpec:ht[ae],validateSpec:U.validateSpec,style:At,styleSpec:J}):[new bt(ae,C[ae],`unknown property "${ae}"`)])}return Bt}function qs(U){let C=U.value,J=U.styleSpec,ht=J.sky,At=U.style,Bt=ps(C);if(C===void 0)return[];if(Bt!=="object")return[new bt("sky",C,`object expected, ${Bt} found`)];let jt=[];for(let ae in C)jt=jt.concat(ht[ae]?U.validateSpec({key:ae,value:C[ae],valueSpec:ht[ae],style:At,styleSpec:J}):[new bt(ae,C[ae],`unknown property "${ae}"`)]);return jt}function Iu(U){let C=U.value,J=U.styleSpec,ht=J.terrain,At=U.style,Bt=[],jt=ps(C);if(C===void 0)return Bt;if(jt!=="object")return Bt=Bt.concat([new bt("terrain",C,`object expected, ${jt} found`)]),Bt;for(let ae in C)Bt=Bt.concat(ht[ae]?U.validateSpec({key:ae,value:C[ae],valueSpec:ht[ae],validateSpec:U.validateSpec,style:At,styleSpec:J}):[new bt(ae,C[ae],`unknown property "${ae}"`)]);return Bt}function sc(U){let C=[],J=U.value,ht=U.key;if(Array.isArray(J)){let At=[],Bt=[];for(let jt in J)J[jt].id&&At.includes(J[jt].id)&&C.push(new bt(ht,J,`all the sprites' ids must be unique, but ${J[jt].id} is duplicated`)),At.push(J[jt].id),J[jt].url&&Bt.includes(J[jt].url)&&C.push(new bt(ht,J,`all the sprites' URLs must be unique, but ${J[jt].url} is duplicated`)),Bt.push(J[jt].url),C=C.concat(Jl({key:`${ht}[${jt}]`,value:J[jt],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:U.validateSpec}));return C}return Yl({key:ht,value:J})}let _u={"*":()=>[],array:ch,boolean:function(U){let C=U.value,J=U.key,ht=ps(C);return ht!=="boolean"?[new bt(J,C,`boolean expected, ${ht} found`)]:[]},number:Ps,color:function(U){let C=U.key,J=U.value,ht=ps(J);return ht!=="string"?[new bt(C,J,`color expected, ${ht} found`)]:Ne.parse(String(J))?[]:[new bt(C,J,`color expected, "${J}" found`)]},constants:Ku,enum:Ql,filter:oc,function:mc,layer:Qc,object:Jl,source:xu,light:Vs,sky:qs,terrain:Iu,projection:function(U){let C=U.value,J=U.styleSpec,ht=J.projection,At=U.style,Bt=ps(C);if(C===void 0)return[];if(Bt!=="object")return[new bt("projection",C,`object expected, ${Bt} found`)];let jt=[];for(let ae in C)jt=jt.concat(ht[ae]?U.validateSpec({key:ae,value:C[ae],valueSpec:ht[ae],style:At,styleSpec:J}):[new bt(ae,C[ae],`unknown property "${ae}"`)]);return jt},string:Yl,formatted:function(U){return Yl(U).length===0?[]:ju(U)},resolvedImage:function(U){return Yl(U).length===0?[]:ju(U)},padding:function(U){let C=U.key,J=U.value;if(ps(J)==="array"){if(J.length<1||J.length>4)return[new bt(C,J,`padding requires 1 to 4 values; ${J.length} values found`)];let ht={type:"number"},At=[];for(let Bt=0;Bt<J.length;Bt++)At=At.concat(U.validateSpec({key:`${C}[${Bt}]`,value:J[Bt],validateSpec:U.validateSpec,valueSpec:ht}));return At}return Ps({key:C,value:J,valueSpec:{}})},variableAnchorOffsetCollection:function(U){let C=U.key,J=U.value,ht=ps(J),At=U.styleSpec;if(ht!=="array"||J.length<1||J.length%2!=0)return[new bt(C,J,"variableAnchorOffsetCollection requires a non-empty array of even length")];let Bt=[];for(let jt=0;jt<J.length;jt+=2)Bt=Bt.concat(Ql({key:`${C}[${jt}]`,value:J[jt],valueSpec:At.layout_symbol["text-anchor"]})),Bt=Bt.concat(ch({key:`${C}[${jt+1}]`,value:J[jt+1],valueSpec:{length:2,value:"number"},validateSpec:U.validateSpec,style:U.style,styleSpec:At}));return Bt},sprite:sc};function wc(U){let C=U.value,J=U.valueSpec,ht=U.styleSpec;return U.validateSpec=wc,J.expression&&Dc(Os(C))?mc(U):J.expression&&Ru(Eu(C))?ju(U):J.type&&_u[J.type]?_u[J.type](U):Jl(vt({},U,{valueSpec:J.type?ht[J.type]:J}))}function Ve(U){let C=U.value,J=U.key,ht=Yl(U);return ht.length||(C.indexOf("{fontstack}")===-1&&ht.push(new bt(J,C,'"glyphs" url must include a "{fontstack}" token')),C.indexOf("{range}")===-1&&ht.push(new bt(J,C,'"glyphs" url must include a "{range}" token'))),ht}function lr(U,C=it){let J=[];return J=J.concat(wc({key:"",value:U,valueSpec:C.$root,styleSpec:C,style:U,validateSpec:wc,objectElementValidators:{glyphs:Ve,"*":()=>[]}})),U.constants&&(J=J.concat(Ku({key:"constants",value:U.constants,style:U,styleSpec:C,validateSpec:wc}))),Or(J)}function Ur(U){return function(C){return U(Py(hu({},C),{validateSpec:wc}))}}function Or(U){return[].concat(U).sort((C,J)=>C.line-J.line)}function un(U){return function(...C){return Or(U.apply(this,C))}}lr.source=un(Ur(xu)),lr.sprite=un(Ur(sc)),lr.glyphs=un(Ur(Ve)),lr.light=un(Ur(Vs)),lr.sky=un(Ur(qs)),lr.terrain=un(Ur(Iu)),lr.layer=un(Ur(Qc)),lr.filter=un(Ur(oc)),lr.paintProperty=un(Ur(wh)),lr.layoutProperty=un(Ur(cl));let Ln=lr,Gn=Ln.light,oa=Ln.sky,ya=Ln.paintProperty,Pa=Ln.layoutProperty;function Jn(U,C){let J=!1;if(C&&C.length)for(let ht of C)U.fire(new q(new Error(ht.message))),J=!0;return J}class va{constructor(C,J,ht){let At=this.cells=[];if(C instanceof ArrayBuffer){this.arrayBuffer=C;let jt=new Int32Array(this.arrayBuffer);C=jt[0],this.d=(J=jt[1])+2*(ht=jt[2]);for(let me=0;me<this.d*this.d;me++){let Ie=jt[3+me],Ge=jt[3+me+1];At.push(Ie===Ge?null:jt.subarray(Ie,Ge))}let ae=jt[3+At.length+1];this.keys=jt.subarray(jt[3+At.length],ae),this.bboxes=jt.subarray(ae),this.insert=this._insertReadonly}else{this.d=J+2*ht;for(let jt=0;jt<this.d*this.d;jt++)At.push([]);this.keys=[],this.bboxes=[]}this.n=J,this.extent=C,this.padding=ht,this.scale=J/C,this.uid=0;let Bt=ht/J*C;this.min=-Bt,this.max=C+Bt}insert(C,J,ht,At,Bt){this._forEachCell(J,ht,At,Bt,this._insertCell,this.uid++,void 0,void 0),this.keys.push(C),this.bboxes.push(J),this.bboxes.push(ht),this.bboxes.push(At),this.bboxes.push(Bt)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(C,J,ht,At,Bt,jt){this.cells[Bt].push(jt)}query(C,J,ht,At,Bt){let jt=this.min,ae=this.max;if(C<=jt&&J<=jt&&ae<=ht&&ae<=At&&!Bt)return Array.prototype.slice.call(this.keys);{let me=[];return this._forEachCell(C,J,ht,At,this._queryCell,me,{},Bt),me}}_queryCell(C,J,ht,At,Bt,jt,ae,me){let Ie=this.cells[Bt];if(Ie!==null){let Ge=this.keys,Ke=this.bboxes;for(let vr=0;vr<Ie.length;vr++){let Cr=Ie[vr];if(ae[Cr]===void 0){let Nr=4*Cr;(me?me(Ke[Nr+0],Ke[Nr+1],Ke[Nr+2],Ke[Nr+3]):C<=Ke[Nr+2]&&J<=Ke[Nr+3]&&ht>=Ke[Nr+0]&&At>=Ke[Nr+1])?(ae[Cr]=!0,jt.push(Ge[Cr])):ae[Cr]=!1}}}}_forEachCell(C,J,ht,At,Bt,jt,ae,me){let Ie=this._convertToCellCoord(C),Ge=this._convertToCellCoord(J),Ke=this._convertToCellCoord(ht),vr=this._convertToCellCoord(At);for(let Cr=Ie;Cr<=Ke;Cr++)for(let Nr=Ge;Nr<=vr;Nr++){let $r=this.d*Nr+Cr;if((!me||me(this._convertFromCellCoord(Cr),this._convertFromCellCoord(Nr),this._convertFromCellCoord(Cr+1),this._convertFromCellCoord(Nr+1)))&&Bt.call(this,C,J,ht,At,$r,jt,ae,me))return}}_convertFromCellCoord(C){return(C-this.padding)/this.scale}_convertToCellCoord(C){return Math.max(0,Math.min(this.d-1,Math.floor(C*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let C=this.cells,J=3+this.cells.length+1+1,ht=0;for(let jt=0;jt<this.cells.length;jt++)ht+=this.cells[jt].length;let At=new Int32Array(J+ht+this.keys.length+this.bboxes.length);At[0]=this.extent,At[1]=this.n,At[2]=this.padding;let Bt=J;for(let jt=0;jt<C.length;jt++){let ae=C[jt];At[3+jt]=Bt,At.set(ae,Bt),Bt+=ae.length}return At[3+C.length]=Bt,At.set(this.keys,Bt),Bt+=this.keys.length,At[3+C.length+1]=Bt,At.set(this.bboxes,Bt),Bt+=this.bboxes.length,At.buffer}static serialize(C,J){let ht=C.toArrayBuffer();return J&&J.push(ht),{buffer:ht}}static deserialize(C){return new va(C.buffer)}}let sa={};function qn(U,C,J={}){if(sa[U])throw new Error(`${U} is already registered.`);Object.defineProperty(C,"_classRegistryKey",{value:U,writeable:!1}),sa[U]={klass:C,omit:J.omit||[],shallow:J.shallow||[]}}qn("Object",Object),qn("TransferableGridIndex",va),qn("Color",Ne),qn("Error",Error),qn("AJAXError",tt),qn("ResolvedImage",Fn),qn("StylePropertyFunction",Ds),qn("StyleExpression",Zl,{omit:["_evaluator"]}),qn("ZoomDependentExpression",yu),qn("ZoomConstantExpression",Qu),qn("CompoundExpression",rl,{omit:["_evaluate"]});for(let U in dc)dc[U]._classRegistryKey||qn(`Expression_${U}`,dc[U]);function Fa(U){return U&&typeof ArrayBuffer<"u"&&(U instanceof ArrayBuffer||U.constructor&&U.constructor.name==="ArrayBuffer")}function Fi(U){return U.$name||U.constructor._classRegistryKey}function Ei(U){return!function(C){if(C===null||typeof C!="object")return!1;let J=Fi(C);return!(!J||J==="Object")}(U)&&(U==null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||U instanceof Boolean||U instanceof Number||U instanceof String||U instanceof Date||U instanceof RegExp||U instanceof Blob||U instanceof Error||Fa(U)||B(U)||ArrayBuffer.isView(U)||U instanceof ImageData)}function Ni(U,C){if(Ei(U))return(Fa(U)||B(U))&&C&&C.push(U),ArrayBuffer.isView(U)&&C&&C.push(U.buffer),U instanceof ImageData&&C&&C.push(U.data.buffer),U;if(Array.isArray(U)){let Bt=[];for(let jt of U)Bt.push(Ni(jt,C));return Bt}if(typeof U!="object")throw new Error("can't serialize object of type "+typeof U);let J=Fi(U);if(!J)throw new Error(`can't serialize object of unregistered class ${U.constructor.name}`);if(!sa[J])throw new Error(`${J} is not registered.`);let{klass:ht}=sa[J],At=ht.serialize?ht.serialize(U,C):{};if(ht.serialize){if(C&&At===C[C.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let Bt in U){if(!U.hasOwnProperty(Bt)||sa[J].omit.indexOf(Bt)>=0)continue;let jt=U[Bt];At[Bt]=sa[J].shallow.indexOf(Bt)>=0?jt:Ni(jt,C)}U instanceof Error&&(At.message=U.message)}if(At.$name)throw new Error("$name property is reserved for worker serialization logic.");return J!=="Object"&&(At.$name=J),At}function Hi(U){if(Ei(U))return U;if(Array.isArray(U))return U.map(Hi);if(typeof U!="object")throw new Error("can't deserialize object of type "+typeof U);let C=Fi(U)||"Object";if(!sa[C])throw new Error(`can't deserialize unregistered class ${C}`);let{klass:J}=sa[C];if(!J)throw new Error(`can't deserialize unregistered class ${C}`);if(J.deserialize)return J.deserialize(U);let ht=Object.create(J.prototype);for(let At of Object.keys(U)){if(At==="$name")continue;let Bt=U[At];ht[At]=sa[C].shallow.indexOf(At)>=0?Bt:Hi(Bt)}return ht}class Ba{constructor(){this.first=!0}update(C,J){let ht=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=ht,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=ht,!0):(this.lastFloorZoom>ht?(this.lastIntegerZoom=ht+1,this.lastIntegerZoomTime=J):this.lastFloorZoom<ht&&(this.lastIntegerZoom=ht,this.lastIntegerZoomTime=J),C!==this.lastZoom&&(this.lastZoom=C,this.lastFloorZoom=ht,!0))}}let ba={"Latin-1 Supplement":U=>U>=128&&U<=255,"Hangul Jamo":U=>U>=4352&&U<=4607,Khmer:U=>U>=6016&&U<=6143,"General Punctuation":U=>U>=8192&&U<=8303,"Letterlike Symbols":U=>U>=8448&&U<=8527,"Number Forms":U=>U>=8528&&U<=8591,"Miscellaneous Technical":U=>U>=8960&&U<=9215,"Control Pictures":U=>U>=9216&&U<=9279,"Optical Character Recognition":U=>U>=9280&&U<=9311,"Enclosed Alphanumerics":U=>U>=9312&&U<=9471,"Geometric Shapes":U=>U>=9632&&U<=9727,"Miscellaneous Symbols":U=>U>=9728&&U<=9983,"Miscellaneous Symbols and Arrows":U=>U>=11008&&U<=11263,"Ideographic Description Characters":U=>U>=12272&&U<=12287,"CJK Symbols and Punctuation":U=>U>=12288&&U<=12351,Katakana:U=>U>=12448&&U<=12543,Kanbun:U=>U>=12688&&U<=12703,"CJK Strokes":U=>U>=12736&&U<=12783,"Enclosed CJK Letters and Months":U=>U>=12800&&U<=13055,"CJK Compatibility":U=>U>=13056&&U<=13311,"Yijing Hexagram Symbols":U=>U>=19904&&U<=19967,"Private Use Area":U=>U>=57344&&U<=63743,"Vertical Forms":U=>U>=65040&&U<=65055,"CJK Compatibility Forms":U=>U>=65072&&U<=65103,"Small Form Variants":U=>U>=65104&&U<=65135,"Halfwidth and Fullwidth Forms":U=>U>=65280&&U<=65519};function $i(U){for(let C of U)if(No(C.charCodeAt(0)))return!0;return!1}function So(U){for(let C of U)if(!os(C.charCodeAt(0)))return!1;return!0}function Jo(U){let C=U.map(J=>{try{return new RegExp(`\\p{sc=${J}}`,"u").source}catch{return null}}).filter(J=>J);return new RegExp(C.join("|"),"u")}let As=Jo(["Arab","Dupl","Mong","Ougr","Syrc"]);function os(U){return!As.test(String.fromCodePoint(U))}let xs=Jo(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function No(U){return!(U!==746&&U!==747&&(U<4352||!(ba["CJK Compatibility Forms"](U)&&!(U>=65097&&U<=65103)||ba["CJK Compatibility"](U)||ba["CJK Strokes"](U)||!(!ba["CJK Symbols and Punctuation"](U)||U>=12296&&U<=12305||U>=12308&&U<=12319||U===12336)||ba["Enclosed CJK Letters and Months"](U)||ba["Ideographic Description Characters"](U)||ba.Kanbun(U)||ba.Katakana(U)&&U!==12540||!(!ba["Halfwidth and Fullwidth Forms"](U)||U===65288||U===65289||U===65293||U>=65306&&U<=65310||U===65339||U===65341||U===65343||U>=65371&&U<=65503||U===65507||U>=65512&&U<=65519)||!(!ba["Small Form Variants"](U)||U>=65112&&U<=65118||U>=65123&&U<=65126)||ba["Vertical Forms"](U)||ba["Yijing Hexagram Symbols"](U)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(U))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(U))||xs.test(String.fromCodePoint(U)))))}function Qs(U){return!(No(U)||function(C){return!!(ba["Latin-1 Supplement"](C)&&(C===167||C===169||C===174||C===177||C===188||C===189||C===190||C===215||C===247)||ba["General Punctuation"](C)&&(C===8214||C===8224||C===8225||C===8240||C===8241||C===8251||C===8252||C===8258||C===8263||C===8264||C===8265||C===8273)||ba["Letterlike Symbols"](C)||ba["Number Forms"](C)||ba["Miscellaneous Technical"](C)&&(C>=8960&&C<=8967||C>=8972&&C<=8991||C>=8996&&C<=9e3||C===9003||C>=9085&&C<=9114||C>=9150&&C<=9165||C===9167||C>=9169&&C<=9179||C>=9186&&C<=9215)||ba["Control Pictures"](C)&&C!==9251||ba["Optical Character Recognition"](C)||ba["Enclosed Alphanumerics"](C)||ba["Geometric Shapes"](C)||ba["Miscellaneous Symbols"](C)&&!(C>=9754&&C<=9759)||ba["Miscellaneous Symbols and Arrows"](C)&&(C>=11026&&C<=11055||C>=11088&&C<=11097||C>=11192&&C<=11243)||ba["CJK Symbols and Punctuation"](C)||ba.Katakana(C)||ba["Private Use Area"](C)||ba["CJK Compatibility Forms"](C)||ba["Small Form Variants"](C)||ba["Halfwidth and Fullwidth Forms"](C)||C===8734||C===8756||C===8757||C>=9984&&C<=10087||C>=10102&&C<=10131||C===65532||C===65533)}(U))}let Hs=Jo(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Ms(U){return Hs.test(String.fromCodePoint(U))}function ni(U,C){return!(!C&&Ms(U)||U>=2304&&U<=3583||U>=3840&&U<=4255||ba.Khmer(U))}function to(U){for(let C of U)if(Ms(C.charCodeAt(0)))return!0;return!1}let ds=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(U){this.pluginStatus=U.pluginStatus,this.pluginURL=U.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(U){this.applyArabicShaping=U.applyArabicShaping,this.processBidirectionalText=U.processBidirectionalText,this.processStyledBidirectionalText=U.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Qo{constructor(C,J){this.zoom=C,J?(this.now=J.now,this.fadeDuration=J.fadeDuration,this.zoomHistory=J.zoomHistory,this.transition=J.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ba,this.transition={})}isSupportedScript(C){return function(J,ht){for(let At of J)if(!ni(At.charCodeAt(0),ht))return!1;return!0}(C,ds.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let C=this.zoom,J=C-Math.floor(C),ht=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:J+(1-J)*ht}:{fromScale:.5,toScale:1,t:1-(1-ht)*J}}}class Tl{constructor(C,J){this.property=C,this.value=J,this.expression=function(ht,At){if(Dc(ht))return new Ds(ht,At);if(Ru(ht)){let Bt=Xl(ht,At);if(Bt.result==="error")throw new Error(Bt.value.map(jt=>`${jt.key}: ${jt.message}`).join(", "));return Bt.value}{let Bt=ht;return At.type==="color"&&typeof ht=="string"?Bt=Ne.parse(ht):At.type!=="padding"||typeof ht!="number"&&!Array.isArray(ht)?At.type==="variableAnchorOffsetCollection"&&Array.isArray(ht)&&(Bt=bn.parse(ht)):Bt=Br.parse(ht),{kind:"constant",evaluate:()=>Bt}}}(J===void 0?C.specification.default:J,C.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(C,J,ht){return this.property.possiblyEvaluate(this,C,J,ht)}}class Kl{constructor(C){this.property=C,this.value=new Tl(C,void 0)}transitioned(C,J){return new tc(this.property,this.value,J,T({},C.transition,this.transition),C.now)}untransitioned(){return new tc(this.property,this.value,null,{},0)}}class Fl{constructor(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)}getValue(C){return f(this._values[C].value.value)}setValue(C,J){Object.prototype.hasOwnProperty.call(this._values,C)||(this._values[C]=new Kl(this._values[C].property)),this._values[C].value=new Tl(this._values[C].property,J===null?void 0:f(J))}getTransition(C){return f(this._values[C].transition)}setTransition(C,J){Object.prototype.hasOwnProperty.call(this._values,C)||(this._values[C]=new Kl(this._values[C].property)),this._values[C].transition=f(J)||void 0}serialize(){let C={};for(let J of Object.keys(this._values)){let ht=this.getValue(J);ht!==void 0&&(C[J]=ht);let At=this.getTransition(J);At!==void 0&&(C[`${J}-transition`]=At)}return C}transitioned(C,J){let ht=new tu(this._properties);for(let At of Object.keys(this._values))ht._values[At]=this._values[At].transitioned(C,J._values[At]);return ht}untransitioned(){let C=new tu(this._properties);for(let J of Object.keys(this._values))C._values[J]=this._values[J].untransitioned();return C}}class tc{constructor(C,J,ht,At,Bt){this.property=C,this.value=J,this.begin=Bt+At.delay||0,this.end=this.begin+At.duration||0,C.specification.transition&&(At.delay||At.duration)&&(this.prior=ht)}possiblyEvaluate(C,J,ht){let At=C.now||0,Bt=this.value.possiblyEvaluate(C,J,ht),jt=this.prior;if(jt){if(At>this.end)return this.prior=null,Bt;if(this.value.isDataDriven())return this.prior=null,Bt;if(At<this.begin)return jt.possiblyEvaluate(C,J,ht);{let ae=(At-this.begin)/(this.end-this.begin);return this.property.interpolate(jt.possiblyEvaluate(C,J,ht),Bt,function(me){if(me<=0)return 0;if(me>=1)return 1;let Ie=me*me,Ge=Ie*me;return 4*(me<.5?Ge:3*(me-Ie)+Ge-.75)}(ae))}}return Bt}}class tu{constructor(C){this._properties=C,this._values=Object.create(C.defaultTransitioningPropertyValues)}possiblyEvaluate(C,J,ht){let At=new ec(this._properties);for(let Bt of Object.keys(this._values))At._values[Bt]=this._values[Bt].possiblyEvaluate(C,J,ht);return At}hasTransition(){for(let C of Object.keys(this._values))if(this._values[C].prior)return!0;return!1}}class Uu{constructor(C){this._properties=C,this._values=Object.create(C.defaultPropertyValues)}hasValue(C){return this._values[C].value!==void 0}getValue(C){return f(this._values[C].value)}setValue(C,J){this._values[C]=new Tl(this._values[C].property,J===null?void 0:f(J))}serialize(){let C={};for(let J of Object.keys(this._values)){let ht=this.getValue(J);ht!==void 0&&(C[J]=ht)}return C}possiblyEvaluate(C,J,ht){let At=new ec(this._properties);for(let Bt of Object.keys(this._values))At._values[Bt]=this._values[Bt].possiblyEvaluate(C,J,ht);return At}}class $s{constructor(C,J,ht){this.property=C,this.value=J,this.parameters=ht}isConstant(){return this.value.kind==="constant"}constantOr(C){return this.value.kind==="constant"?this.value.value:C}evaluate(C,J,ht,At){return this.property.evaluate(this.value,this.parameters,C,J,ht,At)}}class ec{constructor(C){this._properties=C,this._values=Object.create(C.defaultPossiblyEvaluatedValues)}get(C){return this._values[C]}}class Ri{constructor(C){this.specification=C}possiblyEvaluate(C,J){if(C.isDataDriven())throw new Error("Value should not be data driven");return C.expression.evaluate(J)}interpolate(C,J,ht){let At=bi[this.specification.type];return At?At(C,J,ht):C}}class oo{constructor(C,J){this.specification=C,this.overrides=J}possiblyEvaluate(C,J,ht,At){return new $s(this,C.expression.kind==="constant"||C.expression.kind==="camera"?{kind:"constant",value:C.expression.evaluate(J,null,{},ht,At)}:C.expression,J)}interpolate(C,J,ht){if(C.value.kind!=="constant"||J.value.kind!=="constant")return C;if(C.value.value===void 0||J.value.value===void 0)return new $s(this,{kind:"constant",value:void 0},C.parameters);let At=bi[this.specification.type];if(At){let Bt=At(C.value.value,J.value.value,ht);return new $s(this,{kind:"constant",value:Bt},C.parameters)}return C}evaluate(C,J,ht,At,Bt,jt){return C.kind==="constant"?C.value:C.evaluate(J,ht,At,Bt,jt)}}class bu extends oo{possiblyEvaluate(C,J,ht,At){if(C.value===void 0)return new $s(this,{kind:"constant",value:void 0},J);if(C.expression.kind==="constant"){let Bt=C.expression.evaluate(J,null,{},ht,At),jt=C.property.specification.type==="resolvedImage"&&typeof Bt!="string"?Bt.name:Bt,ae=this._calculate(jt,jt,jt,J);return new $s(this,{kind:"constant",value:ae},J)}if(C.expression.kind==="camera"){let Bt=this._calculate(C.expression.evaluate({zoom:J.zoom-1}),C.expression.evaluate({zoom:J.zoom}),C.expression.evaluate({zoom:J.zoom+1}),J);return new $s(this,{kind:"constant",value:Bt},J)}return new $s(this,C.expression,J)}evaluate(C,J,ht,At,Bt,jt){if(C.kind==="source"){let ae=C.evaluate(J,ht,At,Bt,jt);return this._calculate(ae,ae,ae,J)}return C.kind==="composite"?this._calculate(C.evaluate({zoom:Math.floor(J.zoom)-1},ht,At),C.evaluate({zoom:Math.floor(J.zoom)},ht,At),C.evaluate({zoom:Math.floor(J.zoom)+1},ht,At),J):C.value}_calculate(C,J,ht,At){return At.zoom>At.zoomHistory.lastIntegerZoom?{from:C,to:J}:{from:ht,to:J}}interpolate(C){return C}}class Cl{constructor(C){this.specification=C}possiblyEvaluate(C,J,ht,At){if(C.value!==void 0){if(C.expression.kind==="constant"){let Bt=C.expression.evaluate(J,null,{},ht,At);return this._calculate(Bt,Bt,Bt,J)}return this._calculate(C.expression.evaluate(new Qo(Math.floor(J.zoom-1),J)),C.expression.evaluate(new Qo(Math.floor(J.zoom),J)),C.expression.evaluate(new Qo(Math.floor(J.zoom+1),J)),J)}}_calculate(C,J,ht,At){return At.zoom>At.zoomHistory.lastIntegerZoom?{from:C,to:J}:{from:ht,to:J}}interpolate(C){return C}}class Th{constructor(C){this.specification=C}possiblyEvaluate(C,J,ht,At){return!!C.expression.evaluate(J,null,{},ht,At)}interpolate(){return!1}}class Lt{constructor(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let J in C){let ht=C[J];ht.specification.overridable&&this.overridableProperties.push(J);let At=this.defaultPropertyValues[J]=new Tl(ht,void 0),Bt=this.defaultTransitionablePropertyValues[J]=new Kl(ht);this.defaultTransitioningPropertyValues[J]=Bt.untransitioned(),this.defaultPossiblyEvaluatedValues[J]=At.possiblyEvaluate({})}}}qn("DataDrivenProperty",oo),qn("DataConstantProperty",Ri),qn("CrossFadedDataDrivenProperty",bu),qn("CrossFadedProperty",Cl),qn("ColorRampProperty",Th);let P="-transition";class at extends ot{constructor(C,J){if(super(),this.id=C.id,this.type=C.type,this._featureFilter={filter:()=>!0,needGeometry:!1},C.type!=="custom"&&(this.metadata=C.metadata,this.minzoom=C.minzoom,this.maxzoom=C.maxzoom,C.type!=="background"&&(this.source=C.source,this.sourceLayer=C["source-layer"],this.filter=C.filter),J.layout&&(this._unevaluatedLayout=new Uu(J.layout)),J.paint)){this._transitionablePaint=new Fl(J.paint);for(let ht in C.paint)this.setPaintProperty(ht,C.paint[ht],{validate:!1});for(let ht in C.layout)this.setLayoutProperty(ht,C.layout[ht],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ec(J.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(C){return C==="visibility"?this.visibility:this._unevaluatedLayout.getValue(C)}setLayoutProperty(C,J,ht={}){J!=null&&this._validate(Pa,`layers.${this.id}.layout.${C}`,C,J,ht)||(C!=="visibility"?this._unevaluatedLayout.setValue(C,J):this.visibility=J)}getPaintProperty(C){return C.endsWith(P)?this._transitionablePaint.getTransition(C.slice(0,-11)):this._transitionablePaint.getValue(C)}setPaintProperty(C,J,ht={}){if(J!=null&&this._validate(ya,`layers.${this.id}.paint.${C}`,C,J,ht))return!1;if(C.endsWith(P))return this._transitionablePaint.setTransition(C.slice(0,-11),J||void 0),!1;{let At=this._transitionablePaint._values[C],Bt=At.property.specification["property-type"]==="cross-faded-data-driven",jt=At.value.isDataDriven(),ae=At.value;this._transitionablePaint.setValue(C,J),this._handleSpecialPaintPropertyUpdate(C);let me=this._transitionablePaint._values[C].value;return me.isDataDriven()||jt||Bt||this._handleOverridablePaintPropertyUpdate(C,ae,me)}}_handleSpecialPaintPropertyUpdate(C){}_handleOverridablePaintPropertyUpdate(C,J,ht){return!1}isHidden(C){return!!(this.minzoom&&C<this.minzoom)||!!(this.maxzoom&&C>=this.maxzoom)||this.visibility==="none"}updateTransitions(C){this._transitioningPaint=this._transitionablePaint.transitioned(C,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(C,J){C.getCrossfadeParameters&&(this._crossfadeParameters=C.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(C,void 0,J)),this.paint=this._transitioningPaint.possiblyEvaluate(C,void 0,J)}serialize(){let C={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&&(C.layout=C.layout||{},C.layout.visibility=this.visibility),u(C,(J,ht)=>!(J===void 0||ht==="layout"&&!Object.keys(J).length||ht==="paint"&&!Object.keys(J).length))}_validate(C,J,ht,At,Bt={}){return(!Bt||Bt.validate!==!1)&&Jn(this,C.call(Ln,{key:J,layerType:this.type,objectKey:ht,value:At,styleSpec:it,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let C in this.paint._values){let J=this.paint.get(C);if(J instanceof $s&&Gl(J.property.specification)&&(J.value.kind==="source"||J.value.kind==="composite")&&J.value.isStateDependent)return!0}return!1}}let _t={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Tt{constructor(C,J){this._structArray=C,this._pos1=J*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Pt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(C,J){return C._trim(),J&&(C.isTransferred=!0,J.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}}static deserialize(C){let J=Object.create(this.prototype);return J.arrayBuffer=C.arrayBuffer,J.length=C.length,J.capacity=C.arrayBuffer.byteLength/J.bytesPerElement,J._refreshViews(),J}_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(C){this.reserve(C),this.length=C}reserve(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let J=this.uint8;this._refreshViews(),J&&this.uint8.set(J)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ie(U,C=1){let J=0,ht=0;return{members:U.map(At=>{let Bt=_t[At.type].BYTES_PER_ELEMENT,jt=J=de(J,Math.max(C,Bt)),ae=At.components||1;return ht=Math.max(ht,Bt),J+=Bt*ae,{name:At.name,type:At.type,components:ae,offset:jt}}),size:de(J,Math.max(ht,C)),alignment:C}}function de(U,C){return Math.ceil(U/C)*C}class Ee extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,J){let ht=this.length;return this.resize(ht+1),this.emplace(ht,C,J)}emplace(C,J,ht){let At=2*C;return this.int16[At+0]=J,this.int16[At+1]=ht,C}}Ee.prototype.bytesPerElement=4,qn("StructArrayLayout2i4",Ee);class He extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,J,ht){let At=this.length;return this.resize(At+1),this.emplace(At,C,J,ht)}emplace(C,J,ht,At){let Bt=3*C;return this.int16[Bt+0]=J,this.int16[Bt+1]=ht,this.int16[Bt+2]=At,C}}He.prototype.bytesPerElement=6,qn("StructArrayLayout3i6",He);class ar extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,J,ht,At){let Bt=this.length;return this.resize(Bt+1),this.emplace(Bt,C,J,ht,At)}emplace(C,J,ht,At,Bt){let jt=4*C;return this.int16[jt+0]=J,this.int16[jt+1]=ht,this.int16[jt+2]=At,this.int16[jt+3]=Bt,C}}ar.prototype.bytesPerElement=8,qn("StructArrayLayout4i8",ar);class ir extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,J,ht,At,Bt,jt){let ae=this.length;return this.resize(ae+1),this.emplace(ae,C,J,ht,At,Bt,jt)}emplace(C,J,ht,At,Bt,jt,ae){let me=6*C;return this.int16[me+0]=J,this.int16[me+1]=ht,this.int16[me+2]=At,this.int16[me+3]=Bt,this.int16[me+4]=jt,this.int16[me+5]=ae,C}}ir.prototype.bytesPerElement=12,qn("StructArrayLayout2i4i12",ir);class zr extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,J,ht,At,Bt,jt){let ae=this.length;return this.resize(ae+1),this.emplace(ae,C,J,ht,At,Bt,jt)}emplace(C,J,ht,At,Bt,jt,ae){let me=4*C,Ie=8*C;return this.int16[me+0]=J,this.int16[me+1]=ht,this.uint8[Ie+4]=At,this.uint8[Ie+5]=Bt,this.uint8[Ie+6]=jt,this.uint8[Ie+7]=ae,C}}zr.prototype.bytesPerElement=8,qn("StructArrayLayout2i4ub8",zr);class Zr extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,J){let ht=this.length;return this.resize(ht+1),this.emplace(ht,C,J)}emplace(C,J,ht){let At=2*C;return this.float32[At+0]=J,this.float32[At+1]=ht,C}}Zr.prototype.bytesPerElement=8,qn("StructArrayLayout2f8",Zr);class Rt extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,J,ht,At,Bt,jt,ae,me,Ie,Ge){let Ke=this.length;return this.resize(Ke+1),this.emplace(Ke,C,J,ht,At,Bt,jt,ae,me,Ie,Ge)}emplace(C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke){let vr=10*C;return this.uint16[vr+0]=J,this.uint16[vr+1]=ht,this.uint16[vr+2]=At,this.uint16[vr+3]=Bt,this.uint16[vr+4]=jt,this.uint16[vr+5]=ae,this.uint16[vr+6]=me,this.uint16[vr+7]=Ie,this.uint16[vr+8]=Ge,this.uint16[vr+9]=Ke,C}}Rt.prototype.bytesPerElement=20,qn("StructArrayLayout10ui20",Rt);class Gt extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr){let Cr=this.length;return this.resize(Cr+1),this.emplace(Cr,C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr)}emplace(C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr,Cr){let Nr=12*C;return this.int16[Nr+0]=J,this.int16[Nr+1]=ht,this.int16[Nr+2]=At,this.int16[Nr+3]=Bt,this.uint16[Nr+4]=jt,this.uint16[Nr+5]=ae,this.uint16[Nr+6]=me,this.uint16[Nr+7]=Ie,this.int16[Nr+8]=Ge,this.int16[Nr+9]=Ke,this.int16[Nr+10]=vr,this.int16[Nr+11]=Cr,C}}Gt.prototype.bytesPerElement=24,qn("StructArrayLayout4i4ui4i24",Gt);class ne extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,J,ht){let At=this.length;return this.resize(At+1),this.emplace(At,C,J,ht)}emplace(C,J,ht,At){let Bt=3*C;return this.float32[Bt+0]=J,this.float32[Bt+1]=ht,this.float32[Bt+2]=At,C}}ne.prototype.bytesPerElement=12,qn("StructArrayLayout3f12",ne);class oe extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(C){let J=this.length;return this.resize(J+1),this.emplace(J,C)}emplace(C,J){return this.uint32[1*C+0]=J,C}}oe.prototype.bytesPerElement=4,qn("StructArrayLayout1ul4",oe);class be extends Pt{_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(C,J,ht,At,Bt,jt,ae,me,Ie){let Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,C,J,ht,At,Bt,jt,ae,me,Ie)}emplace(C,J,ht,At,Bt,jt,ae,me,Ie,Ge){let Ke=10*C,vr=5*C;return this.int16[Ke+0]=J,this.int16[Ke+1]=ht,this.int16[Ke+2]=At,this.int16[Ke+3]=Bt,this.int16[Ke+4]=jt,this.int16[Ke+5]=ae,this.uint32[vr+3]=me,this.uint16[Ke+8]=Ie,this.uint16[Ke+9]=Ge,C}}be.prototype.bytesPerElement=20,qn("StructArrayLayout6i1ul2ui20",be);class pe extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,J,ht,At,Bt,jt){let ae=this.length;return this.resize(ae+1),this.emplace(ae,C,J,ht,At,Bt,jt)}emplace(C,J,ht,At,Bt,jt,ae){let me=6*C;return this.int16[me+0]=J,this.int16[me+1]=ht,this.int16[me+2]=At,this.int16[me+3]=Bt,this.int16[me+4]=jt,this.int16[me+5]=ae,C}}pe.prototype.bytesPerElement=12,qn("StructArrayLayout2i2i2i12",pe);class Ae extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,J,ht,At,Bt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,C,J,ht,At,Bt)}emplace(C,J,ht,At,Bt,jt){let ae=4*C,me=8*C;return this.float32[ae+0]=J,this.float32[ae+1]=ht,this.float32[ae+2]=At,this.int16[me+6]=Bt,this.int16[me+7]=jt,C}}Ae.prototype.bytesPerElement=16,qn("StructArrayLayout2f1f2i16",Ae);class Xe extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,J,ht,At,Bt,jt){let ae=this.length;return this.resize(ae+1),this.emplace(ae,C,J,ht,At,Bt,jt)}emplace(C,J,ht,At,Bt,jt,ae){let me=16*C,Ie=4*C,Ge=8*C;return this.uint8[me+0]=J,this.uint8[me+1]=ht,this.float32[Ie+1]=At,this.float32[Ie+2]=Bt,this.int16[Ge+6]=jt,this.int16[Ge+7]=ae,C}}Xe.prototype.bytesPerElement=16,qn("StructArrayLayout2ub2f2i16",Xe);class nr extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,J,ht){let At=this.length;return this.resize(At+1),this.emplace(At,C,J,ht)}emplace(C,J,ht,At){let Bt=3*C;return this.uint16[Bt+0]=J,this.uint16[Bt+1]=ht,this.uint16[Bt+2]=At,C}}nr.prototype.bytesPerElement=6,qn("StructArrayLayout3ui6",nr);class or extends Pt{_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(C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr,Cr,Nr,$r,cn,Pn){let ua=this.length;return this.resize(ua+1),this.emplace(ua,C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr,Cr,Nr,$r,cn,Pn)}emplace(C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr,Cr,Nr,$r,cn,Pn,ua){let Un=24*C,Kn=12*C,Sa=48*C;return this.int16[Un+0]=J,this.int16[Un+1]=ht,this.uint16[Un+2]=At,this.uint16[Un+3]=Bt,this.uint32[Kn+2]=jt,this.uint32[Kn+3]=ae,this.uint32[Kn+4]=me,this.uint16[Un+10]=Ie,this.uint16[Un+11]=Ge,this.uint16[Un+12]=Ke,this.float32[Kn+7]=vr,this.float32[Kn+8]=Cr,this.uint8[Sa+36]=Nr,this.uint8[Sa+37]=$r,this.uint8[Sa+38]=cn,this.uint32[Kn+10]=Pn,this.int16[Un+22]=ua,C}}or.prototype.bytesPerElement=48,qn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",or);class Tr extends Pt{_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(C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr,Cr,Nr,$r,cn,Pn,ua,Un,Kn,Sa,Ya,Qi,Vo,Vi,zi,xo,so){let Ki=this.length;return this.resize(Ki+1),this.emplace(Ki,C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr,Cr,Nr,$r,cn,Pn,ua,Un,Kn,Sa,Ya,Qi,Vo,Vi,zi,xo,so)}emplace(C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr,Cr,Nr,$r,cn,Pn,ua,Un,Kn,Sa,Ya,Qi,Vo,Vi,zi,xo,so,Ki){let Oa=32*C,To=16*C;return this.int16[Oa+0]=J,this.int16[Oa+1]=ht,this.int16[Oa+2]=At,this.int16[Oa+3]=Bt,this.int16[Oa+4]=jt,this.int16[Oa+5]=ae,this.int16[Oa+6]=me,this.int16[Oa+7]=Ie,this.uint16[Oa+8]=Ge,this.uint16[Oa+9]=Ke,this.uint16[Oa+10]=vr,this.uint16[Oa+11]=Cr,this.uint16[Oa+12]=Nr,this.uint16[Oa+13]=$r,this.uint16[Oa+14]=cn,this.uint16[Oa+15]=Pn,this.uint16[Oa+16]=ua,this.uint16[Oa+17]=Un,this.uint16[Oa+18]=Kn,this.uint16[Oa+19]=Sa,this.uint16[Oa+20]=Ya,this.uint16[Oa+21]=Qi,this.uint16[Oa+22]=Vo,this.uint32[To+12]=Vi,this.float32[To+13]=zi,this.float32[To+14]=xo,this.uint16[Oa+30]=so,this.uint16[Oa+31]=Ki,C}}Tr.prototype.bytesPerElement=64,qn("StructArrayLayout8i15ui1ul2f2ui64",Tr);class Rr extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C){let J=this.length;return this.resize(J+1),this.emplace(J,C)}emplace(C,J){return this.float32[1*C+0]=J,C}}Rr.prototype.bytesPerElement=4,qn("StructArrayLayout1f4",Rr);class Qr extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,J,ht){let At=this.length;return this.resize(At+1),this.emplace(At,C,J,ht)}emplace(C,J,ht,At){let Bt=3*C;return this.uint16[6*C+0]=J,this.float32[Bt+1]=ht,this.float32[Bt+2]=At,C}}Qr.prototype.bytesPerElement=12,qn("StructArrayLayout1ui2f12",Qr);class nn extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,J,ht){let At=this.length;return this.resize(At+1),this.emplace(At,C,J,ht)}emplace(C,J,ht,At){let Bt=4*C;return this.uint32[2*C+0]=J,this.uint16[Bt+2]=ht,this.uint16[Bt+3]=At,C}}nn.prototype.bytesPerElement=8,qn("StructArrayLayout1ul2ui8",nn);class mn extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,J){let ht=this.length;return this.resize(ht+1),this.emplace(ht,C,J)}emplace(C,J,ht){let At=2*C;return this.uint16[At+0]=J,this.uint16[At+1]=ht,C}}mn.prototype.bytesPerElement=4,qn("StructArrayLayout2ui4",mn);class zn extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C){let J=this.length;return this.resize(J+1),this.emplace(J,C)}emplace(C,J){return this.uint16[1*C+0]=J,C}}zn.prototype.bytesPerElement=2,qn("StructArrayLayout1ui2",zn);class na extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,J,ht,At){let Bt=this.length;return this.resize(Bt+1),this.emplace(Bt,C,J,ht,At)}emplace(C,J,ht,At,Bt){let jt=4*C;return this.float32[jt+0]=J,this.float32[jt+1]=ht,this.float32[jt+2]=At,this.float32[jt+3]=Bt,C}}na.prototype.bytesPerElement=16,qn("StructArrayLayout4f16",na);class Yn extends Tt{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 o(this.anchorPointX,this.anchorPointY)}}Yn.prototype.size=20;class la extends be{get(C){return new Yn(this,C)}}qn("CollisionBoxArray",la);class Na extends Tt{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(C){this._structArray.uint8[this._pos1+37]=C}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(C){this._structArray.uint8[this._pos1+38]=C}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(C){this._structArray.uint32[this._pos4+10]=C}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Na.prototype.size=48;class li extends or{get(C){return new Na(this,C)}}qn("PlacedSymbolArray",li);class Ka extends Tt{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(C){this._structArray.uint32[this._pos4+12]=C}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Ka.prototype.size=64;class Gi extends Tr{get(C){return new Ka(this,C)}}qn("SymbolInstanceArray",Gi);class jo extends Rr{getoffsetX(C){return this.float32[1*C+0]}}qn("GlyphOffsetArray",jo);class Uo extends He{getx(C){return this.int16[3*C+0]}gety(C){return this.int16[3*C+1]}gettileUnitDistanceFromAnchor(C){return this.int16[3*C+2]}}qn("SymbolLineVertexArray",Uo);class ho extends Tt{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}ho.prototype.size=12;class Go extends Qr{get(C){return new ho(this,C)}}qn("TextAnchorOffsetArray",Go);class js extends Tt{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]}}js.prototype.size=8;class Is extends nn{get(C){return new js(this,C)}}qn("FeatureIndexArray",Is);class bo extends Ee{}class wo extends Ee{}class nl extends Ee{}class dl extends ir{}class lu extends zr{}class mt extends Zr{}class St extends Rt{}class Xt extends Gt{}class se extends ne{}class fe extends oe{}class ve extends pe{}class De extends Xe{}class Ce extends nr{}class Qe extends mn{}let Mr=ie([{name:"a_pos",components:2,type:"Int16"}],4),{members:br}=Mr;class jr{constructor(C=[]){this.segments=C}prepareSegment(C,J,ht,At){let Bt=this.segments[this.segments.length-1];return C>jr.MAX_VERTEX_ARRAY_LENGTH&&_(`Max vertices per segment is ${jr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${C}`),(!Bt||Bt.vertexLength+C>jr.MAX_VERTEX_ARRAY_LENGTH||Bt.sortKey!==At)&&(Bt={vertexOffset:J.length,primitiveOffset:ht.length,vertexLength:0,primitiveLength:0},At!==void 0&&(Bt.sortKey=At),this.segments.push(Bt)),Bt}get(){return this.segments}destroy(){for(let C of this.segments)for(let J in C.vaos)C.vaos[J].destroy()}static simpleSegment(C,J,ht,At){return new jr([{vertexOffset:C,primitiveOffset:J,vertexLength:ht,primitiveLength:At,vaos:{},sortKey:0}])}}function Yr(U,C){return 256*(U=b(Math.floor(U),0,255))+b(Math.floor(C),0,255)}jr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,qn("SegmentVector",jr);let tn=ie([{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 Rn={exports:{}},sn={exports:{}};sn.exports=function(U,C){var J,ht,At,Bt,jt,ae,me,Ie;for(ht=U.length-(J=3&U.length),At=C,jt=3432918353,ae=461845907,Ie=0;Ie<ht;)me=255&U.charCodeAt(Ie)|(255&U.charCodeAt(++Ie))<<8|(255&U.charCodeAt(++Ie))<<16|(255&U.charCodeAt(++Ie))<<24,++Ie,At=27492+(65535&(Bt=5*(65535&(At=(At^=me=(65535&(me=(me=(65535&me)*jt+(((me>>>16)*jt&65535)<<16)&4294967295)<<15|me>>>17))*ae+(((me>>>16)*ae&65535)<<16)&4294967295)<<13|At>>>19))+((5*(At>>>16)&65535)<<16)&4294967295))+((58964+(Bt>>>16)&65535)<<16);switch(me=0,J){case 3:me^=(255&U.charCodeAt(Ie+2))<<16;case 2:me^=(255&U.charCodeAt(Ie+1))<<8;case 1:At^=me=(65535&(me=(me=(65535&(me^=255&U.charCodeAt(Ie)))*jt+(((me>>>16)*jt&65535)<<16)&4294967295)<<15|me>>>17))*ae+(((me>>>16)*ae&65535)<<16)&4294967295}return At^=U.length,At=2246822507*(65535&(At^=At>>>16))+((2246822507*(At>>>16)&65535)<<16)&4294967295,At=3266489909*(65535&(At^=At>>>13))+((3266489909*(At>>>16)&65535)<<16)&4294967295,(At^=At>>>16)>>>0};var Mn=sn.exports,In={exports:{}};In.exports=function(U,C){for(var J,ht=U.length,At=C^ht,Bt=0;ht>=4;)J=1540483477*(65535&(J=255&U.charCodeAt(Bt)|(255&U.charCodeAt(++Bt))<<8|(255&U.charCodeAt(++Bt))<<16|(255&U.charCodeAt(++Bt))<<24))+((1540483477*(J>>>16)&65535)<<16),At=1540483477*(65535&At)+((1540483477*(At>>>16)&65535)<<16)^(J=1540483477*(65535&(J^=J>>>24))+((1540483477*(J>>>16)&65535)<<16)),ht-=4,++Bt;switch(ht){case 3:At^=(255&U.charCodeAt(Bt+2))<<16;case 2:At^=(255&U.charCodeAt(Bt+1))<<8;case 1:At=1540483477*(65535&(At^=255&U.charCodeAt(Bt)))+((1540483477*(At>>>16)&65535)<<16)}return At=1540483477*(65535&(At^=At>>>13))+((1540483477*(At>>>16)&65535)<<16),(At^=At>>>15)>>>0};var Dn=Mn,jn=In.exports;Rn.exports=Dn,Rn.exports.murmur3=Dn,Rn.exports.murmur2=jn;var xn=r(Rn.exports);class _a{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(C,J,ht,At){this.ids.push(La(C)),this.positions.push(J,ht,At)}getPositions(C){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let J=La(C),ht=0,At=this.ids.length-1;for(;ht<At;){let jt=ht+At>>1;this.ids[jt]>=J?At=jt:ht=jt+1}let Bt=[];for(;this.ids[ht]===J;)Bt.push({index:this.positions[3*ht],start:this.positions[3*ht+1],end:this.positions[3*ht+2]}),ht++;return Bt}static serialize(C,J){let ht=new Float64Array(C.ids),At=new Uint32Array(C.positions);return $a(ht,At,0,ht.length-1),J&&J.push(ht.buffer,At.buffer),{ids:ht,positions:At}}static deserialize(C){let J=new _a;return J.ids=C.ids,J.positions=C.positions,J.indexed=!0,J}}function La(U){let C=+U;return!isNaN(C)&&C<=Number.MAX_SAFE_INTEGER?C:xn(String(U))}function $a(U,C,J,ht){for(;J<ht;){let At=U[J+ht>>1],Bt=J-1,jt=ht+1;for(;;){do Bt++;while(U[Bt]<At);do jt--;while(U[jt]>At);if(Bt>=jt)break;ti(U,Bt,jt),ti(C,3*Bt,3*jt),ti(C,3*Bt+1,3*jt+1),ti(C,3*Bt+2,3*jt+2)}jt-J<ht-jt?($a(U,C,J,jt),J=jt+1):($a(U,C,jt+1,ht),ht=jt)}}function ti(U,C,J){let ht=U[C];U[C]=U[J],U[J]=ht}qn("FeaturePositionMap",_a);class ii{constructor(C,J){this.gl=C.gl,this.location=J}}class di extends ii{constructor(C,J){super(C,J),this.current=0}set(C){this.current!==C&&(this.current=C,this.gl.uniform1f(this.location,C))}}class Io extends ii{constructor(C,J){super(C,J),this.current=[0,0,0,0]}set(C){C[0]===this.current[0]&&C[1]===this.current[1]&&C[2]===this.current[2]&&C[3]===this.current[3]||(this.current=C,this.gl.uniform4f(this.location,C[0],C[1],C[2],C[3]))}}class gi extends ii{constructor(C,J){super(C,J),this.current=Ne.transparent}set(C){C.r===this.current.r&&C.g===this.current.g&&C.b===this.current.b&&C.a===this.current.a||(this.current=C,this.gl.uniform4f(this.location,C.r,C.g,C.b,C.a))}}let Ji=new Float32Array(16);function qo(U){return[Yr(255*U.r,255*U.g),Yr(255*U.b,255*U.a)]}class Ys{constructor(C,J,ht){this.value=C,this.uniformNames=J.map(At=>`u_${At}`),this.type=ht}setUniform(C,J,ht){C.set(ht.constantOr(this.value))}getBinding(C,J,ht){return this.type==="color"?new gi(C,J):new di(C,J)}}class _s{constructor(C,J){this.uniformNames=J.map(ht=>`u_${ht}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(C,J){this.pixelRatioFrom=J.pixelRatio,this.pixelRatioTo=C.pixelRatio,this.patternFrom=J.tlbr,this.patternTo=C.tlbr}setUniform(C,J,ht,At){let Bt=At==="u_pattern_to"?this.patternTo:At==="u_pattern_from"?this.patternFrom:At==="u_pixel_ratio_to"?this.pixelRatioTo:At==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Bt&&C.set(Bt)}getBinding(C,J,ht){return ht.substr(0,9)==="u_pattern"?new Io(C,J):new di(C,J)}}class Ja{constructor(C,J,ht,At){this.expression=C,this.type=ht,this.maxValue=0,this.paintVertexAttributes=J.map(Bt=>({name:`a_${Bt}`,type:"Float32",components:ht==="color"?2:1,offset:0})),this.paintVertexArray=new At}populatePaintArray(C,J,ht,At,Bt){let jt=this.paintVertexArray.length,ae=this.expression.evaluate(new Qo(0),J,{},At,[],Bt);this.paintVertexArray.resize(C),this._setPaintValue(jt,C,ae)}updatePaintArray(C,J,ht,At){let Bt=this.expression.evaluate({zoom:0},ht,At);this._setPaintValue(C,J,Bt)}_setPaintValue(C,J,ht){if(this.type==="color"){let At=qo(ht);for(let Bt=C;Bt<J;Bt++)this.paintVertexArray.emplace(Bt,At[0],At[1])}else{for(let At=C;At<J;At++)this.paintVertexArray.emplace(At,ht);this.maxValue=Math.max(this.maxValue,Math.abs(ht))}}upload(C){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=C.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class yo{constructor(C,J,ht,At,Bt,jt){this.expression=C,this.uniformNames=J.map(ae=>`u_${ae}_t`),this.type=ht,this.useIntegerZoom=At,this.zoom=Bt,this.maxValue=0,this.paintVertexAttributes=J.map(ae=>({name:`a_${ae}`,type:"Float32",components:ht==="color"?4:2,offset:0})),this.paintVertexArray=new jt}populatePaintArray(C,J,ht,At,Bt){let jt=this.expression.evaluate(new Qo(this.zoom),J,{},At,[],Bt),ae=this.expression.evaluate(new Qo(this.zoom+1),J,{},At,[],Bt),me=this.paintVertexArray.length;this.paintVertexArray.resize(C),this._setPaintValue(me,C,jt,ae)}updatePaintArray(C,J,ht,At){let Bt=this.expression.evaluate({zoom:this.zoom},ht,At),jt=this.expression.evaluate({zoom:this.zoom+1},ht,At);this._setPaintValue(C,J,Bt,jt)}_setPaintValue(C,J,ht,At){if(this.type==="color"){let Bt=qo(ht),jt=qo(At);for(let ae=C;ae<J;ae++)this.paintVertexArray.emplace(ae,Bt[0],Bt[1],jt[0],jt[1])}else{for(let Bt=C;Bt<J;Bt++)this.paintVertexArray.emplace(Bt,ht,At);this.maxValue=Math.max(this.maxValue,Math.abs(ht),Math.abs(At))}}upload(C){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=C.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(C,J){let ht=this.useIntegerZoom?Math.floor(J.zoom):J.zoom,At=b(this.expression.interpolationFactor(ht,this.zoom,this.zoom+1),0,1);C.set(At)}getBinding(C,J,ht){return new di(C,J)}}class Lo{constructor(C,J,ht,At,Bt,jt){this.expression=C,this.type=J,this.useIntegerZoom=ht,this.zoom=At,this.layerId=jt,this.zoomInPaintVertexArray=new Bt,this.zoomOutPaintVertexArray=new Bt}populatePaintArray(C,J,ht){let At=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(C),this.zoomOutPaintVertexArray.resize(C),this._setPaintValues(At,C,J.patterns&&J.patterns[this.layerId],ht)}updatePaintArray(C,J,ht,At,Bt){this._setPaintValues(C,J,ht.patterns&&ht.patterns[this.layerId],Bt)}_setPaintValues(C,J,ht,At){if(!At||!ht)return;let{min:Bt,mid:jt,max:ae}=ht,me=At[Bt],Ie=At[jt],Ge=At[ae];if(me&&Ie&&Ge)for(let Ke=C;Ke<J;Ke++)this.zoomInPaintVertexArray.emplace(Ke,Ie.tl[0],Ie.tl[1],Ie.br[0],Ie.br[1],me.tl[0],me.tl[1],me.br[0],me.br[1],Ie.pixelRatio,me.pixelRatio),this.zoomOutPaintVertexArray.emplace(Ke,Ie.tl[0],Ie.tl[1],Ie.br[0],Ie.br[1],Ge.tl[0],Ge.tl[1],Ge.br[0],Ge.br[1],Ie.pixelRatio,Ge.pixelRatio)}upload(C){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=C.createVertexBuffer(this.zoomInPaintVertexArray,tn.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=C.createVertexBuffer(this.zoomOutPaintVertexArray,tn.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class bs{constructor(C,J,ht){this.binders={},this._buffers=[];let At=[];for(let Bt in C.paint._values){if(!ht(Bt))continue;let jt=C.paint.get(Bt);if(!(jt instanceof $s&&Gl(jt.property.specification)))continue;let ae=eu(Bt,C.type),me=jt.value,Ie=jt.property.specification.type,Ge=jt.property.useIntegerZoom,Ke=jt.property.specification["property-type"],vr=Ke==="cross-faded"||Ke==="cross-faded-data-driven";if(me.kind==="constant")this.binders[Bt]=vr?new _s(me.value,ae):new Ys(me.value,ae,Ie),At.push(`/u_${Bt}`);else if(me.kind==="source"||vr){let Cr=Yo(Bt,Ie,"source");this.binders[Bt]=vr?new Lo(me,Ie,Ge,J,Cr,C.id):new Ja(me,ae,Ie,Cr),At.push(`/a_${Bt}`)}else{let Cr=Yo(Bt,Ie,"composite");this.binders[Bt]=new yo(me,ae,Ie,Ge,J,Cr),At.push(`/z_${Bt}`)}}this.cacheKey=At.sort().join("")}getMaxValue(C){let J=this.binders[C];return J instanceof Ja||J instanceof yo?J.maxValue:0}populatePaintArrays(C,J,ht,At,Bt){for(let jt in this.binders){let ae=this.binders[jt];(ae instanceof Ja||ae instanceof yo||ae instanceof Lo)&&ae.populatePaintArray(C,J,ht,At,Bt)}}setConstantPatternPositions(C,J){for(let ht in this.binders){let At=this.binders[ht];At instanceof _s&&At.setConstantPatternPositions(C,J)}}updatePaintArrays(C,J,ht,At,Bt){let jt=!1;for(let ae in C){let me=J.getPositions(ae);for(let Ie of me){let Ge=ht.feature(Ie.index);for(let Ke in this.binders){let vr=this.binders[Ke];if((vr instanceof Ja||vr instanceof yo||vr instanceof Lo)&&vr.expression.isStateDependent===!0){let Cr=At.paint.get(Ke);vr.expression=Cr.value,vr.updatePaintArray(Ie.start,Ie.end,Ge,C[ae],Bt),jt=!0}}}}return jt}defines(){let C=[];for(let J in this.binders){let ht=this.binders[J];(ht instanceof Ys||ht instanceof _s)&&C.push(...ht.uniformNames.map(At=>`#define HAS_UNIFORM_${At}`))}return C}getBinderAttributes(){let C=[];for(let J in this.binders){let ht=this.binders[J];if(ht instanceof Ja||ht instanceof yo)for(let At=0;At<ht.paintVertexAttributes.length;At++)C.push(ht.paintVertexAttributes[At].name);else if(ht instanceof Lo)for(let At=0;At<tn.members.length;At++)C.push(tn.members[At].name)}return C}getBinderUniforms(){let C=[];for(let J in this.binders){let ht=this.binders[J];if(ht instanceof Ys||ht instanceof _s||ht instanceof yo)for(let At of ht.uniformNames)C.push(At)}return C}getPaintVertexBuffers(){return this._buffers}getUniforms(C,J){let ht=[];for(let At in this.binders){let Bt=this.binders[At];if(Bt instanceof Ys||Bt instanceof _s||Bt instanceof yo){for(let jt of Bt.uniformNames)if(J[jt]){let ae=Bt.getBinding(C,J[jt],jt);ht.push({name:jt,property:At,binding:ae})}}}return ht}setUniforms(C,J,ht,At){for(let{name:Bt,property:jt,binding:ae}of J)this.binders[jt].setUniform(ae,At,ht.get(jt),Bt)}updatePaintBuffers(C){this._buffers=[];for(let J in this.binders){let ht=this.binders[J];if(C&&ht instanceof Lo){let At=C.fromScale===2?ht.zoomInPaintVertexBuffer:ht.zoomOutPaintVertexBuffer;At&&this._buffers.push(At)}else(ht instanceof Ja||ht instanceof yo)&&ht.paintVertexBuffer&&this._buffers.push(ht.paintVertexBuffer)}}upload(C){for(let J in this.binders){let ht=this.binders[J];(ht instanceof Ja||ht instanceof yo||ht instanceof Lo)&&ht.upload(C)}this.updatePaintBuffers()}destroy(){for(let C in this.binders){let J=this.binders[C];(J instanceof Ja||J instanceof yo||J instanceof Lo)&&J.destroy()}}}class us{constructor(C,J,ht=()=>!0){this.programConfigurations={};for(let At of C)this.programConfigurations[At.id]=new bs(At,J,ht);this.needsUpload=!1,this._featureMap=new _a,this._bufferOffset=0}populatePaintArrays(C,J,ht,At,Bt,jt){for(let ae in this.programConfigurations)this.programConfigurations[ae].populatePaintArrays(C,J,At,Bt,jt);J.id!==void 0&&this._featureMap.add(J.id,ht,this._bufferOffset,C),this._bufferOffset=C,this.needsUpload=!0}updatePaintArrays(C,J,ht,At){for(let Bt of ht)this.needsUpload=this.programConfigurations[Bt.id].updatePaintArrays(C,this._featureMap,J,Bt,At)||this.needsUpload}get(C){return this.programConfigurations[C]}upload(C){if(this.needsUpload){for(let J in this.programConfigurations)this.programConfigurations[J].upload(C);this.needsUpload=!1}}destroy(){for(let C in this.programConfigurations)this.programConfigurations[C].destroy()}}function eu(U,C){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"]}[U]||[U.replace(`${C}-`,"").replace(/-/g,"_")]}function Yo(U,C,J){let ht={color:{source:Zr,composite:na},number:{source:Rr,composite:Zr}},At=function(Bt){return{"line-pattern":{source:St,composite:St},"fill-pattern":{source:St,composite:St},"fill-extrusion-pattern":{source:St,composite:St}}[Bt]}(U);return At&&At[J]||ht[C][J]}qn("ConstantBinder",Ys),qn("CrossFadedConstantBinder",_s),qn("SourceExpressionBinder",Ja),qn("CrossFadedCompositeBinder",Lo),qn("CompositeExpressionBinder",yo),qn("ProgramConfiguration",bs,{omit:["_buffers"]}),qn("ProgramConfigurationSet",us);let gs=8192,wu=Math.pow(2,14)-1,sr=-wu-1;function fn(U){let C=gs/U.extent,J=U.loadGeometry();for(let ht=0;ht<J.length;ht++){let At=J[ht];for(let Bt=0;Bt<At.length;Bt++){let jt=At[Bt],ae=Math.round(jt.x*C),me=Math.round(jt.y*C);jt.x=b(ae,sr,wu),jt.y=b(me,sr,wu),(ae<jt.x||ae>jt.x+1||me<jt.y||me>jt.y+1)&&_("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return J}function gn(U,C){return{type:U.type,id:U.id,properties:U.properties,geometry:C?fn(U):[]}}function ha(U,C,J,ht,At){U.emplaceBack(2*C+(ht+1)/2,2*J+(At+1)/2)}class Ta{constructor(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(J=>J.id),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new wo,this.indexArray=new Ce,this.segments=new jr,this.programConfigurations=new us(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(J=>J.isStateDependent()).map(J=>J.id)}populate(C,J,ht){let At=this.layers[0],Bt=[],jt=null,ae=!1;At.type==="circle"&&(jt=At.layout.get("circle-sort-key"),ae=!jt.isConstant());for(let{feature:me,id:Ie,index:Ge,sourceLayerIndex:Ke}of C){let vr=this.layers[0]._featureFilter.needGeometry,Cr=gn(me,vr);if(!this.layers[0]._featureFilter.filter(new Qo(this.zoom),Cr,ht))continue;let Nr=ae?jt.evaluate(Cr,{},ht):void 0,$r={id:Ie,properties:me.properties,type:me.type,sourceLayerIndex:Ke,index:Ge,geometry:vr?Cr.geometry:fn(me),patterns:{},sortKey:Nr};Bt.push($r)}ae&&Bt.sort((me,Ie)=>me.sortKey-Ie.sortKey);for(let me of Bt){let{geometry:Ie,index:Ge,sourceLayerIndex:Ke}=me,vr=C[Ge].feature;this.addFeature(me,Ie,Ge,ht),J.featureIndex.insert(vr,Ie,Ge,Ke,this.index)}}update(C,J,ht){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,J,this.stateDependentLayers,ht)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,br),this.indexBuffer=C.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(C),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(C,J,ht,At){for(let Bt of J)for(let jt of Bt){let ae=jt.x,me=jt.y;if(ae<0||ae>=gs||me<0||me>=gs)continue;let Ie=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),Ge=Ie.vertexLength;ha(this.layoutVertexArray,ae,me,-1,-1),ha(this.layoutVertexArray,ae,me,1,-1),ha(this.layoutVertexArray,ae,me,1,1),ha(this.layoutVertexArray,ae,me,-1,1),this.indexArray.emplaceBack(Ge,Ge+1,Ge+2),this.indexArray.emplaceBack(Ge,Ge+3,Ge+2),Ie.vertexLength+=4,Ie.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ht,{},At)}}function ka(U,C){for(let J=0;J<U.length;J++)if(Ca(C,U[J]))return!0;for(let J=0;J<C.length;J++)if(Ca(U,C[J]))return!0;return!!Ra(U,C)}function Cn(U,C,J){return!!Ca(U,C)||!!Ii(C,U,J)}function ia(U,C){if(U.length===1)return Ha(C,U[0]);for(let J=0;J<C.length;J++){let ht=C[J];for(let At=0;At<ht.length;At++)if(Ca(U,ht[At]))return!0}for(let J=0;J<U.length;J++)if(Ha(C,U[J]))return!0;for(let J=0;J<C.length;J++)if(Ra(U,C[J]))return!0;return!1}function qa(U,C,J){if(U.length>1){if(Ra(U,C))return!0;for(let ht=0;ht<C.length;ht++)if(Ii(C[ht],U,J))return!0}for(let ht=0;ht<U.length;ht++)if(Ii(U[ht],C,J))return!0;return!1}function Ra(U,C){if(U.length===0||C.length===0)return!1;for(let J=0;J<U.length-1;J++){let ht=U[J],At=U[J+1];for(let Bt=0;Bt<C.length-1;Bt++)if(ei(ht,At,C[Bt],C[Bt+1]))return!0}return!1}function ei(U,C,J,ht){return D(U,J,ht)!==D(C,J,ht)&&D(U,C,J)!==D(U,C,ht)}function Ii(U,C,J){let ht=J*J;if(C.length===1)return U.distSqr(C[0])<ht;for(let At=1;At<C.length;At++)if(wi(U,C[At-1],C[At])<ht)return!0;return!1}function wi(U,C,J){let ht=C.distSqr(J);if(ht===0)return U.distSqr(C);let At=((U.x-C.x)*(J.x-C.x)+(U.y-C.y)*(J.y-C.y))/ht;return U.distSqr(At<0?C:At>1?J:J.sub(C)._mult(At)._add(C))}function Ha(U,C){let J,ht,At,Bt=!1;for(let jt=0;jt<U.length;jt++){J=U[jt];for(let ae=0,me=J.length-1;ae<J.length;me=ae++)ht=J[ae],At=J[me],ht.y>C.y!=At.y>C.y&&C.x<(At.x-ht.x)*(C.y-ht.y)/(At.y-ht.y)+ht.x&&(Bt=!Bt)}return Bt}function Ca(U,C){let J=!1;for(let ht=0,At=U.length-1;ht<U.length;At=ht++){let Bt=U[ht],jt=U[At];Bt.y>C.y!=jt.y>C.y&&C.x<(jt.x-Bt.x)*(C.y-Bt.y)/(jt.y-Bt.y)+Bt.x&&(J=!J)}return J}function Wn(U,C,J){let ht=J[0],At=J[2];if(U.x<ht.x&&C.x<ht.x||U.x>At.x&&C.x>At.x||U.y<ht.y&&C.y<ht.y||U.y>At.y&&C.y>At.y)return!1;let Bt=D(U,C,J[0]);return Bt!==D(U,C,J[1])||Bt!==D(U,C,J[2])||Bt!==D(U,C,J[3])}function fa(U,C,J){let ht=C.paint.get(U).value;return ht.kind==="constant"?ht.value:J.programConfigurations.get(C.id).getMaxValue(U)}function Ga(U){return Math.sqrt(U[0]*U[0]+U[1]*U[1])}function Aa(U,C,J,ht,At){if(!C[0]&&!C[1])return U;let Bt=o.convert(C)._mult(At);J==="viewport"&&Bt._rotate(-ht);let jt=[];for(let ae=0;ae<U.length;ae++)jt.push(U[ae].sub(Bt));return jt}let xa,Ti;qn("CircleBucket",Ta,{omit:["layers"]});var fi={get paint(){return Ti=Ti||new Lt({"circle-radius":new oo(it.paint_circle["circle-radius"]),"circle-color":new oo(it.paint_circle["circle-color"]),"circle-blur":new oo(it.paint_circle["circle-blur"]),"circle-opacity":new oo(it.paint_circle["circle-opacity"]),"circle-translate":new Ri(it.paint_circle["circle-translate"]),"circle-translate-anchor":new Ri(it.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ri(it.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ri(it.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new oo(it.paint_circle["circle-stroke-width"]),"circle-stroke-color":new oo(it.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new oo(it.paint_circle["circle-stroke-opacity"])})},get layout(){return xa=xa||new Lt({"circle-sort-key":new oo(it.layout_circle["circle-sort-key"])})}},_i=1e-6,Ia=typeof Float32Array<"u"?Float32Array:Array;function Ma(U){return U[0]=1,U[1]=0,U[2]=0,U[3]=0,U[4]=0,U[5]=1,U[6]=0,U[7]=0,U[8]=0,U[9]=0,U[10]=1,U[11]=0,U[12]=0,U[13]=0,U[14]=0,U[15]=1,U}function ki(U,C,J){var ht=C[0],At=C[1],Bt=C[2],jt=C[3],ae=C[4],me=C[5],Ie=C[6],Ge=C[7],Ke=C[8],vr=C[9],Cr=C[10],Nr=C[11],$r=C[12],cn=C[13],Pn=C[14],ua=C[15],Un=J[0],Kn=J[1],Sa=J[2],Ya=J[3];return U[0]=Un*ht+Kn*ae+Sa*Ke+Ya*$r,U[1]=Un*At+Kn*me+Sa*vr+Ya*cn,U[2]=Un*Bt+Kn*Ie+Sa*Cr+Ya*Pn,U[3]=Un*jt+Kn*Ge+Sa*Nr+Ya*ua,U[4]=(Un=J[4])*ht+(Kn=J[5])*ae+(Sa=J[6])*Ke+(Ya=J[7])*$r,U[5]=Un*At+Kn*me+Sa*vr+Ya*cn,U[6]=Un*Bt+Kn*Ie+Sa*Cr+Ya*Pn,U[7]=Un*jt+Kn*Ge+Sa*Nr+Ya*ua,U[8]=(Un=J[8])*ht+(Kn=J[9])*ae+(Sa=J[10])*Ke+(Ya=J[11])*$r,U[9]=Un*At+Kn*me+Sa*vr+Ya*cn,U[10]=Un*Bt+Kn*Ie+Sa*Cr+Ya*Pn,U[11]=Un*jt+Kn*Ge+Sa*Nr+Ya*ua,U[12]=(Un=J[12])*ht+(Kn=J[13])*ae+(Sa=J[14])*Ke+(Ya=J[15])*$r,U[13]=Un*At+Kn*me+Sa*vr+Ya*cn,U[14]=Un*Bt+Kn*Ie+Sa*Cr+Ya*Pn,U[15]=Un*jt+Kn*Ge+Sa*Nr+Ya*ua,U}Math.hypot||(Math.hypot=function(){for(var U=0,C=arguments.length;C--;)U+=arguments[C]*arguments[C];return Math.sqrt(U)});var hi,Wa=ki;function Qa(U,C,J){var ht=C[0],At=C[1],Bt=C[2],jt=C[3];return U[0]=J[0]*ht+J[4]*At+J[8]*Bt+J[12]*jt,U[1]=J[1]*ht+J[5]*At+J[9]*Bt+J[13]*jt,U[2]=J[2]*ht+J[6]*At+J[10]*Bt+J[14]*jt,U[3]=J[3]*ht+J[7]*At+J[11]*Bt+J[15]*jt,U}hi=new Ia(4),Ia!=Float32Array&&(hi[0]=0,hi[1]=0,hi[2]=0,hi[3]=0);class xi extends at{constructor(C){super(C,fi)}createBucket(C){return new Ta(C)}queryRadius(C){let J=C;return fa("circle-radius",this,J)+fa("circle-stroke-width",this,J)+Ga(this.paint.get("circle-translate"))}queryIntersectsFeature(C,J,ht,At,Bt,jt,ae,me){let Ie=Aa(C,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),jt.angle,ae),Ge=this.paint.get("circle-radius").evaluate(J,ht)+this.paint.get("circle-stroke-width").evaluate(J,ht),Ke=this.paint.get("circle-pitch-alignment")==="map",vr=Ke?Ie:function(Nr,$r){return Nr.map(cn=>Wo(cn,$r))}(Ie,me),Cr=Ke?Ge*ae:Ge;for(let Nr of At)for(let $r of Nr){let cn=Ke?$r:Wo($r,me),Pn=Cr,ua=Qa([],[$r.x,$r.y,0,1],me);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Pn*=ua[3]/jt.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Pn*=jt.cameraToCenterDistance/ua[3]),Cn(vr,cn,Pn))return!0}return!1}}function Wo(U,C){let J=Qa([],[U.x,U.y,0,1],C);return new o(J[0]/J[3],J[1]/J[3])}class zo extends Ta{}let mi;qn("HeatmapBucket",zo,{omit:["layers"]});var Li={get paint(){return mi=mi||new Lt({"heatmap-radius":new oo(it.paint_heatmap["heatmap-radius"]),"heatmap-weight":new oo(it.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ri(it.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Th(it.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ri(it.paint_heatmap["heatmap-opacity"])})}};function mo(U,{width:C,height:J},ht,At){if(At){if(At instanceof Uint8ClampedArray)At=new Uint8Array(At.buffer);else if(At.length!==C*J*ht)throw new RangeError(`mismatched image size. expected: ${At.length} but got: ${C*J*ht}`)}else At=new Uint8Array(C*J*ht);return U.width=C,U.height=J,U.data=At,U}function Oo(U,{width:C,height:J},ht){if(C===U.width&&J===U.height)return;let At=mo({},{width:C,height:J},ht);ss(U,At,{x:0,y:0},{x:0,y:0},{width:Math.min(U.width,C),height:Math.min(U.height,J)},ht),U.width=C,U.height=J,U.data=At.data}function ss(U,C,J,ht,At,Bt){if(At.width===0||At.height===0)return C;if(At.width>U.width||At.height>U.height||J.x>U.width-At.width||J.y>U.height-At.height)throw new RangeError("out of range source coordinates for image copy");if(At.width>C.width||At.height>C.height||ht.x>C.width-At.width||ht.y>C.height-At.height)throw new RangeError("out of range destination coordinates for image copy");let jt=U.data,ae=C.data;if(jt===ae)throw new Error("srcData equals dstData, so image is already copied");for(let me=0;me<At.height;me++){let Ie=((J.y+me)*U.width+J.x)*Bt,Ge=((ht.y+me)*C.width+ht.x)*Bt;for(let Ke=0;Ke<At.width*Bt;Ke++)ae[Ge+Ke]=jt[Ie+Ke]}return C}class ml{constructor(C,J){mo(this,C,1,J)}resize(C){Oo(this,C,1)}clone(){return new ml({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(C,J,ht,At,Bt){ss(C,J,ht,At,Bt,1)}}class Gs{constructor(C,J){mo(this,C,4,J)}resize(C){Oo(this,C,4)}replace(C,J){J?this.data.set(C):this.data=C instanceof Uint8ClampedArray?new Uint8Array(C.buffer):C}clone(){return new Gs({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(C,J,ht,At,Bt){ss(C,J,ht,At,Bt,4)}}function ws(U){let C={},J=U.resolution||256,ht=U.clips?U.clips.length:1,At=U.image||new Gs({width:J,height:ht});if(Math.log(J)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${J}`);let Bt=(jt,ae,me)=>{C[U.evaluationKey]=me;let Ie=U.expression.evaluate(C);At.data[jt+ae+0]=Math.floor(255*Ie.r/Ie.a),At.data[jt+ae+1]=Math.floor(255*Ie.g/Ie.a),At.data[jt+ae+2]=Math.floor(255*Ie.b/Ie.a),At.data[jt+ae+3]=Math.floor(255*Ie.a)};if(U.clips)for(let jt=0,ae=0;jt<ht;++jt,ae+=4*J)for(let me=0,Ie=0;me<J;me++,Ie+=4){let Ge=me/(J-1),{start:Ke,end:vr}=U.clips[jt];Bt(ae,Ie,Ke*(1-Ge)+vr*Ge)}else for(let jt=0,ae=0;jt<J;jt++,ae+=4)Bt(0,ae,jt/(J-1));return At}qn("AlphaImage",ml),qn("RGBAImage",Gs);let ru="big-fb";class al extends at{createBucket(C){return new zo(C)}constructor(C){super(C,Li),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(C){C==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=ws({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(ru)&&this.heatmapFbos.delete(ru)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let Tu;var lc={get paint(){return Tu=Tu||new Lt({"hillshade-illumination-direction":new Ri(it.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ri(it.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ri(it.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ri(it.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ri(it.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ri(it.paint_hillshade["hillshade-accent-color"])})}};class Fc extends at{constructor(C){super(C,lc)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}let Lu=ie([{name:"a_pos",components:2,type:"Int16"}],4),{members:nu}=Lu;function Cu(U,C,J=2){let ht=C&&C.length,At=ht?C[0]*J:U.length,Bt=Xo(U,0,At,J,!0),jt=[];if(!Bt||Bt.next===Bt.prev)return jt;let ae,me,Ie;if(ht&&(Bt=function(Ge,Ke,vr,Cr){let Nr=[];for(let $r=0,cn=Ke.length;$r<cn;$r++){let Pn=Xo(Ge,Ke[$r]*Cr,$r<cn-1?Ke[$r+1]*Cr:Ge.length,Cr,!1);Pn===Pn.next&&(Pn.steiner=!0),Nr.push(K(Pn))}Nr.sort(kl);for(let $r=0;$r<Nr.length;$r++)vr=zs(Nr[$r],vr);return vr}(U,C,Bt,J)),U.length>80*J){ae=1/0,me=1/0;let Ge=-1/0,Ke=-1/0;for(let vr=J;vr<At;vr+=J){let Cr=U[vr],Nr=U[vr+1];Cr<ae&&(ae=Cr),Nr<me&&(me=Nr),Cr>Ge&&(Ge=Cr),Nr>Ke&&(Ke=Nr)}Ie=Math.max(Ge-ae,Ke-me),Ie=Ie!==0?32767/Ie:0}return tl(Bt,jt,J,ae,me,Ie,0),jt}function Xo(U,C,J,ht,At){let Bt;if(At===function(jt,ae,me,Ie){let Ge=0;for(let Ke=ae,vr=me-Ie;Ke<me;Ke+=Ie)Ge+=(jt[vr]-jt[Ke])*(jt[Ke+1]+jt[vr+1]),vr=Ke;return Ge}(U,C,J,ht)>0)for(let jt=C;jt<J;jt+=ht)Bt=er(jt/ht|0,U[jt],U[jt+1],Bt);else for(let jt=J-ht;jt>=C;jt-=ht)Bt=er(jt/ht|0,U[jt],U[jt+1],Bt);return Bt&&ce(Bt,Bt.next)&&(pr(Bt),Bt=Bt.next),Bt}function uu(U,C){if(!U)return U;C||(C=U);let J,ht=U;do if(J=!1,ht.steiner||!ce(ht,ht.next)&&Yt(ht.prev,ht,ht.next)!==0)ht=ht.next;else{if(pr(ht),ht=C=ht.prev,ht===ht.next)break;J=!0}while(J||ht!==C);return C}function tl(U,C,J,ht,At,Bt,jt){if(!U)return;!jt&&Bt&&function(me,Ie,Ge,Ke){let vr=me;do vr.z===0&&(vr.z=et(vr.x,vr.y,Ie,Ge,Ke)),vr.prevZ=vr.prev,vr.nextZ=vr.next,vr=vr.next;while(vr!==me);vr.prevZ.nextZ=null,vr.prevZ=null,function(Cr){let Nr,$r=1;do{let cn,Pn=Cr;Cr=null;let ua=null;for(Nr=0;Pn;){Nr++;let Un=Pn,Kn=0;for(let Ya=0;Ya<$r&&(Kn++,Un=Un.nextZ,Un);Ya++);let Sa=$r;for(;Kn>0||Sa>0&&Un;)Kn!==0&&(Sa===0||!Un||Pn.z<=Un.z)?(cn=Pn,Pn=Pn.nextZ,Kn--):(cn=Un,Un=Un.nextZ,Sa--),ua?ua.nextZ=cn:Cr=cn,cn.prevZ=ua,ua=cn;Pn=Un}ua.nextZ=null,$r*=2}while(Nr>1)}(vr)}(U,ht,At,Bt);let ae=U;for(;U.prev!==U.next;){let me=U.prev,Ie=U.next;if(Bt?Bc(U,ht,At,Bt):au(U))C.push(me.i,U.i,Ie.i),pr(U),U=Ie.next,ae=Ie.next;else if((U=Ie)===ae){jt?jt===1?tl(U=Ho(uu(U),C),C,J,ht,At,Bt,2):jt===2&&Fs(U,C,J,ht,At,Bt):tl(uu(U),C,J,ht,At,Bt,1);break}}}function au(U){let C=U.prev,J=U,ht=U.next;if(Yt(C,J,ht)>=0)return!1;let At=C.x,Bt=J.x,jt=ht.x,ae=C.y,me=J.y,Ie=ht.y,Ge=At<Bt?At<jt?At:jt:Bt<jt?Bt:jt,Ke=ae<me?ae<Ie?ae:Ie:me<Ie?me:Ie,vr=At>Bt?At>jt?At:jt:Bt>jt?Bt:jt,Cr=ae>me?ae>Ie?ae:Ie:me>Ie?me:Ie,Nr=ht.next;for(;Nr!==C;){if(Nr.x>=Ge&&Nr.x<=vr&&Nr.y>=Ke&&Nr.y<=Cr&&pt(At,ae,Bt,me,jt,Ie,Nr.x,Nr.y)&&Yt(Nr.prev,Nr,Nr.next)>=0)return!1;Nr=Nr.next}return!0}function Bc(U,C,J,ht){let At=U.prev,Bt=U,jt=U.next;if(Yt(At,Bt,jt)>=0)return!1;let ae=At.x,me=Bt.x,Ie=jt.x,Ge=At.y,Ke=Bt.y,vr=jt.y,Cr=ae<me?ae<Ie?ae:Ie:me<Ie?me:Ie,Nr=Ge<Ke?Ge<vr?Ge:vr:Ke<vr?Ke:vr,$r=ae>me?ae>Ie?ae:Ie:me>Ie?me:Ie,cn=Ge>Ke?Ge>vr?Ge:vr:Ke>vr?Ke:vr,Pn=et(Cr,Nr,C,J,ht),ua=et($r,cn,C,J,ht),Un=U.prevZ,Kn=U.nextZ;for(;Un&&Un.z>=Pn&&Kn&&Kn.z<=ua;){if(Un.x>=Cr&&Un.x<=$r&&Un.y>=Nr&&Un.y<=cn&&Un!==At&&Un!==jt&&pt(ae,Ge,me,Ke,Ie,vr,Un.x,Un.y)&&Yt(Un.prev,Un,Un.next)>=0||(Un=Un.prevZ,Kn.x>=Cr&&Kn.x<=$r&&Kn.y>=Nr&&Kn.y<=cn&&Kn!==At&&Kn!==jt&&pt(ae,Ge,me,Ke,Ie,vr,Kn.x,Kn.y)&&Yt(Kn.prev,Kn,Kn.next)>=0))return!1;Kn=Kn.nextZ}for(;Un&&Un.z>=Pn;){if(Un.x>=Cr&&Un.x<=$r&&Un.y>=Nr&&Un.y<=cn&&Un!==At&&Un!==jt&&pt(ae,Ge,me,Ke,Ie,vr,Un.x,Un.y)&&Yt(Un.prev,Un,Un.next)>=0)return!1;Un=Un.prevZ}for(;Kn&&Kn.z<=ua;){if(Kn.x>=Cr&&Kn.x<=$r&&Kn.y>=Nr&&Kn.y<=cn&&Kn!==At&&Kn!==jt&&pt(ae,Ge,me,Ke,Ie,vr,Kn.x,Kn.y)&&Yt(Kn.prev,Kn,Kn.next)>=0)return!1;Kn=Kn.nextZ}return!0}function Ho(U,C){let J=U;do{let ht=J.prev,At=J.next.next;!ce(ht,At)&&re(ht,J,J.next,At)&&tr(ht,At)&&tr(At,ht)&&(C.push(ht.i,J.i,At.i),pr(J),pr(J.next),J=U=At),J=J.next}while(J!==U);return uu(J)}function Fs(U,C,J,ht,At,Bt){let jt=U;do{let ae=jt.next.next;for(;ae!==jt.prev;){if(jt.i!==ae.i&&Ct(jt,ae)){let me=$e(jt,ae);return jt=uu(jt,jt.next),me=uu(me,me.next),tl(jt,C,J,ht,At,Bt,0),void tl(me,C,J,ht,At,Bt,0)}ae=ae.next}jt=jt.next}while(jt!==U)}function kl(U,C){return U.x-C.x}function zs(U,C){let J=function(At,Bt){let jt=Bt,ae=At.x,me=At.y,Ie,Ge=-1/0;do{if(me<=jt.y&&me>=jt.next.y&&jt.next.y!==jt.y){let $r=jt.x+(me-jt.y)*(jt.next.x-jt.x)/(jt.next.y-jt.y);if($r<=ae&&$r>Ge&&(Ge=$r,Ie=jt.x<jt.next.x?jt:jt.next,$r===ae))return Ie}jt=jt.next}while(jt!==Bt);if(!Ie)return null;let Ke=Ie,vr=Ie.x,Cr=Ie.y,Nr=1/0;jt=Ie;do{if(ae>=jt.x&&jt.x>=vr&&ae!==jt.x&&pt(me<Cr?ae:Ge,me,vr,Cr,me<Cr?Ge:ae,me,jt.x,jt.y)){let $r=Math.abs(me-jt.y)/(ae-jt.x);tr(jt,At)&&($r<Nr||$r===Nr&&(jt.x>Ie.x||jt.x===Ie.x&&W(Ie,jt)))&&(Ie=jt,Nr=$r)}jt=jt.next}while(jt!==Ke);return Ie}(U,C);if(!J)return C;let ht=$e(J,U);return uu(ht,ht.next),uu(J,J.next)}function W(U,C){return Yt(U.prev,U,C.prev)<0&&Yt(C.next,U,U.next)<0}function et(U,C,J,ht,At){return(U=1431655765&((U=858993459&((U=252645135&((U=16711935&((U=(U-J)*At|0)|U<<8))|U<<4))|U<<2))|U<<1))|(C=1431655765&((C=858993459&((C=252645135&((C=16711935&((C=(C-ht)*At|0)|C<<8))|C<<4))|C<<2))|C<<1))<<1}function K(U){let C=U,J=U;do(C.x<J.x||C.x===J.x&&C.y<J.y)&&(J=C),C=C.next;while(C!==U);return J}function pt(U,C,J,ht,At,Bt,jt,ae){return(At-jt)*(C-ae)>=(U-jt)*(Bt-ae)&&(U-jt)*(ht-ae)>=(J-jt)*(C-ae)&&(J-jt)*(Bt-ae)>=(At-jt)*(ht-ae)}function Ct(U,C){return U.next.i!==C.i&&U.prev.i!==C.i&&!function(J,ht){let At=J;do{if(At.i!==J.i&&At.next.i!==J.i&&At.i!==ht.i&&At.next.i!==ht.i&&re(At,At.next,J,ht))return!0;At=At.next}while(At!==J);return!1}(U,C)&&(tr(U,C)&&tr(C,U)&&function(J,ht){let At=J,Bt=!1,jt=(J.x+ht.x)/2,ae=(J.y+ht.y)/2;do At.y>ae!=At.next.y>ae&&At.next.y!==At.y&&jt<(At.next.x-At.x)*(ae-At.y)/(At.next.y-At.y)+At.x&&(Bt=!Bt),At=At.next;while(At!==J);return Bt}(U,C)&&(Yt(U.prev,U,C.prev)||Yt(U,C.prev,C))||ce(U,C)&&Yt(U.prev,U,U.next)>0&&Yt(C.prev,C,C.next)>0)}function Yt(U,C,J){return(C.y-U.y)*(J.x-C.x)-(C.x-U.x)*(J.y-C.y)}function ce(U,C){return U.x===C.x&&U.y===C.y}function re(U,C,J,ht){let At=Le(Yt(U,C,J)),Bt=Le(Yt(U,C,ht)),jt=Le(Yt(J,ht,U)),ae=Le(Yt(J,ht,C));return At!==Bt&&jt!==ae||!(At!==0||!ye(U,J,C))||!(Bt!==0||!ye(U,ht,C))||!(jt!==0||!ye(J,U,ht))||!(ae!==0||!ye(J,C,ht))}function ye(U,C,J){return C.x<=Math.max(U.x,J.x)&&C.x>=Math.min(U.x,J.x)&&C.y<=Math.max(U.y,J.y)&&C.y>=Math.min(U.y,J.y)}function Le(U){return U>0?1:U<0?-1:0}function tr(U,C){return Yt(U.prev,U,U.next)<0?Yt(U,C,U.next)>=0&&Yt(U,U.prev,C)>=0:Yt(U,C,U.prev)<0||Yt(U,U.next,C)<0}function $e(U,C){let J=wr(U.i,U.x,U.y),ht=wr(C.i,C.x,C.y),At=U.next,Bt=C.prev;return U.next=C,C.prev=U,J.next=At,At.prev=J,ht.next=J,J.prev=ht,Bt.next=ht,ht.prev=Bt,ht}function er(U,C,J,ht){let At=wr(U,C,J);return ht?(At.next=ht.next,At.prev=ht,ht.next.prev=At,ht.next=At):(At.prev=At,At.next=At),At}function pr(U){U.next.prev=U.prev,U.prev.next=U.next,U.prevZ&&(U.prevZ.nextZ=U.nextZ),U.nextZ&&(U.nextZ.prevZ=U.prevZ)}function wr(U,C,J){return{i:U,x:C,y:J,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function rr(U,C,J){let ht=J.patternDependencies,At=!1;for(let Bt of C){let jt=Bt.paint.get(`${U}-pattern`);jt.isConstant()||(At=!0);let ae=jt.constantOr(null);ae&&(At=!0,ht[ae.to]=!0,ht[ae.from]=!0)}return At}function cr(U,C,J,ht,At){let Bt=At.patternDependencies;for(let jt of C){let ae=jt.paint.get(`${U}-pattern`).value;if(ae.kind!=="constant"){let me=ae.evaluate({zoom:ht-1},J,{},At.availableImages),Ie=ae.evaluate({zoom:ht},J,{},At.availableImages),Ge=ae.evaluate({zoom:ht+1},J,{},At.availableImages);me=me&&me.name?me.name:me,Ie=Ie&&Ie.name?Ie.name:Ie,Ge=Ge&&Ge.name?Ge.name:Ge,Bt[me]=!0,Bt[Ie]=!0,Bt[Ge]=!0,J.patterns[jt.id]={min:me,mid:Ie,max:Ge}}}return J}class hr{constructor(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(J=>J.id),this.index=C.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new nl,this.indexArray=new Ce,this.indexArray2=new Qe,this.programConfigurations=new us(C.layers,C.zoom),this.segments=new jr,this.segments2=new jr,this.stateDependentLayerIds=this.layers.filter(J=>J.isStateDependent()).map(J=>J.id)}populate(C,J,ht){this.hasPattern=rr("fill",this.layers,J);let At=this.layers[0].layout.get("fill-sort-key"),Bt=!At.isConstant(),jt=[];for(let{feature:ae,id:me,index:Ie,sourceLayerIndex:Ge}of C){let Ke=this.layers[0]._featureFilter.needGeometry,vr=gn(ae,Ke);if(!this.layers[0]._featureFilter.filter(new Qo(this.zoom),vr,ht))continue;let Cr=Bt?At.evaluate(vr,{},ht,J.availableImages):void 0,Nr={id:me,properties:ae.properties,type:ae.type,sourceLayerIndex:Ge,index:Ie,geometry:Ke?vr.geometry:fn(ae),patterns:{},sortKey:Cr};jt.push(Nr)}Bt&&jt.sort((ae,me)=>ae.sortKey-me.sortKey);for(let ae of jt){let{geometry:me,index:Ie,sourceLayerIndex:Ge}=ae;if(this.hasPattern){let Ke=cr("fill",this.layers,ae,this.zoom,J);this.patternFeatures.push(Ke)}else this.addFeature(ae,me,Ie,ht,{});J.featureIndex.insert(C[Ie].feature,me,Ie,Ge,this.index)}}update(C,J,ht){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,J,this.stateDependentLayers,ht)}addFeatures(C,J,ht){for(let At of this.patternFeatures)this.addFeature(At,At.geometry,At.index,J,ht)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,nu),this.indexBuffer=C.createIndexBuffer(this.indexArray),this.indexBuffer2=C.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(C),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(C,J,ht,At,Bt){for(let jt of Mu(J,500)){let ae=0;for(let Cr of jt)ae+=Cr.length;let me=this.segments.prepareSegment(ae,this.layoutVertexArray,this.indexArray),Ie=me.vertexLength,Ge=[],Ke=[];for(let Cr of jt){if(Cr.length===0)continue;Cr!==jt[0]&&Ke.push(Ge.length/2);let Nr=this.segments2.prepareSegment(Cr.length,this.layoutVertexArray,this.indexArray2),$r=Nr.vertexLength;this.layoutVertexArray.emplaceBack(Cr[0].x,Cr[0].y),this.indexArray2.emplaceBack($r+Cr.length-1,$r),Ge.push(Cr[0].x),Ge.push(Cr[0].y);for(let cn=1;cn<Cr.length;cn++)this.layoutVertexArray.emplaceBack(Cr[cn].x,Cr[cn].y),this.indexArray2.emplaceBack($r+cn-1,$r+cn),Ge.push(Cr[cn].x),Ge.push(Cr[cn].y);Nr.vertexLength+=Cr.length,Nr.primitiveLength+=Cr.length}let vr=Cu(Ge,Ke);for(let Cr=0;Cr<vr.length;Cr+=3)this.indexArray.emplaceBack(Ie+vr[Cr],Ie+vr[Cr+1],Ie+vr[Cr+2]);me.vertexLength+=ae,me.primitiveLength+=vr.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ht,Bt,At)}}let Vr,yn;qn("FillBucket",hr,{omit:["layers","patternFeatures"]});var wn={get paint(){return yn=yn||new Lt({"fill-antialias":new Ri(it.paint_fill["fill-antialias"]),"fill-opacity":new oo(it.paint_fill["fill-opacity"]),"fill-color":new oo(it.paint_fill["fill-color"]),"fill-outline-color":new oo(it.paint_fill["fill-outline-color"]),"fill-translate":new Ri(it.paint_fill["fill-translate"]),"fill-translate-anchor":new Ri(it.paint_fill["fill-translate-anchor"]),"fill-pattern":new bu(it.paint_fill["fill-pattern"])})},get layout(){return Vr=Vr||new Lt({"fill-sort-key":new oo(it.layout_fill["fill-sort-key"])})}};class $n extends at{constructor(C){super(C,wn)}recalculate(C,J){super.recalculate(C,J);let ht=this.paint._values["fill-outline-color"];ht.value.kind==="constant"&&ht.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(C){return new hr(C)}queryRadius(){return Ga(this.paint.get("fill-translate"))}queryIntersectsFeature(C,J,ht,At,Bt,jt,ae){return ia(Aa(C,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),jt.angle,ae),At)}isTileClipped(){return!0}}let Xn=ie([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Vn=ie([{name:"a_centroid",components:2,type:"Int16"}],4),{members:ca}=Xn;var ea={},wa=i,da=pa;function pa(U,C,J,ht,At){this.properties={},this.extent=J,this.type=0,this._pbf=U,this._geometry=-1,this._keys=ht,this._values=At,U.readFields(Ua,this,C)}function Ua(U,C,J){U==1?C.id=J.readVarint():U==2?function(ht,At){for(var Bt=ht.readVarint()+ht.pos;ht.pos<Bt;){var jt=At._keys[ht.readVarint()],ae=At._values[ht.readVarint()];At.properties[jt]=ae}}(J,C):U==3?C.type=J.readVarint():U==4&&(C._geometry=J.pos)}function Di(U){for(var C,J,ht=0,At=0,Bt=U.length,jt=Bt-1;At<Bt;jt=At++)ht+=((J=U[jt]).x-(C=U[At]).x)*(C.y+J.y);return ht}pa.types=["Unknown","Point","LineString","Polygon"],pa.prototype.loadGeometry=function(){var U=this._pbf;U.pos=this._geometry;for(var C,J=U.readVarint()+U.pos,ht=1,At=0,Bt=0,jt=0,ae=[];U.pos<J;){if(At<=0){var me=U.readVarint();ht=7&me,At=me>>3}if(At--,ht===1||ht===2)Bt+=U.readSVarint(),jt+=U.readSVarint(),ht===1&&(C&&ae.push(C),C=[]),C.push(new wa(Bt,jt));else{if(ht!==7)throw new Error("unknown command "+ht);C&&C.push(C[0].clone())}}return C&&ae.push(C),ae},pa.prototype.bbox=function(){var U=this._pbf;U.pos=this._geometry;for(var C=U.readVarint()+U.pos,J=1,ht=0,At=0,Bt=0,jt=1/0,ae=-1/0,me=1/0,Ie=-1/0;U.pos<C;){if(ht<=0){var Ge=U.readVarint();J=7&Ge,ht=Ge>>3}if(ht--,J===1||J===2)(At+=U.readSVarint())<jt&&(jt=At),At>ae&&(ae=At),(Bt+=U.readSVarint())<me&&(me=Bt),Bt>Ie&&(Ie=Bt);else if(J!==7)throw new Error("unknown command "+J)}return[jt,me,ae,Ie]},pa.prototype.toGeoJSON=function(U,C,J){var ht,At,Bt=this.extent*Math.pow(2,J),jt=this.extent*U,ae=this.extent*C,me=this.loadGeometry(),Ie=pa.types[this.type];function Ge(Cr){for(var Nr=0;Nr<Cr.length;Nr++){var $r=Cr[Nr];Cr[Nr]=[360*($r.x+jt)/Bt-180,360/Math.PI*Math.atan(Math.exp((180-360*($r.y+ae)/Bt)*Math.PI/180))-90]}}switch(this.type){case 1:var Ke=[];for(ht=0;ht<me.length;ht++)Ke[ht]=me[ht][0];Ge(me=Ke);break;case 2:for(ht=0;ht<me.length;ht++)Ge(me[ht]);break;case 3:for(me=function(Cr){var Nr=Cr.length;if(Nr<=1)return[Cr];for(var $r,cn,Pn=[],ua=0;ua<Nr;ua++){var Un=Di(Cr[ua]);Un!==0&&(cn===void 0&&(cn=Un<0),cn===Un<0?($r&&Pn.push($r),$r=[Cr[ua]]):$r.push(Cr[ua]))}return $r&&Pn.push($r),Pn}(me),ht=0;ht<me.length;ht++)for(At=0;At<me[ht].length;At++)Ge(me[ht][At])}me.length===1?me=me[0]:Ie="Multi"+Ie;var vr={type:"Feature",geometry:{type:Ie,coordinates:me},properties:this.properties};return"id"in this&&(vr.id=this.id),vr};var ui=da,ji=uo;function uo(U,C){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=U,this._keys=[],this._values=[],this._features=[],U.readFields(cs,this,C),this.length=this._features.length}function cs(U,C,J){U===15?C.version=J.readVarint():U===1?C.name=J.readString():U===5?C.extent=J.readVarint():U===2?C._features.push(J.pos):U===3?C._keys.push(J.readString()):U===4&&C._values.push(function(ht){for(var At=null,Bt=ht.readVarint()+ht.pos;ht.pos<Bt;){var jt=ht.readVarint()>>3;At=jt===1?ht.readString():jt===2?ht.readFloat():jt===3?ht.readDouble():jt===4?ht.readVarint64():jt===5?ht.readVarint():jt===6?ht.readSVarint():jt===7?ht.readBoolean():null}return At}(J))}uo.prototype.feature=function(U){if(U<0||U>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[U];var C=this._pbf.readVarint()+this._pbf.pos;return new ui(this._pbf,C,this.extent,this._keys,this._values)};var Ts=ji;function is(U,C,J){if(U===3){var ht=new Ts(J,J.readVarint()+J.pos);ht.length&&(C[ht.name]=ht)}}ea.VectorTile=function(U,C){this.layers=U.readFields(is,{},C)},ea.VectorTileFeature=da,ea.VectorTileLayer=ji;let hs=ea.VectorTileFeature.types,il=Math.pow(2,13);function eo(U,C,J,ht,At,Bt,jt,ae){U.emplaceBack(C,J,2*Math.floor(ht*il)+jt,At*il*2,Bt*il*2,Math.round(ae))}class Ss{constructor(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(J=>J.id),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new dl,this.centroidVertexArray=new bo,this.indexArray=new Ce,this.programConfigurations=new us(C.layers,C.zoom),this.segments=new jr,this.stateDependentLayerIds=this.layers.filter(J=>J.isStateDependent()).map(J=>J.id)}populate(C,J,ht){this.features=[],this.hasPattern=rr("fill-extrusion",this.layers,J);for(let{feature:At,id:Bt,index:jt,sourceLayerIndex:ae}of C){let me=this.layers[0]._featureFilter.needGeometry,Ie=gn(At,me);if(!this.layers[0]._featureFilter.filter(new Qo(this.zoom),Ie,ht))continue;let Ge={id:Bt,sourceLayerIndex:ae,index:jt,geometry:me?Ie.geometry:fn(At),properties:At.properties,type:At.type,patterns:{}};this.hasPattern?this.features.push(cr("fill-extrusion",this.layers,Ge,this.zoom,J)):this.addFeature(Ge,Ge.geometry,jt,ht,{}),J.featureIndex.insert(At,Ge.geometry,jt,ae,this.index,!0)}}addFeatures(C,J,ht){for(let At of this.features){let{geometry:Bt}=At;this.addFeature(At,Bt,At.index,J,ht)}}update(C,J,ht){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,J,this.stateDependentLayers,ht)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,ca),this.centroidVertexBuffer=C.createVertexBuffer(this.centroidVertexArray,Vn.members,!0),this.indexBuffer=C.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(C),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(C,J,ht,At,Bt){for(let jt of Mu(J,500)){let ae={x:0,y:0,vertexCount:0},me=0;for(let Nr of jt)me+=Nr.length;let Ie=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let Nr of jt){if(Nr.length===0||uc(Nr))continue;let $r=0;for(let cn=0;cn<Nr.length;cn++){let Pn=Nr[cn];if(cn>=1){let ua=Nr[cn-1];if(!Du(Pn,ua)){Ie.vertexLength+4>jr.MAX_VERTEX_ARRAY_LENGTH&&(Ie=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let Un=Pn.sub(ua)._perp()._unit(),Kn=ua.dist(Pn);$r+Kn>32768&&($r=0),eo(this.layoutVertexArray,Pn.x,Pn.y,Un.x,Un.y,0,0,$r),eo(this.layoutVertexArray,Pn.x,Pn.y,Un.x,Un.y,0,1,$r),ae.x+=2*Pn.x,ae.y+=2*Pn.y,ae.vertexCount+=2,$r+=Kn,eo(this.layoutVertexArray,ua.x,ua.y,Un.x,Un.y,0,0,$r),eo(this.layoutVertexArray,ua.x,ua.y,Un.x,Un.y,0,1,$r),ae.x+=2*ua.x,ae.y+=2*ua.y,ae.vertexCount+=2;let Sa=Ie.vertexLength;this.indexArray.emplaceBack(Sa,Sa+2,Sa+1),this.indexArray.emplaceBack(Sa+1,Sa+2,Sa+3),Ie.vertexLength+=4,Ie.primitiveLength+=2}}}}if(Ie.vertexLength+me>jr.MAX_VERTEX_ARRAY_LENGTH&&(Ie=this.segments.prepareSegment(me,this.layoutVertexArray,this.indexArray)),hs[C.type]!=="Polygon")continue;let Ge=[],Ke=[],vr=Ie.vertexLength;for(let Nr of jt)if(Nr.length!==0){Nr!==jt[0]&&Ke.push(Ge.length/2);for(let $r=0;$r<Nr.length;$r++){let cn=Nr[$r];eo(this.layoutVertexArray,cn.x,cn.y,0,0,1,1,0),ae.x+=cn.x,ae.y+=cn.y,ae.vertexCount+=1,Ge.push(cn.x),Ge.push(cn.y)}}let Cr=Cu(Ge,Ke);for(let Nr=0;Nr<Cr.length;Nr+=3)this.indexArray.emplaceBack(vr+Cr[Nr],vr+Cr[Nr+2],vr+Cr[Nr+1]);Ie.primitiveLength+=Cr.length/3,Ie.vertexLength+=me;for(let Nr=0;Nr<ae.vertexCount;Nr++){let $r=Math.floor(ae.x/ae.vertexCount),cn=Math.floor(ae.y/ae.vertexCount);this.centroidVertexArray.emplaceBack($r,cn)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ht,Bt,At)}}function Du(U,C){return U.x===C.x&&(U.x<0||U.x>gs)||U.y===C.y&&(U.y<0||U.y>gs)}function uc(U){return U.every(C=>C.x<0)||U.every(C=>C.x>gs)||U.every(C=>C.y<0)||U.every(C=>C.y>gs)}let lf;qn("FillExtrusionBucket",Ss,{omit:["layers","features"]});var xf={get paint(){return lf=lf||new Lt({"fill-extrusion-opacity":new Ri(it["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new oo(it["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ri(it["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ri(it["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new bu(it["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new oo(it["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new oo(it["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ri(it["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Xh extends at{constructor(C){super(C,xf)}createBucket(C){return new Ss(C)}queryRadius(){return Ga(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(C,J,ht,At,Bt,jt,ae,me){let Ie=Aa(C,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),jt.angle,ae),Ge=this.paint.get("fill-extrusion-height").evaluate(J,ht),Ke=this.paint.get("fill-extrusion-base").evaluate(J,ht),vr=function(Nr,$r,cn,Pn){let ua=[];for(let Un of Nr){let Kn=[Un.x,Un.y,0,1];Qa(Kn,Kn,$r),ua.push(new o(Kn[0]/Kn[3],Kn[1]/Kn[3]))}return ua}(Ie,me),Cr=function(Nr,$r,cn,Pn){let ua=[],Un=[],Kn=Pn[8]*$r,Sa=Pn[9]*$r,Ya=Pn[10]*$r,Qi=Pn[11]*$r,Vo=Pn[8]*cn,Vi=Pn[9]*cn,zi=Pn[10]*cn,xo=Pn[11]*cn;for(let so of Nr){let Ki=[],Oa=[];for(let To of so){let _o=To.x,Ko=To.y,Bl=Pn[0]*_o+Pn[4]*Ko+Pn[12],Dl=Pn[1]*_o+Pn[5]*Ko+Pn[13],Uc=Pn[2]*_o+Pn[6]*Ko+Pn[14],Kh=Pn[3]*_o+Pn[7]*Ko+Pn[15],cc=Uc+Ya,kc=Kh+Qi,Bh=Bl+Vo,Rh=Dl+Vi,jh=Uc+zi,Ou=Kh+xo,Vc=new o((Bl+Kn)/kc,(Dl+Sa)/kc);Vc.z=cc/kc,Ki.push(Vc);let Mh=new o(Bh/Ou,Rh/Ou);Mh.z=jh/Ou,Oa.push(Mh)}ua.push(Ki),Un.push(Oa)}return[ua,Un]}(At,Ke,Ge,me);return function(Nr,$r,cn){let Pn=1/0;ia(cn,$r)&&(Pn=Tf(cn,$r[0]));for(let ua=0;ua<$r.length;ua++){let Un=$r[ua],Kn=Nr[ua];for(let Sa=0;Sa<Un.length-1;Sa++){let Ya=Un[Sa],Qi=[Ya,Un[Sa+1],Kn[Sa+1],Kn[Sa],Ya];ka(cn,Qi)&&(Pn=Math.min(Pn,Tf(cn,Qi)))}}return Pn!==1/0&&Pn}(Cr[0],Cr[1],vr)}}function $h(U,C){return U.x*C.x+U.y*C.y}function Tf(U,C){if(U.length===1){let J=0,ht=C[J++],At;for(;!At||ht.equals(At);)if(At=C[J++],!At)return 1/0;for(;J<C.length;J++){let Bt=C[J],jt=U[0],ae=At.sub(ht),me=Bt.sub(ht),Ie=jt.sub(ht),Ge=$h(ae,ae),Ke=$h(ae,me),vr=$h(me,me),Cr=$h(Ie,ae),Nr=$h(Ie,me),$r=Ge*vr-Ke*Ke,cn=(vr*Cr-Ke*Nr)/$r,Pn=(Ge*Nr-Ke*Cr)/$r,ua=ht.z*(1-cn-Pn)+At.z*cn+Bt.z*Pn;if(isFinite(ua))return ua}return 1/0}{let J=1/0;for(let ht of C)J=Math.min(J,ht.z);return J}}let kh=ie([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Jh}=kh,hh=ie([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Of}=hh,lp=ea.VectorTileFeature.types,Qh=Math.cos(Math.PI/180*37.5),Yh=Math.pow(2,14)/.5;class Ah{constructor(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(J=>J.id),this.index=C.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(J=>{this.gradients[J.id]={}}),this.layoutVertexArray=new lu,this.layoutVertexArray2=new mt,this.indexArray=new Ce,this.programConfigurations=new us(C.layers,C.zoom),this.segments=new jr,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(J=>J.isStateDependent()).map(J=>J.id)}populate(C,J,ht){this.hasPattern=rr("line",this.layers,J);let At=this.layers[0].layout.get("line-sort-key"),Bt=!At.isConstant(),jt=[];for(let{feature:ae,id:me,index:Ie,sourceLayerIndex:Ge}of C){let Ke=this.layers[0]._featureFilter.needGeometry,vr=gn(ae,Ke);if(!this.layers[0]._featureFilter.filter(new Qo(this.zoom),vr,ht))continue;let Cr=Bt?At.evaluate(vr,{},ht):void 0,Nr={id:me,properties:ae.properties,type:ae.type,sourceLayerIndex:Ge,index:Ie,geometry:Ke?vr.geometry:fn(ae),patterns:{},sortKey:Cr};jt.push(Nr)}Bt&&jt.sort((ae,me)=>ae.sortKey-me.sortKey);for(let ae of jt){let{geometry:me,index:Ie,sourceLayerIndex:Ge}=ae;if(this.hasPattern){let Ke=cr("line",this.layers,ae,this.zoom,J);this.patternFeatures.push(Ke)}else this.addFeature(ae,me,Ie,ht,{});J.featureIndex.insert(C[Ie].feature,me,Ie,Ge,this.index)}}update(C,J,ht){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,J,this.stateDependentLayers,ht)}addFeatures(C,J,ht){for(let At of this.patternFeatures)this.addFeature(At,At.geometry,At.index,J,ht)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(C){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=C.createVertexBuffer(this.layoutVertexArray2,Of)),this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,Jh),this.indexBuffer=C.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(C),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(C){if(C.properties&&Object.prototype.hasOwnProperty.call(C.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(C.properties,"mapbox_clip_end"))return{start:+C.properties.mapbox_clip_start,end:+C.properties.mapbox_clip_end}}addFeature(C,J,ht,At,Bt){let jt=this.layers[0].layout,ae=jt.get("line-join").evaluate(C,{}),me=jt.get("line-cap"),Ie=jt.get("line-miter-limit"),Ge=jt.get("line-round-limit");this.lineClips=this.lineFeatureClips(C);for(let Ke of J)this.addLine(Ke,C,ae,me,Ie,Ge);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ht,Bt,At)}addLine(C,J,ht,At,Bt,jt){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Pn=0;Pn<C.length-1;Pn++)this.totalDistance+=C[Pn].dist(C[Pn+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let ae=lp[J.type]==="Polygon",me=C.length;for(;me>=2&&C[me-1].equals(C[me-2]);)me--;let Ie=0;for(;Ie<me-1&&C[Ie].equals(C[Ie+1]);)Ie++;if(me<(ae?3:2))return;ht==="bevel"&&(Bt=1.05);let Ge=this.overscaling<=16?15*gs/(512*this.overscaling):0,Ke=this.segments.prepareSegment(10*me,this.layoutVertexArray,this.indexArray),vr,Cr,Nr,$r,cn;this.e1=this.e2=-1,ae&&(vr=C[me-2],cn=C[Ie].sub(vr)._unit()._perp());for(let Pn=Ie;Pn<me;Pn++){if(Nr=Pn===me-1?ae?C[Ie+1]:void 0:C[Pn+1],Nr&&C[Pn].equals(Nr))continue;cn&&($r=cn),vr&&(Cr=vr),vr=C[Pn],cn=Nr?Nr.sub(vr)._unit()._perp():$r,$r=$r||cn;let ua=$r.add(cn);ua.x===0&&ua.y===0||ua._unit();let Un=$r.x*cn.x+$r.y*cn.y,Kn=ua.x*cn.x+ua.y*cn.y,Sa=Kn!==0?1/Kn:1/0,Ya=2*Math.sqrt(2-2*Kn),Qi=Kn<Qh&&Cr&&Nr,Vo=$r.x*cn.y-$r.y*cn.x>0;if(Qi&&Pn>Ie){let xo=vr.dist(Cr);if(xo>2*Ge){let so=vr.sub(vr.sub(Cr)._mult(Ge/xo)._round());this.updateDistance(Cr,so),this.addCurrentVertex(so,$r,0,0,Ke),Cr=so}}let Vi=Cr&&Nr,zi=Vi?ht:ae?"butt":At;if(Vi&&zi==="round"&&(Sa<jt?zi="miter":Sa<=2&&(zi="fakeround")),zi==="miter"&&Sa>Bt&&(zi="bevel"),zi==="bevel"&&(Sa>2&&(zi="flipbevel"),Sa<Bt&&(zi="miter")),Cr&&this.updateDistance(Cr,vr),zi==="miter")ua._mult(Sa),this.addCurrentVertex(vr,ua,0,0,Ke);else if(zi==="flipbevel"){if(Sa>100)ua=cn.mult(-1);else{let xo=Sa*$r.add(cn).mag()/$r.sub(cn).mag();ua._perp()._mult(xo*(Vo?-1:1))}this.addCurrentVertex(vr,ua,0,0,Ke),this.addCurrentVertex(vr,ua.mult(-1),0,0,Ke)}else if(zi==="bevel"||zi==="fakeround"){let xo=-Math.sqrt(Sa*Sa-1),so=Vo?xo:0,Ki=Vo?0:xo;if(Cr&&this.addCurrentVertex(vr,$r,so,Ki,Ke),zi==="fakeround"){let Oa=Math.round(180*Ya/Math.PI/20);for(let To=1;To<Oa;To++){let _o=To/Oa;if(_o!==.5){let Bl=_o-.5;_o+=_o*Bl*(_o-1)*((1.0904+Un*(Un*(3.55645-1.43519*Un)-3.2452))*Bl*Bl+(.848013+Un*(.215638*Un-1.06021)))}let Ko=cn.sub($r)._mult(_o)._add($r)._unit()._mult(Vo?-1:1);this.addHalfVertex(vr,Ko.x,Ko.y,!1,Vo,0,Ke)}}Nr&&this.addCurrentVertex(vr,cn,-so,-Ki,Ke)}else if(zi==="butt")this.addCurrentVertex(vr,ua,0,0,Ke);else if(zi==="square"){let xo=Cr?1:-1;this.addCurrentVertex(vr,ua,xo,xo,Ke)}else zi==="round"&&(Cr&&(this.addCurrentVertex(vr,$r,0,0,Ke),this.addCurrentVertex(vr,$r,1,1,Ke,!0)),Nr&&(this.addCurrentVertex(vr,cn,-1,-1,Ke,!0),this.addCurrentVertex(vr,cn,0,0,Ke)));if(Qi&&Pn<me-1){let xo=vr.dist(Nr);if(xo>2*Ge){let so=vr.add(Nr.sub(vr)._mult(Ge/xo)._round());this.updateDistance(vr,so),this.addCurrentVertex(so,cn,0,0,Ke),vr=so}}}}addCurrentVertex(C,J,ht,At,Bt,jt=!1){let ae=J.y*At-J.x,me=-J.y-J.x*At;this.addHalfVertex(C,J.x+J.y*ht,J.y-J.x*ht,jt,!1,ht,Bt),this.addHalfVertex(C,ae,me,jt,!0,-At,Bt),this.distance>Yh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(C,J,ht,At,Bt,jt))}addHalfVertex({x:C,y:J},ht,At,Bt,jt,ae,me){let Ie=.5*(this.lineClips?this.scaledDistance*(Yh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((C<<1)+(Bt?1:0),(J<<1)+(jt?1:0),Math.round(63*ht)+128,Math.round(63*At)+128,1+(ae===0?0:ae<0?-1:1)|(63&Ie)<<2,Ie>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let Ge=me.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Ge),me.primitiveLength++),jt?this.e2=Ge:this.e1=Ge}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(C,J){this.distance+=C.dist(J),this.updateScaledDistance()}}let up,Mp;qn("LineBucket",Ah,{omit:["layers","patternFeatures"]});var cp={get paint(){return Mp=Mp||new Lt({"line-opacity":new oo(it.paint_line["line-opacity"]),"line-color":new oo(it.paint_line["line-color"]),"line-translate":new Ri(it.paint_line["line-translate"]),"line-translate-anchor":new Ri(it.paint_line["line-translate-anchor"]),"line-width":new oo(it.paint_line["line-width"]),"line-gap-width":new oo(it.paint_line["line-gap-width"]),"line-offset":new oo(it.paint_line["line-offset"]),"line-blur":new oo(it.paint_line["line-blur"]),"line-dasharray":new Cl(it.paint_line["line-dasharray"]),"line-pattern":new bu(it.paint_line["line-pattern"]),"line-gradient":new Th(it.paint_line["line-gradient"])})},get layout(){return up=up||new Lt({"line-cap":new Ri(it.layout_line["line-cap"]),"line-join":new oo(it.layout_line["line-join"]),"line-miter-limit":new Ri(it.layout_line["line-miter-limit"]),"line-round-limit":new Ri(it.layout_line["line-round-limit"]),"line-sort-key":new oo(it.layout_line["line-sort-key"])})}};class Rc extends oo{possiblyEvaluate(C,J){return J=new Qo(Math.floor(J.zoom),{now:J.now,fadeDuration:J.fadeDuration,zoomHistory:J.zoomHistory,transition:J.transition}),super.possiblyEvaluate(C,J)}evaluate(C,J,ht,At){return J=T({},J,{zoom:Math.floor(J.zoom)}),super.evaluate(C,J,ht,At)}}let Xf;class Sp extends at{constructor(C){super(C,cp),this.gradientVersion=0,Xf||(Xf=new Rc(cp.paint.properties["line-width"].specification),Xf.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(C){if(C==="line-gradient"){let J=this.gradientExpression();this.stepInterpolant=!!function(ht){return ht._styleExpression!==void 0}(J)&&J._styleExpression.expression instanceof Tn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(C,J){super.recalculate(C,J),this.paint._values["line-floorwidth"]=Xf.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,C)}createBucket(C){return new Ah(C)}queryRadius(C){let J=C,ht=jc(fa("line-width",this,J),fa("line-gap-width",this,J)),At=fa("line-offset",this,J);return ht/2+Math.abs(At)+Ga(this.paint.get("line-translate"))}queryIntersectsFeature(C,J,ht,At,Bt,jt,ae){let me=Aa(C,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),jt.angle,ae),Ie=ae/2*jc(this.paint.get("line-width").evaluate(J,ht),this.paint.get("line-gap-width").evaluate(J,ht)),Ge=this.paint.get("line-offset").evaluate(J,ht);return Ge&&(At=function(Ke,vr){let Cr=[];for(let Nr=0;Nr<Ke.length;Nr++){let $r=Ke[Nr],cn=[];for(let Pn=0;Pn<$r.length;Pn++){let ua=$r[Pn-1],Un=$r[Pn],Kn=$r[Pn+1],Sa=Pn===0?new o(0,0):Un.sub(ua)._unit()._perp(),Ya=Pn===$r.length-1?new o(0,0):Kn.sub(Un)._unit()._perp(),Qi=Sa._add(Ya)._unit(),Vo=Qi.x*Ya.x+Qi.y*Ya.y;Vo!==0&&Qi._mult(1/Vo),cn.push(Qi._mult(vr)._add(Un))}Cr.push(cn)}return Cr}(At,Ge*ae)),function(Ke,vr,Cr){for(let Nr=0;Nr<vr.length;Nr++){let $r=vr[Nr];if(Ke.length>=3){for(let cn=0;cn<$r.length;cn++)if(Ca(Ke,$r[cn]))return!0}if(qa(Ke,$r,Cr))return!0}return!1}(me,At,Ie)}isTileClipped(){return!0}}function jc(U,C){return C>0?C+2*U:U}let hp=ie([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Jp=ie([{name:"a_projected_pos",components:3,type:"Float32"}],4);ie([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let Qp=ie([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);ie([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let kf=ie([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Ep=ie([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function zu(U,C,J){return U.sections.forEach(ht=>{ht.text=function(At,Bt,jt){let ae=Bt.layout.get("text-transform").evaluate(jt,{});return ae==="uppercase"?At=At.toLocaleUpperCase():ae==="lowercase"&&(At=At.toLocaleLowerCase()),ds.applyArabicShaping&&(At=ds.applyArabicShaping(At)),At}(ht.text,C,J)}),U}ie([{name:"triangle",components:3,type:"Uint16"}]),ie([{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"}]),ie([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),ie([{type:"Float32",name:"offsetX"}]),ie([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ie([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let Nc={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var ol=24,Pp=vl,Yp=function(U,C,J,ht,At){var Bt,jt,ae=8*At-ht-1,me=(1<<ae)-1,Ie=me>>1,Ge=-7,Ke=At-1,vr=-1,Cr=U[C+Ke];for(Ke+=vr,Bt=Cr&(1<<-Ge)-1,Cr>>=-Ge,Ge+=ae;Ge>0;Bt=256*Bt+U[C+Ke],Ke+=vr,Ge-=8);for(jt=Bt&(1<<-Ge)-1,Bt>>=-Ge,Ge+=ht;Ge>0;jt=256*jt+U[C+Ke],Ke+=vr,Ge-=8);if(Bt===0)Bt=1-Ie;else{if(Bt===me)return jt?NaN:1/0*(Cr?-1:1);jt+=Math.pow(2,ht),Bt-=Ie}return(Cr?-1:1)*jt*Math.pow(2,Bt-ht)},D0=function(U,C,J,ht,At,Bt){var jt,ae,me,Ie=8*Bt-At-1,Ge=(1<<Ie)-1,Ke=Ge>>1,vr=At===23?Math.pow(2,-24)-Math.pow(2,-77):0,Cr=0,Nr=1,$r=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(ae=isNaN(C)?1:0,jt=Ge):(jt=Math.floor(Math.log(C)/Math.LN2),C*(me=Math.pow(2,-jt))<1&&(jt--,me*=2),(C+=jt+Ke>=1?vr/me:vr*Math.pow(2,1-Ke))*me>=2&&(jt++,me/=2),jt+Ke>=Ge?(ae=0,jt=Ge):jt+Ke>=1?(ae=(C*me-1)*Math.pow(2,At),jt+=Ke):(ae=C*Math.pow(2,Ke-1)*Math.pow(2,At),jt=0));At>=8;U[J+Cr]=255&ae,Cr+=Nr,ae/=256,At-=8);for(jt=jt<<At|ae,Ie+=At;Ie>0;U[J+Cr]=255&jt,Cr+=Nr,jt/=256,Ie-=8);U[J+Cr-Nr]|=128*$r};function vl(U){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(U)?U:new Uint8Array(U||0),this.pos=0,this.type=0,this.length=this.buf.length}vl.Varint=0,vl.Fixed64=1,vl.Bytes=2,vl.Fixed32=5;var $f=4294967296,z0=1/$f,Ip=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Af(U){return U.type===vl.Bytes?U.readVarint()+U.pos:U.pos+1}function $g(U,C,J){return J?4294967296*C+(U>>>0):4294967296*(C>>>0)+(U>>>0)}function Kp(U,C,J){var ht=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(7*Math.LN2));J.realloc(ht);for(var At=J.pos-1;At>=U;At--)J.buf[At+ht]=J.buf[At]}function a_(U,C){for(var J=0;J<U.length;J++)C.writeVarint(U[J])}function i_(U,C){for(var J=0;J<U.length;J++)C.writeSVarint(U[J])}function o_(U,C){for(var J=0;J<U.length;J++)C.writeFloat(U[J])}function s_(U,C){for(var J=0;J<U.length;J++)C.writeDouble(U[J])}function l_(U,C){for(var J=0;J<U.length;J++)C.writeBoolean(U[J])}function u_(U,C){for(var J=0;J<U.length;J++)C.writeFixed32(U[J])}function c_(U,C){for(var J=0;J<U.length;J++)C.writeSFixed32(U[J])}function h_(U,C){for(var J=0;J<U.length;J++)C.writeFixed64(U[J])}function O0(U,C){for(var J=0;J<U.length;J++)C.writeSFixed64(U[J])}function F0(U,C){return(U[C]|U[C+1]<<8|U[C+2]<<16)+16777216*U[C+3]}function td(U,C,J){U[J]=C,U[J+1]=C>>>8,U[J+2]=C>>>16,U[J+3]=C>>>24}function Fv(U,C){return(U[C]|U[C+1]<<8|U[C+2]<<16)+(U[C+3]<<24)}vl.prototype={destroy:function(){this.buf=null},readFields:function(U,C,J){for(J=J||this.length;this.pos<J;){var ht=this.readVarint(),At=ht>>3,Bt=this.pos;this.type=7&ht,U(At,C,this),this.pos===Bt&&this.skip(ht)}return C},readMessage:function(U,C){return this.readFields(U,C,this.readVarint()+this.pos)},readFixed32:function(){var U=F0(this.buf,this.pos);return this.pos+=4,U},readSFixed32:function(){var U=Fv(this.buf,this.pos);return this.pos+=4,U},readFixed64:function(){var U=F0(this.buf,this.pos)+F0(this.buf,this.pos+4)*$f;return this.pos+=8,U},readSFixed64:function(){var U=F0(this.buf,this.pos)+Fv(this.buf,this.pos+4)*$f;return this.pos+=8,U},readFloat:function(){var U=Yp(this.buf,this.pos,!0,23,4);return this.pos+=4,U},readDouble:function(){var U=Yp(this.buf,this.pos,!0,52,8);return this.pos+=8,U},readVarint:function(U){var C,J,ht=this.buf;return C=127&(J=ht[this.pos++]),J<128?C:(C|=(127&(J=ht[this.pos++]))<<7,J<128?C:(C|=(127&(J=ht[this.pos++]))<<14,J<128?C:(C|=(127&(J=ht[this.pos++]))<<21,J<128?C:function(At,Bt,jt){var ae,me,Ie=jt.buf;if(ae=(112&(me=Ie[jt.pos++]))>>4,me<128||(ae|=(127&(me=Ie[jt.pos++]))<<3,me<128)||(ae|=(127&(me=Ie[jt.pos++]))<<10,me<128)||(ae|=(127&(me=Ie[jt.pos++]))<<17,me<128)||(ae|=(127&(me=Ie[jt.pos++]))<<24,me<128)||(ae|=(1&(me=Ie[jt.pos++]))<<31,me<128))return $g(At,ae,Bt);throw new Error("Expected varint not more than 10 bytes")}(C|=(15&(J=ht[this.pos]))<<28,U,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var U=this.readVarint();return U%2==1?(U+1)/-2:U/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var U=this.readVarint()+this.pos,C=this.pos;return this.pos=U,U-C>=12&&Ip?function(J,ht,At){return Ip.decode(J.subarray(ht,At))}(this.buf,C,U):function(J,ht,At){for(var Bt="",jt=ht;jt<At;){var ae,me,Ie,Ge=J[jt],Ke=null,vr=Ge>239?4:Ge>223?3:Ge>191?2:1;if(jt+vr>At)break;vr===1?Ge<128&&(Ke=Ge):vr===2?(192&(ae=J[jt+1]))==128&&(Ke=(31&Ge)<<6|63&ae)<=127&&(Ke=null):vr===3?(me=J[jt+2],(192&(ae=J[jt+1]))==128&&(192&me)==128&&((Ke=(15&Ge)<<12|(63&ae)<<6|63&me)<=2047||Ke>=55296&&Ke<=57343)&&(Ke=null)):vr===4&&(me=J[jt+2],Ie=J[jt+3],(192&(ae=J[jt+1]))==128&&(192&me)==128&&(192&Ie)==128&&((Ke=(15&Ge)<<18|(63&ae)<<12|(63&me)<<6|63&Ie)<=65535||Ke>=1114112)&&(Ke=null)),Ke===null?(Ke=65533,vr=1):Ke>65535&&(Ke-=65536,Bt+=String.fromCharCode(Ke>>>10&1023|55296),Ke=56320|1023&Ke),Bt+=String.fromCharCode(Ke),jt+=vr}return Bt}(this.buf,C,U)},readBytes:function(){var U=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,U);return this.pos=U,C},readPackedVarint:function(U,C){if(this.type!==vl.Bytes)return U.push(this.readVarint(C));var J=Af(this);for(U=U||[];this.pos<J;)U.push(this.readVarint(C));return U},readPackedSVarint:function(U){if(this.type!==vl.Bytes)return U.push(this.readSVarint());var C=Af(this);for(U=U||[];this.pos<C;)U.push(this.readSVarint());return U},readPackedBoolean:function(U){if(this.type!==vl.Bytes)return U.push(this.readBoolean());var C=Af(this);for(U=U||[];this.pos<C;)U.push(this.readBoolean());return U},readPackedFloat:function(U){if(this.type!==vl.Bytes)return U.push(this.readFloat());var C=Af(this);for(U=U||[];this.pos<C;)U.push(this.readFloat());return U},readPackedDouble:function(U){if(this.type!==vl.Bytes)return U.push(this.readDouble());var C=Af(this);for(U=U||[];this.pos<C;)U.push(this.readDouble());return U},readPackedFixed32:function(U){if(this.type!==vl.Bytes)return U.push(this.readFixed32());var C=Af(this);for(U=U||[];this.pos<C;)U.push(this.readFixed32());return U},readPackedSFixed32:function(U){if(this.type!==vl.Bytes)return U.push(this.readSFixed32());var C=Af(this);for(U=U||[];this.pos<C;)U.push(this.readSFixed32());return U},readPackedFixed64:function(U){if(this.type!==vl.Bytes)return U.push(this.readFixed64());var C=Af(this);for(U=U||[];this.pos<C;)U.push(this.readFixed64());return U},readPackedSFixed64:function(U){if(this.type!==vl.Bytes)return U.push(this.readSFixed64());var C=Af(this);for(U=U||[];this.pos<C;)U.push(this.readSFixed64());return U},skip:function(U){var C=7&U;if(C===vl.Varint)for(;this.buf[this.pos++]>127;);else if(C===vl.Bytes)this.pos=this.readVarint()+this.pos;else if(C===vl.Fixed32)this.pos+=4;else{if(C!==vl.Fixed64)throw new Error("Unimplemented type: "+C);this.pos+=8}},writeTag:function(U,C){this.writeVarint(U<<3|C)},realloc:function(U){for(var C=this.length||16;C<this.pos+U;)C*=2;if(C!==this.length){var J=new Uint8Array(C);J.set(this.buf),this.buf=J,this.length=C}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(U){this.realloc(4),td(this.buf,U,this.pos),this.pos+=4},writeSFixed32:function(U){this.realloc(4),td(this.buf,U,this.pos),this.pos+=4},writeFixed64:function(U){this.realloc(8),td(this.buf,-1&U,this.pos),td(this.buf,Math.floor(U*z0),this.pos+4),this.pos+=8},writeSFixed64:function(U){this.realloc(8),td(this.buf,-1&U,this.pos),td(this.buf,Math.floor(U*z0),this.pos+4),this.pos+=8},writeVarint:function(U){(U=+U||0)>268435455||U<0?function(C,J){var ht,At;if(C>=0?(ht=C%4294967296|0,At=C/4294967296|0):(At=~(-C/4294967296),4294967295^(ht=~(-C%4294967296))?ht=ht+1|0:(ht=0,At=At+1|0)),C>=18446744073709552e3||C<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");J.realloc(10),function(Bt,jt,ae){ae.buf[ae.pos++]=127&Bt|128,Bt>>>=7,ae.buf[ae.pos++]=127&Bt|128,Bt>>>=7,ae.buf[ae.pos++]=127&Bt|128,Bt>>>=7,ae.buf[ae.pos++]=127&Bt|128,ae.buf[ae.pos]=127&(Bt>>>=7)}(ht,0,J),function(Bt,jt){var ae=(7&Bt)<<4;jt.buf[jt.pos++]|=ae|((Bt>>>=3)?128:0),Bt&&(jt.buf[jt.pos++]=127&Bt|((Bt>>>=7)?128:0),Bt&&(jt.buf[jt.pos++]=127&Bt|((Bt>>>=7)?128:0),Bt&&(jt.buf[jt.pos++]=127&Bt|((Bt>>>=7)?128:0),Bt&&(jt.buf[jt.pos++]=127&Bt|((Bt>>>=7)?128:0),Bt&&(jt.buf[jt.pos++]=127&Bt)))))}(At,J)}(U,this):(this.realloc(4),this.buf[this.pos++]=127&U|(U>127?128:0),U<=127||(this.buf[this.pos++]=127&(U>>>=7)|(U>127?128:0),U<=127||(this.buf[this.pos++]=127&(U>>>=7)|(U>127?128:0),U<=127||(this.buf[this.pos++]=U>>>7&127))))},writeSVarint:function(U){this.writeVarint(U<0?2*-U-1:2*U)},writeBoolean:function(U){this.writeVarint(!!U)},writeString:function(U){U=String(U),this.realloc(4*U.length),this.pos++;var C=this.pos;this.pos=function(ht,At,Bt){for(var jt,ae,me=0;me<At.length;me++){if((jt=At.charCodeAt(me))>55295&&jt<57344){if(!ae){jt>56319||me+1===At.length?(ht[Bt++]=239,ht[Bt++]=191,ht[Bt++]=189):ae=jt;continue}if(jt<56320){ht[Bt++]=239,ht[Bt++]=191,ht[Bt++]=189,ae=jt;continue}jt=ae-55296<<10|jt-56320|65536,ae=null}else ae&&(ht[Bt++]=239,ht[Bt++]=191,ht[Bt++]=189,ae=null);jt<128?ht[Bt++]=jt:(jt<2048?ht[Bt++]=jt>>6|192:(jt<65536?ht[Bt++]=jt>>12|224:(ht[Bt++]=jt>>18|240,ht[Bt++]=jt>>12&63|128),ht[Bt++]=jt>>6&63|128),ht[Bt++]=63&jt|128)}return Bt}(this.buf,U,this.pos);var J=this.pos-C;J>=128&&Kp(C,J,this),this.pos=C-1,this.writeVarint(J),this.pos+=J},writeFloat:function(U){this.realloc(4),D0(this.buf,U,this.pos,!0,23,4),this.pos+=4},writeDouble:function(U){this.realloc(8),D0(this.buf,U,this.pos,!0,52,8),this.pos+=8},writeBytes:function(U){var C=U.length;this.writeVarint(C),this.realloc(C);for(var J=0;J<C;J++)this.buf[this.pos++]=U[J]},writeRawMessage:function(U,C){this.pos++;var J=this.pos;U(C,this);var ht=this.pos-J;ht>=128&&Kp(J,ht,this),this.pos=J-1,this.writeVarint(ht),this.pos+=ht},writeMessage:function(U,C,J){this.writeTag(U,vl.Bytes),this.writeRawMessage(C,J)},writePackedVarint:function(U,C){C.length&&this.writeMessage(U,a_,C)},writePackedSVarint:function(U,C){C.length&&this.writeMessage(U,i_,C)},writePackedBoolean:function(U,C){C.length&&this.writeMessage(U,l_,C)},writePackedFloat:function(U,C){C.length&&this.writeMessage(U,o_,C)},writePackedDouble:function(U,C){C.length&&this.writeMessage(U,s_,C)},writePackedFixed32:function(U,C){C.length&&this.writeMessage(U,u_,C)},writePackedSFixed32:function(U,C){C.length&&this.writeMessage(U,c_,C)},writePackedFixed64:function(U,C){C.length&&this.writeMessage(U,h_,C)},writePackedSFixed64:function(U,C){C.length&&this.writeMessage(U,O0,C)},writeBytesField:function(U,C){this.writeTag(U,vl.Bytes),this.writeBytes(C)},writeFixed32Field:function(U,C){this.writeTag(U,vl.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(U,C){this.writeTag(U,vl.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(U,C){this.writeTag(U,vl.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(U,C){this.writeTag(U,vl.Fixed64),this.writeSFixed64(C)},writeVarintField:function(U,C){this.writeTag(U,vl.Varint),this.writeVarint(C)},writeSVarintField:function(U,C){this.writeTag(U,vl.Varint),this.writeSVarint(C)},writeStringField:function(U,C){this.writeTag(U,vl.Bytes),this.writeString(C)},writeFloatField:function(U,C){this.writeTag(U,vl.Fixed32),this.writeFloat(C)},writeDoubleField:function(U,C){this.writeTag(U,vl.Fixed64),this.writeDouble(C)},writeBooleanField:function(U,C){this.writeVarintField(U,!!C)}};var Jg=r(Pp);let B0=3;function f_(U,C,J){U===1&&J.readMessage(Bv,C)}function Bv(U,C,J){if(U===3){let{id:ht,bitmap:At,width:Bt,height:jt,left:ae,top:me,advance:Ie}=J.readMessage(Qg,{});C.push({id:ht,bitmap:new ml({width:Bt+2*B0,height:jt+2*B0},At),metrics:{width:Bt,height:jt,left:ae,top:me,advance:Ie}})}}function Qg(U,C,J){U===1?C.id=J.readVarint():U===2?C.bitmap=J.readBytes():U===3?C.width=J.readVarint():U===4?C.height=J.readVarint():U===5?C.left=J.readSVarint():U===6?C.top=J.readSVarint():U===7&&(C.advance=J.readVarint())}let Yg=B0;function R0(U){let C=0,J=0;for(let jt of U)C+=jt.w*jt.h,J=Math.max(J,jt.w);U.sort((jt,ae)=>ae.h-jt.h);let ht=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(C/.95)),J),h:1/0}],At=0,Bt=0;for(let jt of U)for(let ae=ht.length-1;ae>=0;ae--){let me=ht[ae];if(!(jt.w>me.w||jt.h>me.h)){if(jt.x=me.x,jt.y=me.y,Bt=Math.max(Bt,jt.y+jt.h),At=Math.max(At,jt.x+jt.w),jt.w===me.w&&jt.h===me.h){let Ie=ht.pop();ae<ht.length&&(ht[ae]=Ie)}else jt.h===me.h?(me.x+=jt.w,me.w-=jt.w):jt.w===me.w?(me.y+=jt.h,me.h-=jt.h):(ht.push({x:me.x+jt.w,y:me.y,w:me.w-jt.w,h:jt.h}),me.y+=jt.h,me.h-=jt.h);break}}return{w:At,h:Bt,fill:C/(At*Bt)||0}}let Tc=1;class fh{constructor(C,{pixelRatio:J,version:ht,stretchX:At,stretchY:Bt,content:jt,textFitWidth:ae,textFitHeight:me}){this.paddedRect=C,this.pixelRatio=J,this.stretchX=At,this.stretchY=Bt,this.content=jt,this.version=ht,this.textFitWidth=ae,this.textFitHeight=me}get tl(){return[this.paddedRect.x+Tc,this.paddedRect.y+Tc]}get br(){return[this.paddedRect.x+this.paddedRect.w-Tc,this.paddedRect.y+this.paddedRect.h-Tc]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*Tc)/this.pixelRatio,(this.paddedRect.h-2*Tc)/this.pixelRatio]}}class Rv{constructor(C,J){let ht={},At={};this.haveRenderCallbacks=[];let Bt=[];this.addImages(C,ht,Bt),this.addImages(J,At,Bt);let{w:jt,h:ae}=R0(Bt),me=new Gs({width:jt||1,height:ae||1});for(let Ie in C){let Ge=C[Ie],Ke=ht[Ie].paddedRect;Gs.copy(Ge.data,me,{x:0,y:0},{x:Ke.x+Tc,y:Ke.y+Tc},Ge.data)}for(let Ie in J){let Ge=J[Ie],Ke=At[Ie].paddedRect,vr=Ke.x+Tc,Cr=Ke.y+Tc,Nr=Ge.data.width,$r=Ge.data.height;Gs.copy(Ge.data,me,{x:0,y:0},{x:vr,y:Cr},Ge.data),Gs.copy(Ge.data,me,{x:0,y:$r-1},{x:vr,y:Cr-1},{width:Nr,height:1}),Gs.copy(Ge.data,me,{x:0,y:0},{x:vr,y:Cr+$r},{width:Nr,height:1}),Gs.copy(Ge.data,me,{x:Nr-1,y:0},{x:vr-1,y:Cr},{width:1,height:$r}),Gs.copy(Ge.data,me,{x:0,y:0},{x:vr+Nr,y:Cr},{width:1,height:$r})}this.image=me,this.iconPositions=ht,this.patternPositions=At}addImages(C,J,ht){for(let At in C){let Bt=C[At],jt={x:0,y:0,w:Bt.data.width+2*Tc,h:Bt.data.height+2*Tc};ht.push(jt),J[At]=new fh(jt,Bt),Bt.hasRenderCallback&&this.haveRenderCallbacks.push(At)}}patchUpdatedImages(C,J){C.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let ht in C.updatedImages)this.patchUpdatedImage(this.iconPositions[ht],C.getImage(ht),J),this.patchUpdatedImage(this.patternPositions[ht],C.getImage(ht),J)}patchUpdatedImage(C,J,ht){if(!C||!J||C.version===J.version)return;C.version=J.version;let[At,Bt]=C.tl;ht.update(J.data,void 0,{x:At,y:Bt})}}var fp;qn("ImagePosition",fh),qn("ImageAtlas",Rv),t.ah=void 0,(fp=t.ah||(t.ah={}))[fp.none=0]="none",fp[fp.horizontal=1]="horizontal",fp[fp.vertical=2]="vertical",fp[fp.horizontalOnly=3]="horizontalOnly";let ed=-17;class Zd{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(C,J){let ht=new Zd;return ht.scale=C||1,ht.fontStack=J,ht}static forImage(C){let J=new Zd;return J.imageName=C,J}}class rd{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(C,J){let ht=new rd;for(let At=0;At<C.sections.length;At++){let Bt=C.sections[At];Bt.image?ht.addImageSection(Bt):ht.addTextSection(Bt,J)}return ht}length(){return this.text.length}getSection(C){return this.sections[this.sectionIndex[C]]}getSectionIndex(C){return this.sectionIndex[C]}getCharCode(C){return this.text.charCodeAt(C)}verticalizePunctuation(){this.text=function(C){let J="";for(let ht=0;ht<C.length;ht++){let At=C.charCodeAt(ht+1)||null,Bt=C.charCodeAt(ht-1)||null;J+=At&&Qs(At)&&!Nc[C[ht+1]]||Bt&&Qs(Bt)&&!Nc[C[ht-1]]||!Nc[C[ht]]?C[ht]:Nc[C[ht]]}return J}(this.text)}trim(){let C=0;for(let ht=0;ht<this.text.length&&N0[this.text.charCodeAt(ht)];ht++)C++;let J=this.text.length;for(let ht=this.text.length-1;ht>=0&&ht>=C&&N0[this.text.charCodeAt(ht)];ht--)J--;this.text=this.text.substring(C,J),this.sectionIndex=this.sectionIndex.slice(C,J)}substring(C,J){let ht=new rd;return ht.text=this.text.substring(C,J),ht.sectionIndex=this.sectionIndex.slice(C,J),ht.sections=this.sections,ht}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((C,J)=>Math.max(C,this.sections[J].scale),0)}addTextSection(C,J){this.text+=C.text,this.sections.push(Zd.forText(C.scale,C.fontStack||J));let ht=this.sections.length-1;for(let At=0;At<C.text.length;++At)this.sectionIndex.push(ht)}addImageSection(C){let J=C.image?C.image.name:"";if(J.length===0)return void _("Can't add FormattedSection with an empty image.");let ht=this.getNextImageSectionCharCode();ht?(this.text+=String.fromCharCode(ht),this.sections.push(Zd.forImage(J)),this.sectionIndex.push(this.sections.length-1)):_("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function j0(U,C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr,Cr,Nr){let $r=rd.fromFeature(U,At),cn;Ke===t.ah.vertical&&$r.verticalizePunctuation();let{processBidirectionalText:Pn,processStyledBidirectionalText:ua}=ds;if(Pn&&$r.sections.length===1){cn=[];let Sa=Pn($r.toString(),Lp($r,Ie,Bt,C,ht,Cr));for(let Ya of Sa){let Qi=new rd;Qi.text=Ya,Qi.sections=$r.sections;for(let Vo=0;Vo<Ya.length;Vo++)Qi.sectionIndex.push(0);cn.push(Qi)}}else if(ua){cn=[];let Sa=ua($r.text,$r.sectionIndex,Lp($r,Ie,Bt,C,ht,Cr));for(let Ya of Sa){let Qi=new rd;Qi.text=Ya[0],Qi.sectionIndex=Ya[1],Qi.sections=$r.sections,cn.push(Qi)}}else cn=function(Sa,Ya){let Qi=[],Vo=Sa.text,Vi=0;for(let zi of Ya)Qi.push(Sa.substring(Vi,zi)),Vi=zi;return Vi<Vo.length&&Qi.push(Sa.substring(Vi,Vo.length)),Qi}($r,Lp($r,Ie,Bt,C,ht,Cr));let Un=[],Kn={positionedLines:Un,text:$r.toString(),top:Ge[1],bottom:Ge[1],left:Ge[0],right:Ge[0],writingMode:Ke,iconsInText:!1,verticalizable:!1};return function(Sa,Ya,Qi,Vo,Vi,zi,xo,so,Ki,Oa,To,_o){let Ko=0,Bl=ed,Dl=0,Uc=0,Kh=so==="right"?1:so==="left"?0:.5,cc=0;for(let Ou of Vi){Ou.trim();let Vc=Ou.getMaxScale(),Mh=(Vc-1)*ol,dh={positionedGlyphs:[],lineOffset:0};Sa.positionedLines[cc]=dh;let Nh=dh.positionedGlyphs,Kc=0;if(!Ou.length()){Bl+=zi,++cc;continue}for(let iu=0;iu<Ou.length();iu++){let Js=Ou.getSection(iu),yl=Ou.getSectionIndex(iu),Al=Ou.getCharCode(iu),ku=0,ou=null,hd=null,Mf=null,Sf=ol,Sh=!(Ki===t.ah.horizontal||!To&&!No(Al)||To&&(N0[Al]||(kc=Al,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(kc)))));if(Js.imageName){let Rl=Vo[Js.imageName];if(!Rl)continue;Mf=Js.imageName,Sa.iconsInText=Sa.iconsInText||!0,hd=Rl.paddedRect;let th=Rl.displaySize;Js.scale=Js.scale*ol/_o,ou={width:th[0],height:th[1],left:Tc,top:-Yg,advance:Sh?th[1]:th[0]},ku=Mh+(ol-th[1]*Js.scale),Sf=ou.advance;let bf=Sh?th[0]*Js.scale-ol*Vc:th[1]*Js.scale-ol*Vc;bf>0&&bf>Kc&&(Kc=bf)}else{let Rl=Qi[Js.fontStack],th=Rl&&Rl[Al];if(th&&th.rect)hd=th.rect,ou=th.metrics;else{let bf=Ya[Js.fontStack],hf=bf&&bf[Al];if(!hf)continue;ou=hf.metrics}ku=(Vc-Js.scale)*ol}Sh?(Sa.verticalizable=!0,Nh.push({glyph:Al,imageName:Mf,x:Ko,y:Bl+ku,vertical:Sh,scale:Js.scale,fontStack:Js.fontStack,sectionIndex:yl,metrics:ou,rect:hd}),Ko+=Sf*Js.scale+Oa):(Nh.push({glyph:Al,imageName:Mf,x:Ko,y:Bl+ku,vertical:Sh,scale:Js.scale,fontStack:Js.fontStack,sectionIndex:yl,metrics:ou,rect:hd}),Ko+=ou.advance*Js.scale+Oa)}Nh.length!==0&&(Dl=Math.max(Ko-Oa,Dl),g_(Nh,0,Nh.length-1,Kh,Kc)),Ko=0;let cf=zi*Vc+Kc;dh.lineOffset=Math.max(Kc,Mh),Bl+=cf,Uc=Math.max(cf,Uc),++cc}var kc;let Bh=Bl-ed,{horizontalAlign:Rh,verticalAlign:jh}=tm(xo);(function(Ou,Vc,Mh,dh,Nh,Kc,cf,iu,Js){let yl=(Vc-Mh)*Nh,Al=0;Al=Kc!==cf?-iu*dh-ed:(-dh*Js+.5)*cf;for(let ku of Ou)for(let ou of ku.positionedGlyphs)ou.x+=yl,ou.y+=Al})(Sa.positionedLines,Kh,Rh,jh,Dl,Uc,zi,Bh,Vi.length),Sa.top+=-jh*Bh,Sa.bottom=Sa.top+Bh,Sa.left+=-Rh*Dl,Sa.right=Sa.left+Dl}(Kn,C,J,ht,cn,jt,ae,me,Ke,Ie,vr,Nr),!function(Sa){for(let Ya of Sa)if(Ya.positionedGlyphs.length!==0)return!1;return!0}(Un)&&Kn}let N0={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},p_={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},d_={40:!0};function U0(U,C,J,ht,At,Bt){if(C.imageName){let jt=ht[C.imageName];return jt?jt.displaySize[0]*C.scale*ol/Bt+At:0}{let jt=J[C.fontStack],ae=jt&&jt[U];return ae?ae.metrics.advance*C.scale+At:0}}function jv(U,C,J,ht){let At=Math.pow(U-C,2);return ht?U<C?At/2:2*At:At+Math.abs(J)*J}function V0(U,C,J){let ht=0;return U===10&&(ht-=1e4),J&&(ht+=150),U!==40&&U!==65288||(ht+=50),C!==41&&C!==65289||(ht+=50),ht}function Kg(U,C,J,ht,At,Bt){let jt=null,ae=jv(C,J,At,Bt);for(let me of ht){let Ie=jv(C-me.x,J,At,Bt)+me.badness;Ie<=ae&&(jt=me,ae=Ie)}return{index:U,x:C,priorBreak:jt,badness:ae}}function Jf(U){return U?Jf(U.priorBreak).concat(U.index):[]}function Lp(U,C,J,ht,At,Bt){if(!U)return[];let jt=[],ae=function(Ke,vr,Cr,Nr,$r,cn){let Pn=0;for(let ua=0;ua<Ke.length();ua++){let Un=Ke.getSection(ua);Pn+=U0(Ke.getCharCode(ua),Un,Nr,$r,vr,cn)}return Pn/Math.max(1,Math.ceil(Pn/Cr))}(U,C,J,ht,At,Bt),me=U.text.indexOf("")>=0,Ie=0;for(let Ke=0;Ke<U.length();Ke++){let vr=U.getSection(Ke),Cr=U.getCharCode(Ke);if(N0[Cr]||(Ie+=U0(Cr,vr,ht,At,C,Bt)),Ke<U.length()-1){let Nr=!((Ge=Cr)<11904)&&(!!ba["CJK Compatibility Forms"](Ge)||!!ba["CJK Compatibility"](Ge)||!!ba["CJK Strokes"](Ge)||!!ba["CJK Symbols and Punctuation"](Ge)||!!ba["Enclosed CJK Letters and Months"](Ge)||!!ba["Halfwidth and Fullwidth Forms"](Ge)||!!ba["Ideographic Description Characters"](Ge)||!!ba["Vertical Forms"](Ge)||xs.test(String.fromCodePoint(Ge)));(p_[Cr]||Nr||vr.imageName||Ke!==U.length()-2&&d_[U.getCharCode(Ke+1)])&&jt.push(Kg(Ke+1,Ie,ae,jt,V0(Cr,U.getCharCode(Ke+1),Nr&&me),!1))}}var Ge;return Jf(Kg(U.length(),Ie,ae,jt,0,!0))}function tm(U){let C=.5,J=.5;switch(U){case"right":case"top-right":case"bottom-right":C=1;break;case"left":case"top-left":case"bottom-left":C=0}switch(U){case"bottom":case"bottom-right":case"bottom-left":J=1;break;case"top":case"top-right":case"top-left":J=0}return{horizontalAlign:C,verticalAlign:J}}function g_(U,C,J,ht,At){if(!ht&&!At)return;let Bt=U[J],jt=(U[J].x+Bt.metrics.advance*Bt.scale)*ht;for(let ae=C;ae<=J;ae++)U[ae].x-=jt,U[ae].y+=At}function m_(U,C,J){let{horizontalAlign:ht,verticalAlign:At}=tm(J),Bt=C[0]-U.displaySize[0]*ht,jt=C[1]-U.displaySize[1]*At;return{image:U,top:jt,bottom:jt+U.displaySize[1],left:Bt,right:Bt+U.displaySize[0]}}function Nv(U){var C,J;let ht=U.left,At=U.top,Bt=U.right-ht,jt=U.bottom-At,ae=(C=U.image.textFitWidth)!==null&&C!==void 0?C:"stretchOrShrink",me=(J=U.image.textFitHeight)!==null&&J!==void 0?J:"stretchOrShrink",Ie=(U.image.content[2]-U.image.content[0])/(U.image.content[3]-U.image.content[1]);if(me==="proportional"){if(ae==="stretchOnly"&&Bt/jt<Ie||ae==="proportional"){let Ge=Math.ceil(jt*Ie);ht*=Ge/Bt,Bt=Ge}}else if(ae==="proportional"&&me==="stretchOnly"&&Ie!==0&&Bt/jt>Ie){let Ge=Math.ceil(Bt/Ie);At*=Ge/jt,jt=Ge}return{x1:ht,y1:At,x2:ht+Bt,y2:At+jt}}function Uv(U,C,J,ht,At,Bt){let jt=U.image,ae;if(jt.content){let cn=jt.content,Pn=jt.pixelRatio||1;ae=[cn[0]/Pn,cn[1]/Pn,jt.displaySize[0]-cn[2]/Pn,jt.displaySize[1]-cn[3]/Pn]}let me=C.left*Bt,Ie=C.right*Bt,Ge,Ke,vr,Cr;J==="width"||J==="both"?(Cr=At[0]+me-ht[3],Ke=At[0]+Ie+ht[1]):(Cr=At[0]+(me+Ie-jt.displaySize[0])/2,Ke=Cr+jt.displaySize[0]);let Nr=C.top*Bt,$r=C.bottom*Bt;return J==="height"||J==="both"?(Ge=At[1]+Nr-ht[0],vr=At[1]+$r+ht[2]):(Ge=At[1]+(Nr+$r-jt.displaySize[1])/2,vr=Ge+jt.displaySize[1]),{image:jt,top:Ge,right:Ke,bottom:vr,left:Cr,collisionPadding:ae}}let Xd=255,Ff=128,pp=Xd*Ff;function Vv(U,C){let{expression:J}=C;if(J.kind==="constant")return{kind:"constant",layoutSize:J.evaluate(new Qo(U+1))};if(J.kind==="source")return{kind:"source"};{let{zoomStops:ht,interpolationType:At}=J,Bt=0;for(;Bt<ht.length&&ht[Bt]<=U;)Bt++;Bt=Math.max(0,Bt-1);let jt=Bt;for(;jt<ht.length&&ht[jt]<U+1;)jt++;jt=Math.min(ht.length-1,jt);let ae=ht[Bt],me=ht[jt];return J.kind==="composite"?{kind:"composite",minZoom:ae,maxZoom:me,interpolationType:At}:{kind:"camera",minZoom:ae,maxZoom:me,minSize:J.evaluate(new Qo(ae)),maxSize:J.evaluate(new Qo(me)),interpolationType:At}}}function em(U,C,J){let ht="never",At=U.get(C);return At?ht=At:U.get(J)&&(ht="always"),ht}let v_=ea.VectorTileFeature.types,rm=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function q0(U,C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr){let Cr=ae?Math.min(pp,Math.round(ae[0])):0,Nr=ae?Math.min(pp,Math.round(ae[1])):0;U.emplaceBack(C,J,Math.round(32*ht),Math.round(32*At),Bt,jt,(Cr<<1)+(me?1:0),Nr,16*Ie,16*Ge,256*Ke,256*vr)}function dp(U,C,J){U.emplaceBack(C.x,C.y,J),U.emplaceBack(C.x,C.y,J),U.emplaceBack(C.x,C.y,J),U.emplaceBack(C.x,C.y,J)}function y_(U){for(let C of U.sections)if(to(C.text))return!0;return!1}class Vu{constructor(C){this.layoutVertexArray=new Xt,this.indexArray=new Ce,this.programConfigurations=C,this.segments=new jr,this.dynamicLayoutVertexArray=new se,this.opacityVertexArray=new fe,this.hasVisibleVertices=!1,this.placedSymbolArray=new li}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(C,J,ht,At){this.isEmpty()||(ht&&(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,hp.members),this.indexBuffer=C.createIndexBuffer(this.indexArray,J),this.dynamicLayoutVertexBuffer=C.createVertexBuffer(this.dynamicLayoutVertexArray,Jp.members,!0),this.opacityVertexBuffer=C.createVertexBuffer(this.opacityVertexArray,rm,!0),this.opacityVertexBuffer.itemSize=1),(ht||At)&&this.programConfigurations.upload(C))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}qn("SymbolBuffers",Vu);class nd{constructor(C,J,ht){this.layoutVertexArray=new C,this.layoutAttributes=J,this.indexArray=new ht,this.segments=new jr,this.collisionVertexArray=new De}upload(C){this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=C.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=C.createVertexBuffer(this.collisionVertexArray,Qp.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}qn("CollisionBuffers",nd);class Cp{constructor(C){this.collisionBoxArray=C.collisionBoxArray,this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(jt=>jt.id),this.index=C.index,this.pixelRatio=C.pixelRatio,this.sourceLayerIndex=C.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Ma([]),this.placementViewportMatrix=Ma([]);let J=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Vv(this.zoom,J["text-size"]),this.iconSizeData=Vv(this.zoom,J["icon-size"]);let ht=this.layers[0].layout,At=ht.get("symbol-sort-key"),Bt=ht.get("symbol-z-order");this.canOverlap=em(ht,"text-overlap","text-allow-overlap")!=="never"||em(ht,"icon-overlap","icon-allow-overlap")!=="never"||ht.get("text-ignore-placement")||ht.get("icon-ignore-placement"),this.sortFeaturesByKey=Bt!=="viewport-y"&&!At.isConstant(),this.sortFeaturesByY=(Bt==="viewport-y"||Bt==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,ht.get("symbol-placement")==="point"&&(this.writingModes=ht.get("text-writing-mode").map(jt=>t.ah[jt])),this.stateDependentLayerIds=this.layers.filter(jt=>jt.isStateDependent()).map(jt=>jt.id),this.sourceID=C.sourceID}createArrays(){this.text=new Vu(new us(this.layers,this.zoom,C=>/^text/.test(C))),this.icon=new Vu(new us(this.layers,this.zoom,C=>/^icon/.test(C))),this.glyphOffsetArray=new jo,this.lineVertexArray=new Uo,this.symbolInstances=new Gi,this.textAnchorOffsets=new Go}calculateGlyphDependencies(C,J,ht,At,Bt){for(let jt=0;jt<C.length;jt++)if(J[C.charCodeAt(jt)]=!0,(ht||At)&&Bt){let ae=Nc[C.charAt(jt)];ae&&(J[ae.charCodeAt(0)]=!0)}}populate(C,J,ht){let At=this.layers[0],Bt=At.layout,jt=Bt.get("text-font"),ae=Bt.get("text-field"),me=Bt.get("icon-image"),Ie=(ae.value.kind!=="constant"||ae.value.value instanceof rn&&!ae.value.value.isEmpty()||ae.value.value.toString().length>0)&&(jt.value.kind!=="constant"||jt.value.value.length>0),Ge=me.value.kind!=="constant"||!!me.value.value||Object.keys(me.parameters).length>0,Ke=Bt.get("symbol-sort-key");if(this.features=[],!Ie&&!Ge)return;let vr=J.iconDependencies,Cr=J.glyphDependencies,Nr=J.availableImages,$r=new Qo(this.zoom);for(let{feature:cn,id:Pn,index:ua,sourceLayerIndex:Un}of C){let Kn=At._featureFilter.needGeometry,Sa=gn(cn,Kn);if(!At._featureFilter.filter($r,Sa,ht))continue;let Ya,Qi;if(Kn||(Sa.geometry=fn(cn)),Ie){let Vi=At.getValueAndResolveTokens("text-field",Sa,ht,Nr),zi=rn.factory(Vi),xo=this.hasRTLText=this.hasRTLText||y_(zi);(!xo||ds.getRTLTextPluginStatus()==="unavailable"||xo&&ds.isParsed())&&(Ya=zu(zi,At,Sa))}if(Ge){let Vi=At.getValueAndResolveTokens("icon-image",Sa,ht,Nr);Qi=Vi instanceof Fn?Vi:Fn.fromString(Vi)}if(!Ya&&!Qi)continue;let Vo=this.sortFeaturesByKey?Ke.evaluate(Sa,{},ht):void 0;if(this.features.push({id:Pn,text:Ya,icon:Qi,index:ua,sourceLayerIndex:Un,geometry:Sa.geometry,properties:cn.properties,type:v_[cn.type],sortKey:Vo}),Qi&&(vr[Qi.name]=!0),Ya){let Vi=jt.evaluate(Sa,{},ht).join(","),zi=Bt.get("text-rotation-alignment")!=="viewport"&&Bt.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.ah.vertical)>=0;for(let xo of Ya.sections)if(xo.image)vr[xo.image.name]=!0;else{let so=$i(Ya.toString()),Ki=xo.fontStack||Vi,Oa=Cr[Ki]=Cr[Ki]||{};this.calculateGlyphDependencies(xo.text,Oa,zi,this.allowVerticalPlacement,so)}}}Bt.get("symbol-placement")==="line"&&(this.features=function(cn){let Pn={},ua={},Un=[],Kn=0;function Sa(Vi){Un.push(cn[Vi]),Kn++}function Ya(Vi,zi,xo){let so=ua[Vi];return delete ua[Vi],ua[zi]=so,Un[so].geometry[0].pop(),Un[so].geometry[0]=Un[so].geometry[0].concat(xo[0]),so}function Qi(Vi,zi,xo){let so=Pn[zi];return delete Pn[zi],Pn[Vi]=so,Un[so].geometry[0].shift(),Un[so].geometry[0]=xo[0].concat(Un[so].geometry[0]),so}function Vo(Vi,zi,xo){let so=xo?zi[0][zi[0].length-1]:zi[0][0];return`${Vi}:${so.x}:${so.y}`}for(let Vi=0;Vi<cn.length;Vi++){let zi=cn[Vi],xo=zi.geometry,so=zi.text?zi.text.toString():null;if(!so){Sa(Vi);continue}let Ki=Vo(so,xo),Oa=Vo(so,xo,!0);if(Ki in ua&&Oa in Pn&&ua[Ki]!==Pn[Oa]){let To=Qi(Ki,Oa,xo),_o=Ya(Ki,Oa,Un[To].geometry);delete Pn[Ki],delete ua[Oa],ua[Vo(so,Un[_o].geometry,!0)]=_o,Un[To].geometry=null}else Ki in ua?Ya(Ki,Oa,xo):Oa in Pn?Qi(Ki,Oa,xo):(Sa(Vi),Pn[Ki]=Kn-1,ua[Oa]=Kn-1)}return Un.filter(Vi=>Vi.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((cn,Pn)=>cn.sortKey-Pn.sortKey)}update(C,J,ht){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(C,J,this.layers,ht),this.icon.programConfigurations.updatePaintArrays(C,J,this.layers,ht))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(C){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(C),this.iconCollisionBox.upload(C)),this.text.upload(C,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(C,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(C,J){let ht=this.lineVertexArray.length;if(C.segment!==void 0){let At=C.dist(J[C.segment+1]),Bt=C.dist(J[C.segment]),jt={};for(let ae=C.segment+1;ae<J.length;ae++)jt[ae]={x:J[ae].x,y:J[ae].y,tileUnitDistanceFromAnchor:At},ae<J.length-1&&(At+=J[ae+1].dist(J[ae]));for(let ae=C.segment||0;ae>=0;ae--)jt[ae]={x:J[ae].x,y:J[ae].y,tileUnitDistanceFromAnchor:Bt},ae>0&&(Bt+=J[ae-1].dist(J[ae]));for(let ae=0;ae<J.length;ae++){let me=jt[ae];this.lineVertexArray.emplaceBack(me.x,me.y,me.tileUnitDistanceFromAnchor)}}return{lineStartIndex:ht,lineLength:this.lineVertexArray.length-ht}}addSymbols(C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr){let Cr=C.indexArray,Nr=C.layoutVertexArray,$r=C.segments.prepareSegment(4*J.length,Nr,Cr,this.canOverlap?jt.sortKey:void 0),cn=this.glyphOffsetArray.length,Pn=$r.vertexLength,ua=this.allowVerticalPlacement&&ae===t.ah.vertical?Math.PI/2:0,Un=jt.text&&jt.text.sections;for(let Kn=0;Kn<J.length;Kn++){let{tl:Sa,tr:Ya,bl:Qi,br:Vo,tex:Vi,pixelOffsetTL:zi,pixelOffsetBR:xo,minFontScaleX:so,minFontScaleY:Ki,glyphOffset:Oa,isSDF:To,sectionIndex:_o}=J[Kn],Ko=$r.vertexLength,Bl=Oa[1];q0(Nr,me.x,me.y,Sa.x,Bl+Sa.y,Vi.x,Vi.y,ht,To,zi.x,zi.y,so,Ki),q0(Nr,me.x,me.y,Ya.x,Bl+Ya.y,Vi.x+Vi.w,Vi.y,ht,To,xo.x,zi.y,so,Ki),q0(Nr,me.x,me.y,Qi.x,Bl+Qi.y,Vi.x,Vi.y+Vi.h,ht,To,zi.x,xo.y,so,Ki),q0(Nr,me.x,me.y,Vo.x,Bl+Vo.y,Vi.x+Vi.w,Vi.y+Vi.h,ht,To,xo.x,xo.y,so,Ki),dp(C.dynamicLayoutVertexArray,me,ua),Cr.emplaceBack(Ko,Ko+1,Ko+2),Cr.emplaceBack(Ko+1,Ko+2,Ko+3),$r.vertexLength+=4,$r.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Oa[0]),Kn!==J.length-1&&_o===J[Kn+1].sectionIndex||C.programConfigurations.populatePaintArrays(Nr.length,jt,jt.index,{},vr,Un&&Un[_o])}C.placedSymbolArray.emplaceBack(me.x,me.y,cn,this.glyphOffsetArray.length-cn,Pn,Ie,Ge,me.segment,ht?ht[0]:0,ht?ht[1]:0,At[0],At[1],ae,0,!1,0,Ke)}_addCollisionDebugVertex(C,J,ht,At,Bt,jt){return J.emplaceBack(0,0),C.emplaceBack(ht.x,ht.y,At,Bt,Math.round(jt.x),Math.round(jt.y))}addCollisionDebugVertices(C,J,ht,At,Bt,jt,ae){let me=Bt.segments.prepareSegment(4,Bt.layoutVertexArray,Bt.indexArray),Ie=me.vertexLength,Ge=Bt.layoutVertexArray,Ke=Bt.collisionVertexArray,vr=ae.anchorX,Cr=ae.anchorY;this._addCollisionDebugVertex(Ge,Ke,jt,vr,Cr,new o(C,J)),this._addCollisionDebugVertex(Ge,Ke,jt,vr,Cr,new o(ht,J)),this._addCollisionDebugVertex(Ge,Ke,jt,vr,Cr,new o(ht,At)),this._addCollisionDebugVertex(Ge,Ke,jt,vr,Cr,new o(C,At)),me.vertexLength+=4;let Nr=Bt.indexArray;Nr.emplaceBack(Ie,Ie+1),Nr.emplaceBack(Ie+1,Ie+2),Nr.emplaceBack(Ie+2,Ie+3),Nr.emplaceBack(Ie+3,Ie),me.primitiveLength+=4}addDebugCollisionBoxes(C,J,ht,At){for(let Bt=C;Bt<J;Bt++){let jt=this.collisionBoxArray.get(Bt);this.addCollisionDebugVertices(jt.x1,jt.y1,jt.x2,jt.y2,At?this.textCollisionBox:this.iconCollisionBox,jt.anchorPoint,ht)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new nd(ve,kf.members,Qe),this.iconCollisionBox=new nd(ve,kf.members,Qe);for(let C=0;C<this.symbolInstances.length;C++){let J=this.symbolInstances.get(C);this.addDebugCollisionBoxes(J.textBoxStartIndex,J.textBoxEndIndex,J,!0),this.addDebugCollisionBoxes(J.verticalTextBoxStartIndex,J.verticalTextBoxEndIndex,J,!0),this.addDebugCollisionBoxes(J.iconBoxStartIndex,J.iconBoxEndIndex,J,!1),this.addDebugCollisionBoxes(J.verticalIconBoxStartIndex,J.verticalIconBoxEndIndex,J,!1)}}_deserializeCollisionBoxesForSymbol(C,J,ht,At,Bt,jt,ae,me,Ie){let Ge={};for(let Ke=J;Ke<ht;Ke++){let vr=C.get(Ke);Ge.textBox={x1:vr.x1,y1:vr.y1,x2:vr.x2,y2:vr.y2,anchorPointX:vr.anchorPointX,anchorPointY:vr.anchorPointY},Ge.textFeatureIndex=vr.featureIndex;break}for(let Ke=At;Ke<Bt;Ke++){let vr=C.get(Ke);Ge.verticalTextBox={x1:vr.x1,y1:vr.y1,x2:vr.x2,y2:vr.y2,anchorPointX:vr.anchorPointX,anchorPointY:vr.anchorPointY},Ge.verticalTextFeatureIndex=vr.featureIndex;break}for(let Ke=jt;Ke<ae;Ke++){let vr=C.get(Ke);Ge.iconBox={x1:vr.x1,y1:vr.y1,x2:vr.x2,y2:vr.y2,anchorPointX:vr.anchorPointX,anchorPointY:vr.anchorPointY},Ge.iconFeatureIndex=vr.featureIndex;break}for(let Ke=me;Ke<Ie;Ke++){let vr=C.get(Ke);Ge.verticalIconBox={x1:vr.x1,y1:vr.y1,x2:vr.x2,y2:vr.y2,anchorPointX:vr.anchorPointX,anchorPointY:vr.anchorPointY},Ge.verticalIconFeatureIndex=vr.featureIndex;break}return Ge}deserializeCollisionBoxes(C){this.collisionArrays=[];for(let J=0;J<this.symbolInstances.length;J++){let ht=this.symbolInstances.get(J);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(C,ht.textBoxStartIndex,ht.textBoxEndIndex,ht.verticalTextBoxStartIndex,ht.verticalTextBoxEndIndex,ht.iconBoxStartIndex,ht.iconBoxEndIndex,ht.verticalIconBoxStartIndex,ht.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(C,J){let ht=C.placedSymbolArray.get(J),At=ht.vertexStartIndex+4*ht.numGlyphs;for(let Bt=ht.vertexStartIndex;Bt<At;Bt+=4)C.indexArray.emplaceBack(Bt,Bt+1,Bt+2),C.indexArray.emplaceBack(Bt+1,Bt+2,Bt+3)}getSortedSymbolIndexes(C){if(this.sortedAngle===C&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let J=Math.sin(C),ht=Math.cos(C),At=[],Bt=[],jt=[];for(let ae=0;ae<this.symbolInstances.length;++ae){jt.push(ae);let me=this.symbolInstances.get(ae);At.push(0|Math.round(J*me.anchorX+ht*me.anchorY)),Bt.push(me.featureIndex)}return jt.sort((ae,me)=>At[ae]-At[me]||Bt[me]-Bt[ae]),jt}addToSortKeyRanges(C,J){let ht=this.sortKeyRanges[this.sortKeyRanges.length-1];ht&&ht.sortKey===J?ht.symbolInstanceEnd=C+1:this.sortKeyRanges.push({sortKey:J,symbolInstanceStart:C,symbolInstanceEnd:C+1})}sortFeatures(C){if(this.sortFeaturesByY&&this.sortedAngle!==C&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(C),this.sortedAngle=C,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let J of this.symbolInstanceIndexes){let ht=this.symbolInstances.get(J);this.featureSortOrder.push(ht.featureIndex),[ht.rightJustifiedTextSymbolIndex,ht.centerJustifiedTextSymbolIndex,ht.leftJustifiedTextSymbolIndex].forEach((At,Bt,jt)=>{At>=0&&jt.indexOf(At)===Bt&&this.addIndicesForPlacedSymbol(this.text,At)}),ht.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,ht.verticalPlacedTextSymbolIndex),ht.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,ht.placedIconSymbolIndex),ht.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,ht.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let $d,Jd;qn("SymbolBucket",Cp,{omit:["layers","collisionBoxArray","features","compareText"]}),Cp.MAX_GLYPHS=65535,Cp.addDynamicAttributes=dp;var nm={get paint(){return Jd=Jd||new Lt({"icon-opacity":new oo(it.paint_symbol["icon-opacity"]),"icon-color":new oo(it.paint_symbol["icon-color"]),"icon-halo-color":new oo(it.paint_symbol["icon-halo-color"]),"icon-halo-width":new oo(it.paint_symbol["icon-halo-width"]),"icon-halo-blur":new oo(it.paint_symbol["icon-halo-blur"]),"icon-translate":new Ri(it.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ri(it.paint_symbol["icon-translate-anchor"]),"text-opacity":new oo(it.paint_symbol["text-opacity"]),"text-color":new oo(it.paint_symbol["text-color"],{runtimeType:Fe,getOverride:U=>U.textColor,hasOverride:U=>!!U.textColor}),"text-halo-color":new oo(it.paint_symbol["text-halo-color"]),"text-halo-width":new oo(it.paint_symbol["text-halo-width"]),"text-halo-blur":new oo(it.paint_symbol["text-halo-blur"]),"text-translate":new Ri(it.paint_symbol["text-translate"]),"text-translate-anchor":new Ri(it.paint_symbol["text-translate-anchor"])})},get layout(){return $d=$d||new Lt({"symbol-placement":new Ri(it.layout_symbol["symbol-placement"]),"symbol-spacing":new Ri(it.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ri(it.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new oo(it.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ri(it.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ri(it.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ri(it.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ri(it.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ri(it.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ri(it.layout_symbol["icon-rotation-alignment"]),"icon-size":new oo(it.layout_symbol["icon-size"]),"icon-text-fit":new Ri(it.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ri(it.layout_symbol["icon-text-fit-padding"]),"icon-image":new oo(it.layout_symbol["icon-image"]),"icon-rotate":new oo(it.layout_symbol["icon-rotate"]),"icon-padding":new oo(it.layout_symbol["icon-padding"]),"icon-keep-upright":new Ri(it.layout_symbol["icon-keep-upright"]),"icon-offset":new oo(it.layout_symbol["icon-offset"]),"icon-anchor":new oo(it.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ri(it.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ri(it.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ri(it.layout_symbol["text-rotation-alignment"]),"text-field":new oo(it.layout_symbol["text-field"]),"text-font":new oo(it.layout_symbol["text-font"]),"text-size":new oo(it.layout_symbol["text-size"]),"text-max-width":new oo(it.layout_symbol["text-max-width"]),"text-line-height":new Ri(it.layout_symbol["text-line-height"]),"text-letter-spacing":new oo(it.layout_symbol["text-letter-spacing"]),"text-justify":new oo(it.layout_symbol["text-justify"]),"text-radial-offset":new oo(it.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ri(it.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new oo(it.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new oo(it.layout_symbol["text-anchor"]),"text-max-angle":new Ri(it.layout_symbol["text-max-angle"]),"text-writing-mode":new Ri(it.layout_symbol["text-writing-mode"]),"text-rotate":new oo(it.layout_symbol["text-rotate"]),"text-padding":new Ri(it.layout_symbol["text-padding"]),"text-keep-upright":new Ri(it.layout_symbol["text-keep-upright"]),"text-transform":new oo(it.layout_symbol["text-transform"]),"text-offset":new oo(it.layout_symbol["text-offset"]),"text-allow-overlap":new Ri(it.layout_symbol["text-allow-overlap"]),"text-overlap":new Ri(it.layout_symbol["text-overlap"]),"text-ignore-placement":new Ri(it.layout_symbol["text-ignore-placement"]),"text-optional":new Ri(it.layout_symbol["text-optional"])})}};class ad{constructor(C){if(C.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=C.property.overrides?C.property.overrides.runtimeType:Zt,this.defaultValue=C}evaluate(C){if(C.formattedSection){let J=this.defaultValue.property.overrides;if(J&&J.hasOverride(C.formattedSection))return J.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default}eachChild(C){this.defaultValue.isConstant()||C(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}qn("FormatSectionOverride",ad,{omit:["defaultValue"]});class H0 extends at{constructor(C){super(C,nm)}recalculate(C,J){if(super.recalculate(C,J),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let ht=this.layout.get("text-writing-mode");if(ht){let At=[];for(let Bt of ht)At.indexOf(Bt)<0&&At.push(Bt);this.layout._values["text-writing-mode"]=At}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(C,J,ht,At){let Bt=this.layout.get(C).evaluate(J,{},ht,At),jt=this._unevaluatedLayout._values[C];return jt.isDataDriven()||Ru(jt.value)||!Bt?Bt:function(ae,me){return me.replace(/{([^{}]+)}/g,(Ie,Ge)=>ae&&Ge in ae?String(ae[Ge]):"")}(J.properties,Bt)}createBucket(C){return new Cp(C)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let C of nm.paint.overridableProperties){if(!H0.hasPaintOverride(this.layout,C))continue;let J=this.paint.get(C),ht=new ad(J),At=new Zl(ht,J.property.specification),Bt=null;Bt=J.value.kind==="constant"||J.value.kind==="source"?new Qu("source",At):new yu("composite",At,J.value.zoomStops),this.paint._values[C]=new $s(J.property,Bt,J.parameters)}}_handleOverridablePaintPropertyUpdate(C,J,ht){return!(!this.layout||J.isDataDriven()||ht.isDataDriven())&&H0.hasPaintOverride(this.layout,C)}static hasPaintOverride(C,J){let ht=C.get("text-field"),At=nm.paint.properties[J],Bt=!1,jt=ae=>{for(let me of ae)if(At.overrides&&At.overrides.hasOverride(me))return void(Bt=!0)};if(ht.value.kind==="constant"&&ht.value.value instanceof rn)jt(ht.value.value.sections);else if(ht.value.kind==="source"){let ae=Ie=>{Bt||(Ie instanceof Pr&&ue(Ie.value)===We?jt(Ie.value.sections):Ie instanceof vs?jt(Ie.sections):Ie.eachChild(ae))},me=ht.value;me._styleExpression&&ae(me._styleExpression.expression)}return Bt}}let am;var qv={get paint(){return am=am||new Lt({"background-color":new Ri(it.paint_background["background-color"]),"background-pattern":new Cl(it.paint_background["background-pattern"]),"background-opacity":new Ri(it.paint_background["background-opacity"])})}};class Qd extends at{constructor(C){super(C,qv)}}let G0;var im={get paint(){return G0=G0||new Lt({"raster-opacity":new Ri(it.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ri(it.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ri(it.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ri(it.paint_raster["raster-brightness-max"]),"raster-saturation":new Ri(it.paint_raster["raster-saturation"]),"raster-contrast":new Ri(it.paint_raster["raster-contrast"]),"raster-resampling":new Ri(it.paint_raster["raster-resampling"]),"raster-fade-duration":new Ri(it.paint_raster["raster-fade-duration"])})}};class x_ extends at{constructor(C){super(C,im)}}class Hv extends at{constructor(C){super(C,{}),this.onAdd=J=>{this.implementation.onAdd&&this.implementation.onAdd(J,J.painter.context.gl)},this.onRemove=J=>{this.implementation.onRemove&&this.implementation.onRemove(J,J.painter.context.gl)},this.implementation=C}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Yd{constructor(C){this._methodToThrottle=C,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let om=63710088e-1;class Bf{constructor(C,J){if(isNaN(C)||isNaN(J))throw new Error(`Invalid LngLat object: (${C}, ${J})`);if(this.lng=+C,this.lat=+J,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Bf(S(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(C){let J=Math.PI/180,ht=this.lat*J,At=C.lat*J,Bt=Math.sin(ht)*Math.sin(At)+Math.cos(ht)*Math.cos(At)*Math.cos((C.lng-this.lng)*J);return om*Math.acos(Math.min(Bt,1))}static convert(C){if(C instanceof Bf)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new Bf(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new Bf(Number("lng"in C?C.lng:C.lon),Number(C.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}let Gv=2*Math.PI*om;function W0(U){return Gv*Math.cos(U*Math.PI/180)}function Z0(U){return(180+U)/360}function Wv(U){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+U*Math.PI/360)))/360}function _f(U,C){return U/W0(C)}function sm(U){return 360/Math.PI*Math.atan(Math.exp((180-360*U)*Math.PI/180))-90}class Kd{constructor(C,J,ht=0){this.x=+C,this.y=+J,this.z=+ht}static fromLngLat(C,J=0){let ht=Bf.convert(C);return new Kd(Z0(ht.lng),Wv(ht.lat),_f(J,ht.lat))}toLngLat(){return new Bf(360*this.x-180,sm(this.y))}toAltitude(){return this.z*W0(sm(this.y))}meterInMercatorCoordinateUnits(){return 1/Gv*(C=sm(this.y),1/Math.cos(C*Math.PI/180));var C}}function Zv(U,C,J){var ht=2*Math.PI*6378137/256/Math.pow(2,J);return[U*ht-2*Math.PI*6378137/2,C*ht-2*Math.PI*6378137/2]}class lm{constructor(C,J,ht){if(!function(At,Bt,jt){return!(At<0||At>25||jt<0||jt>=Math.pow(2,At)||Bt<0||Bt>=Math.pow(2,At))}(C,J,ht))throw new Error(`x=${J}, y=${ht}, z=${C} outside of bounds. 0<=x<${Math.pow(2,C)}, 0<=y<${Math.pow(2,C)} 0<=z<=25 `);this.z=C,this.x=J,this.y=ht,this.key=id(0,C,C,J,ht)}equals(C){return this.z===C.z&&this.x===C.x&&this.y===C.y}url(C,J,ht){let At=(jt=this.y,ae=this.z,me=Zv(256*(Bt=this.x),256*(jt=Math.pow(2,ae)-jt-1),ae),Ie=Zv(256*(Bt+1),256*(jt+1),ae),me[0]+","+me[1]+","+Ie[0]+","+Ie[1]);var Bt,jt,ae,me,Ie;let Ge=function(Ke,vr,Cr){let Nr,$r="";for(let cn=Ke;cn>0;cn--)Nr=1<<cn-1,$r+=(vr&Nr?1:0)+(Cr&Nr?2:0);return $r}(this.z,this.x,this.y);return C[(this.x+this.y)%C.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(ht==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,J>1?"@2x":"").replace(/{quadkey}/g,Ge).replace(/{bbox-epsg-3857}/g,At)}isChildOf(C){let J=this.z-C.z;return J>0&&C.x===this.x>>J&&C.y===this.y>>J}getTilePoint(C){let J=Math.pow(2,this.z);return new o((C.x*J-this.x)*gs,(C.y*J-this.y)*gs)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Xv{constructor(C,J){this.wrap=C,this.canonical=J,this.key=id(C,J.z,J.z,J.x,J.y)}}class gf{constructor(C,J,ht,At,Bt){if(C<ht)throw new Error(`overscaledZ should be >= z; overscaledZ = ${C}; z = ${ht}`);this.overscaledZ=C,this.wrap=J,this.canonical=new lm(ht,+At,+Bt),this.key=id(J,C,ht,At,Bt)}clone(){return new gf(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(C){return this.overscaledZ===C.overscaledZ&&this.wrap===C.wrap&&this.canonical.equals(C.canonical)}scaledTo(C){if(C>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${C}; overscaledZ = ${this.overscaledZ}`);let J=this.canonical.z-C;return C>this.canonical.z?new gf(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new gf(C,this.wrap,C,this.canonical.x>>J,this.canonical.y>>J)}calculateScaledKey(C,J){if(C>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${C}; overscaledZ = ${this.overscaledZ}`);let ht=this.canonical.z-C;return C>this.canonical.z?id(this.wrap*+J,C,this.canonical.z,this.canonical.x,this.canonical.y):id(this.wrap*+J,C,C,this.canonical.x>>ht,this.canonical.y>>ht)}isChildOf(C){if(C.wrap!==this.wrap)return!1;let J=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ<this.overscaledZ&&C.canonical.x===this.canonical.x>>J&&C.canonical.y===this.canonical.y>>J}children(C){if(this.overscaledZ>=C)return[new gf(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let J=this.canonical.z+1,ht=2*this.canonical.x,At=2*this.canonical.y;return[new gf(J,this.wrap,J,ht,At),new gf(J,this.wrap,J,ht+1,At),new gf(J,this.wrap,J,ht,At+1),new gf(J,this.wrap,J,ht+1,At+1)]}isLessThan(C){return this.wrap<C.wrap||!(this.wrap>C.wrap)&&(this.overscaledZ<C.overscaledZ||!(this.overscaledZ>C.overscaledZ)&&(this.canonical.x<C.canonical.x||!(this.canonical.x>C.canonical.x)&&this.canonical.y<C.canonical.y))}wrapped(){return new gf(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(C){return new gf(this.overscaledZ,C,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Xv(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(C){return this.canonical.getTilePoint(new Kd(C.x-this.wrap,C.y))}}function id(U,C,J,ht,At){(U*=2)<0&&(U=-1*U-1);let Bt=1<<J;return(Bt*Bt*U+Bt*At+ht).toString(36)+J.toString(36)+C.toString(36)}qn("CanonicalTileID",lm),qn("OverscaledTileID",gf,{omit:["posMatrix"]});class Dp{constructor(C,J,ht,At=1,Bt=1,jt=1,ae=0){if(this.uid=C,J.height!==J.width)throw new RangeError("DEM tiles must be square");if(ht&&!["mapbox","terrarium","custom"].includes(ht))return void _(`"${ht}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=J.height;let me=this.dim=J.height-2;switch(this.data=new Uint32Array(J.data.buffer),ht){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=At,this.greenFactor=Bt,this.blueFactor=jt,this.baseShift=ae;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let Ie=0;Ie<me;Ie++)this.data[this._idx(-1,Ie)]=this.data[this._idx(0,Ie)],this.data[this._idx(me,Ie)]=this.data[this._idx(me-1,Ie)],this.data[this._idx(Ie,-1)]=this.data[this._idx(Ie,0)],this.data[this._idx(Ie,me)]=this.data[this._idx(Ie,me-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(me,-1)]=this.data[this._idx(me-1,0)],this.data[this._idx(-1,me)]=this.data[this._idx(0,me-1)],this.data[this._idx(me,me)]=this.data[this._idx(me-1,me-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let Ie=0;Ie<me;Ie++)for(let Ge=0;Ge<me;Ge++){let Ke=this.get(Ie,Ge);Ke>this.max&&(this.max=Ke),Ke<this.min&&(this.min=Ke)}}get(C,J){let ht=new Uint8Array(this.data.buffer),At=4*this._idx(C,J);return this.unpack(ht[At],ht[At+1],ht[At+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(C,J){if(C<-1||C>=this.dim+1||J<-1||J>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(J+1)*this.stride+(C+1)}unpack(C,J,ht){return C*this.redFactor+J*this.greenFactor+ht*this.blueFactor-this.baseShift}getPixels(){return new Gs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(C,J,ht){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");let At=J*this.dim,Bt=J*this.dim+this.dim,jt=ht*this.dim,ae=ht*this.dim+this.dim;switch(J){case-1:At=Bt-1;break;case 1:Bt=At+1}switch(ht){case-1:jt=ae-1;break;case 1:ae=jt+1}let me=-J*this.dim,Ie=-ht*this.dim;for(let Ge=jt;Ge<ae;Ge++)for(let Ke=At;Ke<Bt;Ke++)this.data[this._idx(Ke,Ge)]=C.data[this._idx(Ke+me,Ge+Ie)]}}qn("DEMData",Dp);class $v{constructor(C){this._stringToNumber={},this._numberToString=[];for(let J=0;J<C.length;J++){let ht=C[J];this._stringToNumber[ht]=J,this._numberToString[J]=ht}}encode(C){return this._stringToNumber[C]}decode(C){if(C>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${C} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[C]}}class Jv{constructor(C,J,ht,At,Bt){this.type="Feature",this._vectorTileFeature=C,C._z=J,C._x=ht,C._y=At,this.properties=C.properties,this.id=Bt}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(C){this._geometry=C}toJSON(){let C={geometry:this.geometry};for(let J in this)J!=="_geometry"&&J!=="_vectorTileFeature"&&(C[J]=this[J]);return C}}class Qv{constructor(C,J){this.tileID=C,this.x=C.canonical.x,this.y=C.canonical.y,this.z=C.canonical.z,this.grid=new va(gs,16,0),this.grid3D=new va(gs,16,0),this.featureIndexArray=new Is,this.promoteId=J}insert(C,J,ht,At,Bt,jt){let ae=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(ht,At,Bt);let me=jt?this.grid3D:this.grid;for(let Ie=0;Ie<J.length;Ie++){let Ge=J[Ie],Ke=[1/0,1/0,-1/0,-1/0];for(let vr=0;vr<Ge.length;vr++){let Cr=Ge[vr];Ke[0]=Math.min(Ke[0],Cr.x),Ke[1]=Math.min(Ke[1],Cr.y),Ke[2]=Math.max(Ke[2],Cr.x),Ke[3]=Math.max(Ke[3],Cr.y)}Ke[0]<gs&&Ke[1]<gs&&Ke[2]>=0&&Ke[3]>=0&&me.insert(ae,Ke[0],Ke[1],Ke[2],Ke[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ea.VectorTile(new Jg(this.rawTileData)).layers,this.sourceLayerCoder=new $v(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(C,J,ht,At){this.loadVTLayers();let Bt=C.params||{},jt=gs/C.tileSize/C.scale,ae=_c(Bt.filter),me=C.queryGeometry,Ie=C.queryPadding*jt,Ge=um(me),Ke=this.grid.query(Ge.minX-Ie,Ge.minY-Ie,Ge.maxX+Ie,Ge.maxY+Ie),vr=um(C.cameraQueryGeometry),Cr=this.grid3D.query(vr.minX-Ie,vr.minY-Ie,vr.maxX+Ie,vr.maxY+Ie,(cn,Pn,ua,Un)=>function(Kn,Sa,Ya,Qi,Vo){for(let zi of Kn)if(Sa<=zi.x&&Ya<=zi.y&&Qi>=zi.x&&Vo>=zi.y)return!0;let Vi=[new o(Sa,Ya),new o(Sa,Vo),new o(Qi,Vo),new o(Qi,Ya)];if(Kn.length>2){for(let zi of Vi)if(Ca(Kn,zi))return!0}for(let zi=0;zi<Kn.length-1;zi++)if(Wn(Kn[zi],Kn[zi+1],Vi))return!0;return!1}(C.cameraQueryGeometry,cn-Ie,Pn-Ie,ua+Ie,Un+Ie));for(let cn of Cr)Ke.push(cn);Ke.sort(Kv);let Nr={},$r;for(let cn=0;cn<Ke.length;cn++){let Pn=Ke[cn];if(Pn===$r)continue;$r=Pn;let ua=this.featureIndexArray.get(Pn),Un=null;this.loadMatchingFeature(Nr,ua.bucketIndex,ua.sourceLayerIndex,ua.featureIndex,ae,Bt.layers,Bt.availableImages,J,ht,At,(Kn,Sa,Ya)=>(Un||(Un=fn(Kn)),Sa.queryIntersectsFeature(me,Kn,Ya,Un,this.z,C.transform,jt,C.pixelPosMatrix)))}return Nr}loadMatchingFeature(C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke){let vr=this.bucketLayerIDs[J];if(jt&&!function(cn,Pn){for(let ua=0;ua<cn.length;ua++)if(Pn.indexOf(cn[ua])>=0)return!0;return!1}(jt,vr))return;let Cr=this.sourceLayerCoder.decode(ht),Nr=this.vtLayers[Cr].feature(At);if(Bt.needGeometry){let cn=gn(Nr,!0);if(!Bt.filter(new Qo(this.tileID.overscaledZ),cn,this.tileID.canonical))return}else if(!Bt.filter(new Qo(this.tileID.overscaledZ),Nr))return;let $r=this.getId(Nr,Cr);for(let cn=0;cn<vr.length;cn++){let Pn=vr[cn];if(jt&&jt.indexOf(Pn)<0)continue;let ua=me[Pn];if(!ua)continue;let Un={};$r&&Ge&&(Un=Ge.getState(ua.sourceLayer||"_geojsonTileLayer",$r));let Kn=T({},Ie[Pn]);Kn.paint=Yv(Kn.paint,ua.paint,Nr,Un,ae),Kn.layout=Yv(Kn.layout,ua.layout,Nr,Un,ae);let Sa=!Ke||Ke(Nr,ua,Un);if(!Sa)continue;let Ya=new Jv(Nr,this.z,this.x,this.y,$r);Ya.layer=Kn;let Qi=C[Pn];Qi===void 0&&(Qi=C[Pn]=[]),Qi.push({featureIndex:At,feature:Ya,intersectionZ:Sa})}}lookupSymbolFeatures(C,J,ht,At,Bt,jt,ae,me){let Ie={};this.loadVTLayers();let Ge=_c(Bt);for(let Ke of C)this.loadMatchingFeature(Ie,ht,At,Ke,Ge,jt,ae,me,J);return Ie}hasLayer(C){for(let J of this.bucketLayerIDs)for(let ht of J)if(C===ht)return!0;return!1}getId(C,J){let ht=C.id;return this.promoteId&&(ht=C.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[J]],typeof ht=="boolean"&&(ht=Number(ht))),ht}}function Yv(U,C,J,ht,At){return w(U,(Bt,jt)=>{let ae=C instanceof ec?C.get(jt):null;return ae&&ae.evaluate?ae.evaluate(J,ht,At):ae})}function um(U){let C=1/0,J=1/0,ht=-1/0,At=-1/0;for(let Bt of U)C=Math.min(C,Bt.x),J=Math.min(J,Bt.y),ht=Math.max(ht,Bt.x),At=Math.max(At,Bt.y);return{minX:C,minY:J,maxX:ht,maxY:At}}function Kv(U,C){return C-U}function ty(U,C,J,ht,At){let Bt=[];for(let jt=0;jt<U.length;jt++){let ae=U[jt],me;for(let Ie=0;Ie<ae.length-1;Ie++){let Ge=ae[Ie],Ke=ae[Ie+1];Ge.x<C&&Ke.x<C||(Ge.x<C?Ge=new o(C,Ge.y+(C-Ge.x)/(Ke.x-Ge.x)*(Ke.y-Ge.y))._round():Ke.x<C&&(Ke=new o(C,Ge.y+(C-Ge.x)/(Ke.x-Ge.x)*(Ke.y-Ge.y))._round()),Ge.y<J&&Ke.y<J||(Ge.y<J?Ge=new o(Ge.x+(J-Ge.y)/(Ke.y-Ge.y)*(Ke.x-Ge.x),J)._round():Ke.y<J&&(Ke=new o(Ge.x+(J-Ge.y)/(Ke.y-Ge.y)*(Ke.x-Ge.x),J)._round()),Ge.x>=ht&&Ke.x>=ht||(Ge.x>=ht?Ge=new o(ht,Ge.y+(ht-Ge.x)/(Ke.x-Ge.x)*(Ke.y-Ge.y))._round():Ke.x>=ht&&(Ke=new o(ht,Ge.y+(ht-Ge.x)/(Ke.x-Ge.x)*(Ke.y-Ge.y))._round()),Ge.y>=At&&Ke.y>=At||(Ge.y>=At?Ge=new o(Ge.x+(At-Ge.y)/(Ke.y-Ge.y)*(Ke.x-Ge.x),At)._round():Ke.y>=At&&(Ke=new o(Ge.x+(At-Ge.y)/(Ke.y-Ge.y)*(Ke.x-Ge.x),At)._round()),me&&Ge.equals(me[me.length-1])||(me=[Ge],Bt.push(me)),me.push(Ke)))))}}return Bt}qn("FeatureIndex",Qv,{omit:["rawTileData","sourceLayerCoder"]});class gp extends o{constructor(C,J,ht,At){super(C,J),this.angle=ht,At!==void 0&&(this.segment=At)}clone(){return new gp(this.x,this.y,this.angle,this.segment)}}function ey(U,C,J,ht,At){if(C.segment===void 0||J===0)return!0;let Bt=C,jt=C.segment+1,ae=0;for(;ae>-J/2;){if(jt--,jt<0)return!1;ae-=U[jt].dist(Bt),Bt=U[jt]}ae+=U[jt].dist(U[jt+1]),jt++;let me=[],Ie=0;for(;ae<J/2;){let Ge=U[jt],Ke=U[jt+1];if(!Ke)return!1;let vr=U[jt-1].angleTo(Ge)-Ge.angleTo(Ke);for(vr=Math.abs((vr+3*Math.PI)%(2*Math.PI)-Math.PI),me.push({distance:ae,angleDelta:vr}),Ie+=vr;ae-me[0].distance>ht;)Ie-=me.shift().angleDelta;if(Ie>At)return!1;jt++,ae+=Ge.dist(Ke)}return!0}function ry(U){let C=0;for(let J=0;J<U.length-1;J++)C+=U[J].dist(U[J+1]);return C}function ny(U,C,J){return U?.6*C*J:0}function ay(U,C){return Math.max(U?U.right-U.left:0,C?C.right-C.left:0)}function __(U,C,J,ht,At,Bt){let jt=ny(J,At,Bt),ae=ay(J,ht)*Bt,me=0,Ie=ry(U)/2;for(let Ge=0;Ge<U.length-1;Ge++){let Ke=U[Ge],vr=U[Ge+1],Cr=Ke.dist(vr);if(me+Cr>Ie){let Nr=(Ie-me)/Cr,$r=bi.number(Ke.x,vr.x,Nr),cn=bi.number(Ke.y,vr.y,Nr),Pn=new gp($r,cn,vr.angleTo(Ke),Ge);return Pn._round(),!jt||ey(U,Pn,ae,jt,C)?Pn:void 0}me+=Cr}}function b_(U,C,J,ht,At,Bt,jt,ae,me){let Ie=ny(ht,Bt,jt),Ge=ay(ht,At),Ke=Ge*jt,vr=U[0].x===0||U[0].x===me||U[0].y===0||U[0].y===me;return C-Ke<C/4&&(C=Ke+C/4),zp(U,vr?C/2*ae%C:(Ge/2+2*Bt)*jt*ae%C,C,Ie,J,Ke,vr,!1,me)}function zp(U,C,J,ht,At,Bt,jt,ae,me){let Ie=Bt/2,Ge=ry(U),Ke=0,vr=C-J,Cr=[];for(let Nr=0;Nr<U.length-1;Nr++){let $r=U[Nr],cn=U[Nr+1],Pn=$r.dist(cn),ua=cn.angleTo($r);for(;vr+J<Ke+Pn;){vr+=J;let Un=(vr-Ke)/Pn,Kn=bi.number($r.x,cn.x,Un),Sa=bi.number($r.y,cn.y,Un);if(Kn>=0&&Kn<me&&Sa>=0&&Sa<me&&vr-Ie>=0&&vr+Ie<=Ge){let Ya=new gp(Kn,Sa,ua,Nr);Ya._round(),ht&&!ey(U,Ya,Bt,ht,At)||Cr.push(Ya)}}Ke+=Pn}return ae||Cr.length||jt||(Cr=zp(U,Ke/2,J,ht,At,Bt,jt,!0,me)),Cr}qn("Anchor",gp);let od=Tc;function iy(U,C,J,ht){let At=[],Bt=U.image,jt=Bt.pixelRatio,ae=Bt.paddedRect.w-2*od,me=Bt.paddedRect.h-2*od,Ie={x1:U.left,y1:U.top,x2:U.right,y2:U.bottom},Ge=Bt.stretchX||[[0,ae]],Ke=Bt.stretchY||[[0,me]],vr=(Oa,To)=>Oa+To[1]-To[0],Cr=Ge.reduce(vr,0),Nr=Ke.reduce(vr,0),$r=ae-Cr,cn=me-Nr,Pn=0,ua=Cr,Un=0,Kn=Nr,Sa=0,Ya=$r,Qi=0,Vo=cn;if(Bt.content&&ht){let Oa=Bt.content,To=Oa[2]-Oa[0],_o=Oa[3]-Oa[1];(Bt.textFitWidth||Bt.textFitHeight)&&(Ie=Nv(U)),Pn=sd(Ge,0,Oa[0]),Un=sd(Ke,0,Oa[1]),ua=sd(Ge,Oa[0],Oa[2]),Kn=sd(Ke,Oa[1],Oa[3]),Sa=Oa[0]-Pn,Qi=Oa[1]-Un,Ya=To-ua,Vo=_o-Kn}let Vi=Ie.x1,zi=Ie.y1,xo=Ie.x2-Vi,so=Ie.y2-zi,Ki=(Oa,To,_o,Ko)=>{let Bl=uf(Oa.stretch-Pn,ua,xo,Vi),Dl=X0(Oa.fixed-Sa,Ya,Oa.stretch,Cr),Uc=uf(To.stretch-Un,Kn,so,zi),Kh=X0(To.fixed-Qi,Vo,To.stretch,Nr),cc=uf(_o.stretch-Pn,ua,xo,Vi),kc=X0(_o.fixed-Sa,Ya,_o.stretch,Cr),Bh=uf(Ko.stretch-Un,Kn,so,zi),Rh=X0(Ko.fixed-Qi,Vo,Ko.stretch,Nr),jh=new o(Bl,Uc),Ou=new o(cc,Uc),Vc=new o(cc,Bh),Mh=new o(Bl,Bh),dh=new o(Dl/jt,Kh/jt),Nh=new o(kc/jt,Rh/jt),Kc=C*Math.PI/180;if(Kc){let Js=Math.sin(Kc),yl=Math.cos(Kc),Al=[yl,-Js,Js,yl];jh._matMult(Al),Ou._matMult(Al),Mh._matMult(Al),Vc._matMult(Al)}let cf=Oa.stretch+Oa.fixed,iu=To.stretch+To.fixed;return{tl:jh,tr:Ou,bl:Mh,br:Vc,tex:{x:Bt.paddedRect.x+od+cf,y:Bt.paddedRect.y+od+iu,w:_o.stretch+_o.fixed-cf,h:Ko.stretch+Ko.fixed-iu},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:dh,pixelOffsetBR:Nh,minFontScaleX:Ya/jt/xo,minFontScaleY:Vo/jt/so,isSDF:J}};if(ht&&(Bt.stretchX||Bt.stretchY)){let Oa=ld(Ge,$r,Cr),To=ld(Ke,cn,Nr);for(let _o=0;_o<Oa.length-1;_o++){let Ko=Oa[_o],Bl=Oa[_o+1];for(let Dl=0;Dl<To.length-1;Dl++)At.push(Ki(Ko,To[Dl],Bl,To[Dl+1]))}}else At.push(Ki({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:ae+1},{fixed:0,stretch:me+1}));return At}function sd(U,C,J){let ht=0;for(let At of U)ht+=Math.max(C,Math.min(J,At[1]))-Math.max(C,Math.min(J,At[0]));return ht}function ld(U,C,J){let ht=[{fixed:-od,stretch:0}];for(let[At,Bt]of U){let jt=ht[ht.length-1];ht.push({fixed:At-jt.stretch,stretch:jt.stretch}),ht.push({fixed:At-jt.stretch,stretch:jt.stretch+(Bt-At)})}return ht.push({fixed:C+od,stretch:J}),ht}function uf(U,C,J,ht){return U/C*J+ht}function X0(U,C,J,ht){return U-C*J/ht}class $0{constructor(C,J,ht,At,Bt,jt,ae,me,Ie,Ge){var Ke;if(this.boxStartIndex=C.length,Ie){let vr=jt.top,Cr=jt.bottom,Nr=jt.collisionPadding;Nr&&(vr-=Nr[1],Cr+=Nr[3]);let $r=Cr-vr;$r>0&&($r=Math.max(10,$r),this.circleDiameter=$r)}else{let vr=!((Ke=jt.image)===null||Ke===void 0)&&Ke.content&&(jt.image.textFitWidth||jt.image.textFitHeight)?Nv(jt):{x1:jt.left,y1:jt.top,x2:jt.right,y2:jt.bottom};vr.y1=vr.y1*ae-me[0],vr.y2=vr.y2*ae+me[2],vr.x1=vr.x1*ae-me[3],vr.x2=vr.x2*ae+me[1];let Cr=jt.collisionPadding;if(Cr&&(vr.x1-=Cr[0]*ae,vr.y1-=Cr[1]*ae,vr.x2+=Cr[2]*ae,vr.y2+=Cr[3]*ae),Ge){let Nr=new o(vr.x1,vr.y1),$r=new o(vr.x2,vr.y1),cn=new o(vr.x1,vr.y2),Pn=new o(vr.x2,vr.y2),ua=Ge*Math.PI/180;Nr._rotate(ua),$r._rotate(ua),cn._rotate(ua),Pn._rotate(ua),vr.x1=Math.min(Nr.x,$r.x,cn.x,Pn.x),vr.x2=Math.max(Nr.x,$r.x,cn.x,Pn.x),vr.y1=Math.min(Nr.y,$r.y,cn.y,Pn.y),vr.y2=Math.max(Nr.y,$r.y,cn.y,Pn.y)}C.emplaceBack(J.x,J.y,vr.x1,vr.y1,vr.x2,vr.y2,ht,At,Bt)}this.boxEndIndex=C.length}}class w_{constructor(C=[],J=(ht,At)=>ht<At?-1:ht>At?1:0){if(this.data=C,this.length=this.data.length,this.compare=J,this.length>0)for(let ht=(this.length>>1)-1;ht>=0;ht--)this._down(ht)}push(C){this.data.push(C),this._up(this.length++)}pop(){if(this.length===0)return;let C=this.data[0],J=this.data.pop();return--this.length>0&&(this.data[0]=J,this._down(0)),C}peek(){return this.data[0]}_up(C){let{data:J,compare:ht}=this,At=J[C];for(;C>0;){let Bt=C-1>>1,jt=J[Bt];if(ht(At,jt)>=0)break;J[C]=jt,C=Bt}J[C]=At}_down(C){let{data:J,compare:ht}=this,At=this.length>>1,Bt=J[C];for(;C<At;){let jt=1+(C<<1),ae=jt+1;if(ae<this.length&&ht(J[ae],J[jt])<0&&(jt=ae),ht(J[jt],Bt)>=0)break;J[C]=J[jt],C=jt}J[C]=Bt}}function T_(U,C=1,J=!1){let ht=1/0,At=1/0,Bt=-1/0,jt=-1/0,ae=U[0];for(let Cr=0;Cr<ae.length;Cr++){let Nr=ae[Cr];(!Cr||Nr.x<ht)&&(ht=Nr.x),(!Cr||Nr.y<At)&&(At=Nr.y),(!Cr||Nr.x>Bt)&&(Bt=Nr.x),(!Cr||Nr.y>jt)&&(jt=Nr.y)}let me=Math.min(Bt-ht,jt-At),Ie=me/2,Ge=new w_([],k_);if(me===0)return new o(ht,At);for(let Cr=ht;Cr<Bt;Cr+=me)for(let Nr=At;Nr<jt;Nr+=me)Ge.push(new Rf(Cr+Ie,Nr+Ie,Ie,U));let Ke=function(Cr){let Nr=0,$r=0,cn=0,Pn=Cr[0];for(let ua=0,Un=Pn.length,Kn=Un-1;ua<Un;Kn=ua++){let Sa=Pn[ua],Ya=Pn[Kn],Qi=Sa.x*Ya.y-Ya.x*Sa.y;$r+=(Sa.x+Ya.x)*Qi,cn+=(Sa.y+Ya.y)*Qi,Nr+=3*Qi}return new Rf($r/Nr,cn/Nr,0,Cr)}(U),vr=Ge.length;for(;Ge.length;){let Cr=Ge.pop();(Cr.d>Ke.d||!Ke.d)&&(Ke=Cr,J&&console.log("found best %d after %d probes",Math.round(1e4*Cr.d)/1e4,vr)),Cr.max-Ke.d<=C||(Ie=Cr.h/2,Ge.push(new Rf(Cr.p.x-Ie,Cr.p.y-Ie,Ie,U)),Ge.push(new Rf(Cr.p.x+Ie,Cr.p.y-Ie,Ie,U)),Ge.push(new Rf(Cr.p.x-Ie,Cr.p.y+Ie,Ie,U)),Ge.push(new Rf(Cr.p.x+Ie,Cr.p.y+Ie,Ie,U)),vr+=4)}return J&&(console.log(`num probes: ${vr}`),console.log(`best distance: ${Ke.d}`)),Ke.p}function k_(U,C){return C.max-U.max}function Rf(U,C,J,ht){this.p=new o(U,C),this.h=J,this.d=function(At,Bt){let jt=!1,ae=1/0;for(let me=0;me<Bt.length;me++){let Ie=Bt[me];for(let Ge=0,Ke=Ie.length,vr=Ke-1;Ge<Ke;vr=Ge++){let Cr=Ie[Ge],Nr=Ie[vr];Cr.y>At.y!=Nr.y>At.y&&At.x<(Nr.x-Cr.x)*(At.y-Cr.y)/(Nr.y-Cr.y)+Cr.x&&(jt=!jt),ae=Math.min(ae,wi(At,Cr,Nr))}}return(jt?1:-1)*Math.sqrt(ae)}(this.p,ht),this.max=this.d+this.h*Math.SQRT2}var Yc;t.aq=void 0,(Yc=t.aq||(t.aq={}))[Yc.center=1]="center",Yc[Yc.left=2]="left",Yc[Yc.right=3]="right",Yc[Yc.top=4]="top",Yc[Yc.bottom=5]="bottom",Yc[Yc["top-left"]=6]="top-left",Yc[Yc["top-right"]=7]="top-right",Yc[Yc["bottom-left"]=8]="bottom-left",Yc[Yc["bottom-right"]=9]="bottom-right";let mp=7,cm=Number.POSITIVE_INFINITY;function oy(U,C){return C[1]!==cm?function(J,ht,At){let Bt=0,jt=0;switch(ht=Math.abs(ht),At=Math.abs(At),J){case"top-right":case"top-left":case"top":jt=At-mp;break;case"bottom-right":case"bottom-left":case"bottom":jt=-At+mp}switch(J){case"top-right":case"bottom-right":case"right":Bt=-ht;break;case"top-left":case"bottom-left":case"left":Bt=ht}return[Bt,jt]}(U,C[0],C[1]):function(J,ht){let At=0,Bt=0;ht<0&&(ht=0);let jt=ht/Math.SQRT2;switch(J){case"top-right":case"top-left":Bt=jt-mp;break;case"bottom-right":case"bottom-left":Bt=-jt+mp;break;case"bottom":Bt=-ht+mp;break;case"top":Bt=ht-mp}switch(J){case"top-right":case"bottom-right":At=-jt;break;case"top-left":case"bottom-left":At=jt;break;case"left":At=ht;break;case"right":At=-ht}return[At,Bt]}(U,C[0])}function sy(U,C,J){var ht;let At=U.layout,Bt=(ht=At.get("text-variable-anchor-offset"))===null||ht===void 0?void 0:ht.evaluate(C,{},J);if(Bt){let ae=Bt.values,me=[];for(let Ie=0;Ie<ae.length;Ie+=2){let Ge=me[Ie]=ae[Ie],Ke=ae[Ie+1].map(vr=>vr*ol);Ge.startsWith("top")?Ke[1]-=mp:Ge.startsWith("bottom")&&(Ke[1]+=mp),me[Ie+1]=Ke}return new bn(me)}let jt=At.get("text-variable-anchor");if(jt){let ae;ae=U._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[At.get("text-radial-offset").evaluate(C,{},J)*ol,cm]:At.get("text-offset").evaluate(C,{},J).map(Ie=>Ie*ol);let me=[];for(let Ie of jt)me.push(Ie,oy(Ie,ae));return new bn(me)}return null}function hm(U){switch(U){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function A_(U,C,J,ht,At,Bt,jt,ae,me,Ie,Ge){let Ke=Bt.textMaxSize.evaluate(C,{});Ke===void 0&&(Ke=jt);let vr=U.layers[0].layout,Cr=vr.get("icon-offset").evaluate(C,{},Ge),Nr=uy(J.horizontal),$r=jt/24,cn=U.tilePixelRatio*$r,Pn=U.tilePixelRatio*Ke/24,ua=U.tilePixelRatio*ae,Un=U.tilePixelRatio*vr.get("symbol-spacing"),Kn=vr.get("text-padding")*U.tilePixelRatio,Sa=function(Oa,To,_o,Ko=1){let Bl=Oa.get("icon-padding").evaluate(To,{},_o),Dl=Bl&&Bl.values;return[Dl[0]*Ko,Dl[1]*Ko,Dl[2]*Ko,Dl[3]*Ko]}(vr,C,Ge,U.tilePixelRatio),Ya=vr.get("text-max-angle")/180*Math.PI,Qi=vr.get("text-rotation-alignment")!=="viewport"&&vr.get("symbol-placement")!=="point",Vo=vr.get("icon-rotation-alignment")==="map"&&vr.get("symbol-placement")!=="point",Vi=vr.get("symbol-placement"),zi=Un/2,xo=vr.get("icon-text-fit"),so;ht&&xo!=="none"&&(U.allowVerticalPlacement&&J.vertical&&(so=Uv(ht,J.vertical,xo,vr.get("icon-text-fit-padding"),Cr,$r)),Nr&&(ht=Uv(ht,Nr,xo,vr.get("icon-text-fit-padding"),Cr,$r)));let Ki=(Oa,To)=>{To.x<0||To.x>=gs||To.y<0||To.y>=gs||function(_o,Ko,Bl,Dl,Uc,Kh,cc,kc,Bh,Rh,jh,Ou,Vc,Mh,dh,Nh,Kc,cf,iu,Js,yl,Al,ku,ou,hd){let Mf=_o.addToLineVertexArray(Ko,Bl),Sf,Sh,Rl,th,bf=0,hf=0,Uh=0,vm=0,ym=-1,K0=-1,Qf={},xm=xn("");if(_o.allowVerticalPlacement&&Dl.vertical){let gh=kc.layout.get("text-rotate").evaluate(yl,{},ou)+90;Rl=new $0(Bh,Ko,Rh,jh,Ou,Dl.vertical,Vc,Mh,dh,gh),cc&&(th=new $0(Bh,Ko,Rh,jh,Ou,cc,Kc,cf,dh,gh))}if(Uc){let gh=kc.layout.get("icon-rotate").evaluate(yl,{}),ff=kc.layout.get("icon-text-fit")!=="none",vp=iy(Uc,gh,ku,ff),Ef=cc?iy(cc,gh,ku,ff):void 0;Sh=new $0(Bh,Ko,Rh,jh,Ou,Uc,Kc,cf,!1,gh),bf=4*vp.length;let Op=_o.iconSizeData,Pf=null;Op.kind==="source"?(Pf=[Ff*kc.layout.get("icon-size").evaluate(yl,{})],Pf[0]>pp&&_(`${_o.layerIds[0]}: Value for "icon-size" is >= ${Xd}. Reduce your "icon-size".`)):Op.kind==="composite"&&(Pf=[Ff*Al.compositeIconSizes[0].evaluate(yl,{},ou),Ff*Al.compositeIconSizes[1].evaluate(yl,{},ou)],(Pf[0]>pp||Pf[1]>pp)&&_(`${_o.layerIds[0]}: Value for "icon-size" is >= ${Xd}. Reduce your "icon-size".`)),_o.addSymbols(_o.icon,vp,Pf,Js,iu,yl,t.ah.none,Ko,Mf.lineStartIndex,Mf.lineLength,-1,ou),ym=_o.icon.placedSymbolArray.length-1,Ef&&(hf=4*Ef.length,_o.addSymbols(_o.icon,Ef,Pf,Js,iu,yl,t.ah.vertical,Ko,Mf.lineStartIndex,Mf.lineLength,-1,ou),K0=_o.icon.placedSymbolArray.length-1)}let _m=Object.keys(Dl.horizontal);for(let gh of _m){let ff=Dl.horizontal[gh];if(!Sf){xm=xn(ff.text);let Ef=kc.layout.get("text-rotate").evaluate(yl,{},ou);Sf=new $0(Bh,Ko,Rh,jh,Ou,ff,Vc,Mh,dh,Ef)}let vp=ff.positionedLines.length===1;if(Uh+=ly(_o,Ko,ff,Kh,kc,dh,yl,Nh,Mf,Dl.vertical?t.ah.horizontal:t.ah.horizontalOnly,vp?_m:[gh],Qf,ym,Al,ou),vp)break}Dl.vertical&&(vm+=ly(_o,Ko,Dl.vertical,Kh,kc,dh,yl,Nh,Mf,t.ah.vertical,["vertical"],Qf,K0,Al,ou));let bm=Sf?Sf.boxStartIndex:_o.collisionBoxArray.length,wm=Sf?Sf.boxEndIndex:_o.collisionBoxArray.length,M_=Rl?Rl.boxStartIndex:_o.collisionBoxArray.length,S_=Rl?Rl.boxEndIndex:_o.collisionBoxArray.length,E_=Sh?Sh.boxStartIndex:_o.collisionBoxArray.length,P_=Sh?Sh.boxEndIndex:_o.collisionBoxArray.length,dy=th?th.boxStartIndex:_o.collisionBoxArray.length,fd=th?th.boxEndIndex:_o.collisionBoxArray.length,Ac=-1,pd=(gh,ff)=>gh&&gh.circleDiameter?Math.max(gh.circleDiameter,ff):ff;Ac=pd(Sf,Ac),Ac=pd(Rl,Ac),Ac=pd(Sh,Ac),Ac=pd(th,Ac);let Tm=Ac>-1?1:0;Tm&&(Ac*=hd/ol),_o.glyphOffsetArray.length>=Cp.MAX_GLYPHS&&_("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),yl.sortKey!==void 0&&_o.addToSortKeyRanges(_o.symbolInstances.length,yl.sortKey);let gy=sy(kc,yl,ou),[I_,my]=function(gh,ff){let vp=gh.length,Ef=ff?.values;if(Ef?.length>0)for(let Op=0;Op<Ef.length;Op+=2){let Pf=Ef[Op+1];gh.emplaceBack(t.aq[Ef[Op]],Pf[0],Pf[1])}return[vp,gh.length]}(_o.textAnchorOffsets,gy);_o.symbolInstances.emplaceBack(Ko.x,Ko.y,Qf.right>=0?Qf.right:-1,Qf.center>=0?Qf.center:-1,Qf.left>=0?Qf.left:-1,Qf.vertical||-1,ym,K0,xm,bm,wm,M_,S_,E_,P_,dy,fd,Rh,Uh,vm,bf,hf,Tm,0,Vc,Ac,I_,my)}(U,To,Oa,J,ht,At,so,U.layers[0],U.collisionBoxArray,C.index,C.sourceLayerIndex,U.index,cn,[Kn,Kn,Kn,Kn],Qi,me,ua,Sa,Vo,Cr,C,Bt,Ie,Ge,jt)};if(Vi==="line")for(let Oa of ty(C.geometry,0,0,gs,gs)){let To=b_(Oa,Un,Ya,J.vertical||Nr,ht,24,Pn,U.overscaling,gs);for(let _o of To)Nr&&cy(U,Nr.text,zi,_o)||Ki(Oa,_o)}else if(Vi==="line-center"){for(let Oa of C.geometry)if(Oa.length>1){let To=__(Oa,Ya,J.vertical||Nr,ht,24,Pn);To&&Ki(Oa,To)}}else if(C.type==="Polygon")for(let Oa of Mu(C.geometry,0)){let To=T_(Oa,16);Ki(Oa[0],new gp(To.x,To.y,0))}else if(C.type==="LineString")for(let Oa of C.geometry)Ki(Oa,new gp(Oa[0].x,Oa[0].y,0));else if(C.type==="Point")for(let Oa of C.geometry)for(let To of Oa)Ki([To],new gp(To.x,To.y,0))}function ly(U,C,J,ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr,Cr,Nr){let $r=function(ua,Un,Kn,Sa,Ya,Qi,Vo,Vi){let zi=Sa.layout.get("text-rotate").evaluate(Qi,{})*Math.PI/180,xo=[];for(let so of Un.positionedLines)for(let Ki of so.positionedGlyphs){if(!Ki.rect)continue;let Oa=Ki.rect||{},To=Yg+1,_o=!0,Ko=1,Bl=0,Dl=(Ya||Vi)&&Ki.vertical,Uc=Ki.metrics.advance*Ki.scale/2;if(Vi&&Un.verticalizable&&(Bl=so.lineOffset/2-(Ki.imageName?-(ol-Ki.metrics.width*Ki.scale)/2:(Ki.scale-1)*ol)),Ki.imageName){let Js=Vo[Ki.imageName];_o=Js.sdf,Ko=Js.pixelRatio,To=Tc/Ko}let Kh=Ya?[Ki.x+Uc,Ki.y]:[0,0],cc=Ya?[0,0]:[Ki.x+Uc+Kn[0],Ki.y+Kn[1]-Bl],kc=[0,0];Dl&&(kc=cc,cc=[0,0]);let Bh=Ki.metrics.isDoubleResolution?2:1,Rh=(Ki.metrics.left-To)*Ki.scale-Uc+cc[0],jh=(-Ki.metrics.top-To)*Ki.scale+cc[1],Ou=Rh+Oa.w/Bh*Ki.scale/Ko,Vc=jh+Oa.h/Bh*Ki.scale/Ko,Mh=new o(Rh,jh),dh=new o(Ou,jh),Nh=new o(Rh,Vc),Kc=new o(Ou,Vc);if(Dl){let Js=new o(-Uc,Uc-ed),yl=-Math.PI/2,Al=ol/2-Uc,ku=new o(5-ed-Al,-(Ki.imageName?Al:0)),ou=new o(...kc);Mh._rotateAround(yl,Js)._add(ku)._add(ou),dh._rotateAround(yl,Js)._add(ku)._add(ou),Nh._rotateAround(yl,Js)._add(ku)._add(ou),Kc._rotateAround(yl,Js)._add(ku)._add(ou)}if(zi){let Js=Math.sin(zi),yl=Math.cos(zi),Al=[yl,-Js,Js,yl];Mh._matMult(Al),dh._matMult(Al),Nh._matMult(Al),Kc._matMult(Al)}let cf=new o(0,0),iu=new o(0,0);xo.push({tl:Mh,tr:dh,bl:Nh,br:Kc,tex:Oa,writingMode:Un.writingMode,glyphOffset:Kh,sectionIndex:Ki.sectionIndex,isSDF:_o,pixelOffsetTL:cf,pixelOffsetBR:iu,minFontScaleX:0,minFontScaleY:0})}return xo}(0,J,ae,At,Bt,jt,ht,U.allowVerticalPlacement),cn=U.textSizeData,Pn=null;cn.kind==="source"?(Pn=[Ff*At.layout.get("text-size").evaluate(jt,{})],Pn[0]>pp&&_(`${U.layerIds[0]}: Value for "text-size" is >= ${Xd}. Reduce your "text-size".`)):cn.kind==="composite"&&(Pn=[Ff*Cr.compositeTextSizes[0].evaluate(jt,{},Nr),Ff*Cr.compositeTextSizes[1].evaluate(jt,{},Nr)],(Pn[0]>pp||Pn[1]>pp)&&_(`${U.layerIds[0]}: Value for "text-size" is >= ${Xd}. Reduce your "text-size".`)),U.addSymbols(U.text,$r,Pn,ae,Bt,jt,Ie,C,me.lineStartIndex,me.lineLength,vr,Nr);for(let ua of Ge)Ke[ua]=U.text.placedSymbolArray.length-1;return 4*$r.length}function uy(U){for(let C in U)return U[C];return null}function cy(U,C,J,ht){let At=U.compareText;if(C in At){let Bt=At[C];for(let jt=Bt.length-1;jt>=0;jt--)if(ht.dist(Bt[jt])<J)return!0}else At[C]=[];return At[C].push(ht),!1}let hy=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class fm{static from(C){if(!(C instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[J,ht]=new Uint8Array(C,0,2);if(J!==219)throw new Error("Data does not appear to be in a KDBush format.");let At=ht>>4;if(At!==1)throw new Error(`Got v${At} data when expected v1.`);let Bt=hy[15&ht];if(!Bt)throw new Error("Unrecognized array type.");let[jt]=new Uint16Array(C,2,1),[ae]=new Uint32Array(C,4,1);return new fm(ae,jt,Bt,C)}constructor(C,J=64,ht=Float64Array,At){if(isNaN(C)||C<0)throw new Error(`Unpexpected numItems value: ${C}.`);this.numItems=+C,this.nodeSize=Math.min(Math.max(+J,2),65535),this.ArrayType=ht,this.IndexArrayType=C<65536?Uint16Array:Uint32Array;let Bt=hy.indexOf(this.ArrayType),jt=2*C*this.ArrayType.BYTES_PER_ELEMENT,ae=C*this.IndexArrayType.BYTES_PER_ELEMENT,me=(8-ae%8)%8;if(Bt<0)throw new Error(`Unexpected typed array class: ${ht}.`);At&&At instanceof ArrayBuffer?(this.data=At,this.ids=new this.IndexArrayType(this.data,8,C),this.coords=new this.ArrayType(this.data,8+ae+me,2*C),this._pos=2*C,this._finished=!0):(this.data=new ArrayBuffer(8+jt+ae+me),this.ids=new this.IndexArrayType(this.data,8,C),this.coords=new this.ArrayType(this.data,8+ae+me,2*C),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Bt]),new Uint16Array(this.data,2,1)[0]=J,new Uint32Array(this.data,4,1)[0]=C)}add(C,J){let ht=this._pos>>1;return this.ids[ht]=ht,this.coords[this._pos++]=C,this.coords[this._pos++]=J,ht}finish(){let C=this._pos>>1;if(C!==this.numItems)throw new Error(`Added ${C} items when expected ${this.numItems}.`);return pm(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(C,J,ht,At){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Bt,coords:jt,nodeSize:ae}=this,me=[0,Bt.length-1,0],Ie=[];for(;me.length;){let Ge=me.pop()||0,Ke=me.pop()||0,vr=me.pop()||0;if(Ke-vr<=ae){for(let cn=vr;cn<=Ke;cn++){let Pn=jt[2*cn],ua=jt[2*cn+1];Pn>=C&&Pn<=ht&&ua>=J&&ua<=At&&Ie.push(Bt[cn])}continue}let Cr=vr+Ke>>1,Nr=jt[2*Cr],$r=jt[2*Cr+1];Nr>=C&&Nr<=ht&&$r>=J&&$r<=At&&Ie.push(Bt[Cr]),(Ge===0?C<=Nr:J<=$r)&&(me.push(vr),me.push(Cr-1),me.push(1-Ge)),(Ge===0?ht>=Nr:At>=$r)&&(me.push(Cr+1),me.push(Ke),me.push(1-Ge))}return Ie}within(C,J,ht){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:At,coords:Bt,nodeSize:jt}=this,ae=[0,At.length-1,0],me=[],Ie=ht*ht;for(;ae.length;){let Ge=ae.pop()||0,Ke=ae.pop()||0,vr=ae.pop()||0;if(Ke-vr<=jt){for(let cn=vr;cn<=Ke;cn++)ph(Bt[2*cn],Bt[2*cn+1],C,J)<=Ie&&me.push(At[cn]);continue}let Cr=vr+Ke>>1,Nr=Bt[2*Cr],$r=Bt[2*Cr+1];ph(Nr,$r,C,J)<=Ie&&me.push(At[Cr]),(Ge===0?C-ht<=Nr:J-ht<=$r)&&(ae.push(vr),ae.push(Cr-1),ae.push(1-Ge)),(Ge===0?C+ht>=Nr:J+ht>=$r)&&(ae.push(Cr+1),ae.push(Ke),ae.push(1-Ge))}return me}}function pm(U,C,J,ht,At,Bt){if(At-ht<=J)return;let jt=ht+At>>1;fy(U,C,jt,ht,At,Bt),pm(U,C,J,ht,jt-1,1-Bt),pm(U,C,J,jt+1,At,1-Bt)}function fy(U,C,J,ht,At,Bt){for(;At>ht;){if(At-ht>600){let Ie=At-ht+1,Ge=J-ht+1,Ke=Math.log(Ie),vr=.5*Math.exp(2*Ke/3),Cr=.5*Math.sqrt(Ke*vr*(Ie-vr)/Ie)*(Ge-Ie/2<0?-1:1);fy(U,C,J,Math.max(ht,Math.floor(J-Ge*vr/Ie+Cr)),Math.min(At,Math.floor(J+(Ie-Ge)*vr/Ie+Cr)),Bt)}let jt=C[2*J+Bt],ae=ht,me=At;for(ud(U,C,ht,J),C[2*At+Bt]>jt&&ud(U,C,ht,At);ae<me;){for(ud(U,C,ae,me),ae++,me--;C[2*ae+Bt]<jt;)ae++;for(;C[2*me+Bt]>jt;)me--}C[2*ht+Bt]===jt?ud(U,C,ht,me):(me++,ud(U,C,me,At)),me<=J&&(ht=me+1),J<=me&&(At=me-1)}}function ud(U,C,J,ht){J0(U,J,ht),J0(C,2*J,2*ht),J0(C,2*J+1,2*ht+1)}function J0(U,C,J){let ht=U[C];U[C]=U[J],U[J]=ht}function ph(U,C,J,ht){let At=U-J,Bt=C-ht;return At*At+Bt*Bt}var dm;t.bg=void 0,(dm=t.bg||(t.bg={})).create="create",dm.load="load",dm.fullLoad="fullLoad";let Q0=null,cd=[],gm=1e3/60,Y0="loadTime",mm="fullLoadTime",py={mark(U){performance.mark(U)},frame(U){let C=U;Q0!=null&&cd.push(C-Q0),Q0=C},clearMetrics(){Q0=null,cd=[],performance.clearMeasures(Y0),performance.clearMeasures(mm);for(let U in t.bg)performance.clearMarks(t.bg[U])},getPerformanceMetrics(){performance.measure(Y0,t.bg.create,t.bg.load),performance.measure(mm,t.bg.create,t.bg.fullLoad);let U=performance.getEntriesByName(Y0)[0].duration,C=performance.getEntriesByName(mm)[0].duration,J=cd.length,ht=1/(cd.reduce((Bt,jt)=>Bt+jt,0)/J/1e3),At=cd.filter(Bt=>Bt>gm).reduce((Bt,jt)=>Bt+(jt-gm)/gm,0);return{loadTime:U,fullLoadTime:C,fps:ht,percentDroppedFrames:At/(J+At)*100,totalFrames:J}}};t.$=class extends ar{},t.A=Ia,t.B=oa,t.C=function(U){if(O==null){let C=U.navigator?U.navigator.userAgent:null;O=!!U.safari||!(!C||!(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return O},t.D=Ri,t.E=ot,t.F=class{constructor(U,C){this.target=U,this.mapId=C,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Yd(()=>this.process()),this.subscription=function(J,ht,At,Bt){return J.addEventListener(ht,At,!1),{unsubscribe:()=>{J.removeEventListener(ht,At,!1)}}}(this.target,"message",J=>this.receive(J)),this.globalScope=I(self)?U:window}registerMessageHandler(U,C){this.messageHandlers[U]=C}sendAsync(U,C){return new Promise((J,ht)=>{let At=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[At]={resolve:J,reject:ht},C&&C.signal.addEventListener("abort",()=>{delete this.resolveRejects[At];let ae={id:At,type:"<cancel>",origin:location.origin,targetMapId:U.targetMapId,sourceMapId:this.mapId};this.target.postMessage(ae)},{once:!0});let Bt=[],jt=Object.assign(Object.assign({},U),{id:At,sourceMapId:this.mapId,origin:location.origin,data:Ni(U.data,Bt)});this.target.postMessage(jt,{transfer:Bt})})}receive(U){let C=U.data,J=C.id;if(!(C.origin!=="file://"&&location.origin!=="file://"&&C.origin!=="resource://android"&&location.origin!=="resource://android"&&C.origin!==location.origin||C.targetMapId&&this.mapId!==C.targetMapId)){if(C.type==="<cancel>"){delete this.tasks[J];let ht=this.abortControllers[J];return delete this.abortControllers[J],void(ht&&ht.abort())}if(I(self)||C.mustQueue)return this.tasks[J]=C,this.taskQueue.push(J),void this.invoker.trigger();this.processTask(J,C)}}process(){if(this.taskQueue.length===0)return;let U=this.taskQueue.shift(),C=this.tasks[U];delete this.tasks[U],this.taskQueue.length>0&&this.invoker.trigger(),C&&this.processTask(U,C)}processTask(U,C){return e(this,void 0,void 0,function*(){if(C.type==="<response>"){let At=this.resolveRejects[U];return delete this.resolveRejects[U],At?void(C.error?At.reject(Hi(C.error)):At.resolve(Hi(C.data))):void 0}if(!this.messageHandlers[C.type])return void this.completeTask(U,new Error(`Could not find a registered handler for ${C.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let J=Hi(C.data),ht=new AbortController;this.abortControllers[U]=ht;try{let At=yield this.messageHandlers[C.type](C.sourceMapId,J,ht);this.completeTask(U,null,At)}catch(At){this.completeTask(U,At)}})}completeTask(U,C,J){let ht=[];delete this.abortControllers[U];let At={id:U,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:C?Ni(C):null,data:Ni(J,ht)};this.target.postMessage(At,{transfer:ht})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.G=lt,t.H=function(){var U=new Ia(16);return Ia!=Float32Array&&(U[1]=0,U[2]=0,U[3]=0,U[4]=0,U[6]=0,U[7]=0,U[8]=0,U[9]=0,U[11]=0,U[12]=0,U[13]=0,U[14]=0),U[0]=1,U[5]=1,U[10]=1,U[15]=1,U},t.I=fh,t.J=function(U,C,J){var ht,At,Bt,jt,ae,me,Ie,Ge,Ke,vr,Cr,Nr,$r=J[0],cn=J[1],Pn=J[2];return C===U?(U[12]=C[0]*$r+C[4]*cn+C[8]*Pn+C[12],U[13]=C[1]*$r+C[5]*cn+C[9]*Pn+C[13],U[14]=C[2]*$r+C[6]*cn+C[10]*Pn+C[14],U[15]=C[3]*$r+C[7]*cn+C[11]*Pn+C[15]):(At=C[1],Bt=C[2],jt=C[3],ae=C[4],me=C[5],Ie=C[6],Ge=C[7],Ke=C[8],vr=C[9],Cr=C[10],Nr=C[11],U[0]=ht=C[0],U[1]=At,U[2]=Bt,U[3]=jt,U[4]=ae,U[5]=me,U[6]=Ie,U[7]=Ge,U[8]=Ke,U[9]=vr,U[10]=Cr,U[11]=Nr,U[12]=ht*$r+ae*cn+Ke*Pn+C[12],U[13]=At*$r+me*cn+vr*Pn+C[13],U[14]=Bt*$r+Ie*cn+Cr*Pn+C[14],U[15]=jt*$r+Ge*cn+Nr*Pn+C[15]),U},t.K=function(U,C,J){var ht=J[0],At=J[1],Bt=J[2];return U[0]=C[0]*ht,U[1]=C[1]*ht,U[2]=C[2]*ht,U[3]=C[3]*ht,U[4]=C[4]*At,U[5]=C[5]*At,U[6]=C[6]*At,U[7]=C[7]*At,U[8]=C[8]*Bt,U[9]=C[9]*Bt,U[10]=C[10]*Bt,U[11]=C[11]*Bt,U[12]=C[12],U[13]=C[13],U[14]=C[14],U[15]=C[15],U},t.L=ki,t.M=function(U,C){let J={};for(let ht=0;ht<C.length;ht++){let At=C[ht];At in U&&(J[At]=U[At])}return J},t.N=Bf,t.O=Z0,t.P=o,t.Q=Wv,t.R=Gs,t.S=gf,t.T=Fl,t.U=p,t.V=y,t.W=L,t.X=gs,t.Y=ie,t.Z=Kd,t._=e,t.a=rt,t.a$=function(U,C){var J=U[0],ht=U[1],At=U[2],Bt=U[3],jt=U[4],ae=U[5],me=U[6],Ie=U[7],Ge=U[8],Ke=U[9],vr=U[10],Cr=U[11],Nr=U[12],$r=U[13],cn=U[14],Pn=U[15],ua=C[0],Un=C[1],Kn=C[2],Sa=C[3],Ya=C[4],Qi=C[5],Vo=C[6],Vi=C[7],zi=C[8],xo=C[9],so=C[10],Ki=C[11],Oa=C[12],To=C[13],_o=C[14],Ko=C[15];return Math.abs(J-ua)<=_i*Math.max(1,Math.abs(J),Math.abs(ua))&&Math.abs(ht-Un)<=_i*Math.max(1,Math.abs(ht),Math.abs(Un))&&Math.abs(At-Kn)<=_i*Math.max(1,Math.abs(At),Math.abs(Kn))&&Math.abs(Bt-Sa)<=_i*Math.max(1,Math.abs(Bt),Math.abs(Sa))&&Math.abs(jt-Ya)<=_i*Math.max(1,Math.abs(jt),Math.abs(Ya))&&Math.abs(ae-Qi)<=_i*Math.max(1,Math.abs(ae),Math.abs(Qi))&&Math.abs(me-Vo)<=_i*Math.max(1,Math.abs(me),Math.abs(Vo))&&Math.abs(Ie-Vi)<=_i*Math.max(1,Math.abs(Ie),Math.abs(Vi))&&Math.abs(Ge-zi)<=_i*Math.max(1,Math.abs(Ge),Math.abs(zi))&&Math.abs(Ke-xo)<=_i*Math.max(1,Math.abs(Ke),Math.abs(xo))&&Math.abs(vr-so)<=_i*Math.max(1,Math.abs(vr),Math.abs(so))&&Math.abs(Cr-Ki)<=_i*Math.max(1,Math.abs(Cr),Math.abs(Ki))&&Math.abs(Nr-Oa)<=_i*Math.max(1,Math.abs(Nr),Math.abs(Oa))&&Math.abs($r-To)<=_i*Math.max(1,Math.abs($r),Math.abs(To))&&Math.abs(cn-_o)<=_i*Math.max(1,Math.abs(cn),Math.abs(_o))&&Math.abs(Pn-Ko)<=_i*Math.max(1,Math.abs(Pn),Math.abs(Ko))},t.a0=jr,t.a1=lm,t.a2=bt,t.a3=U=>{let C=window.document.createElement("video");return C.muted=!0,new Promise(J=>{C.onloadstart=()=>{J(C)};for(let ht of U){let At=window.document.createElement("source");$(ht)||(C.crossOrigin="Anonymous"),At.src=ht,C.appendChild(At)}})},t.a4=function(){return M++},t.a5=la,t.a6=Cp,t.a7=_c,t.a8=gn,t.a9=Jv,t.aA=function(U){if(U.type==="custom")return new Hv(U);switch(U.type){case"background":return new Qd(U);case"circle":return new xi(U);case"fill":return new $n(U);case"fill-extrusion":return new Xh(U);case"heatmap":return new al(U);case"hillshade":return new Fc(U);case"line":return new Sp(U);case"raster":return new x_(U);case"symbol":return new H0(U)}},t.aB=f,t.aC=function(U,C){if(!U)return[{command:"setStyle",args:[C]}];let J=[];try{if(!xt(U.version,C.version))return[{command:"setStyle",args:[C]}];xt(U.center,C.center)||J.push({command:"setCenter",args:[C.center]}),xt(U.zoom,C.zoom)||J.push({command:"setZoom",args:[C.zoom]}),xt(U.bearing,C.bearing)||J.push({command:"setBearing",args:[C.bearing]}),xt(U.pitch,C.pitch)||J.push({command:"setPitch",args:[C.pitch]}),xt(U.sprite,C.sprite)||J.push({command:"setSprite",args:[C.sprite]}),xt(U.glyphs,C.glyphs)||J.push({command:"setGlyphs",args:[C.glyphs]}),xt(U.transition,C.transition)||J.push({command:"setTransition",args:[C.transition]}),xt(U.light,C.light)||J.push({command:"setLight",args:[C.light]}),xt(U.terrain,C.terrain)||J.push({command:"setTerrain",args:[C.terrain]}),xt(U.sky,C.sky)||J.push({command:"setSky",args:[C.sky]}),xt(U.projection,C.projection)||J.push({command:"setProjection",args:[C.projection]});let ht={},At=[];(function(jt,ae,me,Ie){let Ge;for(Ge in ae=ae||{},jt=jt||{})Object.prototype.hasOwnProperty.call(jt,Ge)&&(Object.prototype.hasOwnProperty.call(ae,Ge)||Nt(Ge,me,Ie));for(Ge in ae)Object.prototype.hasOwnProperty.call(ae,Ge)&&(Object.prototype.hasOwnProperty.call(jt,Ge)?xt(jt[Ge],ae[Ge])||(jt[Ge].type==="geojson"&&ae[Ge].type==="geojson"&&Jt(jt,ae,Ge)?Ft(me,{command:"setGeoJSONSourceData",args:[Ge,ae[Ge].data]}):te(Ge,ae,me,Ie)):Et(Ge,ae,me))})(U.sources,C.sources,At,ht);let Bt=[];U.layers&&U.layers.forEach(jt=>{"source"in jt&&ht[jt.source]?J.push({command:"removeLayer",args:[jt.id]}):Bt.push(jt)}),J=J.concat(At),function(jt,ae,me){ae=ae||[];let Ie=(jt=jt||[]).map(Wt),Ge=ae.map(Wt),Ke=jt.reduce(gt,{}),vr=ae.reduce(gt,{}),Cr=Ie.slice(),Nr=Object.create(null),$r,cn,Pn,ua,Un;for(let Kn=0,Sa=0;Kn<Ie.length;Kn++)$r=Ie[Kn],Object.prototype.hasOwnProperty.call(vr,$r)?Sa++:(Ft(me,{command:"removeLayer",args:[$r]}),Cr.splice(Cr.indexOf($r,Sa),1));for(let Kn=0,Sa=0;Kn<Ge.length;Kn++)$r=Ge[Ge.length-1-Kn],Cr[Cr.length-1-Kn]!==$r&&(Object.prototype.hasOwnProperty.call(Ke,$r)?(Ft(me,{command:"removeLayer",args:[$r]}),Cr.splice(Cr.lastIndexOf($r,Cr.length-Sa),1)):Sa++,ua=Cr[Cr.length-Kn],Ft(me,{command:"addLayer",args:[vr[$r],ua]}),Cr.splice(Cr.length-Kn,0,$r),Nr[$r]=!0);for(let Kn=0;Kn<Ge.length;Kn++)if($r=Ge[Kn],cn=Ke[$r],Pn=vr[$r],!Nr[$r]&&!xt(cn,Pn))if(xt(cn.source,Pn.source)&&xt(cn["source-layer"],Pn["source-layer"])&&xt(cn.type,Pn.type)){for(Un in Qt(cn.layout,Pn.layout,me,$r,null,"setLayoutProperty"),Qt(cn.paint,Pn.paint,me,$r,null,"setPaintProperty"),xt(cn.filter,Pn.filter)||Ft(me,{command:"setFilter",args:[$r,Pn.filter]}),xt(cn.minzoom,Pn.minzoom)&&xt(cn.maxzoom,Pn.maxzoom)||Ft(me,{command:"setLayerZoomRange",args:[$r,Pn.minzoom,Pn.maxzoom]}),cn)Object.prototype.hasOwnProperty.call(cn,Un)&&Un!=="layout"&&Un!=="paint"&&Un!=="filter"&&Un!=="metadata"&&Un!=="minzoom"&&Un!=="maxzoom"&&(Un.indexOf("paint.")===0?Qt(cn[Un],Pn[Un],me,$r,Un.slice(6),"setPaintProperty"):xt(cn[Un],Pn[Un])||Ft(me,{command:"setLayerProperty",args:[$r,Un,Pn[Un]]}));for(Un in Pn)Object.prototype.hasOwnProperty.call(Pn,Un)&&!Object.prototype.hasOwnProperty.call(cn,Un)&&Un!=="layout"&&Un!=="paint"&&Un!=="filter"&&Un!=="metadata"&&Un!=="minzoom"&&Un!=="maxzoom"&&(Un.indexOf("paint.")===0?Qt(cn[Un],Pn[Un],me,$r,Un.slice(6),"setPaintProperty"):xt(cn[Un],Pn[Un])||Ft(me,{command:"setLayerProperty",args:[$r,Un,Pn[Un]]}))}else Ft(me,{command:"removeLayer",args:[$r]}),ua=Cr[Cr.lastIndexOf($r)+1],Ft(me,{command:"addLayer",args:[Pn,ua]})}(Bt,C.layers,J)}catch(ht){console.warn("Unable to compute style diff:",ht),J=[{command:"setStyle",args:[C]}]}return J},t.aD=function(U){let C=[],J=U.id;return J===void 0&&C.push({message:`layers.${J}: missing required property "id"`}),U.render===void 0&&C.push({message:`layers.${J}: missing required method "render"`}),U.renderingMode&&U.renderingMode!=="2d"&&U.renderingMode!=="3d"&&C.push({message:`layers.${J}: property "renderingMode" must be either "2d" or "3d"`}),C},t.aE=function U(C,J){if(Array.isArray(C)){if(!Array.isArray(J)||C.length!==J.length)return!1;for(let ht=0;ht<C.length;ht++)if(!U(C[ht],J[ht]))return!1;return!0}if(typeof C=="object"&&C!==null&&J!==null){if(typeof J!="object"||Object.keys(C).length!==Object.keys(J).length)return!1;for(let ht in C)if(!U(C[ht],J[ht]))return!1;return!0}return C===J},t.aF=w,t.aG=u,t.aH=class extends ii{constructor(U,C){super(U,C),this.current=0}set(U){this.current!==U&&(this.current=U,this.gl.uniform1i(this.location,U))}},t.aI=di,t.aJ=class extends ii{constructor(U,C){super(U,C),this.current=Ji}set(U){if(U[12]!==this.current[12]||U[0]!==this.current[0])return this.current=U,void this.gl.uniformMatrix4fv(this.location,!1,U);for(let C=1;C<16;C++)if(U[C]!==this.current[C]){this.current=U,this.gl.uniformMatrix4fv(this.location,!1,U);break}}},t.aK=Io,t.aL=gi,t.aM=Ne,t.aN=class extends ii{constructor(U,C){super(U,C),this.current=[0,0,0]}set(U){U[0]===this.current[0]&&U[1]===this.current[1]&&U[2]===this.current[2]||(this.current=U,this.gl.uniform3f(this.location,U[0],U[1],U[2]))}},t.aO=class extends ii{constructor(U,C){super(U,C),this.current=[0,0]}set(U){U[0]===this.current[0]&&U[1]===this.current[1]||(this.current=U,this.gl.uniform2f(this.location,U[0],U[1]))}},t.aP=function(U,C,J,ht,At,Bt,jt){var ae=1/(C-J),me=1/(ht-At),Ie=1/(Bt-jt);return U[0]=-2*ae,U[1]=0,U[2]=0,U[3]=0,U[4]=0,U[5]=-2*me,U[6]=0,U[7]=0,U[8]=0,U[9]=0,U[10]=2*Ie,U[11]=0,U[12]=(C+J)*ae,U[13]=(At+ht)*me,U[14]=(jt+Bt)*Ie,U[15]=1,U},t.aQ=Wa,t.aR=class extends Ae{},t.aS=Ep,t.aT=class extends nr{},t.aU=ru,t.aV=function(U){return U<=1?1:Math.pow(2,Math.ceil(Math.log(U)/Math.LN2))},t.aW=ws,t.aX=bo,t.aY=Ce,t.aZ=class extends zn{},t.a_=function(U,C){return U[0]===C[0]&&U[1]===C[1]&&U[2]===C[2]&&U[3]===C[3]&&U[4]===C[4]&&U[5]===C[5]&&U[6]===C[6]&&U[7]===C[7]&&U[8]===C[8]&&U[9]===C[9]&&U[10]===C[10]&&U[11]===C[11]&&U[12]===C[12]&&U[13]===C[13]&&U[14]===C[14]&&U[15]===C[15]},t.aa=function(U){let C={};if(U.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(J,ht,At,Bt)=>{let jt=At||Bt;return C[ht]=!jt||jt.toLowerCase(),""}),C["max-age"]){let J=parseInt(C["max-age"],10);isNaN(J)?delete C["max-age"]:C["max-age"]=J}return C},t.ab=function(U,C){let J=[];for(let ht in U)ht in C||J.push(ht);return J},t.ac=b,t.ad=function(U,C,J){var ht=Math.sin(J),At=Math.cos(J),Bt=C[0],jt=C[1],ae=C[2],me=C[3],Ie=C[4],Ge=C[5],Ke=C[6],vr=C[7];return C!==U&&(U[8]=C[8],U[9]=C[9],U[10]=C[10],U[11]=C[11],U[12]=C[12],U[13]=C[13],U[14]=C[14],U[15]=C[15]),U[0]=Bt*At+Ie*ht,U[1]=jt*At+Ge*ht,U[2]=ae*At+Ke*ht,U[3]=me*At+vr*ht,U[4]=Ie*At-Bt*ht,U[5]=Ge*At-jt*ht,U[6]=Ke*At-ae*ht,U[7]=vr*At-me*ht,U},t.ae=function(U){var C=new Ia(16);return C[0]=U[0],C[1]=U[1],C[2]=U[2],C[3]=U[3],C[4]=U[4],C[5]=U[5],C[6]=U[6],C[7]=U[7],C[8]=U[8],C[9]=U[9],C[10]=U[10],C[11]=U[11],C[12]=U[12],C[13]=U[13],C[14]=U[14],C[15]=U[15],C},t.af=Qa,t.ag=function(U,C){let J=0,ht=0;if(U.kind==="constant")ht=U.layoutSize;else if(U.kind!=="source"){let{interpolationType:At,minZoom:Bt,maxZoom:jt}=U,ae=At?b(ri.interpolationFactor(At,C,Bt,jt),0,1):0;U.kind==="camera"?ht=bi.number(U.minSize,U.maxSize,ae):J=ae}return{uSizeT:J,uSize:ht}},t.ai=function(U,{uSize:C,uSizeT:J},{lowerSize:ht,upperSize:At}){return U.kind==="source"?ht/Ff:U.kind==="composite"?bi.number(ht/Ff,At/Ff,J):C},t.aj=dp,t.ak=function(U,C,J,ht){let At=C.y-U.y,Bt=C.x-U.x,jt=ht.y-J.y,ae=ht.x-J.x,me=jt*Bt-ae*At;if(me===0)return null;let Ie=(ae*(U.y-J.y)-jt*(U.x-J.x))/me;return new o(U.x+Ie*Bt,U.y+Ie*At)},t.al=ty,t.am=ka,t.an=Ma,t.ao=function(U){let C=1/0,J=1/0,ht=-1/0,At=-1/0;for(let Bt of U)C=Math.min(C,Bt.x),J=Math.min(J,Bt.y),ht=Math.max(ht,Bt.x),At=Math.max(At,Bt.y);return[C,J,ht,At]},t.ap=ol,t.ar=em,t.as=function(U,C){var J=C[0],ht=C[1],At=C[2],Bt=C[3],jt=C[4],ae=C[5],me=C[6],Ie=C[7],Ge=C[8],Ke=C[9],vr=C[10],Cr=C[11],Nr=C[12],$r=C[13],cn=C[14],Pn=C[15],ua=J*ae-ht*jt,Un=J*me-At*jt,Kn=J*Ie-Bt*jt,Sa=ht*me-At*ae,Ya=ht*Ie-Bt*ae,Qi=At*Ie-Bt*me,Vo=Ge*$r-Ke*Nr,Vi=Ge*cn-vr*Nr,zi=Ge*Pn-Cr*Nr,xo=Ke*cn-vr*$r,so=Ke*Pn-Cr*$r,Ki=vr*Pn-Cr*cn,Oa=ua*Ki-Un*so+Kn*xo+Sa*zi-Ya*Vi+Qi*Vo;return Oa?(U[0]=(ae*Ki-me*so+Ie*xo)*(Oa=1/Oa),U[1]=(At*so-ht*Ki-Bt*xo)*Oa,U[2]=($r*Qi-cn*Ya+Pn*Sa)*Oa,U[3]=(vr*Ya-Ke*Qi-Cr*Sa)*Oa,U[4]=(me*zi-jt*Ki-Ie*Vi)*Oa,U[5]=(J*Ki-At*zi+Bt*Vi)*Oa,U[6]=(cn*Kn-Nr*Qi-Pn*Un)*Oa,U[7]=(Ge*Qi-vr*Kn+Cr*Un)*Oa,U[8]=(jt*so-ae*zi+Ie*Vo)*Oa,U[9]=(ht*zi-J*so-Bt*Vo)*Oa,U[10]=(Nr*Ya-$r*Kn+Pn*ua)*Oa,U[11]=(Ke*Kn-Ge*Ya-Cr*ua)*Oa,U[12]=(ae*Vi-jt*xo-me*Vo)*Oa,U[13]=(J*xo-ht*Vi+At*Vo)*Oa,U[14]=($r*Un-Nr*Sa-cn*ua)*Oa,U[15]=(Ge*Sa-Ke*Un+vr*ua)*Oa,U):null},t.at=hm,t.au=tm,t.av=fm,t.aw=function(){let U={},C=it.$version;for(let J in it.$root){let ht=it.$root[J];if(ht.required){let At=null;At=J==="version"?C:ht.type==="array"?[]:{},At!=null&&(U[J]=At)}}return U},t.ax=Ba,t.ay=Z,t.az=function(U){U=U.slice();let C=Object.create(null);for(let J=0;J<U.length;J++)C[U[J].id]=U[J];for(let J=0;J<U.length;J++)"ref"in U[J]&&(U[J]=wt(U[J],C[U[J].ref]));return U},t.b=B,t.b0=function(U,C){return U[0]=C[0],U[1]=C[1],U[2]=C[2],U[3]=C[3],U[4]=C[4],U[5]=C[5],U[6]=C[6],U[7]=C[7],U[8]=C[8],U[9]=C[9],U[10]=C[10],U[11]=C[11],U[12]=C[12],U[13]=C[13],U[14]=C[14],U[15]=C[15],U},t.b1=function(U,C,J){return U[0]=C[0]*J[0],U[1]=C[1]*J[1],U[2]=C[2]*J[2],U[3]=C[3]*J[3],U},t.b2=function(U,C){return U[0]*C[0]+U[1]*C[1]+U[2]*C[2]+U[3]*C[3]},t.b3=S,t.b4=Xv,t.b5=_f,t.b6=function(U,C,J,ht,At){var Bt,jt=1/Math.tan(C/2);return U[0]=jt/J,U[1]=0,U[2]=0,U[3]=0,U[4]=0,U[5]=jt,U[6]=0,U[7]=0,U[8]=0,U[9]=0,U[11]=-1,U[12]=0,U[13]=0,U[15]=0,At!=null&&At!==1/0?(U[10]=(At+ht)*(Bt=1/(ht-At)),U[14]=2*At*ht*Bt):(U[10]=-1,U[14]=-2*ht),U},t.b7=function(U,C,J){var ht=Math.sin(J),At=Math.cos(J),Bt=C[4],jt=C[5],ae=C[6],me=C[7],Ie=C[8],Ge=C[9],Ke=C[10],vr=C[11];return C!==U&&(U[0]=C[0],U[1]=C[1],U[2]=C[2],U[3]=C[3],U[12]=C[12],U[13]=C[13],U[14]=C[14],U[15]=C[15]),U[4]=Bt*At+Ie*ht,U[5]=jt*At+Ge*ht,U[6]=ae*At+Ke*ht,U[7]=me*At+vr*ht,U[8]=Ie*At-Bt*ht,U[9]=Ge*At-jt*ht,U[10]=Ke*At-ae*ht,U[11]=vr*At-me*ht,U},t.b8=l,t.b9=x,t.bA=Pp,t.bB=function(U){return U.message===j},t.bC=Xs,t.bD=ds,t.ba=function(U){return U*Math.PI/180},t.bb=function(U,C){let{x:J,y:ht}=Kd.fromLngLat(C);return!(U<0||U>25||ht<0||ht>=1||J<0||J>=1)},t.bc=function(U,C){return U[0]=C[0],U[1]=0,U[2]=0,U[3]=0,U[4]=0,U[5]=C[1],U[6]=0,U[7]=0,U[8]=0,U[9]=0,U[10]=C[2],U[11]=0,U[12]=0,U[13]=0,U[14]=0,U[15]=1,U},t.bd=class extends He{},t.be=om,t.bf=py,t.bh=tt,t.bi=function(U,C){rt.REGISTERED_PROTOCOLS[U]=C},t.bj=function(U){delete rt.REGISTERED_PROTOCOLS[U]},t.bk=function(U,C){let J={};for(let At=0;At<U.length;At++){let Bt=C&&C[U[At].id]||Oc(U[At]);C&&(C[U[At].id]=Bt);let jt=J[Bt];jt||(jt=J[Bt]=[]),jt.push(U[At])}let ht=[];for(let At in J)ht.push(J[At]);return ht},t.bl=qn,t.bm=$v,t.bn=Qv,t.bo=Rv,t.bp=function(U){U.bucket.createArrays(),U.bucket.tilePixelRatio=gs/(512*U.bucket.overscaling),U.bucket.compareText={},U.bucket.iconsNeedLinear=!1;let C=U.bucket.layers[0],J=C.layout,ht=C._unevaluatedLayout._values,At={layoutIconSize:ht["icon-size"].possiblyEvaluate(new Qo(U.bucket.zoom+1),U.canonical),layoutTextSize:ht["text-size"].possiblyEvaluate(new Qo(U.bucket.zoom+1),U.canonical),textMaxSize:ht["text-size"].possiblyEvaluate(new Qo(18))};if(U.bucket.textSizeData.kind==="composite"){let{minZoom:Ie,maxZoom:Ge}=U.bucket.textSizeData;At.compositeTextSizes=[ht["text-size"].possiblyEvaluate(new Qo(Ie),U.canonical),ht["text-size"].possiblyEvaluate(new Qo(Ge),U.canonical)]}if(U.bucket.iconSizeData.kind==="composite"){let{minZoom:Ie,maxZoom:Ge}=U.bucket.iconSizeData;At.compositeIconSizes=[ht["icon-size"].possiblyEvaluate(new Qo(Ie),U.canonical),ht["icon-size"].possiblyEvaluate(new Qo(Ge),U.canonical)]}let Bt=J.get("text-line-height")*ol,jt=J.get("text-rotation-alignment")!=="viewport"&&J.get("symbol-placement")!=="point",ae=J.get("text-keep-upright"),me=J.get("text-size");for(let Ie of U.bucket.features){let Ge=J.get("text-font").evaluate(Ie,{},U.canonical).join(","),Ke=me.evaluate(Ie,{},U.canonical),vr=At.layoutTextSize.evaluate(Ie,{},U.canonical),Cr=At.layoutIconSize.evaluate(Ie,{},U.canonical),Nr={horizontal:{},vertical:void 0},$r=Ie.text,cn,Pn=[0,0];if($r){let Kn=$r.toString(),Sa=J.get("text-letter-spacing").evaluate(Ie,{},U.canonical)*ol,Ya=So(Kn)?Sa:0,Qi=J.get("text-anchor").evaluate(Ie,{},U.canonical),Vo=sy(C,Ie,U.canonical);if(!Vo){let so=J.get("text-radial-offset").evaluate(Ie,{},U.canonical);Pn=so?oy(Qi,[so*ol,cm]):J.get("text-offset").evaluate(Ie,{},U.canonical).map(Ki=>Ki*ol)}let Vi=jt?"center":J.get("text-justify").evaluate(Ie,{},U.canonical),zi=J.get("symbol-placement")==="point"?J.get("text-max-width").evaluate(Ie,{},U.canonical)*ol:1/0,xo=()=>{U.bucket.allowVerticalPlacement&&$i(Kn)&&(Nr.vertical=j0($r,U.glyphMap,U.glyphPositions,U.imagePositions,Ge,zi,Bt,Qi,"left",Ya,Pn,t.ah.vertical,!0,vr,Ke))};if(!jt&&Vo){let so=new Set;if(Vi==="auto")for(let Oa=0;Oa<Vo.values.length;Oa+=2)so.add(hm(Vo.values[Oa]));else so.add(Vi);let Ki=!1;for(let Oa of so)if(!Nr.horizontal[Oa])if(Ki)Nr.horizontal[Oa]=Nr.horizontal[0];else{let To=j0($r,U.glyphMap,U.glyphPositions,U.imagePositions,Ge,zi,Bt,"center",Oa,Ya,Pn,t.ah.horizontal,!1,vr,Ke);To&&(Nr.horizontal[Oa]=To,Ki=To.positionedLines.length===1)}xo()}else{Vi==="auto"&&(Vi=hm(Qi));let so=j0($r,U.glyphMap,U.glyphPositions,U.imagePositions,Ge,zi,Bt,Qi,Vi,Ya,Pn,t.ah.horizontal,!1,vr,Ke);so&&(Nr.horizontal[Vi]=so),xo(),$i(Kn)&&jt&&ae&&(Nr.vertical=j0($r,U.glyphMap,U.glyphPositions,U.imagePositions,Ge,zi,Bt,Qi,Vi,Ya,Pn,t.ah.vertical,!1,vr,Ke))}}let ua=!1;if(Ie.icon&&Ie.icon.name){let Kn=U.imageMap[Ie.icon.name];Kn&&(cn=m_(U.imagePositions[Ie.icon.name],J.get("icon-offset").evaluate(Ie,{},U.canonical),J.get("icon-anchor").evaluate(Ie,{},U.canonical)),ua=!!Kn.sdf,U.bucket.sdfIcons===void 0?U.bucket.sdfIcons=ua:U.bucket.sdfIcons!==ua&&_("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Kn.pixelRatio!==U.bucket.pixelRatio||J.get("icon-rotate").constantOr(1)!==0)&&(U.bucket.iconsNeedLinear=!0))}let Un=uy(Nr.horizontal)||Nr.vertical;U.bucket.iconsInText=!!Un&&Un.iconsInText,(Un||cn)&&A_(U.bucket,Ie,Nr,cn,U.imageMap,At,vr,Cr,Pn,ua,U.canonical)}U.showCollisionBoxes&&U.bucket.generateCollisionDebugBuffers()},t.bq=Ah,t.br=hr,t.bs=Ss,t.bt=ea,t.bu=Jg,t.bv=class{constructor(U){this._marks={start:[U.url,"start"].join("#"),end:[U.url,"end"].join("#"),measure:U.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let U=performance.getEntriesByName(this._marks.measure);return U.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),U=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),U}},t.bw=function(U,C,J,ht,At){return e(this,void 0,void 0,function*(){if(y())try{return yield L(U,C,J,ht,At)}catch{}return function(Bt,jt,ae,me,Ie){let Ge=Bt.width,Ke=Bt.height;F&&N||(F=new OffscreenCanvas(Ge,Ke),N=F.getContext("2d",{willReadFrequently:!0})),F.width=Ge,F.height=Ke,N.drawImage(Bt,0,0,Ge,Ke);let vr=N.getImageData(jt,ae,me,Ie);return N.clearRect(0,0,Ge,Ke),vr.data}(U,C,J,ht,At)})},t.bx=Dp,t.by=r,t.bz=i,t.c=G,t.d=U=>e(void 0,void 0,void 0,function*(){if(U.byteLength===0)return createImageBitmap(new ImageData(1,1));let C=new Blob([new Uint8Array(U)],{type:"image/png"});try{return createImageBitmap(C)}catch(J){throw new Error(`Could not load image because of ${J.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),t.e=T,t.f=U=>new Promise((C,J)=>{let ht=new Image;ht.onload=()=>{C(ht),URL.revokeObjectURL(ht.src),ht.onload=null,window.requestAnimationFrame(()=>{ht.src=R})},ht.onerror=()=>J(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let At=new Blob([new Uint8Array(U)],{type:"image/png"});ht.src=U.byteLength?URL.createObjectURL(At):R}),t.g=ct,t.h=(U,C)=>st(T(U,{type:"json"}),C),t.i=I,t.j=q,t.k=Y,t.l=(U,C)=>st(T(U,{type:"arrayBuffer"}),C),t.m=st,t.n=function(U){return new Jg(U).readFields(f_,[])},t.o=ml,t.p=R0,t.q=Lt,t.r=Gn,t.s=$,t.t=Jn,t.u=Ln,t.v=it,t.w=_,t.x=function([U,C,J]){return C+=90,C*=Math.PI/180,J*=Math.PI/180,{x:U*Math.cos(C)*Math.sin(J),y:U*Math.sin(C)*Math.sin(J),z:U*Math.cos(J)}},t.y=bi,t.z=Qo}),E("worker",["./shared"],function(t){class e{constructor(Dt){this.keyCache={},Dt&&this.replace(Dt)}replace(Dt){this._layerConfigs={},this._layers={},this.update(Dt,[])}update(Dt,qt){for(let ut of Dt){this._layerConfigs[ut.id]=ut;let yt=this._layers[ut.id]=t.aA(ut);yt._featureFilter=t.a7(yt.filter),this.keyCache[ut.id]&&delete this.keyCache[ut.id]}for(let ut of qt)delete this.keyCache[ut],delete this._layerConfigs[ut],delete this._layers[ut];this.familiesBySource={};let zt=t.bk(Object.values(this._layerConfigs),this.keyCache);for(let ut of zt){let yt=ut.map(Me=>this._layers[Me.id]),Mt=yt[0];if(Mt.visibility==="none")continue;let Ot=Mt.source||"",$t=this.familiesBySource[Ot];$t||($t=this.familiesBySource[Ot]={});let ee=Mt.sourceLayer||"_geojsonTileLayer",we=$t[ee];we||(we=$t[ee]=[]),we.push(yt)}}}class r{constructor(Dt){let qt={},zt=[];for(let Ot in Dt){let $t=Dt[Ot],ee=qt[Ot]={};for(let we in $t){let Me=$t[+we];if(!Me||Me.bitmap.width===0||Me.bitmap.height===0)continue;let Re={x:0,y:0,w:Me.bitmap.width+2,h:Me.bitmap.height+2};zt.push(Re),ee[we]={rect:Re,metrics:Me.metrics}}}let{w:ut,h:yt}=t.p(zt),Mt=new t.o({width:ut||1,height:yt||1});for(let Ot in Dt){let $t=Dt[Ot];for(let ee in $t){let we=$t[+ee];if(!we||we.bitmap.width===0||we.bitmap.height===0)continue;let Me=qt[Ot][ee].rect;t.o.copy(we.bitmap,Mt,{x:0,y:0},{x:Me.x+1,y:Me.y+1},we.bitmap)}}this.image=Mt,this.positions=qt}}t.bl("GlyphAtlas",r);class i{constructor(Dt){this.tileID=new t.S(Dt.tileID.overscaledZ,Dt.tileID.wrap,Dt.tileID.canonical.z,Dt.tileID.canonical.x,Dt.tileID.canonical.y),this.uid=Dt.uid,this.zoom=Dt.zoom,this.pixelRatio=Dt.pixelRatio,this.tileSize=Dt.tileSize,this.source=Dt.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Dt.showCollisionBoxes,this.collectResourceTiming=!!Dt.collectResourceTiming,this.returnDependencies=!!Dt.returnDependencies,this.promoteId=Dt.promoteId,this.inFlightDependencies=[]}parse(Dt,qt,zt,ut){return t._(this,void 0,void 0,function*(){this.status="parsing",this.data=Dt,this.collisionBoxArray=new t.a5;let yt=new t.bm(Object.keys(Dt.layers).sort()),Mt=new t.bn(this.tileID,this.promoteId);Mt.bucketLayerIDs=[];let Ot={},$t={featureIndex:Mt,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:zt},ee=qt.familiesBySource[this.source];for(let An in ee){let pn=Dt.layers[An];if(!pn)continue;pn.version===1&&t.w(`Vector tile source "${this.source}" layer "${An}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let On=yt.encode(An),Nn=[];for(let ke=0;ke<pn.length;ke++){let ze=pn.feature(ke),je=Mt.getId(ze,An);Nn.push({feature:ze,id:je,index:ke,sourceLayerIndex:On})}for(let ke of ee[An]){let ze=ke[0];ze.source!==this.source&&t.w(`layer.source = ${ze.source} does not equal this.source = ${this.source}`),ze.minzoom&&this.zoom<Math.floor(ze.minzoom)||ze.maxzoom&&this.zoom>=ze.maxzoom||ze.visibility!=="none"&&(n(ke,this.zoom,zt),(Ot[ze.id]=ze.createBucket({index:Mt.bucketLayerIDs.length,layers:ke,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:On,sourceID:this.source})).populate(Nn,$t,this.tileID.canonical),Mt.bucketLayerIDs.push(ke.map(je=>je.id)))}}let we=t.aF($t.glyphDependencies,An=>Object.keys(An).map(Number));this.inFlightDependencies.forEach(An=>An?.abort()),this.inFlightDependencies=[];let Me=Promise.resolve({});if(Object.keys(we).length){let An=new AbortController;this.inFlightDependencies.push(An),Me=ut.sendAsync({type:"GG",data:{stacks:we,source:this.source,tileID:this.tileID,type:"glyphs"}},An)}let Re=Object.keys($t.iconDependencies),Be=Promise.resolve({});if(Re.length){let An=new AbortController;this.inFlightDependencies.push(An),Be=ut.sendAsync({type:"GI",data:{icons:Re,source:this.source,tileID:this.tileID,type:"icons"}},An)}let Ze=Object.keys($t.patternDependencies),Ue=Promise.resolve({});if(Ze.length){let An=new AbortController;this.inFlightDependencies.push(An),Ue=ut.sendAsync({type:"GI",data:{icons:Ze,source:this.source,tileID:this.tileID,type:"patterns"}},An)}let[mr,ln,an]=yield Promise.all([Me,Be,Ue]),vn=new r(mr),Sn=new t.bo(ln,an);for(let An in Ot){let pn=Ot[An];pn instanceof t.a6?(n(pn.layers,this.zoom,zt),t.bp({bucket:pn,glyphMap:mr,glyphPositions:vn.positions,imageMap:ln,imagePositions:Sn.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):pn.hasPattern&&(pn instanceof t.bq||pn instanceof t.br||pn instanceof t.bs)&&(n(pn.layers,this.zoom,zt),pn.addFeatures($t,this.tileID.canonical,Sn.patternPositions))}return this.status="done",{buckets:Object.values(Ot).filter(An=>!An.isEmpty()),featureIndex:Mt,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:vn.image,imageAtlas:Sn,glyphMap:this.returnDependencies?mr:null,iconMap:this.returnDependencies?ln:null,glyphPositions:this.returnDependencies?vn.positions:null}})}}function n(he,Dt,qt){let zt=new t.z(Dt);for(let ut of he)ut.recalculate(zt,qt)}class o{constructor(Dt,qt,zt){this.actor=Dt,this.layerIndex=qt,this.availableImages=zt,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Dt,qt){return t._(this,void 0,void 0,function*(){let zt=yield t.l(Dt.request,qt);try{return{vectorTile:new t.bt.VectorTile(new t.bu(zt.data)),rawData:zt.data,cacheControl:zt.cacheControl,expires:zt.expires}}catch(ut){let yt=new Uint8Array(zt.data),Mt=`Unable to parse the tile at ${Dt.request.url}, `;throw Mt+=yt[0]===31&&yt[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${ut.message}`,new Error(Mt)}})}loadTile(Dt){return t._(this,void 0,void 0,function*(){let qt=Dt.uid,zt=!!(Dt&&Dt.request&&Dt.request.collectResourceTiming)&&new t.bv(Dt.request),ut=new i(Dt);this.loading[qt]=ut;let yt=new AbortController;ut.abort=yt;try{let Mt=yield this.loadVectorTile(Dt,yt);if(delete this.loading[qt],!Mt)return null;let Ot=Mt.rawData,$t={};Mt.expires&&($t.expires=Mt.expires),Mt.cacheControl&&($t.cacheControl=Mt.cacheControl);let ee={};if(zt){let Me=zt.finish();Me&&(ee.resourceTiming=JSON.parse(JSON.stringify(Me)))}ut.vectorTile=Mt.vectorTile;let we=ut.parse(Mt.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[qt]=ut,this.fetching[qt]={rawTileData:Ot,cacheControl:$t,resourceTiming:ee};try{let Me=yield we;return t.e({rawTileData:Ot.slice(0)},Me,$t,ee)}finally{delete this.fetching[qt]}}catch(Mt){throw delete this.loading[qt],ut.status="done",this.loaded[qt]=ut,Mt}})}reloadTile(Dt){return t._(this,void 0,void 0,function*(){let qt=Dt.uid;if(!this.loaded||!this.loaded[qt])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let zt=this.loaded[qt];if(zt.showCollisionBoxes=Dt.showCollisionBoxes,zt.status==="parsing"){let ut=yield zt.parse(zt.vectorTile,this.layerIndex,this.availableImages,this.actor),yt;if(this.fetching[qt]){let{rawTileData:Mt,cacheControl:Ot,resourceTiming:$t}=this.fetching[qt];delete this.fetching[qt],yt=t.e({rawTileData:Mt.slice(0)},ut,Ot,$t)}else yt=ut;return yt}if(zt.status==="done"&&zt.vectorTile)return zt.parse(zt.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Dt){return t._(this,void 0,void 0,function*(){let qt=this.loading,zt=Dt.uid;qt&&qt[zt]&&qt[zt].abort&&(qt[zt].abort.abort(),delete qt[zt])})}removeTile(Dt){return t._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Dt.uid]&&delete this.loaded[Dt.uid]})}}class a{constructor(){this.loaded={}}loadTile(Dt){return t._(this,void 0,void 0,function*(){let{uid:qt,encoding:zt,rawImageData:ut,redFactor:yt,greenFactor:Mt,blueFactor:Ot,baseShift:$t}=Dt,ee=ut.width+2,we=ut.height+2,Me=t.b(ut)?new t.R({width:ee,height:we},yield t.bw(ut,-1,-1,ee,we)):ut,Re=new t.bx(qt,Me,zt,yt,Mt,Ot,$t);return this.loaded=this.loaded||{},this.loaded[qt]=Re,Re})}removeTile(Dt){let qt=this.loaded,zt=Dt.uid;qt&&qt[zt]&&delete qt[zt]}}function s(he,Dt){if(he.length!==0){h(he[0],Dt);for(var qt=1;qt<he.length;qt++)h(he[qt],!Dt)}}function h(he,Dt){for(var qt=0,zt=0,ut=0,yt=he.length,Mt=yt-1;ut<yt;Mt=ut++){var Ot=(he[ut][0]-he[Mt][0])*(he[Mt][1]+he[ut][1]),$t=qt+Ot;zt+=Math.abs(qt)>=Math.abs(Ot)?qt-$t+Ot:Ot-$t+qt,qt=$t}qt+zt>=0!=!!Dt&&he.reverse()}var v=t.by(function he(Dt,qt){var zt,ut=Dt&&Dt.type;if(ut==="FeatureCollection")for(zt=0;zt<Dt.features.length;zt++)he(Dt.features[zt],qt);else if(ut==="GeometryCollection")for(zt=0;zt<Dt.geometries.length;zt++)he(Dt.geometries[zt],qt);else if(ut==="Feature")he(Dt.geometry,qt);else if(ut==="Polygon")s(Dt.coordinates,qt);else if(ut==="MultiPolygon")for(zt=0;zt<Dt.coordinates.length;zt++)s(Dt.coordinates[zt],qt);return Dt});let m=t.bt.VectorTileFeature.prototype.toGeoJSON;var p={exports:{}},y=t.bz,l=t.bt.VectorTileFeature,x=b;function b(he,Dt){this.options=Dt||{},this.features=he,this.length=he.length}function S(he,Dt){this.id=typeof he.id=="number"?he.id:void 0,this.type=he.type,this.rawGeometry=he.type===1?[he.geometry]:he.geometry,this.properties=he.tags,this.extent=Dt||4096}b.prototype.feature=function(he){return new S(this.features[he],this.options.extent)},S.prototype.loadGeometry=function(){var he=this.rawGeometry;this.geometry=[];for(var Dt=0;Dt<he.length;Dt++){for(var qt=he[Dt],zt=[],ut=0;ut<qt.length;ut++)zt.push(new y(qt[ut][0],qt[ut][1]));this.geometry.push(zt)}return this.geometry},S.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var he=this.geometry,Dt=1/0,qt=-1/0,zt=1/0,ut=-1/0,yt=0;yt<he.length;yt++)for(var Mt=he[yt],Ot=0;Ot<Mt.length;Ot++){var $t=Mt[Ot];Dt=Math.min(Dt,$t.x),qt=Math.max(qt,$t.x),zt=Math.min(zt,$t.y),ut=Math.max(ut,$t.y)}return[Dt,zt,qt,ut]},S.prototype.toGeoJSON=l.prototype.toGeoJSON;var T=t.bA,M=x;function w(he){var Dt=new T;return function(qt,zt){for(var ut in qt.layers)zt.writeMessage(3,u,qt.layers[ut])}(he,Dt),Dt.finish()}function u(he,Dt){var qt;Dt.writeVarintField(15,he.version||1),Dt.writeStringField(1,he.name||""),Dt.writeVarintField(5,he.extent||4096);var zt={keys:[],values:[],keycache:{},valuecache:{}};for(qt=0;qt<he.length;qt++)zt.feature=he.feature(qt),Dt.writeMessage(2,f,zt);var ut=zt.keys;for(qt=0;qt<ut.length;qt++)Dt.writeStringField(3,ut[qt]);var yt=zt.values;for(qt=0;qt<yt.length;qt++)Dt.writeMessage(4,O,yt[qt])}function f(he,Dt){var qt=he.feature;qt.id!==void 0&&Dt.writeVarintField(1,qt.id),Dt.writeMessage(2,k,he),Dt.writeVarintField(3,qt.type),Dt.writeMessage(4,I,qt)}function k(he,Dt){var qt=he.feature,zt=he.keys,ut=he.values,yt=he.keycache,Mt=he.valuecache;for(var Ot in qt.properties){var $t=qt.properties[Ot],ee=yt[Ot];if($t!==null){ee===void 0&&(zt.push(Ot),yt[Ot]=ee=zt.length-1),Dt.writeVarint(ee);var we=typeof $t;we!=="string"&&we!=="boolean"&&we!=="number"&&($t=JSON.stringify($t));var Me=we+":"+$t,Re=Mt[Me];Re===void 0&&(ut.push($t),Mt[Me]=Re=ut.length-1),Dt.writeVarint(Re)}}}function _(he,Dt){return(Dt<<3)+(7&he)}function D(he){return he<<1^he>>31}function I(he,Dt){for(var qt=he.loadGeometry(),zt=he.type,ut=0,yt=0,Mt=qt.length,Ot=0;Ot<Mt;Ot++){var $t=qt[Ot],ee=1;zt===1&&(ee=$t.length),Dt.writeVarint(_(1,ee));for(var we=zt===3?$t.length-1:$t.length,Me=0;Me<we;Me++){Me===1&&zt!==1&&Dt.writeVarint(_(2,we-1));var Re=$t[Me].x-ut,Be=$t[Me].y-yt;Dt.writeVarint(D(Re)),Dt.writeVarint(D(Be)),ut+=Re,yt+=Be}zt===3&&Dt.writeVarint(_(7,1))}}function O(he,Dt){var qt=typeof he;qt==="string"?Dt.writeStringField(1,he):qt==="boolean"?Dt.writeBooleanField(7,he):qt==="number"&&(he%1!=0?Dt.writeDoubleField(3,he):he<0?Dt.writeSVarintField(6,he):Dt.writeVarintField(5,he))}p.exports=w,p.exports.fromVectorTileJs=w,p.exports.fromGeojsonVt=function(he,Dt){Dt=Dt||{};var qt={};for(var zt in he)qt[zt]=new M(he[zt].features,Dt),qt[zt].name=zt,qt[zt].version=Dt.version,qt[zt].extent=Dt.extent;return w({layers:qt})},p.exports.GeoJSONWrapper=M;var B=t.by(p.exports);let R={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:he=>he},L=Math.fround||(F=new Float32Array(1),he=>(F[0]=+he,F[0]));var F;let N=3,j=5,G=6;class rt{constructor(Dt){this.options=Object.assign(Object.create(R),Dt),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Dt){let{log:qt,minZoom:zt,maxZoom:ut}=this.options;qt&&console.time("total time");let yt=`prepare ${Dt.length} points`;qt&&console.time(yt),this.points=Dt;let Mt=[];for(let $t=0;$t<Dt.length;$t++){let ee=Dt[$t];if(!ee.geometry)continue;let[we,Me]=ee.geometry.coordinates,Re=L(tt(we)),Be=L(Z(Me));Mt.push(Re,Be,1/0,$t,-1,1),this.options.reduce&&Mt.push(0)}let Ot=this.trees[ut+1]=this._createTree(Mt);qt&&console.timeEnd(yt);for(let $t=ut;$t>=zt;$t--){let ee=+Date.now();Ot=this.trees[$t]=this._createTree(this._cluster(Ot,$t)),qt&&console.log("z%d: %d clusters in %dms",$t,Ot.numItems,+Date.now()-ee)}return qt&&console.timeEnd("total time"),this}getClusters(Dt,qt){let zt=((Dt[0]+180)%360+360)%360-180,ut=Math.max(-90,Math.min(90,Dt[1])),yt=Dt[2]===180?180:((Dt[2]+180)%360+360)%360-180,Mt=Math.max(-90,Math.min(90,Dt[3]));if(Dt[2]-Dt[0]>=360)zt=-180,yt=180;else if(zt>yt){let Me=this.getClusters([zt,ut,180,Mt],qt),Re=this.getClusters([-180,ut,yt,Mt],qt);return Me.concat(Re)}let Ot=this.trees[this._limitZoom(qt)],$t=Ot.range(tt(zt),Z(Mt),tt(yt),Z(ut)),ee=Ot.data,we=[];for(let Me of $t){let Re=this.stride*Me;we.push(ee[Re+j]>1?ct(ee,Re,this.clusterProps):this.points[ee[Re+N]])}return we}getChildren(Dt){let qt=this._getOriginId(Dt),zt=this._getOriginZoom(Dt),ut="No cluster with the specified id.",yt=this.trees[zt];if(!yt)throw new Error(ut);let Mt=yt.data;if(qt*this.stride>=Mt.length)throw new Error(ut);let Ot=this.options.radius/(this.options.extent*Math.pow(2,zt-1)),$t=yt.within(Mt[qt*this.stride],Mt[qt*this.stride+1],Ot),ee=[];for(let we of $t){let Me=we*this.stride;Mt[Me+4]===Dt&&ee.push(Mt[Me+j]>1?ct(Mt,Me,this.clusterProps):this.points[Mt[Me+N]])}if(ee.length===0)throw new Error(ut);return ee}getLeaves(Dt,qt,zt){let ut=[];return this._appendLeaves(ut,Dt,qt=qt||10,zt=zt||0,0),ut}getTile(Dt,qt,zt){let ut=this.trees[this._limitZoom(Dt)],yt=Math.pow(2,Dt),{extent:Mt,radius:Ot}=this.options,$t=Ot/Mt,ee=(zt-$t)/yt,we=(zt+1+$t)/yt,Me={features:[]};return this._addTileFeatures(ut.range((qt-$t)/yt,ee,(qt+1+$t)/yt,we),ut.data,qt,zt,yt,Me),qt===0&&this._addTileFeatures(ut.range(1-$t/yt,ee,1,we),ut.data,yt,zt,yt,Me),qt===yt-1&&this._addTileFeatures(ut.range(0,ee,$t/yt,we),ut.data,-1,zt,yt,Me),Me.features.length?Me:null}getClusterExpansionZoom(Dt){let qt=this._getOriginZoom(Dt)-1;for(;qt<=this.options.maxZoom;){let zt=this.getChildren(Dt);if(qt++,zt.length!==1)break;Dt=zt[0].properties.cluster_id}return qt}_appendLeaves(Dt,qt,zt,ut,yt){let Mt=this.getChildren(qt);for(let Ot of Mt){let $t=Ot.properties;if($t&&$t.cluster?yt+$t.point_count<=ut?yt+=$t.point_count:yt=this._appendLeaves(Dt,$t.cluster_id,zt,ut,yt):yt<ut?yt++:Dt.push(Ot),Dt.length===zt)break}return yt}_createTree(Dt){let qt=new t.av(Dt.length/this.stride|0,this.options.nodeSize,Float32Array);for(let zt=0;zt<Dt.length;zt+=this.stride)qt.add(Dt[zt],Dt[zt+1]);return qt.finish(),qt.data=Dt,qt}_addTileFeatures(Dt,qt,zt,ut,yt,Mt){for(let Ot of Dt){let $t=Ot*this.stride,ee=qt[$t+j]>1,we,Me,Re;if(ee)we=lt(qt,$t,this.clusterProps),Me=qt[$t],Re=qt[$t+1];else{let Ue=this.points[qt[$t+N]];we=Ue.properties;let[mr,ln]=Ue.geometry.coordinates;Me=tt(mr),Re=Z(ln)}let Be={type:1,geometry:[[Math.round(this.options.extent*(Me*yt-zt)),Math.round(this.options.extent*(Re*yt-ut))]],tags:we},Ze;Ze=ee||this.options.generateId?qt[$t+N]:this.points[qt[$t+N]].id,Ze!==void 0&&(Be.id=Ze),Mt.features.push(Be)}}_limitZoom(Dt){return Math.max(this.options.minZoom,Math.min(Math.floor(+Dt),this.options.maxZoom+1))}_cluster(Dt,qt){let{radius:zt,extent:ut,reduce:yt,minPoints:Mt}=this.options,Ot=zt/(ut*Math.pow(2,qt)),$t=Dt.data,ee=[],we=this.stride;for(let Me=0;Me<$t.length;Me+=we){if($t[Me+2]<=qt)continue;$t[Me+2]=qt;let Re=$t[Me],Be=$t[Me+1],Ze=Dt.within($t[Me],$t[Me+1],Ot),Ue=$t[Me+j],mr=Ue;for(let ln of Ze){let an=ln*we;$t[an+2]>qt&&(mr+=$t[an+j])}if(mr>Ue&&mr>=Mt){let ln,an=Re*Ue,vn=Be*Ue,Sn=-1,An=((Me/we|0)<<5)+(qt+1)+this.points.length;for(let pn of Ze){let On=pn*we;if($t[On+2]<=qt)continue;$t[On+2]=qt;let Nn=$t[On+j];an+=$t[On]*Nn,vn+=$t[On+1]*Nn,$t[On+4]=An,yt&&(ln||(ln=this._map($t,Me,!0),Sn=this.clusterProps.length,this.clusterProps.push(ln)),yt(ln,this._map($t,On)))}$t[Me+4]=An,ee.push(an/mr,vn/mr,1/0,An,-1,mr),yt&&ee.push(Sn)}else{for(let ln=0;ln<we;ln++)ee.push($t[Me+ln]);if(mr>1)for(let ln of Ze){let an=ln*we;if(!($t[an+2]<=qt)){$t[an+2]=qt;for(let vn=0;vn<we;vn++)ee.push($t[an+vn])}}}}return ee}_getOriginId(Dt){return Dt-this.points.length>>5}_getOriginZoom(Dt){return(Dt-this.points.length)%32}_map(Dt,qt,zt){if(Dt[qt+j]>1){let Mt=this.clusterProps[Dt[qt+G]];return zt?Object.assign({},Mt):Mt}let ut=this.points[Dt[qt+N]].properties,yt=this.options.map(ut);return zt&&yt===ut?Object.assign({},yt):yt}}function ct(he,Dt,qt){return{type:"Feature",id:he[Dt+N],properties:lt(he,Dt,qt),geometry:{type:"Point",coordinates:[(zt=he[Dt],360*(zt-.5)),st(he[Dt+1])]}};var zt}function lt(he,Dt,qt){let zt=he[Dt+j],ut=zt>=1e4?`${Math.round(zt/1e3)}k`:zt>=1e3?Math.round(zt/100)/10+"k":zt,yt=he[Dt+G],Mt=yt===-1?{}:Object.assign({},qt[yt]);return Object.assign(Mt,{cluster:!0,cluster_id:he[Dt+N],point_count:zt,point_count_abbreviated:ut})}function tt(he){return he/360+.5}function Z(he){let Dt=Math.sin(he*Math.PI/180),qt=.5-.25*Math.log((1+Dt)/(1-Dt))/Math.PI;return qt<0?0:qt>1?1:qt}function st(he){let Dt=(180-360*he)*Math.PI/180;return 360*Math.atan(Math.exp(Dt))/Math.PI-90}function $(he,Dt,qt,zt){let ut=zt,yt=Dt+(qt-Dt>>1),Mt,Ot=qt-Dt,$t=he[Dt],ee=he[Dt+1],we=he[qt],Me=he[qt+1];for(let Re=Dt+3;Re<qt;Re+=3){let Be=Q(he[Re],he[Re+1],$t,ee,we,Me);if(Be>ut)Mt=Re,ut=Be;else if(Be===ut){let Ze=Math.abs(Re-yt);Ze<Ot&&(Mt=Re,Ot=Ze)}}ut>zt&&(Mt-Dt>3&&$(he,Dt,Mt,zt),he[Mt+2]=ut,qt-Mt>3&&$(he,Mt,qt,zt))}function Q(he,Dt,qt,zt,ut,yt){let Mt=ut-qt,Ot=yt-zt;if(Mt!==0||Ot!==0){let $t=((he-qt)*Mt+(Dt-zt)*Ot)/(Mt*Mt+Ot*Ot);$t>1?(qt=ut,zt=yt):$t>0&&(qt+=Mt*$t,zt+=Ot*$t)}return Mt=he-qt,Ot=Dt-zt,Mt*Mt+Ot*Ot}function nt(he,Dt,qt,zt){let ut={id:he??null,type:Dt,geometry:qt,tags:zt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Dt==="Point"||Dt==="MultiPoint"||Dt==="LineString")Y(ut,qt);else if(Dt==="Polygon")Y(ut,qt[0]);else if(Dt==="MultiLineString")for(let yt of qt)Y(ut,yt);else if(Dt==="MultiPolygon")for(let yt of qt)Y(ut,yt[0]);return ut}function Y(he,Dt){for(let qt=0;qt<Dt.length;qt+=3)he.minX=Math.min(he.minX,Dt[qt]),he.minY=Math.min(he.minY,Dt[qt+1]),he.maxX=Math.max(he.maxX,Dt[qt]),he.maxY=Math.max(he.maxY,Dt[qt+1])}function q(he,Dt,qt,zt){if(!Dt.geometry)return;let ut=Dt.geometry.coordinates;if(ut&&ut.length===0)return;let yt=Dt.geometry.type,Mt=Math.pow(qt.tolerance/((1<<qt.maxZoom)*qt.extent),2),Ot=[],$t=Dt.id;if(qt.promoteId?$t=Dt.properties[qt.promoteId]:qt.generateId&&($t=zt||0),yt==="Point")ot(ut,Ot);else if(yt==="MultiPoint")for(let ee of ut)ot(ee,Ot);else if(yt==="LineString")it(ut,Ot,Mt,!1);else if(yt==="MultiLineString"){if(qt.lineMetrics){for(let ee of ut)Ot=[],it(ee,Ot,Mt,!1),he.push(nt($t,"LineString",Ot,Dt.properties));return}dt(ut,Ot,Mt,!1)}else if(yt==="Polygon")dt(ut,Ot,Mt,!0);else{if(yt!=="MultiPolygon"){if(yt==="GeometryCollection"){for(let ee of Dt.geometry.geometries)q(he,{id:$t,geometry:ee,properties:Dt.properties},qt,zt);return}throw new Error("Input data is not a valid GeoJSON object.")}for(let ee of ut){let we=[];dt(ee,we,Mt,!0),Ot.push(we)}}he.push(nt($t,yt,Ot,Dt.properties))}function ot(he,Dt){Dt.push(wt(he[0]),xt(he[1]),0)}function it(he,Dt,qt,zt){let ut,yt,Mt=0;for(let $t=0;$t<he.length;$t++){let ee=wt(he[$t][0]),we=xt(he[$t][1]);Dt.push(ee,we,0),$t>0&&(Mt+=zt?(ut*we-ee*yt)/2:Math.sqrt(Math.pow(ee-ut,2)+Math.pow(we-yt,2))),ut=ee,yt=we}let Ot=Dt.length-3;Dt[2]=1,$(Dt,0,Ot,qt),Dt[Ot+2]=1,Dt.size=Math.abs(Mt),Dt.start=0,Dt.end=Dt.size}function dt(he,Dt,qt,zt){for(let ut=0;ut<he.length;ut++){let yt=[];it(he[ut],yt,qt,zt),Dt.push(yt)}}function wt(he){return he/360+.5}function xt(he){let Dt=Math.sin(he*Math.PI/180),qt=.5-.25*Math.log((1+Dt)/(1-Dt))/Math.PI;return qt<0?0:qt>1?1:qt}function Ft(he,Dt,qt,zt,ut,yt,Mt,Ot){if(zt/=Dt,yt>=(qt/=Dt)&&Mt<zt)return he;if(Mt<qt||yt>=zt)return null;let $t=[];for(let ee of he){let we=ee.geometry,Me=ee.type,Re=ut===0?ee.minX:ee.minY,Be=ut===0?ee.maxX:ee.maxY;if(Re>=qt&&Be<zt){$t.push(ee);continue}if(Be<qt||Re>=zt)continue;let Ze=[];if(Me==="Point"||Me==="MultiPoint")Et(we,Ze,qt,zt,ut);else if(Me==="LineString")Nt(we,Ze,qt,zt,ut,!1,Ot.lineMetrics);else if(Me==="MultiLineString")Jt(we,Ze,qt,zt,ut,!1);else if(Me==="Polygon")Jt(we,Ze,qt,zt,ut,!0);else if(Me==="MultiPolygon")for(let Ue of we){let mr=[];Jt(Ue,mr,qt,zt,ut,!0),mr.length&&Ze.push(mr)}if(Ze.length){if(Ot.lineMetrics&&Me==="LineString"){for(let Ue of Ze)$t.push(nt(ee.id,Me,Ue,ee.tags));continue}Me!=="LineString"&&Me!=="MultiLineString"||(Ze.length===1?(Me="LineString",Ze=Ze[0]):Me="MultiLineString"),Me!=="Point"&&Me!=="MultiPoint"||(Me=Ze.length===3?"Point":"MultiPoint"),$t.push(nt(ee.id,Me,Ze,ee.tags))}}return $t.length?$t:null}function Et(he,Dt,qt,zt,ut){for(let yt=0;yt<he.length;yt+=3){let Mt=he[yt+ut];Mt>=qt&&Mt<=zt&&Qt(Dt,he[yt],he[yt+1],he[yt+2])}}function Nt(he,Dt,qt,zt,ut,yt,Mt){let Ot=te(he),$t=ut===0?Wt:gt,ee,we,Me=he.start;for(let mr=0;mr<he.length-3;mr+=3){let ln=he[mr],an=he[mr+1],vn=he[mr+2],Sn=he[mr+3],An=he[mr+4],pn=ut===0?ln:an,On=ut===0?Sn:An,Nn=!1;Mt&&(ee=Math.sqrt(Math.pow(ln-Sn,2)+Math.pow(an-An,2))),pn<qt?On>qt&&(we=$t(Ot,ln,an,Sn,An,qt),Mt&&(Ot.start=Me+ee*we)):pn>zt?On<zt&&(we=$t(Ot,ln,an,Sn,An,zt),Mt&&(Ot.start=Me+ee*we)):Qt(Ot,ln,an,vn),On<qt&&pn>=qt&&(we=$t(Ot,ln,an,Sn,An,qt),Nn=!0),On>zt&&pn<=zt&&(we=$t(Ot,ln,an,Sn,An,zt),Nn=!0),!yt&&Nn&&(Mt&&(Ot.end=Me+ee*we),Dt.push(Ot),Ot=te(he)),Mt&&(Me+=ee)}let Re=he.length-3,Be=he[Re],Ze=he[Re+1],Ue=ut===0?Be:Ze;Ue>=qt&&Ue<=zt&&Qt(Ot,Be,Ze,he[Re+2]),Re=Ot.length-3,yt&&Re>=3&&(Ot[Re]!==Ot[0]||Ot[Re+1]!==Ot[1])&&Qt(Ot,Ot[0],Ot[1],Ot[2]),Ot.length&&Dt.push(Ot)}function te(he){let Dt=[];return Dt.size=he.size,Dt.start=he.start,Dt.end=he.end,Dt}function Jt(he,Dt,qt,zt,ut,yt){for(let Mt of he)Nt(Mt,Dt,qt,zt,ut,yt,!1)}function Qt(he,Dt,qt,zt){he.push(Dt,qt,zt)}function Wt(he,Dt,qt,zt,ut,yt){let Mt=(yt-Dt)/(zt-Dt);return Qt(he,yt,qt+(ut-qt)*Mt,1),Mt}function gt(he,Dt,qt,zt,ut,yt){let Mt=(yt-qt)/(ut-qt);return Qt(he,Dt+(zt-Dt)*Mt,yt,1),Mt}function bt(he,Dt){let qt=[];for(let zt=0;zt<he.length;zt++){let ut=he[zt],yt=ut.type,Mt;if(yt==="Point"||yt==="MultiPoint"||yt==="LineString")Mt=vt(ut.geometry,Dt);else if(yt==="MultiLineString"||yt==="Polygon"){Mt=[];for(let Ot of ut.geometry)Mt.push(vt(Ot,Dt))}else if(yt==="MultiPolygon"){Mt=[];for(let Ot of ut.geometry){let $t=[];for(let ee of Ot)$t.push(vt(ee,Dt));Mt.push($t)}}qt.push(nt(ut.id,yt,Mt,ut.tags))}return qt}function vt(he,Dt){let qt=[];qt.size=he.size,he.start!==void 0&&(qt.start=he.start,qt.end=he.end);for(let zt=0;zt<he.length;zt+=3)qt.push(he[zt]+Dt,he[zt+1],he[zt+2]);return qt}function Ut(he,Dt){if(he.transformed)return he;let qt=1<<he.z,zt=he.x,ut=he.y;for(let yt of he.features){let Mt=yt.geometry,Ot=yt.type;if(yt.geometry=[],Ot===1)for(let $t=0;$t<Mt.length;$t+=2)yt.geometry.push(Kt(Mt[$t],Mt[$t+1],Dt,qt,zt,ut));else for(let $t=0;$t<Mt.length;$t++){let ee=[];for(let we=0;we<Mt[$t].length;we+=2)ee.push(Kt(Mt[$t][we],Mt[$t][we+1],Dt,qt,zt,ut));yt.geometry.push(ee)}}return he.transformed=!0,he}function Kt(he,Dt,qt,zt,ut,yt){return[Math.round(qt*(he*zt-ut)),Math.round(qt*(Dt*zt-yt))]}function Zt(he,Dt,qt,zt,ut){let yt=Dt===ut.maxZoom?0:ut.tolerance/((1<<Dt)*ut.extent),Mt={features:[],numPoints:0,numSimplified:0,numFeatures:he.length,source:null,x:qt,y:zt,z:Dt,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let Ot of he)le(Mt,Ot,yt,ut);return Mt}function le(he,Dt,qt,zt){let ut=Dt.geometry,yt=Dt.type,Mt=[];if(he.minX=Math.min(he.minX,Dt.minX),he.minY=Math.min(he.minY,Dt.minY),he.maxX=Math.max(he.maxX,Dt.maxX),he.maxY=Math.max(he.maxY,Dt.maxY),yt==="Point"||yt==="MultiPoint")for(let Ot=0;Ot<ut.length;Ot+=3)Mt.push(ut[Ot],ut[Ot+1]),he.numPoints++,he.numSimplified++;else if(yt==="LineString")Te(Mt,ut,he,qt,!1,!1);else if(yt==="MultiLineString"||yt==="Polygon")for(let Ot=0;Ot<ut.length;Ot++)Te(Mt,ut[Ot],he,qt,yt==="Polygon",Ot===0);else if(yt==="MultiPolygon")for(let Ot=0;Ot<ut.length;Ot++){let $t=ut[Ot];for(let ee=0;ee<$t.length;ee++)Te(Mt,$t[ee],he,qt,!0,ee===0)}if(Mt.length){let Ot=Dt.tags||null;if(yt==="LineString"&&zt.lineMetrics){Ot={};for(let ee in Dt.tags)Ot[ee]=Dt.tags[ee];Ot.mapbox_clip_start=ut.start/ut.size,Ot.mapbox_clip_end=ut.end/ut.size}let $t={geometry:Mt,type:yt==="Polygon"||yt==="MultiPolygon"?3:yt==="LineString"||yt==="MultiLineString"?2:1,tags:Ot};Dt.id!==null&&($t.id=Dt.id),he.features.push($t)}}function Te(he,Dt,qt,zt,ut,yt){let Mt=zt*zt;if(zt>0&&Dt.size<(ut?Mt:zt))return void(qt.numPoints+=Dt.length/3);let Ot=[];for(let $t=0;$t<Dt.length;$t+=3)(zt===0||Dt[$t+2]>Mt)&&(qt.numSimplified++,Ot.push(Dt[$t],Dt[$t+1])),qt.numPoints++;ut&&function($t,ee){let we=0;for(let Me=0,Re=$t.length,Be=Re-2;Me<Re;Be=Me,Me+=2)we+=($t[Me]-$t[Be])*($t[Me+1]+$t[Be+1]);if(we>0===ee)for(let Me=0,Re=$t.length;Me<Re/2;Me+=2){let Be=$t[Me],Ze=$t[Me+1];$t[Me]=$t[Re-2-Me],$t[Me+1]=$t[Re-1-Me],$t[Re-2-Me]=Be,$t[Re-1-Me]=Ze}}(Ot,yt),he.push(Ot)}let Se={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class Fe{constructor(Dt,qt){let zt=(qt=this.options=function(yt,Mt){for(let Ot in Mt)yt[Ot]=Mt[Ot];return yt}(Object.create(Se),qt)).debug;if(zt&&console.time("preprocess data"),qt.maxZoom<0||qt.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(qt.promoteId&&qt.generateId)throw new Error("promoteId and generateId cannot be used together.");let ut=function(yt,Mt){let Ot=[];if(yt.type==="FeatureCollection")for(let $t=0;$t<yt.features.length;$t++)q(Ot,yt.features[$t],Mt,$t);else q(Ot,yt.type==="Feature"?yt:{geometry:yt},Mt);return Ot}(Dt,qt);this.tiles={},this.tileCoords=[],zt&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",qt.indexMaxZoom,qt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),ut=function(yt,Mt){let Ot=Mt.buffer/Mt.extent,$t=yt,ee=Ft(yt,1,-1-Ot,Ot,0,-1,2,Mt),we=Ft(yt,1,1-Ot,2+Ot,0,-1,2,Mt);return(ee||we)&&($t=Ft(yt,1,-Ot,1+Ot,0,-1,2,Mt)||[],ee&&($t=bt(ee,1).concat($t)),we&&($t=$t.concat(bt(we,-1)))),$t}(ut,qt),ut.length&&this.splitTile(ut,0,0,0),zt&&(ut.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(Dt,qt,zt,ut,yt,Mt,Ot){let $t=[Dt,qt,zt,ut],ee=this.options,we=ee.debug;for(;$t.length;){ut=$t.pop(),zt=$t.pop(),qt=$t.pop(),Dt=$t.pop();let Me=1<<qt,Re=Oe(qt,zt,ut),Be=this.tiles[Re];if(!Be&&(we>1&&console.time("creation"),Be=this.tiles[Re]=Zt(Dt,qt,zt,ut,ee),this.tileCoords.push({z:qt,x:zt,y:ut}),we)){we>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",qt,zt,ut,Be.numFeatures,Be.numPoints,Be.numSimplified),console.timeEnd("creation"));let Nn=`z${qt}`;this.stats[Nn]=(this.stats[Nn]||0)+1,this.total++}if(Be.source=Dt,yt==null){if(qt===ee.indexMaxZoom||Be.numPoints<=ee.indexMaxPoints)continue}else{if(qt===ee.maxZoom||qt===yt)continue;if(yt!=null){let Nn=yt-qt;if(zt!==Mt>>Nn||ut!==Ot>>Nn)continue}}if(Be.source=null,Dt.length===0)continue;we>1&&console.time("clipping");let Ze=.5*ee.buffer/ee.extent,Ue=.5-Ze,mr=.5+Ze,ln=1+Ze,an=null,vn=null,Sn=null,An=null,pn=Ft(Dt,Me,zt-Ze,zt+mr,0,Be.minX,Be.maxX,ee),On=Ft(Dt,Me,zt+Ue,zt+ln,0,Be.minX,Be.maxX,ee);Dt=null,pn&&(an=Ft(pn,Me,ut-Ze,ut+mr,1,Be.minY,Be.maxY,ee),vn=Ft(pn,Me,ut+Ue,ut+ln,1,Be.minY,Be.maxY,ee),pn=null),On&&(Sn=Ft(On,Me,ut-Ze,ut+mr,1,Be.minY,Be.maxY,ee),An=Ft(On,Me,ut+Ue,ut+ln,1,Be.minY,Be.maxY,ee),On=null),we>1&&console.timeEnd("clipping"),$t.push(an||[],qt+1,2*zt,2*ut),$t.push(vn||[],qt+1,2*zt,2*ut+1),$t.push(Sn||[],qt+1,2*zt+1,2*ut),$t.push(An||[],qt+1,2*zt+1,2*ut+1)}}getTile(Dt,qt,zt){Dt=+Dt,qt=+qt,zt=+zt;let ut=this.options,{extent:yt,debug:Mt}=ut;if(Dt<0||Dt>24)return null;let Ot=1<<Dt,$t=Oe(Dt,qt=qt+Ot&Ot-1,zt);if(this.tiles[$t])return Ut(this.tiles[$t],yt);Mt>1&&console.log("drilling down to z%d-%d-%d",Dt,qt,zt);let ee,we=Dt,Me=qt,Re=zt;for(;!ee&&we>0;)we--,Me>>=1,Re>>=1,ee=this.tiles[Oe(we,Me,Re)];return ee&&ee.source?(Mt>1&&(console.log("found parent tile z%d-%d-%d",we,Me,Re),console.time("drilling down")),this.splitTile(ee.source,we,Me,Re,Dt,qt,zt),Mt>1&&console.timeEnd("drilling down"),this.tiles[$t]?Ut(this.tiles[$t],yt):null):null}}function Oe(he,Dt,qt){return 32*((1<<he)*qt+Dt)+he}function ur(he,Dt){return Dt?he.properties[Dt]:he.id}function fr(he,Dt){if(he==null)return!0;if(he.type==="Feature")return ur(he,Dt)!=null;if(he.type==="FeatureCollection"){let qt=new Set;for(let zt of he.features){let ut=ur(zt,Dt);if(ut==null||qt.has(ut))return!1;qt.add(ut)}return!0}return!1}function We(he,Dt){let qt=new Map;if(he!=null)if(he.type==="Feature")qt.set(ur(he,Dt),he);else for(let zt of he.features)qt.set(ur(zt,Dt),zt);return qt}class Lr extends o{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(Dt,qt){return t._(this,void 0,void 0,function*(){let zt=Dt.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let ut=this._geoJSONIndex.getTile(zt.z,zt.x,zt.y);if(!ut)return null;let yt=new class{constructor(Ot){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.X,this.length=Ot.length,this._features=Ot}feature(Ot){return new class{constructor($t){this._feature=$t,this.extent=t.X,this.type=$t.type,this.properties=$t.tags,"id"in $t&&!isNaN($t.id)&&(this.id=parseInt($t.id,10))}loadGeometry(){if(this._feature.type===1){let $t=[];for(let ee of this._feature.geometry)$t.push([new t.P(ee[0],ee[1])]);return $t}{let $t=[];for(let ee of this._feature.geometry){let we=[];for(let Me of ee)we.push(new t.P(Me[0],Me[1]));$t.push(we)}return $t}}toGeoJSON($t,ee,we){return m.call(this,$t,ee,we)}}(this._features[Ot])}}(ut.features),Mt=B(yt);return Mt.byteOffset===0&&Mt.byteLength===Mt.buffer.byteLength||(Mt=new Uint8Array(Mt)),{vectorTile:yt,rawData:Mt.buffer}})}loadData(Dt){return t._(this,void 0,void 0,function*(){var qt;(qt=this._pendingRequest)===null||qt===void 0||qt.abort();let zt=!!(Dt&&Dt.request&&Dt.request.collectResourceTiming)&&new t.bv(Dt.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(Dt,this._pendingRequest),this._geoJSONIndex=Dt.cluster?new rt(function({superclusterOptions:Mt,clusterProperties:Ot}){if(!Ot||!Mt)return Mt;let $t={},ee={},we={accumulated:null,zoom:0},Me={properties:null},Re=Object.keys(Ot);for(let Be of Re){let[Ze,Ue]=Ot[Be],mr=t.bC(Ue),ln=t.bC(typeof Ze=="string"?[Ze,["accumulated"],["get",Be]]:Ze);$t[Be]=mr.value,ee[Be]=ln.value}return Mt.map=Be=>{Me.properties=Be;let Ze={};for(let Ue of Re)Ze[Ue]=$t[Ue].evaluate(we,Me);return Ze},Mt.reduce=(Be,Ze)=>{Me.properties=Ze;for(let Ue of Re)we.accumulated=Be[Ue],Be[Ue]=ee[Ue].evaluate(we,Me)},Mt}(Dt)).load((yield this._pendingData).features):(ut=yield this._pendingData,new Fe(ut,Dt.geojsonVtOptions)),this.loaded={};let yt={};if(zt){let Mt=zt.finish();Mt&&(yt.resourceTiming={},yt.resourceTiming[Dt.source]=JSON.parse(JSON.stringify(Mt)))}return yt}catch(yt){if(delete this._pendingRequest,t.bB(yt))return{abandoned:!0};throw yt}var ut})}getData(){return t._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(Dt){let qt=this.loaded;return qt&&qt[Dt.uid]?super.reloadTile(Dt):this.loadTile(Dt)}loadAndProcessGeoJSON(Dt,qt){return t._(this,void 0,void 0,function*(){let zt=yield this.loadGeoJSON(Dt,qt);if(delete this._pendingRequest,typeof zt!="object")throw new Error(`Input data given to '${Dt.source}' is not a valid GeoJSON object.`);if(v(zt,!0),Dt.filter){let ut=t.bC(Dt.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ut.result==="error")throw new Error(ut.value.map(yt=>`${yt.key}: ${yt.message}`).join(", "));zt={type:"FeatureCollection",features:zt.features.filter(yt=>ut.value.evaluate({zoom:0},yt))}}return zt})}loadGeoJSON(Dt,qt){return t._(this,void 0,void 0,function*(){let{promoteId:zt}=Dt;if(Dt.request){let ut=yield t.h(Dt.request,qt);return this._dataUpdateable=fr(ut.data,zt)?We(ut.data,zt):void 0,ut.data}if(typeof Dt.data=="string")try{let ut=JSON.parse(Dt.data);return this._dataUpdateable=fr(ut,zt)?We(ut,zt):void 0,ut}catch{throw new Error(`Input data given to '${Dt.source}' is not a valid GeoJSON object.`)}if(!Dt.dataDiff)throw new Error(`Input data given to '${Dt.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Dt.source}`);return function(ut,yt,Mt){var Ot,$t,ee,we;if(yt.removeAll&&ut.clear(),yt.remove)for(let Me of yt.remove)ut.delete(Me);if(yt.add)for(let Me of yt.add){let Re=ur(Me,Mt);Re!=null&&ut.set(Re,Me)}if(yt.update)for(let Me of yt.update){let Re=ut.get(Me.id);if(Re==null)continue;let Be=!Me.removeAllProperties&&(((Ot=Me.removeProperties)===null||Ot===void 0?void 0:Ot.length)>0||(($t=Me.addOrUpdateProperties)===null||$t===void 0?void 0:$t.length)>0);if((Me.newGeometry||Me.removeAllProperties||Be)&&(Re=Object.assign({},Re),ut.set(Me.id,Re),Be&&(Re.properties=Object.assign({},Re.properties))),Me.newGeometry&&(Re.geometry=Me.newGeometry),Me.removeAllProperties)Re.properties={};else if(((ee=Me.removeProperties)===null||ee===void 0?void 0:ee.length)>0)for(let Ze of Me.removeProperties)Object.prototype.hasOwnProperty.call(Re.properties,Ze)&&delete Re.properties[Ze];if(((we=Me.addOrUpdateProperties)===null||we===void 0?void 0:we.length)>0)for(let{key:Ze,value:Ue}of Me.addOrUpdateProperties)Re.properties[Ze]=Ue}}(this._dataUpdateable,Dt.dataDiff,zt),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Dt){return t._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Dt){return this._geoJSONIndex.getClusterExpansionZoom(Dt.clusterId)}getClusterChildren(Dt){return this._geoJSONIndex.getChildren(Dt.clusterId)}getClusterLeaves(Dt){return this._geoJSONIndex.getLeaves(Dt.clusterId,Dt.limit,Dt.offset)}}class kr{constructor(Dt){this.self=Dt,this.actor=new t.F(Dt),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(qt,zt)=>{if(this.externalWorkerSourceTypes[qt])throw new Error(`Worker source with name "${qt}" already registered.`);this.externalWorkerSourceTypes[qt]=zt},this.self.addProtocol=t.bi,this.self.removeProtocol=t.bj,this.self.registerRTLTextPlugin=qt=>{if(t.bD.isParsed())throw new Error("RTL text plugin already registered.");t.bD.setMethods(qt)},this.actor.registerMessageHandler("LDT",(qt,zt)=>this._getDEMWorkerSource(qt,zt.source).loadTile(zt)),this.actor.registerMessageHandler("RDT",(qt,zt)=>t._(this,void 0,void 0,function*(){this._getDEMWorkerSource(qt,zt.source).removeTile(zt)})),this.actor.registerMessageHandler("GCEZ",(qt,zt)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(qt,zt.type,zt.source).getClusterExpansionZoom(zt)})),this.actor.registerMessageHandler("GCC",(qt,zt)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(qt,zt.type,zt.source).getClusterChildren(zt)})),this.actor.registerMessageHandler("GCL",(qt,zt)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(qt,zt.type,zt.source).getClusterLeaves(zt)})),this.actor.registerMessageHandler("LD",(qt,zt)=>this._getWorkerSource(qt,zt.type,zt.source).loadData(zt)),this.actor.registerMessageHandler("GD",(qt,zt)=>this._getWorkerSource(qt,zt.type,zt.source).getData()),this.actor.registerMessageHandler("LT",(qt,zt)=>this._getWorkerSource(qt,zt.type,zt.source).loadTile(zt)),this.actor.registerMessageHandler("RT",(qt,zt)=>this._getWorkerSource(qt,zt.type,zt.source).reloadTile(zt)),this.actor.registerMessageHandler("AT",(qt,zt)=>this._getWorkerSource(qt,zt.type,zt.source).abortTile(zt)),this.actor.registerMessageHandler("RMT",(qt,zt)=>this._getWorkerSource(qt,zt.type,zt.source).removeTile(zt)),this.actor.registerMessageHandler("RS",(qt,zt)=>t._(this,void 0,void 0,function*(){if(!this.workerSources[qt]||!this.workerSources[qt][zt.type]||!this.workerSources[qt][zt.type][zt.source])return;let ut=this.workerSources[qt][zt.type][zt.source];delete this.workerSources[qt][zt.type][zt.source],ut.removeSource!==void 0&&ut.removeSource(zt)})),this.actor.registerMessageHandler("RM",qt=>t._(this,void 0,void 0,function*(){delete this.layerIndexes[qt],delete this.availableImages[qt],delete this.workerSources[qt],delete this.demWorkerSources[qt]})),this.actor.registerMessageHandler("SR",(qt,zt)=>t._(this,void 0,void 0,function*(){this.referrer=zt})),this.actor.registerMessageHandler("SRPS",(qt,zt)=>this._syncRTLPluginState(qt,zt)),this.actor.registerMessageHandler("IS",(qt,zt)=>t._(this,void 0,void 0,function*(){this.self.importScripts(zt)})),this.actor.registerMessageHandler("SI",(qt,zt)=>this._setImages(qt,zt)),this.actor.registerMessageHandler("UL",(qt,zt)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(qt).update(zt.layers,zt.removedIds)})),this.actor.registerMessageHandler("SL",(qt,zt)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(qt).replace(zt)}))}_setImages(Dt,qt){return t._(this,void 0,void 0,function*(){this.availableImages[Dt]=qt;for(let zt in this.workerSources[Dt]){let ut=this.workerSources[Dt][zt];for(let yt in ut)ut[yt].availableImages=qt}})}_syncRTLPluginState(Dt,qt){return t._(this,void 0,void 0,function*(){if(t.bD.isParsed())return t.bD.getState();if(qt.pluginStatus!=="loading")return t.bD.setState(qt),qt;let zt=qt.pluginURL;if(this.self.importScripts(zt),t.bD.isParsed()){let ut={pluginStatus:"loaded",pluginURL:zt};return t.bD.setState(ut),ut}throw t.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${zt}`)})}_getAvailableImages(Dt){let qt=this.availableImages[Dt];return qt||(qt=[]),qt}_getLayerIndex(Dt){let qt=this.layerIndexes[Dt];return qt||(qt=this.layerIndexes[Dt]=new e),qt}_getWorkerSource(Dt,qt,zt){if(this.workerSources[Dt]||(this.workerSources[Dt]={}),this.workerSources[Dt][qt]||(this.workerSources[Dt][qt]={}),!this.workerSources[Dt][qt][zt]){let ut={sendAsync:(yt,Mt)=>(yt.targetMapId=Dt,this.actor.sendAsync(yt,Mt))};switch(qt){case"vector":this.workerSources[Dt][qt][zt]=new o(ut,this._getLayerIndex(Dt),this._getAvailableImages(Dt));break;case"geojson":this.workerSources[Dt][qt][zt]=new Lr(ut,this._getLayerIndex(Dt),this._getAvailableImages(Dt));break;default:this.workerSources[Dt][qt][zt]=new this.externalWorkerSourceTypes[qt](ut,this._getLayerIndex(Dt),this._getAvailableImages(Dt))}}return this.workerSources[Dt][qt][zt]}_getDEMWorkerSource(Dt,qt){return this.demWorkerSources[Dt]||(this.demWorkerSources[Dt]={}),this.demWorkerSources[Dt][qt]||(this.demWorkerSources[Dt][qt]=new a),this.demWorkerSources[Dt][qt]}}return t.i(self)&&(self.worker=new kr(self)),kr}),E("index",["exports","./shared"],function(t,e){var r="4.7.1";let i,n,o={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:Lt=>new Promise((P,at)=>{let _t=requestAnimationFrame(P);Lt.signal.addEventListener("abort",()=>{cancelAnimationFrame(_t),at(e.c())})}),getImageData(Lt,P=0){return this.getImageCanvasContext(Lt).getImageData(-P,-P,Lt.width+2*P,Lt.height+2*P)},getImageCanvasContext(Lt){let P=window.document.createElement("canvas"),at=P.getContext("2d",{willReadFrequently:!0});if(!at)throw new Error("failed to create canvas 2d context");return P.width=Lt.width,P.height=Lt.height,at.drawImage(Lt,0,0,Lt.width,Lt.height),at},resolveURL:Lt=>(i||(i=document.createElement("a")),i.href=Lt,i.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(n==null&&(n=matchMedia("(prefers-reduced-motion: reduce)")),n.matches)}};class a{static testProp(P){if(!a.docStyle)return P[0];for(let at=0;at<P.length;at++)if(P[at]in a.docStyle)return P[at];return P[0]}static create(P,at,_t){let Tt=window.document.createElement(P);return at!==void 0&&(Tt.className=at),_t&&_t.appendChild(Tt),Tt}static createNS(P,at){return window.document.createElementNS(P,at)}static disableDrag(){a.docStyle&&a.selectProp&&(a.userSelect=a.docStyle[a.selectProp],a.docStyle[a.selectProp]="none")}static enableDrag(){a.docStyle&&a.selectProp&&(a.docStyle[a.selectProp]=a.userSelect)}static setTransform(P,at){P.style[a.transformProp]=at}static addEventListener(P,at,_t,Tt={}){P.addEventListener(at,_t,"passive"in Tt?Tt:Tt.capture)}static removeEventListener(P,at,_t,Tt={}){P.removeEventListener(at,_t,"passive"in Tt?Tt:Tt.capture)}static suppressClickInternal(P){P.preventDefault(),P.stopPropagation(),window.removeEventListener("click",a.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",a.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",a.suppressClickInternal,!0)},0)}static getScale(P){let at=P.getBoundingClientRect();return{x:at.width/P.offsetWidth||1,y:at.height/P.offsetHeight||1,boundingClientRect:at}}static getPoint(P,at,_t){let Tt=at.boundingClientRect;return new e.P((_t.clientX-Tt.left)/at.x-P.clientLeft,(_t.clientY-Tt.top)/at.y-P.clientTop)}static mousePos(P,at){let _t=a.getScale(P);return a.getPoint(P,_t,at)}static touchPos(P,at){let _t=[],Tt=a.getScale(P);for(let Pt=0;Pt<at.length;Pt++)_t.push(a.getPoint(P,Tt,at[Pt]));return _t}static mouseButton(P){return P.button}static remove(P){P.parentNode&&P.parentNode.removeChild(P)}}a.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,a.selectProp=a.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),a.transformProp=a.testProp(["transform","WebkitTransform"]);let s={supported:!1,testSupport:function(Lt){!m&&v&&(p?y(Lt):h=Lt)}},h,v,m=!1,p=!1;function y(Lt){let P=Lt.createTexture();Lt.bindTexture(Lt.TEXTURE_2D,P);try{if(Lt.texImage2D(Lt.TEXTURE_2D,0,Lt.RGBA,Lt.RGBA,Lt.UNSIGNED_BYTE,v),Lt.isContextLost())return;s.supported=!0}catch{}Lt.deleteTexture(P),m=!0}var l;typeof document<"u"&&(v=document.createElement("img"),v.onload=()=>{h&&y(h),h=null,p=!0},v.onerror=()=>{m=!0,h=null},v.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(Lt){let P,at,_t,Tt;Lt.resetRequestQueue=()=>{P=[],at=0,_t=0,Tt={}},Lt.addThrottleControl=Ee=>{let He=_t++;return Tt[He]=Ee,He},Lt.removeThrottleControl=Ee=>{delete Tt[Ee],ie()},Lt.getImage=(Ee,He,ar=!0)=>new Promise((ir,zr)=>{s.supported&&(Ee.headers||(Ee.headers={}),Ee.headers.accept="image/webp,*/*"),e.e(Ee,{type:"image"}),P.push({abortController:He,requestParameters:Ee,supportImageRefresh:ar,state:"queued",onError:Zr=>{zr(Zr)},onSuccess:Zr=>{ir(Zr)}}),ie()});let Pt=Ee=>e._(this,void 0,void 0,function*(){Ee.state="running";let{requestParameters:He,supportImageRefresh:ar,onError:ir,onSuccess:zr,abortController:Zr}=Ee,Rt=ar===!1&&!e.i(self)&&!e.g(He.url)&&(!He.headers||Object.keys(He.headers).reduce((oe,be)=>oe&&be==="accept",!0));at++;let Gt=Rt?de(He,Zr):e.m(He,Zr);try{let oe=yield Gt;delete Ee.abortController,Ee.state="completed",oe.data instanceof HTMLImageElement||e.b(oe.data)?zr(oe):oe.data&&zr({data:yield(ne=oe.data,typeof createImageBitmap=="function"?e.d(ne):e.f(ne)),cacheControl:oe.cacheControl,expires:oe.expires})}catch(oe){delete Ee.abortController,ir(oe)}finally{at--,ie()}var ne}),ie=()=>{let Ee=(()=>{for(let He of Object.keys(Tt))if(Tt[He]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let He=at;He<Ee&&P.length>0;He++){let ar=P.shift();ar.abortController.signal.aborted?He--:Pt(ar)}},de=(Ee,He)=>new Promise((ar,ir)=>{let zr=new Image,Zr=Ee.url,Rt=Ee.credentials;Rt&&Rt==="include"?zr.crossOrigin="use-credentials":(Rt&&Rt==="same-origin"||!e.s(Zr))&&(zr.crossOrigin="anonymous"),He.signal.addEventListener("abort",()=>{zr.src="",ir(e.c())}),zr.fetchPriority="high",zr.onload=()=>{zr.onerror=zr.onload=null,ar({data:zr})},zr.onerror=()=>{zr.onerror=zr.onload=null,He.signal.aborted||ir(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."))},zr.src=Zr})}(l||(l={})),l.resetRequestQueue();class x{constructor(P){this._transformRequestFn=P}transformRequest(P,at){return this._transformRequestFn&&this._transformRequestFn(P,at)||{url:P}}setTransformRequest(P){this._transformRequestFn=P}}function b(Lt){var P=new e.A(3);return P[0]=Lt[0],P[1]=Lt[1],P[2]=Lt[2],P}var S,T=function(Lt,P,at){return Lt[0]=P[0]-at[0],Lt[1]=P[1]-at[1],Lt[2]=P[2]-at[2],Lt};S=new e.A(3),e.A!=Float32Array&&(S[0]=0,S[1]=0,S[2]=0);var M=function(Lt){var P=Lt[0],at=Lt[1];return P*P+at*at};function w(Lt){let P=[];if(typeof Lt=="string")P.push({id:"default",url:Lt});else if(Lt&&Lt.length>0){let at=[];for(let{id:_t,url:Tt}of Lt){let Pt=`${_t}${Tt}`;at.indexOf(Pt)===-1&&(at.push(Pt),P.push({id:_t,url:Tt}))}}return P}function u(Lt,P,at){let _t=Lt.split("?");return _t[0]+=`${P}${at}`,_t.join("?")}(function(){var Lt=new e.A(2);e.A!=Float32Array&&(Lt[0]=0,Lt[1]=0)})();class f{constructor(P,at,_t,Tt){this.context=P,this.format=_t,this.texture=P.gl.createTexture(),this.update(at,Tt)}update(P,at,_t){let{width:Tt,height:Pt}=P,ie=!(this.size&&this.size[0]===Tt&&this.size[1]===Pt||_t),{context:de}=this,{gl:Ee}=de;if(this.useMipmap=!!(at&&at.useMipmap),Ee.bindTexture(Ee.TEXTURE_2D,this.texture),de.pixelStoreUnpackFlipY.set(!1),de.pixelStoreUnpack.set(1),de.pixelStoreUnpackPremultiplyAlpha.set(this.format===Ee.RGBA&&(!at||at.premultiply!==!1)),ie)this.size=[Tt,Pt],P instanceof HTMLImageElement||P instanceof HTMLCanvasElement||P instanceof HTMLVideoElement||P instanceof ImageData||e.b(P)?Ee.texImage2D(Ee.TEXTURE_2D,0,this.format,this.format,Ee.UNSIGNED_BYTE,P):Ee.texImage2D(Ee.TEXTURE_2D,0,this.format,Tt,Pt,0,this.format,Ee.UNSIGNED_BYTE,P.data);else{let{x:He,y:ar}=_t||{x:0,y:0};P instanceof HTMLImageElement||P instanceof HTMLCanvasElement||P instanceof HTMLVideoElement||P instanceof ImageData||e.b(P)?Ee.texSubImage2D(Ee.TEXTURE_2D,0,He,ar,Ee.RGBA,Ee.UNSIGNED_BYTE,P):Ee.texSubImage2D(Ee.TEXTURE_2D,0,He,ar,Tt,Pt,Ee.RGBA,Ee.UNSIGNED_BYTE,P.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Ee.generateMipmap(Ee.TEXTURE_2D)}bind(P,at,_t){let{context:Tt}=this,{gl:Pt}=Tt;Pt.bindTexture(Pt.TEXTURE_2D,this.texture),_t!==Pt.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(_t=Pt.LINEAR),P!==this.filter&&(Pt.texParameteri(Pt.TEXTURE_2D,Pt.TEXTURE_MAG_FILTER,P),Pt.texParameteri(Pt.TEXTURE_2D,Pt.TEXTURE_MIN_FILTER,_t||P),this.filter=P),at!==this.wrap&&(Pt.texParameteri(Pt.TEXTURE_2D,Pt.TEXTURE_WRAP_S,at),Pt.texParameteri(Pt.TEXTURE_2D,Pt.TEXTURE_WRAP_T,at),this.wrap=at)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:P}=this.context;P.deleteTexture(this.texture),this.texture=null}}function k(Lt){let{userImage:P}=Lt;return!!(P&&P.render&&P.render())&&(Lt.data.replace(new Uint8Array(P.data.buffer)),!0)}class _ extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(P){if(this.loaded!==P&&(this.loaded=P,P)){for(let{ids:at,promiseResolve:_t}of this.requestors)_t(this._getImagesForIds(at));this.requestors=[]}}getImage(P){let at=this.images[P];if(at&&!at.data&&at.spriteData){let _t=at.spriteData;at.data=new e.R({width:_t.width,height:_t.height},_t.context.getImageData(_t.x,_t.y,_t.width,_t.height).data),at.spriteData=null}return at}addImage(P,at){if(this.images[P])throw new Error(`Image id ${P} already exist, use updateImage instead`);this._validate(P,at)&&(this.images[P]=at)}_validate(P,at){let _t=!0,Tt=at.data||at.spriteData;return this._validateStretch(at.stretchX,Tt&&Tt.width)||(this.fire(new e.j(new Error(`Image "${P}" has invalid "stretchX" value`))),_t=!1),this._validateStretch(at.stretchY,Tt&&Tt.height)||(this.fire(new e.j(new Error(`Image "${P}" has invalid "stretchY" value`))),_t=!1),this._validateContent(at.content,at)||(this.fire(new e.j(new Error(`Image "${P}" has invalid "content" value`))),_t=!1),_t}_validateStretch(P,at){if(!P)return!0;let _t=0;for(let Tt of P){if(Tt[0]<_t||Tt[1]<Tt[0]||at<Tt[1])return!1;_t=Tt[1]}return!0}_validateContent(P,at){if(!P)return!0;if(P.length!==4)return!1;let _t=at.spriteData,Tt=_t&&_t.width||at.data.width,Pt=_t&&_t.height||at.data.height;return!(P[0]<0||Tt<P[0]||P[1]<0||Pt<P[1]||P[2]<0||Tt<P[2]||P[3]<0||Pt<P[3]||P[2]<P[0]||P[3]<P[1])}updateImage(P,at,_t=!0){let Tt=this.getImage(P);if(_t&&(Tt.data.width!==at.data.width||Tt.data.height!==at.data.height))throw new Error(`size mismatch between old image (${Tt.data.width}x${Tt.data.height}) and new image (${at.data.width}x${at.data.height}).`);at.version=Tt.version+1,this.images[P]=at,this.updatedImages[P]=!0}removeImage(P){let at=this.images[P];delete this.images[P],delete this.patterns[P],at.userImage&&at.userImage.onRemove&&at.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(P){return new Promise((at,_t)=>{let Tt=!0;if(!this.isLoaded())for(let Pt of P)this.images[Pt]||(Tt=!1);this.isLoaded()||Tt?at(this._getImagesForIds(P)):this.requestors.push({ids:P,promiseResolve:at})})}_getImagesForIds(P){let at={};for(let _t of P){let Tt=this.getImage(_t);Tt||(this.fire(new e.k("styleimagemissing",{id:_t})),Tt=this.getImage(_t)),Tt?at[_t]={data:Tt.data.clone(),pixelRatio:Tt.pixelRatio,sdf:Tt.sdf,version:Tt.version,stretchX:Tt.stretchX,stretchY:Tt.stretchY,content:Tt.content,textFitWidth:Tt.textFitWidth,textFitHeight:Tt.textFitHeight,hasRenderCallback:!!(Tt.userImage&&Tt.userImage.render)}:e.w(`Image "${_t}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return at}getPixelSize(){let{width:P,height:at}=this.atlasImage;return{width:P,height:at}}getPattern(P){let at=this.patterns[P],_t=this.getImage(P);if(!_t)return null;if(at&&at.position.version===_t.version)return at.position;if(at)at.position.version=_t.version;else{let Tt={w:_t.data.width+2,h:_t.data.height+2,x:0,y:0},Pt=new e.I(Tt,_t);this.patterns[P]={bin:Tt,position:Pt}}return this._updatePatternAtlas(),this.patterns[P].position}bind(P){let at=P.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new f(P,this.atlasImage,at.RGBA),this.atlasTexture.bind(at.LINEAR,at.CLAMP_TO_EDGE)}_updatePatternAtlas(){let P=[];for(let Pt in this.patterns)P.push(this.patterns[Pt].bin);let{w:at,h:_t}=e.p(P),Tt=this.atlasImage;Tt.resize({width:at||1,height:_t||1});for(let Pt in this.patterns){let{bin:ie}=this.patterns[Pt],de=ie.x+1,Ee=ie.y+1,He=this.getImage(Pt).data,ar=He.width,ir=He.height;e.R.copy(He,Tt,{x:0,y:0},{x:de,y:Ee},{width:ar,height:ir}),e.R.copy(He,Tt,{x:0,y:ir-1},{x:de,y:Ee-1},{width:ar,height:1}),e.R.copy(He,Tt,{x:0,y:0},{x:de,y:Ee+ir},{width:ar,height:1}),e.R.copy(He,Tt,{x:ar-1,y:0},{x:de-1,y:Ee},{width:1,height:ir}),e.R.copy(He,Tt,{x:0,y:0},{x:de+ar,y:Ee},{width:1,height:ir})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(P){for(let at of P){if(this.callbackDispatchedThisFrame[at])continue;this.callbackDispatchedThisFrame[at]=!0;let _t=this.getImage(at);_t||e.w(`Image with ID: "${at}" was not found`),k(_t)&&this.updateImage(at,_t)}}}let D=1e20;function I(Lt,P,at,_t,Tt,Pt,ie,de,Ee){for(let He=P;He<P+_t;He++)O(Lt,at*Pt+He,Pt,Tt,ie,de,Ee);for(let He=at;He<at+Tt;He++)O(Lt,He*Pt+P,1,_t,ie,de,Ee)}function O(Lt,P,at,_t,Tt,Pt,ie){Pt[0]=0,ie[0]=-D,ie[1]=D,Tt[0]=Lt[P];for(let de=1,Ee=0,He=0;de<_t;de++){Tt[de]=Lt[P+de*at];let ar=de*de;do{let ir=Pt[Ee];He=(Tt[de]-Tt[ir]+ar-ir*ir)/(de-ir)/2}while(He<=ie[Ee]&&--Ee>-1);Ee++,Pt[Ee]=de,ie[Ee]=He,ie[Ee+1]=D}for(let de=0,Ee=0;de<_t;de++){for(;ie[Ee+1]<de;)Ee++;let He=Pt[Ee],ar=de-He;Lt[P+de*at]=Tt[He]+ar*ar}}class B{constructor(P,at){this.requestManager=P,this.localIdeographFontFamily=at,this.entries={}}setURL(P){this.url=P}getGlyphs(P){return e._(this,void 0,void 0,function*(){let at=[];for(let Pt in P)for(let ie of P[Pt])at.push(this._getAndCacheGlyphsPromise(Pt,ie));let _t=yield Promise.all(at),Tt={};for(let{stack:Pt,id:ie,glyph:de}of _t)Tt[Pt]||(Tt[Pt]={}),Tt[Pt][ie]=de&&{id:de.id,bitmap:de.bitmap.clone(),metrics:de.metrics};return Tt})}_getAndCacheGlyphsPromise(P,at){return e._(this,void 0,void 0,function*(){let _t=this.entries[P];_t||(_t=this.entries[P]={glyphs:{},requests:{},ranges:{}});let Tt=_t.glyphs[at];if(Tt!==void 0)return{stack:P,id:at,glyph:Tt};if(Tt=this._tinySDF(_t,P,at),Tt)return _t.glyphs[at]=Tt,{stack:P,id:at,glyph:Tt};let Pt=Math.floor(at/256);if(256*Pt>65535)throw new Error("glyphs > 65535 not supported");if(_t.ranges[Pt])return{stack:P,id:at,glyph:Tt};if(!this.url)throw new Error("glyphsUrl is not set");if(!_t.requests[Pt]){let de=B.loadGlyphRange(P,Pt,this.url,this.requestManager);_t.requests[Pt]=de}let ie=yield _t.requests[Pt];for(let de in ie)this._doesCharSupportLocalGlyph(+de)||(_t.glyphs[+de]=ie[+de]);return _t.ranges[Pt]=!0,{stack:P,id:at,glyph:ie[at]||null}})}_doesCharSupportLocalGlyph(P){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(P))}_tinySDF(P,at,_t){let Tt=this.localIdeographFontFamily;if(!Tt||!this._doesCharSupportLocalGlyph(_t))return;let Pt=P.tinySDF;if(!Pt){let de="400";/bold/i.test(at)?de="900":/medium/i.test(at)?de="500":/light/i.test(at)&&(de="200"),Pt=P.tinySDF=new B.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:Tt,fontWeight:de})}let ie=Pt.draw(String.fromCharCode(_t));return{id:_t,bitmap:new e.o({width:ie.width||60,height:ie.height||60},ie.data),metrics:{width:ie.glyphWidth/2||24,height:ie.glyphHeight/2||24,left:ie.glyphLeft/2+.5||0,top:ie.glyphTop/2-27.5||-8,advance:ie.glyphAdvance/2||24,isDoubleResolution:!0}}}}B.loadGlyphRange=function(Lt,P,at,_t){return e._(this,void 0,void 0,function*(){let Tt=256*P,Pt=Tt+255,ie=_t.transformRequest(at.replace("{fontstack}",Lt).replace("{range}",`${Tt}-${Pt}`),"Glyphs"),de=yield e.l(ie,new AbortController);if(!de||!de.data)throw new Error(`Could not load glyph range. range: ${P}, ${Tt}-${Pt}`);let Ee={};for(let He of e.n(de.data))Ee[He.id]=He;return Ee})},B.TinySDF=class{constructor({fontSize:Lt=24,buffer:P=3,radius:at=8,cutoff:_t=.25,fontFamily:Tt="sans-serif",fontWeight:Pt="normal",fontStyle:ie="normal"}={}){this.buffer=P,this.cutoff=_t,this.radius=at;let de=this.size=Lt+4*P,Ee=this._createCanvas(de),He=this.ctx=Ee.getContext("2d",{willReadFrequently:!0});He.font=`${ie} ${Pt} ${Lt}px ${Tt}`,He.textBaseline="alphabetic",He.textAlign="left",He.fillStyle="black",this.gridOuter=new Float64Array(de*de),this.gridInner=new Float64Array(de*de),this.f=new Float64Array(de),this.z=new Float64Array(de+1),this.v=new Uint16Array(de)}_createCanvas(Lt){let P=document.createElement("canvas");return P.width=P.height=Lt,P}draw(Lt){let{width:P,actualBoundingBoxAscent:at,actualBoundingBoxDescent:_t,actualBoundingBoxLeft:Tt,actualBoundingBoxRight:Pt}=this.ctx.measureText(Lt),ie=Math.ceil(at),de=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Pt-Tt))),Ee=Math.min(this.size-this.buffer,ie+Math.ceil(_t)),He=de+2*this.buffer,ar=Ee+2*this.buffer,ir=Math.max(He*ar,0),zr=new Uint8ClampedArray(ir),Zr={data:zr,width:He,height:ar,glyphWidth:de,glyphHeight:Ee,glyphTop:ie,glyphLeft:0,glyphAdvance:P};if(de===0||Ee===0)return Zr;let{ctx:Rt,buffer:Gt,gridInner:ne,gridOuter:oe}=this;Rt.clearRect(Gt,Gt,de,Ee),Rt.fillText(Lt,Gt,Gt+ie);let be=Rt.getImageData(Gt,Gt,de,Ee);oe.fill(D,0,ir),ne.fill(0,0,ir);for(let pe=0;pe<Ee;pe++)for(let Ae=0;Ae<de;Ae++){let Xe=be.data[4*(pe*de+Ae)+3]/255;if(Xe===0)continue;let nr=(pe+Gt)*He+Ae+Gt;if(Xe===1)oe[nr]=0,ne[nr]=D;else{let or=.5-Xe;oe[nr]=or>0?or*or:0,ne[nr]=or<0?or*or:0}}I(oe,0,0,He,ar,He,this.f,this.v,this.z),I(ne,Gt,Gt,de,Ee,He,this.f,this.v,this.z);for(let pe=0;pe<ir;pe++){let Ae=Math.sqrt(oe[pe])-Math.sqrt(ne[pe]);zr[pe]=Math.round(255-255*(Ae/this.radius+this.cutoff))}return Zr}};class R{constructor(){this.specification=e.v.light.position}possiblyEvaluate(P,at){return e.x(P.expression.evaluate(at))}interpolate(P,at,_t){return{x:e.y.number(P.x,at.x,_t),y:e.y.number(P.y,at.y,_t),z:e.y.number(P.z,at.z,_t)}}}let L;class F extends e.E{constructor(P){super(),L=L||new e.q({anchor:new e.D(e.v.light.anchor),position:new R,color:new e.D(e.v.light.color),intensity:new e.D(e.v.light.intensity)}),this._transitionable=new e.T(L),this.setLight(P),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(P,at={}){if(!this._validate(e.r,P,at))for(let _t in P){let Tt=P[_t];_t.endsWith("-transition")?this._transitionable.setTransition(_t.slice(0,-11),Tt):this._transitionable.setValue(_t,Tt)}}updateTransitions(P){this._transitioning=this._transitionable.transitioned(P,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(P){this.properties=this._transitioning.possiblyEvaluate(P)}_validate(P,at,_t){return(!_t||_t.validate!==!1)&&e.t(this,P.call(e.u,{value:at,style:{glyphs:!0,sprite:!0},styleSpec:e.v}))}}let N=new e.q({"sky-color":new e.D(e.v.sky["sky-color"]),"horizon-color":new e.D(e.v.sky["horizon-color"]),"fog-color":new e.D(e.v.sky["fog-color"]),"fog-ground-blend":new e.D(e.v.sky["fog-ground-blend"]),"horizon-fog-blend":new e.D(e.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new e.D(e.v.sky["sky-horizon-blend"]),"atmosphere-blend":new e.D(e.v.sky["atmosphere-blend"])});class j extends e.E{constructor(P){super(),this._transitionable=new e.T(N),this.setSky(P),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.z(0))}setSky(P,at={}){if(!this._validate(e.B,P,at)){P||(P={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let _t in P){let Tt=P[_t];_t.endsWith("-transition")?this._transitionable.setTransition(_t.slice(0,-11),Tt):this._transitionable.setValue(_t,Tt)}}}getSky(){return this._transitionable.serialize()}updateTransitions(P){this._transitioning=this._transitionable.transitioned(P,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(P){this.properties=this._transitioning.possiblyEvaluate(P)}_validate(P,at,_t={}){return _t?.validate!==!1&&e.t(this,P.call(e.u,e.e({value:at,style:{glyphs:!0,sprite:!0},styleSpec:e.v})))}calculateFogBlendOpacity(P){return P<60?0:P<70?(P-60)/10:1}}class G{constructor(P,at){this.width=P,this.height=at,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(P,at){let _t=P.join(",")+String(at);return this.dashEntry[_t]||(this.dashEntry[_t]=this.addDash(P,at)),this.dashEntry[_t]}getDashRanges(P,at,_t){let Tt=[],Pt=P.length%2==1?-P[P.length-1]*_t:0,ie=P[0]*_t,de=!0;Tt.push({left:Pt,right:ie,isDash:de,zeroLength:P[0]===0});let Ee=P[0];for(let He=1;He<P.length;He++){de=!de;let ar=P[He];Pt=Ee*_t,Ee+=ar,ie=Ee*_t,Tt.push({left:Pt,right:ie,isDash:de,zeroLength:ar===0})}return Tt}addRoundDash(P,at,_t){let Tt=at/2;for(let Pt=-_t;Pt<=_t;Pt++){let ie=this.width*(this.nextRow+_t+Pt),de=0,Ee=P[de];for(let He=0;He<this.width;He++){He/Ee.right>1&&(Ee=P[++de]);let ar=Math.abs(He-Ee.left),ir=Math.abs(He-Ee.right),zr=Math.min(ar,ir),Zr,Rt=Pt/_t*(Tt+1);if(Ee.isDash){let Gt=Tt-Math.abs(Rt);Zr=Math.sqrt(zr*zr+Gt*Gt)}else Zr=Tt-Math.sqrt(zr*zr+Rt*Rt);this.data[ie+He]=Math.max(0,Math.min(255,Zr+128))}}}addRegularDash(P){for(let de=P.length-1;de>=0;--de){let Ee=P[de],He=P[de+1];Ee.zeroLength?P.splice(de,1):He&&He.isDash===Ee.isDash&&(He.left=Ee.left,P.splice(de,1))}let at=P[0],_t=P[P.length-1];at.isDash===_t.isDash&&(at.left=_t.left-this.width,_t.right=at.right+this.width);let Tt=this.width*this.nextRow,Pt=0,ie=P[Pt];for(let de=0;de<this.width;de++){de/ie.right>1&&(ie=P[++Pt]);let Ee=Math.abs(de-ie.left),He=Math.abs(de-ie.right),ar=Math.min(Ee,He);this.data[Tt+de]=Math.max(0,Math.min(255,(ie.isDash?ar:-ar)+128))}}addDash(P,at){let _t=at?7:0,Tt=2*_t+1;if(this.nextRow+Tt>this.height)return e.w("LineAtlas out of space"),null;let Pt=0;for(let de=0;de<P.length;de++)Pt+=P[de];if(Pt!==0){let de=this.width/Pt,Ee=this.getDashRanges(P,this.width,de);at?this.addRoundDash(Ee,de,_t):this.addRegularDash(Ee)}let ie={y:(this.nextRow+_t+.5)/this.height,height:2*_t/this.height,width:Pt};return this.nextRow+=Tt,this.dirty=!0,ie}bind(P){let at=P.gl;this.texture?(at.bindTexture(at.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,at.texSubImage2D(at.TEXTURE_2D,0,0,0,this.width,this.height,at.ALPHA,at.UNSIGNED_BYTE,this.data))):(this.texture=at.createTexture(),at.bindTexture(at.TEXTURE_2D,this.texture),at.texParameteri(at.TEXTURE_2D,at.TEXTURE_WRAP_S,at.REPEAT),at.texParameteri(at.TEXTURE_2D,at.TEXTURE_WRAP_T,at.REPEAT),at.texParameteri(at.TEXTURE_2D,at.TEXTURE_MIN_FILTER,at.LINEAR),at.texParameteri(at.TEXTURE_2D,at.TEXTURE_MAG_FILTER,at.LINEAR),at.texImage2D(at.TEXTURE_2D,0,at.ALPHA,this.width,this.height,0,at.ALPHA,at.UNSIGNED_BYTE,this.data))}}let rt="maplibre_preloaded_worker_pool";class ct{constructor(){this.active={}}acquire(P){if(!this.workers)for(this.workers=[];this.workers.length<ct.workerCount;)this.workers.push(new Worker(e.a.WORKER_URL));return this.active[P]=!0,this.workers.slice()}release(P){delete this.active[P],this.numActive()===0&&(this.workers.forEach(at=>{at.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[rt]}numActive(){return Object.keys(this.active).length}}let lt=Math.floor(o.hardwareConcurrency/2),tt,Z;function st(){return tt||(tt=new ct),tt}ct.workerCount=e.C(globalThis)?Math.max(Math.min(lt,3),1):1;class ${constructor(P,at){this.workerPool=P,this.actors=[],this.currentActor=0,this.id=at;let _t=this.workerPool.acquire(at);for(let Tt=0;Tt<_t.length;Tt++){let Pt=new e.F(_t[Tt],at);Pt.name=`Worker ${Tt}`,this.actors.push(Pt)}if(!this.actors.length)throw new Error("No actors found")}broadcast(P,at){let _t=[];for(let Tt of this.actors)_t.push(Tt.sendAsync({type:P,data:at}));return Promise.all(_t)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(P=!0){this.actors.forEach(at=>{at.remove()}),this.actors=[],P&&this.workerPool.release(this.id)}registerMessageHandler(P,at){for(let _t of this.actors)_t.registerMessageHandler(P,at)}}function Q(){return Z||(Z=new $(st(),e.G),Z.registerMessageHandler("GR",(Lt,P,at)=>e.m(P,at))),Z}function nt(Lt,P){let at=e.H();return e.J(at,at,[1,1,0]),e.K(at,at,[.5*Lt.width,.5*Lt.height,1]),e.L(at,at,Lt.calculatePosMatrix(P.toUnwrapped()))}function Y(Lt,P,at,_t,Tt,Pt){let ie=function(ir,zr,Zr){if(ir)for(let Rt of ir){let Gt=zr[Rt];if(Gt&&Gt.source===Zr&&Gt.type==="fill-extrusion")return!0}else for(let Rt in zr){let Gt=zr[Rt];if(Gt.source===Zr&&Gt.type==="fill-extrusion")return!0}return!1}(Tt&&Tt.layers,P,Lt.id),de=Pt.maxPitchScaleFactor(),Ee=Lt.tilesIn(_t,de,ie);Ee.sort(q);let He=[];for(let ir of Ee)He.push({wrappedTileID:ir.tileID.wrapped().key,queryResults:ir.tile.queryRenderedFeatures(P,at,Lt._state,ir.queryGeometry,ir.cameraQueryGeometry,ir.scale,Tt,Pt,de,nt(Lt.transform,ir.tileID))});let ar=function(ir){let zr={},Zr={};for(let Rt of ir){let Gt=Rt.queryResults,ne=Rt.wrappedTileID,oe=Zr[ne]=Zr[ne]||{};for(let be in Gt){let pe=Gt[be],Ae=oe[be]=oe[be]||{},Xe=zr[be]=zr[be]||[];for(let nr of pe)Ae[nr.featureIndex]||(Ae[nr.featureIndex]=!0,Xe.push(nr))}}return zr}(He);for(let ir in ar)ar[ir].forEach(zr=>{let Zr=zr.feature,Rt=Lt.getFeatureState(Zr.layer["source-layer"],Zr.id);Zr.source=Zr.layer.source,Zr.layer["source-layer"]&&(Zr.sourceLayer=Zr.layer["source-layer"]),Zr.state=Rt});return ar}function q(Lt,P){let at=Lt.tileID,_t=P.tileID;return at.overscaledZ-_t.overscaledZ||at.canonical.y-_t.canonical.y||at.wrap-_t.wrap||at.canonical.x-_t.canonical.x}function ot(Lt,P,at){return e._(this,void 0,void 0,function*(){let _t=Lt;if(Lt.url?_t=(yield e.h(P.transformRequest(Lt.url,"Source"),at)).data:yield o.frameAsync(at),!_t)return null;let Tt=e.M(e.e(_t,Lt),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in _t&&_t.vector_layers&&(Tt.vectorLayerIds=_t.vector_layers.map(Pt=>Pt.id)),Tt})}class it{constructor(P,at){P&&(at?this.setSouthWest(P).setNorthEast(at):Array.isArray(P)&&(P.length===4?this.setSouthWest([P[0],P[1]]).setNorthEast([P[2],P[3]]):this.setSouthWest(P[0]).setNorthEast(P[1])))}setNorthEast(P){return this._ne=P instanceof e.N?new e.N(P.lng,P.lat):e.N.convert(P),this}setSouthWest(P){return this._sw=P instanceof e.N?new e.N(P.lng,P.lat):e.N.convert(P),this}extend(P){let at=this._sw,_t=this._ne,Tt,Pt;if(P instanceof e.N)Tt=P,Pt=P;else{if(!(P instanceof it))return Array.isArray(P)?P.length===4||P.every(Array.isArray)?this.extend(it.convert(P)):this.extend(e.N.convert(P)):P&&("lng"in P||"lon"in P)&&"lat"in P?this.extend(e.N.convert(P)):this;if(Tt=P._sw,Pt=P._ne,!Tt||!Pt)return this}return at||_t?(at.lng=Math.min(Tt.lng,at.lng),at.lat=Math.min(Tt.lat,at.lat),_t.lng=Math.max(Pt.lng,_t.lng),_t.lat=Math.max(Pt.lat,_t.lat)):(this._sw=new e.N(Tt.lng,Tt.lat),this._ne=new e.N(Pt.lng,Pt.lat)),this}getCenter(){return new e.N((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 e.N(this.getWest(),this.getNorth())}getSouthEast(){return new e.N(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(P){let{lng:at,lat:_t}=e.N.convert(P),Tt=this._sw.lng<=at&&at<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Tt=this._sw.lng>=at&&at>=this._ne.lng),this._sw.lat<=_t&&_t<=this._ne.lat&&Tt}static convert(P){return P instanceof it?P:P&&new it(P)}static fromLngLat(P,at=0){let _t=360*at/40075017,Tt=_t/Math.cos(Math.PI/180*P.lat);return new it(new e.N(P.lng-Tt,P.lat-_t),new e.N(P.lng+Tt,P.lat+_t))}adjustAntiMeridian(){let P=new e.N(this._sw.lng,this._sw.lat),at=new e.N(this._ne.lng,this._ne.lat);return new it(P,P.lng>at.lng?new e.N(at.lng+360,at.lat):at)}}class dt{constructor(P,at,_t){this.bounds=it.convert(this.validateBounds(P)),this.minzoom=at||0,this.maxzoom=_t||24}validateBounds(P){return Array.isArray(P)&&P.length===4?[Math.max(-180,P[0]),Math.max(-90,P[1]),Math.min(180,P[2]),Math.min(90,P[3])]:[-180,-90,180,90]}contains(P){let at=Math.pow(2,P.z),_t=Math.floor(e.O(this.bounds.getWest())*at),Tt=Math.floor(e.Q(this.bounds.getNorth())*at),Pt=Math.ceil(e.O(this.bounds.getEast())*at),ie=Math.ceil(e.Q(this.bounds.getSouth())*at);return P.x>=_t&&P.x<Pt&&P.y>=Tt&&P.y<ie}}class wt extends e.E{constructor(P,at,_t,Tt){if(super(),this.id=P,this.dispatcher=_t,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.e(this,e.M(at,["url","scheme","tileSize","promoteId"])),this._options=e.e({type:"vector"},at),this._collectResourceTiming=at.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(Tt)}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let P=yield ot(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),P&&(e.e(this,P),P.bounds&&(this.tileBounds=new dt(P.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(P){this._tileJSONRequest=null,this.fire(new e.j(P))}})}loaded(){return this._loaded}hasTile(P){return!this.tileBounds||this.tileBounds.contains(P.canonical)}onAdd(P){this.map=P,this.load()}setSourceProperty(P){this._tileJSONRequest&&this._tileJSONRequest.abort(),P(),this.load()}setTiles(P){return this.setSourceProperty(()=>{this._options.tiles=P}),this}setUrl(P){return this.setSourceProperty(()=>{this.url=P,this._options.url=P}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(P){return e._(this,void 0,void 0,function*(){let at=P.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),_t={request:this.map._requestManager.transformRequest(at,"Tile"),uid:P.uid,tileID:P.tileID,zoom:P.tileID.overscaledZ,tileSize:this.tileSize*P.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};_t.request.collectResourceTiming=this._collectResourceTiming;let Tt="RT";if(P.actor&&P.state!=="expired"){if(P.state==="loading")return new Promise((Pt,ie)=>{P.reloadPromise={resolve:Pt,reject:ie}})}else P.actor=this.dispatcher.getActor(),Tt="LT";P.abortController=new AbortController;try{let Pt=yield P.actor.sendAsync({type:Tt,data:_t},P.abortController);if(delete P.abortController,P.aborted)return;this._afterTileLoadWorkerResponse(P,Pt)}catch(Pt){if(delete P.abortController,P.aborted)return;if(Pt&&Pt.status!==404)throw Pt;this._afterTileLoadWorkerResponse(P,null)}})}_afterTileLoadWorkerResponse(P,at){if(at&&at.resourceTiming&&(P.resourceTiming=at.resourceTiming),at&&this.map._refreshExpiredTiles&&P.setExpiryData(at),P.loadVectorData(at,this.map.painter),P.reloadPromise){let _t=P.reloadPromise;P.reloadPromise=null,this.loadTile(P).then(_t.resolve).catch(_t.reject)}}abortTile(P){return e._(this,void 0,void 0,function*(){P.abortController&&(P.abortController.abort(),delete P.abortController),P.actor&&(yield P.actor.sendAsync({type:"AT",data:{uid:P.uid,type:this.type,source:this.id}}))})}unloadTile(P){return e._(this,void 0,void 0,function*(){P.unloadVectorData(),P.actor&&(yield P.actor.sendAsync({type:"RMT",data:{uid:P.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class xt extends e.E{constructor(P,at,_t,Tt){super(),this.id=P,this.dispatcher=_t,this.setEventedParent(Tt),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},at),e.e(this,e.M(at,["url","scheme","tileSize"]))}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let P=yield ot(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,P&&(e.e(this,P),P.bounds&&(this.tileBounds=new dt(P.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(P){this._tileJSONRequest=null,this.fire(new e.j(P))}})}loaded(){return this._loaded}onAdd(P){this.map=P,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(P){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),P(),this.load()}setTiles(P){return this.setSourceProperty(()=>{this._options.tiles=P}),this}setUrl(P){return this.setSourceProperty(()=>{this.url=P,this._options.url=P}),this}serialize(){return e.e({},this._options)}hasTile(P){return!this.tileBounds||this.tileBounds.contains(P.canonical)}loadTile(P){return e._(this,void 0,void 0,function*(){let at=P.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);P.abortController=new AbortController;try{let _t=yield l.getImage(this.map._requestManager.transformRequest(at,"Tile"),P.abortController,this.map._refreshExpiredTiles);if(delete P.abortController,P.aborted)return void(P.state="unloaded");if(_t&&_t.data){this.map._refreshExpiredTiles&&_t.cacheControl&&_t.expires&&P.setExpiryData({cacheControl:_t.cacheControl,expires:_t.expires});let Tt=this.map.painter.context,Pt=Tt.gl,ie=_t.data;P.texture=this.map.painter.getTileTexture(ie.width),P.texture?P.texture.update(ie,{useMipmap:!0}):(P.texture=new f(Tt,ie,Pt.RGBA,{useMipmap:!0}),P.texture.bind(Pt.LINEAR,Pt.CLAMP_TO_EDGE,Pt.LINEAR_MIPMAP_NEAREST)),P.state="loaded"}}catch(_t){if(delete P.abortController,P.aborted)P.state="unloaded";else if(_t)throw P.state="errored",_t}})}abortTile(P){return e._(this,void 0,void 0,function*(){P.abortController&&(P.abortController.abort(),delete P.abortController)})}unloadTile(P){return e._(this,void 0,void 0,function*(){P.texture&&this.map.painter.saveTileTexture(P.texture)})}hasTransition(){return!1}}class Ft extends xt{constructor(P,at,_t,Tt){super(P,at,_t,Tt),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},at),this.encoding=at.encoding||"mapbox",this.redFactor=at.redFactor,this.greenFactor=at.greenFactor,this.blueFactor=at.blueFactor,this.baseShift=at.baseShift}loadTile(P){return e._(this,void 0,void 0,function*(){let at=P.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),_t=this.map._requestManager.transformRequest(at,"Tile");P.neighboringTiles=this._getNeighboringTiles(P.tileID),P.abortController=new AbortController;try{let Tt=yield l.getImage(_t,P.abortController,this.map._refreshExpiredTiles);if(delete P.abortController,P.aborted)return void(P.state="unloaded");if(Tt&&Tt.data){let Pt=Tt.data;this.map._refreshExpiredTiles&&Tt.cacheControl&&Tt.expires&&P.setExpiryData({cacheControl:Tt.cacheControl,expires:Tt.expires});let ie=e.b(Pt)&&e.U()?Pt:yield this.readImageNow(Pt),de={type:this.type,uid:P.uid,source:this.id,rawImageData:ie,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!P.actor||P.state==="expired"){P.actor=this.dispatcher.getActor();let Ee=yield P.actor.sendAsync({type:"LDT",data:de});P.dem=Ee,P.needsHillshadePrepare=!0,P.needsTerrainPrepare=!0,P.state="loaded"}}}catch(Tt){if(delete P.abortController,P.aborted)P.state="unloaded";else if(Tt)throw P.state="errored",Tt}})}readImageNow(P){return e._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&e.V()){let at=P.width+2,_t=P.height+2;try{return new e.R({width:at,height:_t},yield e.W(P,-1,-1,at,_t))}catch{}}return o.getImageData(P,1)})}_getNeighboringTiles(P){let at=P.canonical,_t=Math.pow(2,at.z),Tt=(at.x-1+_t)%_t,Pt=at.x===0?P.wrap-1:P.wrap,ie=(at.x+1+_t)%_t,de=at.x+1===_t?P.wrap+1:P.wrap,Ee={};return Ee[new e.S(P.overscaledZ,Pt,at.z,Tt,at.y).key]={backfilled:!1},Ee[new e.S(P.overscaledZ,de,at.z,ie,at.y).key]={backfilled:!1},at.y>0&&(Ee[new e.S(P.overscaledZ,Pt,at.z,Tt,at.y-1).key]={backfilled:!1},Ee[new e.S(P.overscaledZ,P.wrap,at.z,at.x,at.y-1).key]={backfilled:!1},Ee[new e.S(P.overscaledZ,de,at.z,ie,at.y-1).key]={backfilled:!1}),at.y+1<_t&&(Ee[new e.S(P.overscaledZ,Pt,at.z,Tt,at.y+1).key]={backfilled:!1},Ee[new e.S(P.overscaledZ,P.wrap,at.z,at.x,at.y+1).key]={backfilled:!1},Ee[new e.S(P.overscaledZ,de,at.z,ie,at.y+1).key]={backfilled:!1}),Ee}unloadTile(P){return e._(this,void 0,void 0,function*(){P.demTexture&&this.map.painter.saveTileTexture(P.demTexture),P.fbo&&(P.fbo.destroy(),delete P.fbo),P.dem&&delete P.dem,delete P.neighboringTiles,P.state="unloaded",P.actor&&(yield P.actor.sendAsync({type:"RDT",data:{type:this.type,uid:P.uid,source:this.id}}))})}}class Et extends e.E{constructor(P,at,_t,Tt){super(),this.id=P,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=_t.getActor(),this.setEventedParent(Tt),this._data=at.data,this._options=e.e({},at),this._collectResourceTiming=at.collectResourceTiming,at.maxzoom!==void 0&&(this.maxzoom=at.maxzoom),at.type&&(this.type=at.type),at.attribution&&(this.attribution=at.attribution),this.promoteId=at.promoteId;let Pt=e.X/this.tileSize;at.clusterMaxZoom!==void 0&&this.maxzoom<=at.clusterMaxZoom&&e.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${at.clusterMaxZoom}".`),this.workerOptions=e.e({source:this.id,cluster:at.cluster||!1,geojsonVtOptions:{buffer:(at.buffer!==void 0?at.buffer:128)*Pt,tolerance:(at.tolerance!==void 0?at.tolerance:.375)*Pt,extent:e.X,maxZoom:this.maxzoom,lineMetrics:at.lineMetrics||!1,generateId:at.generateId||!1},superclusterOptions:{maxZoom:at.clusterMaxZoom!==void 0?at.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,at.clusterMinPoints||2),extent:e.X,radius:(at.clusterRadius||50)*Pt,log:!1,generateId:at.generateId||!1},clusterProperties:at.clusterProperties,filter:at.filter},at.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}load(){return e._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(P){this.map=P,this.load()}setData(P){return this._data=P,this._updateWorkerData(),this}updateData(P){return this._updateWorkerData(P),this}getData(){return e._(this,void 0,void 0,function*(){let P=e.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:P})})}setClusterOptions(P){return this.workerOptions.cluster=P.cluster,P&&(P.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=P.clusterRadius),P.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=P.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(P){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:P,source:this.id}})}getClusterChildren(P){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:P,source:this.id}})}getClusterLeaves(P,at,_t){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:P,limit:at,offset:_t}})}_updateWorkerData(P){return e._(this,void 0,void 0,function*(){let at=e.e({type:this.type},this.workerOptions);P?at.dataDiff=P:typeof this._data=="string"?(at.request=this.map._requestManager.transformRequest(o.resolveURL(this._data),"Source"),at.request.collectResourceTiming=this._collectResourceTiming):at.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new e.k("dataloading",{dataType:"source"}));try{let _t=yield this.actor.sendAsync({type:"LD",data:at});if(this._pendingLoads--,this._removed||_t.abandoned)return void this.fire(new e.k("dataabort",{dataType:"source"}));let Tt=null;_t.resourceTiming&&_t.resourceTiming[this.id]&&(Tt=_t.resourceTiming[this.id].slice(0));let Pt={dataType:"source"};this._collectResourceTiming&&Tt&&Tt.length>0&&e.e(Pt,{resourceTiming:Tt}),this.fire(new e.k("data",Object.assign(Object.assign({},Pt),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},Pt),{sourceDataType:"content"})))}catch(_t){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(_t))}})}loaded(){return this._pendingLoads===0}loadTile(P){return e._(this,void 0,void 0,function*(){let at=P.actor?"RT":"LT";P.actor=this.actor;let _t={type:this.type,uid:P.uid,tileID:P.tileID,zoom:P.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};P.abortController=new AbortController;let Tt=yield this.actor.sendAsync({type:at,data:_t},P.abortController);delete P.abortController,P.unloadVectorData(),P.aborted||P.loadVectorData(Tt,this.map.painter,at==="RT")})}abortTile(P){return e._(this,void 0,void 0,function*(){P.abortController&&(P.abortController.abort(),delete P.abortController),P.aborted=!0})}unloadTile(P){return e._(this,void 0,void 0,function*(){P.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:P.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Nt=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class te extends e.E{constructor(P,at,_t,Tt){super(),this.id=P,this.dispatcher=_t,this.coordinates=at.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Tt),this.options=at}load(P){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let at=yield l.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,at&&at.data&&(this.image=at.data,P&&(this.coordinates=P),this._finishLoading())}catch(at){this._request=null,this._loaded=!0,this.fire(new e.j(at))}})}loaded(){return this._loaded}updateImage(P){return P.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=P.url,this.load(P.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(P){this.map=P,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(P){this.coordinates=P;let at=P.map(e.Z.fromLngLat);this.tileID=function(Tt){let Pt=1/0,ie=1/0,de=-1/0,Ee=-1/0;for(let zr of Tt)Pt=Math.min(Pt,zr.x),ie=Math.min(ie,zr.y),de=Math.max(de,zr.x),Ee=Math.max(Ee,zr.y);let He=Math.max(de-Pt,Ee-ie),ar=Math.max(0,Math.floor(-Math.log(He)/Math.LN2)),ir=Math.pow(2,ar);return new e.a1(ar,Math.floor((Pt+de)/2*ir),Math.floor((ie+Ee)/2*ir))}(at),this.minzoom=this.maxzoom=this.tileID.z;let _t=at.map(Tt=>this.tileID.getTilePoint(Tt)._round());return this._boundsArray=new e.$,this._boundsArray.emplaceBack(_t[0].x,_t[0].y,0,0),this._boundsArray.emplaceBack(_t[1].x,_t[1].y,e.X,0),this._boundsArray.emplaceBack(_t[3].x,_t[3].y,0,e.X),this._boundsArray.emplaceBack(_t[2].x,_t[2].y,e.X,e.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let P=this.map.painter.context,at=P.gl;this.boundsBuffer||(this.boundsBuffer=P.createVertexBuffer(this._boundsArray,Nt.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new f(P,this.image,at.RGBA),this.texture.bind(at.LINEAR,at.CLAMP_TO_EDGE));let _t=!1;for(let Tt in this.tiles){let Pt=this.tiles[Tt];Pt.state!=="loaded"&&(Pt.state="loaded",Pt.texture=this.texture,_t=!0)}_t&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(P){return e._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(P.tileID.canonical)?(this.tiles[String(P.tileID.wrap)]=P,P.buckets={}):P.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Jt extends te{constructor(P,at,_t,Tt){super(P,at,_t,Tt),this.roundZoom=!0,this.type="video",this.options=at}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1;let P=this.options;this.urls=[];for(let at of P.urls)this.urls.push(this.map._requestManager.transformRequest(at,"Source").url);try{let at=yield e.a3(this.urls);if(this._loaded=!0,!at)return;this.video=at,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(at){this.fire(new e.j(at))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(P){if(this.video){let at=this.video.seekable;P<at.start(0)||P>at.end(0)?this.fire(new e.j(new e.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${at.start(0)} and ${at.end(0)}-second mark.`))):this.video.currentTime=P}}getVideo(){return this.video}onAdd(P){this.map||(this.map=P,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let P=this.map.painter.context,at=P.gl;this.boundsBuffer||(this.boundsBuffer=P.createVertexBuffer(this._boundsArray,Nt.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(at.LINEAR,at.CLAMP_TO_EDGE),at.texSubImage2D(at.TEXTURE_2D,0,0,0,at.RGBA,at.UNSIGNED_BYTE,this.video)):(this.texture=new f(P,this.video,at.RGBA),this.texture.bind(at.LINEAR,at.CLAMP_TO_EDGE));let _t=!1;for(let Tt in this.tiles){let Pt=this.tiles[Tt];Pt.state!=="loaded"&&(Pt.state="loaded",Pt.texture=this.texture,_t=!0)}_t&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Qt extends te{constructor(P,at,_t,Tt){super(P,at,_t,Tt),at.coordinates?Array.isArray(at.coordinates)&&at.coordinates.length===4&&!at.coordinates.some(Pt=>!Array.isArray(Pt)||Pt.length!==2||Pt.some(ie=>typeof ie!="number"))||this.fire(new e.j(new e.a2(`sources.${P}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${P}`,null,'missing required property "coordinates"'))),at.animate&&typeof at.animate!="boolean"&&this.fire(new e.j(new e.a2(`sources.${P}`,null,'optional "animate" property must be a boolean value'))),at.canvas?typeof at.canvas=="string"||at.canvas instanceof HTMLCanvasElement||this.fire(new e.j(new e.a2(`sources.${P}`,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 e.j(new e.a2(`sources.${P}`,null,'missing required property "canvas"'))),this.options=at,this.animate=at.animate===void 0||at.animate}load(){return e._(this,void 0,void 0,function*(){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 e.j(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(P){this.map=P,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let P=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,P=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,P=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let at=this.map.painter.context,_t=at.gl;this.boundsBuffer||(this.boundsBuffer=at.createVertexBuffer(this._boundsArray,Nt.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?(P||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new f(at,this.canvas,_t.RGBA,{premultiply:!0});let Tt=!1;for(let Pt in this.tiles){let ie=this.tiles[Pt];ie.state!=="loaded"&&(ie.state="loaded",ie.texture=this.texture,Tt=!0)}Tt&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let P of[this.canvas.width,this.canvas.height])if(isNaN(P)||P<=0)return!0;return!1}}let Wt={},gt=Lt=>{switch(Lt){case"geojson":return Et;case"image":return te;case"raster":return xt;case"raster-dem":return Ft;case"vector":return wt;case"video":return Jt;case"canvas":return Qt}return Wt[Lt]},bt="RTLPluginLoaded";class vt extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Q()}_syncState(P){return this.status=P,this.dispatcher.broadcast("SRPS",{pluginStatus:P,pluginURL:this.url}).catch(at=>{throw this.status="error",at})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(P){return e._(this,arguments,void 0,function*(at,_t=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=o.resolveURL(at),!this.url)throw new Error(`requested url ${at} is invalid`);if(this.status==="unavailable"){if(!_t)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return e._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.k(bt))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Ut=null;function Kt(){return Ut||(Ut=new vt),Ut}class Zt{constructor(P,at){this.timeAdded=0,this.fadeEndTime=0,this.tileID=P,this.uid=e.a4(),this.uses=0,this.tileSize=at,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(P){let at=P+this.timeAdded;at<this.fadeEndTime||(this.fadeEndTime=at)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(P){this.demTexture&&P.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(P,at,_t){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",P){P.featureIndex&&(this.latestFeatureIndex=P.featureIndex,P.rawTileData?(this.latestRawTileData=P.rawTileData,this.latestFeatureIndex.rawTileData=P.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=P.collisionBoxArray,this.buckets=function(Tt,Pt){let ie={};if(!Pt)return ie;for(let de of Tt){let Ee=de.layerIds.map(He=>Pt.getLayer(He)).filter(Boolean);if(Ee.length!==0){de.layers=Ee,de.stateDependentLayerIds&&(de.stateDependentLayers=de.stateDependentLayerIds.map(He=>Ee.filter(ar=>ar.id===He)[0]));for(let He of Ee)ie[He.id]=de}}return ie}(P.buckets,at.style),this.hasSymbolBuckets=!1;for(let Tt in this.buckets){let Pt=this.buckets[Tt];if(Pt instanceof e.a6){if(this.hasSymbolBuckets=!0,!_t)break;Pt.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let Tt in this.buckets){let Pt=this.buckets[Tt];if(Pt instanceof e.a6&&Pt.hasRTLText){this.hasRTLText=!0,Kt().lazyLoad();break}}this.queryPadding=0;for(let Tt in this.buckets){let Pt=this.buckets[Tt];this.queryPadding=Math.max(this.queryPadding,at.style.getLayer(Tt).queryRadius(Pt))}P.imageAtlas&&(this.imageAtlas=P.imageAtlas),P.glyphAtlasImage&&(this.glyphAtlasImage=P.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(let P in this.buckets)this.buckets[P].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(P){return this.buckets[P.id]}upload(P){for(let _t in this.buckets){let Tt=this.buckets[_t];Tt.uploadPending()&&Tt.upload(P)}let at=P.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new f(P,this.imageAtlas.image,at.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new f(P,this.glyphAtlasImage,at.ALPHA),this.glyphAtlasImage=null)}prepare(P){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(P,this.imageAtlasTexture)}queryRenderedFeatures(P,at,_t,Tt,Pt,ie,de,Ee,He,ar){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Tt,cameraQueryGeometry:Pt,scale:ie,tileSize:this.tileSize,pixelPosMatrix:ar,transform:Ee,params:de,queryPadding:this.queryPadding*He},P,at,_t):{}}querySourceFeatures(P,at){let _t=this.latestFeatureIndex;if(!_t||!_t.rawTileData)return;let Tt=_t.loadVTLayers(),Pt=at&&at.sourceLayer?at.sourceLayer:"",ie=Tt._geojsonTileLayer||Tt[Pt];if(!ie)return;let de=e.a7(at&&at.filter),{z:Ee,x:He,y:ar}=this.tileID.canonical,ir={z:Ee,x:He,y:ar};for(let zr=0;zr<ie.length;zr++){let Zr=ie.feature(zr);if(de.needGeometry){let ne=e.a8(Zr,!0);if(!de.filter(new e.z(this.tileID.overscaledZ),ne,this.tileID.canonical))continue}else if(!de.filter(new e.z(this.tileID.overscaledZ),Zr))continue;let Rt=_t.getId(Zr,Pt),Gt=new e.a9(Zr,Ee,He,ar,Rt);Gt.tile=ir,P.push(Gt)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(P){let at=this.expirationTime;if(P.cacheControl){let _t=e.aa(P.cacheControl);_t["max-age"]&&(this.expirationTime=Date.now()+1e3*_t["max-age"])}else P.expires&&(this.expirationTime=new Date(P.expires).getTime());if(this.expirationTime){let _t=Date.now(),Tt=!1;if(this.expirationTime>_t)Tt=!1;else if(at)if(this.expirationTime<at)Tt=!0;else{let Pt=this.expirationTime-at;Pt?this.expirationTime=_t+Math.max(Pt,3e4):Tt=!0}else Tt=!0;Tt?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(P,at){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(P).length===0)return;let _t=this.latestFeatureIndex.loadVTLayers();for(let Tt in this.buckets){if(!at.style.hasLayer(Tt))continue;let Pt=this.buckets[Tt],ie=Pt.layers[0].sourceLayer||"_geojsonTileLayer",de=_t[ie],Ee=P[ie];if(!de||!Ee||Object.keys(Ee).length===0)continue;Pt.update(Ee,de,this.imageAtlas&&this.imageAtlas.patternPositions||{});let He=at&&at.style&&at.style.getLayer(Tt);He&&(this.queryPadding=Math.max(this.queryPadding,He.queryRadius(Pt)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<o.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(P){this.symbolFadeHoldUntil=o.now()+P}setDependencies(P,at){let _t={};for(let Tt of at)_t[Tt]=!0;this.dependencies[P]=_t}hasDependency(P,at){for(let _t of P){let Tt=this.dependencies[_t];if(Tt){for(let Pt of at)if(Tt[Pt])return!0}}return!1}}class le{constructor(P,at){this.max=P,this.onRemove=at,this.reset()}reset(){for(let P in this.data)for(let at of this.data[P])at.timeout&&clearTimeout(at.timeout),this.onRemove(at.value);return this.data={},this.order=[],this}add(P,at,_t){let Tt=P.wrapped().key;this.data[Tt]===void 0&&(this.data[Tt]=[]);let Pt={value:at,timeout:void 0};if(_t!==void 0&&(Pt.timeout=setTimeout(()=>{this.remove(P,Pt)},_t)),this.data[Tt].push(Pt),this.order.push(Tt),this.order.length>this.max){let ie=this._getAndRemoveByKey(this.order[0]);ie&&this.onRemove(ie)}return this}has(P){return P.wrapped().key in this.data}getAndRemove(P){return this.has(P)?this._getAndRemoveByKey(P.wrapped().key):null}_getAndRemoveByKey(P){let at=this.data[P].shift();return at.timeout&&clearTimeout(at.timeout),this.data[P].length===0&&delete this.data[P],this.order.splice(this.order.indexOf(P),1),at.value}getByKey(P){let at=this.data[P];return at?at[0].value:null}get(P){return this.has(P)?this.data[P.wrapped().key][0].value:null}remove(P,at){if(!this.has(P))return this;let _t=P.wrapped().key,Tt=at===void 0?0:this.data[_t].indexOf(at),Pt=this.data[_t][Tt];return this.data[_t].splice(Tt,1),Pt.timeout&&clearTimeout(Pt.timeout),this.data[_t].length===0&&delete this.data[_t],this.onRemove(Pt.value),this.order.splice(this.order.indexOf(_t),1),this}setMaxSize(P){for(this.max=P;this.order.length>this.max;){let at=this._getAndRemoveByKey(this.order[0]);at&&this.onRemove(at)}return this}filter(P){let at=[];for(let _t in this.data)for(let Tt of this.data[_t])P(Tt.value)||at.push(Tt);for(let _t of at)this.remove(_t.value.tileID,_t)}}class Te{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(P,at,_t){let Tt=String(at);if(this.stateChanges[P]=this.stateChanges[P]||{},this.stateChanges[P][Tt]=this.stateChanges[P][Tt]||{},e.e(this.stateChanges[P][Tt],_t),this.deletedStates[P]===null){this.deletedStates[P]={};for(let Pt in this.state[P])Pt!==Tt&&(this.deletedStates[P][Pt]=null)}else if(this.deletedStates[P]&&this.deletedStates[P][Tt]===null){this.deletedStates[P][Tt]={};for(let Pt in this.state[P][Tt])_t[Pt]||(this.deletedStates[P][Tt][Pt]=null)}else for(let Pt in _t)this.deletedStates[P]&&this.deletedStates[P][Tt]&&this.deletedStates[P][Tt][Pt]===null&&delete this.deletedStates[P][Tt][Pt]}removeFeatureState(P,at,_t){if(this.deletedStates[P]===null)return;let Tt=String(at);if(this.deletedStates[P]=this.deletedStates[P]||{},_t&&at!==void 0)this.deletedStates[P][Tt]!==null&&(this.deletedStates[P][Tt]=this.deletedStates[P][Tt]||{},this.deletedStates[P][Tt][_t]=null);else if(at!==void 0)if(this.stateChanges[P]&&this.stateChanges[P][Tt])for(_t in this.deletedStates[P][Tt]={},this.stateChanges[P][Tt])this.deletedStates[P][Tt][_t]=null;else this.deletedStates[P][Tt]=null;else this.deletedStates[P]=null}getState(P,at){let _t=String(at),Tt=e.e({},(this.state[P]||{})[_t],(this.stateChanges[P]||{})[_t]);if(this.deletedStates[P]===null)return{};if(this.deletedStates[P]){let Pt=this.deletedStates[P][at];if(Pt===null)return{};for(let ie in Pt)delete Tt[ie]}return Tt}initializeTileState(P,at){P.setFeatureState(this.state,at)}coalesceChanges(P,at){let _t={};for(let Tt in this.stateChanges){this.state[Tt]=this.state[Tt]||{};let Pt={};for(let ie in this.stateChanges[Tt])this.state[Tt][ie]||(this.state[Tt][ie]={}),e.e(this.state[Tt][ie],this.stateChanges[Tt][ie]),Pt[ie]=this.state[Tt][ie];_t[Tt]=Pt}for(let Tt in this.deletedStates){this.state[Tt]=this.state[Tt]||{};let Pt={};if(this.deletedStates[Tt]===null)for(let ie in this.state[Tt])Pt[ie]={},this.state[Tt][ie]={};else for(let ie in this.deletedStates[Tt]){if(this.deletedStates[Tt][ie]===null)this.state[Tt][ie]={};else for(let de of Object.keys(this.deletedStates[Tt][ie]))delete this.state[Tt][ie][de];Pt[ie]=this.state[Tt][ie]}_t[Tt]=_t[Tt]||{},e.e(_t[Tt],Pt)}if(this.stateChanges={},this.deletedStates={},Object.keys(_t).length!==0)for(let Tt in P)P[Tt].setFeatureState(_t,at)}}class Se extends e.E{constructor(P,at,_t){super(),this.id=P,this.dispatcher=_t,this.on("data",Tt=>this._dataHandler(Tt)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((Tt,Pt,ie,de)=>{let Ee=new(gt(Pt.type))(Tt,Pt,ie,de);if(Ee.id!==Tt)throw new Error(`Expected Source id to be ${Tt} instead of ${Ee.id}`);return Ee})(P,at,_t,this),this._tiles={},this._cache=new le(0,Tt=>this._unloadTile(Tt)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Te,this._didEmitContent=!1,this._updated=!1}onAdd(P){this.map=P,this._maxTileCacheSize=P?P._maxTileCacheSize:null,this._maxTileCacheZoomLevels=P?P._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(P)}onRemove(P){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(P)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let P in this._tiles){let at=this._tiles[P];if(at.state!=="loaded"&&at.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let P=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,P&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(P,at,_t){return e._(this,void 0,void 0,function*(){try{yield this._source.loadTile(P),this._tileLoaded(P,at,_t)}catch(Tt){P.state="errored",Tt.status!==404?this._source.fire(new e.j(Tt,{tile:P})):this.update(this.transform,this.terrain)}})}_unloadTile(P){this._source.unloadTile&&this._source.unloadTile(P)}_abortTile(P){this._source.abortTile&&this._source.abortTile(P),this._source.fire(new e.k("dataabort",{tile:P,coord:P.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(P){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let at in this._tiles){let _t=this._tiles[at];_t.upload(P),_t.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(P=>P.tileID).sort(Fe).map(P=>P.key)}getRenderableIds(P){let at=[];for(let _t in this._tiles)this._isIdRenderable(_t,P)&&at.push(this._tiles[_t]);return P?at.sort((_t,Tt)=>{let Pt=_t.tileID,ie=Tt.tileID,de=new e.P(Pt.canonical.x,Pt.canonical.y)._rotate(this.transform.angle),Ee=new e.P(ie.canonical.x,ie.canonical.y)._rotate(this.transform.angle);return Pt.overscaledZ-ie.overscaledZ||Ee.y-de.y||Ee.x-de.x}).map(_t=>_t.tileID.key):at.map(_t=>_t.tileID).sort(Fe).map(_t=>_t.key)}hasRenderableParent(P){let at=this.findLoadedParent(P,0);return!!at&&this._isIdRenderable(at.tileID.key)}_isIdRenderable(P,at){return this._tiles[P]&&this._tiles[P].hasData()&&!this._coveredTiles[P]&&(at||!this._tiles[P].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let P in this._tiles)this._tiles[P].state!=="errored"&&this._reloadTile(P,"reloading")}}_reloadTile(P,at){return e._(this,void 0,void 0,function*(){let _t=this._tiles[P];_t&&(_t.state!=="loading"&&(_t.state=at),yield this._loadTile(_t,P,at))})}_tileLoaded(P,at,_t){P.timeAdded=o.now(),_t==="expired"&&(P.refreshedUponExpiration=!0),this._setTileReloadTimer(at,P),this.getSource().type==="raster-dem"&&P.dem&&this._backfillDEM(P),this._state.initializeTileState(P,this.map?this.map.painter:null),P.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:P,coord:P.tileID}))}_backfillDEM(P){let at=this.getRenderableIds();for(let Tt=0;Tt<at.length;Tt++){let Pt=at[Tt];if(P.neighboringTiles&&P.neighboringTiles[Pt]){let ie=this.getTileByID(Pt);_t(P,ie),_t(ie,P)}}function _t(Tt,Pt){Tt.needsHillshadePrepare=!0,Tt.needsTerrainPrepare=!0;let ie=Pt.tileID.canonical.x-Tt.tileID.canonical.x,de=Pt.tileID.canonical.y-Tt.tileID.canonical.y,Ee=Math.pow(2,Tt.tileID.canonical.z),He=Pt.tileID.key;ie===0&&de===0||Math.abs(de)>1||(Math.abs(ie)>1&&(Math.abs(ie+Ee)===1?ie+=Ee:Math.abs(ie-Ee)===1&&(ie-=Ee)),Pt.dem&&Tt.dem&&(Tt.dem.backfillBorder(Pt.dem,ie,de),Tt.neighboringTiles&&Tt.neighboringTiles[He]&&(Tt.neighboringTiles[He].backfilled=!0)))}}getTile(P){return this.getTileByID(P.key)}getTileByID(P){return this._tiles[P]}_retainLoadedChildren(P,at,_t,Tt){for(let Pt in this._tiles){let ie=this._tiles[Pt];if(Tt[Pt]||!ie.hasData()||ie.tileID.overscaledZ<=at||ie.tileID.overscaledZ>_t)continue;let de=ie.tileID;for(;ie&&ie.tileID.overscaledZ>at+1;){let He=ie.tileID.scaledTo(ie.tileID.overscaledZ-1);ie=this._tiles[He.key],ie&&ie.hasData()&&(de=He)}let Ee=de;for(;Ee.overscaledZ>at;)if(Ee=Ee.scaledTo(Ee.overscaledZ-1),P[Ee.key]){Tt[de.key]=de;break}}}findLoadedParent(P,at){if(P.key in this._loadedParentTiles){let _t=this._loadedParentTiles[P.key];return _t&&_t.tileID.overscaledZ>=at?_t:null}for(let _t=P.overscaledZ-1;_t>=at;_t--){let Tt=P.scaledTo(_t),Pt=this._getLoadedTile(Tt);if(Pt)return Pt}}findLoadedSibling(P){return this._getLoadedTile(P)}_getLoadedTile(P){let at=this._tiles[P.key];return at&&at.hasData()?at:this._cache.getByKey(P.wrapped().key)}updateCacheSize(P){let at=Math.ceil(P.width/this._source.tileSize)+1,_t=Math.ceil(P.height/this._source.tileSize)+1,Tt=Math.floor(at*_t*(this._maxTileCacheZoomLevels===null?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Pt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Tt):Tt;this._cache.setMaxSize(Pt)}handleWrapJump(P){let at=Math.round((P-(this._prevLng===void 0?P:this._prevLng))/360);if(this._prevLng=P,at){let _t={};for(let Tt in this._tiles){let Pt=this._tiles[Tt];Pt.tileID=Pt.tileID.unwrapTo(Pt.tileID.wrap+at),_t[Pt.tileID.key]=Pt}this._tiles=_t;for(let Tt in this._timers)clearTimeout(this._timers[Tt]),delete this._timers[Tt];for(let Tt in this._tiles)this._setTileReloadTimer(Tt,this._tiles[Tt])}}_updateCoveredAndRetainedTiles(P,at,_t,Tt,Pt,ie){let de={},Ee={},He=Object.keys(P),ar=o.now();for(let ir of He){let zr=P[ir],Zr=this._tiles[ir];if(!Zr||Zr.fadeEndTime!==0&&Zr.fadeEndTime<=ar)continue;let Rt=this.findLoadedParent(zr,at),Gt=this.findLoadedSibling(zr),ne=Rt||Gt||null;ne&&(this._addTile(ne.tileID),de[ne.tileID.key]=ne.tileID),Ee[ir]=zr}this._retainLoadedChildren(Ee,Tt,_t,P);for(let ir in de)P[ir]||(this._coveredTiles[ir]=!0,P[ir]=de[ir]);if(ie){let ir={},zr={};for(let Zr of Pt)this._tiles[Zr.key].hasData()?ir[Zr.key]=Zr:zr[Zr.key]=Zr;for(let Zr in zr){let Rt=zr[Zr].children(this._source.maxzoom);this._tiles[Rt[0].key]&&this._tiles[Rt[1].key]&&this._tiles[Rt[2].key]&&this._tiles[Rt[3].key]&&(ir[Rt[0].key]=P[Rt[0].key]=Rt[0],ir[Rt[1].key]=P[Rt[1].key]=Rt[1],ir[Rt[2].key]=P[Rt[2].key]=Rt[2],ir[Rt[3].key]=P[Rt[3].key]=Rt[3],delete zr[Zr])}for(let Zr in zr){let Rt=zr[Zr],Gt=this.findLoadedParent(Rt,this._source.minzoom),ne=this.findLoadedSibling(Rt),oe=Gt||ne||null;if(oe){ir[oe.tileID.key]=P[oe.tileID.key]=oe.tileID;for(let be in ir)ir[be].isChildOf(oe.tileID)&&delete ir[be]}}for(let Zr in this._tiles)ir[Zr]||(this._coveredTiles[Zr]=!0)}}update(P,at){if(!this._sourceLoaded||this._paused)return;let _t;this.transform=P,this.terrain=at,this.updateCacheSize(P),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?_t=P.getVisibleUnwrappedCoordinates(this._source.tileID).map(ar=>new e.S(ar.canonical.z,ar.wrap,ar.canonical.z,ar.canonical.x,ar.canonical.y)):(_t=P.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:at}),this._source.hasTile&&(_t=_t.filter(ar=>this._source.hasTile(ar)))):_t=[];let Tt=P.coveringZoomLevel(this._source),Pt=Math.max(Tt-Se.maxOverzooming,this._source.minzoom),ie=Math.max(Tt+Se.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let ar={};for(let ir of _t)if(ir.canonical.z>this._source.minzoom){let zr=ir.scaledTo(ir.canonical.z-1);ar[zr.key]=zr;let Zr=ir.scaledTo(Math.max(this._source.minzoom,Math.min(ir.canonical.z,5)));ar[Zr.key]=Zr}_t=_t.concat(Object.values(ar))}let de=_t.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,de&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let Ee=this._updateRetainedTiles(_t,Tt);Oe(this._source.type)&&this._updateCoveredAndRetainedTiles(Ee,Pt,ie,Tt,_t,at);for(let ar in Ee)this._tiles[ar].clearFadeHold();let He=e.ab(this._tiles,Ee);for(let ar of He){let ir=this._tiles[ar];ir.hasSymbolBuckets&&!ir.holdingForFade()?ir.setHoldDuration(this.map._fadeDuration):ir.hasSymbolBuckets&&!ir.symbolFadeFinished()||this._removeTile(ar)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let P in this._tiles)this._tiles[P].holdingForFade()&&this._removeTile(P)}_updateRetainedTiles(P,at){var _t;let Tt={},Pt={},ie=Math.max(at-Se.maxOverzooming,this._source.minzoom),de=Math.max(at+Se.maxUnderzooming,this._source.minzoom),Ee={};for(let He of P){let ar=this._addTile(He);Tt[He.key]=He,ar.hasData()||at<this._source.maxzoom&&(Ee[He.key]=He)}this._retainLoadedChildren(Ee,at,de,Tt);for(let He of P){let ar=this._tiles[He.key];if(ar.hasData())continue;if(at+1>this._source.maxzoom){let zr=He.children(this._source.maxzoom)[0],Zr=this.getTile(zr);if(Zr&&Zr.hasData()){Tt[zr.key]=zr;continue}}else{let zr=He.children(this._source.maxzoom);if(Tt[zr[0].key]&&Tt[zr[1].key]&&Tt[zr[2].key]&&Tt[zr[3].key])continue}let ir=ar.wasRequested();for(let zr=He.overscaledZ-1;zr>=ie;--zr){let Zr=He.scaledTo(zr);if(Pt[Zr.key])break;if(Pt[Zr.key]=!0,ar=this.getTile(Zr),!ar&&ir&&(ar=this._addTile(Zr)),ar){let Rt=ar.hasData();if((Rt||!(!((_t=this.map)===null||_t===void 0)&&_t.cancelPendingTileRequestsWhileZooming)||ir)&&(Tt[Zr.key]=Zr),ir=ar.wasRequested(),Rt)break}}}return Tt}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let P in this._tiles){let at=[],_t,Tt=this._tiles[P].tileID;for(;Tt.overscaledZ>0;){if(Tt.key in this._loadedParentTiles){_t=this._loadedParentTiles[Tt.key];break}at.push(Tt.key);let Pt=Tt.scaledTo(Tt.overscaledZ-1);if(_t=this._getLoadedTile(Pt),_t)break;Tt=Pt}for(let Pt of at)this._loadedParentTiles[Pt]=_t}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let P in this._tiles){let at=this._tiles[P].tileID,_t=this._getLoadedTile(at);this._loadedSiblingTiles[at.key]=_t}}_addTile(P){let at=this._tiles[P.key];if(at)return at;at=this._cache.getAndRemove(P),at&&(this._setTileReloadTimer(P.key,at),at.tileID=P,this._state.initializeTileState(at,this.map?this.map.painter:null),this._cacheTimers[P.key]&&(clearTimeout(this._cacheTimers[P.key]),delete this._cacheTimers[P.key],this._setTileReloadTimer(P.key,at)));let _t=at;return at||(at=new Zt(P,this._source.tileSize*P.overscaleFactor()),this._loadTile(at,P.key,at.state)),at.uses++,this._tiles[P.key]=at,_t||this._source.fire(new e.k("dataloading",{tile:at,coord:at.tileID,dataType:"source"})),at}_setTileReloadTimer(P,at){P in this._timers&&(clearTimeout(this._timers[P]),delete this._timers[P]);let _t=at.getExpiryTimeout();_t&&(this._timers[P]=setTimeout(()=>{this._reloadTile(P,"expired"),delete this._timers[P]},_t))}_removeTile(P){let at=this._tiles[P];at&&(at.uses--,delete this._tiles[P],this._timers[P]&&(clearTimeout(this._timers[P]),delete this._timers[P]),at.uses>0||(at.hasData()&&at.state!=="reloading"?this._cache.add(at.tileID,at,at.getExpiryTimeout()):(at.aborted=!0,this._abortTile(at),this._unloadTile(at))))}_dataHandler(P){let at=P.sourceDataType;P.dataType==="source"&&at==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&P.dataType==="source"&&at==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let P in this._tiles)this._removeTile(P);this._cache.reset()}tilesIn(P,at,_t){let Tt=[],Pt=this.transform;if(!Pt)return Tt;let ie=_t?Pt.getCameraQueryGeometry(P):P,de=P.map(Rt=>Pt.pointCoordinate(Rt,this.terrain)),Ee=ie.map(Rt=>Pt.pointCoordinate(Rt,this.terrain)),He=this.getIds(),ar=1/0,ir=1/0,zr=-1/0,Zr=-1/0;for(let Rt of Ee)ar=Math.min(ar,Rt.x),ir=Math.min(ir,Rt.y),zr=Math.max(zr,Rt.x),Zr=Math.max(Zr,Rt.y);for(let Rt=0;Rt<He.length;Rt++){let Gt=this._tiles[He[Rt]];if(Gt.holdingForFade())continue;let ne=Gt.tileID,oe=Math.pow(2,Pt.zoom-Gt.tileID.overscaledZ),be=at*Gt.queryPadding*e.X/Gt.tileSize/oe,pe=[ne.getTilePoint(new e.Z(ar,ir)),ne.getTilePoint(new e.Z(zr,Zr))];if(pe[0].x-be<e.X&&pe[0].y-be<e.X&&pe[1].x+be>=0&&pe[1].y+be>=0){let Ae=de.map(nr=>ne.getTilePoint(nr)),Xe=Ee.map(nr=>ne.getTilePoint(nr));Tt.push({tile:Gt,tileID:ne,queryGeometry:Ae,cameraQueryGeometry:Xe,scale:oe})}}return Tt}getVisibleCoordinates(P){let at=this.getRenderableIds(P).map(_t=>this._tiles[_t].tileID);for(let _t of at)_t.posMatrix=this.transform.calculatePosMatrix(_t.toUnwrapped());return at}hasTransition(){if(this._source.hasTransition())return!0;if(Oe(this._source.type)){let P=o.now();for(let at in this._tiles)if(this._tiles[at].fadeEndTime>=P)return!0}return!1}setFeatureState(P,at,_t){this._state.updateState(P=P||"_geojsonTileLayer",at,_t)}removeFeatureState(P,at,_t){this._state.removeFeatureState(P=P||"_geojsonTileLayer",at,_t)}getFeatureState(P,at){return this._state.getState(P=P||"_geojsonTileLayer",at)}setDependencies(P,at,_t){let Tt=this._tiles[P];Tt&&Tt.setDependencies(at,_t)}reloadTilesForDependencies(P,at){for(let _t in this._tiles)this._tiles[_t].hasDependency(P,at)&&this._reloadTile(_t,"reloading");this._cache.filter(_t=>!_t.hasDependency(P,at))}}function Fe(Lt,P){let at=Math.abs(2*Lt.wrap)-+(Lt.wrap<0),_t=Math.abs(2*P.wrap)-+(P.wrap<0);return Lt.overscaledZ-P.overscaledZ||_t-at||P.canonical.y-Lt.canonical.y||P.canonical.x-Lt.canonical.x}function Oe(Lt){return Lt==="raster"||Lt==="image"||Lt==="video"}Se.maxOverzooming=10,Se.maxUnderzooming=3;class ur{constructor(P,at){this.reset(P,at)}reset(P,at){this.points=P||[],this._distances=[0];for(let _t=1;_t<this.points.length;_t++)this._distances[_t]=this._distances[_t-1]+this.points[_t].dist(this.points[_t-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(at||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(P){if(this.points.length===1)return this.points[0];P=e.ac(P,0,1);let at=1,_t=this._distances[at],Tt=P*this.paddedLength+this.padding;for(;_t<Tt&&at<this._distances.length;)_t=this._distances[++at];let Pt=at-1,ie=this._distances[Pt],de=_t-ie,Ee=de>0?(Tt-ie)/de:0;return this.points[Pt].mult(1-Ee).add(this.points[at].mult(Ee))}}function fr(Lt,P){let at=!0;return Lt==="always"||Lt!=="never"&&P!=="never"||(at=!1),at}class We{constructor(P,at,_t){let Tt=this.boxCells=[],Pt=this.circleCells=[];this.xCellCount=Math.ceil(P/_t),this.yCellCount=Math.ceil(at/_t);for(let ie=0;ie<this.xCellCount*this.yCellCount;ie++)Tt.push([]),Pt.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=P,this.height=at,this.xScale=this.xCellCount/P,this.yScale=this.yCellCount/at,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(P,at,_t,Tt,Pt){this._forEachCell(at,_t,Tt,Pt,this._insertBoxCell,this.boxUid++),this.boxKeys.push(P),this.bboxes.push(at),this.bboxes.push(_t),this.bboxes.push(Tt),this.bboxes.push(Pt)}insertCircle(P,at,_t,Tt){this._forEachCell(at-Tt,_t-Tt,at+Tt,_t+Tt,this._insertCircleCell,this.circleUid++),this.circleKeys.push(P),this.circles.push(at),this.circles.push(_t),this.circles.push(Tt)}_insertBoxCell(P,at,_t,Tt,Pt,ie){this.boxCells[Pt].push(ie)}_insertCircleCell(P,at,_t,Tt,Pt,ie){this.circleCells[Pt].push(ie)}_query(P,at,_t,Tt,Pt,ie,de){if(_t<0||P>this.width||Tt<0||at>this.height)return[];let Ee=[];if(P<=0&&at<=0&&this.width<=_t&&this.height<=Tt){if(Pt)return[{key:null,x1:P,y1:at,x2:_t,y2:Tt}];for(let He=0;He<this.boxKeys.length;He++)Ee.push({key:this.boxKeys[He],x1:this.bboxes[4*He],y1:this.bboxes[4*He+1],x2:this.bboxes[4*He+2],y2:this.bboxes[4*He+3]});for(let He=0;He<this.circleKeys.length;He++){let ar=this.circles[3*He],ir=this.circles[3*He+1],zr=this.circles[3*He+2];Ee.push({key:this.circleKeys[He],x1:ar-zr,y1:ir-zr,x2:ar+zr,y2:ir+zr})}}else this._forEachCell(P,at,_t,Tt,this._queryCell,Ee,{hitTest:Pt,overlapMode:ie,seenUids:{box:{},circle:{}}},de);return Ee}query(P,at,_t,Tt){return this._query(P,at,_t,Tt,!1,null)}hitTest(P,at,_t,Tt,Pt,ie){return this._query(P,at,_t,Tt,!0,Pt,ie).length>0}hitTestCircle(P,at,_t,Tt,Pt){let ie=P-_t,de=P+_t,Ee=at-_t,He=at+_t;if(de<0||ie>this.width||He<0||Ee>this.height)return!1;let ar=[];return this._forEachCell(ie,Ee,de,He,this._queryCellCircle,ar,{hitTest:!0,overlapMode:Tt,circle:{x:P,y:at,radius:_t},seenUids:{box:{},circle:{}}},Pt),ar.length>0}_queryCell(P,at,_t,Tt,Pt,ie,de,Ee){let{seenUids:He,hitTest:ar,overlapMode:ir}=de,zr=this.boxCells[Pt];if(zr!==null){let Rt=this.bboxes;for(let Gt of zr)if(!He.box[Gt]){He.box[Gt]=!0;let ne=4*Gt,oe=this.boxKeys[Gt];if(P<=Rt[ne+2]&&at<=Rt[ne+3]&&_t>=Rt[ne+0]&&Tt>=Rt[ne+1]&&(!Ee||Ee(oe))&&(!ar||!fr(ir,oe.overlapMode))&&(ie.push({key:oe,x1:Rt[ne],y1:Rt[ne+1],x2:Rt[ne+2],y2:Rt[ne+3]}),ar))return!0}}let Zr=this.circleCells[Pt];if(Zr!==null){let Rt=this.circles;for(let Gt of Zr)if(!He.circle[Gt]){He.circle[Gt]=!0;let ne=3*Gt,oe=this.circleKeys[Gt];if(this._circleAndRectCollide(Rt[ne],Rt[ne+1],Rt[ne+2],P,at,_t,Tt)&&(!Ee||Ee(oe))&&(!ar||!fr(ir,oe.overlapMode))){let be=Rt[ne],pe=Rt[ne+1],Ae=Rt[ne+2];if(ie.push({key:oe,x1:be-Ae,y1:pe-Ae,x2:be+Ae,y2:pe+Ae}),ar)return!0}}}return!1}_queryCellCircle(P,at,_t,Tt,Pt,ie,de,Ee){let{circle:He,seenUids:ar,overlapMode:ir}=de,zr=this.boxCells[Pt];if(zr!==null){let Rt=this.bboxes;for(let Gt of zr)if(!ar.box[Gt]){ar.box[Gt]=!0;let ne=4*Gt,oe=this.boxKeys[Gt];if(this._circleAndRectCollide(He.x,He.y,He.radius,Rt[ne+0],Rt[ne+1],Rt[ne+2],Rt[ne+3])&&(!Ee||Ee(oe))&&!fr(ir,oe.overlapMode))return ie.push(!0),!0}}let Zr=this.circleCells[Pt];if(Zr!==null){let Rt=this.circles;for(let Gt of Zr)if(!ar.circle[Gt]){ar.circle[Gt]=!0;let ne=3*Gt,oe=this.circleKeys[Gt];if(this._circlesCollide(Rt[ne],Rt[ne+1],Rt[ne+2],He.x,He.y,He.radius)&&(!Ee||Ee(oe))&&!fr(ir,oe.overlapMode))return ie.push(!0),!0}}}_forEachCell(P,at,_t,Tt,Pt,ie,de,Ee){let He=this._convertToXCellCoord(P),ar=this._convertToYCellCoord(at),ir=this._convertToXCellCoord(_t),zr=this._convertToYCellCoord(Tt);for(let Zr=He;Zr<=ir;Zr++)for(let Rt=ar;Rt<=zr;Rt++)if(Pt.call(this,P,at,_t,Tt,this.xCellCount*Rt+Zr,ie,de,Ee))return}_convertToXCellCoord(P){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(P*this.xScale)))}_convertToYCellCoord(P){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(P*this.yScale)))}_circlesCollide(P,at,_t,Tt,Pt,ie){let de=Tt-P,Ee=Pt-at,He=_t+ie;return He*He>de*de+Ee*Ee}_circleAndRectCollide(P,at,_t,Tt,Pt,ie,de){let Ee=(ie-Tt)/2,He=Math.abs(P-(Tt+Ee));if(He>Ee+_t)return!1;let ar=(de-Pt)/2,ir=Math.abs(at-(Pt+ar));if(ir>ar+_t)return!1;if(He<=Ee||ir<=ar)return!0;let zr=He-Ee,Zr=ir-ar;return zr*zr+Zr*Zr<=_t*_t}}function Lr(Lt,P,at,_t,Tt){let Pt=e.H();return P?(e.K(Pt,Pt,[1/Tt,1/Tt,1]),at||e.ad(Pt,Pt,_t.angle)):e.L(Pt,_t.labelPlaneMatrix,Lt),Pt}function kr(Lt,P,at,_t,Tt){if(P){let Pt=e.ae(Lt);return e.K(Pt,Pt,[Tt,Tt,1]),at||e.ad(Pt,Pt,-_t.angle),Pt}return _t.glCoordMatrix}function he(Lt,P,at,_t){let Tt;_t?(Tt=[Lt,P,_t(Lt,P),1],e.af(Tt,Tt,at)):(Tt=[Lt,P,0,1],Ue(Tt,Tt,at));let Pt=Tt[3];return{point:new e.P(Tt[0]/Pt,Tt[1]/Pt),signedDistanceFromCamera:Pt,isOccluded:!1}}function Dt(Lt,P){return .5+Lt/P*.5}function qt(Lt,P){return Lt.x>=-P[0]&&Lt.x<=P[0]&&Lt.y>=-P[1]&&Lt.y<=P[1]}function zt(Lt,P,at,_t,Tt,Pt,ie,de,Ee,He,ar,ir,zr,Zr,Rt){let Gt=_t?Lt.textSizeData:Lt.iconSizeData,ne=e.ag(Gt,at.transform.zoom),oe=[256/at.width*2+1,256/at.height*2+1],be=_t?Lt.text.dynamicLayoutVertexArray:Lt.icon.dynamicLayoutVertexArray;be.clear();let pe=Lt.lineVertexArray,Ae=_t?Lt.text.placedSymbolArray:Lt.icon.placedSymbolArray,Xe=at.transform.width/at.transform.height,nr=!1;for(let or=0;or<Ae.length;or++){let Tr=Ae.get(or);if(Tr.hidden||Tr.writingMode===e.ah.vertical&&!nr){Ze(Tr.numGlyphs,be);continue}nr=!1;let Rr=he(Tr.anchorX,Tr.anchorY,P,Rt);if(!qt(Rr.point,oe)){Ze(Tr.numGlyphs,be);continue}let Qr=Dt(at.transform.cameraToCenterDistance,Rr.signedDistanceFromCamera),nn=e.ai(Gt,ne,Tr),mn=ie?nn/Qr:nn*Qr,zn={getElevation:Rt,labelPlaneMatrix:Tt,lineVertexArray:pe,pitchWithMap:ie,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:He,tileAnchorPoint:new e.P(Tr.anchorX,Tr.anchorY),unwrappedTileID:ar,width:ir,height:zr,translation:Zr},na=Mt(zn,Tr,mn,!1,de,P,Pt,Lt.glyphOffsetArray,be,Xe,Ee);nr=na.useVertical,(na.notEnoughRoom||nr||na.needsFlipping&&Mt(zn,Tr,mn,!0,de,P,Pt,Lt.glyphOffsetArray,be,Xe,Ee).notEnoughRoom)&&Ze(Tr.numGlyphs,be)}_t?Lt.text.dynamicLayoutVertexBuffer.updateData(be):Lt.icon.dynamicLayoutVertexBuffer.updateData(be)}function ut(Lt,P,at,_t,Tt,Pt,ie,de){let Ee=Pt.glyphStartIndex+Pt.numGlyphs,He=Pt.lineStartIndex,ar=Pt.lineStartIndex+Pt.lineLength,ir=P.getoffsetX(Pt.glyphStartIndex),zr=P.getoffsetX(Ee-1),Zr=Re(Lt*ir,at,_t,Tt,Pt.segment,He,ar,de,ie);if(!Zr)return null;let Rt=Re(Lt*zr,at,_t,Tt,Pt.segment,He,ar,de,ie);return Rt?de.projectionCache.anyProjectionOccluded?null:{first:Zr,last:Rt}:null}function yt(Lt,P,at,_t){return Lt===e.ah.horizontal&&Math.abs(at.y-P.y)>Math.abs(at.x-P.x)*_t?{useVertical:!0}:(Lt===e.ah.vertical?P.y<at.y:P.x>at.x)?{needsFlipping:!0}:null}function Mt(Lt,P,at,_t,Tt,Pt,ie,de,Ee,He,ar){let ir=at/24,zr=P.lineOffsetX*ir,Zr=P.lineOffsetY*ir,Rt;if(P.numGlyphs>1){let Gt=P.glyphStartIndex+P.numGlyphs,ne=P.lineStartIndex,oe=P.lineStartIndex+P.lineLength,be=ut(ir,de,zr,Zr,_t,P,ar,Lt);if(!be)return{notEnoughRoom:!0};let pe=he(be.first.point.x,be.first.point.y,ie,Lt.getElevation).point,Ae=he(be.last.point.x,be.last.point.y,ie,Lt.getElevation).point;if(Tt&&!_t){let Xe=yt(P.writingMode,pe,Ae,He);if(Xe)return Xe}Rt=[be.first];for(let Xe=P.glyphStartIndex+1;Xe<Gt-1;Xe++)Rt.push(Re(ir*de.getoffsetX(Xe),zr,Zr,_t,P.segment,ne,oe,Lt,ar));Rt.push(be.last)}else{if(Tt&&!_t){let ne=he(Lt.tileAnchorPoint.x,Lt.tileAnchorPoint.y,Pt,Lt.getElevation).point,oe=P.lineStartIndex+P.segment+1,be=new e.P(Lt.lineVertexArray.getx(oe),Lt.lineVertexArray.gety(oe)),pe=he(be.x,be.y,Pt,Lt.getElevation),Ae=pe.signedDistanceFromCamera>0?pe.point:function(nr,or,Tr,Rr,Qr,nn){return Ot(nr,or,Tr,1,Qr,nn)}(Lt.tileAnchorPoint,be,ne,0,Pt,Lt),Xe=yt(P.writingMode,ne,Ae,He);if(Xe)return Xe}let Gt=Re(ir*de.getoffsetX(P.glyphStartIndex),zr,Zr,_t,P.segment,P.lineStartIndex,P.lineStartIndex+P.lineLength,Lt,ar);if(!Gt||Lt.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};Rt=[Gt]}for(let Gt of Rt)e.aj(Ee,Gt.point,Gt.angle);return{}}function Ot(Lt,P,at,_t,Tt,Pt){let ie=Lt.add(Lt.sub(P)._unit()),de=Tt!==void 0?he(ie.x,ie.y,Tt,Pt.getElevation).point:ee(ie.x,ie.y,Pt).point,Ee=at.sub(de);return at.add(Ee._mult(_t/Ee.mag()))}function $t(Lt,P,at){let _t=P.projectionCache;if(_t.projections[Lt])return _t.projections[Lt];let Tt=new e.P(P.lineVertexArray.getx(Lt),P.lineVertexArray.gety(Lt)),Pt=ee(Tt.x,Tt.y,P);if(Pt.signedDistanceFromCamera>0)return _t.projections[Lt]=Pt.point,_t.anyProjectionOccluded=_t.anyProjectionOccluded||Pt.isOccluded,Pt.point;let ie=Lt-at.direction;return function(de,Ee,He,ar,ir){return Ot(de,Ee,He,ar,void 0,ir)}(at.distanceFromAnchor===0?P.tileAnchorPoint:new e.P(P.lineVertexArray.getx(ie),P.lineVertexArray.gety(ie)),Tt,at.previousVertex,at.absOffsetX-at.distanceFromAnchor+1,P)}function ee(Lt,P,at){let _t=Lt+at.translation[0],Tt=P+at.translation[1],Pt;return!at.pitchWithMap&&at.projection.useSpecialProjectionForSymbols?(Pt=at.projection.projectTileCoordinates(_t,Tt,at.unwrappedTileID,at.getElevation),Pt.point.x=(.5*Pt.point.x+.5)*at.width,Pt.point.y=(.5*-Pt.point.y+.5)*at.height):(Pt=he(_t,Tt,at.labelPlaneMatrix,at.getElevation),Pt.isOccluded=!1),Pt}function we(Lt,P,at){return Lt._unit()._perp()._mult(P*at)}function Me(Lt,P,at,_t,Tt,Pt,ie,de,Ee){if(de.projectionCache.offsets[Lt])return de.projectionCache.offsets[Lt];let He=at.add(P);if(Lt+Ee.direction<_t||Lt+Ee.direction>=Tt)return de.projectionCache.offsets[Lt]=He,He;let ar=$t(Lt+Ee.direction,de,Ee),ir=we(ar.sub(at),ie,Ee.direction),zr=at.add(ir),Zr=ar.add(ir);return de.projectionCache.offsets[Lt]=e.ak(Pt,He,zr,Zr)||He,de.projectionCache.offsets[Lt]}function Re(Lt,P,at,_t,Tt,Pt,ie,de,Ee){let He=_t?Lt-P:Lt+P,ar=He>0?1:-1,ir=0;_t&&(ar*=-1,ir=Math.PI),ar<0&&(ir+=Math.PI);let zr,Zr=ar>0?Pt+Tt:Pt+Tt+1;de.projectionCache.cachedAnchorPoint?zr=de.projectionCache.cachedAnchorPoint:(zr=ee(de.tileAnchorPoint.x,de.tileAnchorPoint.y,de).point,de.projectionCache.cachedAnchorPoint=zr);let Rt,Gt,ne=zr,oe=zr,be=0,pe=0,Ae=Math.abs(He),Xe=[],nr;for(;be+pe<=Ae;){if(Zr+=ar,Zr<Pt||Zr>=ie)return null;be+=pe,oe=ne,Gt=Rt;let Rr={absOffsetX:Ae,direction:ar,distanceFromAnchor:be,previousVertex:oe};if(ne=$t(Zr,de,Rr),at===0)Xe.push(oe),nr=ne.sub(oe);else{let Qr,nn=ne.sub(oe);Qr=nn.mag()===0?we($t(Zr+ar,de,Rr).sub(ne),at,ar):we(nn,at,ar),Gt||(Gt=oe.add(Qr)),Rt=Me(Zr,Qr,ne,Pt,ie,Gt,at,de,Rr),Xe.push(Gt),nr=Rt.sub(Gt)}pe=nr.mag()}let or=nr._mult((Ae-be)/pe)._add(Gt||oe),Tr=ir+Math.atan2(ne.y-oe.y,ne.x-oe.x);return Xe.push(or),{point:or,angle:Ee?Tr:0,path:Xe}}let Be=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ze(Lt,P){for(let at=0;at<Lt;at++){let _t=P.length;P.resize(_t+4),P.float32.set(Be,3*_t)}}function Ue(Lt,P,at){let _t=P[0],Tt=P[1];return Lt[0]=at[0]*_t+at[4]*Tt+at[12],Lt[1]=at[1]*_t+at[5]*Tt+at[13],Lt[3]=at[3]*_t+at[7]*Tt+at[15],Lt}let mr=100;class ln{constructor(P,at,_t=new We(P.width+200,P.height+200,25),Tt=new We(P.width+200,P.height+200,25)){this.transform=P,this.mapProjection=at,this.grid=_t,this.ignoredGrid=Tt,this.pitchFactor=Math.cos(P._pitch)*P.cameraToCenterDistance,this.screenRightBoundary=P.width+mr,this.screenBottomBoundary=P.height+mr,this.gridRightBoundary=P.width+200,this.gridBottomBoundary=P.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(P,at,_t,Tt,Pt,ie,de,Ee,He,ar,ir){let zr=P.anchorPointX+Ee[0],Zr=P.anchorPointY+Ee[1],Rt=this.projectAndGetPerspectiveRatio(Tt,zr,Zr,Pt,ar),Gt=_t*Rt.perspectiveRatio,ne;if(ie||de)ne=this._projectCollisionBox(P,Gt,Tt,Pt,ie,de,Ee,Rt,ar,ir);else{let Xe=Rt.point.x+(ir?ir.x*Gt:0),nr=Rt.point.y+(ir?ir.y*Gt:0);ne={allPointsOccluded:!1,box:[Xe+P.x1*Gt,nr+P.y1*Gt,Xe+P.x2*Gt,nr+P.y2*Gt]}}let[oe,be,pe,Ae]=ne.box;return this.mapProjection.useSpecialProjectionForSymbols&&(ie?ne.allPointsOccluded:this.mapProjection.isOccluded(zr,Zr,Pt))||Rt.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(oe,be,pe,Ae)||at!=="always"&&this.grid.hitTest(oe,be,pe,Ae,at,He)?{box:[oe,be,pe,Ae],placeable:!1,offscreen:!1}:{box:[oe,be,pe,Ae],placeable:!0,offscreen:this.isOffscreen(oe,be,pe,Ae)}}placeCollisionCircles(P,at,_t,Tt,Pt,ie,de,Ee,He,ar,ir,zr,Zr,Rt,Gt,ne){let oe=[],be=new e.P(at.anchorX,at.anchorY),pe=this.getPerspectiveRatio(ie,be.x,be.y,de,ne),Ae=(ir?Pt/pe:Pt*pe)/e.ap,Xe={getElevation:ne,labelPlaneMatrix:Ee,lineVertexArray:_t,pitchWithMap:ir,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:be,unwrappedTileID:de,width:this.transform.width,height:this.transform.height,translation:Gt},nr=ut(Ae,Tt,at.lineOffsetX*Ae,at.lineOffsetY*Ae,!1,at,!1,Xe),or=!1,Tr=!1,Rr=!0;if(nr){let Qr=.5*Zr*pe+Rt,nn=new e.P(-100,-100),mn=new e.P(this.screenRightBoundary,this.screenBottomBoundary),zn=new ur,na=nr.first,Yn=nr.last,la=[];for(let Ka=na.path.length-1;Ka>=1;Ka--)la.push(na.path[Ka]);for(let Ka=1;Ka<Yn.path.length;Ka++)la.push(Yn.path[Ka]);let Na=2.5*Qr;if(He){let Ka=this.projectPathToScreenSpace(la,Xe,He);la=Ka.some(Gi=>Gi.signedDistanceFromCamera<=0)?[]:Ka.map(Gi=>Gi.point)}let li=[];if(la.length>0){let Ka=la[0].clone(),Gi=la[0].clone();for(let jo=1;jo<la.length;jo++)Ka.x=Math.min(Ka.x,la[jo].x),Ka.y=Math.min(Ka.y,la[jo].y),Gi.x=Math.max(Gi.x,la[jo].x),Gi.y=Math.max(Gi.y,la[jo].y);li=Ka.x>=nn.x&&Gi.x<=mn.x&&Ka.y>=nn.y&&Gi.y<=mn.y?[la]:Gi.x<nn.x||Ka.x>mn.x||Gi.y<nn.y||Ka.y>mn.y?[]:e.al([la],nn.x,nn.y,mn.x,mn.y)}for(let Ka of li){zn.reset(Ka,.25*Qr);let Gi=0;Gi=zn.length<=.5*Qr?1:Math.ceil(zn.paddedLength/Na)+1;for(let jo=0;jo<Gi;jo++){let Uo=jo/Math.max(Gi-1,1),ho=zn.lerp(Uo),Go=ho.x+mr,js=ho.y+mr;oe.push(Go,js,Qr,0);let Is=Go-Qr,bo=js-Qr,wo=Go+Qr,nl=js+Qr;if(Rr=Rr&&this.isOffscreen(Is,bo,wo,nl),Tr=Tr||this.isInsideGrid(Is,bo,wo,nl),P!=="always"&&this.grid.hitTestCircle(Go,js,Qr,P,zr)&&(or=!0,!ar))return{circles:[],offscreen:!1,collisionDetected:or}}}}return{circles:!ar&&or||!Tr||pe<this.perspectiveRatioCutoff?[]:oe,offscreen:Rr,collisionDetected:or}}projectPathToScreenSpace(P,at,_t){return P.map(Tt=>he(Tt.x,Tt.y,_t,at.getElevation))}queryRenderedSymbols(P){if(P.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let at=[],_t=1/0,Tt=1/0,Pt=-1/0,ie=-1/0;for(let ar of P){let ir=new e.P(ar.x+mr,ar.y+mr);_t=Math.min(_t,ir.x),Tt=Math.min(Tt,ir.y),Pt=Math.max(Pt,ir.x),ie=Math.max(ie,ir.y),at.push(ir)}let de=this.grid.query(_t,Tt,Pt,ie).concat(this.ignoredGrid.query(_t,Tt,Pt,ie)),Ee={},He={};for(let ar of de){let ir=ar.key;if(Ee[ir.bucketInstanceId]===void 0&&(Ee[ir.bucketInstanceId]={}),Ee[ir.bucketInstanceId][ir.featureIndex])continue;let zr=[new e.P(ar.x1,ar.y1),new e.P(ar.x2,ar.y1),new e.P(ar.x2,ar.y2),new e.P(ar.x1,ar.y2)];e.am(at,zr)&&(Ee[ir.bucketInstanceId][ir.featureIndex]=!0,He[ir.bucketInstanceId]===void 0&&(He[ir.bucketInstanceId]=[]),He[ir.bucketInstanceId].push(ir.featureIndex))}return He}insertCollisionBox(P,at,_t,Tt,Pt,ie){(_t?this.ignoredGrid:this.grid).insert({bucketInstanceId:Tt,featureIndex:Pt,collisionGroupID:ie,overlapMode:at},P[0],P[1],P[2],P[3])}insertCollisionCircles(P,at,_t,Tt,Pt,ie){let de=_t?this.ignoredGrid:this.grid,Ee={bucketInstanceId:Tt,featureIndex:Pt,collisionGroupID:ie,overlapMode:at};for(let He=0;He<P.length;He+=4)de.insertCircle(Ee,P[He],P[He+1],P[He+2])}projectAndGetPerspectiveRatio(P,at,_t,Tt,Pt){let ie;Pt?(ie=[at,_t,Pt(at,_t),1],e.af(ie,ie,P)):(ie=[at,_t,0,1],Ue(ie,ie,P));let de=ie[3];return{point:new e.P((ie[0]/de+1)/2*this.transform.width+mr,(-ie[1]/de+1)/2*this.transform.height+mr),perspectiveRatio:.5+this.transform.cameraToCenterDistance/de*.5,isOccluded:!1,signedDistanceFromCamera:de}}getPerspectiveRatio(P,at,_t,Tt,Pt){let ie=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(at,_t,Tt,Pt):he(at,_t,P,Pt);return .5+this.transform.cameraToCenterDistance/ie.signedDistanceFromCamera*.5}isOffscreen(P,at,_t,Tt){return _t<mr||P>=this.screenRightBoundary||Tt<mr||at>this.screenBottomBoundary}isInsideGrid(P,at,_t,Tt){return _t>=0&&P<this.gridRightBoundary&&Tt>=0&&at<this.gridBottomBoundary}getViewportMatrix(){let P=e.an([]);return e.J(P,P,[-100,-100,0]),P}_projectCollisionBox(P,at,_t,Tt,Pt,ie,de,Ee,He,ar){let ir=new e.P(1,0),zr=new e.P(0,1),Zr=new e.P(P.anchorPointX+de[0],P.anchorPointY+de[1]);if(ie&&!Pt){let Rr=this.projectAndGetPerspectiveRatio(_t,Zr.x+1,Zr.y,Tt,He).point.sub(Ee.point).unit(),Qr=Math.atan(Rr.y/Rr.x)+(Rr.x<0?Math.PI:0),nn=Math.sin(Qr),mn=Math.cos(Qr);ir=new e.P(mn,nn),zr=new e.P(-nn,mn)}else if(!ie&&Pt){let Rr=-this.transform.angle,Qr=Math.sin(Rr),nn=Math.cos(Rr);ir=new e.P(nn,Qr),zr=new e.P(-Qr,nn)}let Rt=Ee.point,Gt=at;if(Pt){Rt=Zr;let Rr=this.transform.zoom-Math.floor(this.transform.zoom);Gt=Math.pow(2,-Rr),Gt*=this.mapProjection.getPitchedTextCorrection(this.transform,Zr,Tt),ar||(Gt*=e.ac(.5+Ee.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}ar&&(Rt=Rt.add(ir.mult(ar.x*Gt)).add(zr.mult(ar.y*Gt)));let ne=P.x1*Gt,oe=P.x2*Gt,be=(ne+oe)/2,pe=P.y1*Gt,Ae=P.y2*Gt,Xe=(pe+Ae)/2,nr=[{offsetX:ne,offsetY:pe},{offsetX:be,offsetY:pe},{offsetX:oe,offsetY:pe},{offsetX:oe,offsetY:Xe},{offsetX:oe,offsetY:Ae},{offsetX:be,offsetY:Ae},{offsetX:ne,offsetY:Ae},{offsetX:ne,offsetY:Xe}],or=[];for(let{offsetX:Rr,offsetY:Qr}of nr)or.push(new e.P(Rt.x+ir.x*Rr+zr.x*Qr,Rt.y+ir.y*Rr+zr.y*Qr));let Tr=!1;if(Pt){let Rr=or.map(Qr=>this.projectAndGetPerspectiveRatio(_t,Qr.x,Qr.y,Tt,He));Tr=Rr.some(Qr=>!Qr.isOccluded),or=Rr.map(Qr=>Qr.point)}else Tr=!0;return{box:e.ao(or),allPointsOccluded:!Tr}}}function an(Lt,P,at){return P*(e.X/(Lt.tileSize*Math.pow(2,at-Lt.tileID.overscaledZ)))}class vn{constructor(P,at,_t,Tt){this.opacity=P?Math.max(0,Math.min(1,P.opacity+(P.placed?at:-at))):Tt&&_t?1:0,this.placed=_t}isHidden(){return this.opacity===0&&!this.placed}}class Sn{constructor(P,at,_t,Tt,Pt){this.text=new vn(P?P.text:null,at,_t,Pt),this.icon=new vn(P?P.icon:null,at,Tt,Pt)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class An{constructor(P,at,_t){this.text=P,this.icon=at,this.skipFade=_t}}class pn{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class On{constructor(P,at,_t,Tt,Pt){this.bucketInstanceId=P,this.featureIndex=at,this.sourceLayerIndex=_t,this.bucketIndex=Tt,this.tileID=Pt}}class Nn{constructor(P){this.crossSourceCollisions=P,this.maxGroupID=0,this.collisionGroups={}}get(P){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[P]){let at=++this.maxGroupID;this.collisionGroups[P]={ID:at,predicate:_t=>_t.collisionGroupID===at}}return this.collisionGroups[P]}}function ke(Lt,P,at,_t,Tt){let{horizontalAlign:Pt,verticalAlign:ie}=e.au(Lt);return new e.P(-(Pt-.5)*P+_t[0]*Tt,-(ie-.5)*at+_t[1]*Tt)}class ze{constructor(P,at,_t,Tt,Pt,ie){this.transform=P.clone(),this.terrain=_t,this.collisionIndex=new ln(this.transform,at),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=Tt,this.retainedQueryData={},this.collisionGroups=new Nn(Pt),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=ie,ie&&(ie.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(P){let at=this.terrain;return at?(_t,Tt)=>at.getElevation(P,_t,Tt):null}getBucketParts(P,at,_t,Tt){let Pt=_t.getBucket(at),ie=_t.latestFeatureIndex;if(!Pt||!ie||at.id!==Pt.layerIds[0])return;let de=_t.collisionBoxArray,Ee=Pt.layers[0].layout,He=Pt.layers[0].paint,ar=Math.pow(2,this.transform.zoom-_t.tileID.overscaledZ),ir=_t.tileSize/e.X,zr=_t.tileID.toUnwrapped(),Zr=this.transform.calculatePosMatrix(zr),Rt=Ee.get("text-pitch-alignment")==="map",Gt=Ee.get("text-rotation-alignment")==="map",ne=an(_t,1,this.transform.zoom),oe=this.collisionIndex.mapProjection.translatePosition(this.transform,_t,He.get("text-translate"),He.get("text-translate-anchor")),be=this.collisionIndex.mapProjection.translatePosition(this.transform,_t,He.get("icon-translate"),He.get("icon-translate-anchor")),pe=Lr(Zr,Rt,Gt,this.transform,ne),Ae=null;if(Rt){let nr=kr(Zr,Rt,Gt,this.transform,ne);Ae=e.L([],this.transform.labelPlaneMatrix,nr)}this.retainedQueryData[Pt.bucketInstanceId]=new On(Pt.bucketInstanceId,ie,Pt.sourceLayerIndex,Pt.index,_t.tileID);let Xe={bucket:Pt,layout:Ee,translationText:oe,translationIcon:be,posMatrix:Zr,unwrappedTileID:zr,textLabelPlaneMatrix:pe,labelToScreenMatrix:Ae,scale:ar,textPixelRatio:ir,holdingForFade:_t.holdingForFade(),collisionBoxArray:de,partiallyEvaluatedTextSize:e.ag(Pt.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Pt.sourceID)};if(Tt)for(let nr of Pt.sortKeyRanges){let{sortKey:or,symbolInstanceStart:Tr,symbolInstanceEnd:Rr}=nr;P.push({sortKey:or,symbolInstanceStart:Tr,symbolInstanceEnd:Rr,parameters:Xe})}else P.push({symbolInstanceStart:0,symbolInstanceEnd:Pt.symbolInstances.length,parameters:Xe})}attemptAnchorPlacement(P,at,_t,Tt,Pt,ie,de,Ee,He,ar,ir,zr,Zr,Rt,Gt,ne,oe,be,pe){let Ae=e.aq[P.textAnchor],Xe=[P.textOffset0,P.textOffset1],nr=ke(Ae,_t,Tt,Xe,Pt),or=this.collisionIndex.placeCollisionBox(at,zr,Ee,He,ar,de,ie,ne,ir.predicate,pe,nr);if((!be||this.collisionIndex.placeCollisionBox(be,zr,Ee,He,ar,de,ie,oe,ir.predicate,pe,nr).placeable)&&or.placeable){let Tr;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Zr.crossTileID]&&this.prevPlacement.placements[Zr.crossTileID]&&this.prevPlacement.placements[Zr.crossTileID].text&&(Tr=this.prevPlacement.variableOffsets[Zr.crossTileID].anchor),Zr.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Zr.crossTileID]={textOffset:Xe,width:_t,height:Tt,anchor:Ae,textBoxScale:Pt,prevAnchor:Tr},this.markUsedJustification(Rt,Ae,Zr,Gt),Rt.allowVerticalPlacement&&(this.markUsedOrientation(Rt,Gt,Zr),this.placedOrientations[Zr.crossTileID]=Gt),{shift:nr,placedGlyphBoxes:or}}}placeLayerBucketPart(P,at,_t){let{bucket:Tt,layout:Pt,translationText:ie,translationIcon:de,posMatrix:Ee,unwrappedTileID:He,textLabelPlaneMatrix:ar,labelToScreenMatrix:ir,textPixelRatio:zr,holdingForFade:Zr,collisionBoxArray:Rt,partiallyEvaluatedTextSize:Gt,collisionGroup:ne}=P.parameters,oe=Pt.get("text-optional"),be=Pt.get("icon-optional"),pe=e.ar(Pt,"text-overlap","text-allow-overlap"),Ae=pe==="always",Xe=e.ar(Pt,"icon-overlap","icon-allow-overlap"),nr=Xe==="always",or=Pt.get("text-rotation-alignment")==="map",Tr=Pt.get("text-pitch-alignment")==="map",Rr=Pt.get("icon-text-fit")!=="none",Qr=Pt.get("symbol-z-order")==="viewport-y",nn=Ae&&(nr||!Tt.hasIconData()||be),mn=nr&&(Ae||!Tt.hasTextData()||oe);!Tt.collisionArrays&&Rt&&Tt.deserializeCollisionBoxes(Rt);let zn=this._getTerrainElevationFunc(this.retainedQueryData[Tt.bucketInstanceId].tileID),na=(Yn,la,Na)=>{var li,Ka;if(at[Yn.crossTileID])return;if(Zr)return void(this.placements[Yn.crossTileID]=new An(!1,!1,!1));let Gi=!1,jo=!1,Uo=!0,ho=null,Go={box:null,placeable:!1,offscreen:null},js={box:null,placeable:!1,offscreen:null},Is=null,bo=null,wo=null,nl=0,dl=0,lu=0;la.textFeatureIndex?nl=la.textFeatureIndex:Yn.useRuntimeCollisionCircles&&(nl=Yn.featureIndex),la.verticalTextFeatureIndex&&(dl=la.verticalTextFeatureIndex);let mt=la.textBox;if(mt){let fe=Qe=>{let Mr=e.ah.horizontal;if(Tt.allowVerticalPlacement&&!Qe&&this.prevPlacement){let br=this.prevPlacement.placedOrientations[Yn.crossTileID];br&&(this.placedOrientations[Yn.crossTileID]=br,Mr=br,this.markUsedOrientation(Tt,Mr,Yn))}return Mr},ve=(Qe,Mr)=>{if(Tt.allowVerticalPlacement&&Yn.numVerticalGlyphVertices>0&&la.verticalTextBox){for(let br of Tt.writingModes)if(br===e.ah.vertical?(Go=Mr(),js=Go):Go=Qe(),Go&&Go.placeable)break}else Go=Qe()},De=Yn.textAnchorOffsetStartIndex,Ce=Yn.textAnchorOffsetEndIndex;if(Ce===De){let Qe=(Mr,br)=>{let jr=this.collisionIndex.placeCollisionBox(Mr,pe,zr,Ee,He,Tr,or,ie,ne.predicate,zn);return jr&&jr.placeable&&(this.markUsedOrientation(Tt,br,Yn),this.placedOrientations[Yn.crossTileID]=br),jr};ve(()=>Qe(mt,e.ah.horizontal),()=>{let Mr=la.verticalTextBox;return Tt.allowVerticalPlacement&&Yn.numVerticalGlyphVertices>0&&Mr?Qe(Mr,e.ah.vertical):{box:null,offscreen:null}}),fe(Go&&Go.placeable)}else{let Qe=e.aq[(Ka=(li=this.prevPlacement)===null||li===void 0?void 0:li.variableOffsets[Yn.crossTileID])===null||Ka===void 0?void 0:Ka.anchor],Mr=(jr,Yr,tn)=>{let Rn=jr.x2-jr.x1,sn=jr.y2-jr.y1,Mn=Yn.textBoxScale,In=Rr&&Xe==="never"?Yr:null,Dn=null,jn=pe==="never"?1:2,xn="never";Qe&&jn++;for(let _a=0;_a<jn;_a++){for(let La=De;La<Ce;La++){let $a=Tt.textAnchorOffsets.get(La);if(Qe&&$a.textAnchor!==Qe)continue;let ti=this.attemptAnchorPlacement($a,jr,Rn,sn,Mn,or,Tr,zr,Ee,He,ne,xn,Yn,Tt,tn,ie,de,In,zn);if(ti&&(Dn=ti.placedGlyphBoxes,Dn&&Dn.placeable))return Gi=!0,ho=ti.shift,Dn}Qe?Qe=null:xn=pe}return _t&&!Dn&&(Dn={box:this.collisionIndex.placeCollisionBox(mt,"always",zr,Ee,He,Tr,or,ie,ne.predicate,zn,new e.P(0,0)).box,offscreen:!1,placeable:!1}),Dn};ve(()=>Mr(mt,la.iconBox,e.ah.horizontal),()=>{let jr=la.verticalTextBox;return Tt.allowVerticalPlacement&&(!Go||!Go.placeable)&&Yn.numVerticalGlyphVertices>0&&jr?Mr(jr,la.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Go&&(Gi=Go.placeable,Uo=Go.offscreen);let br=fe(Go&&Go.placeable);if(!Gi&&this.prevPlacement){let jr=this.prevPlacement.variableOffsets[Yn.crossTileID];jr&&(this.variableOffsets[Yn.crossTileID]=jr,this.markUsedJustification(Tt,jr.anchor,Yn,br))}}}if(Is=Go,Gi=Is&&Is.placeable,Uo=Is&&Is.offscreen,Yn.useRuntimeCollisionCircles){let fe=Tt.text.placedSymbolArray.get(Yn.centerJustifiedTextSymbolIndex),ve=e.ai(Tt.textSizeData,Gt,fe),De=Pt.get("text-padding");bo=this.collisionIndex.placeCollisionCircles(pe,fe,Tt.lineVertexArray,Tt.glyphOffsetArray,ve,Ee,He,ar,ir,_t,Tr,ne.predicate,Yn.collisionCircleDiameter,De,ie,zn),bo.circles.length&&bo.collisionDetected&&!_t&&e.w("Collisions detected, but collision boxes are not shown"),Gi=Ae||bo.circles.length>0&&!bo.collisionDetected,Uo=Uo&&bo.offscreen}if(la.iconFeatureIndex&&(lu=la.iconFeatureIndex),la.iconBox){let fe=ve=>this.collisionIndex.placeCollisionBox(ve,Xe,zr,Ee,He,Tr,or,de,ne.predicate,zn,Rr&&ho?ho:void 0);js&&js.placeable&&la.verticalIconBox?(wo=fe(la.verticalIconBox),jo=wo.placeable):(wo=fe(la.iconBox),jo=wo.placeable),Uo=Uo&&wo.offscreen}let St=oe||Yn.numHorizontalGlyphVertices===0&&Yn.numVerticalGlyphVertices===0,Xt=be||Yn.numIconVertices===0;St||Xt?Xt?St||(jo=jo&&Gi):Gi=jo&&Gi:jo=Gi=jo&&Gi;let se=jo&&wo.placeable;if(Gi&&Is.placeable&&this.collisionIndex.insertCollisionBox(Is.box,pe,Pt.get("text-ignore-placement"),Tt.bucketInstanceId,js&&js.placeable&&dl?dl:nl,ne.ID),se&&this.collisionIndex.insertCollisionBox(wo.box,Xe,Pt.get("icon-ignore-placement"),Tt.bucketInstanceId,lu,ne.ID),bo&&Gi&&this.collisionIndex.insertCollisionCircles(bo.circles,pe,Pt.get("text-ignore-placement"),Tt.bucketInstanceId,nl,ne.ID),_t&&this.storeCollisionData(Tt.bucketInstanceId,Na,la,Is,wo,bo),Yn.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(Tt.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Yn.crossTileID]=new An(Gi||nn,jo||mn,Uo||Tt.justReloaded),at[Yn.crossTileID]=!0};if(Qr){if(P.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let Yn=Tt.getSortedSymbolIndexes(this.transform.angle);for(let la=Yn.length-1;la>=0;--la){let Na=Yn[la];na(Tt.symbolInstances.get(Na),Tt.collisionArrays[Na],Na)}}else for(let Yn=P.symbolInstanceStart;Yn<P.symbolInstanceEnd;Yn++)na(Tt.symbolInstances.get(Yn),Tt.collisionArrays[Yn],Yn);if(_t&&Tt.bucketInstanceId in this.collisionCircleArrays){let Yn=this.collisionCircleArrays[Tt.bucketInstanceId];e.as(Yn.invProjMatrix,Ee),Yn.viewportMatrix=this.collisionIndex.getViewportMatrix()}Tt.justReloaded=!1}storeCollisionData(P,at,_t,Tt,Pt,ie){if(_t.textBox||_t.iconBox){let de,Ee;this.collisionBoxArrays.has(P)?de=this.collisionBoxArrays.get(P):(de=new Map,this.collisionBoxArrays.set(P,de)),de.has(at)?Ee=de.get(at):(Ee={text:null,icon:null},de.set(at,Ee)),_t.textBox&&(Ee.text=Tt.box),_t.iconBox&&(Ee.icon=Pt.box)}if(ie){let de=this.collisionCircleArrays[P];de===void 0&&(de=this.collisionCircleArrays[P]=new pn);for(let Ee=0;Ee<ie.circles.length;Ee+=4)de.circles.push(ie.circles[Ee+0]),de.circles.push(ie.circles[Ee+1]),de.circles.push(ie.circles[Ee+2]),de.circles.push(ie.collisionDetected?1:0)}}markUsedJustification(P,at,_t,Tt){let Pt;Pt=Tt===e.ah.vertical?_t.verticalPlacedTextSymbolIndex:{left:_t.leftJustifiedTextSymbolIndex,center:_t.centerJustifiedTextSymbolIndex,right:_t.rightJustifiedTextSymbolIndex}[e.at(at)];let ie=[_t.leftJustifiedTextSymbolIndex,_t.centerJustifiedTextSymbolIndex,_t.rightJustifiedTextSymbolIndex,_t.verticalPlacedTextSymbolIndex];for(let de of ie)de>=0&&(P.text.placedSymbolArray.get(de).crossTileID=Pt>=0&&de!==Pt?0:_t.crossTileID)}markUsedOrientation(P,at,_t){let Tt=at===e.ah.horizontal||at===e.ah.horizontalOnly?at:0,Pt=at===e.ah.vertical?at:0,ie=[_t.leftJustifiedTextSymbolIndex,_t.centerJustifiedTextSymbolIndex,_t.rightJustifiedTextSymbolIndex];for(let de of ie)P.text.placedSymbolArray.get(de).placedOrientation=Tt;_t.verticalPlacedTextSymbolIndex&&(P.text.placedSymbolArray.get(_t.verticalPlacedTextSymbolIndex).placedOrientation=Pt)}commit(P){this.commitTime=P,this.zoomAtLastRecencyCheck=this.transform.zoom;let at=this.prevPlacement,_t=!1;this.prevZoomAdjustment=at?at.zoomAdjustment(this.transform.zoom):0;let Tt=at?at.symbolFadeChange(P):1,Pt=at?at.opacities:{},ie=at?at.variableOffsets:{},de=at?at.placedOrientations:{};for(let Ee in this.placements){let He=this.placements[Ee],ar=Pt[Ee];ar?(this.opacities[Ee]=new Sn(ar,Tt,He.text,He.icon),_t=_t||He.text!==ar.text.placed||He.icon!==ar.icon.placed):(this.opacities[Ee]=new Sn(null,Tt,He.text,He.icon,He.skipFade),_t=_t||He.text||He.icon)}for(let Ee in Pt){let He=Pt[Ee];if(!this.opacities[Ee]){let ar=new Sn(He,Tt,!1,!1);ar.isHidden()||(this.opacities[Ee]=ar,_t=_t||He.text.placed||He.icon.placed)}}for(let Ee in ie)this.variableOffsets[Ee]||!this.opacities[Ee]||this.opacities[Ee].isHidden()||(this.variableOffsets[Ee]=ie[Ee]);for(let Ee in de)this.placedOrientations[Ee]||!this.opacities[Ee]||this.opacities[Ee].isHidden()||(this.placedOrientations[Ee]=de[Ee]);if(at&&at.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");_t?this.lastPlacementChangeTime=P:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=at?at.lastPlacementChangeTime:P)}updateLayerOpacities(P,at){let _t={};for(let Tt of at){let Pt=Tt.getBucket(P);Pt&&Tt.latestFeatureIndex&&P.id===Pt.layerIds[0]&&this.updateBucketOpacities(Pt,Tt.tileID,_t,Tt.collisionBoxArray)}}updateBucketOpacities(P,at,_t,Tt){P.hasTextData()&&(P.text.opacityVertexArray.clear(),P.text.hasVisibleVertices=!1),P.hasIconData()&&(P.icon.opacityVertexArray.clear(),P.icon.hasVisibleVertices=!1),P.hasIconCollisionBoxData()&&P.iconCollisionBox.collisionVertexArray.clear(),P.hasTextCollisionBoxData()&&P.textCollisionBox.collisionVertexArray.clear();let Pt=P.layers[0],ie=Pt.layout,de=new Sn(null,0,!1,!1,!0),Ee=ie.get("text-allow-overlap"),He=ie.get("icon-allow-overlap"),ar=Pt._unevaluatedLayout.hasValue("text-variable-anchor")||Pt._unevaluatedLayout.hasValue("text-variable-anchor-offset"),ir=ie.get("text-rotation-alignment")==="map",zr=ie.get("text-pitch-alignment")==="map",Zr=ie.get("icon-text-fit")!=="none",Rt=new Sn(null,0,Ee&&(He||!P.hasIconData()||ie.get("icon-optional")),He&&(Ee||!P.hasTextData()||ie.get("text-optional")),!0);!P.collisionArrays&&Tt&&(P.hasIconCollisionBoxData()||P.hasTextCollisionBoxData())&&P.deserializeCollisionBoxes(Tt);let Gt=(oe,be,pe)=>{for(let Ae=0;Ae<be/4;Ae++)oe.opacityVertexArray.emplaceBack(pe);oe.hasVisibleVertices=oe.hasVisibleVertices||pe!==on},ne=this.collisionBoxArrays.get(P.bucketInstanceId);for(let oe=0;oe<P.symbolInstances.length;oe++){let be=P.symbolInstances.get(oe),{numHorizontalGlyphVertices:pe,numVerticalGlyphVertices:Ae,crossTileID:Xe}=be,nr=this.opacities[Xe];_t[Xe]?nr=de:nr||(nr=Rt,this.opacities[Xe]=nr),_t[Xe]=!0;let or=be.numIconVertices>0,Tr=this.placedOrientations[be.crossTileID],Rr=Tr===e.ah.vertical,Qr=Tr===e.ah.horizontal||Tr===e.ah.horizontalOnly;if(pe>0||Ae>0){let mn=Fn(nr.text);Gt(P.text,pe,Rr?on:mn),Gt(P.text,Ae,Qr?on:mn);let zn=nr.text.isHidden();[be.rightJustifiedTextSymbolIndex,be.centerJustifiedTextSymbolIndex,be.leftJustifiedTextSymbolIndex].forEach(la=>{la>=0&&(P.text.placedSymbolArray.get(la).hidden=zn||Rr?1:0)}),be.verticalPlacedTextSymbolIndex>=0&&(P.text.placedSymbolArray.get(be.verticalPlacedTextSymbolIndex).hidden=zn||Qr?1:0);let na=this.variableOffsets[be.crossTileID];na&&this.markUsedJustification(P,na.anchor,be,Tr);let Yn=this.placedOrientations[be.crossTileID];Yn&&(this.markUsedJustification(P,"left",be,Yn),this.markUsedOrientation(P,Yn,be))}if(or){let mn=Fn(nr.icon),zn=!(Zr&&be.verticalPlacedIconSymbolIndex&&Rr);be.placedIconSymbolIndex>=0&&(Gt(P.icon,be.numIconVertices,zn?mn:on),P.icon.placedSymbolArray.get(be.placedIconSymbolIndex).hidden=nr.icon.isHidden()),be.verticalPlacedIconSymbolIndex>=0&&(Gt(P.icon,be.numVerticalIconVertices,zn?on:mn),P.icon.placedSymbolArray.get(be.verticalPlacedIconSymbolIndex).hidden=nr.icon.isHidden())}let nn=ne&&ne.has(oe)?ne.get(oe):{text:null,icon:null};if(P.hasIconCollisionBoxData()||P.hasTextCollisionBoxData()){let mn=P.collisionArrays[oe];if(mn){let zn=new e.P(0,0);if(mn.textBox||mn.verticalTextBox){let na=!0;if(ar){let Yn=this.variableOffsets[Xe];Yn?(zn=ke(Yn.anchor,Yn.width,Yn.height,Yn.textOffset,Yn.textBoxScale),ir&&zn._rotate(zr?this.transform.angle:-this.transform.angle)):na=!1}if(mn.textBox||mn.verticalTextBox){let Yn;mn.textBox&&(Yn=Rr),mn.verticalTextBox&&(Yn=Qr),je(P.textCollisionBox.collisionVertexArray,nr.text.placed,!na||Yn,nn.text,zn.x,zn.y)}}if(mn.iconBox||mn.verticalIconBox){let na=!!(!Qr&&mn.verticalIconBox),Yn;mn.iconBox&&(Yn=na),mn.verticalIconBox&&(Yn=!na),je(P.iconCollisionBox.collisionVertexArray,nr.icon.placed,Yn,nn.icon,Zr?zn.x:0,Zr?zn.y:0)}}}}if(P.sortFeatures(this.transform.angle),this.retainedQueryData[P.bucketInstanceId]&&(this.retainedQueryData[P.bucketInstanceId].featureSortOrder=P.featureSortOrder),P.hasTextData()&&P.text.opacityVertexBuffer&&P.text.opacityVertexBuffer.updateData(P.text.opacityVertexArray),P.hasIconData()&&P.icon.opacityVertexBuffer&&P.icon.opacityVertexBuffer.updateData(P.icon.opacityVertexArray),P.hasIconCollisionBoxData()&&P.iconCollisionBox.collisionVertexBuffer&&P.iconCollisionBox.collisionVertexBuffer.updateData(P.iconCollisionBox.collisionVertexArray),P.hasTextCollisionBoxData()&&P.textCollisionBox.collisionVertexBuffer&&P.textCollisionBox.collisionVertexBuffer.updateData(P.textCollisionBox.collisionVertexArray),P.text.opacityVertexArray.length!==P.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${P.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${P.text.layoutVertexArray.length}) / 4`);if(P.icon.opacityVertexArray.length!==P.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${P.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${P.icon.layoutVertexArray.length}) / 4`);if(P.bucketInstanceId in this.collisionCircleArrays){let oe=this.collisionCircleArrays[P.bucketInstanceId];P.placementInvProjMatrix=oe.invProjMatrix,P.placementViewportMatrix=oe.viewportMatrix,P.collisionCircleArray=oe.circles,delete this.collisionCircleArrays[P.bucketInstanceId]}}symbolFadeChange(P){return this.fadeDuration===0?1:(P-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(P){return Math.max(0,(this.transform.zoom-P)/1.5)}hasTransitions(P){return this.stale||P-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(P,at){let _t=this.zoomAtLastRecencyCheck===at?1-this.zoomAdjustment(at):1;return this.zoomAtLastRecencyCheck=at,this.commitTime+this.fadeDuration*_t>P}setStale(){this.stale=!0}}function je(Lt,P,at,_t,Tt,Pt){_t&&_t.length!==0||(_t=[0,0,0,0]);let ie=_t[0]-mr,de=_t[1]-mr,Ee=_t[2]-mr,He=_t[3]-mr;Lt.emplaceBack(P?1:0,at?1:0,Tt||0,Pt||0,ie,de),Lt.emplaceBack(P?1:0,at?1:0,Tt||0,Pt||0,Ee,de),Lt.emplaceBack(P?1:0,at?1:0,Tt||0,Pt||0,Ee,He),Lt.emplaceBack(P?1:0,at?1:0,Tt||0,Pt||0,ie,He)}let Ne=Math.pow(2,25),_r=Math.pow(2,24),Xr=Math.pow(2,17),rn=Math.pow(2,16),Br=Math.pow(2,9),_n=Math.pow(2,8),bn=Math.pow(2,1);function Fn(Lt){if(Lt.opacity===0&&!Lt.placed)return 0;if(Lt.opacity===1&&Lt.placed)return 4294967295;let P=Lt.placed?1:0,at=Math.floor(127*Lt.opacity);return at*Ne+P*_r+at*Xr+P*rn+at*Br+P*_n+at*bn+P}let on=0;function Bn(){return{isOccluded:(Lt,P,at)=>!1,getPitchedTextCorrection:(Lt,P,at)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Lt,P,at,_t){throw new Error("Not implemented.")},translatePosition:(Lt,P,at,_t)=>function(Tt,Pt,ie,de,Ee=!1){if(!ie[0]&&!ie[1])return[0,0];let He=Ee?de==="map"?Tt.angle:0:de==="viewport"?-Tt.angle:0;if(He){let ar=Math.sin(He),ir=Math.cos(He);ie=[ie[0]*ir-ie[1]*ar,ie[0]*ar+ie[1]*ir]}return[Ee?ie[0]:an(Pt,ie[0],Tt.zoom),Ee?ie[1]:an(Pt,ie[1],Tt.zoom)]}(Lt,P,at,_t),getCircleRadiusCorrection:Lt=>1}}class ue{constructor(P){this._sortAcrossTiles=P.layout.get("symbol-z-order")!=="viewport-y"&&!P.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(P,at,_t,Tt,Pt){let ie=this._bucketParts;for(;this._currentTileIndex<P.length;)if(at.getBucketParts(ie,Tt,P[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,Pt())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,ie.sort((de,Ee)=>de.sortKey-Ee.sortKey));this._currentPartIndex<ie.length;)if(at.placeLayerBucketPart(ie[this._currentPartIndex],this._seenCrossTileIDs,_t),this._currentPartIndex++,Pt())return!0;return!1}}class xe{constructor(P,at,_t,Tt,Pt,ie,de,Ee){this.placement=new ze(P,Bn(),at,ie,de,Ee),this._currentPlacementIndex=_t.length-1,this._forceFullPlacement=Tt,this._showCollisionBoxes=Pt,this._done=!1}isDone(){return this._done}continuePlacement(P,at,_t){let Tt=o.now(),Pt=()=>!this._forceFullPlacement&&o.now()-Tt>2;for(;this._currentPlacementIndex>=0;){let ie=at[P[this._currentPlacementIndex]],de=this.placement.collisionIndex.transform.zoom;if(ie.type==="symbol"&&(!ie.minzoom||ie.minzoom<=de)&&(!ie.maxzoom||ie.maxzoom>de)){if(this._inProgressLayer||(this._inProgressLayer=new ue(ie)),this._inProgressLayer.continuePlacement(_t[ie.source],this.placement,this._showCollisionBoxes,ie,Pt))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(P){return this.placement.commit(P),this.placement}}let Pr=512/e.X/2;class Sr{constructor(P,at,_t){this.tileID=P,this.bucketInstanceId=_t,this._symbolsByKey={};let Tt=new Map;for(let Pt=0;Pt<at.length;Pt++){let ie=at.get(Pt),de=ie.key,Ee=Tt.get(de);Ee?Ee.push(ie):Tt.set(de,[ie])}for(let[Pt,ie]of Tt){let de={positions:ie.map(Ee=>({x:Math.floor(Ee.anchorX*Pr),y:Math.floor(Ee.anchorY*Pr)})),crossTileIDs:ie.map(Ee=>Ee.crossTileID)};if(de.positions.length>128){let Ee=new e.av(de.positions.length,16,Uint16Array);for(let{x:He,y:ar}of de.positions)Ee.add(He,ar);Ee.finish(),delete de.positions,de.index=Ee}this._symbolsByKey[Pt]=de}}getScaledCoordinates(P,at){let{x:_t,y:Tt,z:Pt}=this.tileID.canonical,{x:ie,y:de,z:Ee}=at.canonical,He=Pr/Math.pow(2,Ee-Pt),ar=(de*e.X+P.anchorY)*He,ir=Tt*e.X*Pr;return{x:Math.floor((ie*e.X+P.anchorX)*He-_t*e.X*Pr),y:Math.floor(ar-ir)}}findMatches(P,at,_t){let Tt=this.tileID.canonical.z<at.canonical.z?1:Math.pow(2,this.tileID.canonical.z-at.canonical.z);for(let Pt=0;Pt<P.length;Pt++){let ie=P.get(Pt);if(ie.crossTileID)continue;let de=this._symbolsByKey[ie.key];if(!de)continue;let Ee=this.getScaledCoordinates(ie,at);if(de.index){let He=de.index.range(Ee.x-Tt,Ee.y-Tt,Ee.x+Tt,Ee.y+Tt).sort();for(let ar of He){let ir=de.crossTileIDs[ar];if(!_t[ir]){_t[ir]=!0,ie.crossTileID=ir;break}}}else if(de.positions)for(let He=0;He<de.positions.length;He++){let ar=de.positions[He],ir=de.crossTileIDs[He];if(Math.abs(ar.x-Ee.x)<=Tt&&Math.abs(ar.y-Ee.y)<=Tt&&!_t[ir]){_t[ir]=!0,ie.crossTileID=ir;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:P})=>P)}}class gr{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class dr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(P){let at=Math.round((P-this.lng)/360);if(at!==0)for(let _t in this.indexes){let Tt=this.indexes[_t],Pt={};for(let ie in Tt){let de=Tt[ie];de.tileID=de.tileID.unwrapTo(de.tileID.wrap+at),Pt[de.tileID.key]=de}this.indexes[_t]=Pt}this.lng=P}addBucket(P,at,_t){if(this.indexes[P.overscaledZ]&&this.indexes[P.overscaledZ][P.key]){if(this.indexes[P.overscaledZ][P.key].bucketInstanceId===at.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(P.overscaledZ,this.indexes[P.overscaledZ][P.key])}for(let Pt=0;Pt<at.symbolInstances.length;Pt++)at.symbolInstances.get(Pt).crossTileID=0;this.usedCrossTileIDs[P.overscaledZ]||(this.usedCrossTileIDs[P.overscaledZ]={});let Tt=this.usedCrossTileIDs[P.overscaledZ];for(let Pt in this.indexes){let ie=this.indexes[Pt];if(Number(Pt)>P.overscaledZ)for(let de in ie){let Ee=ie[de];Ee.tileID.isChildOf(P)&&Ee.findMatches(at.symbolInstances,P,Tt)}else{let de=ie[P.scaledTo(Number(Pt)).key];de&&de.findMatches(at.symbolInstances,P,Tt)}}for(let Pt=0;Pt<at.symbolInstances.length;Pt++){let ie=at.symbolInstances.get(Pt);ie.crossTileID||(ie.crossTileID=_t.generate(),Tt[ie.crossTileID]=!0)}return this.indexes[P.overscaledZ]===void 0&&(this.indexes[P.overscaledZ]={}),this.indexes[P.overscaledZ][P.key]=new Sr(P,at.symbolInstances,at.bucketInstanceId),!0}removeBucketCrossTileIDs(P,at){for(let _t of at.getCrossTileIDsLists())for(let Tt of _t)delete this.usedCrossTileIDs[P][Tt]}removeStaleBuckets(P){let at=!1;for(let _t in this.indexes){let Tt=this.indexes[_t];for(let Pt in Tt)P[Tt[Pt].bucketInstanceId]||(this.removeBucketCrossTileIDs(_t,Tt[Pt]),delete Tt[Pt],at=!0)}return at}}class Er{constructor(){this.layerIndexes={},this.crossTileIDs=new gr,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(P,at,_t){let Tt=this.layerIndexes[P.id];Tt===void 0&&(Tt=this.layerIndexes[P.id]=new dr);let Pt=!1,ie={};Tt.handleWrapJump(_t);for(let de of at){let Ee=de.getBucket(P);Ee&&P.id===Ee.layerIds[0]&&(Ee.bucketInstanceId||(Ee.bucketInstanceId=++this.maxBucketInstanceId),Tt.addBucket(de.tileID,Ee,this.crossTileIDs)&&(Pt=!0),ie[Ee.bucketInstanceId]=!0)}return Tt.removeStaleBuckets(ie)&&(Pt=!0),Pt}pruneUnusedLayers(P){let at={};P.forEach(_t=>{at[_t]=!0});for(let _t in this.layerIndexes)at[_t]||delete this.layerIndexes[_t]}}let Dr=(Lt,P)=>e.t(Lt,P&&P.filter(at=>at.identifier!=="source.canvas")),Ar=e.aw();class Gr extends e.E{constructor(P,at={}){super(),this._rtlPluginLoaded=()=>{for(let _t in this.sourceCaches){let Tt=this.sourceCaches[_t].getSource().type;Tt!=="vector"&&Tt!=="geojson"||this.sourceCaches[_t].reload()}},this.map=P,this.dispatcher=new $(st(),P._getMapId()),this.dispatcher.registerMessageHandler("GG",(_t,Tt)=>this.getGlyphs(_t,Tt)),this.dispatcher.registerMessageHandler("GI",(_t,Tt)=>this.getImages(_t,Tt)),this.imageManager=new _,this.imageManager.setEventedParent(this),this.glyphManager=new B(P._requestManager,at.localIdeographFontFamily),this.lineAtlas=new G(256,512),this.crossTileSymbolIndex=new Er,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",e.ay()),Kt().on(bt,this._rtlPluginLoaded),this.on("data",_t=>{if(_t.dataType!=="source"||_t.sourceDataType!=="metadata")return;let Tt=this.sourceCaches[_t.sourceId];if(!Tt)return;let Pt=Tt.getSource();if(Pt&&Pt.vectorLayerIds)for(let ie in this._layers){let de=this._layers[ie];de.source===Pt.id&&this._validateLayer(de)}})}loadURL(P,at={},_t){this.fire(new e.k("dataloading",{dataType:"style"})),at.validate=typeof at.validate!="boolean"||at.validate;let Tt=this.map._requestManager.transformRequest(P,"Style");this._loadStyleRequest=new AbortController;let Pt=this._loadStyleRequest;e.h(Tt,this._loadStyleRequest).then(ie=>{this._loadStyleRequest=null,this._load(ie.data,at,_t)}).catch(ie=>{this._loadStyleRequest=null,ie&&!Pt.signal.aborted&&this.fire(new e.j(ie))})}loadJSON(P,at={},_t){this.fire(new e.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,o.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,at.validate=at.validate!==!1,this._load(P,at,_t)}).catch(()=>{})}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(Ar,{validate:!1})}_load(P,at,_t){var Tt;let Pt=at.transformStyle?at.transformStyle(_t,P):P;if(!at.validate||!Dr(this,e.u(Pt))){this._loaded=!0,this.stylesheet=Pt;for(let ie in Pt.sources)this.addSource(ie,Pt.sources[ie],{validate:!1});Pt.sprite?this._loadSprite(Pt.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Pt.glyphs),this._createLayers(),this.light=new F(this.stylesheet.light),this.sky=new j(this.stylesheet.sky),this.map.setTerrain((Tt=this.stylesheet.terrain)!==null&&Tt!==void 0?Tt:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){let P=e.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",P),this._order=P.map(at=>at.id),this._layers={},this._serializedLayers=null;for(let at of P){let _t=e.aA(at);_t.setEventedParent(this,{layer:{id:at.id}}),this._layers[at.id]=_t}}_loadSprite(P,at=!1,_t=void 0){let Tt;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(Pt,ie,de,Ee){return e._(this,void 0,void 0,function*(){let He=w(Pt),ar=de>1?"@2x":"",ir={},zr={};for(let{id:Zr,url:Rt}of He){let Gt=ie.transformRequest(u(Rt,ar,".json"),"SpriteJSON");ir[Zr]=e.h(Gt,Ee);let ne=ie.transformRequest(u(Rt,ar,".png"),"SpriteImage");zr[Zr]=l.getImage(ne,Ee)}return yield Promise.all([...Object.values(ir),...Object.values(zr)]),function(Zr,Rt){return e._(this,void 0,void 0,function*(){let Gt={};for(let ne in Zr){Gt[ne]={};let oe=o.getImageCanvasContext((yield Rt[ne]).data),be=(yield Zr[ne]).data;for(let pe in be){let{width:Ae,height:Xe,x:nr,y:or,sdf:Tr,pixelRatio:Rr,stretchX:Qr,stretchY:nn,content:mn,textFitWidth:zn,textFitHeight:na}=be[pe];Gt[ne][pe]={data:null,pixelRatio:Rr,sdf:Tr,stretchX:Qr,stretchY:nn,content:mn,textFitWidth:zn,textFitHeight:na,spriteData:{width:Ae,height:Xe,x:nr,y:or,context:oe}}}}return Gt})}(ir,zr)})}(P,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Pt=>{if(this._spriteRequest=null,Pt)for(let ie in Pt){this._spritesImagesIds[ie]=[];let de=this._spritesImagesIds[ie]?this._spritesImagesIds[ie].filter(Ee=>!(Ee in Pt)):[];for(let Ee of de)this.imageManager.removeImage(Ee),this._changedImages[Ee]=!0;for(let Ee in Pt[ie]){let He=ie==="default"?Ee:`${ie}:${Ee}`;this._spritesImagesIds[ie].push(He),He in this.imageManager.images?this.imageManager.updateImage(He,Pt[ie][Ee],!1):this.imageManager.addImage(He,Pt[ie][Ee]),at&&(this._changedImages[He]=!0)}}}).catch(Pt=>{this._spriteRequest=null,Tt=Pt,this.fire(new e.j(Tt))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),at&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"})),_t&&_t(Tt)})}_unloadSprite(){for(let P of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(P),this._changedImages[P]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}_validateLayer(P){let at=this.sourceCaches[P.source];if(!at)return;let _t=P.sourceLayer;if(!_t)return;let Tt=at.getSource();(Tt.type==="geojson"||Tt.vectorLayerIds&&Tt.vectorLayerIds.indexOf(_t)===-1)&&this.fire(new e.j(new Error(`Source layer "${_t}" does not exist on source "${Tt.id}" as specified by style layer "${P.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let P in this.sourceCaches)if(!this.sourceCaches[P].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(P,at=!1){let _t=this._serializedAllLayers();if(!P||P.length===0)return Object.values(at?e.aB(_t):_t);let Tt=[];for(let Pt of P)if(_t[Pt]){let ie=at?e.aB(_t[Pt]):_t[Pt];Tt.push(ie)}return Tt}_serializedAllLayers(){let P=this._serializedLayers;if(P)return P;P=this._serializedLayers={};let at=Object.keys(this._layers);for(let _t of at){let Tt=this._layers[_t];Tt.type!=="custom"&&(P[_t]=Tt.serialize())}return P}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let P in this.sourceCaches)if(this.sourceCaches[P].hasTransition())return!0;for(let P in this._layers)if(this._layers[P].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(P){if(!this._loaded)return;let at=this._changed;if(at){let Tt=Object.keys(this._updatedLayers),Pt=Object.keys(this._removedLayers);(Tt.length||Pt.length)&&this._updateWorkerLayers(Tt,Pt);for(let ie in this._updatedSources){let de=this._updatedSources[ie];if(de==="reload")this._reloadSource(ie);else{if(de!=="clear")throw new Error(`Invalid action ${de}`);this._clearSource(ie)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let ie in this._updatedPaintProps)this._layers[ie].updateTransitions(P);this.light.updateTransitions(P),this.sky.updateTransitions(P),this._resetUpdates()}let _t={};for(let Tt in this.sourceCaches){let Pt=this.sourceCaches[Tt];_t[Tt]=Pt.used,Pt.used=!1}for(let Tt of this._order){let Pt=this._layers[Tt];Pt.recalculate(P,this._availableImages),!Pt.isHidden(P.zoom)&&Pt.source&&(this.sourceCaches[Pt.source].used=!0)}for(let Tt in _t){let Pt=this.sourceCaches[Tt];!!_t[Tt]!=!!Pt.used&&Pt.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:Tt}))}this.light.recalculate(P),this.sky.recalculate(P),this.z=P.zoom,at&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let P=Object.keys(this._changedImages);if(P.length){for(let at in this.sourceCaches)this.sourceCaches[at].reloadTilesForDependencies(["icons","patterns"],P);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let P in this.sourceCaches)this.sourceCaches[P].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(P,at){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(P,!1),removedIds:at})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(P,at={}){var _t;this._checkLoaded();let Tt=this.serialize();if(P=at.transformStyle?at.transformStyle(Tt,P):P,((_t=at.validate)===null||_t===void 0||_t)&&Dr(this,e.u(P)))return!1;(P=e.aB(P)).layers=e.az(P.layers);let Pt=e.aC(Tt,P),ie=this._getOperationsToPerform(Pt);if(ie.unimplemented.length>0)throw new Error(`Unimplemented: ${ie.unimplemented.join(", ")}.`);if(ie.operations.length===0)return!1;for(let de of ie.operations)de();return this.stylesheet=P,this._serializedLayers=null,!0}_getOperationsToPerform(P){let at=[],_t=[];for(let Tt of P)switch(Tt.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":at.push(()=>this.addLayer.apply(this,Tt.args));break;case"removeLayer":at.push(()=>this.removeLayer.apply(this,Tt.args));break;case"setPaintProperty":at.push(()=>this.setPaintProperty.apply(this,Tt.args));break;case"setLayoutProperty":at.push(()=>this.setLayoutProperty.apply(this,Tt.args));break;case"setFilter":at.push(()=>this.setFilter.apply(this,Tt.args));break;case"addSource":at.push(()=>this.addSource.apply(this,Tt.args));break;case"removeSource":at.push(()=>this.removeSource.apply(this,Tt.args));break;case"setLayerZoomRange":at.push(()=>this.setLayerZoomRange.apply(this,Tt.args));break;case"setLight":at.push(()=>this.setLight.apply(this,Tt.args));break;case"setGeoJSONSourceData":at.push(()=>this.setGeoJSONSourceData.apply(this,Tt.args));break;case"setGlyphs":at.push(()=>this.setGlyphs.apply(this,Tt.args));break;case"setSprite":at.push(()=>this.setSprite.apply(this,Tt.args));break;case"setSky":at.push(()=>this.setSky.apply(this,Tt.args));break;case"setTerrain":at.push(()=>this.map.setTerrain.apply(this,Tt.args));break;case"setTransition":at.push(()=>{});break;default:_t.push(Tt.command)}return{operations:at,unimplemented:_t}}addImage(P,at){if(this.getImage(P))return this.fire(new e.j(new Error(`An image named "${P}" already exists.`)));this.imageManager.addImage(P,at),this._afterImageUpdated(P)}updateImage(P,at){this.imageManager.updateImage(P,at)}getImage(P){return this.imageManager.getImage(P)}removeImage(P){if(!this.getImage(P))return this.fire(new e.j(new Error(`An image named "${P}" does not exist.`)));this.imageManager.removeImage(P),this._afterImageUpdated(P)}_afterImageUpdated(P){this._availableImages=this.imageManager.listImages(),this._changedImages[P]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(P,at,_t={}){if(this._checkLoaded(),this.sourceCaches[P]!==void 0)throw new Error(`Source "${P}" already exists.`);if(!at.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(at).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(at.type)>=0&&this._validate(e.u.source,`sources.${P}`,at,null,_t))return;this.map&&this.map._collectResourceTiming&&(at.collectResourceTiming=!0);let Tt=this.sourceCaches[P]=new Se(P,at,this.dispatcher);Tt.style=this,Tt.setEventedParent(this,()=>({isSourceLoaded:Tt.loaded(),source:Tt.serialize(),sourceId:P})),Tt.onAdd(this.map),this._changed=!0}removeSource(P){if(this._checkLoaded(),this.sourceCaches[P]===void 0)throw new Error("There is no source with this ID");for(let _t in this._layers)if(this._layers[_t].source===P)return this.fire(new e.j(new Error(`Source "${P}" cannot be removed while layer "${_t}" is using it.`)));let at=this.sourceCaches[P];delete this.sourceCaches[P],delete this._updatedSources[P],at.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:P})),at.setEventedParent(null),at.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(P,at){if(this._checkLoaded(),this.sourceCaches[P]===void 0)throw new Error(`There is no source with this ID=${P}`);let _t=this.sourceCaches[P].getSource();if(_t.type!=="geojson")throw new Error(`geojsonSource.type is ${_t.type}, which is !== 'geojson`);_t.setData(at),this._changed=!0}getSource(P){return this.sourceCaches[P]&&this.sourceCaches[P].getSource()}addLayer(P,at,_t={}){this._checkLoaded();let Tt=P.id;if(this.getLayer(Tt))return void this.fire(new e.j(new Error(`Layer "${Tt}" already exists on this map.`)));let Pt;if(P.type==="custom"){if(Dr(this,e.aD(P)))return;Pt=e.aA(P)}else{if("source"in P&&typeof P.source=="object"&&(this.addSource(Tt,P.source),P=e.aB(P),P=e.e(P,{source:Tt})),this._validate(e.u.layer,`layers.${Tt}`,P,{arrayIndex:-1},_t))return;Pt=e.aA(P),this._validateLayer(Pt),Pt.setEventedParent(this,{layer:{id:Tt}})}let ie=at?this._order.indexOf(at):this._order.length;if(at&&ie===-1)this.fire(new e.j(new Error(`Cannot add layer "${Tt}" before non-existing layer "${at}".`)));else{if(this._order.splice(ie,0,Tt),this._layerOrderChanged=!0,this._layers[Tt]=Pt,this._removedLayers[Tt]&&Pt.source&&Pt.type!=="custom"){let de=this._removedLayers[Tt];delete this._removedLayers[Tt],de.type!==Pt.type?this._updatedSources[Pt.source]="clear":(this._updatedSources[Pt.source]="reload",this.sourceCaches[Pt.source].pause())}this._updateLayer(Pt),Pt.onAdd&&Pt.onAdd(this.map)}}moveLayer(P,at){if(this._checkLoaded(),this._changed=!0,!this._layers[P])return void this.fire(new e.j(new Error(`The layer '${P}' does not exist in the map's style and cannot be moved.`)));if(P===at)return;let _t=this._order.indexOf(P);this._order.splice(_t,1);let Tt=at?this._order.indexOf(at):this._order.length;at&&Tt===-1?this.fire(new e.j(new Error(`Cannot move layer "${P}" before non-existing layer "${at}".`))):(this._order.splice(Tt,0,P),this._layerOrderChanged=!0)}removeLayer(P){this._checkLoaded();let at=this._layers[P];if(!at)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${P}".`)));at.setEventedParent(null);let _t=this._order.indexOf(P);this._order.splice(_t,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[P]=at,delete this._layers[P],this._serializedLayers&&delete this._serializedLayers[P],delete this._updatedLayers[P],delete this._updatedPaintProps[P],at.onRemove&&at.onRemove(this.map)}getLayer(P){return this._layers[P]}getLayersOrder(){return[...this._order]}hasLayer(P){return P in this._layers}setLayerZoomRange(P,at,_t){this._checkLoaded();let Tt=this.getLayer(P);Tt?Tt.minzoom===at&&Tt.maxzoom===_t||(at!=null&&(Tt.minzoom=at),_t!=null&&(Tt.maxzoom=_t),this._updateLayer(Tt)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${P}".`)))}setFilter(P,at,_t={}){this._checkLoaded();let Tt=this.getLayer(P);if(Tt){if(!e.aE(Tt.filter,at))return at==null?(Tt.filter=void 0,void this._updateLayer(Tt)):void(this._validate(e.u.filter,`layers.${Tt.id}.filter`,at,null,_t)||(Tt.filter=e.aB(at),this._updateLayer(Tt)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${P}".`)))}getFilter(P){return e.aB(this.getLayer(P).filter)}setLayoutProperty(P,at,_t,Tt={}){this._checkLoaded();let Pt=this.getLayer(P);Pt?e.aE(Pt.getLayoutProperty(at),_t)||(Pt.setLayoutProperty(at,_t,Tt),this._updateLayer(Pt)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${P}".`)))}getLayoutProperty(P,at){let _t=this.getLayer(P);if(_t)return _t.getLayoutProperty(at);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${P}".`)))}setPaintProperty(P,at,_t,Tt={}){this._checkLoaded();let Pt=this.getLayer(P);Pt?e.aE(Pt.getPaintProperty(at),_t)||(Pt.setPaintProperty(at,_t,Tt)&&this._updateLayer(Pt),this._changed=!0,this._updatedPaintProps[P]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${P}".`)))}getPaintProperty(P,at){return this.getLayer(P).getPaintProperty(at)}setFeatureState(P,at){this._checkLoaded();let _t=P.source,Tt=P.sourceLayer,Pt=this.sourceCaches[_t];if(Pt===void 0)return void this.fire(new e.j(new Error(`The source '${_t}' does not exist in the map's style.`)));let ie=Pt.getSource().type;ie==="geojson"&&Tt?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):ie!=="vector"||Tt?(P.id===void 0&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),Pt.setFeatureState(Tt,P.id,at)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(P,at){this._checkLoaded();let _t=P.source,Tt=this.sourceCaches[_t];if(Tt===void 0)return void this.fire(new e.j(new Error(`The source '${_t}' does not exist in the map's style.`)));let Pt=Tt.getSource().type,ie=Pt==="vector"?P.sourceLayer:void 0;Pt!=="vector"||ie?at&&typeof P.id!="string"&&typeof P.id!="number"?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):Tt.removeFeatureState(ie,P.id,at):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(P){this._checkLoaded();let at=P.source,_t=P.sourceLayer,Tt=this.sourceCaches[at];if(Tt!==void 0)return Tt.getSource().type!=="vector"||_t?(P.id===void 0&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),Tt.getFeatureState(_t,P.id)):void this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.j(new Error(`The source '${at}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let P=e.aF(this.sourceCaches,Pt=>Pt.serialize()),at=this._serializeByIds(this._order,!0),_t=this.map.getTerrain()||void 0,Tt=this.stylesheet;return e.aG({version:Tt.version,name:Tt.name,metadata:Tt.metadata,light:Tt.light,sky:Tt.sky,center:Tt.center,zoom:Tt.zoom,bearing:Tt.bearing,pitch:Tt.pitch,sprite:Tt.sprite,glyphs:Tt.glyphs,transition:Tt.transition,sources:P,layers:at,terrain:_t},Pt=>Pt!==void 0)}_updateLayer(P){this._updatedLayers[P.id]=!0,P.source&&!this._updatedSources[P.source]&&this.sourceCaches[P.source].getSource().type!=="raster"&&(this._updatedSources[P.source]="reload",this.sourceCaches[P.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(P){let at=ie=>this._layers[ie].type==="fill-extrusion",_t={},Tt=[];for(let ie=this._order.length-1;ie>=0;ie--){let de=this._order[ie];if(at(de)){_t[de]=ie;for(let Ee of P){let He=Ee[de];if(He)for(let ar of He)Tt.push(ar)}}}Tt.sort((ie,de)=>de.intersectionZ-ie.intersectionZ);let Pt=[];for(let ie=this._order.length-1;ie>=0;ie--){let de=this._order[ie];if(at(de))for(let Ee=Tt.length-1;Ee>=0;Ee--){let He=Tt[Ee].feature;if(_t[He.layer.id]<ie)break;Pt.push(He),Tt.pop()}else for(let Ee of P){let He=Ee[de];if(He)for(let ar of He)Pt.push(ar.feature)}}return Pt}queryRenderedFeatures(P,at,_t){at&&at.filter&&this._validate(e.u.filter,"queryRenderedFeatures.filter",at.filter,null,at);let Tt={};if(at&&at.layers){if(!Array.isArray(at.layers))return this.fire(new e.j(new Error("parameters.layers must be an Array."))),[];for(let de of at.layers){let Ee=this._layers[de];if(!Ee)return this.fire(new e.j(new Error(`The layer '${de}' does not exist in the map's style and cannot be queried for features.`))),[];Tt[Ee.source]=!0}}let Pt=[];at.availableImages=this._availableImages;let ie=this._serializedAllLayers();for(let de in this.sourceCaches)at.layers&&!Tt[de]||Pt.push(Y(this.sourceCaches[de],this._layers,ie,P,at,_t));return this.placement&&Pt.push(function(de,Ee,He,ar,ir,zr,Zr){let Rt={},Gt=zr.queryRenderedSymbols(ar),ne=[];for(let oe of Object.keys(Gt).map(Number))ne.push(Zr[oe]);ne.sort(q);for(let oe of ne){let be=oe.featureIndex.lookupSymbolFeatures(Gt[oe.bucketInstanceId],Ee,oe.bucketIndex,oe.sourceLayerIndex,ir.filter,ir.layers,ir.availableImages,de);for(let pe in be){let Ae=Rt[pe]=Rt[pe]||[],Xe=be[pe];Xe.sort((nr,or)=>{let Tr=oe.featureSortOrder;if(Tr){let Rr=Tr.indexOf(nr.featureIndex);return Tr.indexOf(or.featureIndex)-Rr}return or.featureIndex-nr.featureIndex});for(let nr of Xe)Ae.push(nr)}}for(let oe in Rt)Rt[oe].forEach(be=>{let pe=be.feature,Ae=He[de[oe].source].getFeatureState(pe.layer["source-layer"],pe.id);pe.source=pe.layer.source,pe.layer["source-layer"]&&(pe.sourceLayer=pe.layer["source-layer"]),pe.state=Ae});return Rt}(this._layers,ie,this.sourceCaches,P,at,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Pt)}querySourceFeatures(P,at){at&&at.filter&&this._validate(e.u.filter,"querySourceFeatures.filter",at.filter,null,at);let _t=this.sourceCaches[P];return _t?function(Tt,Pt){let ie=Tt.getRenderableIds().map(He=>Tt.getTileByID(He)),de=[],Ee={};for(let He=0;He<ie.length;He++){let ar=ie[He],ir=ar.tileID.canonical.key;Ee[ir]||(Ee[ir]=!0,ar.querySourceFeatures(de,Pt))}return de}(_t,at):[]}getLight(){return this.light.getLight()}setLight(P,at={}){this._checkLoaded();let _t=this.light.getLight(),Tt=!1;for(let ie in P)if(!e.aE(P[ie],_t[ie])){Tt=!0;break}if(!Tt)return;let Pt={now:o.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(P,at),this.light.updateTransitions(Pt)}getSky(){var P;return(P=this.stylesheet)===null||P===void 0?void 0:P.sky}setSky(P,at={}){let _t=this.getSky(),Tt=!1;if(!P&&!_t)return;if(P&&!_t)Tt=!0;else if(!P&&_t)Tt=!0;else for(let ie in P)if(!e.aE(P[ie],_t[ie])){Tt=!0;break}if(!Tt)return;let Pt={now:o.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=P,this.sky.setSky(P,at),this.sky.updateTransitions(Pt)}_validate(P,at,_t,Tt,Pt={}){return(!Pt||Pt.validate!==!1)&&Dr(this,P.call(e.u,e.e({key:at,style:this.serialize(),value:_t,styleSpec:e.v},Tt)))}_remove(P=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),Kt().off(bt,this._rtlPluginLoaded);for(let at in this._layers)this._layers[at].setEventedParent(null);for(let at in this.sourceCaches){let _t=this.sourceCaches[at];_t.setEventedParent(null),_t.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),P&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(P)}_clearSource(P){this.sourceCaches[P].clearTiles()}_reloadSource(P){this.sourceCaches[P].resume(),this.sourceCaches[P].reload()}_updateSources(P){for(let at in this.sourceCaches)this.sourceCaches[at].update(P,this.map.terrain)}_generateCollisionBoxes(){for(let P in this.sourceCaches)this._reloadSource(P)}_updatePlacement(P,at,_t,Tt,Pt=!1){let ie=!1,de=!1,Ee={};for(let He of this._order){let ar=this._layers[He];if(ar.type!=="symbol")continue;if(!Ee[ar.source]){let zr=this.sourceCaches[ar.source];Ee[ar.source]=zr.getRenderableIds(!0).map(Zr=>zr.getTileByID(Zr)).sort((Zr,Rt)=>Rt.tileID.overscaledZ-Zr.tileID.overscaledZ||(Zr.tileID.isLessThan(Rt.tileID)?-1:1))}let ir=this.crossTileSymbolIndex.addLayer(ar,Ee[ar.source],P.center.lng);ie=ie||ir}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Pt=Pt||this._layerOrderChanged||_t===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.now(),P.zoom))&&(this.pauseablePlacement=new xe(P,this.map.terrain,this._order,Pt,at,_t,Tt,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Ee),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.now()),de=!0),ie&&this.pauseablePlacement.placement.setStale()),de||ie)for(let He of this._order){let ar=this._layers[He];ar.type==="symbol"&&this.placement.updateLayerOpacities(ar,Ee[ar.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.now())}_releaseSymbolFadeTiles(){for(let P in this.sourceCaches)this.sourceCaches[P].releaseSymbolFadeTiles()}getImages(P,at){return e._(this,void 0,void 0,function*(){let _t=yield this.imageManager.getImages(at.icons);this._updateTilesForChangedImages();let Tt=this.sourceCaches[at.source];return Tt&&Tt.setDependencies(at.tileID.key,at.type,at.icons),_t})}getGlyphs(P,at){return e._(this,void 0,void 0,function*(){let _t=yield this.glyphManager.getGlyphs(at.stacks),Tt=this.sourceCaches[at.source];return Tt&&Tt.setDependencies(at.tileID.key,at.type,[""]),_t})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(P,at={}){this._checkLoaded(),P&&this._validate(e.u.glyphs,"glyphs",P,null,at)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=P,this.glyphManager.entries={},this.glyphManager.setURL(P))}addSprite(P,at,_t={},Tt){this._checkLoaded();let Pt=[{id:P,url:at}],ie=[...w(this.stylesheet.sprite),...Pt];this._validate(e.u.sprite,"sprite",ie,null,_t)||(this.stylesheet.sprite=ie,this._loadSprite(Pt,!0,Tt))}removeSprite(P){this._checkLoaded();let at=w(this.stylesheet.sprite);if(at.find(_t=>_t.id===P)){if(this._spritesImagesIds[P])for(let _t of this._spritesImagesIds[P])this.imageManager.removeImage(_t),this._changedImages[_t]=!0;at.splice(at.findIndex(_t=>_t.id===P),1),this.stylesheet.sprite=at.length>0?at:void 0,delete this._spritesImagesIds[P],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}else this.fire(new e.j(new Error(`Sprite "${P}" doesn't exists on this map.`)))}getSprite(){return w(this.stylesheet.sprite)}setSprite(P,at={},_t){this._checkLoaded(),P&&this._validate(e.u.sprite,"sprite",P,null,at)||(this.stylesheet.sprite=P,P?this._loadSprite(P,!0,_t):(this._unloadSprite(),_t&&_t(null)))}}var Wr=e.Y([{name:"a_pos",type:"Int16",components:2}]);let Jr={prelude:_e(`#ifdef GL_ES
|
||
precision mediump float;
|
||
#else
|
||
#if !defined(lowp)
|
||
#define lowp
|
||
#endif
|
||
#if !defined(mediump)
|
||
#define mediump
|
||
#endif
|
||
#if !defined(highp)
|
||
#define highp
|
||
#endif
|
||
#endif
|
||
`,`#ifdef GL_ES
|
||
precision highp float;
|
||
#else
|
||
#if !defined(lowp)
|
||
#define lowp
|
||
#endif
|
||
#if !defined(mediump)
|
||
#define mediump
|
||
#endif
|
||
#if !defined(highp)
|
||
#define highp
|
||
#endif
|
||
#endif
|
||
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
|
||
);}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;}
|
||
#ifdef TERRAIN3D
|
||
uniform 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;
|
||
#endif
|
||
const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
|
||
#ifdef TERRAIN3D
|
||
highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
|
||
#else
|
||
return 1.0;
|
||
#endif
|
||
}float calculate_visibility(vec4 pos) {
|
||
#ifdef TERRAIN3D
|
||
vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
|
||
#else
|
||
return 1.0;
|
||
#endif
|
||
}float ele(vec2 pos) {
|
||
#ifdef TERRAIN3D
|
||
vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
|
||
#else
|
||
return 0.0;
|
||
#endif
|
||
}float get_elevation(vec2 pos) {
|
||
#ifdef TERRAIN3D
|
||
vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
|
||
#else
|
||
return 0.0;
|
||
#endif
|
||
}`),background:_e(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:_e(`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;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,"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:_e(`varying vec3 v_data;varying float v_visibility;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define mediump float radius
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define highp vec4 stroke_color
|
||
#pragma mapbox: define mediump float stroke_width
|
||
#pragma mapbox: define lowp float stroke_opacity
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize mediump float radius
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize highp vec4 stroke_color
|
||
#pragma mapbox: initialize mediump float stroke_width
|
||
#pragma mapbox: initialize lowp float stroke_opacity
|
||
vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;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);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`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;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define mediump float radius
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define highp vec4 stroke_color
|
||
#pragma mapbox: define mediump float stroke_width
|
||
#pragma mapbox: define lowp float stroke_opacity
|
||
void main(void) {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize mediump float radius
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize highp vec4 stroke_color
|
||
#pragma mapbox: initialize mediump float stroke_width
|
||
#pragma mapbox: initialize lowp float stroke_opacity
|
||
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:_e("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:_e(`uniform highp float u_intensity;varying vec2 v_extrude;
|
||
#pragma mapbox: define highp float weight
|
||
#define GAUSS_COEF 0.3989422804014327
|
||
void main() {
|
||
#pragma mapbox: initialize highp float weight
|
||
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`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;
|
||
#pragma mapbox: define highp float weight
|
||
#pragma mapbox: define mediump float radius
|
||
const highp float ZERO=1.0/255.0/16.0;
|
||
#define GAUSS_COEF 0.3989422804014327
|
||
void main(void) {
|
||
#pragma mapbox: initialize highp float weight
|
||
#pragma mapbox: initialize mediump float radius
|
||
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:_e(`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;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(0.0);
|
||
#endif
|
||
}`,"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:_e("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_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:_e("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:_e("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:_e(`#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
gl_FragColor=color*opacity;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:_e(`varying vec2 v_pos;
|
||
#pragma mapbox: define highp vec4 outline_color
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 outline_color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
|
||
#pragma mapbox: define highp vec4 outline_color
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 outline_color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:_e(`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;
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`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;
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
#pragma mapbox: define lowp float pixel_ratio_from
|
||
#pragma mapbox: define lowp float pixel_ratio_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
#pragma mapbox: initialize lowp float pixel_ratio_from
|
||
#pragma mapbox: initialize lowp float pixel_ratio_to
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:_e(`#ifdef GL_ES
|
||
precision highp float;
|
||
#endif
|
||
uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`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;
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
#pragma mapbox: define lowp float pixel_ratio_from
|
||
#pragma mapbox: define lowp float pixel_ratio_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
#pragma mapbox: initialize lowp float pixel_ratio_from
|
||
#pragma mapbox: initialize lowp float pixel_ratio_to
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:_e(`varying vec4 v_color;void main() {gl_FragColor=v_color;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`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;
|
||
#ifdef TERRAIN3D
|
||
attribute vec2 a_centroid;
|
||
#endif
|
||
varying vec4 v_color;
|
||
#pragma mapbox: define highp float base
|
||
#pragma mapbox: define highp float height
|
||
#pragma mapbox: define highp vec4 color
|
||
void main() {
|
||
#pragma mapbox: initialize highp float base
|
||
#pragma mapbox: initialize highp float height
|
||
#pragma mapbox: initialize highp vec4 color
|
||
vec3 normal=a_normal_ed.xyz;
|
||
#ifdef TERRAIN3D
|
||
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
|
||
#else
|
||
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
|
||
#endif
|
||
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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:_e(`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;
|
||
#pragma mapbox: define lowp float base
|
||
#pragma mapbox: define lowp float height
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
#pragma mapbox: define lowp float pixel_ratio_from
|
||
#pragma mapbox: define lowp float pixel_ratio_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float base
|
||
#pragma mapbox: initialize lowp float height
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
#pragma mapbox: initialize lowp float pixel_ratio_from
|
||
#pragma mapbox: initialize lowp float pixel_ratio_to
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`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;
|
||
#ifdef TERRAIN3D
|
||
attribute vec2 a_centroid;
|
||
#endif
|
||
varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
||
#pragma mapbox: define lowp float base
|
||
#pragma mapbox: define lowp float height
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
#pragma mapbox: define lowp float pixel_ratio_from
|
||
#pragma mapbox: define lowp float pixel_ratio_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float base
|
||
#pragma mapbox: initialize lowp float height
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
#pragma mapbox: initialize lowp float pixel_ratio_from
|
||
#pragma mapbox: initialize lowp float pixel_ratio_to
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
|
||
#ifdef TERRAIN3D
|
||
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
|
||
#else
|
||
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
|
||
#endif
|
||
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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
|
||
? a_pos
|
||
: 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:_e(`#ifdef GL_ES
|
||
precision highp float;
|
||
#endif
|
||
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,"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:_e(`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;
|
||
#define PI 3.141592653589793
|
||
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,"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:_e(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`
|
||
#define scale 0.015873016
|
||
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define mediump float gapwidth
|
||
#pragma mapbox: define lowp float offset
|
||
#pragma mapbox: define mediump float width
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump float gapwidth
|
||
#pragma mapbox: initialize lowp float offset
|
||
#pragma mapbox: initialize mediump float width
|
||
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
|
||
#ifdef TERRAIN3D
|
||
v_gamma_scale=1.0;
|
||
#else
|
||
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
||
#endif
|
||
v_width2=vec2(outset,inset);}`),lineGradient:_e(`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;
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`
|
||
#define scale 0.015873016
|
||
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define mediump float gapwidth
|
||
#pragma mapbox: define lowp float offset
|
||
#pragma mapbox: define mediump float width
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump float gapwidth
|
||
#pragma mapbox: initialize lowp float offset
|
||
#pragma mapbox: initialize mediump float width
|
||
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
|
||
#ifdef TERRAIN3D
|
||
v_gamma_scale=1.0;
|
||
#else
|
||
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
||
#endif
|
||
v_width2=vec2(outset,inset);}`),linePattern:_e(`#ifdef GL_ES
|
||
precision highp float;
|
||
#endif
|
||
uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
#pragma mapbox: define lowp float pixel_ratio_from
|
||
#pragma mapbox: define lowp float pixel_ratio_to
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
#pragma mapbox: initialize lowp float pixel_ratio_from
|
||
#pragma mapbox: initialize lowp float pixel_ratio_to
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`
|
||
#define scale 0.015873016
|
||
#define LINE_DISTANCE_SCALE 2.0
|
||
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp float offset
|
||
#pragma mapbox: define mediump float gapwidth
|
||
#pragma mapbox: define mediump float width
|
||
#pragma mapbox: define lowp float floorwidth
|
||
#pragma mapbox: define lowp vec4 pattern_from
|
||
#pragma mapbox: define lowp vec4 pattern_to
|
||
#pragma mapbox: define lowp float pixel_ratio_from
|
||
#pragma mapbox: define lowp float pixel_ratio_to
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize lowp float offset
|
||
#pragma mapbox: initialize mediump float gapwidth
|
||
#pragma mapbox: initialize mediump float width
|
||
#pragma mapbox: initialize lowp float floorwidth
|
||
#pragma mapbox: initialize mediump vec4 pattern_from
|
||
#pragma mapbox: initialize mediump vec4 pattern_to
|
||
#pragma mapbox: initialize lowp float pixel_ratio_from
|
||
#pragma mapbox: initialize lowp float pixel_ratio_to
|
||
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
|
||
#ifdef TERRAIN3D
|
||
v_gamma_scale=1.0;
|
||
#else
|
||
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
||
#endif
|
||
v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:_e(`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;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define mediump float width
|
||
#pragma mapbox: define lowp float floorwidth
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump float width
|
||
#pragma mapbox: initialize lowp float floorwidth
|
||
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`
|
||
#define scale 0.015873016
|
||
#define LINE_DISTANCE_SCALE 2.0
|
||
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
||
#pragma mapbox: define highp vec4 color
|
||
#pragma mapbox: define lowp float blur
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define mediump float gapwidth
|
||
#pragma mapbox: define lowp float offset
|
||
#pragma mapbox: define mediump float width
|
||
#pragma mapbox: define lowp float floorwidth
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 color
|
||
#pragma mapbox: initialize lowp float blur
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize mediump float gapwidth
|
||
#pragma mapbox: initialize lowp float offset
|
||
#pragma mapbox: initialize mediump float width
|
||
#pragma mapbox: initialize lowp float floorwidth
|
||
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
|
||
#ifdef TERRAIN3D
|
||
v_gamma_scale=1.0;
|
||
#else
|
||
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
||
#endif
|
||
v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:_e(`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);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,"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:_e(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float opacity
|
||
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}
|
||
#pragma mapbox: define lowp float opacity
|
||
void main() {
|
||
#pragma mapbox: initialize lowp float opacity
|
||
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
||
camera_to_anchor_distance/u_camera_to_center_distance :
|
||
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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:_e(`#define SDF_PX 8.0
|
||
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
|
||
#pragma mapbox: define highp vec4 fill_color
|
||
#pragma mapbox: define highp vec4 halo_color
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp float halo_width
|
||
#pragma mapbox: define lowp float halo_blur
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 fill_color
|
||
#pragma mapbox: initialize highp vec4 halo_color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize lowp float halo_width
|
||
#pragma mapbox: initialize lowp float halo_blur
|
||
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(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);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`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 bool u_is_along_line;uniform bool u_is_variable_anchor;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_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}
|
||
#pragma mapbox: define highp vec4 fill_color
|
||
#pragma mapbox: define highp vec4 halo_color
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp float halo_width
|
||
#pragma mapbox: define lowp float halo_blur
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 fill_color
|
||
#pragma mapbox: initialize highp vec4 halo_color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize lowp float halo_width
|
||
#pragma mapbox: initialize lowp float halo_blur
|
||
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
||
camera_to_anchor_distance/u_camera_to_center_distance :
|
||
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;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:_e(`#define SDF_PX 8.0
|
||
#define SDF 1.0
|
||
#define ICON 0.0
|
||
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
|
||
#pragma mapbox: define highp vec4 fill_color
|
||
#pragma mapbox: define highp vec4 halo_color
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp float halo_width
|
||
#pragma mapbox: define lowp float halo_blur
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 fill_color
|
||
#pragma mapbox: initialize highp vec4 halo_color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize lowp float halo_width
|
||
#pragma mapbox: initialize lowp float halo_blur
|
||
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}
|
||
#pragma mapbox: define highp vec4 fill_color
|
||
#pragma mapbox: define highp vec4 halo_color
|
||
#pragma mapbox: define lowp float opacity
|
||
#pragma mapbox: define lowp float halo_width
|
||
#pragma mapbox: define lowp float halo_blur
|
||
void main() {
|
||
#pragma mapbox: initialize highp vec4 fill_color
|
||
#pragma mapbox: initialize highp vec4 halo_color
|
||
#pragma mapbox: initialize lowp float opacity
|
||
#pragma mapbox: initialize lowp float halo_width
|
||
#pragma mapbox: initialize lowp float halo_blur
|
||
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
||
camera_to_anchor_distance/u_camera_to_center_distance :
|
||
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;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:_e("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:_e("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);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:_e("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);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:_e("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function _e(Lt,P){let at=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,_t=P.match(/attribute ([\w]+) ([\w]+)/g),Tt=Lt.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Pt=P.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ie=Pt?Pt.concat(Tt):Tt,de={};return{fragmentSource:Lt=Lt.replace(at,(Ee,He,ar,ir,zr)=>(de[zr]=!0,He==="define"?`
|
||
#ifndef HAS_UNIFORM_u_${zr}
|
||
varying ${ar} ${ir} ${zr};
|
||
#else
|
||
uniform ${ar} ${ir} u_${zr};
|
||
#endif
|
||
`:`
|
||
#ifdef HAS_UNIFORM_u_${zr}
|
||
${ar} ${ir} ${zr} = u_${zr};
|
||
#endif
|
||
`)),vertexSource:P=P.replace(at,(Ee,He,ar,ir,zr)=>{let Zr=ir==="float"?"vec2":"vec4",Rt=zr.match(/color/)?"color":Zr;return de[zr]?He==="define"?`
|
||
#ifndef HAS_UNIFORM_u_${zr}
|
||
uniform lowp float u_${zr}_t;
|
||
attribute ${ar} ${Zr} a_${zr};
|
||
varying ${ar} ${ir} ${zr};
|
||
#else
|
||
uniform ${ar} ${ir} u_${zr};
|
||
#endif
|
||
`:Rt==="vec4"?`
|
||
#ifndef HAS_UNIFORM_u_${zr}
|
||
${zr} = a_${zr};
|
||
#else
|
||
${ar} ${ir} ${zr} = u_${zr};
|
||
#endif
|
||
`:`
|
||
#ifndef HAS_UNIFORM_u_${zr}
|
||
${zr} = unpack_mix_${Rt}(a_${zr}, u_${zr}_t);
|
||
#else
|
||
${ar} ${ir} ${zr} = u_${zr};
|
||
#endif
|
||
`:He==="define"?`
|
||
#ifndef HAS_UNIFORM_u_${zr}
|
||
uniform lowp float u_${zr}_t;
|
||
attribute ${ar} ${Zr} a_${zr};
|
||
#else
|
||
uniform ${ar} ${ir} u_${zr};
|
||
#endif
|
||
`:Rt==="vec4"?`
|
||
#ifndef HAS_UNIFORM_u_${zr}
|
||
${ar} ${ir} ${zr} = a_${zr};
|
||
#else
|
||
${ar} ${ir} ${zr} = u_${zr};
|
||
#endif
|
||
`:`
|
||
#ifndef HAS_UNIFORM_u_${zr}
|
||
${ar} ${ir} ${zr} = unpack_mix_${Rt}(a_${zr}, u_${zr}_t);
|
||
#else
|
||
${ar} ${ir} ${zr} = u_${zr};
|
||
#endif
|
||
`}),staticAttributes:_t,staticUniforms:ie}}class Je{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(P,at,_t,Tt,Pt,ie,de,Ee,He){this.context=P;let ar=this.boundPaintVertexBuffers.length!==Tt.length;for(let ir=0;!ar&&ir<Tt.length;ir++)this.boundPaintVertexBuffers[ir]!==Tt[ir]&&(ar=!0);!this.vao||this.boundProgram!==at||this.boundLayoutVertexBuffer!==_t||ar||this.boundIndexBuffer!==Pt||this.boundVertexOffset!==ie||this.boundDynamicVertexBuffer!==de||this.boundDynamicVertexBuffer2!==Ee||this.boundDynamicVertexBuffer3!==He?this.freshBind(at,_t,Tt,Pt,ie,de,Ee,He):(P.bindVertexArray.set(this.vao),de&&de.bind(),Pt&&Pt.dynamicDraw&&Pt.bind(),Ee&&Ee.bind(),He&&He.bind())}freshBind(P,at,_t,Tt,Pt,ie,de,Ee){let He=P.numAttributes,ar=this.context,ir=ar.gl;this.vao&&this.destroy(),this.vao=ar.createVertexArray(),ar.bindVertexArray.set(this.vao),this.boundProgram=P,this.boundLayoutVertexBuffer=at,this.boundPaintVertexBuffers=_t,this.boundIndexBuffer=Tt,this.boundVertexOffset=Pt,this.boundDynamicVertexBuffer=ie,this.boundDynamicVertexBuffer2=de,this.boundDynamicVertexBuffer3=Ee,at.enableAttributes(ir,P);for(let zr of _t)zr.enableAttributes(ir,P);ie&&ie.enableAttributes(ir,P),de&&de.enableAttributes(ir,P),Ee&&Ee.enableAttributes(ir,P),at.bind(),at.setVertexAttribPointers(ir,P,Pt);for(let zr of _t)zr.bind(),zr.setVertexAttribPointers(ir,P,Pt);ie&&(ie.bind(),ie.setVertexAttribPointers(ir,P,Pt)),Tt&&Tt.bind(),de&&(de.bind(),de.setVertexAttribPointers(ir,P,Pt)),Ee&&(Ee.bind(),Ee.setVertexAttribPointers(ir,P,Pt)),ar.currentNumAttributes=He}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let yr=(Lt,P,at,_t,Tt)=>({u_matrix:Lt,u_texture:0,u_ele_delta:P,u_fog_matrix:at,u_fog_color:_t?_t.properties.get("fog-color"):e.aM.white,u_fog_ground_blend:_t?_t.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:_t?_t.calculateFogBlendOpacity(Tt):0,u_horizon_color:_t?_t.properties.get("horizon-color"):e.aM.white,u_horizon_fog_blend:_t?_t.properties.get("horizon-fog-blend"):1});function Hr(Lt){let P=[];for(let at=0;at<Lt.length;at++){if(Lt[at]===null)continue;let _t=Lt[at].split(" ");P.push(_t.pop())}return P}class hn{constructor(P,at,_t,Tt,Pt,ie){let de=P.gl;this.program=de.createProgram();let Ee=Hr(at.staticAttributes),He=_t?_t.getBinderAttributes():[],ar=Ee.concat(He),ir=Jr.prelude.staticUniforms?Hr(Jr.prelude.staticUniforms):[],zr=at.staticUniforms?Hr(at.staticUniforms):[],Zr=_t?_t.getBinderUniforms():[],Rt=ir.concat(zr).concat(Zr),Gt=[];for(let nr of Rt)Gt.indexOf(nr)<0&&Gt.push(nr);let ne=_t?_t.defines():[];Pt&&ne.push("#define OVERDRAW_INSPECTOR;"),ie&&ne.push("#define TERRAIN3D;");let oe=ne.concat(Jr.prelude.fragmentSource,at.fragmentSource).join(`
|
||
`),be=ne.concat(Jr.prelude.vertexSource,at.vertexSource).join(`
|
||
`),pe=de.createShader(de.FRAGMENT_SHADER);if(de.isContextLost())return void(this.failedToCreate=!0);if(de.shaderSource(pe,oe),de.compileShader(pe),!de.getShaderParameter(pe,de.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${de.getShaderInfoLog(pe)}`);de.attachShader(this.program,pe);let Ae=de.createShader(de.VERTEX_SHADER);if(de.isContextLost())return void(this.failedToCreate=!0);if(de.shaderSource(Ae,be),de.compileShader(Ae),!de.getShaderParameter(Ae,de.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${de.getShaderInfoLog(Ae)}`);de.attachShader(this.program,Ae),this.attributes={};let Xe={};this.numAttributes=ar.length;for(let nr=0;nr<this.numAttributes;nr++)ar[nr]&&(de.bindAttribLocation(this.program,nr,ar[nr]),this.attributes[ar[nr]]=nr);if(de.linkProgram(this.program),!de.getProgramParameter(this.program,de.LINK_STATUS))throw new Error(`Program failed to link: ${de.getProgramInfoLog(this.program)}`);de.deleteShader(Ae),de.deleteShader(pe);for(let nr=0;nr<Gt.length;nr++){let or=Gt[nr];if(or&&!Xe[or]){let Tr=de.getUniformLocation(this.program,or);Tr&&(Xe[or]=Tr)}}this.fixedUniforms=Tt(P,Xe),this.terrainUniforms=((nr,or)=>({u_depth:new e.aH(nr,or.u_depth),u_terrain:new e.aH(nr,or.u_terrain),u_terrain_dim:new e.aI(nr,or.u_terrain_dim),u_terrain_matrix:new e.aJ(nr,or.u_terrain_matrix),u_terrain_unpack:new e.aK(nr,or.u_terrain_unpack),u_terrain_exaggeration:new e.aI(nr,or.u_terrain_exaggeration)}))(P,Xe),this.binderUniforms=_t?_t.getUniforms(P,Xe):[]}draw(P,at,_t,Tt,Pt,ie,de,Ee,He,ar,ir,zr,Zr,Rt,Gt,ne,oe,be){let pe=P.gl;if(this.failedToCreate)return;if(P.program.set(this.program),P.setDepthMode(_t),P.setStencilMode(Tt),P.setColorMode(Pt),P.setCullFace(ie),Ee){P.activeTexture.set(pe.TEXTURE2),pe.bindTexture(pe.TEXTURE_2D,Ee.depthTexture),P.activeTexture.set(pe.TEXTURE3),pe.bindTexture(pe.TEXTURE_2D,Ee.texture);for(let Xe in this.terrainUniforms)this.terrainUniforms[Xe].set(Ee[Xe])}for(let Xe in this.fixedUniforms)this.fixedUniforms[Xe].set(de[Xe]);Gt&&Gt.setUniforms(P,this.binderUniforms,Zr,{zoom:Rt});let Ae=0;switch(at){case pe.LINES:Ae=2;break;case pe.TRIANGLES:Ae=3;break;case pe.LINE_STRIP:Ae=1}for(let Xe of zr.get()){let nr=Xe.vaos||(Xe.vaos={});(nr[He]||(nr[He]=new Je)).bind(P,this,ar,Gt?Gt.getPaintVertexBuffers():[],ir,Xe.vertexOffset,ne,oe,be),pe.drawElements(at,Xe.primitiveLength*Ae,pe.UNSIGNED_SHORT,Xe.primitiveOffset*Ae*2)}}}function En(Lt,P,at){let _t=1/an(at,1,P.transform.tileZoom),Tt=Math.pow(2,at.tileID.overscaledZ),Pt=at.tileSize*Math.pow(2,P.transform.tileZoom)/Tt,ie=Pt*(at.tileID.canonical.x+at.tileID.wrap*Tt),de=Pt*at.tileID.canonical.y;return{u_image:0,u_texsize:at.imageAtlasTexture.size,u_scale:[_t,Lt.fromScale,Lt.toScale],u_fade:Lt.t,u_pixel_coord_upper:[ie>>16,de>>16],u_pixel_coord_lower:[65535&ie,65535&de]}}let dn=(Lt,P,at,_t)=>{let Tt=P.style.light,Pt=Tt.properties.get("position"),ie=[Pt.x,Pt.y,Pt.z],de=function(){var He=new e.A(9);return e.A!=Float32Array&&(He[1]=0,He[2]=0,He[3]=0,He[5]=0,He[6]=0,He[7]=0),He[0]=1,He[4]=1,He[8]=1,He}();Tt.properties.get("anchor")==="viewport"&&function(He,ar){var ir=Math.sin(ar),zr=Math.cos(ar);He[0]=zr,He[1]=ir,He[2]=0,He[3]=-ir,He[4]=zr,He[5]=0,He[6]=0,He[7]=0,He[8]=1}(de,-P.transform.angle),function(He,ar,ir){var zr=ar[0],Zr=ar[1],Rt=ar[2];He[0]=zr*ir[0]+Zr*ir[3]+Rt*ir[6],He[1]=zr*ir[1]+Zr*ir[4]+Rt*ir[7],He[2]=zr*ir[2]+Zr*ir[5]+Rt*ir[8]}(ie,ie,de);let Ee=Tt.properties.get("color");return{u_matrix:Lt,u_lightpos:ie,u_lightintensity:Tt.properties.get("intensity"),u_lightcolor:[Ee.r,Ee.g,Ee.b],u_vertical_gradient:+at,u_opacity:_t}},Kr=(Lt,P,at,_t,Tt,Pt,ie)=>e.e(dn(Lt,P,at,_t),En(Pt,P,ie),{u_height_factor:-Math.pow(2,Tt.overscaledZ)/ie.tileSize/8}),Tn=Lt=>({u_matrix:Lt}),ta=(Lt,P,at,_t)=>e.e(Tn(Lt),En(at,P,_t)),Qn=(Lt,P)=>({u_matrix:Lt,u_world:P}),Va=(Lt,P,at,_t,Tt)=>e.e(ta(Lt,P,at,_t),{u_world:Tt}),ja=(Lt,P,at,_t)=>{let Tt=Lt.transform,Pt,ie;if(_t.paint.get("circle-pitch-alignment")==="map"){let de=an(at,1,Tt.zoom);Pt=!0,ie=[de,de]}else Pt=!1,ie=Tt.pixelsToGLUnits;return{u_camera_to_center_distance:Tt.cameraToCenterDistance,u_scale_with_map:+(_t.paint.get("circle-pitch-scale")==="map"),u_matrix:Lt.translatePosMatrix(P.posMatrix,at,_t.paint.get("circle-translate"),_t.paint.get("circle-translate-anchor")),u_pitch_with_map:+Pt,u_device_pixel_ratio:Lt.pixelRatio,u_extrude_scale:ie}},ci=(Lt,P,at)=>({u_matrix:Lt,u_inv_matrix:P,u_camera_to_center_distance:at.cameraToCenterDistance,u_viewport_size:[at.width,at.height]}),pi=(Lt,P,at=1)=>({u_matrix:Lt,u_color:P,u_overlay:0,u_overlay_scale:at}),bi=Lt=>({u_matrix:Lt}),ri=(Lt,P,at,_t)=>({u_matrix:Lt,u_extrude_scale:an(P,1,at),u_intensity:_t}),Da=(Lt,P,at,_t)=>{let Tt=e.H();e.aP(Tt,0,Lt.width,Lt.height,0,0,1);let Pt=Lt.context.gl;return{u_matrix:Tt,u_world:[Pt.drawingBufferWidth,Pt.drawingBufferHeight],u_image:at,u_color_ramp:_t,u_opacity:P.paint.get("heatmap-opacity")}};function Ui(Lt,P){let at=Math.pow(2,P.canonical.z),_t=P.canonical.y;return[new e.Z(0,_t/at).toLngLat().lat,new e.Z(0,(_t+1)/at).toLngLat().lat]}let lo=(Lt,P,at,_t)=>{let Tt=Lt.transform;return{u_matrix:Si(Lt,P,at,_t),u_ratio:1/an(P,1,Tt.zoom),u_device_pixel_ratio:Lt.pixelRatio,u_units_to_pixels:[1/Tt.pixelsToGLUnits[0],1/Tt.pixelsToGLUnits[1]]}},Co=(Lt,P,at,_t,Tt)=>e.e(lo(Lt,P,at,Tt),{u_image:0,u_image_height:_t}),Bo=(Lt,P,at,_t,Tt)=>{let Pt=Lt.transform,ie=yi(P,Pt);return{u_matrix:Si(Lt,P,at,Tt),u_texsize:P.imageAtlasTexture.size,u_ratio:1/an(P,1,Pt.zoom),u_device_pixel_ratio:Lt.pixelRatio,u_image:0,u_scale:[ie,_t.fromScale,_t.toScale],u_fade:_t.t,u_units_to_pixels:[1/Pt.pixelsToGLUnits[0],1/Pt.pixelsToGLUnits[1]]}},ai=(Lt,P,at,_t,Tt,Pt)=>{let ie=Lt.lineAtlas,de=yi(P,Lt.transform),Ee=at.layout.get("line-cap")==="round",He=ie.getDash(_t.from,Ee),ar=ie.getDash(_t.to,Ee),ir=He.width*Tt.fromScale,zr=ar.width*Tt.toScale;return e.e(lo(Lt,P,at,Pt),{u_patternscale_a:[de/ir,-He.height/2],u_patternscale_b:[de/zr,-ar.height/2],u_sdfgamma:ie.width/(256*Math.min(ir,zr)*Lt.pixelRatio)/2,u_image:0,u_tex_y_a:He.y,u_tex_y_b:ar.y,u_mix:Tt.t})};function yi(Lt,P){return 1/an(Lt,1,P.tileZoom)}function Si(Lt,P,at,_t){return Lt.translatePosMatrix(_t?_t.posMatrix:P.tileID.posMatrix,P,at.paint.get("line-translate"),at.paint.get("line-translate-anchor"))}let ko=(Lt,P,at,_t,Tt)=>{return{u_matrix:Lt,u_tl_parent:P,u_scale_parent:at,u_buffer_scale:1,u_fade_t:_t.mix,u_opacity:_t.opacity*Tt.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Tt.paint.get("raster-brightness-min"),u_brightness_high:Tt.paint.get("raster-brightness-max"),u_saturation_factor:(ie=Tt.paint.get("raster-saturation"),ie>0?1-1/(1.001-ie):-ie),u_contrast_factor:(Pt=Tt.paint.get("raster-contrast"),Pt>0?1/(1-Pt):1+Pt),u_spin_weights:Ao(Tt.paint.get("raster-hue-rotate"))};var Pt,ie};function Ao(Lt){Lt*=Math.PI/180;let P=Math.sin(Lt),at=Math.cos(Lt);return[(2*at+1)/3,(-Math.sqrt(3)*P-at+1)/3,(Math.sqrt(3)*P-at+1)/3]}let Do=(Lt,P,at,_t,Tt,Pt,ie,de,Ee,He,ar,ir,zr,Zr)=>{let Rt=ie.transform;return{u_is_size_zoom_constant:+(Lt==="constant"||Lt==="source"),u_is_size_feature_constant:+(Lt==="constant"||Lt==="camera"),u_size_t:P?P.uSizeT:0,u_size:P?P.uSize:0,u_camera_to_center_distance:Rt.cameraToCenterDistance,u_pitch:Rt.pitch/360*2*Math.PI,u_rotate_symbol:+at,u_aspect_ratio:Rt.width/Rt.height,u_fade_change:ie.options.fadeDuration?ie.symbolFadeChange:1,u_matrix:de,u_label_plane_matrix:Ee,u_coord_matrix:He,u_is_text:+ir,u_pitch_with_map:+_t,u_is_along_line:Tt,u_is_variable_anchor:Pt,u_texsize:zr,u_texture:0,u_translation:ar,u_pitched_scale:Zr}},Pi=(Lt,P,at,_t,Tt,Pt,ie,de,Ee,He,ar,ir,zr,Zr,Rt)=>{let Gt=ie.transform;return e.e(Do(Lt,P,at,_t,Tt,Pt,ie,de,Ee,He,ar,ir,zr,Rt),{u_gamma_scale:_t?Math.cos(Gt._pitch)*Gt.cameraToCenterDistance:1,u_device_pixel_ratio:ie.pixelRatio,u_is_halo:+Zr})},Yi=(Lt,P,at,_t,Tt,Pt,ie,de,Ee,He,ar,ir,zr,Zr)=>e.e(Pi(Lt,P,at,_t,Tt,Pt,ie,de,Ee,He,ar,!0,ir,!0,Zr),{u_texsize_icon:zr,u_texture_icon:1}),vs=(Lt,P,at)=>({u_matrix:Lt,u_opacity:P,u_color:at}),es=(Lt,P,at,_t,Tt,Pt)=>e.e(function(ie,de,Ee,He){let ar=Ee.imageManager.getPattern(ie.from.toString()),ir=Ee.imageManager.getPattern(ie.to.toString()),{width:zr,height:Zr}=Ee.imageManager.getPixelSize(),Rt=Math.pow(2,He.tileID.overscaledZ),Gt=He.tileSize*Math.pow(2,Ee.transform.tileZoom)/Rt,ne=Gt*(He.tileID.canonical.x+He.tileID.wrap*Rt),oe=Gt*He.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:ar.tl,u_pattern_br_a:ar.br,u_pattern_tl_b:ir.tl,u_pattern_br_b:ir.br,u_texsize:[zr,Zr],u_mix:de.t,u_pattern_size_a:ar.displaySize,u_pattern_size_b:ir.displaySize,u_scale_a:de.fromScale,u_scale_b:de.toScale,u_tile_units_to_pixels:1/an(He,1,Ee.transform.tileZoom),u_pixel_coord_upper:[ne>>16,oe>>16],u_pixel_coord_lower:[65535&ne,65535&oe]}}(_t,Pt,at,Tt),{u_matrix:Lt,u_opacity:P}),ls={fillExtrusion:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_lightpos:new e.aN(Lt,P.u_lightpos),u_lightintensity:new e.aI(Lt,P.u_lightintensity),u_lightcolor:new e.aN(Lt,P.u_lightcolor),u_vertical_gradient:new e.aI(Lt,P.u_vertical_gradient),u_opacity:new e.aI(Lt,P.u_opacity)}),fillExtrusionPattern:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_lightpos:new e.aN(Lt,P.u_lightpos),u_lightintensity:new e.aI(Lt,P.u_lightintensity),u_lightcolor:new e.aN(Lt,P.u_lightcolor),u_vertical_gradient:new e.aI(Lt,P.u_vertical_gradient),u_height_factor:new e.aI(Lt,P.u_height_factor),u_image:new e.aH(Lt,P.u_image),u_texsize:new e.aO(Lt,P.u_texsize),u_pixel_coord_upper:new e.aO(Lt,P.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(Lt,P.u_pixel_coord_lower),u_scale:new e.aN(Lt,P.u_scale),u_fade:new e.aI(Lt,P.u_fade),u_opacity:new e.aI(Lt,P.u_opacity)}),fill:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix)}),fillPattern:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_image:new e.aH(Lt,P.u_image),u_texsize:new e.aO(Lt,P.u_texsize),u_pixel_coord_upper:new e.aO(Lt,P.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(Lt,P.u_pixel_coord_lower),u_scale:new e.aN(Lt,P.u_scale),u_fade:new e.aI(Lt,P.u_fade)}),fillOutline:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_world:new e.aO(Lt,P.u_world)}),fillOutlinePattern:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_world:new e.aO(Lt,P.u_world),u_image:new e.aH(Lt,P.u_image),u_texsize:new e.aO(Lt,P.u_texsize),u_pixel_coord_upper:new e.aO(Lt,P.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(Lt,P.u_pixel_coord_lower),u_scale:new e.aN(Lt,P.u_scale),u_fade:new e.aI(Lt,P.u_fade)}),circle:(Lt,P)=>({u_camera_to_center_distance:new e.aI(Lt,P.u_camera_to_center_distance),u_scale_with_map:new e.aH(Lt,P.u_scale_with_map),u_pitch_with_map:new e.aH(Lt,P.u_pitch_with_map),u_extrude_scale:new e.aO(Lt,P.u_extrude_scale),u_device_pixel_ratio:new e.aI(Lt,P.u_device_pixel_ratio),u_matrix:new e.aJ(Lt,P.u_matrix)}),collisionBox:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_pixel_extrude_scale:new e.aO(Lt,P.u_pixel_extrude_scale)}),collisionCircle:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_inv_matrix:new e.aJ(Lt,P.u_inv_matrix),u_camera_to_center_distance:new e.aI(Lt,P.u_camera_to_center_distance),u_viewport_size:new e.aO(Lt,P.u_viewport_size)}),debug:(Lt,P)=>({u_color:new e.aL(Lt,P.u_color),u_matrix:new e.aJ(Lt,P.u_matrix),u_overlay:new e.aH(Lt,P.u_overlay),u_overlay_scale:new e.aI(Lt,P.u_overlay_scale)}),clippingMask:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix)}),heatmap:(Lt,P)=>({u_extrude_scale:new e.aI(Lt,P.u_extrude_scale),u_intensity:new e.aI(Lt,P.u_intensity),u_matrix:new e.aJ(Lt,P.u_matrix)}),heatmapTexture:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_world:new e.aO(Lt,P.u_world),u_image:new e.aH(Lt,P.u_image),u_color_ramp:new e.aH(Lt,P.u_color_ramp),u_opacity:new e.aI(Lt,P.u_opacity)}),hillshade:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_image:new e.aH(Lt,P.u_image),u_latrange:new e.aO(Lt,P.u_latrange),u_light:new e.aO(Lt,P.u_light),u_shadow:new e.aL(Lt,P.u_shadow),u_highlight:new e.aL(Lt,P.u_highlight),u_accent:new e.aL(Lt,P.u_accent)}),hillshadePrepare:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_image:new e.aH(Lt,P.u_image),u_dimension:new e.aO(Lt,P.u_dimension),u_zoom:new e.aI(Lt,P.u_zoom),u_unpack:new e.aK(Lt,P.u_unpack)}),line:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_ratio:new e.aI(Lt,P.u_ratio),u_device_pixel_ratio:new e.aI(Lt,P.u_device_pixel_ratio),u_units_to_pixels:new e.aO(Lt,P.u_units_to_pixels)}),lineGradient:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_ratio:new e.aI(Lt,P.u_ratio),u_device_pixel_ratio:new e.aI(Lt,P.u_device_pixel_ratio),u_units_to_pixels:new e.aO(Lt,P.u_units_to_pixels),u_image:new e.aH(Lt,P.u_image),u_image_height:new e.aI(Lt,P.u_image_height)}),linePattern:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_texsize:new e.aO(Lt,P.u_texsize),u_ratio:new e.aI(Lt,P.u_ratio),u_device_pixel_ratio:new e.aI(Lt,P.u_device_pixel_ratio),u_image:new e.aH(Lt,P.u_image),u_units_to_pixels:new e.aO(Lt,P.u_units_to_pixels),u_scale:new e.aN(Lt,P.u_scale),u_fade:new e.aI(Lt,P.u_fade)}),lineSDF:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_ratio:new e.aI(Lt,P.u_ratio),u_device_pixel_ratio:new e.aI(Lt,P.u_device_pixel_ratio),u_units_to_pixels:new e.aO(Lt,P.u_units_to_pixels),u_patternscale_a:new e.aO(Lt,P.u_patternscale_a),u_patternscale_b:new e.aO(Lt,P.u_patternscale_b),u_sdfgamma:new e.aI(Lt,P.u_sdfgamma),u_image:new e.aH(Lt,P.u_image),u_tex_y_a:new e.aI(Lt,P.u_tex_y_a),u_tex_y_b:new e.aI(Lt,P.u_tex_y_b),u_mix:new e.aI(Lt,P.u_mix)}),raster:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_tl_parent:new e.aO(Lt,P.u_tl_parent),u_scale_parent:new e.aI(Lt,P.u_scale_parent),u_buffer_scale:new e.aI(Lt,P.u_buffer_scale),u_fade_t:new e.aI(Lt,P.u_fade_t),u_opacity:new e.aI(Lt,P.u_opacity),u_image0:new e.aH(Lt,P.u_image0),u_image1:new e.aH(Lt,P.u_image1),u_brightness_low:new e.aI(Lt,P.u_brightness_low),u_brightness_high:new e.aI(Lt,P.u_brightness_high),u_saturation_factor:new e.aI(Lt,P.u_saturation_factor),u_contrast_factor:new e.aI(Lt,P.u_contrast_factor),u_spin_weights:new e.aN(Lt,P.u_spin_weights)}),symbolIcon:(Lt,P)=>({u_is_size_zoom_constant:new e.aH(Lt,P.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(Lt,P.u_is_size_feature_constant),u_size_t:new e.aI(Lt,P.u_size_t),u_size:new e.aI(Lt,P.u_size),u_camera_to_center_distance:new e.aI(Lt,P.u_camera_to_center_distance),u_pitch:new e.aI(Lt,P.u_pitch),u_rotate_symbol:new e.aH(Lt,P.u_rotate_symbol),u_aspect_ratio:new e.aI(Lt,P.u_aspect_ratio),u_fade_change:new e.aI(Lt,P.u_fade_change),u_matrix:new e.aJ(Lt,P.u_matrix),u_label_plane_matrix:new e.aJ(Lt,P.u_label_plane_matrix),u_coord_matrix:new e.aJ(Lt,P.u_coord_matrix),u_is_text:new e.aH(Lt,P.u_is_text),u_pitch_with_map:new e.aH(Lt,P.u_pitch_with_map),u_is_along_line:new e.aH(Lt,P.u_is_along_line),u_is_variable_anchor:new e.aH(Lt,P.u_is_variable_anchor),u_texsize:new e.aO(Lt,P.u_texsize),u_texture:new e.aH(Lt,P.u_texture),u_translation:new e.aO(Lt,P.u_translation),u_pitched_scale:new e.aI(Lt,P.u_pitched_scale)}),symbolSDF:(Lt,P)=>({u_is_size_zoom_constant:new e.aH(Lt,P.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(Lt,P.u_is_size_feature_constant),u_size_t:new e.aI(Lt,P.u_size_t),u_size:new e.aI(Lt,P.u_size),u_camera_to_center_distance:new e.aI(Lt,P.u_camera_to_center_distance),u_pitch:new e.aI(Lt,P.u_pitch),u_rotate_symbol:new e.aH(Lt,P.u_rotate_symbol),u_aspect_ratio:new e.aI(Lt,P.u_aspect_ratio),u_fade_change:new e.aI(Lt,P.u_fade_change),u_matrix:new e.aJ(Lt,P.u_matrix),u_label_plane_matrix:new e.aJ(Lt,P.u_label_plane_matrix),u_coord_matrix:new e.aJ(Lt,P.u_coord_matrix),u_is_text:new e.aH(Lt,P.u_is_text),u_pitch_with_map:new e.aH(Lt,P.u_pitch_with_map),u_is_along_line:new e.aH(Lt,P.u_is_along_line),u_is_variable_anchor:new e.aH(Lt,P.u_is_variable_anchor),u_texsize:new e.aO(Lt,P.u_texsize),u_texture:new e.aH(Lt,P.u_texture),u_gamma_scale:new e.aI(Lt,P.u_gamma_scale),u_device_pixel_ratio:new e.aI(Lt,P.u_device_pixel_ratio),u_is_halo:new e.aH(Lt,P.u_is_halo),u_translation:new e.aO(Lt,P.u_translation),u_pitched_scale:new e.aI(Lt,P.u_pitched_scale)}),symbolTextAndIcon:(Lt,P)=>({u_is_size_zoom_constant:new e.aH(Lt,P.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(Lt,P.u_is_size_feature_constant),u_size_t:new e.aI(Lt,P.u_size_t),u_size:new e.aI(Lt,P.u_size),u_camera_to_center_distance:new e.aI(Lt,P.u_camera_to_center_distance),u_pitch:new e.aI(Lt,P.u_pitch),u_rotate_symbol:new e.aH(Lt,P.u_rotate_symbol),u_aspect_ratio:new e.aI(Lt,P.u_aspect_ratio),u_fade_change:new e.aI(Lt,P.u_fade_change),u_matrix:new e.aJ(Lt,P.u_matrix),u_label_plane_matrix:new e.aJ(Lt,P.u_label_plane_matrix),u_coord_matrix:new e.aJ(Lt,P.u_coord_matrix),u_is_text:new e.aH(Lt,P.u_is_text),u_pitch_with_map:new e.aH(Lt,P.u_pitch_with_map),u_is_along_line:new e.aH(Lt,P.u_is_along_line),u_is_variable_anchor:new e.aH(Lt,P.u_is_variable_anchor),u_texsize:new e.aO(Lt,P.u_texsize),u_texsize_icon:new e.aO(Lt,P.u_texsize_icon),u_texture:new e.aH(Lt,P.u_texture),u_texture_icon:new e.aH(Lt,P.u_texture_icon),u_gamma_scale:new e.aI(Lt,P.u_gamma_scale),u_device_pixel_ratio:new e.aI(Lt,P.u_device_pixel_ratio),u_is_halo:new e.aH(Lt,P.u_is_halo),u_translation:new e.aO(Lt,P.u_translation),u_pitched_scale:new e.aI(Lt,P.u_pitched_scale)}),background:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_opacity:new e.aI(Lt,P.u_opacity),u_color:new e.aL(Lt,P.u_color)}),backgroundPattern:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_opacity:new e.aI(Lt,P.u_opacity),u_image:new e.aH(Lt,P.u_image),u_pattern_tl_a:new e.aO(Lt,P.u_pattern_tl_a),u_pattern_br_a:new e.aO(Lt,P.u_pattern_br_a),u_pattern_tl_b:new e.aO(Lt,P.u_pattern_tl_b),u_pattern_br_b:new e.aO(Lt,P.u_pattern_br_b),u_texsize:new e.aO(Lt,P.u_texsize),u_mix:new e.aI(Lt,P.u_mix),u_pattern_size_a:new e.aO(Lt,P.u_pattern_size_a),u_pattern_size_b:new e.aO(Lt,P.u_pattern_size_b),u_scale_a:new e.aI(Lt,P.u_scale_a),u_scale_b:new e.aI(Lt,P.u_scale_b),u_pixel_coord_upper:new e.aO(Lt,P.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(Lt,P.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aI(Lt,P.u_tile_units_to_pixels)}),terrain:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_texture:new e.aH(Lt,P.u_texture),u_ele_delta:new e.aI(Lt,P.u_ele_delta),u_fog_matrix:new e.aJ(Lt,P.u_fog_matrix),u_fog_color:new e.aL(Lt,P.u_fog_color),u_fog_ground_blend:new e.aI(Lt,P.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aI(Lt,P.u_fog_ground_blend_opacity),u_horizon_color:new e.aL(Lt,P.u_horizon_color),u_horizon_fog_blend:new e.aI(Lt,P.u_horizon_fog_blend)}),terrainDepth:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_ele_delta:new e.aI(Lt,P.u_ele_delta)}),terrainCoords:(Lt,P)=>({u_matrix:new e.aJ(Lt,P.u_matrix),u_texture:new e.aH(Lt,P.u_texture),u_terrain_coords_id:new e.aI(Lt,P.u_terrain_coords_id),u_ele_delta:new e.aI(Lt,P.u_ele_delta)}),sky:(Lt,P)=>({u_sky_color:new e.aL(Lt,P.u_sky_color),u_horizon_color:new e.aL(Lt,P.u_horizon_color),u_horizon:new e.aI(Lt,P.u_horizon),u_sky_horizon_blend:new e.aI(Lt,P.u_sky_horizon_blend)})};class Xi{constructor(P,at,_t){this.context=P;let Tt=P.gl;this.buffer=Tt.createBuffer(),this.dynamicDraw=!!_t,this.context.unbindVAO(),P.bindElementBuffer.set(this.buffer),Tt.bufferData(Tt.ELEMENT_ARRAY_BUFFER,at.arrayBuffer,this.dynamicDraw?Tt.DYNAMIC_DRAW:Tt.STATIC_DRAW),this.dynamicDraw||delete at.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(P){let at=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),at.bufferSubData(at.ELEMENT_ARRAY_BUFFER,0,P.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let ga={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Xa{constructor(P,at,_t,Tt){this.length=at.length,this.attributes=_t,this.itemSize=at.bytesPerElement,this.dynamicDraw=Tt,this.context=P;let Pt=P.gl;this.buffer=Pt.createBuffer(),P.bindVertexBuffer.set(this.buffer),Pt.bufferData(Pt.ARRAY_BUFFER,at.arrayBuffer,this.dynamicDraw?Pt.DYNAMIC_DRAW:Pt.STATIC_DRAW),this.dynamicDraw||delete at.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(P){if(P.length!==this.length)throw new Error(`Length of new data is ${P.length}, which doesn't match current length of ${this.length}`);let at=this.context.gl;this.bind(),at.bufferSubData(at.ARRAY_BUFFER,0,P.arrayBuffer)}enableAttributes(P,at){for(let _t=0;_t<this.attributes.length;_t++){let Tt=at.attributes[this.attributes[_t].name];Tt!==void 0&&P.enableVertexAttribArray(Tt)}}setVertexAttribPointers(P,at,_t){for(let Tt=0;Tt<this.attributes.length;Tt++){let Pt=this.attributes[Tt],ie=at.attributes[Pt.name];ie!==void 0&&P.vertexAttribPointer(ie,Pt.components,P[ga[Pt.type]],!1,this.itemSize,Pt.offset+this.itemSize*(_t||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Ls=new WeakMap;function fs(Lt){var P;if(Ls.has(Lt))return Ls.get(Lt);{let at=(P=Lt.getParameter(Lt.VERSION))===null||P===void 0?void 0:P.startsWith("WebGL 2.0");return Ls.set(Lt,at),at}}class qi{constructor(P){this.gl=P.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(P){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class ms extends qi{getDefault(){return e.aM.transparent}set(P){let at=this.current;(P.r!==at.r||P.g!==at.g||P.b!==at.b||P.a!==at.a||this.dirty)&&(this.gl.clearColor(P.r,P.g,P.b,P.a),this.current=P,this.dirty=!1)}}class Po extends qi{getDefault(){return 1}set(P){(P!==this.current||this.dirty)&&(this.gl.clearDepth(P),this.current=P,this.dirty=!1)}}class rs extends qi{getDefault(){return 0}set(P){(P!==this.current||this.dirty)&&(this.gl.clearStencil(P),this.current=P,this.dirty=!1)}}class hl extends qi{getDefault(){return[!0,!0,!0,!0]}set(P){let at=this.current;(P[0]!==at[0]||P[1]!==at[1]||P[2]!==at[2]||P[3]!==at[3]||this.dirty)&&(this.gl.colorMask(P[0],P[1],P[2],P[3]),this.current=P,this.dirty=!1)}}class za extends qi{getDefault(){return!0}set(P){(P!==this.current||this.dirty)&&(this.gl.depthMask(P),this.current=P,this.dirty=!1)}}class Oi extends qi{getDefault(){return 255}set(P){(P!==this.current||this.dirty)&&(this.gl.stencilMask(P),this.current=P,this.dirty=!1)}}class Bi extends qi{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(P){let at=this.current;(P.func!==at.func||P.ref!==at.ref||P.mask!==at.mask||this.dirty)&&(this.gl.stencilFunc(P.func,P.ref,P.mask),this.current=P,this.dirty=!1)}}class Ro extends qi{getDefault(){let P=this.gl;return[P.KEEP,P.KEEP,P.KEEP]}set(P){let at=this.current;(P[0]!==at[0]||P[1]!==at[1]||P[2]!==at[2]||this.dirty)&&(this.gl.stencilOp(P[0],P[1],P[2]),this.current=P,this.dirty=!1)}}class Fo extends qi{getDefault(){return!1}set(P){if(P===this.current&&!this.dirty)return;let at=this.gl;P?at.enable(at.STENCIL_TEST):at.disable(at.STENCIL_TEST),this.current=P,this.dirty=!1}}class Ci extends qi{getDefault(){return[0,1]}set(P){let at=this.current;(P[0]!==at[0]||P[1]!==at[1]||this.dirty)&&(this.gl.depthRange(P[0],P[1]),this.current=P,this.dirty=!1)}}class fl extends qi{getDefault(){return!1}set(P){if(P===this.current&&!this.dirty)return;let at=this.gl;P?at.enable(at.DEPTH_TEST):at.disable(at.DEPTH_TEST),this.current=P,this.dirty=!1}}class ql extends qi{getDefault(){return this.gl.LESS}set(P){(P!==this.current||this.dirty)&&(this.gl.depthFunc(P),this.current=P,this.dirty=!1)}}class Zs extends qi{getDefault(){return!1}set(P){if(P===this.current&&!this.dirty)return;let at=this.gl;P?at.enable(at.BLEND):at.disable(at.BLEND),this.current=P,this.dirty=!1}}class Hl extends qi{getDefault(){let P=this.gl;return[P.ONE,P.ZERO]}set(P){let at=this.current;(P[0]!==at[0]||P[1]!==at[1]||this.dirty)&&(this.gl.blendFunc(P[0],P[1]),this.current=P,this.dirty=!1)}}class Us extends qi{getDefault(){return e.aM.transparent}set(P){let at=this.current;(P.r!==at.r||P.g!==at.g||P.b!==at.b||P.a!==at.a||this.dirty)&&(this.gl.blendColor(P.r,P.g,P.b,P.a),this.current=P,this.dirty=!1)}}class Es extends qi{getDefault(){return this.gl.FUNC_ADD}set(P){(P!==this.current||this.dirty)&&(this.gl.blendEquation(P),this.current=P,this.dirty=!1)}}class El extends qi{getDefault(){return!1}set(P){if(P===this.current&&!this.dirty)return;let at=this.gl;P?at.enable(at.CULL_FACE):at.disable(at.CULL_FACE),this.current=P,this.dirty=!1}}class Wu extends qi{getDefault(){return this.gl.BACK}set(P){(P!==this.current||this.dirty)&&(this.gl.cullFace(P),this.current=P,this.dirty=!1)}}class Mu extends qi{getDefault(){return this.gl.CCW}set(P){(P!==this.current||this.dirty)&&(this.gl.frontFace(P),this.current=P,this.dirty=!1)}}class Fu extends qi{getDefault(){return null}set(P){(P!==this.current||this.dirty)&&(this.gl.useProgram(P),this.current=P,this.dirty=!1)}}class _h extends qi{getDefault(){return this.gl.TEXTURE0}set(P){(P!==this.current||this.dirty)&&(this.gl.activeTexture(P),this.current=P,this.dirty=!1)}}class ih extends qi{getDefault(){let P=this.gl;return[0,0,P.drawingBufferWidth,P.drawingBufferHeight]}set(P){let at=this.current;(P[0]!==at[0]||P[1]!==at[1]||P[2]!==at[2]||P[3]!==at[3]||this.dirty)&&(this.gl.viewport(P[0],P[1],P[2],P[3]),this.current=P,this.dirty=!1)}}class ns extends qi{getDefault(){return null}set(P){if(P===this.current&&!this.dirty)return;let at=this.gl;at.bindFramebuffer(at.FRAMEBUFFER,P),this.current=P,this.dirty=!1}}class du extends qi{getDefault(){return null}set(P){if(P===this.current&&!this.dirty)return;let at=this.gl;at.bindRenderbuffer(at.RENDERBUFFER,P),this.current=P,this.dirty=!1}}class Ic extends qi{getDefault(){return null}set(P){if(P===this.current&&!this.dirty)return;let at=this.gl;at.bindTexture(at.TEXTURE_2D,P),this.current=P,this.dirty=!1}}class ll extends qi{getDefault(){return null}set(P){if(P===this.current&&!this.dirty)return;let at=this.gl;at.bindBuffer(at.ARRAY_BUFFER,P),this.current=P,this.dirty=!1}}class el extends qi{getDefault(){return null}set(P){let at=this.gl;at.bindBuffer(at.ELEMENT_ARRAY_BUFFER,P),this.current=P,this.dirty=!1}}class ul extends qi{getDefault(){return null}set(P){var at;if(P===this.current&&!this.dirty)return;let _t=this.gl;fs(_t)?_t.bindVertexArray(P):(at=_t.getExtension("OES_vertex_array_object"))===null||at===void 0||at.bindVertexArrayOES(P),this.current=P,this.dirty=!1}}class Zu extends qi{getDefault(){return 4}set(P){if(P===this.current&&!this.dirty)return;let at=this.gl;at.pixelStorei(at.UNPACK_ALIGNMENT,P),this.current=P,this.dirty=!1}}class ys extends qi{getDefault(){return!1}set(P){if(P===this.current&&!this.dirty)return;let at=this.gl;at.pixelStorei(at.UNPACK_PREMULTIPLY_ALPHA_WEBGL,P),this.current=P,this.dirty=!1}}class pl extends qi{getDefault(){return!1}set(P){if(P===this.current&&!this.dirty)return;let at=this.gl;at.pixelStorei(at.UNPACK_FLIP_Y_WEBGL,P),this.current=P,this.dirty=!1}}class $o extends qi{constructor(P,at){super(P),this.context=P,this.parent=at}getDefault(){return null}}class ks extends $o{setDirty(){this.dirty=!0}set(P){if(P===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let at=this.gl;at.framebufferTexture2D(at.FRAMEBUFFER,at.COLOR_ATTACHMENT0,at.TEXTURE_2D,P,0),this.current=P,this.dirty=!1}}class Bu extends $o{set(P){if(P===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let at=this.gl;at.framebufferRenderbuffer(at.FRAMEBUFFER,at.DEPTH_ATTACHMENT,at.RENDERBUFFER,P),this.current=P,this.dirty=!1}}class Ol extends $o{set(P){if(P===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let at=this.gl;at.framebufferRenderbuffer(at.FRAMEBUFFER,at.DEPTH_STENCIL_ATTACHMENT,at.RENDERBUFFER,P),this.current=P,this.dirty=!1}}class Xu{constructor(P,at,_t,Tt,Pt){this.context=P,this.width=at,this.height=_t;let ie=P.gl,de=this.framebuffer=ie.createFramebuffer();if(this.colorAttachment=new ks(P,de),Tt)this.depthAttachment=Pt?new Ol(P,de):new Bu(P,de);else if(Pt)throw new Error("Stencil cannot be set without depth");if(ie.checkFramebufferStatus(ie.FRAMEBUFFER)!==ie.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){let P=this.context.gl,at=this.colorAttachment.get();if(at&&P.deleteTexture(at),this.depthAttachment){let _t=this.depthAttachment.get();_t&&P.deleteRenderbuffer(_t)}P.deleteFramebuffer(this.framebuffer)}}class Cs{constructor(P,at,_t){this.blendFunction=P,this.blendColor=at,this.mask=_t}}Cs.Replace=[1,0],Cs.disabled=new Cs(Cs.Replace,e.aM.transparent,[!1,!1,!1,!1]),Cs.unblended=new Cs(Cs.Replace,e.aM.transparent,[!0,!0,!0,!0]),Cs.alphaBlended=new Cs([1,771],e.aM.transparent,[!0,!0,!0,!0]);class zh{constructor(P){var at,_t;if(this.gl=P,this.clearColor=new ms(this),this.clearDepth=new Po(this),this.clearStencil=new rs(this),this.colorMask=new hl(this),this.depthMask=new za(this),this.stencilMask=new Oi(this),this.stencilFunc=new Bi(this),this.stencilOp=new Ro(this),this.stencilTest=new Fo(this),this.depthRange=new Ci(this),this.depthTest=new fl(this),this.depthFunc=new ql(this),this.blend=new Zs(this),this.blendFunc=new Hl(this),this.blendColor=new Us(this),this.blendEquation=new Es(this),this.cullFace=new El(this),this.cullFaceSide=new Wu(this),this.frontFace=new Mu(this),this.program=new Fu(this),this.activeTexture=new _h(this),this.viewport=new ih(this),this.bindFramebuffer=new ns(this),this.bindRenderbuffer=new du(this),this.bindTexture=new Ic(this),this.bindVertexBuffer=new ll(this),this.bindElementBuffer=new el(this),this.bindVertexArray=new ul(this),this.pixelStoreUnpack=new Zu(this),this.pixelStoreUnpackPremultiplyAlpha=new ys(this),this.pixelStoreUnpackFlipY=new pl(this),this.extTextureFilterAnisotropic=P.getExtension("EXT_texture_filter_anisotropic")||P.getExtension("MOZ_EXT_texture_filter_anisotropic")||P.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=P.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=P.getParameter(P.MAX_TEXTURE_SIZE),fs(P)){this.HALF_FLOAT=P.HALF_FLOAT;let Tt=P.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(at=P.RGBA16F)!==null&&at!==void 0?at:Tt?.RGBA16F_EXT,this.RGB16F=(_t=P.RGB16F)!==null&&_t!==void 0?_t:Tt?.RGB16F_EXT,P.getExtension("EXT_color_buffer_float")}else{P.getExtension("EXT_color_buffer_half_float"),P.getExtension("OES_texture_half_float_linear");let Tt=P.getExtension("OES_texture_half_float");this.HALF_FLOAT=Tt?.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(P,at){return new Xi(this,P,at)}createVertexBuffer(P,at,_t){return new Xa(this,P,at,_t)}createRenderbuffer(P,at,_t){let Tt=this.gl,Pt=Tt.createRenderbuffer();return this.bindRenderbuffer.set(Pt),Tt.renderbufferStorage(Tt.RENDERBUFFER,P,at,_t),this.bindRenderbuffer.set(null),Pt}createFramebuffer(P,at,_t,Tt){return new Xu(this,P,at,_t,Tt)}clear({color:P,depth:at,stencil:_t}){let Tt=this.gl,Pt=0;P&&(Pt|=Tt.COLOR_BUFFER_BIT,this.clearColor.set(P),this.colorMask.set([!0,!0,!0,!0])),at!==void 0&&(Pt|=Tt.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(at),this.depthMask.set(!0)),_t!==void 0&&(Pt|=Tt.STENCIL_BUFFER_BIT,this.clearStencil.set(_t),this.stencilMask.set(255)),Tt.clear(Pt)}setCullFace(P){P.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(P.mode),this.frontFace.set(P.frontFace))}setDepthMode(P){P.func!==this.gl.ALWAYS||P.mask?(this.depthTest.set(!0),this.depthFunc.set(P.func),this.depthMask.set(P.mask),this.depthRange.set(P.range)):this.depthTest.set(!1)}setStencilMode(P){P.test.func!==this.gl.ALWAYS||P.mask?(this.stencilTest.set(!0),this.stencilMask.set(P.mask),this.stencilOp.set([P.fail,P.depthFail,P.pass]),this.stencilFunc.set({func:P.test.func,ref:P.ref,mask:P.test.mask})):this.stencilTest.set(!1)}setColorMode(P){e.aE(P.blendFunction,Cs.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(P.blendFunction),this.blendColor.set(P.blendColor)),this.colorMask.set(P.mask)}createVertexArray(){var P;return fs(this.gl)?this.gl.createVertexArray():(P=this.gl.getExtension("OES_vertex_array_object"))===null||P===void 0?void 0:P.createVertexArrayOES()}deleteVertexArray(P){var at;return fs(this.gl)?this.gl.deleteVertexArray(P):(at=this.gl.getExtension("OES_vertex_array_object"))===null||at===void 0?void 0:at.deleteVertexArrayOES(P)}unbindVAO(){this.bindVertexArray.set(null)}}class Mo{constructor(P,at,_t){this.func=P,this.mask=at,this.range=_t}}Mo.ReadOnly=!1,Mo.ReadWrite=!0,Mo.disabled=new Mo(519,Mo.ReadOnly,[0,1]);let Oh=7680;class as{constructor(P,at,_t,Tt,Pt,ie){this.test=P,this.ref=at,this.mask=_t,this.fail=Tt,this.depthFail=Pt,this.pass=ie}}as.disabled=new as({func:519,mask:0},0,0,Oh,Oh,Oh);class io{constructor(P,at,_t){this.enable=P,this.mode=at,this.frontFace=_t}}let pc;function gu(Lt,P,at,_t,Tt){let Pt=Lt.context,ie=Pt.gl,de=Lt.useProgram("collisionBox"),Ee=[],He=0,ar=0;for(let oe=0;oe<_t.length;oe++){let be=_t[oe],pe=P.getTile(be).getBucket(at);if(!pe)continue;let Ae=Tt?pe.textCollisionBox:pe.iconCollisionBox,Xe=pe.collisionCircleArray;if(Xe.length>0){let nr=e.H();e.aQ(nr,pe.placementInvProjMatrix,Lt.transform.glCoordMatrix),e.aQ(nr,nr,pe.placementViewportMatrix),Ee.push({circleArray:Xe,circleOffset:ar,transform:be.posMatrix,invTransform:nr,coord:be}),He+=Xe.length/4,ar=He}Ae&&de.draw(Pt,ie.LINES,Mo.disabled,as.disabled,Lt.colorModeForRenderPass(),io.disabled,{u_matrix:be.posMatrix,u_pixel_extrude_scale:[1/(ir=Lt.transform).width,1/ir.height]},Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(be),at.id,Ae.layoutVertexBuffer,Ae.indexBuffer,Ae.segments,null,Lt.transform.zoom,null,null,Ae.collisionVertexBuffer)}var ir;if(!Tt||!Ee.length)return;let zr=Lt.useProgram("collisionCircle"),Zr=new e.aR;Zr.resize(4*He),Zr._trim();let Rt=0;for(let oe of Ee)for(let be=0;be<oe.circleArray.length/4;be++){let pe=4*be,Ae=oe.circleArray[pe+0],Xe=oe.circleArray[pe+1],nr=oe.circleArray[pe+2],or=oe.circleArray[pe+3];Zr.emplace(Rt++,Ae,Xe,nr,or,0),Zr.emplace(Rt++,Ae,Xe,nr,or,1),Zr.emplace(Rt++,Ae,Xe,nr,or,2),Zr.emplace(Rt++,Ae,Xe,nr,or,3)}(!pc||pc.length<2*He)&&(pc=function(oe){let be=2*oe,pe=new e.aT;pe.resize(be),pe._trim();for(let Ae=0;Ae<be;Ae++){let Xe=6*Ae;pe.uint16[Xe+0]=4*Ae+0,pe.uint16[Xe+1]=4*Ae+1,pe.uint16[Xe+2]=4*Ae+2,pe.uint16[Xe+3]=4*Ae+2,pe.uint16[Xe+4]=4*Ae+3,pe.uint16[Xe+5]=4*Ae+0}return pe}(He));let Gt=Pt.createIndexBuffer(pc,!0),ne=Pt.createVertexBuffer(Zr,e.aS.members,!0);for(let oe of Ee){let be=ci(oe.transform,oe.invTransform,Lt.transform);zr.draw(Pt,ie.TRIANGLES,Mo.disabled,as.disabled,Lt.colorModeForRenderPass(),io.disabled,be,Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(oe.coord),at.id,ne,Gt,e.a0.simpleSegment(0,2*oe.circleOffset,oe.circleArray.length,oe.circleArray.length/2),null,Lt.transform.zoom,null,null,null)}ne.destroy(),Gt.destroy()}io.disabled=new io(!1,1029,2305),io.backCCW=new io(!0,1029,2305);let Pl=e.an(new Float32Array(16));function Wc(Lt,P,at,_t,Tt,Pt){let{horizontalAlign:ie,verticalAlign:de}=e.au(Lt);return new e.P((-(ie-.5)*P/Tt+_t[0])*Pt,(-(de-.5)*at/Tt+_t[1])*Pt)}function $u(Lt,P,at,_t,Tt,Pt){let ie=P.tileAnchorPoint.add(new e.P(P.translation[0],P.translation[1]));if(P.pitchWithMap){let de=_t.mult(Pt);at||(de=de.rotate(-Tt));let Ee=ie.add(de);return he(Ee.x,Ee.y,P.labelPlaneMatrix,P.getElevation).point}if(at){let de=ee(P.tileAnchorPoint.x+1,P.tileAnchorPoint.y,P).point.sub(Lt),Ee=Math.atan(de.y/de.x)+(de.x<0?Math.PI:0);return Lt.add(_t.rotate(Ee))}return Lt.add(_t)}function dc(Lt,P,at,_t,Tt,Pt,ie,de,Ee,He,ar,ir,zr,Zr){let Rt=Lt.text.placedSymbolArray,Gt=Lt.text.dynamicLayoutVertexArray,ne=Lt.icon.dynamicLayoutVertexArray,oe={};Gt.clear();for(let be=0;be<Rt.length;be++){let pe=Rt.get(be),Ae=pe.hidden||!pe.crossTileID||Lt.allowVerticalPlacement&&!pe.placedOrientation?null:_t[pe.crossTileID];if(Ae){let Xe=new e.P(pe.anchorX,pe.anchorY),nr={getElevation:Zr,width:Tt.width,height:Tt.height,labelPlaneMatrix:Pt,lineVertexArray:null,pitchWithMap:at,projection:ar,projectionCache:null,tileAnchorPoint:Xe,translation:ir,unwrappedTileID:zr},or=at?he(Xe.x,Xe.y,ie,Zr):ee(Xe.x,Xe.y,nr),Tr=Dt(Tt.cameraToCenterDistance,or.signedDistanceFromCamera),Rr=e.ai(Lt.textSizeData,Ee,pe)*Tr/e.ap;at&&(Rr*=Lt.tilePixelRatio/de);let{width:Qr,height:nn,anchor:mn,textOffset:zn,textBoxScale:na}=Ae,Yn=Wc(mn,Qr,nn,zn,na,Rr),la=ar.getPitchedTextCorrection(Tt,Xe.add(new e.P(ir[0],ir[1])),zr),Na=$u(or.point,nr,P,Yn,Tt.angle,la),li=Lt.allowVerticalPlacement&&pe.placedOrientation===e.ah.vertical?Math.PI/2:0;for(let Ka=0;Ka<pe.numGlyphs;Ka++)e.aj(Gt,Na,li);He&&pe.associatedIconIndex>=0&&(oe[pe.associatedIconIndex]={shiftedAnchor:Na,angle:li})}else Ze(pe.numGlyphs,Gt)}if(He){ne.clear();let be=Lt.icon.placedSymbolArray;for(let pe=0;pe<be.length;pe++){let Ae=be.get(pe);if(Ae.hidden)Ze(Ae.numGlyphs,ne);else{let Xe=oe[pe];if(Xe)for(let nr=0;nr<Ae.numGlyphs;nr++)e.aj(ne,Xe.shiftedAnchor,Xe.angle);else Ze(Ae.numGlyphs,ne)}}Lt.icon.dynamicLayoutVertexBuffer.updateData(ne)}Lt.text.dynamicLayoutVertexBuffer.updateData(Gt)}function rl(Lt,P,at){return at.iconsInText&&P?"symbolTextAndIcon":Lt?"symbolSDF":"symbolIcon"}function oh(Lt,P,at,_t,Tt,Pt,ie,de,Ee,He,ar,ir){let zr=Lt.context,Zr=zr.gl,Rt=Lt.transform,Gt=Bn(),ne=de==="map",oe=Ee==="map",be=de!=="viewport"&&at.layout.get("symbol-placement")!=="point",pe=ne&&!oe&&!be,Ae=!oe&&be,Xe=!at.layout.get("symbol-sort-key").isConstant(),nr=!1,or=Lt.depthModeForSublayer(0,Mo.ReadOnly),Tr=at._unevaluatedLayout.hasValue("text-variable-anchor")||at._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Rr=[],Qr=Gt.getCircleRadiusCorrection(Rt);for(let nn of _t){let mn=P.getTile(nn),zn=mn.getBucket(at);if(!zn)continue;let na=Tt?zn.text:zn.icon;if(!na||!na.segments.get().length||!na.hasVisibleVertices)continue;let Yn=na.programConfigurations.get(at.id),la=Tt||zn.sdfIcons,Na=Tt?zn.textSizeData:zn.iconSizeData,li=oe||Rt.pitch!==0,Ka=Lt.useProgram(rl(la,Tt,zn),Yn),Gi=e.ag(Na,Rt.zoom),jo=Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(nn),Uo,ho,Go,js,Is=[0,0],bo=null;if(Tt)ho=mn.glyphAtlasTexture,Go=Zr.LINEAR,Uo=mn.glyphAtlasTexture.size,zn.iconsInText&&(Is=mn.imageAtlasTexture.size,bo=mn.imageAtlasTexture,js=li||Lt.options.rotating||Lt.options.zooming||Na.kind==="composite"||Na.kind==="camera"?Zr.LINEAR:Zr.NEAREST);else{let jr=at.layout.get("icon-size").constantOr(0)!==1||zn.iconsNeedLinear;ho=mn.imageAtlasTexture,Go=la||Lt.options.rotating||Lt.options.zooming||jr||li?Zr.LINEAR:Zr.NEAREST,Uo=mn.imageAtlasTexture.size}let wo=an(mn,1,Lt.transform.zoom),nl=Ae?nn.posMatrix:Pl,dl=Lr(nl,oe,ne,Lt.transform,wo),lu=kr(nl,oe,ne,Lt.transform,wo),mt=kr(nn.posMatrix,oe,ne,Lt.transform,wo),St=Gt.translatePosition(Lt.transform,mn,Pt,ie),Xt=Tr&&zn.hasTextData(),se=at.layout.get("icon-text-fit")!=="none"&&Xt&&zn.hasIconData();if(be){let jr=Lt.style.map.terrain?(tn,Rn)=>Lt.style.map.terrain.getElevation(nn,tn,Rn):null,Yr=at.layout.get("text-rotation-alignment")==="map";zt(zn,nn.posMatrix,Lt,Tt,dl,mt,oe,He,Yr,Gt,nn.toUnwrapped(),Rt.width,Rt.height,St,jr)}let fe=nn.posMatrix,ve=Tt&&Tr||se,De=be||ve?Pl:dl,Ce=lu,Qe=la&&at.paint.get(Tt?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Mr;Mr=la?zn.iconsInText?Yi(Na.kind,Gi,pe,oe,be,ve,Lt,fe,De,Ce,St,Uo,Is,Qr):Pi(Na.kind,Gi,pe,oe,be,ve,Lt,fe,De,Ce,St,Tt,Uo,!0,Qr):Do(Na.kind,Gi,pe,oe,be,ve,Lt,fe,De,Ce,St,Tt,Uo,Qr);let br={program:Ka,buffers:na,uniformValues:Mr,atlasTexture:ho,atlasTextureIcon:bo,atlasInterpolation:Go,atlasInterpolationIcon:js,isSDF:la,hasHalo:Qe};if(Xe&&zn.canOverlap){nr=!0;let jr=na.segments.get();for(let Yr of jr)Rr.push({segments:new e.a0([Yr]),sortKey:Yr.sortKey,state:br,terrainData:jo})}else Rr.push({segments:na.segments,sortKey:0,state:br,terrainData:jo})}nr&&Rr.sort((nn,mn)=>nn.sortKey-mn.sortKey);for(let nn of Rr){let mn=nn.state;if(zr.activeTexture.set(Zr.TEXTURE0),mn.atlasTexture.bind(mn.atlasInterpolation,Zr.CLAMP_TO_EDGE),mn.atlasTextureIcon&&(zr.activeTexture.set(Zr.TEXTURE1),mn.atlasTextureIcon&&mn.atlasTextureIcon.bind(mn.atlasInterpolationIcon,Zr.CLAMP_TO_EDGE)),mn.isSDF){let zn=mn.uniformValues;mn.hasHalo&&(zn.u_is_halo=1,Zc(mn.buffers,nn.segments,at,Lt,mn.program,or,ar,ir,zn,nn.terrainData)),zn.u_is_halo=0}Zc(mn.buffers,nn.segments,at,Lt,mn.program,or,ar,ir,mn.uniformValues,nn.terrainData)}}function Zc(Lt,P,at,_t,Tt,Pt,ie,de,Ee,He){let ar=_t.context;Tt.draw(ar,ar.gl.TRIANGLES,Pt,ie,de,io.disabled,Ee,He,at.id,Lt.layoutVertexBuffer,Lt.indexBuffer,P,at.paint,_t.transform.zoom,Lt.programConfigurations.get(at.id),Lt.dynamicLayoutVertexBuffer,Lt.opacityVertexBuffer)}function Lc(Lt,P,at,_t){let Tt=Lt.context,Pt=Tt.gl,ie=as.disabled,de=new Cs([Pt.ONE,Pt.ONE],e.aM.transparent,[!0,!0,!0,!0]),Ee=P.getBucket(at);if(!Ee)return;let He=_t.key,ar=at.heatmapFbos.get(He);ar||(ar=Cc(Tt,P.tileSize,P.tileSize),at.heatmapFbos.set(He,ar)),Tt.bindFramebuffer.set(ar.framebuffer),Tt.viewport.set([0,0,P.tileSize,P.tileSize]),Tt.clear({color:e.aM.transparent});let ir=Ee.programConfigurations.get(at.id),zr=Lt.useProgram("heatmap",ir),Zr=Lt.style.map.terrain.getTerrainData(_t);zr.draw(Tt,Pt.TRIANGLES,Mo.disabled,ie,de,io.disabled,ri(_t.posMatrix,P,Lt.transform.zoom,at.paint.get("heatmap-intensity")),Zr,at.id,Ee.layoutVertexBuffer,Ee.indexBuffer,Ee.segments,at.paint,Lt.transform.zoom,ir)}function Ju(Lt,P,at){let _t=Lt.context,Tt=_t.gl;_t.setColorMode(Lt.colorModeForRenderPass());let Pt=Xc(_t,P),ie=at.key,de=P.heatmapFbos.get(ie);de&&(_t.activeTexture.set(Tt.TEXTURE0),Tt.bindTexture(Tt.TEXTURE_2D,de.colorAttachment.get()),_t.activeTexture.set(Tt.TEXTURE1),Pt.bind(Tt.LINEAR,Tt.CLAMP_TO_EDGE),Lt.useProgram("heatmapTexture").draw(_t,Tt.TRIANGLES,Mo.disabled,as.disabled,Lt.colorModeForRenderPass(),io.disabled,Da(Lt,P,0,1),null,P.id,Lt.rasterBoundsBuffer,Lt.quadTriangleIndexBuffer,Lt.rasterBoundsSegments,P.paint,Lt.transform.zoom),de.destroy(),P.heatmapFbos.delete(ie))}function Cc(Lt,P,at){var _t,Tt;let Pt=Lt.gl,ie=Pt.createTexture();Pt.bindTexture(Pt.TEXTURE_2D,ie),Pt.texParameteri(Pt.TEXTURE_2D,Pt.TEXTURE_WRAP_S,Pt.CLAMP_TO_EDGE),Pt.texParameteri(Pt.TEXTURE_2D,Pt.TEXTURE_WRAP_T,Pt.CLAMP_TO_EDGE),Pt.texParameteri(Pt.TEXTURE_2D,Pt.TEXTURE_MIN_FILTER,Pt.LINEAR),Pt.texParameteri(Pt.TEXTURE_2D,Pt.TEXTURE_MAG_FILTER,Pt.LINEAR);let de=(_t=Lt.HALF_FLOAT)!==null&&_t!==void 0?_t:Pt.UNSIGNED_BYTE,Ee=(Tt=Lt.RGBA16F)!==null&&Tt!==void 0?Tt:Pt.RGBA;Pt.texImage2D(Pt.TEXTURE_2D,0,Ee,P,at,0,Pt.RGBA,de,null);let He=Lt.createFramebuffer(P,at,!1,!1);return He.colorAttachment.set(ie),He}function Xc(Lt,P){return P.colorRampTexture||(P.colorRampTexture=new f(Lt,P.colorRamp,Lt.gl.RGBA)),P.colorRampTexture}function mu(Lt,P,at,_t,Tt){if(!at||!_t||!_t.imageAtlas)return;let Pt=_t.imageAtlas.patternPositions,ie=Pt[at.to.toString()],de=Pt[at.from.toString()];if(!ie&&de&&(ie=de),!de&&ie&&(de=ie),!ie||!de){let Ee=Tt.getPaintProperty(P);ie=Pt[Ee],de=Pt[Ee]}ie&&de&&Lt.setConstantPatternPositions(ie,de)}function $c(Lt,P,at,_t,Tt,Pt,ie){let de=Lt.context.gl,Ee="fill-pattern",He=at.paint.get(Ee),ar=He&&He.constantOr(1),ir=at.getCrossfadeParameters(),zr,Zr,Rt,Gt,ne;ie?(Zr=ar&&!at.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",zr=de.LINES):(Zr=ar?"fillPattern":"fill",zr=de.TRIANGLES);let oe=He.constantOr(null);for(let be of _t){let pe=P.getTile(be);if(ar&&!pe.patternsLoaded())continue;let Ae=pe.getBucket(at);if(!Ae)continue;let Xe=Ae.programConfigurations.get(at.id),nr=Lt.useProgram(Zr,Xe),or=Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(be);ar&&(Lt.context.activeTexture.set(de.TEXTURE0),pe.imageAtlasTexture.bind(de.LINEAR,de.CLAMP_TO_EDGE),Xe.updatePaintBuffers(ir)),mu(Xe,Ee,oe,pe,at);let Tr=or?be:null,Rr=Lt.translatePosMatrix(Tr?Tr.posMatrix:be.posMatrix,pe,at.paint.get("fill-translate"),at.paint.get("fill-translate-anchor"));if(ie){Gt=Ae.indexBuffer2,ne=Ae.segments2;let Qr=[de.drawingBufferWidth,de.drawingBufferHeight];Rt=Zr==="fillOutlinePattern"&&ar?Va(Rr,Lt,ir,pe,Qr):Qn(Rr,Qr)}else Gt=Ae.indexBuffer,ne=Ae.segments,Rt=ar?ta(Rr,Lt,ir,pe):Tn(Rr);nr.draw(Lt.context,zr,Tt,Lt.stencilModeForClipping(be),Pt,io.disabled,Rt,or,at.id,Ae.layoutVertexBuffer,Gt,ne,at.paint,Lt.transform.zoom,Xe)}}function nc(Lt,P,at,_t,Tt,Pt,ie){let de=Lt.context,Ee=de.gl,He="fill-extrusion-pattern",ar=at.paint.get(He),ir=ar.constantOr(1),zr=at.getCrossfadeParameters(),Zr=at.paint.get("fill-extrusion-opacity"),Rt=ar.constantOr(null);for(let Gt of _t){let ne=P.getTile(Gt),oe=ne.getBucket(at);if(!oe)continue;let be=Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(Gt),pe=oe.programConfigurations.get(at.id),Ae=Lt.useProgram(ir?"fillExtrusionPattern":"fillExtrusion",pe);ir&&(Lt.context.activeTexture.set(Ee.TEXTURE0),ne.imageAtlasTexture.bind(Ee.LINEAR,Ee.CLAMP_TO_EDGE),pe.updatePaintBuffers(zr)),mu(pe,He,Rt,ne,at);let Xe=Lt.translatePosMatrix(Gt.posMatrix,ne,at.paint.get("fill-extrusion-translate"),at.paint.get("fill-extrusion-translate-anchor")),nr=at.paint.get("fill-extrusion-vertical-gradient"),or=ir?Kr(Xe,Lt,nr,Zr,Gt,zr,ne):dn(Xe,Lt,nr,Zr);Ae.draw(de,de.gl.TRIANGLES,Tt,Pt,ie,io.backCCW,or,be,at.id,oe.layoutVertexBuffer,oe.indexBuffer,oe.segments,at.paint,Lt.transform.zoom,pe,Lt.style.map.terrain&&oe.centroidVertexBuffer)}}function vu(Lt,P,at,_t,Tt,Pt,ie){let de=Lt.context,Ee=de.gl,He=at.fbo;if(!He)return;let ar=Lt.useProgram("hillshade"),ir=Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(P);de.activeTexture.set(Ee.TEXTURE0),Ee.bindTexture(Ee.TEXTURE_2D,He.colorAttachment.get()),ar.draw(de,Ee.TRIANGLES,Tt,Pt,ie,io.disabled,((zr,Zr,Rt,Gt)=>{let ne=Rt.paint.get("hillshade-shadow-color"),oe=Rt.paint.get("hillshade-highlight-color"),be=Rt.paint.get("hillshade-accent-color"),pe=Rt.paint.get("hillshade-illumination-direction")*(Math.PI/180);Rt.paint.get("hillshade-illumination-anchor")==="viewport"&&(pe-=zr.transform.angle);let Ae=!zr.options.moving;return{u_matrix:Gt?Gt.posMatrix:zr.transform.calculatePosMatrix(Zr.tileID.toUnwrapped(),Ae),u_image:0,u_latrange:Ui(0,Zr.tileID),u_light:[Rt.paint.get("hillshade-exaggeration"),pe],u_shadow:ne,u_highlight:oe,u_accent:be}})(Lt,at,_t,ir?P:null),ir,_t.id,Lt.rasterBoundsBuffer,Lt.quadTriangleIndexBuffer,Lt.rasterBoundsSegments)}function Gl(Lt,P,at,_t,Tt,Pt){let ie=Lt.context,de=ie.gl,Ee=P.dem;if(Ee&&Ee.data){let He=Ee.dim,ar=Ee.stride,ir=Ee.getPixels();if(ie.activeTexture.set(de.TEXTURE1),ie.pixelStoreUnpackPremultiplyAlpha.set(!1),P.demTexture=P.demTexture||Lt.getTileTexture(ar),P.demTexture){let Zr=P.demTexture;Zr.update(ir,{premultiply:!1}),Zr.bind(de.NEAREST,de.CLAMP_TO_EDGE)}else P.demTexture=new f(ie,ir,de.RGBA,{premultiply:!1}),P.demTexture.bind(de.NEAREST,de.CLAMP_TO_EDGE);ie.activeTexture.set(de.TEXTURE0);let zr=P.fbo;if(!zr){let Zr=new f(ie,{width:He,height:He,data:null},de.RGBA);Zr.bind(de.LINEAR,de.CLAMP_TO_EDGE),zr=P.fbo=ie.createFramebuffer(He,He,!0,!1),zr.colorAttachment.set(Zr.texture)}ie.bindFramebuffer.set(zr.framebuffer),ie.viewport.set([0,0,He,He]),Lt.useProgram("hillshadePrepare").draw(ie,de.TRIANGLES,_t,Tt,Pt,io.disabled,((Zr,Rt)=>{let Gt=Rt.stride,ne=e.H();return e.aP(ne,0,e.X,-e.X,0,0,1),e.J(ne,ne,[0,-e.X,0]),{u_matrix:ne,u_image:1,u_dimension:[Gt,Gt],u_zoom:Zr.overscaledZ,u_unpack:Rt.getUnpackVector()}})(P.tileID,Ee),null,at.id,Lt.rasterBoundsBuffer,Lt.quadTriangleIndexBuffer,Lt.rasterBoundsSegments),P.needsHillshadePrepare=!1}}function yc(Lt,P,at,_t,Tt,Pt){let ie=_t.paint.get("raster-fade-duration");if(!Pt&&ie>0){let de=o.now(),Ee=(de-Lt.timeAdded)/ie,He=P?(de-P.timeAdded)/ie:-1,ar=at.getSource(),ir=Tt.coveringZoomLevel({tileSize:ar.tileSize,roundZoom:ar.roundZoom}),zr=!P||Math.abs(P.tileID.overscaledZ-ir)>Math.abs(Lt.tileID.overscaledZ-ir),Zr=zr&&Lt.refreshedUponExpiration?1:e.ac(zr?Ee:1-He,0,1);return Lt.refreshedUponExpiration&&Ee>=1&&(Lt.refreshedUponExpiration=!1),P?{opacity:1,mix:1-Zr}:{opacity:Zr,mix:0}}return{opacity:1,mix:0}}let Jc=new e.aM(1,0,0,1),ps=new e.aM(0,1,0,1),Dc=new e.aM(0,0,1,1),Fh=new e.aM(1,0,1,1),sh=new e.aM(0,1,1,1);function xc(Lt,P,at,_t){Wl(Lt,0,P+at/2,Lt.transform.width,at,_t)}function lh(Lt,P,at,_t){Wl(Lt,P-at/2,0,at,Lt.transform.height,_t)}function Wl(Lt,P,at,_t,Tt,Pt){let ie=Lt.context,de=ie.gl;de.enable(de.SCISSOR_TEST),de.scissor(P*Lt.pixelRatio,at*Lt.pixelRatio,_t*Lt.pixelRatio,Tt*Lt.pixelRatio),ie.clear({color:Pt}),de.disable(de.SCISSOR_TEST)}function uh(Lt,P,at){let _t=Lt.context,Tt=_t.gl,Pt=at.posMatrix,ie=Lt.useProgram("debug"),de=Mo.disabled,Ee=as.disabled,He=Lt.colorModeForRenderPass(),ar="$debug",ir=Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(at);_t.activeTexture.set(Tt.TEXTURE0);let zr=P.getTileByID(at.key).latestRawTileData,Zr=Math.floor((zr&&zr.byteLength||0)/1024),Rt=P.getTile(at).tileSize,Gt=512/Math.min(Rt,512)*(at.overscaledZ/Lt.transform.zoom)*.5,ne=at.canonical.toString();at.overscaledZ!==at.canonical.z&&(ne+=` => ${at.overscaledZ}`),function(oe,be){oe.initDebugOverlayCanvas();let pe=oe.debugOverlayCanvas,Ae=oe.context.gl,Xe=oe.debugOverlayCanvas.getContext("2d");Xe.clearRect(0,0,pe.width,pe.height),Xe.shadowColor="white",Xe.shadowBlur=2,Xe.lineWidth=1.5,Xe.strokeStyle="white",Xe.textBaseline="top",Xe.font="bold 36px Open Sans, sans-serif",Xe.fillText(be,5,5),Xe.strokeText(be,5,5),oe.debugOverlayTexture.update(pe),oe.debugOverlayTexture.bind(Ae.LINEAR,Ae.CLAMP_TO_EDGE)}(Lt,`${ne} ${Zr}kB`),ie.draw(_t,Tt.TRIANGLES,de,Ee,Cs.alphaBlended,io.disabled,pi(Pt,e.aM.transparent,Gt),null,ar,Lt.debugBuffer,Lt.quadTriangleIndexBuffer,Lt.debugSegments),ie.draw(_t,Tt.LINE_STRIP,de,Ee,He,io.disabled,pi(Pt,e.aM.red),ir,ar,Lt.debugBuffer,Lt.tileBorderIndexBuffer,Lt.debugSegments)}function Il(Lt,P,at){let _t=Lt.context,Tt=_t.gl,Pt=Lt.colorModeForRenderPass(),ie=new Mo(Tt.LEQUAL,Mo.ReadWrite,Lt.depthRangeFor3D),de=Lt.useProgram("terrain"),Ee=P.getTerrainMesh();_t.bindFramebuffer.set(null),_t.viewport.set([0,0,Lt.width,Lt.height]);for(let He of at){let ar=Lt.renderToTexture.getTexture(He),ir=P.getTerrainData(He.tileID);_t.activeTexture.set(Tt.TEXTURE0),Tt.bindTexture(Tt.TEXTURE_2D,ar.texture);let zr=Lt.transform.calculatePosMatrix(He.tileID.toUnwrapped()),Zr=P.getMeshFrameDelta(Lt.transform.zoom),Rt=Lt.transform.calculateFogMatrix(He.tileID.toUnwrapped()),Gt=yr(zr,Zr,Rt,Lt.style.sky,Lt.transform.pitch);de.draw(_t,Tt.TRIANGLES,ie,as.disabled,Pt,io.backCCW,Gt,ir,"terrain",Ee.vertexBuffer,Ee.indexBuffer,Ee.segments)}}class Zl{constructor(P,at,_t){this.vertexBuffer=P,this.indexBuffer=at,this.segments=_t}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Ru{constructor(P,at){this.context=new zh(P),this.transform=at,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Se.maxUnderzooming+Se.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Er}resize(P,at,_t){if(this.width=Math.floor(P*_t),this.height=Math.floor(at*_t),this.pixelRatio=_t,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let Tt of this.style._order)this.style._layers[Tt].resize()}setup(){let P=this.context,at=new e.aX;at.emplaceBack(0,0),at.emplaceBack(e.X,0),at.emplaceBack(0,e.X),at.emplaceBack(e.X,e.X),this.tileExtentBuffer=P.createVertexBuffer(at,Wr.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);let _t=new e.aX;_t.emplaceBack(0,0),_t.emplaceBack(e.X,0),_t.emplaceBack(0,e.X),_t.emplaceBack(e.X,e.X),this.debugBuffer=P.createVertexBuffer(_t,Wr.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);let Tt=new e.$;Tt.emplaceBack(0,0,0,0),Tt.emplaceBack(e.X,0,e.X,0),Tt.emplaceBack(0,e.X,0,e.X),Tt.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=P.createVertexBuffer(Tt,Nt.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);let Pt=new e.aX;Pt.emplaceBack(0,0),Pt.emplaceBack(1,0),Pt.emplaceBack(0,1),Pt.emplaceBack(1,1),this.viewportBuffer=P.createVertexBuffer(Pt,Wr.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);let ie=new e.aZ;ie.emplaceBack(0),ie.emplaceBack(1),ie.emplaceBack(3),ie.emplaceBack(2),ie.emplaceBack(0),this.tileBorderIndexBuffer=P.createIndexBuffer(ie);let de=new e.aY;de.emplaceBack(0,1,2),de.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=P.createIndexBuffer(de);let Ee=this.context.gl;this.stencilClearMode=new as({func:Ee.ALWAYS,mask:0},0,255,Ee.ZERO,Ee.ZERO,Ee.ZERO)}clearStencil(){let P=this.context,at=P.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let _t=e.H();e.aP(_t,0,this.width,this.height,0,0,1),e.K(_t,_t,[at.drawingBufferWidth,at.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(P,at.TRIANGLES,Mo.disabled,this.stencilClearMode,Cs.disabled,io.disabled,bi(_t),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(P,at){if(this.currentStencilSource===P.source||!P.isTileClipped()||!at||!at.length)return;this.currentStencilSource=P.source;let _t=this.context,Tt=_t.gl;this.nextStencilID+at.length>256&&this.clearStencil(),_t.setColorMode(Cs.disabled),_t.setDepthMode(Mo.disabled);let Pt=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let ie of at){let de=this._tileClippingMaskIDs[ie.key]=this.nextStencilID++,Ee=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ie);Pt.draw(_t,Tt.TRIANGLES,Mo.disabled,new as({func:Tt.ALWAYS,mask:0},de,255,Tt.KEEP,Tt.KEEP,Tt.REPLACE),Cs.disabled,io.disabled,bi(ie.posMatrix),Ee,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let P=this.nextStencilID++,at=this.context.gl;return new as({func:at.NOTEQUAL,mask:255},P,255,at.KEEP,at.KEEP,at.REPLACE)}stencilModeForClipping(P){let at=this.context.gl;return new as({func:at.EQUAL,mask:255},this._tileClippingMaskIDs[P.key],0,at.KEEP,at.KEEP,at.REPLACE)}stencilConfigForOverlap(P){let at=this.context.gl,_t=P.sort((ie,de)=>de.overscaledZ-ie.overscaledZ),Tt=_t[_t.length-1].overscaledZ,Pt=_t[0].overscaledZ-Tt+1;if(Pt>1){this.currentStencilSource=void 0,this.nextStencilID+Pt>256&&this.clearStencil();let ie={};for(let de=0;de<Pt;de++)ie[de+Tt]=new as({func:at.GEQUAL,mask:255},de+this.nextStencilID,255,at.KEEP,at.KEEP,at.REPLACE);return this.nextStencilID+=Pt,[ie,_t]}return[{[Tt]:as.disabled},_t]}colorModeForRenderPass(){let P=this.context.gl;return this._showOverdrawInspector?new Cs([P.CONSTANT_COLOR,P.ONE],new e.aM(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Cs.unblended:Cs.alphaBlended}depthModeForSublayer(P,at,_t){if(!this.opaquePassEnabledForLayer())return Mo.disabled;let Tt=1-((1+this.currentLayer)*this.numSublayers+P)*this.depthEpsilon;return new Mo(_t||this.context.gl.LEQUAL,at,[Tt,Tt])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(P,at){this.style=P,this.options=at,this.lineAtlas=P.lineAtlas,this.imageManager=P.imageManager,this.glyphManager=P.glyphManager,this.symbolFadeChange=P.placement.symbolFadeChange(o.now()),this.imageManager.beginFrame();let _t=this.style._order,Tt=this.style.sourceCaches,Pt={},ie={},de={};for(let Ee in Tt){let He=Tt[Ee];He.used&&He.prepare(this.context),Pt[Ee]=He.getVisibleCoordinates(),ie[Ee]=Pt[Ee].slice().reverse(),de[Ee]=He.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let Ee=0;Ee<_t.length;Ee++)if(this.style._layers[_t[Ee]].is3D()){this.opaquePassCutoff=Ee;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let Ee of _t){let He=this.style._layers[Ee];if(!He.hasOffscreenPass()||He.isHidden(this.transform.zoom))continue;let ar=ie[He.source];(He.type==="custom"||ar.length)&&this.renderLayer(this,Tt[He.source],He,ar)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:at.showOverdrawInspector?e.aM.black:e.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(Ee,He){let ar=Ee.context,ir=ar.gl,zr=((oe,be,pe)=>({u_sky_color:oe.properties.get("sky-color"),u_horizon_color:oe.properties.get("horizon-color"),u_horizon:(be.height/2+be.getHorizon())*pe,u_sky_horizon_blend:oe.properties.get("sky-horizon-blend")*be.height/2*pe}))(He,Ee.style.map.transform,Ee.pixelRatio),Zr=new Mo(ir.LEQUAL,Mo.ReadWrite,[0,1]),Rt=as.disabled,Gt=Ee.colorModeForRenderPass(),ne=Ee.useProgram("sky");if(!He.mesh){let oe=new e.aX;oe.emplaceBack(-1,-1),oe.emplaceBack(1,-1),oe.emplaceBack(1,1),oe.emplaceBack(-1,1);let be=new e.aY;be.emplaceBack(0,1,2),be.emplaceBack(0,2,3),He.mesh=new Zl(ar.createVertexBuffer(oe,Wr.members),ar.createIndexBuffer(be),e.a0.simpleSegment(0,0,oe.length,be.length))}ne.draw(ar,ir.TRIANGLES,Zr,Rt,Gt,io.disabled,zr,void 0,"sky",He.mesh.vertexBuffer,He.mesh.indexBuffer,He.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=at.showOverdrawInspector,this.depthRangeFor3D=[0,1-(P._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=_t.length-1;this.currentLayer>=0;this.currentLayer--){let Ee=this.style._layers[_t[this.currentLayer]],He=Tt[Ee.source],ar=Pt[Ee.source];this._renderTileClippingMasks(Ee,ar),this.renderLayer(this,He,Ee,ar)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<_t.length;this.currentLayer++){let Ee=this.style._layers[_t[this.currentLayer]],He=Tt[Ee.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(Ee))continue;let ar=(Ee.type==="symbol"?de:ie)[Ee.source];this._renderTileClippingMasks(Ee,Pt[Ee.source]),this.renderLayer(this,He,Ee,ar)}if(this.options.showTileBoundaries){let Ee=function(He,ar){let ir=null,zr=Object.values(He._layers).flatMap(ne=>ne.source&&!ne.isHidden(ar)?[He.sourceCaches[ne.source]]:[]),Zr=zr.filter(ne=>ne.getSource().type==="vector"),Rt=zr.filter(ne=>ne.getSource().type!=="vector"),Gt=ne=>{(!ir||ir.getSource().maxzoom<ne.getSource().maxzoom)&&(ir=ne)};return Zr.forEach(ne=>Gt(ne)),ir||Rt.forEach(ne=>Gt(ne)),ir}(this.style,this.transform.zoom);Ee&&function(He,ar,ir){for(let zr=0;zr<ir.length;zr++)uh(He,ar,ir[zr])}(this,Ee,Ee.getVisibleCoordinates())}this.options.showPadding&&function(Ee){let He=Ee.transform.padding;xc(Ee,Ee.transform.height-(He.top||0),3,Jc),xc(Ee,He.bottom||0,3,ps),lh(Ee,He.left||0,3,Dc),lh(Ee,Ee.transform.width-(He.right||0),3,Fh);let ar=Ee.transform.centerPoint;(function(ir,zr,Zr,Rt){Wl(ir,zr-1,Zr-10,2,20,Rt),Wl(ir,zr-10,Zr-1,20,2,Rt)})(Ee,ar.x,Ee.transform.height-ar.y,sh)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(P){if(!this.style||!this.style.map||!this.style.map.terrain)return;let at=this.terrainFacilitator.matrix,_t=this.transform.modelViewProjectionMatrix,Tt=this.terrainFacilitator.dirty;Tt||(Tt=P?!e.a_(at,_t):!e.a$(at,_t)),Tt||(Tt=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),Tt&&(e.b0(at,_t),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(Pt,ie){let de=Pt.context,Ee=de.gl,He=Cs.unblended,ar=new Mo(Ee.LEQUAL,Mo.ReadWrite,[0,1]),ir=ie.getTerrainMesh(),zr=ie.sourceCache.getRenderableTiles(),Zr=Pt.useProgram("terrainDepth");de.bindFramebuffer.set(ie.getFramebuffer("depth").framebuffer),de.viewport.set([0,0,Pt.width/devicePixelRatio,Pt.height/devicePixelRatio]),de.clear({color:e.aM.transparent,depth:1});for(let Rt of zr){let Gt=ie.getTerrainData(Rt.tileID),ne={u_matrix:Pt.transform.calculatePosMatrix(Rt.tileID.toUnwrapped()),u_ele_delta:ie.getMeshFrameDelta(Pt.transform.zoom)};Zr.draw(de,Ee.TRIANGLES,ar,as.disabled,He,io.backCCW,ne,Gt,"terrain",ir.vertexBuffer,ir.indexBuffer,ir.segments)}de.bindFramebuffer.set(null),de.viewport.set([0,0,Pt.width,Pt.height])}(this,this.style.map.terrain),function(Pt,ie){let de=Pt.context,Ee=de.gl,He=Cs.unblended,ar=new Mo(Ee.LEQUAL,Mo.ReadWrite,[0,1]),ir=ie.getTerrainMesh(),zr=ie.getCoordsTexture(),Zr=ie.sourceCache.getRenderableTiles(),Rt=Pt.useProgram("terrainCoords");de.bindFramebuffer.set(ie.getFramebuffer("coords").framebuffer),de.viewport.set([0,0,Pt.width/devicePixelRatio,Pt.height/devicePixelRatio]),de.clear({color:e.aM.transparent,depth:1}),ie.coordsIndex=[];for(let Gt of Zr){let ne=ie.getTerrainData(Gt.tileID);de.activeTexture.set(Ee.TEXTURE0),Ee.bindTexture(Ee.TEXTURE_2D,zr.texture);let oe={u_matrix:Pt.transform.calculatePosMatrix(Gt.tileID.toUnwrapped()),u_terrain_coords_id:(255-ie.coordsIndex.length)/255,u_texture:0,u_ele_delta:ie.getMeshFrameDelta(Pt.transform.zoom)};Rt.draw(de,Ee.TRIANGLES,ar,as.disabled,He,io.backCCW,oe,ne,"terrain",ir.vertexBuffer,ir.indexBuffer,ir.segments),ie.coordsIndex.push(Gt.tileID.key)}de.bindFramebuffer.set(null),de.viewport.set([0,0,Pt.width,Pt.height])}(this,this.style.map.terrain))}renderLayer(P,at,_t,Tt){if(!_t.isHidden(this.transform.zoom)&&(_t.type==="background"||_t.type==="custom"||(Tt||[]).length))switch(this.id=_t.id,_t.type){case"symbol":(function(Pt,ie,de,Ee,He){if(Pt.renderPass!=="translucent")return;let ar=as.disabled,ir=Pt.colorModeForRenderPass();(de._unevaluatedLayout.hasValue("text-variable-anchor")||de._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(zr,Zr,Rt,Gt,ne,oe,be,pe,Ae){let Xe=Zr.transform,nr=Bn(),or=ne==="map",Tr=oe==="map";for(let Rr of zr){let Qr=Gt.getTile(Rr),nn=Qr.getBucket(Rt);if(!nn||!nn.text||!nn.text.segments.get().length)continue;let mn=e.ag(nn.textSizeData,Xe.zoom),zn=an(Qr,1,Zr.transform.zoom),na=Lr(Rr.posMatrix,Tr,or,Zr.transform,zn),Yn=Rt.layout.get("icon-text-fit")!=="none"&&nn.hasIconData();if(mn){let la=Math.pow(2,Xe.zoom-Qr.tileID.overscaledZ),Na=Zr.style.map.terrain?(Ka,Gi)=>Zr.style.map.terrain.getElevation(Rr,Ka,Gi):null,li=nr.translatePosition(Xe,Qr,be,pe);dc(nn,or,Tr,Ae,Xe,na,Rr.posMatrix,la,mn,Yn,nr,li,Rr.toUnwrapped(),Na)}}}(Ee,Pt,de,ie,de.layout.get("text-rotation-alignment"),de.layout.get("text-pitch-alignment"),de.paint.get("text-translate"),de.paint.get("text-translate-anchor"),He),de.paint.get("icon-opacity").constantOr(1)!==0&&oh(Pt,ie,de,Ee,!1,de.paint.get("icon-translate"),de.paint.get("icon-translate-anchor"),de.layout.get("icon-rotation-alignment"),de.layout.get("icon-pitch-alignment"),de.layout.get("icon-keep-upright"),ar,ir),de.paint.get("text-opacity").constantOr(1)!==0&&oh(Pt,ie,de,Ee,!0,de.paint.get("text-translate"),de.paint.get("text-translate-anchor"),de.layout.get("text-rotation-alignment"),de.layout.get("text-pitch-alignment"),de.layout.get("text-keep-upright"),ar,ir),ie.map.showCollisionBoxes&&(gu(Pt,ie,de,Ee,!0),gu(Pt,ie,de,Ee,!1))})(P,at,_t,Tt,this.style.placement.variableOffsets);break;case"circle":(function(Pt,ie,de,Ee){if(Pt.renderPass!=="translucent")return;let He=de.paint.get("circle-opacity"),ar=de.paint.get("circle-stroke-width"),ir=de.paint.get("circle-stroke-opacity"),zr=!de.layout.get("circle-sort-key").isConstant();if(He.constantOr(1)===0&&(ar.constantOr(1)===0||ir.constantOr(1)===0))return;let Zr=Pt.context,Rt=Zr.gl,Gt=Pt.depthModeForSublayer(0,Mo.ReadOnly),ne=as.disabled,oe=Pt.colorModeForRenderPass(),be=[];for(let pe=0;pe<Ee.length;pe++){let Ae=Ee[pe],Xe=ie.getTile(Ae),nr=Xe.getBucket(de);if(!nr)continue;let or=nr.programConfigurations.get(de.id),Tr=Pt.useProgram("circle",or),Rr=nr.layoutVertexBuffer,Qr=nr.indexBuffer,nn=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(Ae),mn={programConfiguration:or,program:Tr,layoutVertexBuffer:Rr,indexBuffer:Qr,uniformValues:ja(Pt,Ae,Xe,de),terrainData:nn};if(zr){let zn=nr.segments.get();for(let na of zn)be.push({segments:new e.a0([na]),sortKey:na.sortKey,state:mn})}else be.push({segments:nr.segments,sortKey:0,state:mn})}zr&&be.sort((pe,Ae)=>pe.sortKey-Ae.sortKey);for(let pe of be){let{programConfiguration:Ae,program:Xe,layoutVertexBuffer:nr,indexBuffer:or,uniformValues:Tr,terrainData:Rr}=pe.state;Xe.draw(Zr,Rt.TRIANGLES,Gt,ne,oe,io.disabled,Tr,Rr,de.id,nr,or,pe.segments,de.paint,Pt.transform.zoom,Ae)}})(P,at,_t,Tt);break;case"heatmap":(function(Pt,ie,de,Ee){if(de.paint.get("heatmap-opacity")===0)return;let He=Pt.context;if(Pt.style.map.terrain){for(let ar of Ee){let ir=ie.getTile(ar);ie.hasRenderableParent(ar)||(Pt.renderPass==="offscreen"?Lc(Pt,ir,de,ar):Pt.renderPass==="translucent"&&Ju(Pt,de,ar))}He.viewport.set([0,0,Pt.width,Pt.height])}else Pt.renderPass==="offscreen"?function(ar,ir,zr,Zr){let Rt=ar.context,Gt=Rt.gl,ne=as.disabled,oe=new Cs([Gt.ONE,Gt.ONE],e.aM.transparent,[!0,!0,!0,!0]);(function(be,pe,Ae){let Xe=be.gl;be.activeTexture.set(Xe.TEXTURE1),be.viewport.set([0,0,pe.width/4,pe.height/4]);let nr=Ae.heatmapFbos.get(e.aU);nr?(Xe.bindTexture(Xe.TEXTURE_2D,nr.colorAttachment.get()),be.bindFramebuffer.set(nr.framebuffer)):(nr=Cc(be,pe.width/4,pe.height/4),Ae.heatmapFbos.set(e.aU,nr))})(Rt,ar,zr),Rt.clear({color:e.aM.transparent});for(let be=0;be<Zr.length;be++){let pe=Zr[be];if(ir.hasRenderableParent(pe))continue;let Ae=ir.getTile(pe),Xe=Ae.getBucket(zr);if(!Xe)continue;let nr=Xe.programConfigurations.get(zr.id),or=ar.useProgram("heatmap",nr),{zoom:Tr}=ar.transform;or.draw(Rt,Gt.TRIANGLES,Mo.disabled,ne,oe,io.disabled,ri(pe.posMatrix,Ae,Tr,zr.paint.get("heatmap-intensity")),null,zr.id,Xe.layoutVertexBuffer,Xe.indexBuffer,Xe.segments,zr.paint,ar.transform.zoom,nr)}Rt.viewport.set([0,0,ar.width,ar.height])}(Pt,ie,de,Ee):Pt.renderPass==="translucent"&&function(ar,ir){let zr=ar.context,Zr=zr.gl;zr.setColorMode(ar.colorModeForRenderPass());let Rt=ir.heatmapFbos.get(e.aU);Rt&&(zr.activeTexture.set(Zr.TEXTURE0),Zr.bindTexture(Zr.TEXTURE_2D,Rt.colorAttachment.get()),zr.activeTexture.set(Zr.TEXTURE1),Xc(zr,ir).bind(Zr.LINEAR,Zr.CLAMP_TO_EDGE),ar.useProgram("heatmapTexture").draw(zr,Zr.TRIANGLES,Mo.disabled,as.disabled,ar.colorModeForRenderPass(),io.disabled,Da(ar,ir,0,1),null,ir.id,ar.viewportBuffer,ar.quadTriangleIndexBuffer,ar.viewportSegments,ir.paint,ar.transform.zoom))}(Pt,de)})(P,at,_t,Tt);break;case"line":(function(Pt,ie,de,Ee){if(Pt.renderPass!=="translucent")return;let He=de.paint.get("line-opacity"),ar=de.paint.get("line-width");if(He.constantOr(1)===0||ar.constantOr(1)===0)return;let ir=Pt.depthModeForSublayer(0,Mo.ReadOnly),zr=Pt.colorModeForRenderPass(),Zr=de.paint.get("line-dasharray"),Rt=de.paint.get("line-pattern"),Gt=Rt.constantOr(1),ne=de.paint.get("line-gradient"),oe=de.getCrossfadeParameters(),be=Gt?"linePattern":Zr?"lineSDF":ne?"lineGradient":"line",pe=Pt.context,Ae=pe.gl,Xe=!0;for(let nr of Ee){let or=ie.getTile(nr);if(Gt&&!or.patternsLoaded())continue;let Tr=or.getBucket(de);if(!Tr)continue;let Rr=Tr.programConfigurations.get(de.id),Qr=Pt.context.program.get(),nn=Pt.useProgram(be,Rr),mn=Xe||nn.program!==Qr,zn=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(nr),na=Rt.constantOr(null);if(na&&or.imageAtlas){let Na=or.imageAtlas,li=Na.patternPositions[na.to.toString()],Ka=Na.patternPositions[na.from.toString()];li&&Ka&&Rr.setConstantPatternPositions(li,Ka)}let Yn=zn?nr:null,la=Gt?Bo(Pt,or,de,oe,Yn):Zr?ai(Pt,or,de,Zr,oe,Yn):ne?Co(Pt,or,de,Tr.lineClipsArray.length,Yn):lo(Pt,or,de,Yn);if(Gt)pe.activeTexture.set(Ae.TEXTURE0),or.imageAtlasTexture.bind(Ae.LINEAR,Ae.CLAMP_TO_EDGE),Rr.updatePaintBuffers(oe);else if(Zr&&(mn||Pt.lineAtlas.dirty))pe.activeTexture.set(Ae.TEXTURE0),Pt.lineAtlas.bind(pe);else if(ne){let Na=Tr.gradients[de.id],li=Na.texture;if(de.gradientVersion!==Na.version){let Ka=256;if(de.stepInterpolant){let Gi=ie.getSource().maxzoom,jo=nr.canonical.z===Gi?Math.ceil(1<<Pt.transform.maxZoom-nr.canonical.z):1;Ka=e.ac(e.aV(Tr.maxLineLength/e.X*1024*jo),256,pe.maxTextureSize)}Na.gradient=e.aW({expression:de.gradientExpression(),evaluationKey:"lineProgress",resolution:Ka,image:Na.gradient||void 0,clips:Tr.lineClipsArray}),Na.texture?Na.texture.update(Na.gradient):Na.texture=new f(pe,Na.gradient,Ae.RGBA),Na.version=de.gradientVersion,li=Na.texture}pe.activeTexture.set(Ae.TEXTURE0),li.bind(de.stepInterpolant?Ae.NEAREST:Ae.LINEAR,Ae.CLAMP_TO_EDGE)}nn.draw(pe,Ae.TRIANGLES,ir,Pt.stencilModeForClipping(nr),zr,io.disabled,la,zn,de.id,Tr.layoutVertexBuffer,Tr.indexBuffer,Tr.segments,de.paint,Pt.transform.zoom,Rr,Tr.layoutVertexBuffer2),Xe=!1}})(P,at,_t,Tt);break;case"fill":(function(Pt,ie,de,Ee){let He=de.paint.get("fill-color"),ar=de.paint.get("fill-opacity");if(ar.constantOr(1)===0)return;let ir=Pt.colorModeForRenderPass(),zr=de.paint.get("fill-pattern"),Zr=Pt.opaquePassEnabledForLayer()&&!zr.constantOr(1)&&He.constantOr(e.aM.transparent).a===1&&ar.constantOr(0)===1?"opaque":"translucent";if(Pt.renderPass===Zr){let Rt=Pt.depthModeForSublayer(1,Pt.renderPass==="opaque"?Mo.ReadWrite:Mo.ReadOnly);$c(Pt,ie,de,Ee,Rt,ir,!1)}if(Pt.renderPass==="translucent"&&de.paint.get("fill-antialias")){let Rt=Pt.depthModeForSublayer(de.getPaintProperty("fill-outline-color")?2:0,Mo.ReadOnly);$c(Pt,ie,de,Ee,Rt,ir,!0)}})(P,at,_t,Tt);break;case"fill-extrusion":(function(Pt,ie,de,Ee){let He=de.paint.get("fill-extrusion-opacity");if(He!==0&&Pt.renderPass==="translucent"){let ar=new Mo(Pt.context.gl.LEQUAL,Mo.ReadWrite,Pt.depthRangeFor3D);if(He!==1||de.paint.get("fill-extrusion-pattern").constantOr(1))nc(Pt,ie,de,Ee,ar,as.disabled,Cs.disabled),nc(Pt,ie,de,Ee,ar,Pt.stencilModeFor3D(),Pt.colorModeForRenderPass());else{let ir=Pt.colorModeForRenderPass();nc(Pt,ie,de,Ee,ar,as.disabled,ir)}}})(P,at,_t,Tt);break;case"hillshade":(function(Pt,ie,de,Ee){if(Pt.renderPass!=="offscreen"&&Pt.renderPass!=="translucent")return;let He=Pt.context,ar=Pt.depthModeForSublayer(0,Mo.ReadOnly),ir=Pt.colorModeForRenderPass(),[zr,Zr]=Pt.renderPass==="translucent"?Pt.stencilConfigForOverlap(Ee):[{},Ee];for(let Rt of Zr){let Gt=ie.getTile(Rt);Gt.needsHillshadePrepare!==void 0&&Gt.needsHillshadePrepare&&Pt.renderPass==="offscreen"?Gl(Pt,Gt,de,ar,as.disabled,ir):Pt.renderPass==="translucent"&&vu(Pt,Rt,Gt,de,ar,zr[Rt.overscaledZ],ir)}He.viewport.set([0,0,Pt.width,Pt.height])})(P,at,_t,Tt);break;case"raster":(function(Pt,ie,de,Ee){if(Pt.renderPass!=="translucent"||de.paint.get("raster-opacity")===0||!Ee.length)return;let He=Pt.context,ar=He.gl,ir=ie.getSource(),zr=Pt.useProgram("raster"),Zr=Pt.colorModeForRenderPass(),[Rt,Gt]=ir instanceof te?[{},Ee]:Pt.stencilConfigForOverlap(Ee),ne=Gt[Gt.length-1].overscaledZ,oe=!Pt.options.moving;for(let be of Gt){let pe=Pt.depthModeForSublayer(be.overscaledZ-ne,de.paint.get("raster-opacity")===1?Mo.ReadWrite:Mo.ReadOnly,ar.LESS),Ae=ie.getTile(be);Ae.registerFadeDuration(de.paint.get("raster-fade-duration"));let Xe=ie.findLoadedParent(be,0),nr=ie.findLoadedSibling(be),or=yc(Ae,Xe||nr||null,ie,de,Pt.transform,Pt.style.map.terrain),Tr,Rr,Qr=de.paint.get("raster-resampling")==="nearest"?ar.NEAREST:ar.LINEAR;He.activeTexture.set(ar.TEXTURE0),Ae.texture.bind(Qr,ar.CLAMP_TO_EDGE,ar.LINEAR_MIPMAP_NEAREST),He.activeTexture.set(ar.TEXTURE1),Xe?(Xe.texture.bind(Qr,ar.CLAMP_TO_EDGE,ar.LINEAR_MIPMAP_NEAREST),Tr=Math.pow(2,Xe.tileID.overscaledZ-Ae.tileID.overscaledZ),Rr=[Ae.tileID.canonical.x*Tr%1,Ae.tileID.canonical.y*Tr%1]):Ae.texture.bind(Qr,ar.CLAMP_TO_EDGE,ar.LINEAR_MIPMAP_NEAREST),Ae.texture.useMipmap&&He.extTextureFilterAnisotropic&&Pt.transform.pitch>20&&ar.texParameterf(ar.TEXTURE_2D,He.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,He.extTextureFilterAnisotropicMax);let nn=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(be),mn=nn?be:null,zn=mn?mn.posMatrix:Pt.transform.calculatePosMatrix(be.toUnwrapped(),oe),na=ko(zn,Rr||[0,0],Tr||1,or,de);ir instanceof te?zr.draw(He,ar.TRIANGLES,pe,as.disabled,Zr,io.disabled,na,nn,de.id,ir.boundsBuffer,Pt.quadTriangleIndexBuffer,ir.boundsSegments):zr.draw(He,ar.TRIANGLES,pe,Rt[be.overscaledZ],Zr,io.disabled,na,nn,de.id,Pt.rasterBoundsBuffer,Pt.quadTriangleIndexBuffer,Pt.rasterBoundsSegments)}})(P,at,_t,Tt);break;case"background":(function(Pt,ie,de,Ee){let He=de.paint.get("background-color"),ar=de.paint.get("background-opacity");if(ar===0)return;let ir=Pt.context,zr=ir.gl,Zr=Pt.transform,Rt=Zr.tileSize,Gt=de.paint.get("background-pattern");if(Pt.isPatternMissing(Gt))return;let ne=!Gt&&He.a===1&&ar===1&&Pt.opaquePassEnabledForLayer()?"opaque":"translucent";if(Pt.renderPass!==ne)return;let oe=as.disabled,be=Pt.depthModeForSublayer(0,ne==="opaque"?Mo.ReadWrite:Mo.ReadOnly),pe=Pt.colorModeForRenderPass(),Ae=Pt.useProgram(Gt?"backgroundPattern":"background"),Xe=Ee||Zr.coveringTiles({tileSize:Rt,terrain:Pt.style.map.terrain});Gt&&(ir.activeTexture.set(zr.TEXTURE0),Pt.imageManager.bind(Pt.context));let nr=de.getCrossfadeParameters();for(let or of Xe){let Tr=Ee?or.posMatrix:Pt.transform.calculatePosMatrix(or.toUnwrapped()),Rr=Gt?es(Tr,ar,Pt,Gt,{tileID:or,tileSize:Rt},nr):vs(Tr,ar,He),Qr=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(or);Ae.draw(ir,zr.TRIANGLES,be,oe,pe,io.disabled,Rr,Qr,de.id,Pt.tileExtentBuffer,Pt.quadTriangleIndexBuffer,Pt.tileExtentSegments)}})(P,0,_t,Tt);break;case"custom":(function(Pt,ie,de){let Ee=Pt.context,He=de.implementation;if(Pt.renderPass==="offscreen"){let ar=He.prerender;ar&&(Pt.setCustomLayerDefaults(),Ee.setColorMode(Pt.colorModeForRenderPass()),ar.call(He,Ee.gl,Pt.transform.customLayerMatrix()),Ee.setDirty(),Pt.setBaseState())}else if(Pt.renderPass==="translucent"){Pt.setCustomLayerDefaults(),Ee.setColorMode(Pt.colorModeForRenderPass()),Ee.setStencilMode(as.disabled);let ar=He.renderingMode==="3d"?new Mo(Pt.context.gl.LEQUAL,Mo.ReadWrite,Pt.depthRangeFor3D):Pt.depthModeForSublayer(0,Mo.ReadOnly);Ee.setDepthMode(ar),He.render(Ee.gl,Pt.transform.customLayerMatrix(),{farZ:Pt.transform.farZ,nearZ:Pt.transform.nearZ,fov:Pt.transform._fov,modelViewProjectionMatrix:Pt.transform.modelViewProjectionMatrix,projectionMatrix:Pt.transform.projectionMatrix}),Ee.setDirty(),Pt.setBaseState(),Ee.bindFramebuffer.set(null)}})(P,0,_t)}}translatePosMatrix(P,at,_t,Tt,Pt){if(!_t[0]&&!_t[1])return P;let ie=Pt?Tt==="map"?this.transform.angle:0:Tt==="viewport"?-this.transform.angle:0;if(ie){let He=Math.sin(ie),ar=Math.cos(ie);_t=[_t[0]*ar-_t[1]*He,_t[0]*He+_t[1]*ar]}let de=[Pt?_t[0]:an(at,_t[0],this.transform.zoom),Pt?_t[1]:an(at,_t[1],this.transform.zoom),0],Ee=new Float32Array(16);return e.J(Ee,P,de),Ee}saveTileTexture(P){let at=this._tileTextures[P.size[0]];at?at.push(P):this._tileTextures[P.size[0]]=[P]}getTileTexture(P){let at=this._tileTextures[P];return at&&at.length>0?at.pop():null}isPatternMissing(P){if(!P)return!1;if(!P.from||!P.to)return!0;let at=this.imageManager.getPattern(P.from.toString()),_t=this.imageManager.getPattern(P.to.toString());return!at||!_t}useProgram(P,at){this.cache=this.cache||{};let _t=P+(at?at.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[_t]||(this.cache[_t]=new hn(this.context,Jr[P],at,ls[P],this._showOverdrawInspector,this.style.map.terrain)),this.cache[_t]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let P=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(P.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new f(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:P,drawingBufferHeight:at}=this.context.gl;return this.width!==P||this.height!==at}}class Xs{constructor(P,at){this.points=P,this.planes=at}static fromInvProjectionMatrix(P,at,_t){let Tt=Math.pow(2,_t),Pt=[[-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(de=>{let Ee=1/(de=e.af([],de,P))[3]/at*Tt;return e.b1(de,de,[Ee,Ee,1/de[3],Ee])}),ie=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(de=>{let Ee=function(zr,Zr){var Rt=Zr[0],Gt=Zr[1],ne=Zr[2],oe=Rt*Rt+Gt*Gt+ne*ne;return oe>0&&(oe=1/Math.sqrt(oe)),zr[0]=Zr[0]*oe,zr[1]=Zr[1]*oe,zr[2]=Zr[2]*oe,zr}([],function(zr,Zr,Rt){var Gt=Zr[0],ne=Zr[1],oe=Zr[2],be=Rt[0],pe=Rt[1],Ae=Rt[2];return zr[0]=ne*Ae-oe*pe,zr[1]=oe*be-Gt*Ae,zr[2]=Gt*pe-ne*be,zr}([],T([],Pt[de[0]],Pt[de[1]]),T([],Pt[de[2]],Pt[de[1]]))),He=-((ar=Ee)[0]*(ir=Pt[de[1]])[0]+ar[1]*ir[1]+ar[2]*ir[2]);var ar,ir;return Ee.concat(He)});return new Xs(Pt,ie)}}class Qu{constructor(P,at){this.min=P,this.max=at,this.center=function(_t,Tt,Pt){return _t[0]=.5*Tt[0],_t[1]=.5*Tt[1],_t[2]=.5*Tt[2],_t}([],function(_t,Tt,Pt){return _t[0]=Tt[0]+Pt[0],_t[1]=Tt[1]+Pt[1],_t[2]=Tt[2]+Pt[2],_t}([],this.min,this.max))}quadrant(P){let at=[P%2==0,P<2],_t=b(this.min),Tt=b(this.max);for(let Pt=0;Pt<at.length;Pt++)_t[Pt]=at[Pt]?this.min[Pt]:this.center[Pt],Tt[Pt]=at[Pt]?this.center[Pt]:this.max[Pt];return Tt[2]=this.max[2],new Qu(_t,Tt)}distanceX(P){return Math.max(Math.min(this.max[0],P[0]),this.min[0])-P[0]}distanceY(P){return Math.max(Math.min(this.max[1],P[1]),this.min[1])-P[1]}intersects(P){let at=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]],_t=!0;for(let Tt=0;Tt<P.planes.length;Tt++){let Pt=P.planes[Tt],ie=0;for(let de=0;de<at.length;de++)e.b2(Pt,at[de])>=0&&ie++;if(ie===0)return 0;ie!==at.length&&(_t=!1)}if(_t)return 2;for(let Tt=0;Tt<3;Tt++){let Pt=Number.MAX_VALUE,ie=-Number.MAX_VALUE;for(let de=0;de<P.points.length;de++){let Ee=P.points[de][Tt]-this.min[Tt];Pt=Math.min(Pt,Ee),ie=Math.max(ie,Ee)}if(ie<0||Pt>this.max[Tt]-this.min[Tt])return 0}return 1}}class yu{constructor(P=0,at=0,_t=0,Tt=0){if(isNaN(P)||P<0||isNaN(at)||at<0||isNaN(_t)||_t<0||isNaN(Tt)||Tt<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=P,this.bottom=at,this.left=_t,this.right=Tt}interpolate(P,at,_t){return at.top!=null&&P.top!=null&&(this.top=e.y.number(P.top,at.top,_t)),at.bottom!=null&&P.bottom!=null&&(this.bottom=e.y.number(P.bottom,at.bottom,_t)),at.left!=null&&P.left!=null&&(this.left=e.y.number(P.left,at.left,_t)),at.right!=null&&P.right!=null&&(this.right=e.y.number(P.right,at.right,_t)),this}getCenter(P,at){let _t=e.ac((this.left+P-this.right)/2,0,P),Tt=e.ac((this.top+at-this.bottom)/2,0,at);return new e.P(_t,Tt)}equals(P){return this.top===P.top&&this.bottom===P.bottom&&this.left===P.left&&this.right===P.right}clone(){return new yu(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let Xl=85.051129;class Ds{constructor(P,at,_t,Tt,Pt){this.tileSize=512,this._renderWorldCopies=Pt===void 0||!!Pt,this._minZoom=P||0,this._maxZoom=at||22,this._minPitch=_t??0,this._maxPitch=Tt??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new yu,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let P=new Ds(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return P.apply(this),P}apply(P){this.tileSize=P.tileSize,this.latRange=P.latRange,this.lngRange=P.lngRange,this.width=P.width,this.height=P.height,this._center=P._center,this._elevation=P._elevation,this.minElevationForCurrentTile=P.minElevationForCurrentTile,this.zoom=P.zoom,this.angle=P.angle,this._fov=P._fov,this._pitch=P._pitch,this._unmodified=P._unmodified,this._edgeInsets=P._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(P){this._minZoom!==P&&(this._minZoom=P,this.zoom=Math.max(this.zoom,P))}get maxZoom(){return this._maxZoom}set maxZoom(P){this._maxZoom!==P&&(this._maxZoom=P,this.zoom=Math.min(this.zoom,P))}get minPitch(){return this._minPitch}set minPitch(P){this._minPitch!==P&&(this._minPitch=P,this.pitch=Math.max(this.pitch,P))}get maxPitch(){return this._maxPitch}set maxPitch(P){this._maxPitch!==P&&(this._maxPitch=P,this.pitch=Math.min(this.pitch,P))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(P){P===void 0?P=!0:P===null&&(P=!1),this._renderWorldCopies=P}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(P){let at=-e.b3(P,-180,180)*Math.PI/180;this.angle!==at&&(this._unmodified=!1,this.angle=at,this._calcMatrices(),this.rotationMatrix=function(){var _t=new e.A(4);return e.A!=Float32Array&&(_t[1]=0,_t[2]=0),_t[0]=1,_t[3]=1,_t}(),function(_t,Tt,Pt){var ie=Tt[0],de=Tt[1],Ee=Tt[2],He=Tt[3],ar=Math.sin(Pt),ir=Math.cos(Pt);_t[0]=ie*ir+Ee*ar,_t[1]=de*ir+He*ar,_t[2]=ie*-ar+Ee*ir,_t[3]=de*-ar+He*ir}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(P){let at=e.ac(P,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==at&&(this._unmodified=!1,this._pitch=at,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(P){P=Math.max(.01,Math.min(60,P)),this._fov!==P&&(this._unmodified=!1,this._fov=P/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(P){let at=Math.min(Math.max(P,this.minZoom),this.maxZoom);this._zoom!==at&&(this._unmodified=!1,this._zoom=at,this.tileZoom=Math.max(0,Math.floor(at)),this.scale=this.zoomScale(at),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(P){P.lat===this._center.lat&&P.lng===this._center.lng||(this._unmodified=!1,this._center=P,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(P){P!==this._elevation&&(this._elevation=P,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(P){this._edgeInsets.equals(P)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,P,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(P){return this._edgeInsets.equals(P)}interpolatePadding(P,at,_t){this._unmodified=!1,this._edgeInsets.interpolate(P,at,_t),this._constrain(),this._calcMatrices()}coveringZoomLevel(P){let at=(P.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/P.tileSize));return Math.max(0,at)}getVisibleUnwrappedCoordinates(P){let at=[new e.b4(0,P)];if(this._renderWorldCopies){let _t=this.pointCoordinate(new e.P(0,0)),Tt=this.pointCoordinate(new e.P(this.width,0)),Pt=this.pointCoordinate(new e.P(this.width,this.height)),ie=this.pointCoordinate(new e.P(0,this.height)),de=Math.floor(Math.min(_t.x,Tt.x,Pt.x,ie.x)),Ee=Math.floor(Math.max(_t.x,Tt.x,Pt.x,ie.x)),He=1;for(let ar=de-He;ar<=Ee+He;ar++)ar!==0&&at.push(new e.b4(ar,P))}return at}coveringTiles(P){var at,_t;let Tt=this.coveringZoomLevel(P),Pt=Tt;if(P.minzoom!==void 0&&Tt<P.minzoom)return[];P.maxzoom!==void 0&&Tt>P.maxzoom&&(Tt=P.maxzoom);let ie=this.pointCoordinate(this.getCameraPoint()),de=e.Z.fromLngLat(this.center),Ee=Math.pow(2,Tt),He=[Ee*ie.x,Ee*ie.y,0],ar=[Ee*de.x,Ee*de.y,0],ir=Xs.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Tt),zr=P.minzoom||0;!P.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(zr=Tt);let Zr=P.terrain?2/Math.min(this.tileSize,P.tileSize)*this.tileSize:3,Rt=pe=>({aabb:new Qu([pe*Ee,0,0],[(pe+1)*Ee,Ee,0]),zoom:0,x:0,y:0,wrap:pe,fullyVisible:!1}),Gt=[],ne=[],oe=Tt,be=P.reparseOverscaled?Pt:Tt;if(this._renderWorldCopies)for(let pe=1;pe<=3;pe++)Gt.push(Rt(-pe)),Gt.push(Rt(pe));for(Gt.push(Rt(0));Gt.length>0;){let pe=Gt.pop(),Ae=pe.x,Xe=pe.y,nr=pe.fullyVisible;if(!nr){let nn=pe.aabb.intersects(ir);if(nn===0)continue;nr=nn===2}let or=P.terrain?He:ar,Tr=pe.aabb.distanceX(or),Rr=pe.aabb.distanceY(or),Qr=Math.max(Math.abs(Tr),Math.abs(Rr));if(pe.zoom===oe||Qr>Zr+(1<<oe-pe.zoom)-2&&pe.zoom>=zr){let nn=oe-pe.zoom,mn=He[0]-.5-(Ae<<nn),zn=He[1]-.5-(Xe<<nn);ne.push({tileID:new e.S(pe.zoom===oe?be:pe.zoom,pe.wrap,pe.zoom,Ae,Xe),distanceSq:M([ar[0]-.5-Ae,ar[1]-.5-Xe]),tileDistanceToCamera:Math.sqrt(mn*mn+zn*zn)})}else for(let nn=0;nn<4;nn++){let mn=(Ae<<1)+nn%2,zn=(Xe<<1)+(nn>>1),na=pe.zoom+1,Yn=pe.aabb.quadrant(nn);if(P.terrain){let la=new e.S(na,pe.wrap,na,mn,zn),Na=P.terrain.getMinMaxElevation(la),li=(at=Na.minElevation)!==null&&at!==void 0?at:this.elevation,Ka=(_t=Na.maxElevation)!==null&&_t!==void 0?_t:this.elevation;Yn=new Qu([Yn.min[0],Yn.min[1],li],[Yn.max[0],Yn.max[1],Ka])}Gt.push({aabb:Yn,zoom:na,x:mn,y:zn,wrap:pe.wrap,fullyVisible:nr})}}return ne.sort((pe,Ae)=>pe.distanceSq-Ae.distanceSq).map(pe=>pe.tileID)}resize(P,at){this.width=P,this.height=at,this.pixelsToGLUnits=[2/P,-2/at],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(P){return Math.pow(2,P)}scaleZoom(P){return Math.log(P)/Math.LN2}project(P){let at=e.ac(P.lat,-85.051129,Xl);return new e.P(e.O(P.lng)*this.worldSize,e.Q(at)*this.worldSize)}unproject(P){return new e.Z(P.x/this.worldSize,P.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(P){let at=this.elevation,_t=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Tt=this.pointLocation(this.centerPoint,P),Pt=P.getElevationForLngLatZoom(Tt,this.tileZoom);if(!(this.elevation-Pt))return;let ie=_t+at-Pt,de=Math.cos(this._pitch)*this.cameraToCenterDistance/ie/e.b5(1,Tt.lat),Ee=this.scaleZoom(de/this.tileSize);this._elevation=Pt,this._center=Tt,this.zoom=Ee}setLocationAtPoint(P,at){let _t=this.pointCoordinate(at),Tt=this.pointCoordinate(this.centerPoint),Pt=this.locationCoordinate(P),ie=new e.Z(Pt.x-(_t.x-Tt.x),Pt.y-(_t.y-Tt.y));this.center=this.coordinateLocation(ie),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(P,at){return at?this.coordinatePoint(this.locationCoordinate(P),at.getElevationForLngLatZoom(P,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(P))}pointLocation(P,at){return this.coordinateLocation(this.pointCoordinate(P,at))}locationCoordinate(P){return e.Z.fromLngLat(P)}coordinateLocation(P){return P&&P.toLngLat()}pointCoordinate(P,at){if(at){let zr=at.pointCoordinate(P);if(zr!=null)return zr}let _t=[P.x,P.y,0,1],Tt=[P.x,P.y,1,1];e.af(_t,_t,this.pixelMatrixInverse),e.af(Tt,Tt,this.pixelMatrixInverse);let Pt=_t[3],ie=Tt[3],de=_t[1]/Pt,Ee=Tt[1]/ie,He=_t[2]/Pt,ar=Tt[2]/ie,ir=He===ar?0:(0-He)/(ar-He);return new e.Z(e.y.number(_t[0]/Pt,Tt[0]/ie,ir)/this.worldSize,e.y.number(de,Ee,ir)/this.worldSize)}coordinatePoint(P,at=0,_t=this.pixelMatrix){let Tt=[P.x*this.worldSize,P.y*this.worldSize,at,1];return e.af(Tt,Tt,_t),new e.P(Tt[0]/Tt[3],Tt[1]/Tt[3])}getBounds(){let P=Math.max(0,this.height/2-this.getHorizon());return new it().extend(this.pointLocation(new e.P(0,P))).extend(this.pointLocation(new e.P(this.width,P))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new it([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(P){P?(this.lngRange=[P.getWest(),P.getEast()],this.latRange=[P.getSouth(),P.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Xl])}calculateTileMatrix(P){let at=P.canonical,_t=this.worldSize/this.zoomScale(at.z),Tt=at.x+Math.pow(2,at.z)*P.wrap,Pt=e.an(new Float64Array(16));return e.J(Pt,Pt,[Tt*_t,at.y*_t,0]),e.K(Pt,Pt,[_t/e.X,_t/e.X,1]),Pt}calculatePosMatrix(P,at=!1){let _t=P.key,Tt=at?this._alignedPosMatrixCache:this._posMatrixCache;if(Tt[_t])return Tt[_t];let Pt=this.calculateTileMatrix(P);return e.L(Pt,at?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Pt),Tt[_t]=new Float32Array(Pt),Tt[_t]}calculateFogMatrix(P){let at=P.key,_t=this._fogMatrixCache;if(_t[at])return _t[at];let Tt=this.calculateTileMatrix(P);return e.L(Tt,this.fogMatrix,Tt),_t[at]=new Float32Array(Tt),_t[at]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(P,at){at=e.ac(+at,this.minZoom,this.maxZoom);let _t={center:new e.N(P.lng,P.lat),zoom:at},Tt=this.lngRange;if(!this._renderWorldCopies&&Tt===null){let pe=179.9999999999;Tt=[-pe,pe]}let Pt=this.tileSize*this.zoomScale(_t.zoom),ie=0,de=Pt,Ee=0,He=Pt,ar=0,ir=0,{x:zr,y:Zr}=this.size;if(this.latRange){let pe=this.latRange;ie=e.Q(pe[1])*Pt,de=e.Q(pe[0])*Pt,de-ie<Zr&&(ar=Zr/(de-ie))}Tt&&(Ee=e.b3(e.O(Tt[0])*Pt,0,Pt),He=e.b3(e.O(Tt[1])*Pt,0,Pt),He<Ee&&(He+=Pt),He-Ee<zr&&(ir=zr/(He-Ee)));let{x:Rt,y:Gt}=this.project.call({worldSize:Pt},P),ne,oe,be=Math.max(ir||0,ar||0);if(be){let pe=new e.P(ir?(He+Ee)/2:Rt,ar?(de+ie)/2:Gt);return _t.center=this.unproject.call({worldSize:Pt},pe).wrap(),_t.zoom+=this.scaleZoom(be),_t}if(this.latRange){let pe=Zr/2;Gt-pe<ie&&(oe=ie+pe),Gt+pe>de&&(oe=de-pe)}if(Tt){let pe=(Ee+He)/2,Ae=Rt;this._renderWorldCopies&&(Ae=e.b3(Rt,pe-Pt/2,pe+Pt/2));let Xe=zr/2;Ae-Xe<Ee&&(ne=Ee+Xe),Ae+Xe>He&&(ne=He-Xe)}if(ne!==void 0||oe!==void 0){let pe=new e.P(ne??Rt,oe??Gt);_t.center=this.unproject.call({worldSize:Pt},pe).wrap()}return _t}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let P=this._unmodified,{center:at,zoom:_t}=this.getConstrained(this.center,this.zoom);this.center=at,this.zoom=_t,this._unmodified=P,this._constraining=!1}_calcMatrices(){if(!this.height)return;let P=this.centerOffset,at=this.point.x,_t=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let Tt=e.an(new Float64Array(16));e.K(Tt,Tt,[this.width/2,-this.height/2,1]),e.J(Tt,Tt,[1,-1,0]),this.labelPlaneMatrix=Tt,Tt=e.an(new Float64Array(16)),e.K(Tt,Tt,[1,-1,1]),e.J(Tt,Tt,[-1,-1,0]),e.K(Tt,Tt,[2/this.width,2/this.height,1]),this.glCoordMatrix=Tt;let Pt=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),ie=Math.min(this.elevation,this.minElevationForCurrentTile),de=Pt-ie*this._pixelPerMeter/Math.cos(this._pitch),Ee=ie<0?de:Pt,He=Math.PI/2+this._pitch,ar=this._fov*(.5+P.y/this.height),ir=Math.sin(ar)*Ee/Math.sin(e.ac(Math.PI-He-ar,.01,Math.PI-.01)),zr=this.getHorizon(),Zr=2*Math.atan(zr/this.cameraToCenterDistance)*(.5+P.y/(2*zr)),Rt=Math.sin(Zr)*Ee/Math.sin(e.ac(Math.PI-He-Zr,.01,Math.PI-.01)),Gt=Math.min(ir,Rt);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Gt+Ee),this.nearZ=this.height/50,Tt=new Float64Array(16),e.b6(Tt,this._fov,this.width/this.height,this.nearZ,this.farZ),Tt[8]=2*-P.x/this.width,Tt[9]=2*P.y/this.height,this.projectionMatrix=e.ae(Tt),e.K(Tt,Tt,[1,-1,1]),e.J(Tt,Tt,[0,0,-this.cameraToCenterDistance]),e.b7(Tt,Tt,this._pitch),e.ad(Tt,Tt,this.angle),e.J(Tt,Tt,[-at,-_t,0]),this.mercatorMatrix=e.K([],Tt,[this.worldSize,this.worldSize,this.worldSize]),e.K(Tt,Tt,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,Tt),e.J(Tt,Tt,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Tt,this.invModelViewProjectionMatrix=e.as([],Tt),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,Pt,this.farZ),this.fogMatrix[8]=2*-P.x/this.width,this.fogMatrix[9]=2*P.y/this.height,e.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),e.b7(this.fogMatrix,this.fogMatrix,this._pitch),e.ad(this.fogMatrix,this.fogMatrix,this.angle),e.J(this.fogMatrix,this.fogMatrix,[-at,-_t,0]),e.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=e.L(new Float64Array(16),this.labelPlaneMatrix,Tt);let ne=this.width%2/2,oe=this.height%2/2,be=Math.cos(this.angle),pe=Math.sin(this.angle),Ae=at-Math.round(at)+be*ne+pe*oe,Xe=_t-Math.round(_t)+be*oe+pe*ne,nr=new Float64Array(Tt);if(e.J(nr,nr,[Ae>.5?Ae-1:Ae,Xe>.5?Xe-1:Xe,0]),this.alignedModelViewProjectionMatrix=nr,Tt=e.as(new Float64Array(16),this.pixelMatrix),!Tt)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Tt,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let P=this.pointCoordinate(new e.P(0,0)),at=[P.x*this.worldSize,P.y*this.worldSize,0,1];return e.af(at,at,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let P=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,P))}getCameraQueryGeometry(P){let at=this.getCameraPoint();if(P.length===1)return[P[0],at];{let _t=at.x,Tt=at.y,Pt=at.x,ie=at.y;for(let de of P)_t=Math.min(_t,de.x),Tt=Math.min(Tt,de.y),Pt=Math.max(Pt,de.x),ie=Math.max(ie,de.y);return[new e.P(_t,Tt),new e.P(Pt,Tt),new e.P(Pt,ie),new e.P(_t,ie),new e.P(_t,Tt)]}}lngLatToCameraDepth(P,at){let _t=this.locationCoordinate(P),Tt=[_t.x*this.worldSize,_t.y*this.worldSize,at,1];return e.af(Tt,Tt,this.modelViewProjectionMatrix),Tt[2]/Tt[3]}}function gc(Lt,P){let at,_t=!1,Tt=null,Pt=null,ie=()=>{Tt=null,_t&&(Lt.apply(Pt,at),Tt=setTimeout(ie,P),_t=!1)};return(...de)=>(_t=!0,Pt=this,at=de,Tt||ie(),Tt)}class Su{constructor(P){this._getCurrentHash=()=>{let at=window.location.hash.replace("#","");if(this._hashName){let _t;return at.split("&").map(Tt=>Tt.split("=")).forEach(Tt=>{Tt[0]===this._hashName&&(_t=Tt)}),(_t&&_t[1]||"").split("/")}return at.split("/")},this._onHashChange=()=>{let at=this._getCurrentHash();if(at.length>=3&&!at.some(_t=>isNaN(_t))){let _t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(at[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+at[2],+at[1]],zoom:+at[0],bearing:_t,pitch:+(at[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let at=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,at)},this._removeHash=()=>{let at=this._getCurrentHash();if(at.length===0)return;let _t=at.join("/"),Tt=_t;Tt.split("&").length>0&&(Tt=Tt.split("&")[0]),this._hashName&&(Tt=`${this._hashName}=${_t}`);let Pt=window.location.hash.replace(Tt,"");Pt.startsWith("#&")?Pt=Pt.slice(0,1)+Pt.slice(2):Pt==="#"&&(Pt="");let ie=window.location.href.replace(/(#.+)?$/,Pt);ie=ie.replace("&&","&"),window.history.replaceState(window.history.state,null,ie)},this._updateHash=gc(this._updateHashUnthrottled,300),this._hashName=P&&encodeURIComponent(P)}addTo(P){return this._map=P,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()),this._removeHash(),delete this._map,this}getHashString(P){let at=this._map.getCenter(),_t=Math.round(100*this._map.getZoom())/100,Tt=Math.ceil((_t*Math.LN2+Math.log(512/360/.5))/Math.LN10),Pt=Math.pow(10,Tt),ie=Math.round(at.lng*Pt)/Pt,de=Math.round(at.lat*Pt)/Pt,Ee=this._map.getBearing(),He=this._map.getPitch(),ar="";if(ar+=P?`/${ie}/${de}/${_t}`:`${_t}/${de}/${ie}`,(Ee||He)&&(ar+="/"+Math.round(10*Ee)/10),He&&(ar+=`/${Math.round(He)}`),this._hashName){let ir=this._hashName,zr=!1,Zr=window.location.hash.slice(1).split("&").map(Rt=>{let Gt=Rt.split("=")[0];return Gt===ir?(zr=!0,`${Gt}=${ar}`):Rt}).filter(Rt=>Rt);return zr||Zr.push(`${ir}=${ar}`),`#${Zr.join("&")}`}return`#${ar}`}}let Yu={linearity:.3,easing:e.b8(0,0,.3,1)},_c=e.e({deceleration:2500,maxSpeed:1400},Yu),bh=e.e({deceleration:20,maxSpeed:1400},Yu),Zh=e.e({deceleration:1e3,maxSpeed:360},Yu),ac=e.e({deceleration:1e3,maxSpeed:90},Yu);class bc{constructor(P){this._map=P,this.clear()}clear(){this._inertiaBuffer=[]}record(P){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.now(),settings:P})}_drainInertiaBuffer(){let P=this._inertiaBuffer,at=o.now();for(;P.length>0&&at-P[0].time>160;)P.shift()}_onMoveEnd(P){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let at={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:Pt}of this._inertiaBuffer)at.zoom+=Pt.zoomDelta||0,at.bearing+=Pt.bearingDelta||0,at.pitch+=Pt.pitchDelta||0,Pt.panDelta&&at.pan._add(Pt.panDelta),Pt.around&&(at.around=Pt.around),Pt.pinchAround&&(at.pinchAround=Pt.pinchAround);let _t=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Tt={};if(at.pan.mag()){let Pt=zc(at.pan.mag(),_t,e.e({},_c,P||{}));Tt.offset=at.pan.mult(Pt.amount/at.pan.mag()),Tt.center=this._map.transform.center,Ll(Tt,Pt)}if(at.zoom){let Pt=zc(at.zoom,_t,bh);Tt.zoom=this._map.transform.zoom+Pt.amount,Ll(Tt,Pt)}if(at.bearing){let Pt=zc(at.bearing,_t,Zh);Tt.bearing=this._map.transform.bearing+e.ac(Pt.amount,-179,179),Ll(Tt,Pt)}if(at.pitch){let Pt=zc(at.pitch,_t,ac);Tt.pitch=this._map.transform.pitch+Pt.amount,Ll(Tt,Pt)}if(Tt.zoom||Tt.bearing){let Pt=at.pinchAround===void 0?at.around:at.pinchAround;Tt.around=Pt?this._map.unproject(Pt):this._map.getCenter()}return this.clear(),e.e(Tt,{noMoveStart:!0})}}function Ll(Lt,P){(!Lt.duration||Lt.duration<P.duration)&&(Lt.duration=P.duration,Lt.easing=P.easing)}function zc(Lt,P,at){let{maxSpeed:_t,linearity:Tt,deceleration:Pt}=at,ie=e.ac(Lt*Tt/(P/1e3),-_t,_t),de=Math.abs(ie)/(Pt*Tt);return{easing:at.easing,duration:1e3*de,amount:ie*(de/2)}}class $l extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(P,at,_t,Tt={}){let Pt=a.mousePos(at.getCanvas(),_t),ie=at.unproject(Pt);super(P,e.e({point:Pt,lngLat:ie,originalEvent:_t},Tt)),this._defaultPrevented=!1,this.target=at}}class ic extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(P,at,_t){let Tt=P==="touchend"?_t.changedTouches:_t.touches,Pt=a.touchPos(at.getCanvasContainer(),Tt),ie=Pt.map(Ee=>at.unproject(Ee)),de=Pt.reduce((Ee,He,ar,ir)=>Ee.add(He.div(ir.length)),new e.P(0,0));super(P,{points:Pt,point:de,lngLats:ie,lngLat:at.unproject(de),originalEvent:_t}),this._defaultPrevented=!1}}class Oc extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(P,at,_t){super(P,{originalEvent:_t}),this._defaultPrevented=!1}}class Ku{constructor(P,at){this._map=P,this._clickTolerance=at.clickTolerance}reset(){delete this._mousedownPos}wheel(P){return this._firePreventable(new Oc(P.type,this._map,P))}mousedown(P,at){return this._mousedownPos=at,this._firePreventable(new $l(P.type,this._map,P))}mouseup(P){this._map.fire(new $l(P.type,this._map,P))}click(P,at){this._mousedownPos&&this._mousedownPos.dist(at)>=this._clickTolerance||this._map.fire(new $l(P.type,this._map,P))}dblclick(P){return this._firePreventable(new $l(P.type,this._map,P))}mouseover(P){this._map.fire(new $l(P.type,this._map,P))}mouseout(P){this._map.fire(new $l(P.type,this._map,P))}touchstart(P){return this._firePreventable(new ic(P.type,this._map,P))}touchmove(P){this._map.fire(new ic(P.type,this._map,P))}touchend(P){this._map.fire(new ic(P.type,this._map,P))}touchcancel(P){this._map.fire(new ic(P.type,this._map,P))}_firePreventable(P){if(this._map.fire(P),P.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Os{constructor(P){this._map=P}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(P){this._map.fire(new $l(P.type,this._map,P))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new $l("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(P){this._delayContextMenu?this._contextMenuEvent=P:this._ignoreContextMenu||this._map.fire(new $l(P.type,this._map,P)),this._map.listens("contextmenu")&&P.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Eu{constructor(P){this._map=P}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(P){return this.transform.pointLocation(e.P.convert(P),this._map.terrain)}}class Jl{constructor(P,at){this._map=P,this._tr=new Eu(P),this._el=P.getCanvasContainer(),this._container=P.getContainer(),this._clickTolerance=at.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(P,at){this.isEnabled()&&P.shiftKey&&P.button===0&&(a.disableDrag(),this._startPos=this._lastPos=at,this._active=!0)}mousemoveWindow(P,at){if(!this._active)return;let _t=at;if(this._lastPos.equals(_t)||!this._box&&_t.dist(this._startPos)<this._clickTolerance)return;let Tt=this._startPos;this._lastPos=_t,this._box||(this._box=a.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",P));let Pt=Math.min(Tt.x,_t.x),ie=Math.max(Tt.x,_t.x),de=Math.min(Tt.y,_t.y),Ee=Math.max(Tt.y,_t.y);a.setTransform(this._box,`translate(${Pt}px,${de}px)`),this._box.style.width=ie-Pt+"px",this._box.style.height=Ee-de+"px"}mouseupWindow(P,at){if(!this._active||P.button!==0)return;let _t=this._startPos,Tt=at;if(this.reset(),a.suppressClick(),_t.x!==Tt.x||_t.y!==Tt.y)return this._map.fire(new e.k("boxzoomend",{originalEvent:P})),{cameraAnimation:Pt=>Pt.fitScreenCoordinates(_t,Tt,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",P)}keydown(P){this._active&&P.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",P))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(a.remove(this._box),this._box=null),a.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(P,at){return this._map.fire(new e.k(P,{originalEvent:at}))}}function ch(Lt,P){if(Lt.length!==P.length)throw new Error(`The number of touches and points are not equal - touches ${Lt.length}, points ${P.length}`);let at={};for(let _t=0;_t<Lt.length;_t++)at[Lt[_t].identifier]=P[_t];return at}class Ps{constructor(P){this.reset(),this.numTouches=P.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(P,at,_t){(this.centroid||_t.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=P.timeStamp),_t.length===this.numTouches&&(this.centroid=function(Tt){let Pt=new e.P(0,0);for(let ie of Tt)Pt._add(ie);return Pt.div(Tt.length)}(at),this.touches=ch(_t,at)))}touchmove(P,at,_t){if(this.aborted||!this.centroid)return;let Tt=ch(_t,at);for(let Pt in this.touches){let ie=Tt[Pt];(!ie||ie.dist(this.touches[Pt])>30)&&(this.aborted=!0)}}touchend(P,at,_t){if((!this.centroid||P.timeStamp-this.startTime>500)&&(this.aborted=!0),_t.length===0){let Tt=!this.aborted&&this.centroid;if(this.reset(),Tt)return Tt}}}class mc{constructor(P){this.singleTap=new Ps(P),this.numTaps=P.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(P,at,_t){this.singleTap.touchstart(P,at,_t)}touchmove(P,at,_t){this.singleTap.touchmove(P,at,_t)}touchend(P,at,_t){let Tt=this.singleTap.touchend(P,at,_t);if(Tt){let Pt=P.timeStamp-this.lastTime<500,ie=!this.lastTap||this.lastTap.dist(Tt)<30;if(Pt&&ie||this.reset(),this.count++,this.lastTime=P.timeStamp,this.lastTap=Tt,this.count===this.numTaps)return this.reset(),Tt}}}class ju{constructor(P){this._tr=new Eu(P),this._zoomIn=new mc({numTouches:1,numTaps:2}),this._zoomOut=new mc({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(P,at,_t){this._zoomIn.touchstart(P,at,_t),this._zoomOut.touchstart(P,at,_t)}touchmove(P,at,_t){this._zoomIn.touchmove(P,at,_t),this._zoomOut.touchmove(P,at,_t)}touchend(P,at,_t){let Tt=this._zoomIn.touchend(P,at,_t),Pt=this._zoomOut.touchend(P,at,_t),ie=this._tr;return Tt?(this._active=!0,P.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:de=>de.easeTo({duration:300,zoom:ie.zoom+1,around:ie.unproject(Tt)},{originalEvent:P})}):Pt?(this._active=!0,P.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:de=>de.easeTo({duration:300,zoom:ie.zoom-1,around:ie.unproject(Pt)},{originalEvent:P})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ql{constructor(P){this._enabled=!!P.enable,this._moveStateManager=P.moveStateManager,this._clickTolerance=P.clickTolerance||1,this._moveFunction=P.move,this._activateOnStart=!!P.activateOnStart,P.assignEvents(this),this.reset()}reset(P){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(P)}_move(...P){let at=this._moveFunction(...P);if(at.bearingDelta||at.pitchDelta||at.around||at.panDelta)return this._active=!0,at}dragStart(P,at){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(P)&&(this._moveStateManager.startMove(P),this._lastPoint=at.length?at[0]:at,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(P,at){if(!this.isEnabled())return;let _t=this._lastPoint;if(!_t)return;if(P.preventDefault(),!this._moveStateManager.isValidMoveEvent(P))return void this.reset(P);let Tt=at.length?at[0]:at;return!this._moved&&Tt.dist(_t)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=Tt,this._move(_t,Tt))}dragEnd(P){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(P)&&(this._moved&&a.suppressClick(),this.reset(P))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let oc={0:1,2:2};class Nu{constructor(P){this._correctEvent=P.checkCorrectEvent}startMove(P){let at=a.mouseButton(P);this._eventButton=at}endMove(P){delete this._eventButton}isValidStartEvent(P){return this._correctEvent(P)}isValidMoveEvent(P){return!function(at,_t){let Tt=oc[_t];return at.buttons===void 0||(at.buttons&Tt)!==Tt}(P,this._eventButton)}isValidEndEvent(P){return a.mouseButton(P)===this._eventButton}}class vc{constructor(){this._firstTouch=void 0}_isOneFingerTouch(P){return P.targetTouches.length===1}_isSameTouchEvent(P){return P.targetTouches[0].identifier===this._firstTouch}startMove(P){this._firstTouch=P.targetTouches[0].identifier}endMove(P){delete this._firstTouch}isValidStartEvent(P){return this._isOneFingerTouch(P)}isValidMoveEvent(P){return this._isOneFingerTouch(P)&&this._isSameTouchEvent(P)}isValidEndEvent(P){return this._isOneFingerTouch(P)&&this._isSameTouchEvent(P)}}let wh=Lt=>{Lt.mousedown=Lt.dragStart,Lt.mousemoveWindow=Lt.dragMove,Lt.mouseup=Lt.dragEnd,Lt.contextmenu=P=>{P.preventDefault()}},cl=({enable:Lt,clickTolerance:P,bearingDegreesPerPixelMoved:at=.8})=>{let _t=new Nu({checkCorrectEvent:Tt=>a.mouseButton(Tt)===0&&Tt.ctrlKey||a.mouseButton(Tt)===2});return new Ql({clickTolerance:P,move:(Tt,Pt)=>({bearingDelta:(Pt.x-Tt.x)*at}),moveStateManager:_t,enable:Lt,assignEvents:wh})},Qc=({enable:Lt,clickTolerance:P,pitchDegreesPerPixelMoved:at=-.5})=>{let _t=new Nu({checkCorrectEvent:Tt=>a.mouseButton(Tt)===0&&Tt.ctrlKey||a.mouseButton(Tt)===2});return new Ql({clickTolerance:P,move:(Tt,Pt)=>({pitchDelta:(Pt.y-Tt.y)*at}),moveStateManager:_t,enable:Lt,assignEvents:wh})};class Yl{constructor(P,at){this._clickTolerance=P.clickTolerance||1,this._map=at,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(P){return P<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(P,at,_t){return this._calculateTransform(P,at,_t)}touchmove(P,at,_t){if(this._active){if(!this._shouldBePrevented(_t.length))return P.preventDefault(),this._calculateTransform(P,at,_t);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",P)}}touchend(P,at,_t){this._calculateTransform(P,at,_t),this._active&&this._shouldBePrevented(_t.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(P,at,_t){_t.length>0&&(this._active=!0);let Tt=ch(_t,at),Pt=new e.P(0,0),ie=new e.P(0,0),de=0;for(let He in Tt){let ar=Tt[He],ir=this._touches[He];ir&&(Pt._add(ar),ie._add(ar.sub(ir)),de++,Tt[He]=ar)}if(this._touches=Tt,this._shouldBePrevented(de)||!ie.mag())return;let Ee=ie.div(de);return this._sum._add(Ee),this._sum.mag()<this._clickTolerance?void 0:{around:Pt.div(de),panDelta:Ee}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Pu{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(P,at,_t){this._firstTwoTouches||_t.length<2||(this._firstTwoTouches=[_t[0].identifier,_t[1].identifier],this._start([at[0],at[1]]))}touchmove(P,at,_t){if(!this._firstTwoTouches)return;P.preventDefault();let[Tt,Pt]=this._firstTwoTouches,ie=xu(_t,at,Tt),de=xu(_t,at,Pt);if(!ie||!de)return;let Ee=this._aroundCenter?null:ie.add(de).div(2);return this._move([ie,de],Ee,P)}touchend(P,at,_t){if(!this._firstTwoTouches)return;let[Tt,Pt]=this._firstTwoTouches,ie=xu(_t,at,Tt),de=xu(_t,at,Pt);ie&&de||(this._active&&a.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(P){this._enabled=!0,this._aroundCenter=!!P&&P.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function xu(Lt,P,at){for(let _t=0;_t<Lt.length;_t++)if(Lt[_t].identifier===at)return P[_t]}function Vs(Lt,P){return Math.log(Lt/P)/Math.LN2}class qs extends Pu{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(P){this._startDistance=this._distance=P[0].dist(P[1])}_move(P,at){let _t=this._distance;if(this._distance=P[0].dist(P[1]),this._active||!(Math.abs(Vs(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Vs(this._distance,_t),pinchAround:at}}}function Iu(Lt,P){return 180*Lt.angleWith(P)/Math.PI}class sc extends Pu{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(P){this._startVector=this._vector=P[0].sub(P[1]),this._minDiameter=P[0].dist(P[1])}_move(P,at,_t){let Tt=this._vector;if(this._vector=P[0].sub(P[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Iu(this._vector,Tt),pinchAround:at}}_isBelowThreshold(P){this._minDiameter=Math.min(this._minDiameter,P.mag());let at=25/(Math.PI*this._minDiameter)*360,_t=Iu(P,this._startVector);return Math.abs(_t)<at}}function _u(Lt){return Math.abs(Lt.y)>Math.abs(Lt.x)}class wc extends Pu{constructor(P){super(),this._currentTouchCount=0,this._map=P}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(P,at,_t){super.touchstart(P,at,_t),this._currentTouchCount=_t.length}_start(P){this._lastPoints=P,_u(P[0].sub(P[1]))&&(this._valid=!1)}_move(P,at,_t){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let Tt=P[0].sub(this._lastPoints[0]),Pt=P[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Tt,Pt,_t.timeStamp),this._valid?(this._lastPoints=P,this._active=!0,{pitchDelta:(Tt.y+Pt.y)/2*-.5}):void 0}gestureBeginsVertically(P,at,_t){if(this._valid!==void 0)return this._valid;let Tt=P.mag()>=2,Pt=at.mag()>=2;if(!Tt&&!Pt)return;if(!Tt||!Pt)return this._firstMove===void 0&&(this._firstMove=_t),_t-this._firstMove<100&&void 0;let ie=P.y>0==at.y>0;return _u(P)&&_u(at)&&ie}}let Ve={panStep:100,bearingStep:15,pitchStep:10};class lr{constructor(P){this._tr=new Eu(P);let at=Ve;this._panStep=at.panStep,this._bearingStep=at.bearingStep,this._pitchStep=at.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(P){if(P.altKey||P.ctrlKey||P.metaKey)return;let at=0,_t=0,Tt=0,Pt=0,ie=0;switch(P.keyCode){case 61:case 107:case 171:case 187:at=1;break;case 189:case 109:case 173:at=-1;break;case 37:P.shiftKey?_t=-1:(P.preventDefault(),Pt=-1);break;case 39:P.shiftKey?_t=1:(P.preventDefault(),Pt=1);break;case 38:P.shiftKey?Tt=1:(P.preventDefault(),ie=-1);break;case 40:P.shiftKey?Tt=-1:(P.preventDefault(),ie=1);break;default:return}return this._rotationDisabled&&(_t=0,Tt=0),{cameraAnimation:de=>{let Ee=this._tr;de.easeTo({duration:300,easeId:"keyboardHandler",easing:Ur,zoom:at?Math.round(Ee.zoom)+at*(P.shiftKey?2:1):Ee.zoom,bearing:Ee.bearing+_t*this._bearingStep,pitch:Ee.pitch+Tt*this._pitchStep,offset:[-Pt*this._panStep,-ie*this._panStep],center:Ee.center},{originalEvent:P})}}}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 Ur(Lt){return Lt*(2-Lt)}let Or=4.000244140625;class un{constructor(P,at){this._onTimeout=_t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(_t)},this._map=P,this._tr=new Eu(P),this._triggerRenderFrame=at,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(P){this._defaultZoomRate=P}setWheelZoomRate(P){this._wheelZoomRate=P}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(P){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!P&&P.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(P){return!!this._map.cooperativeGestures.isEnabled()&&!(P.ctrlKey||this._map.cooperativeGestures.isBypassed(P))}wheel(P){if(!this.isEnabled())return;if(this._shouldBePrevented(P))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",P);let at=P.deltaMode===WheelEvent.DOM_DELTA_LINE?40*P.deltaY:P.deltaY,_t=o.now(),Tt=_t-(this._lastWheelEventTime||0);this._lastWheelEventTime=_t,at!==0&&at%Or==0?this._type="wheel":at!==0&&Math.abs(at)<4?this._type="trackpad":Tt>400?(this._type=null,this._lastValue=at,this._timeout=setTimeout(this._onTimeout,40,P)):this._type||(this._type=Math.abs(Tt*at)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,at+=this._lastValue)),P.shiftKey&&at&&(at/=4),this._type&&(this._lastWheelEvent=P,this._delta-=at,this._active||this._start(P)),P.preventDefault()}_start(P){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let at=a.mousePos(this._map.getCanvas(),P),_t=this._tr;this._around=at.y>_t.transform.height/2-_t.transform.getHorizon()?e.N.convert(this._aroundCenter?_t.center:_t.unproject(at)):e.N.convert(_t.center),this._aroundPoint=_t.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let P=this._tr.transform;if(this._delta!==0){let Ee=this._type==="wheel"&&Math.abs(this._delta)>Or?this._wheelZoomRate:this._defaultZoomRate,He=2/(1+Math.exp(-Math.abs(this._delta*Ee)));this._delta<0&&He!==0&&(He=1/He);let ar=typeof this._targetZoom=="number"?P.zoomScale(this._targetZoom):P.scale;this._targetZoom=Math.min(P.maxZoom,Math.max(P.minZoom,P.scaleZoom(ar*He))),this._type==="wheel"&&(this._startZoom=P.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let at=typeof this._targetZoom=="number"?this._targetZoom:P.zoom,_t=this._startZoom,Tt=this._easing,Pt,ie=!1,de=o.now()-this._lastWheelEventTime;if(this._type==="wheel"&&_t&&Tt&&de){let Ee=Math.min(de/200,1),He=Tt(Ee);Pt=e.y.number(_t,at,He),Ee<1?this._frameId||(this._frameId=!0):ie=!0}else Pt=at,ie=!0;return this._active=!0,ie&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ie,zoomDelta:Pt-P.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(P){let at=e.b9;if(this._prevEase){let _t=this._prevEase,Tt=(o.now()-_t.start)/_t.duration,Pt=_t.easing(Tt+.01)-_t.easing(Tt),ie=.27/Math.sqrt(Pt*Pt+1e-4)*.01,de=Math.sqrt(.0729-ie*ie);at=e.b8(ie,de,.25,1)}return this._prevEase={start:o.now(),duration:P,easing:at},at}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ln{constructor(P,at){this._clickZoom=P,this._tapZoom=at}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 Gn{constructor(P){this._tr=new Eu(P),this.reset()}reset(){this._active=!1}dblclick(P,at){return P.preventDefault(),{cameraAnimation:_t=>{_t.easeTo({duration:300,zoom:this._tr.zoom+(P.shiftKey?-1:1),around:this._tr.unproject(at)},{originalEvent:P})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class oa{constructor(){this._tap=new mc({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(P,at,_t){if(!this._swipePoint)if(this._tapTime){let Tt=at[0],Pt=P.timeStamp-this._tapTime<500,ie=this._tapPoint.dist(Tt)<30;Pt&&ie?_t.length>0&&(this._swipePoint=Tt,this._swipeTouch=_t[0].identifier):this.reset()}else this._tap.touchstart(P,at,_t)}touchmove(P,at,_t){if(this._tapTime){if(this._swipePoint){if(_t[0].identifier!==this._swipeTouch)return;let Tt=at[0],Pt=Tt.y-this._swipePoint.y;return this._swipePoint=Tt,P.preventDefault(),this._active=!0,{zoomDelta:Pt/128}}}else this._tap.touchmove(P,at,_t)}touchend(P,at,_t){if(this._tapTime)this._swipePoint&&_t.length===0&&this.reset();else{let Tt=this._tap.touchend(P,at,_t);Tt&&(this._tapTime=P.timeStamp,this._tapPoint=Tt)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ya{constructor(P,at,_t){this._el=P,this._mousePan=at,this._touchPan=_t}enable(P){this._inertiaOptions=P||{},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 Pa{constructor(P,at,_t){this._pitchWithRotate=P.pitchWithRotate,this._mouseRotate=at,this._mousePitch=_t}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 Jn{constructor(P,at,_t,Tt){this._el=P,this._touchZoom=at,this._touchRotate=_t,this._tapDragZoom=Tt,this._rotationDisabled=!1,this._enabled=!0}enable(P){this._touchZoom.enable(P),this._rotationDisabled||this._touchRotate.enable(P),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()}}class va{constructor(P,at){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=P,this._options=at,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let P=this._map.getCanvasContainer();P.classList.add("maplibregl-cooperative-gestures"),this._container=a.create("div","maplibregl-cooperative-gesture-screen",P);let at=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(at=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let _t=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Tt=document.createElement("div");Tt.className="maplibregl-desktop-message",Tt.textContent=at,this._container.appendChild(Tt);let Pt=document.createElement("div");Pt.className="maplibregl-mobile-message",Pt.textContent=_t,this._container.appendChild(Pt),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(a.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(P){return P[this._bypassKey]}notifyGestureBlocked(P,at){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:P,originalEvent:at})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let sa=Lt=>Lt.zoom||Lt.drag||Lt.pitch||Lt.rotate;class qn extends e.k{}function Fa(Lt){return Lt.panDelta&&Lt.panDelta.mag()||Lt.zoomDelta||Lt.bearingDelta||Lt.pitchDelta}class Fi{constructor(P,at){this.handleWindowEvent=Tt=>{this.handleEvent(Tt,`${Tt.type}Window`)},this.handleEvent=(Tt,Pt)=>{if(Tt.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let ie=Tt.type==="renderFrame"?void 0:Tt,de={needsRenderFrame:!1},Ee={},He={},ar=Tt.touches,ir=ar?this._getMapTouches(ar):void 0,zr=ir?a.touchPos(this._map.getCanvas(),ir):a.mousePos(this._map.getCanvas(),Tt);for(let{handlerName:Gt,handler:ne,allowed:oe}of this._handlers){if(!ne.isEnabled())continue;let be;this._blockedByActive(He,oe,Gt)?ne.reset():ne[Pt||Tt.type]&&(be=ne[Pt||Tt.type](Tt,zr,ir),this.mergeHandlerResult(de,Ee,be,Gt,ie),be&&be.needsRenderFrame&&this._triggerRenderFrame()),(be||ne.isActive())&&(He[Gt]=ne)}let Zr={};for(let Gt in this._previousActiveHandlers)He[Gt]||(Zr[Gt]=ie);this._previousActiveHandlers=He,(Object.keys(Zr).length||Fa(de))&&(this._changes.push([de,Ee,Zr]),this._triggerRenderFrame()),(Object.keys(He).length||Fa(de))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:Rt}=de;Rt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Rt(this._map))},this._map=P,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new bc(P),this._bearingSnap=at.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(at);let _t=this._el;this._listeners=[[_t,"touchstart",{passive:!0}],[_t,"touchmove",{passive:!1}],[_t,"touchend",void 0],[_t,"touchcancel",void 0],[_t,"mousedown",void 0],[_t,"mousemove",void 0],[_t,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[_t,"mouseover",void 0],[_t,"mouseout",void 0],[_t,"dblclick",void 0],[_t,"click",void 0],[_t,"keydown",{capture:!1}],[_t,"keyup",void 0],[_t,"wheel",{passive:!1}],[_t,"contextmenu",void 0],[window,"blur",void 0]];for(let[Tt,Pt,ie]of this._listeners)a.addEventListener(Tt,Pt,Tt===document?this.handleWindowEvent:this.handleEvent,ie)}destroy(){for(let[P,at,_t]of this._listeners)a.removeEventListener(P,at,P===document?this.handleWindowEvent:this.handleEvent,_t)}_addDefaultHandlers(P){let at=this._map,_t=at.getCanvasContainer();this._add("mapEvent",new Ku(at,P));let Tt=at.boxZoom=new Jl(at,P);this._add("boxZoom",Tt),P.interactive&&P.boxZoom&&Tt.enable();let Pt=at.cooperativeGestures=new va(at,P.cooperativeGestures);this._add("cooperativeGestures",Pt),P.cooperativeGestures&&Pt.enable();let ie=new ju(at),de=new Gn(at);at.doubleClickZoom=new Ln(de,ie),this._add("tapZoom",ie),this._add("clickZoom",de),P.interactive&&P.doubleClickZoom&&at.doubleClickZoom.enable();let Ee=new oa;this._add("tapDragZoom",Ee);let He=at.touchPitch=new wc(at);this._add("touchPitch",He),P.interactive&&P.touchPitch&&at.touchPitch.enable(P.touchPitch);let ar=cl(P),ir=Qc(P);at.dragRotate=new Pa(P,ar,ir),this._add("mouseRotate",ar,["mousePitch"]),this._add("mousePitch",ir,["mouseRotate"]),P.interactive&&P.dragRotate&&at.dragRotate.enable();let zr=(({enable:be,clickTolerance:pe})=>{let Ae=new Nu({checkCorrectEvent:Xe=>a.mouseButton(Xe)===0&&!Xe.ctrlKey});return new Ql({clickTolerance:pe,move:(Xe,nr)=>({around:nr,panDelta:nr.sub(Xe)}),activateOnStart:!0,moveStateManager:Ae,enable:be,assignEvents:wh})})(P),Zr=new Yl(P,at);at.dragPan=new ya(_t,zr,Zr),this._add("mousePan",zr),this._add("touchPan",Zr,["touchZoom","touchRotate"]),P.interactive&&P.dragPan&&at.dragPan.enable(P.dragPan);let Rt=new sc,Gt=new qs;at.touchZoomRotate=new Jn(_t,Gt,Rt,Ee),this._add("touchRotate",Rt,["touchPan","touchZoom"]),this._add("touchZoom",Gt,["touchPan","touchRotate"]),P.interactive&&P.touchZoomRotate&&at.touchZoomRotate.enable(P.touchZoomRotate);let ne=at.scrollZoom=new un(at,()=>this._triggerRenderFrame());this._add("scrollZoom",ne,["mousePan"]),P.interactive&&P.scrollZoom&&at.scrollZoom.enable(P.scrollZoom);let oe=at.keyboard=new lr(at);this._add("keyboard",oe),P.interactive&&P.keyboard&&at.keyboard.enable(),this._add("blockableMapEvent",new Os(at))}_add(P,at,_t){this._handlers.push({handlerName:P,handler:at,allowed:_t}),this._handlersById[P]=at}stop(P){if(!this._updatingCamera){for(let{handler:at}of this._handlers)at.reset();this._inertia.clear(),this._fireEvents({},{},P),this._changes=[]}}isActive(){for(let{handler:P}of this._handlers)if(P.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!sa(this._eventsInProgress)||this.isZooming()}_blockedByActive(P,at,_t){for(let Tt in P)if(Tt!==_t&&(!at||at.indexOf(Tt)<0))return!0;return!1}_getMapTouches(P){let at=[];for(let _t of P)this._el.contains(_t.target)&&at.push(_t);return at}mergeHandlerResult(P,at,_t,Tt,Pt){if(!_t)return;e.e(P,_t);let ie={handlerName:Tt,originalEvent:_t.originalEvent||Pt};_t.zoomDelta!==void 0&&(at.zoom=ie),_t.panDelta!==void 0&&(at.drag=ie),_t.pitchDelta!==void 0&&(at.pitch=ie),_t.bearingDelta!==void 0&&(at.rotate=ie)}_applyChanges(){let P={},at={},_t={};for(let[Tt,Pt,ie]of this._changes)Tt.panDelta&&(P.panDelta=(P.panDelta||new e.P(0,0))._add(Tt.panDelta)),Tt.zoomDelta&&(P.zoomDelta=(P.zoomDelta||0)+Tt.zoomDelta),Tt.bearingDelta&&(P.bearingDelta=(P.bearingDelta||0)+Tt.bearingDelta),Tt.pitchDelta&&(P.pitchDelta=(P.pitchDelta||0)+Tt.pitchDelta),Tt.around!==void 0&&(P.around=Tt.around),Tt.pinchAround!==void 0&&(P.pinchAround=Tt.pinchAround),Tt.noInertia&&(P.noInertia=Tt.noInertia),e.e(at,Pt),e.e(_t,ie);this._updateMapTransform(P,at,_t),this._changes=[]}_updateMapTransform(P,at,_t){let Tt=this._map,Pt=Tt._getTransformForUpdate(),ie=Tt.terrain;if(!(Fa(P)||ie&&this._terrainMovement))return this._fireEvents(at,_t,!0);let{panDelta:de,zoomDelta:Ee,bearingDelta:He,pitchDelta:ar,around:ir,pinchAround:zr}=P;zr!==void 0&&(ir=zr),Tt._stop(!0),ir=ir||Tt.transform.centerPoint;let Zr=Pt.pointLocation(de?ir.sub(de):ir);He&&(Pt.bearing+=He),ar&&(Pt.pitch+=ar),Ee&&(Pt.zoom+=Ee),ie?this._terrainMovement||!at.drag&&!at.zoom?at.drag&&this._terrainMovement?Pt.center=Pt.pointLocation(Pt.centerPoint.sub(de)):Pt.setLocationAtPoint(Zr,ir):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Pt.setLocationAtPoint(Zr,ir)):Pt.setLocationAtPoint(Zr,ir),Tt._applyUpdatedTransform(Pt),this._map._update(),P.noInertia||this._inertia.record(P),this._fireEvents(at,_t,!0)}_fireEvents(P,at,_t){let Tt=sa(this._eventsInProgress),Pt=sa(P),ie={};for(let ir in P){let{originalEvent:zr}=P[ir];this._eventsInProgress[ir]||(ie[`${ir}start`]=zr),this._eventsInProgress[ir]=P[ir]}!Tt&&Pt&&this._fireEvent("movestart",Pt.originalEvent);for(let ir in ie)this._fireEvent(ir,ie[ir]);Pt&&this._fireEvent("move",Pt.originalEvent);for(let ir in P){let{originalEvent:zr}=P[ir];this._fireEvent(ir,zr)}let de={},Ee;for(let ir in this._eventsInProgress){let{handlerName:zr,originalEvent:Zr}=this._eventsInProgress[ir];this._handlersById[zr].isActive()||(delete this._eventsInProgress[ir],Ee=at[zr]||Zr,de[`${ir}end`]=Ee)}for(let ir in de)this._fireEvent(ir,de[ir]);let He=sa(this._eventsInProgress),ar=(Tt||Pt)&&!He;if(ar&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let ir=this._map._getTransformForUpdate();ir.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(ir)}if(_t&&ar){this._updatingCamera=!0;let ir=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),zr=Zr=>Zr!==0&&-this._bearingSnap<Zr&&Zr<this._bearingSnap;!ir||!ir.essential&&o.prefersReducedMotion?(this._map.fire(new e.k("moveend",{originalEvent:Ee})),zr(this._map.getBearing())&&this._map.resetNorth()):(zr(ir.bearing||this._map.getBearing())&&(ir.bearing=0),ir.freezeElevation=!0,this._map.easeTo(ir,{originalEvent:Ee})),this._updatingCamera=!1}}_fireEvent(P,at){this._map.fire(new e.k(P,at?{originalEvent:at}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(P=>{delete this._frameId,this.handleEvent(new qn("renderFrame",{timeStamp:P})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Ei extends e.E{constructor(P,at){super(),this._renderFrameCallback=()=>{let _t=Math.min((o.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(_t)),_t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=P,this._bearingSnap=at.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(P,at){return this.jumpTo({center:P},at)}panBy(P,at,_t){return P=e.P.convert(P).mult(-1),this.panTo(this.transform.center,e.e({offset:P},at),_t)}panTo(P,at,_t){return this.easeTo(e.e({center:P},at),_t)}getZoom(){return this.transform.zoom}setZoom(P,at){return this.jumpTo({zoom:P},at),this}zoomTo(P,at,_t){return this.easeTo(e.e({zoom:P},at),_t)}zoomIn(P,at){return this.zoomTo(this.getZoom()+1,P,at),this}zoomOut(P,at){return this.zoomTo(this.getZoom()-1,P,at),this}getBearing(){return this.transform.bearing}setBearing(P,at){return this.jumpTo({bearing:P},at),this}getPadding(){return this.transform.padding}setPadding(P,at){return this.jumpTo({padding:P},at),this}rotateTo(P,at,_t){return this.easeTo(e.e({bearing:P},at),_t)}resetNorth(P,at){return this.rotateTo(0,e.e({duration:1e3},P),at),this}resetNorthPitch(P,at){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},P),at),this}snapToNorth(P,at){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(P,at):this}getPitch(){return this.transform.pitch}setPitch(P,at){return this.jumpTo({pitch:P},at),this}cameraForBounds(P,at){P=it.convert(P).adjustAntiMeridian();let _t=at&&at.bearing||0;return this._cameraForBoxAndBearing(P.getNorthWest(),P.getSouthEast(),_t,at)}_cameraForBoxAndBearing(P,at,_t,Tt){let Pt={top:0,bottom:0,right:0,left:0};if(typeof(Tt=e.e({padding:Pt,offset:[0,0],maxZoom:this.transform.maxZoom},Tt)).padding=="number"){let nn=Tt.padding;Tt.padding={top:nn,bottom:nn,right:nn,left:nn}}Tt.padding=e.e(Pt,Tt.padding);let ie=this.transform,de=ie.padding,Ee=new it(P,at),He=ie.project(Ee.getNorthWest()),ar=ie.project(Ee.getNorthEast()),ir=ie.project(Ee.getSouthEast()),zr=ie.project(Ee.getSouthWest()),Zr=e.ba(-_t),Rt=He.rotate(Zr),Gt=ar.rotate(Zr),ne=ir.rotate(Zr),oe=zr.rotate(Zr),be=new e.P(Math.max(Rt.x,Gt.x,oe.x,ne.x),Math.max(Rt.y,Gt.y,oe.y,ne.y)),pe=new e.P(Math.min(Rt.x,Gt.x,oe.x,ne.x),Math.min(Rt.y,Gt.y,oe.y,ne.y)),Ae=be.sub(pe),Xe=(ie.width-(de.left+de.right+Tt.padding.left+Tt.padding.right))/Ae.x,nr=(ie.height-(de.top+de.bottom+Tt.padding.top+Tt.padding.bottom))/Ae.y;if(nr<0||Xe<0)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let or=Math.min(ie.scaleZoom(ie.scale*Math.min(Xe,nr)),Tt.maxZoom),Tr=e.P.convert(Tt.offset),Rr=new e.P((Tt.padding.left-Tt.padding.right)/2,(Tt.padding.top-Tt.padding.bottom)/2).rotate(e.ba(_t)),Qr=Tr.add(Rr).mult(ie.scale/ie.zoomScale(or));return{center:ie.unproject(He.add(ir).div(2).sub(Qr)),zoom:or,bearing:_t}}fitBounds(P,at,_t){return this._fitInternal(this.cameraForBounds(P,at),at,_t)}fitScreenCoordinates(P,at,_t,Tt,Pt){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.P.convert(P)),this.transform.pointLocation(e.P.convert(at)),_t,Tt),Tt,Pt)}_fitInternal(P,at,_t){return P?(delete(at=e.e(P,at)).padding,at.linear?this.easeTo(at,_t):this.flyTo(at,_t)):this}jumpTo(P,at){this.stop();let _t=this._getTransformForUpdate(),Tt=!1,Pt=!1,ie=!1;return"zoom"in P&&_t.zoom!==+P.zoom&&(Tt=!0,_t.zoom=+P.zoom),P.center!==void 0&&(_t.center=e.N.convert(P.center)),"bearing"in P&&_t.bearing!==+P.bearing&&(Pt=!0,_t.bearing=+P.bearing),"pitch"in P&&_t.pitch!==+P.pitch&&(ie=!0,_t.pitch=+P.pitch),P.padding==null||_t.isPaddingEqual(P.padding)||(_t.padding=P.padding),this._applyUpdatedTransform(_t),this.fire(new e.k("movestart",at)).fire(new e.k("move",at)),Tt&&this.fire(new e.k("zoomstart",at)).fire(new e.k("zoom",at)).fire(new e.k("zoomend",at)),Pt&&this.fire(new e.k("rotatestart",at)).fire(new e.k("rotate",at)).fire(new e.k("rotateend",at)),ie&&this.fire(new e.k("pitchstart",at)).fire(new e.k("pitch",at)).fire(new e.k("pitchend",at)),this.fire(new e.k("moveend",at))}calculateCameraOptionsFromTo(P,at,_t,Tt=0){let Pt=e.Z.fromLngLat(P,at),ie=e.Z.fromLngLat(_t,Tt),de=ie.x-Pt.x,Ee=ie.y-Pt.y,He=ie.z-Pt.z,ar=Math.hypot(de,Ee,He);if(ar===0)throw new Error("Can't calculate camera options with same From and To");let ir=Math.hypot(de,Ee),zr=this.transform.scaleZoom(this.transform.cameraToCenterDistance/ar/this.transform.tileSize),Zr=180*Math.atan2(de,-Ee)/Math.PI,Rt=180*Math.acos(ir/ar)/Math.PI;return Rt=He<0?90-Rt:90+Rt,{center:ie.toLngLat(),zoom:zr,pitch:Rt,bearing:Zr}}easeTo(P,at){var _t;this._stop(!1,P.easeId),((P=e.e({offset:[0,0],duration:500,easing:e.b9},P)).animate===!1||!P.essential&&o.prefersReducedMotion)&&(P.duration=0);let Tt=this._getTransformForUpdate(),Pt=Tt.zoom,ie=Tt.bearing,de=Tt.pitch,Ee=Tt.padding,He="bearing"in P?this._normalizeBearing(P.bearing,ie):ie,ar="pitch"in P?+P.pitch:de,ir="padding"in P?P.padding:Tt.padding,zr=e.P.convert(P.offset),Zr=Tt.centerPoint.add(zr),Rt=Tt.pointLocation(Zr),{center:Gt,zoom:ne}=Tt.getConstrained(e.N.convert(P.center||Rt),(_t=P.zoom)!==null&&_t!==void 0?_t:Pt);this._normalizeCenter(Gt,Tt);let oe=Tt.project(Rt),be=Tt.project(Gt).sub(oe),pe=Tt.zoomScale(ne-Pt),Ae,Xe;P.around&&(Ae=e.N.convert(P.around),Xe=Tt.locationPoint(Ae));let nr={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||ne!==Pt,this._rotating=this._rotating||ie!==He,this._pitching=this._pitching||ar!==de,this._padding=!Tt.isPaddingEqual(ir),this._easeId=P.easeId,this._prepareEase(at,P.noMoveStart,nr),this.terrain&&this._prepareElevation(Gt),this._ease(or=>{if(this._zooming&&(Tt.zoom=e.y.number(Pt,ne,or)),this._rotating&&(Tt.bearing=e.y.number(ie,He,or)),this._pitching&&(Tt.pitch=e.y.number(de,ar,or)),this._padding&&(Tt.interpolatePadding(Ee,ir,or),Zr=Tt.centerPoint.add(zr)),this.terrain&&!P.freezeElevation&&this._updateElevation(or),Ae)Tt.setLocationAtPoint(Ae,Xe);else{let Tr=Tt.zoomScale(Tt.zoom-Pt),Rr=ne>Pt?Math.min(2,pe):Math.max(.5,pe),Qr=Math.pow(Rr,1-or),nn=Tt.unproject(oe.add(be.mult(or*Qr)).mult(Tr));Tt.setLocationAtPoint(Tt.renderWorldCopies?nn.wrap():nn,Zr)}this._applyUpdatedTransform(Tt),this._fireMoveEvents(at)},or=>{this.terrain&&P.freezeElevation&&this._finalizeElevation(),this._afterEase(at,or)},P),this}_prepareEase(P,at,_t={}){this._moving=!0,at||_t.moving||this.fire(new e.k("movestart",P)),this._zooming&&!_t.zooming&&this.fire(new e.k("zoomstart",P)),this._rotating&&!_t.rotating&&this.fire(new e.k("rotatestart",P)),this._pitching&&!_t.pitching&&this.fire(new e.k("pitchstart",P))}_prepareElevation(P){this._elevationCenter=P,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(P,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(P){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let at=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(P<1&&at!==this._elevationTarget){let _t=this._elevationTarget-this._elevationStart;this._elevationStart+=P*(_t-(at-(_t*P+this._elevationStart))/(1-P)),this._elevationTarget=at}this.transform.elevation=e.y.number(this._elevationStart,this._elevationTarget,P)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(P){let at=P.getCameraPosition(),_t=this.terrain.getElevationForLngLatZoom(at.lngLat,P.zoom);if(at.altitude<_t){let Tt=this.calculateCameraOptionsFromTo(at.lngLat,_t,P.center,P.elevation);return{pitch:Tt.pitch,zoom:Tt.zoom}}return{}}_applyUpdatedTransform(P){let at=[];if(this.terrain&&at.push(Tt=>this._elevateCameraIfInsideTerrain(Tt)),this.transformCameraUpdate&&at.push(Tt=>this.transformCameraUpdate(Tt)),!at.length)return;let _t=P.clone();for(let Tt of at){let Pt=_t.clone(),{center:ie,zoom:de,pitch:Ee,bearing:He,elevation:ar}=Tt(Pt);ie&&(Pt.center=ie),de!==void 0&&(Pt.zoom=de),Ee!==void 0&&(Pt.pitch=Ee),He!==void 0&&(Pt.bearing=He),ar!==void 0&&(Pt.elevation=ar),_t.apply(Pt)}this.transform.apply(_t)}_fireMoveEvents(P){this.fire(new e.k("move",P)),this._zooming&&this.fire(new e.k("zoom",P)),this._rotating&&this.fire(new e.k("rotate",P)),this._pitching&&this.fire(new e.k("pitch",P))}_afterEase(P,at){if(this._easeId&&at&&this._easeId===at)return;delete this._easeId;let _t=this._zooming,Tt=this._rotating,Pt=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,_t&&this.fire(new e.k("zoomend",P)),Tt&&this.fire(new e.k("rotateend",P)),Pt&&this.fire(new e.k("pitchend",P)),this.fire(new e.k("moveend",P))}flyTo(P,at){var _t;if(!P.essential&&o.prefersReducedMotion){let la=e.M(P,["center","zoom","bearing","pitch","around"]);return this.jumpTo(la,at)}this.stop(),P=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},P);let Tt=this._getTransformForUpdate(),Pt=Tt.zoom,ie=Tt.bearing,de=Tt.pitch,Ee=Tt.padding,He="bearing"in P?this._normalizeBearing(P.bearing,ie):ie,ar="pitch"in P?+P.pitch:de,ir="padding"in P?P.padding:Tt.padding,zr=e.P.convert(P.offset),Zr=Tt.centerPoint.add(zr),Rt=Tt.pointLocation(Zr),{center:Gt,zoom:ne}=Tt.getConstrained(e.N.convert(P.center||Rt),(_t=P.zoom)!==null&&_t!==void 0?_t:Pt);this._normalizeCenter(Gt,Tt);let oe=Tt.zoomScale(ne-Pt),be=Tt.project(Rt),pe=Tt.project(Gt).sub(be),Ae=P.curve,Xe=Math.max(Tt.width,Tt.height),nr=Xe/oe,or=pe.mag();if("minZoom"in P){let la=e.ac(Math.min(P.minZoom,Pt,ne),Tt.minZoom,Tt.maxZoom),Na=Xe/Tt.zoomScale(la-Pt);Ae=Math.sqrt(Na/or*2)}let Tr=Ae*Ae;function Rr(la){let Na=(nr*nr-Xe*Xe+(la?-1:1)*Tr*Tr*or*or)/(2*(la?nr:Xe)*Tr*or);return Math.log(Math.sqrt(Na*Na+1)-Na)}function Qr(la){return(Math.exp(la)-Math.exp(-la))/2}function nn(la){return(Math.exp(la)+Math.exp(-la))/2}let mn=Rr(!1),zn=function(la){return nn(mn)/nn(mn+Ae*la)},na=function(la){return Xe*((nn(mn)*(Qr(Na=mn+Ae*la)/nn(Na))-Qr(mn))/Tr)/or;var Na},Yn=(Rr(!0)-mn)/Ae;if(Math.abs(or)<1e-6||!isFinite(Yn)){if(Math.abs(Xe-nr)<1e-6)return this.easeTo(P,at);let la=nr<Xe?-1:1;Yn=Math.abs(Math.log(nr/Xe))/Ae,na=()=>0,zn=Na=>Math.exp(la*Ae*Na)}return P.duration="duration"in P?+P.duration:1e3*Yn/("screenSpeed"in P?+P.screenSpeed/Ae:+P.speed),P.maxDuration&&P.duration>P.maxDuration&&(P.duration=0),this._zooming=!0,this._rotating=ie!==He,this._pitching=ar!==de,this._padding=!Tt.isPaddingEqual(ir),this._prepareEase(at,!1),this.terrain&&this._prepareElevation(Gt),this._ease(la=>{let Na=la*Yn,li=1/zn(Na);Tt.zoom=la===1?ne:Pt+Tt.scaleZoom(li),this._rotating&&(Tt.bearing=e.y.number(ie,He,la)),this._pitching&&(Tt.pitch=e.y.number(de,ar,la)),this._padding&&(Tt.interpolatePadding(Ee,ir,la),Zr=Tt.centerPoint.add(zr)),this.terrain&&!P.freezeElevation&&this._updateElevation(la);let Ka=la===1?Gt:Tt.unproject(be.add(pe.mult(na(Na))).mult(li));Tt.setLocationAtPoint(Tt.renderWorldCopies?Ka.wrap():Ka,Zr),this._applyUpdatedTransform(Tt),this._fireMoveEvents(at)},()=>{this.terrain&&P.freezeElevation&&this._finalizeElevation(),this._afterEase(at)},P),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(P,at){var _t;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let Tt=this._onEaseEnd;delete this._onEaseEnd,Tt.call(this,at)}return P||(_t=this.handlers)===null||_t===void 0||_t.stop(!1),this}_ease(P,at,_t){_t.animate===!1||_t.duration===0?(P(1),at()):(this._easeStart=o.now(),this._easeOptions=_t,this._onEaseFrame=P,this._onEaseEnd=at,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(P,at){P=e.b3(P,-180,180);let _t=Math.abs(P-at);return Math.abs(P-360-at)<_t&&(P-=360),Math.abs(P+360-at)<_t&&(P+=360),P}_normalizeCenter(P,at){if(!at.renderWorldCopies||at.lngRange)return;let _t=P.lng-at.center.lng;P.lng+=_t>180?-360:_t<-180?360:0}queryTerrainElevation(P){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(P),this.transform.tileZoom)-this.transform.elevation:null}}let Ni={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Hi{constructor(P=Ni){this._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")))},this._updateData=at=>{!at||at.sourceDataType!=="metadata"&&at.sourceDataType!=="visibility"&&at.dataType!=="style"&&at.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=P}getDefaultPosition(){return"bottom-right"}onAdd(P){return this._map=P,this._compact=this.options.compact,this._container=a.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=a.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.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(){a.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(P,at){let _t=this._map._getUIString(`AttributionControl.${at}`);P.title=_t,P.setAttribute("aria-label",_t)}_updateAttributions(){if(!this._map.style)return;let P=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?P=P.concat(this.options.customAttribution.map(Tt=>typeof Tt!="string"?"":Tt)):typeof this.options.customAttribution=="string"&&P.push(this.options.customAttribution)),this._map.style.stylesheet){let Tt=this._map.style.stylesheet;this.styleOwner=Tt.owner,this.styleId=Tt.id}let at=this._map.style.sourceCaches;for(let Tt in at){let Pt=at[Tt];if(Pt.used||Pt.usedForTerrain){let ie=Pt.getSource();ie.attribution&&P.indexOf(ie.attribution)<0&&P.push(ie.attribution)}}P=P.filter(Tt=>String(Tt).trim()),P.sort((Tt,Pt)=>Tt.length-Pt.length),P=P.filter((Tt,Pt)=>{for(let ie=Pt+1;ie<P.length;ie++)if(P[ie].indexOf(Tt)>=0)return!1;return!0});let _t=P.join(" | ");_t!==this._attribHTML&&(this._attribHTML=_t,P.length?(this._innerContainer.innerHTML=_t,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ba{constructor(P={}){this._updateCompact=()=>{let at=this._container.children;if(at.length){let _t=at[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&_t.classList.add("maplibregl-compact"):_t.classList.remove("maplibregl-compact")}},this.options=P}getDefaultPosition(){return"bottom-left"}onAdd(P){this._map=P,this._compact=this.options&&this.options.compact,this._container=a.create("div","maplibregl-ctrl");let at=a.create("a","maplibregl-ctrl-logo");return at.target="_blank",at.rel="noopener nofollow",at.href="https://maplibre.org/",at.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),at.setAttribute("rel","noopener nofollow"),this._container.appendChild(at),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){a.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ba{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(P){let at=++this._id;return this._queue.push({callback:P,id:at,cancelled:!1}),at}remove(P){let at=this._currentlyRunning,_t=at?this._queue.concat(at):this._queue;for(let Tt of _t)if(Tt.id===P)return void(Tt.cancelled=!0)}run(P=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let at=this._currentlyRunning=this._queue;this._queue=[];for(let _t of at)if(!_t.cancelled&&(_t.callback(P),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var $i=e.Y([{name:"a_pos3d",type:"Int16",components:3}]);class So extends e.E{constructor(P){super(),this.sourceCache=P,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,P.usedForTerrain=!0,P.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(P,at){this.sourceCache.update(P,at),this._renderableTilesKeys=[];let _t={};for(let Tt of P.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:at}))_t[Tt.key]=!0,this._renderableTilesKeys.push(Tt.key),this._tiles[Tt.key]||(Tt.posMatrix=new Float64Array(16),e.aP(Tt.posMatrix,0,e.X,0,e.X,0,1),this._tiles[Tt.key]=new Zt(Tt,this.tileSize));for(let Tt in this._tiles)_t[Tt]||delete this._tiles[Tt]}freeRtt(P){for(let at in this._tiles){let _t=this._tiles[at];(!P||_t.tileID.equals(P)||_t.tileID.isChildOf(P)||P.isChildOf(_t.tileID))&&(_t.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(P=>this.getTileByID(P))}getTileByID(P){return this._tiles[P]}getTerrainCoords(P){let at={};for(let _t of this._renderableTilesKeys){let Tt=this._tiles[_t].tileID;if(Tt.canonical.equals(P.canonical)){let Pt=P.clone();Pt.posMatrix=new Float64Array(16),e.aP(Pt.posMatrix,0,e.X,0,e.X,0,1),at[_t]=Pt}else if(Tt.canonical.isChildOf(P.canonical)){let Pt=P.clone();Pt.posMatrix=new Float64Array(16);let ie=Tt.canonical.z-P.canonical.z,de=Tt.canonical.x-(Tt.canonical.x>>ie<<ie),Ee=Tt.canonical.y-(Tt.canonical.y>>ie<<ie),He=e.X>>ie;e.aP(Pt.posMatrix,0,He,0,He,0,1),e.J(Pt.posMatrix,Pt.posMatrix,[-de*He,-Ee*He,0]),at[_t]=Pt}else if(P.canonical.isChildOf(Tt.canonical)){let Pt=P.clone();Pt.posMatrix=new Float64Array(16);let ie=P.canonical.z-Tt.canonical.z,de=P.canonical.x-(P.canonical.x>>ie<<ie),Ee=P.canonical.y-(P.canonical.y>>ie<<ie),He=e.X>>ie;e.aP(Pt.posMatrix,0,e.X,0,e.X,0,1),e.J(Pt.posMatrix,Pt.posMatrix,[de*He,Ee*He,0]),e.K(Pt.posMatrix,Pt.posMatrix,[1/2**ie,1/2**ie,0]),at[_t]=Pt}}return at}getSourceTile(P,at){let _t=this.sourceCache._source,Tt=P.overscaledZ-this.deltaZoom;if(Tt>_t.maxzoom&&(Tt=_t.maxzoom),Tt<_t.minzoom)return null;this._sourceTileCache[P.key]||(this._sourceTileCache[P.key]=P.scaledTo(Tt).key);let Pt=this.sourceCache.getTileByID(this._sourceTileCache[P.key]);if((!Pt||!Pt.dem)&&at)for(;Tt>=_t.minzoom&&(!Pt||!Pt.dem);)Pt=this.sourceCache.getTileByID(P.scaledTo(Tt--).key);return Pt}tilesAfterTime(P=Date.now()){return Object.values(this._tiles).filter(at=>at.timeAdded>=P)}}class Jo{constructor(P,at,_t){this.painter=P,this.sourceCache=new So(at),this.options=_t,this.exaggeration=typeof _t.exaggeration=="number"?_t.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(P,at,_t,Tt=e.X){var Pt;if(!(at>=0&&at<Tt&&_t>=0&&_t<Tt))return 0;let ie=this.getTerrainData(P),de=(Pt=ie.tile)===null||Pt===void 0?void 0:Pt.dem;if(!de)return 0;let Ee=function(Rt,Gt,ne){var oe=Gt[0],be=Gt[1];return Rt[0]=ne[0]*oe+ne[4]*be+ne[12],Rt[1]=ne[1]*oe+ne[5]*be+ne[13],Rt}([],[at/Tt*e.X,_t/Tt*e.X],ie.u_terrain_matrix),He=[Ee[0]*de.dim,Ee[1]*de.dim],ar=Math.floor(He[0]),ir=Math.floor(He[1]),zr=He[0]-ar,Zr=He[1]-ir;return de.get(ar,ir)*(1-zr)*(1-Zr)+de.get(ar+1,ir)*zr*(1-Zr)+de.get(ar,ir+1)*(1-zr)*Zr+de.get(ar+1,ir+1)*zr*Zr}getElevationForLngLatZoom(P,at){if(!e.bb(at,P.wrap()))return 0;let{tileID:_t,mercatorX:Tt,mercatorY:Pt}=this._getOverscaledTileIDFromLngLatZoom(P,at);return this.getElevation(_t,Tt%e.X,Pt%e.X,e.X)}getElevation(P,at,_t,Tt=e.X){return this.getDEMElevation(P,at,_t,Tt)*this.exaggeration}getTerrainData(P){if(!this._emptyDemTexture){let Tt=this.painter.context,Pt=new e.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new f(Tt,Pt,Tt.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new f(Tt,new e.R({width:1,height:1}),Tt.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(Tt.gl.NEAREST,Tt.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.an([])}let at=this.sourceCache.getSourceTile(P,!0);if(at&&at.dem&&(!at.demTexture||at.needsTerrainPrepare)){let Tt=this.painter.context;at.demTexture=this.painter.getTileTexture(at.dem.stride),at.demTexture?at.demTexture.update(at.dem.getPixels(),{premultiply:!1}):at.demTexture=new f(Tt,at.dem.getPixels(),Tt.gl.RGBA,{premultiply:!1}),at.demTexture.bind(Tt.gl.NEAREST,Tt.gl.CLAMP_TO_EDGE),at.needsTerrainPrepare=!1}let _t=at&&at+at.tileID.key+P.key;if(_t&&!this._demMatrixCache[_t]){let Tt=this.sourceCache.sourceCache._source.maxzoom,Pt=P.canonical.z-at.tileID.canonical.z;P.overscaledZ>P.canonical.z&&(P.canonical.z>=Tt?Pt=P.canonical.z-Tt:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let ie=P.canonical.x-(P.canonical.x>>Pt<<Pt),de=P.canonical.y-(P.canonical.y>>Pt<<Pt),Ee=e.bc(new Float64Array(16),[1/(e.X<<Pt),1/(e.X<<Pt),0]);e.J(Ee,Ee,[ie*e.X,de*e.X,0]),this._demMatrixCache[P.key]={matrix:Ee,coord:P}}return{u_depth:2,u_terrain:3,u_terrain_dim:at&&at.dem&&at.dem.dim||1,u_terrain_matrix:_t?this._demMatrixCache[P.key].matrix:this._emptyDemMatrix,u_terrain_unpack:at&&at.dem&&at.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(at&&at.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:at}}getFramebuffer(P){let at=this.painter,_t=at.width/devicePixelRatio,Tt=at.height/devicePixelRatio;return!this._fbo||this._fbo.width===_t&&this._fbo.height===Tt||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new f(at.context,{width:_t,height:Tt,data:null},at.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(at.context.gl.NEAREST,at.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new f(at.context,{width:_t,height:Tt,data:null},at.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(at.context.gl.NEAREST,at.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=at.context.createFramebuffer(_t,Tt,!0,!1),this._fbo.depthAttachment.set(at.context.createRenderbuffer(at.context.gl.DEPTH_COMPONENT16,_t,Tt))),this._fbo.colorAttachment.set(P==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let P=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let at=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let Pt=0,ie=0;Pt<this._coordsTextureSize;Pt++)for(let de=0;de<this._coordsTextureSize;de++,ie+=4)at[ie+0]=255&de,at[ie+1]=255&Pt,at[ie+2]=de>>8<<4|Pt>>8,at[ie+3]=0;let _t=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(at.buffer)),Tt=new f(P,_t,P.gl.RGBA,{premultiply:!1});return Tt.bind(P.gl.NEAREST,P.gl.CLAMP_TO_EDGE),this._coordsTexture=Tt,Tt}pointCoordinate(P){this.painter.maybeDrawDepthAndCoords(!0);let at=new Uint8Array(4),_t=this.painter.context,Tt=_t.gl,Pt=Math.round(P.x*this.painter.pixelRatio/devicePixelRatio),ie=Math.round(P.y*this.painter.pixelRatio/devicePixelRatio),de=Math.round(this.painter.height/devicePixelRatio);_t.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Tt.readPixels(Pt,de-ie-1,1,1,Tt.RGBA,Tt.UNSIGNED_BYTE,at),_t.bindFramebuffer.set(null);let Ee=at[0]+(at[2]>>4<<8),He=at[1]+((15&at[2])<<8),ar=this.coordsIndex[255-at[3]],ir=ar&&this.sourceCache.getTileByID(ar);if(!ir)return null;let zr=this._coordsTextureSize,Zr=(1<<ir.tileID.canonical.z)*zr;return new e.Z((ir.tileID.canonical.x*zr+Ee)/Zr+ir.tileID.wrap,(ir.tileID.canonical.y*zr+He)/Zr,this.getElevation(ir.tileID,Ee,He,zr))}depthAtPoint(P){let at=new Uint8Array(4),_t=this.painter.context,Tt=_t.gl;return _t.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),Tt.readPixels(P.x,this.painter.height/devicePixelRatio-P.y-1,1,1,Tt.RGBA,Tt.UNSIGNED_BYTE,at),_t.bindFramebuffer.set(null),(at[0]/16777216+at[1]/65536+at[2]/256+at[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let P=this.painter.context,at=new e.bd,_t=new e.aY,Tt=this.meshSize,Pt=e.X/Tt,ie=Tt*Tt;for(let ir=0;ir<=Tt;ir++)for(let zr=0;zr<=Tt;zr++)at.emplaceBack(zr*Pt,ir*Pt,0);for(let ir=0;ir<ie;ir+=Tt+1)for(let zr=0;zr<Tt;zr++)_t.emplaceBack(zr+ir,Tt+zr+ir+1,Tt+zr+ir+2),_t.emplaceBack(zr+ir,Tt+zr+ir+2,zr+ir+1);let de=at.length,Ee=de+2*(Tt+1);for(let ir of[0,1])for(let zr=0;zr<=Tt;zr++)for(let Zr of[0,1])at.emplaceBack(zr*Pt,ir*e.X,Zr);for(let ir=0;ir<2*Tt;ir+=2)_t.emplaceBack(Ee+ir,Ee+ir+1,Ee+ir+3),_t.emplaceBack(Ee+ir,Ee+ir+3,Ee+ir+2),_t.emplaceBack(de+ir,de+ir+3,de+ir+1),_t.emplaceBack(de+ir,de+ir+2,de+ir+3);let He=at.length,ar=He+2*(Tt+1);for(let ir of[0,1])for(let zr=0;zr<=Tt;zr++)for(let Zr of[0,1])at.emplaceBack(ir*e.X,zr*Pt,Zr);for(let ir=0;ir<2*Tt;ir+=2)_t.emplaceBack(He+ir,He+ir+1,He+ir+3),_t.emplaceBack(He+ir,He+ir+3,He+ir+2),_t.emplaceBack(ar+ir,ar+ir+3,ar+ir+1),_t.emplaceBack(ar+ir,ar+ir+2,ar+ir+3);return this._mesh=new Zl(P.createVertexBuffer(at,$i.members),P.createIndexBuffer(_t),e.a0.simpleSegment(0,0,at.length,_t.length)),this._mesh}getMeshFrameDelta(P){return 2*Math.PI*e.be/Math.pow(2,P)/5}getMinTileElevationForLngLatZoom(P,at){var _t;let{tileID:Tt}=this._getOverscaledTileIDFromLngLatZoom(P,at);return(_t=this.getMinMaxElevation(Tt).minElevation)!==null&&_t!==void 0?_t:0}getMinMaxElevation(P){let at=this.getTerrainData(P).tile,_t={minElevation:null,maxElevation:null};return at&&at.dem&&(_t.minElevation=at.dem.min*this.exaggeration,_t.maxElevation=at.dem.max*this.exaggeration),_t}_getOverscaledTileIDFromLngLatZoom(P,at){let _t=e.Z.fromLngLat(P.wrap()),Tt=(1<<at)*e.X,Pt=_t.x*Tt,ie=_t.y*Tt,de=Math.floor(Pt/e.X),Ee=Math.floor(ie/e.X);return{tileID:new e.S(at,0,at,de,Ee),mercatorX:Pt,mercatorY:ie}}}class As{constructor(P,at,_t){this._context=P,this._size=at,this._tileSize=_t,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let P of this._objects)P.texture.destroy(),P.fbo.destroy()}_createObject(P){let at=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),_t=new f(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return _t.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),at.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),at.colorAttachment.set(_t.texture),{id:P,fbo:at,texture:_t,stamp:-1,inUse:!1}}getObjectForId(P){return this._objects[P]}useObject(P){P.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(at=>P.id!==at),this._recentlyUsed.push(P.id)}stampObject(P){P.stamp=++this._stamp}getOrCreateFreeObject(){for(let at of this._recentlyUsed)if(!this._objects[at].inUse)return this._objects[at];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let P=this._createObject(this._objects.length);return this._objects.push(P),P}freeObject(P){P.inUse=!1}freeAllObjects(){for(let P of this._objects)this.freeObject(P)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(P=>!P.inUse)===!1}}let os={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class xs{constructor(P,at){this.painter=P,this.terrain=at,this.pool=new As(P.context,30,at.sourceCache.tileSize*at.qualityFactor)}destruct(){this.pool.destruct()}getTexture(P){return this.pool.getObjectForId(P.rtt[this._stacks.length-1].id).texture}prepareForRender(P,at){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=P._order.filter(_t=>!P._layers[_t].isHidden(at)),this._coordsDescendingInv={};for(let _t in P.sourceCaches){this._coordsDescendingInv[_t]={};let Tt=P.sourceCaches[_t].getVisibleCoordinates();for(let Pt of Tt){let ie=this.terrain.sourceCache.getTerrainCoords(Pt);for(let de in ie)this._coordsDescendingInv[_t][de]||(this._coordsDescendingInv[_t][de]=[]),this._coordsDescendingInv[_t][de].push(ie[de])}}this._coordsDescendingInvStr={};for(let _t of P._order){let Tt=P._layers[_t],Pt=Tt.source;if(os[Tt.type]&&!this._coordsDescendingInvStr[Pt]){this._coordsDescendingInvStr[Pt]={};for(let ie in this._coordsDescendingInv[Pt])this._coordsDescendingInvStr[Pt][ie]=this._coordsDescendingInv[Pt][ie].map(de=>de.key).sort().join()}}for(let _t of this._renderableTiles)for(let Tt in this._coordsDescendingInvStr){let Pt=this._coordsDescendingInvStr[Tt][_t.tileID.key];Pt&&Pt!==_t.rttCoords[Tt]&&(_t.rtt=[])}}renderLayer(P){if(P.isHidden(this.painter.transform.zoom))return!1;let at=P.type,_t=this.painter,Tt=this._renderableLayerIds[this._renderableLayerIds.length-1]===P.id;if(os[at]&&(this._prevType&&os[this._prevType]||this._stacks.push([]),this._prevType=at,this._stacks[this._stacks.length-1].push(P.id),!Tt))return!0;if(os[this._prevType]||os[at]&&Tt){this._prevType=at;let Pt=this._stacks.length-1,ie=this._stacks[Pt]||[];for(let de of this._renderableTiles){if(this.pool.isFull()&&(Il(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(de),de.rtt[Pt]){let He=this.pool.getObjectForId(de.rtt[Pt].id);if(He.stamp===de.rtt[Pt].stamp){this.pool.useObject(He);continue}}let Ee=this.pool.getOrCreateFreeObject();this.pool.useObject(Ee),this.pool.stampObject(Ee),de.rtt[Pt]={id:Ee.id,stamp:Ee.stamp},_t.context.bindFramebuffer.set(Ee.fbo.framebuffer),_t.context.clear({color:e.aM.transparent,stencil:0}),_t.currentStencilSource=void 0;for(let He=0;He<ie.length;He++){let ar=_t.style._layers[ie[He]],ir=ar.source?this._coordsDescendingInv[ar.source][de.tileID.key]:[de.tileID];_t.context.viewport.set([0,0,Ee.fbo.width,Ee.fbo.height]),_t._renderTileClippingMasks(ar,ir),_t.renderLayer(_t,_t.style.sourceCaches[ar.source],ar,ir),ar.source&&(de.rttCoords[ar.source]=this._coordsDescendingInvStr[ar.source][de.tileID.key])}}return Il(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),os[at]}return!1}}let No={"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":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Qs=r,Hs={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Ni,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:e.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},Ms=Lt=>{Lt.touchstart=Lt.dragStart,Lt.touchmoveWindow=Lt.dragMove,Lt.touchend=Lt.dragEnd},ni={showCompass:!0,showZoom:!0,visualizePitch:!1};class to{constructor(P,at,_t=!1){this.mousedown=ie=>{this.startMouse(e.e({},ie,{ctrlKey:!0,preventDefault:()=>ie.preventDefault()}),a.mousePos(this.element,ie)),a.addEventListener(window,"mousemove",this.mousemove),a.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ie=>{this.moveMouse(ie,a.mousePos(this.element,ie))},this.mouseup=ie=>{this.mouseRotate.dragEnd(ie),this.mousePitch&&this.mousePitch.dragEnd(ie),this.offTemp()},this.touchstart=ie=>{ie.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,ie.targetTouches)[0],this.startTouch(ie,this._startPos),a.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.addEventListener(window,"touchend",this.touchend))},this.touchmove=ie=>{ie.targetTouches.length!==1?this.reset():(this._lastPos=a.touchPos(this.element,ie.targetTouches)[0],this.moveTouch(ie,this._lastPos))},this.touchend=ie=>{ie.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let Tt=P.dragRotate._mouseRotate.getClickTolerance(),Pt=P.dragRotate._mousePitch.getClickTolerance();this.element=at,this.mouseRotate=cl({clickTolerance:Tt,enable:!0}),this.touchRotate=(({enable:ie,clickTolerance:de,bearingDegreesPerPixelMoved:Ee=.8})=>{let He=new vc;return new Ql({clickTolerance:de,move:(ar,ir)=>({bearingDelta:(ir.x-ar.x)*Ee}),moveStateManager:He,enable:ie,assignEvents:Ms})})({clickTolerance:Tt,enable:!0}),this.map=P,_t&&(this.mousePitch=Qc({clickTolerance:Pt,enable:!0}),this.touchPitch=(({enable:ie,clickTolerance:de,pitchDegreesPerPixelMoved:Ee=-.5})=>{let He=new vc;return new Ql({clickTolerance:de,move:(ar,ir)=>({pitchDelta:(ir.y-ar.y)*Ee}),moveStateManager:He,enable:ie,assignEvents:Ms})})({clickTolerance:Pt,enable:!0})),a.addEventListener(at,"mousedown",this.mousedown),a.addEventListener(at,"touchstart",this.touchstart,{passive:!1}),a.addEventListener(at,"touchcancel",this.reset)}startMouse(P,at){this.mouseRotate.dragStart(P,at),this.mousePitch&&this.mousePitch.dragStart(P,at),a.disableDrag()}startTouch(P,at){this.touchRotate.dragStart(P,at),this.touchPitch&&this.touchPitch.dragStart(P,at),a.disableDrag()}moveMouse(P,at){let _t=this.map,{bearingDelta:Tt}=this.mouseRotate.dragMove(P,at)||{};if(Tt&&_t.setBearing(_t.getBearing()+Tt),this.mousePitch){let{pitchDelta:Pt}=this.mousePitch.dragMove(P,at)||{};Pt&&_t.setPitch(_t.getPitch()+Pt)}}moveTouch(P,at){let _t=this.map,{bearingDelta:Tt}=this.touchRotate.dragMove(P,at)||{};if(Tt&&_t.setBearing(_t.getBearing()+Tt),this.touchPitch){let{pitchDelta:Pt}=this.touchPitch.dragMove(P,at)||{};Pt&&_t.setPitch(_t.getPitch()+Pt)}}off(){let P=this.element;a.removeEventListener(P,"mousedown",this.mousedown),a.removeEventListener(P,"touchstart",this.touchstart,{passive:!1}),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend),a.removeEventListener(P,"touchcancel",this.reset),this.offTemp()}offTemp(){a.enableDrag(),a.removeEventListener(window,"mousemove",this.mousemove),a.removeEventListener(window,"mouseup",this.mouseup),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend)}}let ds;function Qo(Lt,P,at){let _t=new e.N(Lt.lng,Lt.lat);if(Lt=new e.N(Lt.lng,Lt.lat),P){let Tt=new e.N(Lt.lng-360,Lt.lat),Pt=new e.N(Lt.lng+360,Lt.lat),ie=at.locationPoint(Lt).distSqr(P);at.locationPoint(Tt).distSqr(P)<ie?Lt=Tt:at.locationPoint(Pt).distSqr(P)<ie&&(Lt=Pt)}for(;Math.abs(Lt.lng-at.center.lng)>180;){let Tt=at.locationPoint(Lt);if(Tt.x>=0&&Tt.y>=0&&Tt.x<=at.width&&Tt.y<=at.height)break;Lt.lng>at.center.lng?Lt.lng-=360:Lt.lng+=360}return Lt.lng!==_t.lng&&at.locationPoint(Lt).y>at.height/2-at.getHorizon()?Lt:_t}let Tl={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 Kl(Lt,P,at){let _t=Lt.classList;for(let Tt in Tl)_t.remove(`maplibregl-${at}-anchor-${Tt}`);_t.add(`maplibregl-${at}-anchor-${P}`)}class Fl extends e.E{constructor(P){if(super(),this._onKeyPress=at=>{let _t=at.code,Tt=at.charCode||at.keyCode;_t!=="Space"&&_t!=="Enter"&&Tt!==32&&Tt!==13||this.togglePopup()},this._onMapClick=at=>{let _t=at.originalEvent.target,Tt=this._element;this._popup&&(_t===Tt||Tt.contains(_t))&&this.togglePopup()},this._update=at=>{var _t;if(!this._map)return;let Tt=this._map.loaded()&&!this._map.isMoving();(at?.type==="terrain"||at?.type==="render"&&!Tt)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Qo(this._lngLat,this._flatPos,this._map.transform):(_t=this._lngLat)===null||_t===void 0?void 0:_t.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Pt="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Pt=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Pt=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let ie="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?ie="rotateX(0deg)":this._pitchAlignment==="map"&&(ie=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||at&&at.type!=="moveend"||(this._pos=this._pos.round()),a.setTransform(this._element,`${Tl[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${ie} ${Pt}`),o.frameAsync(new AbortController).then(()=>{this._updateOpacity(at&&at.type==="moveend")}).catch(()=>{})},this._onMove=at=>{if(!this._isDragging){let _t=this._clickTolerance||this._map._clickTolerance;this._isDragging=at.point.dist(this._pointerdownPos)>=_t}this._isDragging&&(this._pos=at.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.k("dragstart"))),this.fire(new e.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.k("dragend")),this._state="inactive"},this._addDragHandler=at=>{this._element.contains(at.originalEvent.target)&&(at.preventDefault(),this._positionDelta=at.point.sub(this._pos).add(this._offset),this._pointerdownPos=at.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))},this._anchor=P&&P.anchor||"center",this._color=P&&P.color||"#3FB1CE",this._scale=P&&P.scale||1,this._draggable=P&&P.draggable||!1,this._clickTolerance=P&&P.clickTolerance||0,this._subpixelPositioning=P&&P.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=P&&P.rotation||0,this._rotationAlignment=P&&P.rotationAlignment||"auto",this._pitchAlignment=P&&P.pitchAlignment&&P.pitchAlignment!=="auto"?P.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(P?.opacity,P?.opacityWhenCovered),P&&P.element)this._element=P.element,this._offset=e.P.convert(P&&P.offset||[0,0]);else{this._defaultMarker=!0,this._element=a.create("div");let at=a.createNS("http://www.w3.org/2000/svg","svg"),_t=41,Tt=27;at.setAttributeNS(null,"display","block"),at.setAttributeNS(null,"height",`${_t}px`),at.setAttributeNS(null,"width",`${Tt}px`),at.setAttributeNS(null,"viewBox",`0 0 ${Tt} ${_t}`);let Pt=a.createNS("http://www.w3.org/2000/svg","g");Pt.setAttributeNS(null,"stroke","none"),Pt.setAttributeNS(null,"stroke-width","1"),Pt.setAttributeNS(null,"fill","none"),Pt.setAttributeNS(null,"fill-rule","evenodd");let ie=a.createNS("http://www.w3.org/2000/svg","g");ie.setAttributeNS(null,"fill-rule","nonzero");let de=a.createNS("http://www.w3.org/2000/svg","g");de.setAttributeNS(null,"transform","translate(3.0, 29.0)"),de.setAttributeNS(null,"fill","#000000");let Ee=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let oe of Ee){let be=a.createNS("http://www.w3.org/2000/svg","ellipse");be.setAttributeNS(null,"opacity","0.04"),be.setAttributeNS(null,"cx","10.5"),be.setAttributeNS(null,"cy","5.80029008"),be.setAttributeNS(null,"rx",oe.rx),be.setAttributeNS(null,"ry",oe.ry),de.appendChild(be)}let He=a.createNS("http://www.w3.org/2000/svg","g");He.setAttributeNS(null,"fill",this._color);let ar=a.createNS("http://www.w3.org/2000/svg","path");ar.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"),He.appendChild(ar);let ir=a.createNS("http://www.w3.org/2000/svg","g");ir.setAttributeNS(null,"opacity","0.25"),ir.setAttributeNS(null,"fill","#000000");let zr=a.createNS("http://www.w3.org/2000/svg","path");zr.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"),ir.appendChild(zr);let Zr=a.createNS("http://www.w3.org/2000/svg","g");Zr.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Zr.setAttributeNS(null,"fill","#FFFFFF");let Rt=a.createNS("http://www.w3.org/2000/svg","g");Rt.setAttributeNS(null,"transform","translate(8.0, 8.0)");let Gt=a.createNS("http://www.w3.org/2000/svg","circle");Gt.setAttributeNS(null,"fill","#000000"),Gt.setAttributeNS(null,"opacity","0.25"),Gt.setAttributeNS(null,"cx","5.5"),Gt.setAttributeNS(null,"cy","5.5"),Gt.setAttributeNS(null,"r","5.4999962");let ne=a.createNS("http://www.w3.org/2000/svg","circle");ne.setAttributeNS(null,"fill","#FFFFFF"),ne.setAttributeNS(null,"cx","5.5"),ne.setAttributeNS(null,"cy","5.5"),ne.setAttributeNS(null,"r","5.4999962"),Rt.appendChild(Gt),Rt.appendChild(ne),ie.appendChild(de),ie.appendChild(He),ie.appendChild(ir),ie.appendChild(Zr),ie.appendChild(Rt),at.appendChild(ie),at.setAttributeNS(null,"height",_t*this._scale+"px"),at.setAttributeNS(null,"width",Tt*this._scale+"px"),this._element.appendChild(at),this._offset=e.P.convert(P&&P.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",at=>{at.preventDefault()}),this._element.addEventListener("mousedown",at=>{at.preventDefault()}),Kl(this._element,this._anchor,"marker"),P&&P.className)for(let at of P.className.split(" "))this._element.classList.add(at);this._popup=null}addTo(P){return this.remove(),this._map=P,this._element.setAttribute("aria-label",P._getUIString("Marker.Title")),P.getCanvasContainer().appendChild(this._element),P.on("move",this._update),P.on("moveend",this._update),P.on("terrain",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("terrain",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),a.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(P){return this._lngLat=e.N.convert(P),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(P){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),P){if(!("offset"in P.options)){let at=Math.abs(13.5)/Math.SQRT2;P.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[at,-1*(38.1-13.5+at)],"bottom-right":[-at,-1*(38.1-13.5+at)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=P,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(P){return this._subpixelPositioning=P,this}getPopup(){return this._popup}togglePopup(){let P=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:P?(P.isOpen()?P.remove():(P.setLngLat(this._lngLat),P.addTo(this._map)),this):this}_updateOpacity(P=!1){var at,_t;if(!(!((at=this._map)===null||at===void 0)&&at.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(P)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let Tt=this._map,Pt=Tt.terrain.depthAtPoint(this._pos),ie=Tt.terrain.getElevationForLngLatZoom(this._lngLat,Tt.transform.tileZoom);if(Tt.transform.lngLatToCameraDepth(this._lngLat,ie)-Pt<.006)return void(this._element.style.opacity=this._opacity);let de=-this._offset.y/Tt.transform._pixelPerMeter,Ee=Math.sin(Tt.getPitch()*Math.PI/180)*de,He=Tt.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),ar=Tt.transform.lngLatToCameraDepth(this._lngLat,ie+Ee)-He>.006;!((_t=this._popup)===null||_t===void 0)&&_t.isOpen()&&ar&&this._popup.remove(),this._element.style.opacity=ar?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(P){return this._offset=e.P.convert(P),this._update(),this}addClassName(P){this._element.classList.add(P)}removeClassName(P){this._element.classList.remove(P)}toggleClassName(P){return this._element.classList.toggle(P)}setDraggable(P){return this._draggable=!!P,this._map&&(P?(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(P){return this._rotation=P||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(P){return this._rotationAlignment=P||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(P){return this._pitchAlignment=P&&P!=="auto"?P:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(P,at){return P===void 0&&at===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),P!==void 0&&(this._opacity=P),at!==void 0&&(this._opacityWhenCovered=at),this._map&&this._updateOpacity(!0),this}}let tc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},tu=0,Uu=!1,$s={maxWidth:100,unit:"metric"};function ec(Lt,P,at){let _t=at&&at.maxWidth||100,Tt=Lt._container.clientHeight/2,Pt=Lt.unproject([0,Tt]),ie=Lt.unproject([_t,Tt]),de=Pt.distanceTo(ie);if(at&&at.unit==="imperial"){let Ee=3.2808*de;Ee>5280?Ri(P,_t,Ee/5280,Lt._getUIString("ScaleControl.Miles")):Ri(P,_t,Ee,Lt._getUIString("ScaleControl.Feet"))}else at&&at.unit==="nautical"?Ri(P,_t,de/1852,Lt._getUIString("ScaleControl.NauticalMiles")):de>=1e3?Ri(P,_t,de/1e3,Lt._getUIString("ScaleControl.Kilometers")):Ri(P,_t,de,Lt._getUIString("ScaleControl.Meters"))}function Ri(Lt,P,at,_t){let Tt=function(Pt){let ie=Math.pow(10,`${Math.floor(Pt)}`.length-1),de=Pt/ie;return de=de>=10?10:de>=5?5:de>=3?3:de>=2?2:de>=1?1:function(Ee){let He=Math.pow(10,Math.ceil(-Math.log(Ee)/Math.LN10));return Math.round(Ee*He)/He}(de),ie*de}(at);Lt.style.width=P*(Tt/at)+"px",Lt.innerHTML=`${Tt} ${_t}`}let oo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},bu=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Cl(Lt){if(Lt){if(typeof Lt=="number"){let P=Math.round(Math.abs(Lt)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,Lt),"top-left":new e.P(P,P),"top-right":new e.P(-P,P),bottom:new e.P(0,-Lt),"bottom-left":new e.P(P,-P),"bottom-right":new e.P(-P,-P),left:new e.P(Lt,0),right:new e.P(-Lt,0)}}if(Lt instanceof e.P||Array.isArray(Lt)){let P=e.P.convert(Lt);return{center:P,top:P,"top-left":P,"top-right":P,bottom:P,"bottom-left":P,"bottom-right":P,left:P,right:P}}return{center:e.P.convert(Lt.center||[0,0]),top:e.P.convert(Lt.top||[0,0]),"top-left":e.P.convert(Lt["top-left"]||[0,0]),"top-right":e.P.convert(Lt["top-right"]||[0,0]),bottom:e.P.convert(Lt.bottom||[0,0]),"bottom-left":e.P.convert(Lt["bottom-left"]||[0,0]),"bottom-right":e.P.convert(Lt["bottom-right"]||[0,0]),left:e.P.convert(Lt.left||[0,0]),right:e.P.convert(Lt.right||[0,0])}}return Cl(new e.P(0,0))}let Th=r;t.AJAXError=e.bh,t.Evented=e.E,t.LngLat=e.N,t.MercatorCoordinate=e.Z,t.Point=e.P,t.addProtocol=e.bi,t.config=e.a,t.removeProtocol=e.bj,t.AttributionControl=Hi,t.BoxZoomHandler=Jl,t.CanvasSource=Qt,t.CooperativeGesturesHandler=va,t.DoubleClickZoomHandler=Ln,t.DragPanHandler=ya,t.DragRotateHandler=Pa,t.EdgeInsets=yu,t.FullscreenControl=class extends e.E{constructor(Lt={}){super(),this._onFullscreenChange=()=>{var P;let at=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((P=at?.shadowRoot)===null||P===void 0)&&P.fullscreenElement;)at=at.shadowRoot.fullscreenElement;at===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Lt&&Lt.container&&(Lt.container instanceof HTMLElement?this._container=Lt.container:e.w("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(Lt){return this._map=Lt,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){a.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let Lt=this._fullscreenButton=a.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);a.create("span","maplibregl-ctrl-icon",Lt).setAttribute("aria-hidden","true"),Lt.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let Lt=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Lt),this._fullscreenButton.title=Lt}_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._fullscreen?(this.fire(new e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_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()}},t.GeoJSONSource=Et,t.GeolocateControl=class extends e.E{constructor(Lt){super(),this._onSuccess=P=>{if(this._map){if(this._isOutOfMapMaxBounds(P))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",P)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=P,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&&this._watchState!=="OFF"&&this._updateMarker(P),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(P),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",P)),this._finish()}},this._updateCamera=P=>{let at=new e.N(P.coords.longitude,P.coords.latitude),_t=P.coords.accuracy,Tt=this._map.getBearing(),Pt=e.e({bearing:Tt},this.options.fitBoundsOptions),ie=it.fromLngLat(at,_t);this._map.fitBounds(ie,Pt,{geolocateSource:!0})},this._updateMarker=P=>{if(P){let at=new e.N(P.coords.longitude,P.coords.latitude);this._accuracyCircleMarker.setLngLat(at).addTo(this._map),this._userLocationDotMarker.setLngLat(at).addTo(this._map),this._accuracy=P.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=P=>{if(this._map){if(this.options.trackUserLocation)if(P.code===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._geolocateButton.disabled=!0;let at=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=at,this._geolocateButton.setAttribute("aria-label",at),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(P.code===3&&Uu)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",P)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",P=>P.preventDefault()),this._geolocateButton=a.create("button","maplibregl-ctrl-geolocate",this._container),a.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=P=>{if(this._map){if(P===!1){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");let at=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=at,this._geolocateButton.setAttribute("aria-label",at)}else{let at=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=at,this._geolocateButton.setAttribute("aria-label",at)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Fl({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Fl({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",at=>{at.geolocateSource||this._watchState!=="ACTIVE_LOCK"||at.originalEvent&&at.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")),this.fire(new e.k("userlocationlostfocus")))})}},this.options=e.e({},tc,Lt)}onAdd(Lt){return this._map=Lt,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,function*(P=!1){if(ds!==void 0&&!P)return ds;if(window.navigator.permissions===void 0)return ds=!!window.navigator.geolocation,ds;try{ds=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{ds=!!window.navigator.geolocation}return ds})}().then(P=>this._finishSetupUI(P)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,tu=0,Uu=!1}_isOutOfMapMaxBounds(Lt){let P=this._map.getMaxBounds(),at=Lt.coords;return P&&(at.longitude<P.getWest()||at.longitude>P.getEast()||at.latitude<P.getSouth()||at.latitude>P.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}`)}}_updateCircleRadius(){let Lt=this._map.getBounds(),P=Lt.getSouthEast(),at=Lt.getNorthEast(),_t=P.distanceTo(at),Tt=Math.ceil(this._accuracy/(_t/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Tt}px`,this._circleElement.style.height=`${Tt}px`}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":tu--,Uu=!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 e.k("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 e.k("trackuserlocationstart")),this.fire(new e.k("userlocationfocus"));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(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let Lt;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),tu++,tu>1?(Lt={maximumAge:6e5,timeout:0},Uu=!0):(Lt=this.options.positionOptions,Uu=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Lt)}}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)}},t.Hash=Su,t.ImageSource=te,t.KeyboardHandler=lr,t.LngLatBounds=it,t.LogoControl=Ba,t.Map=class extends Ei{constructor(Lt){e.bf.mark(e.bg.create);let P=Object.assign(Object.assign({},Hs),Lt);if(P.minZoom!=null&&P.maxZoom!=null&&P.minZoom>P.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(P.minPitch!=null&&P.maxPitch!=null&&P.minPitch>P.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(P.minPitch!=null&&P.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(P.maxPitch!=null&&P.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Ds(P.minZoom,P.maxZoom,P.minPitch,P.maxPitch,P.renderWorldCopies),{bearingSnap:P.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new ba,this._controls=[],this._mapId=e.a4(),this._contextLost=at=>{at.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:at}))},this._contextRestored=at=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("webglcontextrestored",{originalEvent:at}))},this._onMapScroll=at=>{if(at.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=P.interactive,this._maxTileCacheSize=P.maxTileCacheSize,this._maxTileCacheZoomLevels=P.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=P.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=P.preserveDrawingBuffer===!0,this._antialias=P.antialias===!0,this._trackResize=P.trackResize===!0,this._bearingSnap=P.bearingSnap,this._refreshExpiredTiles=P.refreshExpiredTiles===!0,this._fadeDuration=P.fadeDuration,this._crossSourceCollisions=P.crossSourceCollisions===!0,this._collectResourceTiming=P.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},No),P.locale),this._clickTolerance=P.clickTolerance,this._overridePixelRatio=P.pixelRatio,this._maxCanvasSize=P.maxCanvasSize,this.transformCameraUpdate=P.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=P.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new x(P.transformRequest),typeof P.container=="string"){if(this._container=document.getElementById(P.container),!this._container)throw new Error(`Container '${P.container}' not found.`)}else{if(!(P.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=P.container}if(P.maxBounds&&this.setMaxBounds(P.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let at=!1,_t=gc(Tt=>{this._trackResize&&!this._removed&&(this.resize(Tt),this.redraw())},50);this._resizeObserver=new ResizeObserver(Tt=>{at?_t(Tt):at=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Fi(this,P),this._hash=P.hash&&new Su(typeof P.hash=="string"&&P.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:P.center,zoom:P.zoom,bearing:P.bearing,pitch:P.pitch}),P.bounds&&(this.resize(),this.fitBounds(P.bounds,e.e({},P.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=P.localIdeographFontFamily,this._validateStyle=P.validateStyle,P.style&&this.setStyle(P.style,{localIdeographFontFamily:P.localIdeographFontFamily}),P.attributionControl&&this.addControl(new Hi(typeof P.attributionControl=="boolean"?void 0:P.attributionControl)),P.maplibreLogo&&this.addControl(new Ba,P.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",at=>{this._update(at.dataType==="style"),this.fire(new e.k(`${at.dataType}data`,at))}),this.on("dataloading",at=>{this.fire(new e.k(`${at.dataType}dataloading`,at))}),this.on("dataabort",at=>{this.fire(new e.k("sourcedataabort",at))})}_getMapId(){return this._mapId}addControl(Lt,P){if(P===void 0&&(P=Lt.getDefaultPosition?Lt.getDefaultPosition():"top-right"),!Lt||!Lt.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let at=Lt.onAdd(this);this._controls.push(Lt);let _t=this._controlPositions[P];return P.indexOf("bottom")!==-1?_t.insertBefore(at,_t.firstChild):_t.appendChild(at),this}removeControl(Lt){if(!Lt||!Lt.onRemove)return this.fire(new e.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let P=this._controls.indexOf(Lt);return P>-1&&this._controls.splice(P,1),Lt.onRemove(this),this}hasControl(Lt){return this._controls.indexOf(Lt)>-1}calculateCameraOptionsFromTo(Lt,P,at,_t){return _t==null&&this.terrain&&(_t=this.terrain.getElevationForLngLatZoom(at,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Lt,P,at,_t)}resize(Lt){var P;let at=this._containerDimensions(),_t=at[0],Tt=at[1],Pt=this._getClampedPixelRatio(_t,Tt);if(this._resizeCanvas(_t,Tt,Pt),this.painter.resize(_t,Tt,Pt),this.painter.overLimit()){let de=this.painter.context.gl;this._maxCanvasSize=[de.drawingBufferWidth,de.drawingBufferHeight];let Ee=this._getClampedPixelRatio(_t,Tt);this._resizeCanvas(_t,Tt,Ee),this.painter.resize(_t,Tt,Ee)}this.transform.resize(_t,Tt),(P=this._requestedCameraState)===null||P===void 0||P.resize(_t,Tt);let ie=!this._moving;return ie&&(this.stop(),this.fire(new e.k("movestart",Lt)).fire(new e.k("move",Lt))),this.fire(new e.k("resize",Lt)),ie&&this.fire(new e.k("moveend",Lt)),this}_getClampedPixelRatio(Lt,P){let{0:at,1:_t}=this._maxCanvasSize,Tt=this.getPixelRatio(),Pt=Lt*Tt,ie=P*Tt;return Math.min(Pt>at?at/Pt:1,ie>_t?_t/ie:1)*Tt}getPixelRatio(){var Lt;return(Lt=this._overridePixelRatio)!==null&&Lt!==void 0?Lt:devicePixelRatio}setPixelRatio(Lt){this._overridePixelRatio=Lt,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Lt){return this.transform.setMaxBounds(it.convert(Lt)),this._update()}setMinZoom(Lt){if((Lt=Lt??-2)>=-2&&Lt<=this.transform.maxZoom)return this.transform.minZoom=Lt,this._update(),this.getZoom()<Lt&&this.setZoom(Lt),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(Lt){if((Lt=Lt??22)>=this.transform.minZoom)return this.transform.maxZoom=Lt,this._update(),this.getZoom()>Lt&&this.setZoom(Lt),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Lt){if((Lt=Lt??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Lt>=0&&Lt<=this.transform.maxPitch)return this.transform.minPitch=Lt,this._update(),this.getPitch()<Lt&&this.setPitch(Lt),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(Lt){if((Lt=Lt??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(Lt>=this.transform.minPitch)return this.transform.maxPitch=Lt,this._update(),this.getPitch()>Lt&&this.setPitch(Lt),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Lt){return this.transform.renderWorldCopies=Lt,this._update()}project(Lt){return this.transform.locationPoint(e.N.convert(Lt),this.style&&this.terrain)}unproject(Lt){return this.transform.pointLocation(e.P.convert(Lt),this.terrain)}isMoving(){var Lt;return this._moving||((Lt=this.handlers)===null||Lt===void 0?void 0:Lt.isMoving())}isZooming(){var Lt;return this._zooming||((Lt=this.handlers)===null||Lt===void 0?void 0:Lt.isZooming())}isRotating(){var Lt;return this._rotating||((Lt=this.handlers)===null||Lt===void 0?void 0:Lt.isRotating())}_createDelegatedListener(Lt,P,at){if(Lt==="mouseenter"||Lt==="mouseover"){let _t=!1;return{layers:P,listener:at,delegates:{mousemove:Tt=>{let Pt=P.filter(de=>this.getLayer(de)),ie=Pt.length!==0?this.queryRenderedFeatures(Tt.point,{layers:Pt}):[];ie.length?_t||(_t=!0,at.call(this,new $l(Lt,this,Tt.originalEvent,{features:ie}))):_t=!1},mouseout:()=>{_t=!1}}}}if(Lt==="mouseleave"||Lt==="mouseout"){let _t=!1;return{layers:P,listener:at,delegates:{mousemove:Tt=>{let Pt=P.filter(ie=>this.getLayer(ie));(Pt.length!==0?this.queryRenderedFeatures(Tt.point,{layers:Pt}):[]).length?_t=!0:_t&&(_t=!1,at.call(this,new $l(Lt,this,Tt.originalEvent)))},mouseout:Tt=>{_t&&(_t=!1,at.call(this,new $l(Lt,this,Tt.originalEvent)))}}}}{let _t=Tt=>{let Pt=P.filter(de=>this.getLayer(de)),ie=Pt.length!==0?this.queryRenderedFeatures(Tt.point,{layers:Pt}):[];ie.length&&(Tt.features=ie,at.call(this,Tt),delete Tt.features)};return{layers:P,listener:at,delegates:{[Lt]:_t}}}}_saveDelegatedListener(Lt,P){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Lt]=this._delegatedListeners[Lt]||[],this._delegatedListeners[Lt].push(P)}_removeDelegatedListener(Lt,P,at){if(!this._delegatedListeners||!this._delegatedListeners[Lt])return;let _t=this._delegatedListeners[Lt];for(let Tt=0;Tt<_t.length;Tt++){let Pt=_t[Tt];if(Pt.listener===at&&Pt.layers.length===P.length&&Pt.layers.every(ie=>P.includes(ie))){for(let ie in Pt.delegates)this.off(ie,Pt.delegates[ie]);return void _t.splice(Tt,1)}}}on(Lt,P,at){if(at===void 0)return super.on(Lt,P);let _t=this._createDelegatedListener(Lt,typeof P=="string"?[P]:P,at);this._saveDelegatedListener(Lt,_t);for(let Tt in _t.delegates)this.on(Tt,_t.delegates[Tt]);return this}once(Lt,P,at){if(at===void 0)return super.once(Lt,P);let _t=typeof P=="string"?[P]:P,Tt=this._createDelegatedListener(Lt,_t,at);for(let Pt in Tt.delegates){let ie=Tt.delegates[Pt];Tt.delegates[Pt]=(...de)=>{this._removeDelegatedListener(Lt,_t,at),ie(...de)}}this._saveDelegatedListener(Lt,Tt);for(let Pt in Tt.delegates)this.once(Pt,Tt.delegates[Pt]);return this}off(Lt,P,at){return at===void 0?super.off(Lt,P):(this._removeDelegatedListener(Lt,typeof P=="string"?[P]:P,at),this)}queryRenderedFeatures(Lt,P){if(!this.style)return[];let at,_t=Lt instanceof e.P||Array.isArray(Lt),Tt=_t?Lt:[[0,0],[this.transform.width,this.transform.height]];if(P=P||(_t?{}:Lt)||{},Tt instanceof e.P||typeof Tt[0]=="number")at=[e.P.convert(Tt)];else{let Pt=e.P.convert(Tt[0]),ie=e.P.convert(Tt[1]);at=[Pt,new e.P(ie.x,Pt.y),ie,new e.P(Pt.x,ie.y),Pt]}return this.style.queryRenderedFeatures(at,P,this.transform)}querySourceFeatures(Lt,P){return this.style.querySourceFeatures(Lt,P)}setStyle(Lt,P){return(P=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},P)).diff!==!1&&P.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Lt?(this._diffStyle(Lt,P),this):(this._localIdeographFontFamily=P.localIdeographFontFamily,this._updateStyle(Lt,P))}setTransformRequest(Lt){return this._requestManager.setTransformRequest(Lt),this}_getUIString(Lt){let P=this._locale[Lt];if(P==null)throw new Error(`Missing UI string '${Lt}'`);return P}_updateStyle(Lt,P){if(P.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Lt,P));let at=this.style&&P.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Lt)),Lt?(this.style=new Gr(this,P||{}),this.style.setEventedParent(this,{style:this.style}),typeof Lt=="string"?this.style.loadURL(Lt,P,at):this.style.loadJSON(Lt,P,at),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Gr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Lt,P){if(typeof Lt=="string"){let at=this._requestManager.transformRequest(Lt,"Style");e.h(at,new AbortController).then(_t=>{this._updateDiff(_t.data,P)}).catch(_t=>{_t&&this.fire(new e.j(_t))})}else typeof Lt=="object"&&this._updateDiff(Lt,P)}_updateDiff(Lt,P){try{this.style.setState(Lt,P)&&this._update(!0)}catch(at){e.w(`Unable to perform style diff: ${at.message||at.error||at}. Rebuilding the style from scratch.`),this._updateStyle(Lt,P)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(Lt,P){return this._lazyInitEmptyStyle(),this.style.addSource(Lt,P),this._update(!0)}isSourceLoaded(Lt){let P=this.style&&this.style.sourceCaches[Lt];if(P!==void 0)return P.loaded();this.fire(new e.j(new Error(`There is no source with ID '${Lt}'`)))}setTerrain(Lt){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Lt){let P=this.style.sourceCaches[Lt.source];if(!P)throw new Error(`cannot load terrain, because there exists no source with ID: ${Lt.source}`);this.terrain===null&&P.reload();for(let at in this.style._layers){let _t=this.style._layers[at];_t.type==="hillshade"&&_t.source===Lt.source&&e.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Jo(this.painter,P,Lt),this.painter.renderToTexture=new xs(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=at=>{at.dataType==="style"?this.terrain.sourceCache.freeRtt():at.dataType==="source"&&at.tile&&(at.sourceId!==Lt.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(at.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.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new e.k("terrain",{terrain:Lt})),this}getTerrain(){var Lt,P;return(P=(Lt=this.terrain)===null||Lt===void 0?void 0:Lt.options)!==null&&P!==void 0?P:null}areTilesLoaded(){let Lt=this.style&&this.style.sourceCaches;for(let P in Lt){let at=Lt[P]._tiles;for(let _t in at){let Tt=at[_t];if(Tt.state!=="loaded"&&Tt.state!=="errored")return!1}}return!0}removeSource(Lt){return this.style.removeSource(Lt),this._update(!0)}getSource(Lt){return this.style.getSource(Lt)}addImage(Lt,P,at={}){let{pixelRatio:_t=1,sdf:Tt=!1,stretchX:Pt,stretchY:ie,content:de,textFitWidth:Ee,textFitHeight:He}=at;if(this._lazyInitEmptyStyle(),!(P instanceof HTMLImageElement||e.b(P))){if(P.width===void 0||P.height===void 0)return this.fire(new e.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:ar,height:ir,data:zr}=P,Zr=P;return this.style.addImage(Lt,{data:new e.R({width:ar,height:ir},new Uint8Array(zr)),pixelRatio:_t,stretchX:Pt,stretchY:ie,content:de,textFitWidth:Ee,textFitHeight:He,sdf:Tt,version:0,userImage:Zr}),Zr.onAdd&&Zr.onAdd(this,Lt),this}}{let{width:ar,height:ir,data:zr}=o.getImageData(P);this.style.addImage(Lt,{data:new e.R({width:ar,height:ir},zr),pixelRatio:_t,stretchX:Pt,stretchY:ie,content:de,textFitWidth:Ee,textFitHeight:He,sdf:Tt,version:0})}}updateImage(Lt,P){let at=this.style.getImage(Lt);if(!at)return this.fire(new e.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let _t=P instanceof HTMLImageElement||e.b(P)?o.getImageData(P):P,{width:Tt,height:Pt,data:ie}=_t;if(Tt===void 0||Pt===void 0)return this.fire(new e.j(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(Tt!==at.data.width||Pt!==at.data.height)return this.fire(new e.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let de=!(P instanceof HTMLImageElement||e.b(P));return at.data.replace(ie,de),this.style.updateImage(Lt,at),this}getImage(Lt){return this.style.getImage(Lt)}hasImage(Lt){return Lt?!!this.style.getImage(Lt):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(Lt){this.style.removeImage(Lt)}loadImage(Lt){return l.getImage(this._requestManager.transformRequest(Lt,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Lt,P){return this._lazyInitEmptyStyle(),this.style.addLayer(Lt,P),this._update(!0)}moveLayer(Lt,P){return this.style.moveLayer(Lt,P),this._update(!0)}removeLayer(Lt){return this.style.removeLayer(Lt),this._update(!0)}getLayer(Lt){return this.style.getLayer(Lt)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Lt,P,at){return this.style.setLayerZoomRange(Lt,P,at),this._update(!0)}setFilter(Lt,P,at={}){return this.style.setFilter(Lt,P,at),this._update(!0)}getFilter(Lt){return this.style.getFilter(Lt)}setPaintProperty(Lt,P,at,_t={}){return this.style.setPaintProperty(Lt,P,at,_t),this._update(!0)}getPaintProperty(Lt,P){return this.style.getPaintProperty(Lt,P)}setLayoutProperty(Lt,P,at,_t={}){return this.style.setLayoutProperty(Lt,P,at,_t),this._update(!0)}getLayoutProperty(Lt,P){return this.style.getLayoutProperty(Lt,P)}setGlyphs(Lt,P={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Lt,P),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Lt,P,at={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Lt,P,at,_t=>{_t||this._update(!0)}),this}removeSprite(Lt){return this._lazyInitEmptyStyle(),this.style.removeSprite(Lt),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Lt,P={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Lt,P,at=>{at||this._update(!0)}),this}setLight(Lt,P={}){return this._lazyInitEmptyStyle(),this.style.setLight(Lt,P),this._update(!0)}getLight(){return this.style.getLight()}setSky(Lt){return this._lazyInitEmptyStyle(),this.style.setSky(Lt),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Lt,P){return this.style.setFeatureState(Lt,P),this._update()}removeFeatureState(Lt,P){return this.style.removeFeatureState(Lt,P),this._update()}getFeatureState(Lt){return this.style.getFeatureState(Lt)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Lt=0,P=0;return this._container&&(Lt=this._container.clientWidth||400,P=this._container.clientHeight||300),[Lt,P]}_setupContainer(){let Lt=this._container;Lt.classList.add("maplibregl-map");let P=this._canvasContainer=a.create("div","maplibregl-canvas-container",Lt);this._interactive&&P.classList.add("maplibregl-interactive"),this._canvas=a.create("canvas","maplibregl-canvas",P),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let at=this._containerDimensions(),_t=this._getClampedPixelRatio(at[0],at[1]);this._resizeCanvas(at[0],at[1],_t);let Tt=this._controlContainer=a.create("div","maplibregl-control-container",Lt),Pt=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ie=>{Pt[ie]=a.create("div",`maplibregl-ctrl-${ie} `,Tt)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Lt,P,at){this._canvas.width=Math.floor(at*Lt),this._canvas.height=Math.floor(at*P),this._canvas.style.width=`${Lt}px`,this._canvas.style.height=`${P}px`}_setupPainter(){let Lt={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},P=null;this._canvas.addEventListener("webglcontextcreationerror",_t=>{P={requestedAttributes:Lt},_t&&(P.statusMessage=_t.statusMessage,P.type=_t.type)},{once:!0});let at=this._canvas.getContext("webgl2",Lt)||this._canvas.getContext("webgl",Lt);if(!at){let _t="Failed to initialize WebGL";throw P?(P.message=_t,new Error(JSON.stringify(P))):new Error(_t)}this.painter=new Ru(at,this.transform),s.testSupport(at)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Lt){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Lt,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Lt){return this._update(),this._renderTaskQueue.add(Lt)}_cancelRenderFrame(Lt){this._renderTaskQueue.remove(Lt)}_render(Lt){let P=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Lt),this._removed)return;let at=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let Tt=this.transform.zoom,Pt=o.now();this.style.zoomHistory.update(Tt,Pt);let ie=new e.z(Tt,{now:Pt,fadeDuration:P,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),de=ie.crossFadingFactor();de===1&&de===this._crossFadingFactor||(at=!0,this._crossFadingFactor=de),this.style.update(ie)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,P,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:P,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.bf.mark(e.bg.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||at)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let _t=this._sourcesDirty||this._styleDirty||this._placementDirty;return _t||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||_t||(this._fullyLoaded=!0,e.bf.mark(e.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var Lt;this._hash&&this._hash.remove();for(let at of this._controls)at.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),l.removeThrottleControl(this._imageQueueHandle),(Lt=this._resizeObserver)===null||Lt===void 0||Lt.disconnect();let P=this.painter.context.gl.getExtension("WEBGL_lose_context");P!=null&&P.loseContext&&P.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),a.remove(this._canvasContainer),a.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.bf.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,o.frameAsync(this._frameRequest).then(Lt=>{e.bf.frame(Lt),this._frameRequest=null,this._render(Lt)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Lt){this._showTileBoundaries!==Lt&&(this._showTileBoundaries=Lt,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Lt){this._showPadding!==Lt&&(this._showPadding=Lt,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Lt){this._showCollisionBoxes!==Lt&&(this._showCollisionBoxes=Lt,Lt?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Lt){this._showOverdrawInspector!==Lt&&(this._showOverdrawInspector=Lt,this._update())}get repaint(){return!!this._repaint}set repaint(Lt){this._repaint!==Lt&&(this._repaint=Lt,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Lt){this._vertices=Lt,this._update()}get version(){return Qs}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=$l,t.MapTouchEvent=ic,t.MapWheelEvent=Oc,t.Marker=Fl,t.NavigationControl=class{constructor(Lt){this._updateZoomButtons=()=>{let P=this._map.getZoom(),at=P===this._map.getMaxZoom(),_t=P===this._map.getMinZoom();this._zoomInButton.disabled=at,this._zoomOutButton.disabled=_t,this._zoomInButton.setAttribute("aria-disabled",at.toString()),this._zoomOutButton.setAttribute("aria-disabled",_t.toString())},this._rotateCompassArrow=()=>{let P=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=P},this._setButtonTitle=(P,at)=>{let _t=this._map._getUIString(`NavigationControl.${at}`);P.title=_t,P.setAttribute("aria-label",_t)},this.options=e.e({},ni,Lt),this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",P=>P.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",P=>this._map.zoomIn({},{originalEvent:P})),a.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",P=>this._map.zoomOut({},{originalEvent:P})),a.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",P=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:P}):this._map.resetNorth({},{originalEvent:P})}),this._compassIcon=a.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Lt){return this._map=Lt,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 to(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){a.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(Lt,P){let at=a.create("button",Lt,this._container);return at.type="button",at.addEventListener("click",P),at}},t.Popup=class extends e.E{constructor(Lt){super(),this.remove=()=>(this._content&&a.remove(this._content),this._container&&(a.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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.k("close"))),this),this._onMouseUp=P=>{this._update(P.point)},this._onMouseMove=P=>{this._update(P.point)},this._onDrag=P=>{this._update(P.point)},this._update=P=>{var at;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=a.create("div","maplibregl-popup",this._map.getContainer()),this._tip=a.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let de of this.options.className.split(" "))this._container.classList.add(de);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Qo(this._lngLat,this._flatPos,this._map.transform):(at=this._lngLat)===null||at===void 0?void 0:at.wrap(),this._trackPointer&&!P)return;let _t=this._flatPos=this._pos=this._trackPointer&&P?P:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&P?P:this._map.transform.locationPoint(this._lngLat));let Tt=this.options.anchor,Pt=Cl(this.options.offset);if(!Tt){let de=this._container.offsetWidth,Ee=this._container.offsetHeight,He;He=_t.y+Pt.bottom.y<Ee?["top"]:_t.y>this._map.transform.height-Ee?["bottom"]:[],_t.x<de/2?He.push("left"):_t.x>this._map.transform.width-de/2&&He.push("right"),Tt=He.length===0?"bottom":He.join("-")}let ie=_t.add(Pt[Tt]);this.options.subpixelPositioning||(ie=ie.round()),a.setTransform(this._container,`${Tl[Tt]} translate(${ie.x}px,${ie.y}px)`),Kl(this._container,Tt,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(oo),Lt)}addTo(Lt){return this._map&&this.remove(),this._map=Lt,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 e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(Lt){return this._lngLat=e.N.convert(Lt),this._pos=null,this._flatPos=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._flatPos=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(Lt){return this.setDOMContent(document.createTextNode(Lt))}setHTML(Lt){let P=document.createDocumentFragment(),at=document.createElement("body"),_t;for(at.innerHTML=Lt;_t=at.firstChild,_t;)P.appendChild(_t);return this.setDOMContent(P)}getMaxWidth(){var Lt;return(Lt=this._container)===null||Lt===void 0?void 0:Lt.style.maxWidth}setMaxWidth(Lt){return this.options.maxWidth=Lt,this._update(),this}setDOMContent(Lt){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(Lt),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Lt){return this._container&&this._container.classList.add(Lt),this}removeClassName(Lt){return this._container&&this._container.classList.remove(Lt),this}setOffset(Lt){return this.options.offset=Lt,this._update(),this}toggleClassName(Lt){if(this._container)return this._container.classList.toggle(Lt)}setSubpixelPositioning(Lt){this.options.subpixelPositioning=Lt}_createCloseButton(){this.options.closeButton&&(this._closeButton=a.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let Lt=this._container.querySelector(bu);Lt&&Lt.focus()}},t.RasterDEMTileSource=Ft,t.RasterTileSource=xt,t.ScaleControl=class{constructor(Lt){this._onMove=()=>{ec(this._map,this._container,this.options)},this.setUnit=P=>{this.options.unit=P,ec(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},$s),Lt)}getDefaultPosition(){return"bottom-left"}onAdd(Lt){return this._map=Lt,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Lt.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=un,t.Style=Gr,t.TerrainControl=class{constructor(Lt){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._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.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=Lt}onAdd(Lt){return this._map=Lt,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=a.create("button","maplibregl-ctrl-terrain",this._container),a.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(){a.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=wc,t.TwoFingersTouchRotateHandler=sc,t.TwoFingersTouchZoomHandler=qs,t.TwoFingersTouchZoomRotateHandler=Jn,t.VectorTileSource=wt,t.VideoSource=Jt,t.addSourceType=(Lt,P)=>e._(void 0,void 0,void 0,function*(){if(gt(Lt))throw new Error(`A source type called "${Lt}" already exists.`);((at,_t)=>{Wt[at]=_t})(Lt,P)}),t.clearPrewarmedResources=function(){let Lt=tt;Lt&&(Lt.isPreloaded()&&Lt.numActive()===1?(Lt.release(rt),tt=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()"))},t.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return Kt().getRTLTextPluginStatus()},t.getVersion=function(){return Th},t.getWorkerCount=function(){return ct.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(Lt){return Q().broadcast("IS",Lt)},t.prewarm=function(){st().acquire(rt)},t.setMaxParallelImageRequests=function(Lt){e.a.MAX_PARALLEL_IMAGE_REQUESTS=Lt},t.setRTLTextPlugin=function(Lt,P){return Kt().setRTLTextPlugin(Lt,P)},t.setWorkerCount=function(Lt){ct.workerCount=Lt},t.setWorkerUrl=function(Lt){e.a.WORKER_URL=Lt}});var A=c;return A})}),$I=Vt((X,V)=>{var c=qr(),g=sl().sanitizeHTML,E=w5(),A=Wd();function t(o,a){this.subplot=o,this.uid=o.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=A.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var e=t.prototype;e.update=function(o){this.visible?this.needsNewImage(o)?this.updateImage(o):this.needsNewSource(o)?(this.removeLayer(),this.updateSource(o),this.updateLayer(o)):this.needsNewLayer(o)?this.updateLayer(o):this.updateStyle(o):(this.updateSource(o),this.updateLayer(o)),this.visible=r(o)},e.needsNewImage=function(o){var a=this.subplot.map;return a.getSource(this.idSource)&&this.sourceType==="image"&&o.sourcetype==="image"&&(this.source!==o.source||JSON.stringify(this.coordinates)!==JSON.stringify(o.coordinates))},e.needsNewSource=function(o){return this.sourceType!==o.sourcetype||JSON.stringify(this.source)!==JSON.stringify(o.source)||this.layerType!==o.type},e.needsNewLayer=function(o){return this.layerType!==o.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},e.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},e.updateImage=function(o){var a=this.subplot.map;a.getSource(this.idSource).updateImage({url:o.source,coordinates:o.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},e.updateSource=function(o){var a=this.subplot.map;if(a.getSource(this.idSource)&&a.removeSource(this.idSource),this.sourceType=o.sourcetype,this.source=o.source,!!r(o)){var s=n(o);a.addSource(this.idSource,s)}},e.findFollowingMapLayerId=function(o){if(o==="traces")for(var a=this.subplot.getMapLayers(),s=0;s<a.length;s++){var h=a[s].id;if(typeof h=="string"&&h.indexOf(A.traceLayerPrefix)===0){o=h;break}}return o},e.updateLayer=function(o){var a=this.subplot,s=i(o),h=this.lookupBelow(),v=this.findFollowingMapLayerId(h);this.removeLayer(),r(o)&&a.addLayer({id:this.idLayer,source:this.idSource,"source-layer":o.sourcelayer||"",type:o.type,minzoom:o.minzoom,maxzoom:o.maxzoom,layout:s.layout,paint:s.paint},v),this.layerType=o.type,this.below=h},e.updateStyle=function(o){if(r(o)){var a=i(o);this.subplot.setOptions(this.idLayer,"setLayoutProperty",a.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",a.paint)}},e.removeLayer=function(){var o=this.subplot.map;o.getLayer(this.idLayer)&&o.removeLayer(this.idLayer)},e.dispose=function(){var o=this.subplot.map;o.getLayer(this.idLayer)&&o.removeLayer(this.idLayer),o.getSource(this.idSource)&&o.removeSource(this.idSource)};function r(o){if(!o.visible)return!1;var a=o.source;if(Array.isArray(a)&&a.length>0){for(var s=0;s<a.length;s++)if(typeof a[s]!="string"||a[s].length===0)return!1;return!0}return c.isPlainObject(a)||typeof a=="string"&&a.length>0}function i(o){var a={},s={};switch(o.type){case"circle":c.extendFlat(s,{"circle-radius":o.circle.radius,"circle-color":o.color,"circle-opacity":o.opacity});break;case"line":c.extendFlat(s,{"line-width":o.line.width,"line-color":o.color,"line-opacity":o.opacity,"line-dasharray":o.line.dash});break;case"fill":c.extendFlat(s,{"fill-color":o.color,"fill-outline-color":o.fill.outlinecolor,"fill-opacity":o.opacity});break;case"symbol":var h=o.symbol,v=E(h.textposition,h.iconsize);c.extendFlat(a,{"icon-image":h.icon+"-15","icon-size":h.iconsize/10,"text-field":h.text,"text-size":h.textfont.size,"text-anchor":v.anchor,"text-offset":v.offset,"symbol-placement":h.placement}),c.extendFlat(s,{"icon-color":o.color,"text-color":h.textfont.color,"text-opacity":o.opacity});break;case"raster":c.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":o.opacity});break}return{layout:a,paint:s}}function n(o){var a=o.sourcetype,s=o.source,h={type:a},v;return a==="geojson"?v="data":a==="vector"?v=typeof s=="string"?"url":"tiles":a==="raster"?(v="tiles",h.tileSize=256):a==="image"&&(v="url",h.coordinates=o.coordinates),h[v]=s,o.sourceattribution&&(h.attribution=g(o.sourceattribution)),h}V.exports=function(o,a,s){var h=new t(o,a);return h.update(s),h}}),JI=Vt((X,V)=>{var c=XI(),g=qr(),E=Vd(),A=Mi(),t=ao(),e=af(),r=Hu(),i=ep(),n=i.drawMode,o=i.selectMode,a=fc().prepSelect,s=fc().clearOutline,h=fc().clearSelectionsCache,v=fc().selectOnClick,m=Wd(),p=$I();function y(M,w){this.id=w,this.gd=M;var u=M._fullLayout,f=M._context;this.container=u._glcontainer.node(),this.isStatic=f.staticPlot,this.uid=u._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(u),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=y.prototype;l.plot=function(M,w,u){var f=this,k;f.map?k=new Promise(function(_,D){f.updateMap(M,w,_,D)}):k=new Promise(function(_,D){f.createMap(M,w,_,D)}),u.push(k)},l.createMap=function(M,w,u,f){var k=this,_=w[k.id],D=k.styleObj=b(_.style),I=_.bounds,O=I?[[I.west,I.south],[I.east,I.north]]:null,B=k.map=new c.Map({container:k.div,style:D.style,center:T(_.center),zoom:_.zoom,bearing:_.bearing,pitch:_.pitch,maxBounds:O,interactive:!k.isStatic,preserveDrawingBuffer:k.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new c.AttributionControl({compact:!0})),R={};B.on("styleimagemissing",function(F){var N=F.id;if(!R[N]&&N.includes("-15")){R[N]=!0;var j=new Image(15,15);j.onload=function(){B.addImage(N,j)},j.crossOrigin="Anonymous",j.src="https://unpkg.com/maki@2.1.0/icons/"+N+".svg"}}),B.setTransformRequest(function(F){return F=F.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),F=F.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),F=F.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:F}}),B._canvas.style.left="0px",B._canvas.style.top="0px",k.rejectOnError(f),k.isStatic||k.initFx(M,w);var L=[];L.push(new Promise(function(F){B.once("load",F)})),L=L.concat(E.fetchTraceGeoData(M)),Promise.all(L).then(function(){k.fillBelowLookup(M,w),k.updateData(M),k.updateLayout(w),k.resolveOnRender(u)}).catch(f)},l.updateMap=function(M,w,u,f){var k=this,_=k.map,D=w[this.id];k.rejectOnError(f);var I=[],O=b(D.style);JSON.stringify(k.styleObj)!==JSON.stringify(O)&&(k.styleObj=O,_.setStyle(O.style),k.traceHash={},I.push(new Promise(function(B){_.once("styledata",B)}))),I=I.concat(E.fetchTraceGeoData(M)),Promise.all(I).then(function(){k.fillBelowLookup(M,w),k.updateData(M),k.updateLayout(w),k.resolveOnRender(u)}).catch(f)},l.fillBelowLookup=function(M,w){var u=w[this.id],f=u.layers,k,_,D=this.belowLookup={},I=!1;for(k=0;k<M.length;k++){var O=M[k][0].trace,B=O._module;typeof O.below=="string"?_=O.below:B.getBelow&&(_=B.getBelow(O,this)),_===""&&(I=!0),D["trace-"+O.uid]=_||""}for(k=0;k<f.length;k++){var R=f[k];typeof R.below=="string"?_=R.below:I?_="traces":_="",D["layout-"+k]=_}var L={},F,N;for(F in D)_=D[F],L[_]?L[_].push(F):L[_]=[F];for(_ in L){var j=L[_];if(j.length>1)for(k=0;k<j.length;k++)F=j[k],F.indexOf("trace-")===0?(N=F.split("trace-")[1],this.traceHash[N]&&(this.traceHash[N].below=null)):F.indexOf("layout-")===0&&(N=F.split("layout-")[1],this.layerList[N]&&(this.layerList[N].below=null))}};var x={choroplethmap:0,densitymap:1,scattermap:2};l.updateData=function(M){var w=this.traceHash,u,f,k,_,D=M.slice().sort(function(L,F){return x[L[0].trace.type]-x[F[0].trace.type]});for(k=0;k<D.length;k++){var I=D[k];f=I[0].trace,u=w[f.uid];var O=!1;u&&(u.type===f.type?(u.update(I),O=!0):u.dispose()),!O&&f._module&&(w[f.uid]=f._module.plot(this,I))}var B=Object.keys(w);t:for(k=0;k<B.length;k++){var R=B[k];for(_=0;_<M.length;_++)if(f=M[_][0].trace,R===f.uid)continue t;u=w[R],u.dispose(),delete w[R]}},l.updateLayout=function(M){var w=this.map,u=M[this.id];!this.dragging&&!this.wheeling&&(w.setCenter(T(u.center)),w.setZoom(u.zoom),w.setBearing(u.bearing),w.setPitch(u.pitch)),this.updateLayers(M),this.updateFramework(M),this.updateFx(M),this.map.resize(),this.gd._context._scrollZoom.map?w.scrollZoom.enable():w.scrollZoom.disable()},l.resolveOnRender=function(M){var w=this.map;w.on("render",function u(){w.loaded()&&(w.off("render",u),setTimeout(M,10))})},l.rejectOnError=function(M){var w=this.map;function u(){M(new Error(m.mapOnErrorMsg))}w.once("error",u),w.once("style.error",u),w.once("source.error",u),w.once("tile.error",u),w.once("layer.error",u)},l.createFramework=function(M){var w=this,u=w.div=document.createElement("div");u.id=w.uid,u.style.position="absolute",w.container.appendChild(u),w.xaxis={_id:"x",c2p:function(f){return w.project(f).x}},w.yaxis={_id:"y",c2p:function(f){return w.project(f).y}},w.updateFramework(M),w.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},t.setConvert(w.mockAxis,M)},l.initFx=function(M,w){var u=this,f=u.gd,k=u.map;k.on("moveend",function(I){if(u.map){var O=f._fullLayout;if(I.originalEvent||u.wheeling){var B=O[u.id];A.call("_storeDirectGUIEdit",f.layout,O._preGUI,u.getViewEdits(B));var R=u.getView();B._input.center=B.center=R.center,B._input.zoom=B.zoom=R.zoom,B._input.bearing=B.bearing=R.bearing,B._input.pitch=B.pitch=R.pitch,f.emit("plotly_relayout",u.getViewEditsWithDerived(R))}I.originalEvent&&I.originalEvent.type==="mouseup"?u.dragging=!1:u.wheeling&&(u.wheeling=!1),O&&O._rehover&&O._rehover()}}),k.on("wheel",function(){u.wheeling=!0}),k.on("mousemove",function(I){var O=u.div.getBoundingClientRect(),B=[I.originalEvent.offsetX,I.originalEvent.offsetY];I.target.getBoundingClientRect=function(){return O},u.xaxis.p2c=function(){return k.unproject(B).lng},u.yaxis.p2c=function(){return k.unproject(B).lat},f._fullLayout._rehover=function(){f._fullLayout._hoversubplot===u.id&&f._fullLayout[u.id]&&r.hover(f,I,u.id)},r.hover(f,I,u.id),f._fullLayout._hoversubplot=u.id});function _(){r.loneUnhover(w._hoverlayer)}k.on("dragstart",function(){u.dragging=!0,_()}),k.on("zoomstart",_),k.on("mouseout",function(){f._fullLayout._hoversubplot=null});function D(){var I=u.getView();f.emit("plotly_relayouting",u.getViewEditsWithDerived(I))}k.on("drag",D),k.on("zoom",D),k.on("dblclick",function(){var I=f._fullLayout[u.id];A.call("_storeDirectGUIEdit",f.layout,f._fullLayout._preGUI,u.getViewEdits(I));var O=u.viewInitial;k.setCenter(T(O.center)),k.setZoom(O.zoom),k.setBearing(O.bearing),k.setPitch(O.pitch);var B=u.getView();I._input.center=I.center=B.center,I._input.zoom=I.zoom=B.zoom,I._input.bearing=I.bearing=B.bearing,I._input.pitch=I.pitch=B.pitch,f.emit("plotly_doubleclick",null),f.emit("plotly_relayout",u.getViewEditsWithDerived(B))}),u.clearOutline=function(){h(u.dragOptions),s(u.dragOptions.gd)},u.onClickInPanFn=function(I){return function(O){var B=f._fullLayout.clickmode;B.indexOf("select")>-1&&v(O.originalEvent,f,[u.xaxis],[u.yaxis],u.id,I),B.indexOf("event")>-1&&r.click(f,O.originalEvent)}}},l.updateFx=function(M){var w=this,u=w.map,f=w.gd;if(w.isStatic)return;function k(O){var B=w.map.unproject(O);return[B.lng,B.lat]}var _=M.dragmode,D;D=function(O,B){if(B.isRect){var R=O.range={};R[w.id]=[k([B.xmin,B.ymin]),k([B.xmax,B.ymax])]}else{var L=O.lassoPoints={};L[w.id]=B.map(k)}};var I=w.dragOptions;w.dragOptions=g.extendDeep(I||{},{dragmode:M.dragmode,element:w.div,gd:f,plotinfo:{id:w.id,domain:M[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:D},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),u.off("click",w.onClickInPanHandler),o(_)||n(_)?(u.dragPan.disable(),u.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(O,B,R){a(O,B,R,w.dragOptions,_)},e.init(w.dragOptions)):(u.dragPan.enable(),u.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),u.on("click",w.onClickInPanHandler))},l.updateFramework=function(M){var w=M[this.id].domain,u=M._size,f=this.div.style;f.width=u.w*(w.x[1]-w.x[0])+"px",f.height=u.h*(w.y[1]-w.y[0])+"px",f.left=u.l+w.x[0]*u.w+"px",f.top=u.t+(1-w.y[1])*u.h+"px",this.xaxis._offset=u.l+w.x[0]*u.w,this.xaxis._length=u.w*(w.x[1]-w.x[0]),this.yaxis._offset=u.t+(1-w.y[1])*u.h,this.yaxis._length=u.h*(w.y[1]-w.y[0])},l.updateLayers=function(M){var w=M[this.id],u=w.layers,f=this.layerList,k;if(u.length!==f.length){for(k=0;k<f.length;k++)f[k].dispose();for(f=this.layerList=[],k=0;k<u.length;k++)f.push(p(this,k,u[k]))}else for(k=0;k<u.length;k++)f[k].update(u[k])},l.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},l.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},l.setOptions=function(M,w,u){for(var f in u)this.map[w](M,f,u[f])},l.getMapLayers=function(){return this.map.getStyle().layers},l.addLayer=function(M,w){var u=this.map;if(typeof w=="string"){if(w===""){u.addLayer(M,w);return}for(var f=this.getMapLayers(),k=0;k<f.length;k++)if(w===f[k].id){u.addLayer(M,w);return}g.warn(["Trying to add layer with *below* value",w,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}u.addLayer(M)},l.project=function(M){return this.map.project(new c.LngLat(M[0],M[1]))},l.getView=function(){var M=this.map,w=M.getCenter(),u=w.lng,f=w.lat,k={lon:u,lat:f},_=M.getCanvas(),D=parseInt(_.style.width),I=parseInt(_.style.height);return{center:k,zoom:M.getZoom(),bearing:M.getBearing(),pitch:M.getPitch(),_derived:{coordinates:[M.unproject([0,0]).toArray(),M.unproject([D,0]).toArray(),M.unproject([D,I]).toArray(),M.unproject([0,I]).toArray()]}}},l.getViewEdits=function(M){for(var w=this.id,u=["center","zoom","bearing","pitch"],f={},k=0;k<u.length;k++){var _=u[k];f[w+"."+_]=M[_]}return f},l.getViewEditsWithDerived=function(M){var w=this.id,u=this.getViewEdits(M);return u[w+"._derived"]=M._derived,u};function b(M){var w={};return g.isPlainObject(M)?(w.id=M.id,w.style=M):typeof M=="string"?(w.id=M,m.stylesMap[M]?w.style=m.stylesMap[M]:w.style=M):(w.id=m.styleValueDflt,w.style=S(m.styleValueDflt)),w.transition={duration:0,delay:0},w}function S(M){return m.styleUrlPrefix+M+"-"+m.styleUrlSuffix}function T(M){return[M.lon,M.lat]}V.exports=y}),QI=Vt((X,V)=>{var c=qr(),g=Ld(),E=Gh(),A=zv();V.exports=function(r,i,n){g(r,i,n,{type:"map",attributes:A,handleDefaults:t,partition:"y"})};function t(r,i,n){n("style"),n("center.lon"),n("center.lat"),n("zoom"),n("bearing"),n("pitch");var o=n("bounds.west"),a=n("bounds.east"),s=n("bounds.south"),h=n("bounds.north");(o===void 0||a===void 0||s===void 0||h===void 0)&&delete i.bounds,E(r,i,{name:"layers",handleItemDefaults:e}),i._input=r}function e(r,i){function n(m,p){return c.coerce(r,i,A.layers,m,p)}var o=n("visible");if(o){var a=n("sourcetype"),s=a==="raster"||a==="image";n("source"),n("sourceattribution"),a==="vector"&&n("sourcelayer"),a==="image"&&n("coordinates");var h;s&&(h="raster");var v=n("type",h);s&&v!=="raster"&&(v=i.type="raster",c.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),v==="circle"&&n("circle.radius"),v==="line"&&(n("line.width"),n("line.dash")),v==="fill"&&n("fill.outlinecolor"),v==="symbol"&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),c.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}}),Zx=Vt(X=>{var V=qr(),c=V.strTranslate,g=V.strScale,E=Ph().getSubplotCalcData,A=Cf(),t=Ai(),e=go(),r=sl(),i=JI(),n="map";X.name=n,X.attr="subplot",X.idRoot=n,X.idRegex=X.attrRegex=V.counterRegex(n),X.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},X.layoutAttributes=zv(),X.supplyLayoutDefaults=QI(),X.plot=function(o){for(var a=o._fullLayout,s=o.calcdata,h=a._subplots[n],v=0;v<h.length;v++){var m=h[v],p=E(s,n,m),y=a[m],l=y._subplot;l||(l=new i(o,m),a[m]._subplot=l),l.viewInitial||(l.viewInitial={center:V.extendFlat({},y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch}),l.plot(p,a,o._promises)}},X.clean=function(o,a,s,h){for(var v=h._subplots[n]||[],m=0;m<v.length;m++){var p=v[m];!a[p]&&h[p]._subplot&&h[p]._subplot.destroy()}},X.toSVG=function(o){for(var a=o._fullLayout,s=a._subplots[n],h=a._size,v=0;v<s.length;v++){var m=a[s[v]],p=m.domain,y=m._subplot,l=y.toImage("png"),x=a._glimages.append("svg:image");x.attr({xmlns:A.svg,"xlink:href":l,x:h.l+h.w*p.x[0],y:h.t+h.h*(1-p.y[1]),width:h.w*(p.x[1]-p.x[0]),height:h.h*(p.y[1]-p.y[0]),preserveAspectRatio:"none"});var b=t.select(m._subplot.div),S=b.select(".maplibregl-ctrl-attrib").text().replace("Improve this map",""),T=a._glimages.append("g"),M=T.append("text");M.text(S).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":S});var w=e.bBox(M.node()),u=h.w*(p.x[1]-p.x[0]);if(w.width>u/2){var f=S.split("|").join("<br>");M.text(f).attr("data-unformatted",f).call(r.convertToTspans,o),w=e.bBox(M.node())}M.attr("transform",c(-3,-w.height+8)),T.insert("rect",".static-attribution").attr({x:-w.width-6,y:-w.height-3,width:w.width+6,height:w.height+3,fill:"rgba(255, 255, 255, 0.75)"});var k=1;w.width+6>u&&(k=u/(w.width+6));var _=[h.l+h.w*p.x[1],h.t+h.h*(1-p.y[0])];T.attr("transform",c(_[0],_[1])+g(k))}},X.updateFx=function(o){for(var a=o._fullLayout,s=a._subplots[n],h=0;h<s.length;h++){var v=a[s[h]]._subplot;v.updateFx(a)}}}),YI=Vt((X,V)=>{V.exports={attributes:Gx(),supplyDefaults:qI(),colorbar:Wh(),formatLabels:b5(),calc:kx(),plot:GI(),hoverPoints:Wx().hoverPoints,eventData:WI(),selectPoints:ZI(),styleOnSelect:function(c,g){if(g){var E=g[0].trace;E._glTrace.update(g)}},moduleType:"trace",name:"scattermap",basePlotModule:Zx(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}),KI=Vt((X,V)=>{V.exports=YI()}),T5=Vt((X,V)=>{var c=Wg(),g=wl(),E=Zo().hovertemplateAttrs,A=Ks(),t=po().extendFlat;V.exports=t({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:t({},c.featureidkey,{}),below:{valType:"string",editType:"plot"},text:c.text,hovertext:c.hovertext,marker:{line:{color:t({},c.marker.line.color,{editType:"plot"}),width:t({},c.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:t({},c.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:t({},c.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:t({},c.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:c.hoverinfo,hovertemplate:E({},{keys:["properties"]}),showlegend:t({},A.showlegend,{dflt:!1})},g("",{cLetter:"z",editTypeOverride:"calc"}))}),tL=Vt((X,V)=>{var c=qr(),g=ah(),E=T5();V.exports=function(A,t,e,r){function i(h,v){return c.coerce(A,t,E,h,v)}var n=i("locations"),o=i("z"),a=i("geojson");if(!c.isArrayOrTypedArray(n)||!n.length||!c.isArrayOrTypedArray(o)||!o.length||!(typeof a=="string"&&a!==""||c.isPlainObject(a))){t.visible=!1;return}i("featureidkey"),t._length=Math.min(n.length,o.length),i("below"),i("text"),i("hovertext"),i("hovertemplate");var s=i("marker.line.width");s&&i("marker.line.color"),i("marker.opacity"),g(A,t,r,i,{prefix:"",cLetter:"z"}),c.coerceSelectionMarkerOpacity(t,i)}}),k5=Vt((X,V)=>{var c=vo(),g=qr(),E=Ul(),A=go(),t=Ud().makeBlank,e=Vd();function r(n){var o=n[0].trace,a=o.visible===!0&&o._length!==0,s={layout:{visibility:"none"},paint:{}},h={layout:{visibility:"none"},paint:{}},v=o._opts={fill:s,line:h,geojson:t()};if(!a)return v;var m=e.extractTraceFeature(n);if(!m)return v;var p=E.makeColorScaleFuncFromTrace(o),y=o.marker,l=y.line||{},x;g.isArrayOrTypedArray(y.opacity)&&(x=function(k){var _=k.mo;return c(_)?+g.constrain(_,0,1):0});var b;g.isArrayOrTypedArray(l.color)&&(b=function(k){return k.mlc});var S;g.isArrayOrTypedArray(l.width)&&(S=function(k){return k.mlw});for(var T=0;T<n.length;T++){var M=n[T],w=M.fOut;if(w){var u=w.properties;u.fc=p(M.z),x&&(u.mo=x(M)),b&&(u.mlc=b(M)),S&&(u.mlw=S(M)),M.ct=u.ct,M._polygons=e.feature2polygons(w)}}var f=x?{type:"identity",property:"mo"}:y.opacity;return g.extendFlat(s.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":f}),g.extendFlat(h.paint,{"line-color":b?{type:"identity",property:"mlc"}:l.color,"line-width":S?{type:"identity",property:"mlw"}:l.width,"line-opacity":f}),s.layout.visibility="visible",h.layout.visibility="visible",v.geojson={type:"FeatureCollection",features:m},i(n),v}function i(n){var o=n[0].trace,a=o._opts,s;if(o.selectedpoints){for(var h=A.makeSelectedPointStyleFns(o),v=0;v<n.length;v++){var m=n[v];m.fOut&&(m.fOut.properties.mo2=h.selectedOpacityFn(m))}s={type:"identity",property:"mo2"}}else s=g.isArrayOrTypedArray(o.marker.opacity)?{type:"identity",property:"mo"}:o.marker.opacity;return g.extendFlat(a.fill.paint,{"fill-opacity":s}),g.extendFlat(a.line.paint,{"line-opacity":s}),a}V.exports={convert:r,convertOnSelect:i}}),eL=Vt((X,V)=>{var c=k5().convert,g=k5().convertOnSelect,E=Wd().traceLayerPrefix;function A(e,r){this.type="choroplethmap",this.subplot=e,this.uid=r,this.sourceId="source-"+r,this.layerList=[["fill",E+r+"-fill"],["line",E+r+"-line"]],this.below=null}var t=A.prototype;t.update=function(e){this._update(c(e)),e[0].trace._glTrace=this},t.updateOnSelect=function(e){this._update(g(e))},t._update=function(e){var r=this.subplot,i=this.layerList,n=r.belowLookup["trace-"+this.uid];r.map.getSource(this.sourceId).setData(e.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(e,n),this.below=n);for(var o=0;o<i.length;o++){var a=i[o],s=a[0],h=a[1],v=e[s];r.setOptions(h,"setLayoutProperty",v.layout),v.layout.visibility==="visible"&&r.setOptions(h,"setPaintProperty",v.paint)}},t._addLayers=function(e,r){for(var i=this.subplot,n=this.layerList,o=this.sourceId,a=0;a<n.length;a++){var s=n[a],h=s[0],v=e[h];i.addLayer({type:h,id:s[1],source:o,layout:v.layout,paint:v.paint},r)}},t._removeLayers=function(){for(var e=this.subplot.map,r=this.layerList,i=r.length-1;i>=0;i--)e.removeLayer(r[i][1])},t.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},V.exports=function(e,r){var i=r[0].trace,n=new A(e,i.uid),o=n.sourceId,a=c(r),s=n.below=e.belowLookup["trace-"+i.uid];return e.map.addSource(o,{type:"geojson",data:a.geojson}),n._addLayers(a,s),r[0].trace._glTrace=n,n}}),rL=Vt((X,V)=>{V.exports={attributes:T5(),supplyDefaults:tL(),colorbar:Id(),calc:Ex(),plot:eL(),hoverPoints:Ix(),eventData:Lx(),selectPoints:Cx(),styleOnSelect:function(c,g){if(g){var E=g[0].trace;E._glTrace.updateOnSelect(g)}},getBelow:function(c,g){for(var E=g.getMapLayers(),A=E.length-2;A>=0;A--){var t=E[A].id;if(typeof t=="string"&&t.indexOf("water")===0){for(var e=A+1;e<E.length;e++)if(t=E[e].id,typeof t=="string"&&t.indexOf("plotly-")===-1)return t}}},moduleType:"trace",name:"choroplethmap",basePlotModule:Zx(),categories:["map","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_map"}}}),nL=Vt((X,V)=>{V.exports=rL()}),A5=Vt((X,V)=>{var c=wl(),g=Zo().hovertemplateAttrs,E=Ks(),A=Gx(),t=po().extendFlat;V.exports=t({lon:A.lon,lat:A.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:A.text,hovertext:A.hovertext,hoverinfo:t({},E.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:g(),showlegend:t({},E.showlegend,{dflt:!1})},c("",{cLetter:"z",editTypeOverride:"calc"}))}),aL=Vt((X,V)=>{var c=qr(),g=ah(),E=A5();V.exports=function(A,t,e,r){function i(s,h){return c.coerce(A,t,E,s,h)}var n=i("lon")||[],o=i("lat")||[],a=Math.min(n.length,o.length);if(!a){t.visible=!1;return}t._length=a,i("z"),i("radius"),i("below"),i("text"),i("hovertext"),i("hovertemplate"),g(A,t,r,i,{prefix:"",cLetter:"z"})}}),iL=Vt((X,V)=>{var c=vo(),g=qr().isArrayOrTypedArray,E=ts().BADNUM,A=df(),t=qr()._;V.exports=function(e,r){for(var i=r._length,n=new Array(i),o=r.z,a=g(o)&&o.length,s=0;s<i;s++){var h=n[s]={},v=r.lon[s],m=r.lat[s];if(h.lonlat=c(v)&&c(m)?[+v,+m]:[E,E],a){var p=o[s];h.z=c(p)?p:E}}return A(e,r,{vals:a?o:[0,1],containerStr:"",cLetter:"z"}),i&&(n[0].t={labels:{lat:t(e,"lat:")+" ",lon:t(e,"lon:")+" "}}),n}}),oL=Vt((X,V)=>{var c=vo(),g=qr(),E=vi(),A=Ul(),t=ts().BADNUM,e=Ud().makeBlank;V.exports=function(r){var i=r[0].trace,n=i.visible===!0&&i._length!==0,o={layout:{visibility:"none"},paint:{}},a=i._opts={heatmap:o,geojson:e()};if(!n)return a;var s=[],h,v=i.z,m=i.radius,p=g.isArrayOrTypedArray(v)&&v.length,y=g.isArrayOrTypedArray(m);for(h=0;h<r.length;h++){var l=r[h],x=l.lonlat;if(x[0]!==t){var b={};if(p){var S=l.z;b.z=S!==t?S:0}y&&(b.r=c(m[h])&&m[h]>0?+m[h]:0),s.push({type:"Feature",geometry:{type:"Point",coordinates:x},properties:b})}}var T=A.extractOpts(i),M=T.reversescale?A.flipScale(T.colorscale):T.colorscale,w=M[0][1],u=E.opacity(w)<1?w:E.addOpacity(w,0),f=["interpolate",["linear"],["heatmap-density"],0,u];for(h=1;h<M.length;h++)f.push(M[h][0],M[h][1]);var k=["interpolate",["linear"],["get","z"],T.min,0,T.max,1];return g.extendFlat(a.heatmap.paint,{"heatmap-weight":p?k:1/(T.max-T.min),"heatmap-color":f,"heatmap-radius":y?{type:"identity",property:"r"}:i.radius,"heatmap-opacity":i.opacity}),a.geojson={type:"FeatureCollection",features:s},a.heatmap.layout.visibility="visible",a}}),sL=Vt((X,V)=>{var c=oL(),g=Wd().traceLayerPrefix;function E(t,e){this.type="densitymap",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",g+e+"-heatmap"]],this.below=null}var A=E.prototype;A.update=function(t){var e=this.subplot,r=this.layerList,i=c(t),n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(i.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(i,n),this.below=n);for(var o=0;o<r.length;o++){var a=r[o],s=a[0],h=a[1],v=i[s];e.setOptions(h,"setLayoutProperty",v.layout),v.layout.visibility==="visible"&&e.setOptions(h,"setPaintProperty",v.paint)}},A._addLayers=function(t,e){for(var r=this.subplot,i=this.layerList,n=this.sourceId,o=0;o<i.length;o++){var a=i[o],s=a[0],h=t[s];r.addLayer({type:s,id:a[1],source:n,layout:h.layout,paint:h.paint},e)}},A._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},A.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},V.exports=function(t,e){var r=e[0].trace,i=new E(t,r.uid),n=i.sourceId,o=c(e),a=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(n,{type:"geojson",data:o.geojson}),i._addLayers(o,a),i}}),lL=Vt((X,V)=>{var c=ao(),g=Wx().hoverPoints,E=Wx().getExtraText;V.exports=function(A,t,e){var r=g(A,t,e);if(r){var i=r[0],n=i.cd,o=n[0].trace,a=n[i.index];if(delete i.color,"z"in a){var s=i.subplot.mockAxis;i.z=a.z,i.zLabel=c.tickText(s,s.c2l(a.z),"hover").text}return i.extraText=E(o,a,n[0].t.labels),[i]}}}),uL=Vt((X,V)=>{V.exports=function(c,g){return c.lon=g.lon,c.lat=g.lat,c.z=g.z,c}}),cL=Vt((X,V)=>{V.exports={attributes:A5(),supplyDefaults:aL(),colorbar:Id(),formatLabels:b5(),calc:iL(),plot:sL(),hoverPoints:lL(),eventData:uL(),getBelow:function(c,g){for(var E=g.getMapLayers(),A=0;A<E.length;A++){var t=E[A],e=t.id;if(t.type==="symbol"&&typeof e=="string"&&e.indexOf("plotly-")===-1)return e}},moduleType:"trace",name:"densitymap",basePlotModule:Zx(),categories:["map","gl","showLegend"],meta:{hr_name:"density_map"}}}),hL=Vt((X,V)=>{V.exports=cL()}),M5=Vt((X,V)=>{var c=Nl(),g=Ks(),E=Hc(),A=dg(),t=pu().attributes,e=Zo().hovertemplateAttrs,r=wl(),i=Ns().templatedArray,n=qu().descriptionOnlyNumbers,o=po().extendFlat,a=su().overrideAll;V.exports=a({hoverinfo:o({},g.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:A.hoverlabel,domain:t({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:n("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:c({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:E.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:A.hoverlabel,hovertemplate:e({},{keys:["value","label"]}),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:E.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:A.hoverlabel,hovertemplate:e({},{keys:["value","label"]}),colorscales:i("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:o(r().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}),fL=Vt((X,V)=>{var c=qr(),g=M5(),E=vi(),A=yh(),t=pu().defaults,e=Fm(),r=Ns(),i=Gh();V.exports=function(o,a,s,h){function v(D,I){return c.coerce(o,a,g,D,I)}var m=c.extendDeep(h.hoverlabel,o.hoverlabel),p=o.node,y=r.newContainer(a,"node");function l(D,I){return c.coerce(p,y,g.node,D,I)}l("label"),l("groups"),l("x"),l("y"),l("pad"),l("thickness"),l("line.color"),l("line.width"),l("hoverinfo",o.hoverinfo),e(p,y,l,m),l("hovertemplate"),l("align");var x=h.colorway,b=function(D){return x[D%x.length]};l("color",y.label.map(function(D,I){return E.addOpacity(b(I),.8)})),l("customdata");var S=o.link||{},T=r.newContainer(a,"link");function M(D,I){return c.coerce(S,T,g.link,D,I)}M("label"),M("arrowlen"),M("source"),M("target"),M("value"),M("line.color"),M("line.width"),M("hoverinfo",o.hoverinfo),e(S,T,M,m),M("hovertemplate");var w=A(h.paper_bgcolor).getLuminance()<.333,u=w?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",f=M("color",u);function k(D){var I=A(D);if(!I.isValid())return D;var O=I.getAlpha();return O<=.8?I.setAlpha(O+.2):I=w?I.brighten():I.darken(),I.toRgbString()}M("hovercolor",Array.isArray(f)?f.map(k):k(f)),M("customdata"),i(S,T,{name:"colorscales",handleItemDefaults:n}),t(a,h,v),v("orientation"),v("valueformat"),v("valuesuffix");var _;y.x.length&&y.y.length&&(_="freeform"),v("arrangement",_),c.coerceFont(v,"textfont",h.font,{autoShadowDflt:!0}),a._length=null};function n(o,a){function s(h,v){return c.coerce(o,a,g.link.colorscales,h,v)}s("label"),s("cmin"),s("cmax"),s("colorscale")}}),S5=Vt((X,V)=>{V.exports=c;function c(g){for(var E=g.length,A=new Array(E),t=new Array(E),e=new Array(E),r=new Array(E),i=new Array(E),n=new Array(E),o=0;o<E;++o)A[o]=-1,t[o]=0,e[o]=!1,r[o]=0,i[o]=-1,n[o]=[];var a=0,s=[],h=[];function v(l){var x=[l],b=[l];for(A[l]=t[l]=a,e[l]=!0,a+=1;b.length>0;){l=b[b.length-1];var S=g[l];if(r[l]<S.length){for(var T=r[l];T<S.length;++T){var M=S[T];if(A[M]<0){A[M]=t[M]=a,e[M]=!0,a+=1,x.push(M),b.push(M);break}else e[M]&&(t[l]=Math.min(t[l],t[M])|0);i[M]>=0&&n[l].push(i[M])}r[l]=T}else{if(t[l]===A[l]){for(var w=[],u=[],f=0,T=x.length-1;T>=0;--T){var k=x[T];if(e[k]=!1,w.push(k),u.push(n[k]),f+=n[k].length,i[k]=s.length,k===l){x.length=T;break}}s.push(w);for(var _=new Array(f),T=0;T<u.length;T++)for(var D=0;D<u[T].length;D++)_[--f]=u[T][D];h.push(_)}b.pop()}}}for(var o=0;o<E;++o)A[o]<0&&v(o);for(var m,o=0;o<h.length;o++){var p=h[o];if(p.length!==0){p.sort(function(x,b){return x-b}),m=[p[0]];for(var y=1;y<p.length;y++)p[y]!==p[y-1]&&m.push(p[y]);h[o]=m}}return{components:s,adjacencyList:h}}}),pL=Vt((X,V)=>{var c=S5(),g=qr(),E=Ap().wrap,A=g.isArrayOrTypedArray,t=g.isIndex,e=Ul();function r(n){var o=n.node,a=n.link,s=[],h=A(a.color),v=A(a.hovercolor),m=A(a.customdata),p={},y={},l=a.colorscales.length,x;for(x=0;x<l;x++){var b=a.colorscales[x],S=e.extractScale(b,{cLetter:"c"}),T=e.makeColorScaleFunc(S);y[b.label]=T}var M=0;for(x=0;x<a.value.length;x++)a.source[x]>M&&(M=a.source[x]),a.target[x]>M&&(M=a.target[x]);var w=M+1;n.node._count=w;var u,f=n.node.groups,k={};for(x=0;x<f.length;x++){var _=f[x];for(u=0;u<_.length;u++){var D=_[u],I=w+x;k.hasOwnProperty(D)?g.warn("Node "+D+" is already part of a group."):k[D]=I}}var O={source:[],target:[]};for(x=0;x<a.value.length;x++){var B=a.value[x],R=a.source[x],L=a.target[x];if(B>0&&t(R,w)&&t(L,w)&&!(k.hasOwnProperty(R)&&k.hasOwnProperty(L)&&k[R]===k[L])){k.hasOwnProperty(L)&&(L=k[L]),k.hasOwnProperty(R)&&(R=k[R]),R=+R,L=+L,p[R]=p[L]=!0;var F="";a.label&&a.label[x]&&(F=a.label[x]);var N=null;F&&y.hasOwnProperty(F)&&(N=y[F]),s.push({pointNumber:x,label:F,color:h?a.color[x]:a.color,hovercolor:v?a.hovercolor[x]:a.hovercolor,customdata:m?a.customdata[x]:a.customdata,concentrationscale:N,source:R,target:L,value:+B}),O.source.push(R),O.target.push(L)}}var j=w+f.length,G=A(o.color),rt=A(o.customdata),ct=[];for(x=0;x<j;x++)if(p[x]){var lt=o.label[x];ct.push({group:x>w-1,childrenNodes:[],pointNumber:x,label:lt,color:G?o.color[x]:o.color,customdata:rt?o.customdata[x]:o.customdata})}var tt=!1;return i(j,O.source,O.target)&&(tt=!0),{circular:tt,links:s,nodes:ct,groups:f,groupLookup:k}}function i(n,o,a){for(var s=g.init2dArray(n,0),h=0;h<Math.min(o.length,a.length);h++)if(g.isIndex(o[h],n)&&g.isIndex(a[h],n)){if(o[h]===a[h])return!0;s[o[h]].push(a[h])}var v=c(s);return v.components.some(function(m){return m.length>1})}V.exports=function(n,o){var a=r(o);return E({circular:a.circular,_nodes:a.nodes,_links:a.links,_groups:a.groups,_groupLookup:a.groupLookup})}}),dL=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X):(c=c||self,g(c.d3=c.d3||{}))})(X,function(c){function g(w){var u=+this._x.call(null,w),f=+this._y.call(null,w);return E(this.cover(u,f),u,f,w)}function E(w,u,f,k){if(isNaN(u)||isNaN(f))return w;var _,D=w._root,I={data:k},O=w._x0,B=w._y0,R=w._x1,L=w._y1,F,N,j,G,rt,ct,lt,tt;if(!D)return w._root=I,w;for(;D.length;)if((rt=u>=(F=(O+R)/2))?O=F:R=F,(ct=f>=(N=(B+L)/2))?B=N:L=N,_=D,!(D=D[lt=ct<<1|rt]))return _[lt]=I,w;if(j=+w._x.call(null,D.data),G=+w._y.call(null,D.data),u===j&&f===G)return I.next=D,_?_[lt]=I:w._root=I,w;do _=_?_[lt]=new Array(4):w._root=new Array(4),(rt=u>=(F=(O+R)/2))?O=F:R=F,(ct=f>=(N=(B+L)/2))?B=N:L=N;while((lt=ct<<1|rt)===(tt=(G>=N)<<1|j>=F));return _[tt]=D,_[lt]=I,w}function A(w){var u,f,k=w.length,_,D,I=new Array(k),O=new Array(k),B=1/0,R=1/0,L=-1/0,F=-1/0;for(f=0;f<k;++f)isNaN(_=+this._x.call(null,u=w[f]))||isNaN(D=+this._y.call(null,u))||(I[f]=_,O[f]=D,_<B&&(B=_),_>L&&(L=_),D<R&&(R=D),D>F&&(F=D));if(B>L||R>F)return this;for(this.cover(B,R).cover(L,F),f=0;f<k;++f)E(this,I[f],O[f],w[f]);return this}function t(w,u){if(isNaN(w=+w)||isNaN(u=+u))return this;var f=this._x0,k=this._y0,_=this._x1,D=this._y1;if(isNaN(f))_=(f=Math.floor(w))+1,D=(k=Math.floor(u))+1;else{for(var I=_-f,O=this._root,B,R;f>w||w>=_||k>u||u>=D;)switch(R=(u<k)<<1|w<f,B=new Array(4),B[R]=O,O=B,I*=2,R){case 0:_=f+I,D=k+I;break;case 1:f=_-I,D=k+I;break;case 2:_=f+I,k=D-I;break;case 3:f=_-I,k=D-I;break}this._root&&this._root.length&&(this._root=O)}return this._x0=f,this._y0=k,this._x1=_,this._y1=D,this}function e(){var w=[];return this.visit(function(u){if(!u.length)do w.push(u.data);while(u=u.next)}),w}function r(w){return arguments.length?this.cover(+w[0][0],+w[0][1]).cover(+w[1][0],+w[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function i(w,u,f,k,_){this.node=w,this.x0=u,this.y0=f,this.x1=k,this.y1=_}function n(w,u,f){var k,_=this._x0,D=this._y0,I,O,B,R,L=this._x1,F=this._y1,N=[],j=this._root,G,rt;for(j&&N.push(new i(j,_,D,L,F)),f==null?f=1/0:(_=w-f,D=u-f,L=w+f,F=u+f,f*=f);G=N.pop();)if(!(!(j=G.node)||(I=G.x0)>L||(O=G.y0)>F||(B=G.x1)<_||(R=G.y1)<D))if(j.length){var ct=(I+B)/2,lt=(O+R)/2;N.push(new i(j[3],ct,lt,B,R),new i(j[2],I,lt,ct,R),new i(j[1],ct,O,B,lt),new i(j[0],I,O,ct,lt)),(rt=(u>=lt)<<1|w>=ct)&&(G=N[N.length-1],N[N.length-1]=N[N.length-1-rt],N[N.length-1-rt]=G)}else{var tt=w-+this._x.call(null,j.data),Z=u-+this._y.call(null,j.data),st=tt*tt+Z*Z;if(st<f){var $=Math.sqrt(f=st);_=w-$,D=u-$,L=w+$,F=u+$,k=j.data}}return k}function o(w){if(isNaN(L=+this._x.call(null,w))||isNaN(F=+this._y.call(null,w)))return this;var u,f=this._root,k,_,D,I=this._x0,O=this._y0,B=this._x1,R=this._y1,L,F,N,j,G,rt,ct,lt;if(!f)return this;if(f.length)for(;;){if((G=L>=(N=(I+B)/2))?I=N:B=N,(rt=F>=(j=(O+R)/2))?O=j:R=j,u=f,!(f=f[ct=rt<<1|G]))return this;if(!f.length)break;(u[ct+1&3]||u[ct+2&3]||u[ct+3&3])&&(k=u,lt=ct)}for(;f.data!==w;)if(_=f,!(f=f.next))return this;return(D=f.next)&&delete f.next,_?(D?_.next=D:delete _.next,this):u?(D?u[ct]=D:delete u[ct],(f=u[0]||u[1]||u[2]||u[3])&&f===(u[3]||u[2]||u[1]||u[0])&&!f.length&&(k?k[lt]=f:this._root=f),this):(this._root=D,this)}function a(w){for(var u=0,f=w.length;u<f;++u)this.remove(w[u]);return this}function s(){return this._root}function h(){var w=0;return this.visit(function(u){if(!u.length)do++w;while(u=u.next)}),w}function v(w){var u=[],f,k=this._root,_,D,I,O,B;for(k&&u.push(new i(k,this._x0,this._y0,this._x1,this._y1));f=u.pop();)if(!w(k=f.node,D=f.x0,I=f.y0,O=f.x1,B=f.y1)&&k.length){var R=(D+O)/2,L=(I+B)/2;(_=k[3])&&u.push(new i(_,R,L,O,B)),(_=k[2])&&u.push(new i(_,D,L,R,B)),(_=k[1])&&u.push(new i(_,R,I,O,L)),(_=k[0])&&u.push(new i(_,D,I,R,L))}return this}function m(w){var u=[],f=[],k;for(this._root&&u.push(new i(this._root,this._x0,this._y0,this._x1,this._y1));k=u.pop();){var _=k.node;if(_.length){var D,I=k.x0,O=k.y0,B=k.x1,R=k.y1,L=(I+B)/2,F=(O+R)/2;(D=_[0])&&u.push(new i(D,I,O,L,F)),(D=_[1])&&u.push(new i(D,L,O,B,F)),(D=_[2])&&u.push(new i(D,I,F,L,R)),(D=_[3])&&u.push(new i(D,L,F,B,R))}f.push(k)}for(;k=f.pop();)w(k.node,k.x0,k.y0,k.x1,k.y1);return this}function p(w){return w[0]}function y(w){return arguments.length?(this._x=w,this):this._x}function l(w){return w[1]}function x(w){return arguments.length?(this._y=w,this):this._y}function b(w,u,f){var k=new S(u??p,f??l,NaN,NaN,NaN,NaN);return w==null?k:k.addAll(w)}function S(w,u,f,k,_,D){this._x=w,this._y=u,this._x0=f,this._y0=k,this._x1=_,this._y1=D,this._root=void 0}function T(w){for(var u={data:w.data},f=u;w=w.next;)f=f.next={data:w.data};return u}var M=b.prototype=S.prototype;M.copy=function(){var w=new S(this._x,this._y,this._x0,this._y0,this._x1,this._y1),u=this._root,f,k;if(!u)return w;if(!u.length)return w._root=T(u),w;for(f=[{source:u,target:w._root=new Array(4)}];u=f.pop();)for(var _=0;_<4;++_)(k=u.source[_])&&(k.length?f.push({source:k,target:u.target[_]=new Array(4)}):u.target[_]=T(k));return w},M.add=g,M.addAll=A,M.cover=t,M.data=e,M.extent=r,M.find=n,M.remove=o,M.removeAll=a,M.root=s,M.size=h,M.visit=v,M.visitAfter=m,M.x=y,M.y=x,c.quadtree=b,Object.defineProperty(c,"__esModule",{value:!0})})}),Xx=Vt((X,V)=>{(function(c,g){g(typeof X=="object"&&typeof V<"u"?X:c.d3=c.d3||{})})(X,function(c){var g="$";function E(){}E.prototype=A.prototype={constructor:E,has:function(p){return g+p in this},get:function(p){return this[g+p]},set:function(p,y){return this[g+p]=y,this},remove:function(p){var y=g+p;return y in this&&delete this[y]},clear:function(){for(var p in this)p[0]===g&&delete this[p]},keys:function(){var p=[];for(var y in this)y[0]===g&&p.push(y.slice(1));return p},values:function(){var p=[];for(var y in this)y[0]===g&&p.push(this[y]);return p},entries:function(){var p=[];for(var y in this)y[0]===g&&p.push({key:y.slice(1),value:this[y]});return p},size:function(){var p=0;for(var y in this)y[0]===g&&++p;return p},empty:function(){for(var p in this)if(p[0]===g)return!1;return!0},each:function(p){for(var y in this)y[0]===g&&p(this[y],y.slice(1),this)}};function A(p,y){var l=new E;if(p instanceof E)p.each(function(M,w){l.set(w,M)});else if(Array.isArray(p)){var x=-1,b=p.length,S;if(y==null)for(;++x<b;)l.set(x,p[x]);else for(;++x<b;)l.set(y(S=p[x],x,p),S)}else if(p)for(var T in p)l.set(T,p[T]);return l}function t(){var p=[],y=[],l,x,b;function S(M,w,u,f){if(w>=p.length)return l!=null&&M.sort(l),x!=null?x(M):M;for(var k=-1,_=M.length,D=p[w++],I,O,B=A(),R,L=u();++k<_;)(R=B.get(I=D(O=M[k])+""))?R.push(O):B.set(I,[O]);return B.each(function(F,N){f(L,N,S(F,w,u,f))}),L}function T(M,w){if(++w>p.length)return M;var u,f=y[w-1];return x!=null&&w>=p.length?u=M.entries():(u=[],M.each(function(k,_){u.push({key:_,values:T(k,w)})})),f!=null?u.sort(function(k,_){return f(k.key,_.key)}):u}return b={object:function(M){return S(M,0,e,r)},map:function(M){return S(M,0,i,n)},entries:function(M){return T(S(M,0,i,n),0)},key:function(M){return p.push(M),b},sortKeys:function(M){return y[p.length-1]=M,b},sortValues:function(M){return l=M,b},rollup:function(M){return x=M,b}}}function e(){return{}}function r(p,y,l){p[y]=l}function i(){return A()}function n(p,y,l){p.set(y,l)}function o(){}var a=A.prototype;o.prototype=s.prototype={constructor:o,has:a.has,add:function(p){return p+="",this[g+p]=p,this},remove:a.remove,clear:a.clear,values:a.keys,size:a.size,empty:a.empty,each:a.each};function s(p,y){var l=new o;if(p instanceof o)p.each(function(S){l.add(S)});else if(p){var x=-1,b=p.length;if(y==null)for(;++x<b;)l.add(p[x]);else for(;++x<b;)l.add(y(p[x],x,p))}return l}function h(p){var y=[];for(var l in p)y.push(l);return y}function v(p){var y=[];for(var l in p)y.push(p[l]);return y}function m(p){var y=[];for(var l in p)y.push({key:l,value:p[l]});return y}c.nest=t,c.set=s,c.map=A,c.keys=h,c.values=v,c.entries=m,Object.defineProperty(c,"__esModule",{value:!0})})}),gL=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X):(c=c||self,g(c.d3=c.d3||{}))})(X,function(c){var g={value:function(){}};function E(){for(var i=0,n=arguments.length,o={},a;i<n;++i){if(!(a=arguments[i]+"")||a in o||/[\s.]/.test(a))throw new Error("illegal type: "+a);o[a]=[]}return new A(o)}function A(i){this._=i}function t(i,n){return i.trim().split(/^|\s+/).map(function(o){var a="",s=o.indexOf(".");if(s>=0&&(a=o.slice(s+1),o=o.slice(0,s)),o&&!n.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:a}})}A.prototype=E.prototype={constructor:A,on:function(i,n){var o=this._,a=t(i+"",o),s,h=-1,v=a.length;if(arguments.length<2){for(;++h<v;)if((s=(i=a[h]).type)&&(s=e(o[s],i.name)))return s;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++h<v;)if(s=(i=a[h]).type)o[s]=r(o[s],i.name,n);else if(n==null)for(s in o)o[s]=r(o[s],i.name,null);return this},copy:function(){var i={},n=this._;for(var o in n)i[o]=n[o].slice();return new A(i)},call:function(i,n){if((s=arguments.length-2)>0)for(var o=new Array(s),a=0,s,h;a<s;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(h=this._[i],a=0,s=h.length;a<s;++a)h[a].value.apply(n,o)},apply:function(i,n,o){if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(var a=this._[i],s=0,h=a.length;s<h;++s)a[s].value.apply(n,o)}};function e(i,n){for(var o=0,a=i.length,s;o<a;++o)if((s=i[o]).name===n)return s.value}function r(i,n,o){for(var a=0,s=i.length;a<s;++a)if(i[a].name===n){i[a]=g,i=i.slice(0,a).concat(i.slice(a+1));break}return o!=null&&i.push({name:n,value:o}),i}c.dispatch=E,Object.defineProperty(c,"__esModule",{value:!0})})}),mL=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X):(c=c||self,g(c.d3=c.d3||{}))})(X,function(c){var g=0,E=0,A=0,t=1e3,e,r,i=0,n=0,o=0,a=typeof performance=="object"&&performance.now?performance:Date,s=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(w){setTimeout(w,17)};function h(){return n||(s(v),n=a.now()+o)}function v(){n=0}function m(){this._call=this._time=this._next=null}m.prototype=p.prototype={constructor:m,restart:function(w,u,f){if(typeof w!="function")throw new TypeError("callback is not a function");f=(f==null?h():+f)+(u==null?0:+u),!this._next&&r!==this&&(r?r._next=this:e=this,r=this),this._call=w,this._time=f,S()},stop:function(){this._call&&(this._call=null,this._time=1/0,S())}};function p(w,u,f){var k=new m;return k.restart(w,u,f),k}function y(){h(),++g;for(var w=e,u;w;)(u=n-w._time)>=0&&w._call.call(null,u),w=w._next;--g}function l(){n=(i=a.now())+o,g=E=0;try{y()}finally{g=0,b(),n=0}}function x(){var w=a.now(),u=w-i;u>t&&(o-=u,i=w)}function b(){for(var w,u=e,f,k=1/0;u;)u._call?(k>u._time&&(k=u._time),w=u,u=u._next):(f=u._next,u._next=null,u=w?w._next=f:e=f);r=w,S(k)}function S(w){if(!g){E&&(E=clearTimeout(E));var u=w-n;u>24?(w<1/0&&(E=setTimeout(l,w-a.now()-o)),A&&(A=clearInterval(A))):(A||(i=a.now(),A=setInterval(x,t)),g=1,s(l))}}function T(w,u,f){var k=new m;return u=u==null?0:+u,k.restart(function(_){k.stop(),w(_+u)},u,f),k}function M(w,u,f){var k=new m,_=u;return u==null?(k.restart(w,u,f),k):(u=+u,f=f==null?h():+f,k.restart(function D(I){I+=_,k.restart(D,_+=u,f),w(I)},u,f),k)}c.interval=M,c.now=h,c.timeout=T,c.timer=p,c.timerFlush=y,Object.defineProperty(c,"__esModule",{value:!0})})}),vL=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X,dL(),Xx(),gL(),mL()):g(c.d3=c.d3||{},c.d3,c.d3,c.d3,c.d3)})(X,function(c,g,E,A,t){function e(w,u){var f;w==null&&(w=0),u==null&&(u=0);function k(){var _,D=f.length,I,O=0,B=0;for(_=0;_<D;++_)I=f[_],O+=I.x,B+=I.y;for(O=O/D-w,B=B/D-u,_=0;_<D;++_)I=f[_],I.x-=O,I.y-=B}return k.initialize=function(_){f=_},k.x=function(_){return arguments.length?(w=+_,k):w},k.y=function(_){return arguments.length?(u=+_,k):u},k}function r(w){return function(){return w}}function i(){return(Math.random()-.5)*1e-6}function n(w){return w.x+w.vx}function o(w){return w.y+w.vy}function a(w){var u,f,k=1,_=1;typeof w!="function"&&(w=r(w==null?1:+w));function D(){for(var B,R=u.length,L,F,N,j,G,rt,ct=0;ct<_;++ct)for(L=g.quadtree(u,n,o).visitAfter(I),B=0;B<R;++B)F=u[B],G=f[F.index],rt=G*G,N=F.x+F.vx,j=F.y+F.vy,L.visit(lt);function lt(tt,Z,st,$,Q){var nt=tt.data,Y=tt.r,q=G+Y;if(nt){if(nt.index>F.index){var ot=N-nt.x-nt.vx,it=j-nt.y-nt.vy,dt=ot*ot+it*it;dt<q*q&&(ot===0&&(ot=i(),dt+=ot*ot),it===0&&(it=i(),dt+=it*it),dt=(q-(dt=Math.sqrt(dt)))/dt*k,F.vx+=(ot*=dt)*(q=(Y*=Y)/(rt+Y)),F.vy+=(it*=dt)*q,nt.vx-=ot*(q=1-q),nt.vy-=it*q)}return}return Z>N+q||$<N-q||st>j+q||Q<j-q}}function I(B){if(B.data)return B.r=f[B.data.index];for(var R=B.r=0;R<4;++R)B[R]&&B[R].r>B.r&&(B.r=B[R].r)}function O(){if(u){var B,R=u.length,L;for(f=new Array(R),B=0;B<R;++B)L=u[B],f[L.index]=+w(L,B,u)}}return D.initialize=function(B){u=B,O()},D.iterations=function(B){return arguments.length?(_=+B,D):_},D.strength=function(B){return arguments.length?(k=+B,D):k},D.radius=function(B){return arguments.length?(w=typeof B=="function"?B:r(+B),O(),D):w},D}function s(w){return w.index}function h(w,u){var f=w.get(u);if(!f)throw new Error("missing: "+u);return f}function v(w){var u=s,f=L,k,_=r(30),D,I,O,B,R=1;w==null&&(w=[]);function L(rt){return 1/Math.min(O[rt.source.index],O[rt.target.index])}function F(rt){for(var ct=0,lt=w.length;ct<R;++ct)for(var tt=0,Z,st,$,Q,nt,Y,q;tt<lt;++tt)Z=w[tt],st=Z.source,$=Z.target,Q=$.x+$.vx-st.x-st.vx||i(),nt=$.y+$.vy-st.y-st.vy||i(),Y=Math.sqrt(Q*Q+nt*nt),Y=(Y-D[tt])/Y*rt*k[tt],Q*=Y,nt*=Y,$.vx-=Q*(q=B[tt]),$.vy-=nt*q,st.vx+=Q*(q=1-q),st.vy+=nt*q}function N(){if(I){var rt,ct=I.length,lt=w.length,tt=E.map(I,u),Z;for(rt=0,O=new Array(ct);rt<lt;++rt)Z=w[rt],Z.index=rt,typeof Z.source!="object"&&(Z.source=h(tt,Z.source)),typeof Z.target!="object"&&(Z.target=h(tt,Z.target)),O[Z.source.index]=(O[Z.source.index]||0)+1,O[Z.target.index]=(O[Z.target.index]||0)+1;for(rt=0,B=new Array(lt);rt<lt;++rt)Z=w[rt],B[rt]=O[Z.source.index]/(O[Z.source.index]+O[Z.target.index]);k=new Array(lt),j(),D=new Array(lt),G()}}function j(){if(I)for(var rt=0,ct=w.length;rt<ct;++rt)k[rt]=+f(w[rt],rt,w)}function G(){if(I)for(var rt=0,ct=w.length;rt<ct;++rt)D[rt]=+_(w[rt],rt,w)}return F.initialize=function(rt){I=rt,N()},F.links=function(rt){return arguments.length?(w=rt,N(),F):w},F.id=function(rt){return arguments.length?(u=rt,F):u},F.iterations=function(rt){return arguments.length?(R=+rt,F):R},F.strength=function(rt){return arguments.length?(f=typeof rt=="function"?rt:r(+rt),j(),F):f},F.distance=function(rt){return arguments.length?(_=typeof rt=="function"?rt:r(+rt),G(),F):_},F}function m(w){return w.x}function p(w){return w.y}var y=10,l=Math.PI*(3-Math.sqrt(5));function x(w){var u,f=1,k=.001,_=1-Math.pow(k,1/300),D=0,I=.6,O=E.map(),B=t.timer(L),R=A.dispatch("tick","end");w==null&&(w=[]);function L(){F(),R.call("tick",u),f<k&&(B.stop(),R.call("end",u))}function F(G){var rt,ct=w.length,lt;G===void 0&&(G=1);for(var tt=0;tt<G;++tt)for(f+=(D-f)*_,O.each(function(Z){Z(f)}),rt=0;rt<ct;++rt)lt=w[rt],lt.fx==null?lt.x+=lt.vx*=I:(lt.x=lt.fx,lt.vx=0),lt.fy==null?lt.y+=lt.vy*=I:(lt.y=lt.fy,lt.vy=0);return u}function N(){for(var G=0,rt=w.length,ct;G<rt;++G){if(ct=w[G],ct.index=G,ct.fx!=null&&(ct.x=ct.fx),ct.fy!=null&&(ct.y=ct.fy),isNaN(ct.x)||isNaN(ct.y)){var lt=y*Math.sqrt(G),tt=G*l;ct.x=lt*Math.cos(tt),ct.y=lt*Math.sin(tt)}(isNaN(ct.vx)||isNaN(ct.vy))&&(ct.vx=ct.vy=0)}}function j(G){return G.initialize&&G.initialize(w),G}return N(),u={tick:F,restart:function(){return B.restart(L),u},stop:function(){return B.stop(),u},nodes:function(G){return arguments.length?(w=G,N(),O.each(j),u):w},alpha:function(G){return arguments.length?(f=+G,u):f},alphaMin:function(G){return arguments.length?(k=+G,u):k},alphaDecay:function(G){return arguments.length?(_=+G,u):+_},alphaTarget:function(G){return arguments.length?(D=+G,u):D},velocityDecay:function(G){return arguments.length?(I=1-G,u):1-I},force:function(G,rt){return arguments.length>1?(rt==null?O.remove(G):O.set(G,j(rt)),u):O.get(G)},find:function(G,rt,ct){var lt=0,tt=w.length,Z,st,$,Q,nt;for(ct==null?ct=1/0:ct*=ct,lt=0;lt<tt;++lt)Q=w[lt],Z=G-Q.x,st=rt-Q.y,$=Z*Z+st*st,$<ct&&(nt=Q,ct=$);return nt},on:function(G,rt){return arguments.length>1?(R.on(G,rt),u):R.on(G)}}}function b(){var w,u,f,k=r(-30),_,D=1,I=1/0,O=.81;function B(N){var j,G=w.length,rt=g.quadtree(w,m,p).visitAfter(L);for(f=N,j=0;j<G;++j)u=w[j],rt.visit(F)}function R(){if(w){var N,j=w.length,G;for(_=new Array(j),N=0;N<j;++N)G=w[N],_[G.index]=+k(G,N,w)}}function L(N){var j=0,G,rt,ct=0,lt,tt,Z;if(N.length){for(lt=tt=Z=0;Z<4;++Z)(G=N[Z])&&(rt=Math.abs(G.value))&&(j+=G.value,ct+=rt,lt+=rt*G.x,tt+=rt*G.y);N.x=lt/ct,N.y=tt/ct}else{G=N,G.x=G.data.x,G.y=G.data.y;do j+=_[G.data.index];while(G=G.next)}N.value=j}function F(N,j,G,rt){if(!N.value)return!0;var ct=N.x-u.x,lt=N.y-u.y,tt=rt-j,Z=ct*ct+lt*lt;if(tt*tt/O<Z)return Z<I&&(ct===0&&(ct=i(),Z+=ct*ct),lt===0&&(lt=i(),Z+=lt*lt),Z<D&&(Z=Math.sqrt(D*Z)),u.vx+=ct*N.value*f/Z,u.vy+=lt*N.value*f/Z),!0;if(!(N.length||Z>=I)){(N.data!==u||N.next)&&(ct===0&&(ct=i(),Z+=ct*ct),lt===0&&(lt=i(),Z+=lt*lt),Z<D&&(Z=Math.sqrt(D*Z)));do N.data!==u&&(tt=_[N.data.index]*f/Z,u.vx+=ct*tt,u.vy+=lt*tt);while(N=N.next)}}return B.initialize=function(N){w=N,R()},B.strength=function(N){return arguments.length?(k=typeof N=="function"?N:r(+N),R(),B):k},B.distanceMin=function(N){return arguments.length?(D=N*N,B):Math.sqrt(D)},B.distanceMax=function(N){return arguments.length?(I=N*N,B):Math.sqrt(I)},B.theta=function(N){return arguments.length?(O=N*N,B):Math.sqrt(O)},B}function S(w,u,f){var k,_=r(.1),D,I;typeof w!="function"&&(w=r(+w)),u==null&&(u=0),f==null&&(f=0);function O(R){for(var L=0,F=k.length;L<F;++L){var N=k[L],j=N.x-u||1e-6,G=N.y-f||1e-6,rt=Math.sqrt(j*j+G*G),ct=(I[L]-rt)*D[L]*R/rt;N.vx+=j*ct,N.vy+=G*ct}}function B(){if(k){var R,L=k.length;for(D=new Array(L),I=new Array(L),R=0;R<L;++R)I[R]=+w(k[R],R,k),D[R]=isNaN(I[R])?0:+_(k[R],R,k)}}return O.initialize=function(R){k=R,B()},O.strength=function(R){return arguments.length?(_=typeof R=="function"?R:r(+R),B(),O):_},O.radius=function(R){return arguments.length?(w=typeof R=="function"?R:r(+R),B(),O):w},O.x=function(R){return arguments.length?(u=+R,O):u},O.y=function(R){return arguments.length?(f=+R,O):f},O}function T(w){var u=r(.1),f,k,_;typeof w!="function"&&(w=r(w==null?0:+w));function D(O){for(var B=0,R=f.length,L;B<R;++B)L=f[B],L.vx+=(_[B]-L.x)*k[B]*O}function I(){if(f){var O,B=f.length;for(k=new Array(B),_=new Array(B),O=0;O<B;++O)k[O]=isNaN(_[O]=+w(f[O],O,f))?0:+u(f[O],O,f)}}return D.initialize=function(O){f=O,I()},D.strength=function(O){return arguments.length?(u=typeof O=="function"?O:r(+O),I(),D):u},D.x=function(O){return arguments.length?(w=typeof O=="function"?O:r(+O),I(),D):w},D}function M(w){var u=r(.1),f,k,_;typeof w!="function"&&(w=r(w==null?0:+w));function D(O){for(var B=0,R=f.length,L;B<R;++B)L=f[B],L.vy+=(_[B]-L.y)*k[B]*O}function I(){if(f){var O,B=f.length;for(k=new Array(B),_=new Array(B),O=0;O<B;++O)k[O]=isNaN(_[O]=+w(f[O],O,f))?0:+u(f[O],O,f)}}return D.initialize=function(O){f=O,I()},D.strength=function(O){return arguments.length?(u=typeof O=="function"?O:r(+O),I(),D):u},D.y=function(O){return arguments.length?(w=typeof O=="function"?O:r(+O),I(),D):w},D}c.forceCenter=e,c.forceCollide=a,c.forceLink=v,c.forceManyBody=b,c.forceRadial=S,c.forceSimulation=x,c.forceX=T,c.forceY=M,Object.defineProperty(c,"__esModule",{value:!0})})}),yL=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X):(c=c||self,g(c.d3=c.d3||{}))})(X,function(c){var g=Math.PI,E=2*g,A=1e-6,t=E-A;function e(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function r(){return new e}e.prototype=r.prototype={constructor:e,moveTo:function(i,n){this._+="M"+(this._x0=this._x1=+i)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(i,n){this._+="L"+(this._x1=+i)+","+(this._y1=+n)},quadraticCurveTo:function(i,n,o,a){this._+="Q"+ +i+","+ +n+","+(this._x1=+o)+","+(this._y1=+a)},bezierCurveTo:function(i,n,o,a,s,h){this._+="C"+ +i+","+ +n+","+ +o+","+ +a+","+(this._x1=+s)+","+(this._y1=+h)},arcTo:function(i,n,o,a,s){i=+i,n=+n,o=+o,a=+a,s=+s;var h=this._x1,v=this._y1,m=o-i,p=a-n,y=h-i,l=v-n,x=y*y+l*l;if(s<0)throw new Error("negative radius: "+s);if(this._x1===null)this._+="M"+(this._x1=i)+","+(this._y1=n);else if(x>A)if(!(Math.abs(l*m-p*y)>A)||!s)this._+="L"+(this._x1=i)+","+(this._y1=n);else{var b=o-h,S=a-v,T=m*m+p*p,M=b*b+S*S,w=Math.sqrt(T),u=Math.sqrt(x),f=s*Math.tan((g-Math.acos((T+x-M)/(2*w*u)))/2),k=f/u,_=f/w;Math.abs(k-1)>A&&(this._+="L"+(i+k*y)+","+(n+k*l)),this._+="A"+s+","+s+",0,0,"+ +(l*b>y*S)+","+(this._x1=i+_*m)+","+(this._y1=n+_*p)}},arc:function(i,n,o,a,s,h){i=+i,n=+n,o=+o,h=!!h;var v=o*Math.cos(a),m=o*Math.sin(a),p=i+v,y=n+m,l=1^h,x=h?a-s:s-a;if(o<0)throw new Error("negative radius: "+o);this._x1===null?this._+="M"+p+","+y:(Math.abs(this._x1-p)>A||Math.abs(this._y1-y)>A)&&(this._+="L"+p+","+y),o&&(x<0&&(x=x%E+E),x>t?this._+="A"+o+","+o+",0,1,"+l+","+(i-v)+","+(n-m)+"A"+o+","+o+",0,1,"+l+","+(this._x1=p)+","+(this._y1=y):x>A&&(this._+="A"+o+","+o+",0,"+ +(x>=g)+","+l+","+(this._x1=i+o*Math.cos(s))+","+(this._y1=n+o*Math.sin(s))))},rect:function(i,n,o,a){this._+="M"+(this._x0=this._x1=+i)+","+(this._y0=this._y1=+n)+"h"+ +o+"v"+ +a+"h"+-o+"Z"},toString:function(){return this._}},c.path=r,Object.defineProperty(c,"__esModule",{value:!0})})}),E5=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X,yL()):(c=c||self,g(c.d3=c.d3||{},c.d3))})(X,function(c,g){function E(_e){return function(){return _e}}var A=Math.abs,t=Math.atan2,e=Math.cos,r=Math.max,i=Math.min,n=Math.sin,o=Math.sqrt,a=1e-12,s=Math.PI,h=s/2,v=2*s;function m(_e){return _e>1?0:_e<-1?s:Math.acos(_e)}function p(_e){return _e>=1?h:_e<=-1?-h:Math.asin(_e)}function y(_e){return _e.innerRadius}function l(_e){return _e.outerRadius}function x(_e){return _e.startAngle}function b(_e){return _e.endAngle}function S(_e){return _e&&_e.padAngle}function T(_e,Je,yr,Hr,hn,En,dn,Kr){var Tn=yr-_e,ta=Hr-Je,Qn=dn-hn,Va=Kr-En,ja=Va*Tn-Qn*ta;if(!(ja*ja<a))return ja=(Qn*(Je-En)-Va*(_e-hn))/ja,[_e+ja*Tn,Je+ja*ta]}function M(_e,Je,yr,Hr,hn,En,dn){var Kr=_e-yr,Tn=Je-Hr,ta=(dn?En:-En)/o(Kr*Kr+Tn*Tn),Qn=ta*Tn,Va=-ta*Kr,ja=_e+Qn,ci=Je+Va,pi=yr+Qn,bi=Hr+Va,ri=(ja+pi)/2,Da=(ci+bi)/2,Ui=pi-ja,lo=bi-ci,Co=Ui*Ui+lo*lo,Bo=hn-En,ai=ja*bi-pi*ci,yi=(lo<0?-1:1)*o(r(0,Bo*Bo*Co-ai*ai)),Si=(ai*lo-Ui*yi)/Co,ko=(-ai*Ui-lo*yi)/Co,Ao=(ai*lo+Ui*yi)/Co,Do=(-ai*Ui+lo*yi)/Co,Pi=Si-ri,Yi=ko-Da,vs=Ao-ri,es=Do-Da;return Pi*Pi+Yi*Yi>vs*vs+es*es&&(Si=Ao,ko=Do),{cx:Si,cy:ko,x01:-Qn,y01:-Va,x11:Si*(hn/Bo-1),y11:ko*(hn/Bo-1)}}function w(){var _e=y,Je=l,yr=E(0),Hr=null,hn=x,En=b,dn=S,Kr=null;function Tn(){var ta,Qn,Va=+_e.apply(this,arguments),ja=+Je.apply(this,arguments),ci=hn.apply(this,arguments)-h,pi=En.apply(this,arguments)-h,bi=A(pi-ci),ri=pi>ci;if(Kr||(Kr=ta=g.path()),ja<Va&&(Qn=ja,ja=Va,Va=Qn),!(ja>a))Kr.moveTo(0,0);else if(bi>v-a)Kr.moveTo(ja*e(ci),ja*n(ci)),Kr.arc(0,0,ja,ci,pi,!ri),Va>a&&(Kr.moveTo(Va*e(pi),Va*n(pi)),Kr.arc(0,0,Va,pi,ci,ri));else{var Da=ci,Ui=pi,lo=ci,Co=pi,Bo=bi,ai=bi,yi=dn.apply(this,arguments)/2,Si=yi>a&&(Hr?+Hr.apply(this,arguments):o(Va*Va+ja*ja)),ko=i(A(ja-Va)/2,+yr.apply(this,arguments)),Ao=ko,Do=ko,Pi,Yi;if(Si>a){var vs=p(Si/Va*n(yi)),es=p(Si/ja*n(yi));(Bo-=vs*2)>a?(vs*=ri?1:-1,lo+=vs,Co-=vs):(Bo=0,lo=Co=(ci+pi)/2),(ai-=es*2)>a?(es*=ri?1:-1,Da+=es,Ui-=es):(ai=0,Da=Ui=(ci+pi)/2)}var ls=ja*e(Da),Xi=ja*n(Da),ga=Va*e(Co),Xa=Va*n(Co);if(ko>a){var Ls=ja*e(Ui),fs=ja*n(Ui),qi=Va*e(lo),ms=Va*n(lo),Po;if(bi<s&&(Po=T(ls,Xi,qi,ms,Ls,fs,ga,Xa))){var rs=ls-Po[0],hl=Xi-Po[1],za=Ls-Po[0],Oi=fs-Po[1],Bi=1/n(m((rs*za+hl*Oi)/(o(rs*rs+hl*hl)*o(za*za+Oi*Oi)))/2),Ro=o(Po[0]*Po[0]+Po[1]*Po[1]);Ao=i(ko,(Va-Ro)/(Bi-1)),Do=i(ko,(ja-Ro)/(Bi+1))}}ai>a?Do>a?(Pi=M(qi,ms,ls,Xi,ja,Do,ri),Yi=M(Ls,fs,ga,Xa,ja,Do,ri),Kr.moveTo(Pi.cx+Pi.x01,Pi.cy+Pi.y01),Do<ko?Kr.arc(Pi.cx,Pi.cy,Do,t(Pi.y01,Pi.x01),t(Yi.y01,Yi.x01),!ri):(Kr.arc(Pi.cx,Pi.cy,Do,t(Pi.y01,Pi.x01),t(Pi.y11,Pi.x11),!ri),Kr.arc(0,0,ja,t(Pi.cy+Pi.y11,Pi.cx+Pi.x11),t(Yi.cy+Yi.y11,Yi.cx+Yi.x11),!ri),Kr.arc(Yi.cx,Yi.cy,Do,t(Yi.y11,Yi.x11),t(Yi.y01,Yi.x01),!ri))):(Kr.moveTo(ls,Xi),Kr.arc(0,0,ja,Da,Ui,!ri)):Kr.moveTo(ls,Xi),!(Va>a)||!(Bo>a)?Kr.lineTo(ga,Xa):Ao>a?(Pi=M(ga,Xa,Ls,fs,Va,-Ao,ri),Yi=M(ls,Xi,qi,ms,Va,-Ao,ri),Kr.lineTo(Pi.cx+Pi.x01,Pi.cy+Pi.y01),Ao<ko?Kr.arc(Pi.cx,Pi.cy,Ao,t(Pi.y01,Pi.x01),t(Yi.y01,Yi.x01),!ri):(Kr.arc(Pi.cx,Pi.cy,Ao,t(Pi.y01,Pi.x01),t(Pi.y11,Pi.x11),!ri),Kr.arc(0,0,Va,t(Pi.cy+Pi.y11,Pi.cx+Pi.x11),t(Yi.cy+Yi.y11,Yi.cx+Yi.x11),ri),Kr.arc(Yi.cx,Yi.cy,Ao,t(Yi.y11,Yi.x11),t(Yi.y01,Yi.x01),!ri))):Kr.arc(0,0,Va,Co,lo,ri)}if(Kr.closePath(),ta)return Kr=null,ta+""||null}return Tn.centroid=function(){var ta=(+_e.apply(this,arguments)+ +Je.apply(this,arguments))/2,Qn=(+hn.apply(this,arguments)+ +En.apply(this,arguments))/2-s/2;return[e(Qn)*ta,n(Qn)*ta]},Tn.innerRadius=function(ta){return arguments.length?(_e=typeof ta=="function"?ta:E(+ta),Tn):_e},Tn.outerRadius=function(ta){return arguments.length?(Je=typeof ta=="function"?ta:E(+ta),Tn):Je},Tn.cornerRadius=function(ta){return arguments.length?(yr=typeof ta=="function"?ta:E(+ta),Tn):yr},Tn.padRadius=function(ta){return arguments.length?(Hr=ta==null?null:typeof ta=="function"?ta:E(+ta),Tn):Hr},Tn.startAngle=function(ta){return arguments.length?(hn=typeof ta=="function"?ta:E(+ta),Tn):hn},Tn.endAngle=function(ta){return arguments.length?(En=typeof ta=="function"?ta:E(+ta),Tn):En},Tn.padAngle=function(ta){return arguments.length?(dn=typeof ta=="function"?ta:E(+ta),Tn):dn},Tn.context=function(ta){return arguments.length?(Kr=ta??null,Tn):Kr},Tn}function u(_e){this._context=_e}u.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(_e,Je){switch(_e=+_e,Je=+Je,this._point){case 0:this._point=1,this._line?this._context.lineTo(_e,Je):this._context.moveTo(_e,Je);break;case 1:this._point=2;default:this._context.lineTo(_e,Je);break}}};function f(_e){return new u(_e)}function k(_e){return _e[0]}function _(_e){return _e[1]}function D(){var _e=k,Je=_,yr=E(!0),Hr=null,hn=f,En=null;function dn(Kr){var Tn,ta=Kr.length,Qn,Va=!1,ja;for(Hr==null&&(En=hn(ja=g.path())),Tn=0;Tn<=ta;++Tn)!(Tn<ta&&yr(Qn=Kr[Tn],Tn,Kr))===Va&&((Va=!Va)?En.lineStart():En.lineEnd()),Va&&En.point(+_e(Qn,Tn,Kr),+Je(Qn,Tn,Kr));if(ja)return En=null,ja+""||null}return dn.x=function(Kr){return arguments.length?(_e=typeof Kr=="function"?Kr:E(+Kr),dn):_e},dn.y=function(Kr){return arguments.length?(Je=typeof Kr=="function"?Kr:E(+Kr),dn):Je},dn.defined=function(Kr){return arguments.length?(yr=typeof Kr=="function"?Kr:E(!!Kr),dn):yr},dn.curve=function(Kr){return arguments.length?(hn=Kr,Hr!=null&&(En=hn(Hr)),dn):hn},dn.context=function(Kr){return arguments.length?(Kr==null?Hr=En=null:En=hn(Hr=Kr),dn):Hr},dn}function I(){var _e=k,Je=null,yr=E(0),Hr=_,hn=E(!0),En=null,dn=f,Kr=null;function Tn(Qn){var Va,ja,ci,pi=Qn.length,bi,ri=!1,Da,Ui=new Array(pi),lo=new Array(pi);for(En==null&&(Kr=dn(Da=g.path())),Va=0;Va<=pi;++Va){if(!(Va<pi&&hn(bi=Qn[Va],Va,Qn))===ri)if(ri=!ri)ja=Va,Kr.areaStart(),Kr.lineStart();else{for(Kr.lineEnd(),Kr.lineStart(),ci=Va-1;ci>=ja;--ci)Kr.point(Ui[ci],lo[ci]);Kr.lineEnd(),Kr.areaEnd()}ri&&(Ui[Va]=+_e(bi,Va,Qn),lo[Va]=+yr(bi,Va,Qn),Kr.point(Je?+Je(bi,Va,Qn):Ui[Va],Hr?+Hr(bi,Va,Qn):lo[Va]))}if(Da)return Kr=null,Da+""||null}function ta(){return D().defined(hn).curve(dn).context(En)}return Tn.x=function(Qn){return arguments.length?(_e=typeof Qn=="function"?Qn:E(+Qn),Je=null,Tn):_e},Tn.x0=function(Qn){return arguments.length?(_e=typeof Qn=="function"?Qn:E(+Qn),Tn):_e},Tn.x1=function(Qn){return arguments.length?(Je=Qn==null?null:typeof Qn=="function"?Qn:E(+Qn),Tn):Je},Tn.y=function(Qn){return arguments.length?(yr=typeof Qn=="function"?Qn:E(+Qn),Hr=null,Tn):yr},Tn.y0=function(Qn){return arguments.length?(yr=typeof Qn=="function"?Qn:E(+Qn),Tn):yr},Tn.y1=function(Qn){return arguments.length?(Hr=Qn==null?null:typeof Qn=="function"?Qn:E(+Qn),Tn):Hr},Tn.lineX0=Tn.lineY0=function(){return ta().x(_e).y(yr)},Tn.lineY1=function(){return ta().x(_e).y(Hr)},Tn.lineX1=function(){return ta().x(Je).y(yr)},Tn.defined=function(Qn){return arguments.length?(hn=typeof Qn=="function"?Qn:E(!!Qn),Tn):hn},Tn.curve=function(Qn){return arguments.length?(dn=Qn,En!=null&&(Kr=dn(En)),Tn):dn},Tn.context=function(Qn){return arguments.length?(Qn==null?En=Kr=null:Kr=dn(En=Qn),Tn):En},Tn}function O(_e,Je){return Je<_e?-1:Je>_e?1:Je>=_e?0:NaN}function B(_e){return _e}function R(){var _e=B,Je=O,yr=null,Hr=E(0),hn=E(v),En=E(0);function dn(Kr){var Tn,ta=Kr.length,Qn,Va,ja=0,ci=new Array(ta),pi=new Array(ta),bi=+Hr.apply(this,arguments),ri=Math.min(v,Math.max(-v,hn.apply(this,arguments)-bi)),Da,Ui=Math.min(Math.abs(ri)/ta,En.apply(this,arguments)),lo=Ui*(ri<0?-1:1),Co;for(Tn=0;Tn<ta;++Tn)(Co=pi[ci[Tn]=Tn]=+_e(Kr[Tn],Tn,Kr))>0&&(ja+=Co);for(Je!=null?ci.sort(function(Bo,ai){return Je(pi[Bo],pi[ai])}):yr!=null&&ci.sort(function(Bo,ai){return yr(Kr[Bo],Kr[ai])}),Tn=0,Va=ja?(ri-ta*lo)/ja:0;Tn<ta;++Tn,bi=Da)Qn=ci[Tn],Co=pi[Qn],Da=bi+(Co>0?Co*Va:0)+lo,pi[Qn]={data:Kr[Qn],index:Tn,value:Co,startAngle:bi,endAngle:Da,padAngle:Ui};return pi}return dn.value=function(Kr){return arguments.length?(_e=typeof Kr=="function"?Kr:E(+Kr),dn):_e},dn.sortValues=function(Kr){return arguments.length?(Je=Kr,yr=null,dn):Je},dn.sort=function(Kr){return arguments.length?(yr=Kr,Je=null,dn):yr},dn.startAngle=function(Kr){return arguments.length?(Hr=typeof Kr=="function"?Kr:E(+Kr),dn):Hr},dn.endAngle=function(Kr){return arguments.length?(hn=typeof Kr=="function"?Kr:E(+Kr),dn):hn},dn.padAngle=function(Kr){return arguments.length?(En=typeof Kr=="function"?Kr:E(+Kr),dn):En},dn}var L=N(f);function F(_e){this._curve=_e}F.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(_e,Je){this._curve.point(Je*Math.sin(_e),Je*-Math.cos(_e))}};function N(_e){function Je(yr){return new F(_e(yr))}return Je._curve=_e,Je}function j(_e){var Je=_e.curve;return _e.angle=_e.x,delete _e.x,_e.radius=_e.y,delete _e.y,_e.curve=function(yr){return arguments.length?Je(N(yr)):Je()._curve},_e}function G(){return j(D().curve(L))}function rt(){var _e=I().curve(L),Je=_e.curve,yr=_e.lineX0,Hr=_e.lineX1,hn=_e.lineY0,En=_e.lineY1;return _e.angle=_e.x,delete _e.x,_e.startAngle=_e.x0,delete _e.x0,_e.endAngle=_e.x1,delete _e.x1,_e.radius=_e.y,delete _e.y,_e.innerRadius=_e.y0,delete _e.y0,_e.outerRadius=_e.y1,delete _e.y1,_e.lineStartAngle=function(){return j(yr())},delete _e.lineX0,_e.lineEndAngle=function(){return j(Hr())},delete _e.lineX1,_e.lineInnerRadius=function(){return j(hn())},delete _e.lineY0,_e.lineOuterRadius=function(){return j(En())},delete _e.lineY1,_e.curve=function(dn){return arguments.length?Je(N(dn)):Je()._curve},_e}function ct(_e,Je){return[(Je=+Je)*Math.cos(_e-=Math.PI/2),Je*Math.sin(_e)]}var lt=Array.prototype.slice;function tt(_e){return _e.source}function Z(_e){return _e.target}function st(_e){var Je=tt,yr=Z,Hr=k,hn=_,En=null;function dn(){var Kr,Tn=lt.call(arguments),ta=Je.apply(this,Tn),Qn=yr.apply(this,Tn);if(En||(En=Kr=g.path()),_e(En,+Hr.apply(this,(Tn[0]=ta,Tn)),+hn.apply(this,Tn),+Hr.apply(this,(Tn[0]=Qn,Tn)),+hn.apply(this,Tn)),Kr)return En=null,Kr+""||null}return dn.source=function(Kr){return arguments.length?(Je=Kr,dn):Je},dn.target=function(Kr){return arguments.length?(yr=Kr,dn):yr},dn.x=function(Kr){return arguments.length?(Hr=typeof Kr=="function"?Kr:E(+Kr),dn):Hr},dn.y=function(Kr){return arguments.length?(hn=typeof Kr=="function"?Kr:E(+Kr),dn):hn},dn.context=function(Kr){return arguments.length?(En=Kr??null,dn):En},dn}function $(_e,Je,yr,Hr,hn){_e.moveTo(Je,yr),_e.bezierCurveTo(Je=(Je+Hr)/2,yr,Je,hn,Hr,hn)}function Q(_e,Je,yr,Hr,hn){_e.moveTo(Je,yr),_e.bezierCurveTo(Je,yr=(yr+hn)/2,Hr,yr,Hr,hn)}function nt(_e,Je,yr,Hr,hn){var En=ct(Je,yr),dn=ct(Je,yr=(yr+hn)/2),Kr=ct(Hr,yr),Tn=ct(Hr,hn);_e.moveTo(En[0],En[1]),_e.bezierCurveTo(dn[0],dn[1],Kr[0],Kr[1],Tn[0],Tn[1])}function Y(){return st($)}function q(){return st(Q)}function ot(){var _e=st(nt);return _e.angle=_e.x,delete _e.x,_e.radius=_e.y,delete _e.y,_e}var it={draw:function(_e,Je){var yr=Math.sqrt(Je/s);_e.moveTo(yr,0),_e.arc(0,0,yr,0,v)}},dt={draw:function(_e,Je){var yr=Math.sqrt(Je/5)/2;_e.moveTo(-3*yr,-yr),_e.lineTo(-yr,-yr),_e.lineTo(-yr,-3*yr),_e.lineTo(yr,-3*yr),_e.lineTo(yr,-yr),_e.lineTo(3*yr,-yr),_e.lineTo(3*yr,yr),_e.lineTo(yr,yr),_e.lineTo(yr,3*yr),_e.lineTo(-yr,3*yr),_e.lineTo(-yr,yr),_e.lineTo(-3*yr,yr),_e.closePath()}},wt=Math.sqrt(1/3),xt=wt*2,Ft={draw:function(_e,Je){var yr=Math.sqrt(Je/xt),Hr=yr*wt;_e.moveTo(0,-yr),_e.lineTo(Hr,0),_e.lineTo(0,yr),_e.lineTo(-Hr,0),_e.closePath()}},Et=.8908130915292852,Nt=Math.sin(s/10)/Math.sin(7*s/10),te=Math.sin(v/10)*Nt,Jt=-Math.cos(v/10)*Nt,Qt={draw:function(_e,Je){var yr=Math.sqrt(Je*Et),Hr=te*yr,hn=Jt*yr;_e.moveTo(0,-yr),_e.lineTo(Hr,hn);for(var En=1;En<5;++En){var dn=v*En/5,Kr=Math.cos(dn),Tn=Math.sin(dn);_e.lineTo(Tn*yr,-Kr*yr),_e.lineTo(Kr*Hr-Tn*hn,Tn*Hr+Kr*hn)}_e.closePath()}},Wt={draw:function(_e,Je){var yr=Math.sqrt(Je),Hr=-yr/2;_e.rect(Hr,Hr,yr,yr)}},gt=Math.sqrt(3),bt={draw:function(_e,Je){var yr=-Math.sqrt(Je/(gt*3));_e.moveTo(0,yr*2),_e.lineTo(-gt*yr,-yr),_e.lineTo(gt*yr,-yr),_e.closePath()}},vt=-.5,Ut=Math.sqrt(3)/2,Kt=1/Math.sqrt(12),Zt=(Kt/2+1)*3,le={draw:function(_e,Je){var yr=Math.sqrt(Je/Zt),Hr=yr/2,hn=yr*Kt,En=Hr,dn=yr*Kt+yr,Kr=-En,Tn=dn;_e.moveTo(Hr,hn),_e.lineTo(En,dn),_e.lineTo(Kr,Tn),_e.lineTo(vt*Hr-Ut*hn,Ut*Hr+vt*hn),_e.lineTo(vt*En-Ut*dn,Ut*En+vt*dn),_e.lineTo(vt*Kr-Ut*Tn,Ut*Kr+vt*Tn),_e.lineTo(vt*Hr+Ut*hn,vt*hn-Ut*Hr),_e.lineTo(vt*En+Ut*dn,vt*dn-Ut*En),_e.lineTo(vt*Kr+Ut*Tn,vt*Tn-Ut*Kr),_e.closePath()}},Te=[it,dt,Ft,Wt,Qt,bt,le];function Se(){var _e=E(it),Je=E(64),yr=null;function Hr(){var hn;if(yr||(yr=hn=g.path()),_e.apply(this,arguments).draw(yr,+Je.apply(this,arguments)),hn)return yr=null,hn+""||null}return Hr.type=function(hn){return arguments.length?(_e=typeof hn=="function"?hn:E(hn),Hr):_e},Hr.size=function(hn){return arguments.length?(Je=typeof hn=="function"?hn:E(+hn),Hr):Je},Hr.context=function(hn){return arguments.length?(yr=hn??null,Hr):yr},Hr}function Fe(){}function Oe(_e,Je,yr){_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+Je)/6,(_e._y0+4*_e._y1+yr)/6)}function ur(_e){this._context=_e}ur.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:Oe(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(_e,Je){switch(_e=+_e,Je=+Je,this._point){case 0:this._point=1,this._line?this._context.lineTo(_e,Je):this._context.moveTo(_e,Je);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:Oe(this,_e,Je);break}this._x0=this._x1,this._x1=_e,this._y0=this._y1,this._y1=Je}};function fr(_e){return new ur(_e)}function We(_e){this._context=_e}We.prototype={areaStart:Fe,areaEnd:Fe,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);break}}},point:function(_e,Je){switch(_e=+_e,Je=+Je,this._point){case 0:this._point=1,this._x2=_e,this._y2=Je;break;case 1:this._point=2,this._x3=_e,this._y3=Je;break;case 2:this._point=3,this._x4=_e,this._y4=Je,this._context.moveTo((this._x0+4*this._x1+_e)/6,(this._y0+4*this._y1+Je)/6);break;default:Oe(this,_e,Je);break}this._x0=this._x1,this._x1=_e,this._y0=this._y1,this._y1=Je}};function Lr(_e){return new We(_e)}function kr(_e){this._context=_e}kr.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(_e,Je){switch(_e=+_e,Je=+Je,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var yr=(this._x0+4*this._x1+_e)/6,Hr=(this._y0+4*this._y1+Je)/6;this._line?this._context.lineTo(yr,Hr):this._context.moveTo(yr,Hr);break;case 3:this._point=4;default:Oe(this,_e,Je);break}this._x0=this._x1,this._x1=_e,this._y0=this._y1,this._y1=Je}};function he(_e){return new kr(_e)}function Dt(_e,Je){this._basis=new ur(_e),this._beta=Je}Dt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var _e=this._x,Je=this._y,yr=_e.length-1;if(yr>0)for(var Hr=_e[0],hn=Je[0],En=_e[yr]-Hr,dn=Je[yr]-hn,Kr=-1,Tn;++Kr<=yr;)Tn=Kr/yr,this._basis.point(this._beta*_e[Kr]+(1-this._beta)*(Hr+Tn*En),this._beta*Je[Kr]+(1-this._beta)*(hn+Tn*dn));this._x=this._y=null,this._basis.lineEnd()},point:function(_e,Je){this._x.push(+_e),this._y.push(+Je)}};var qt=function _e(Je){function yr(Hr){return Je===1?new ur(Hr):new Dt(Hr,Je)}return yr.beta=function(Hr){return _e(+Hr)},yr}(.85);function zt(_e,Je,yr){_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-Je),_e._y2+_e._k*(_e._y1-yr),_e._x2,_e._y2)}function ut(_e,Je){this._context=_e,this._k=(1-Je)/6}ut.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:zt(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(_e,Je){switch(_e=+_e,Je=+Je,this._point){case 0:this._point=1,this._line?this._context.lineTo(_e,Je):this._context.moveTo(_e,Je);break;case 1:this._point=2,this._x1=_e,this._y1=Je;break;case 2:this._point=3;default:zt(this,_e,Je);break}this._x0=this._x1,this._x1=this._x2,this._x2=_e,this._y0=this._y1,this._y1=this._y2,this._y2=Je}};var yt=function _e(Je){function yr(Hr){return new ut(Hr,Je)}return yr.tension=function(Hr){return _e(+Hr)},yr}(0);function Mt(_e,Je){this._context=_e,this._k=(1-Je)/6}Mt.prototype={areaStart:Fe,areaEnd:Fe,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);break}}},point:function(_e,Je){switch(_e=+_e,Je=+Je,this._point){case 0:this._point=1,this._x3=_e,this._y3=Je;break;case 1:this._point=2,this._context.moveTo(this._x4=_e,this._y4=Je);break;case 2:this._point=3,this._x5=_e,this._y5=Je;break;default:zt(this,_e,Je);break}this._x0=this._x1,this._x1=this._x2,this._x2=_e,this._y0=this._y1,this._y1=this._y2,this._y2=Je}};var Ot=function _e(Je){function yr(Hr){return new Mt(Hr,Je)}return yr.tension=function(Hr){return _e(+Hr)},yr}(0);function $t(_e,Je){this._context=_e,this._k=(1-Je)/6}$t.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(_e,Je){switch(_e=+_e,Je=+Je,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:zt(this,_e,Je);break}this._x0=this._x1,this._x1=this._x2,this._x2=_e,this._y0=this._y1,this._y1=this._y2,this._y2=Je}};var ee=function _e(Je){function yr(Hr){return new $t(Hr,Je)}return yr.tension=function(Hr){return _e(+Hr)},yr}(0);function we(_e,Je,yr){var Hr=_e._x1,hn=_e._y1,En=_e._x2,dn=_e._y2;if(_e._l01_a>a){var Kr=2*_e._l01_2a+3*_e._l01_a*_e._l12_a+_e._l12_2a,Tn=3*_e._l01_a*(_e._l01_a+_e._l12_a);Hr=(Hr*Kr-_e._x0*_e._l12_2a+_e._x2*_e._l01_2a)/Tn,hn=(hn*Kr-_e._y0*_e._l12_2a+_e._y2*_e._l01_2a)/Tn}if(_e._l23_a>a){var ta=2*_e._l23_2a+3*_e._l23_a*_e._l12_a+_e._l12_2a,Qn=3*_e._l23_a*(_e._l23_a+_e._l12_a);En=(En*ta+_e._x1*_e._l23_2a-Je*_e._l12_2a)/Qn,dn=(dn*ta+_e._y1*_e._l23_2a-yr*_e._l12_2a)/Qn}_e._context.bezierCurveTo(Hr,hn,En,dn,_e._x2,_e._y2)}function Me(_e,Je){this._context=_e,this._alpha=Je}Me.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);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(_e,Je){if(_e=+_e,Je=+Je,this._point){var yr=this._x2-_e,Hr=this._y2-Je;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(yr*yr+Hr*Hr,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(_e,Je):this._context.moveTo(_e,Je);break;case 1:this._point=2;break;case 2:this._point=3;default:we(this,_e,Je);break}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=Je}};var Re=function _e(Je){function yr(Hr){return Je?new Me(Hr,Je):new ut(Hr,0)}return yr.alpha=function(Hr){return _e(+Hr)},yr}(.5);function Be(_e,Je){this._context=_e,this._alpha=Je}Be.prototype={areaStart:Fe,areaEnd:Fe,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);break}}},point:function(_e,Je){if(_e=+_e,Je=+Je,this._point){var yr=this._x2-_e,Hr=this._y2-Je;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(yr*yr+Hr*Hr,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=_e,this._y3=Je;break;case 1:this._point=2,this._context.moveTo(this._x4=_e,this._y4=Je);break;case 2:this._point=3,this._x5=_e,this._y5=Je;break;default:we(this,_e,Je);break}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=Je}};var Ze=function _e(Je){function yr(Hr){return Je?new Be(Hr,Je):new Mt(Hr,0)}return yr.alpha=function(Hr){return _e(+Hr)},yr}(.5);function Ue(_e,Je){this._context=_e,this._alpha=Je}Ue.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(_e,Je){if(_e=+_e,Je=+Je,this._point){var yr=this._x2-_e,Hr=this._y2-Je;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(yr*yr+Hr*Hr,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:we(this,_e,Je);break}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=Je}};var mr=function _e(Je){function yr(Hr){return Je?new Ue(Hr,Je):new $t(Hr,0)}return yr.alpha=function(Hr){return _e(+Hr)},yr}(.5);function ln(_e){this._context=_e}ln.prototype={areaStart:Fe,areaEnd:Fe,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(_e,Je){_e=+_e,Je=+Je,this._point?this._context.lineTo(_e,Je):(this._point=1,this._context.moveTo(_e,Je))}};function an(_e){return new ln(_e)}function vn(_e){return _e<0?-1:1}function Sn(_e,Je,yr){var Hr=_e._x1-_e._x0,hn=Je-_e._x1,En=(_e._y1-_e._y0)/(Hr||hn<0&&-0),dn=(yr-_e._y1)/(hn||Hr<0&&-0),Kr=(En*hn+dn*Hr)/(Hr+hn);return(vn(En)+vn(dn))*Math.min(Math.abs(En),Math.abs(dn),.5*Math.abs(Kr))||0}function An(_e,Je){var yr=_e._x1-_e._x0;return yr?(3*(_e._y1-_e._y0)/yr-Je)/2:Je}function pn(_e,Je,yr){var Hr=_e._x0,hn=_e._y0,En=_e._x1,dn=_e._y1,Kr=(En-Hr)/3;_e._context.bezierCurveTo(Hr+Kr,hn+Kr*Je,En-Kr,dn-Kr*yr,En,dn)}function On(_e){this._context=_e}On.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:pn(this,this._t0,An(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(_e,Je){var yr=NaN;if(_e=+_e,Je=+Je,!(_e===this._x1&&Je===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(_e,Je):this._context.moveTo(_e,Je);break;case 1:this._point=2;break;case 2:this._point=3,pn(this,An(this,yr=Sn(this,_e,Je)),yr);break;default:pn(this,this._t0,yr=Sn(this,_e,Je));break}this._x0=this._x1,this._x1=_e,this._y0=this._y1,this._y1=Je,this._t0=yr}}};function Nn(_e){this._context=new ke(_e)}(Nn.prototype=Object.create(On.prototype)).point=function(_e,Je){On.prototype.point.call(this,Je,_e)};function ke(_e){this._context=_e}ke.prototype={moveTo:function(_e,Je){this._context.moveTo(Je,_e)},closePath:function(){this._context.closePath()},lineTo:function(_e,Je){this._context.lineTo(Je,_e)},bezierCurveTo:function(_e,Je,yr,Hr,hn,En){this._context.bezierCurveTo(Je,_e,Hr,yr,En,hn)}};function ze(_e){return new On(_e)}function je(_e){return new Nn(_e)}function Ne(_e){this._context=_e}Ne.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var _e=this._x,Je=this._y,yr=_e.length;if(yr)if(this._line?this._context.lineTo(_e[0],Je[0]):this._context.moveTo(_e[0],Je[0]),yr===2)this._context.lineTo(_e[1],Je[1]);else for(var Hr=_r(_e),hn=_r(Je),En=0,dn=1;dn<yr;++En,++dn)this._context.bezierCurveTo(Hr[0][En],hn[0][En],Hr[1][En],hn[1][En],_e[dn],Je[dn]);(this._line||this._line!==0&&yr===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(_e,Je){this._x.push(+_e),this._y.push(+Je)}};function _r(_e){var Je,yr=_e.length-1,Hr,hn=new Array(yr),En=new Array(yr),dn=new Array(yr);for(hn[0]=0,En[0]=2,dn[0]=_e[0]+2*_e[1],Je=1;Je<yr-1;++Je)hn[Je]=1,En[Je]=4,dn[Je]=4*_e[Je]+2*_e[Je+1];for(hn[yr-1]=2,En[yr-1]=7,dn[yr-1]=8*_e[yr-1]+_e[yr],Je=1;Je<yr;++Je)Hr=hn[Je]/En[Je-1],En[Je]-=Hr,dn[Je]-=Hr*dn[Je-1];for(hn[yr-1]=dn[yr-1]/En[yr-1],Je=yr-2;Je>=0;--Je)hn[Je]=(dn[Je]-hn[Je+1])/En[Je];for(En[yr-1]=(_e[yr]+hn[yr-1])/2,Je=0;Je<yr-1;++Je)En[Je]=2*_e[Je+1]-hn[Je+1];return[hn,En]}function Xr(_e){return new Ne(_e)}function rn(_e,Je){this._context=_e,this._t=Je}rn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(_e,Je){switch(_e=+_e,Je=+Je,this._point){case 0:this._point=1,this._line?this._context.lineTo(_e,Je):this._context.moveTo(_e,Je);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,Je),this._context.lineTo(_e,Je);else{var yr=this._x*(1-this._t)+_e*this._t;this._context.lineTo(yr,this._y),this._context.lineTo(yr,Je)}break}}this._x=_e,this._y=Je}};function Br(_e){return new rn(_e,.5)}function _n(_e){return new rn(_e,0)}function bn(_e){return new rn(_e,1)}function Fn(_e,Je){if((dn=_e.length)>1)for(var yr=1,Hr,hn,En=_e[Je[0]],dn,Kr=En.length;yr<dn;++yr)for(hn=En,En=_e[Je[yr]],Hr=0;Hr<Kr;++Hr)En[Hr][1]+=En[Hr][0]=isNaN(hn[Hr][1])?hn[Hr][0]:hn[Hr][1]}function on(_e){for(var Je=_e.length,yr=new Array(Je);--Je>=0;)yr[Je]=Je;return yr}function Bn(_e,Je){return _e[Je]}function ue(){var _e=E([]),Je=on,yr=Fn,Hr=Bn;function hn(En){var dn=_e.apply(this,arguments),Kr,Tn=En.length,ta=dn.length,Qn=new Array(ta),Va;for(Kr=0;Kr<ta;++Kr){for(var ja=dn[Kr],ci=Qn[Kr]=new Array(Tn),pi=0,bi;pi<Tn;++pi)ci[pi]=bi=[0,+Hr(En[pi],ja,pi,En)],bi.data=En[pi];ci.key=ja}for(Kr=0,Va=Je(Qn);Kr<ta;++Kr)Qn[Va[Kr]].index=Kr;return yr(Qn,Va),Qn}return hn.keys=function(En){return arguments.length?(_e=typeof En=="function"?En:E(lt.call(En)),hn):_e},hn.value=function(En){return arguments.length?(Hr=typeof En=="function"?En:E(+En),hn):Hr},hn.order=function(En){return arguments.length?(Je=En==null?on:typeof En=="function"?En:E(lt.call(En)),hn):Je},hn.offset=function(En){return arguments.length?(yr=En??Fn,hn):yr},hn}function xe(_e,Je){if((Hr=_e.length)>0){for(var yr,Hr,hn=0,En=_e[0].length,dn;hn<En;++hn){for(dn=yr=0;yr<Hr;++yr)dn+=_e[yr][hn][1]||0;if(dn)for(yr=0;yr<Hr;++yr)_e[yr][hn][1]/=dn}Fn(_e,Je)}}function Pr(_e,Je){if((Tn=_e.length)>0)for(var yr,Hr=0,hn,En,dn,Kr,Tn,ta=_e[Je[0]].length;Hr<ta;++Hr)for(dn=Kr=0,yr=0;yr<Tn;++yr)(En=(hn=_e[Je[yr]][Hr])[1]-hn[0])>0?(hn[0]=dn,hn[1]=dn+=En):En<0?(hn[1]=Kr,hn[0]=Kr+=En):(hn[0]=0,hn[1]=En)}function Sr(_e,Je){if((hn=_e.length)>0){for(var yr=0,Hr=_e[Je[0]],hn,En=Hr.length;yr<En;++yr){for(var dn=0,Kr=0;dn<hn;++dn)Kr+=_e[dn][yr][1]||0;Hr[yr][1]+=Hr[yr][0]=-Kr/2}Fn(_e,Je)}}function gr(_e,Je){if(!(!((dn=_e.length)>0)||!((En=(hn=_e[Je[0]]).length)>0))){for(var yr=0,Hr=1,hn,En,dn;Hr<En;++Hr){for(var Kr=0,Tn=0,ta=0;Kr<dn;++Kr){for(var Qn=_e[Je[Kr]],Va=Qn[Hr][1]||0,ja=Qn[Hr-1][1]||0,ci=(Va-ja)/2,pi=0;pi<Kr;++pi){var bi=_e[Je[pi]],ri=bi[Hr][1]||0,Da=bi[Hr-1][1]||0;ci+=ri-Da}Tn+=Va,ta+=ci*Va}hn[Hr-1][1]+=hn[Hr-1][0]=yr,Tn&&(yr-=ta/Tn)}hn[Hr-1][1]+=hn[Hr-1][0]=yr,Fn(_e,Je)}}function dr(_e){var Je=_e.map(Er);return on(_e).sort(function(yr,Hr){return Je[yr]-Je[Hr]})}function Er(_e){for(var Je=-1,yr=0,Hr=_e.length,hn,En=-1/0;++Je<Hr;)(hn=+_e[Je][1])>En&&(En=hn,yr=Je);return yr}function Dr(_e){var Je=_e.map(Ar);return on(_e).sort(function(yr,Hr){return Je[yr]-Je[Hr]})}function Ar(_e){for(var Je=0,yr=-1,Hr=_e.length,hn;++yr<Hr;)(hn=+_e[yr][1])&&(Je+=hn);return Je}function Gr(_e){return Dr(_e).reverse()}function Wr(_e){var Je=_e.length,yr,Hr,hn=_e.map(Ar),En=dr(_e),dn=0,Kr=0,Tn=[],ta=[];for(yr=0;yr<Je;++yr)Hr=En[yr],dn<Kr?(dn+=hn[Hr],Tn.push(Hr)):(Kr+=hn[Hr],ta.push(Hr));return ta.reverse().concat(Tn)}function Jr(_e){return on(_e).reverse()}c.arc=w,c.area=I,c.areaRadial=rt,c.curveBasis=fr,c.curveBasisClosed=Lr,c.curveBasisOpen=he,c.curveBundle=qt,c.curveCardinal=yt,c.curveCardinalClosed=Ot,c.curveCardinalOpen=ee,c.curveCatmullRom=Re,c.curveCatmullRomClosed=Ze,c.curveCatmullRomOpen=mr,c.curveLinear=f,c.curveLinearClosed=an,c.curveMonotoneX=ze,c.curveMonotoneY=je,c.curveNatural=Xr,c.curveStep=Br,c.curveStepAfter=bn,c.curveStepBefore=_n,c.line=D,c.lineRadial=G,c.linkHorizontal=Y,c.linkRadial=ot,c.linkVertical=q,c.pie=R,c.pointRadial=ct,c.radialArea=rt,c.radialLine=G,c.stack=ue,c.stackOffsetDiverging=Pr,c.stackOffsetExpand=xe,c.stackOffsetNone=Fn,c.stackOffsetSilhouette=Sr,c.stackOffsetWiggle=gr,c.stackOrderAppearance=dr,c.stackOrderAscending=Dr,c.stackOrderDescending=Gr,c.stackOrderInsideOut=Wr,c.stackOrderNone=on,c.stackOrderReverse=Jr,c.symbol=Se,c.symbolCircle=it,c.symbolCross=dt,c.symbolDiamond=Ft,c.symbolSquare=Wt,c.symbolStar=Qt,c.symbolTriangle=bt,c.symbolWye=le,c.symbols=Te,Object.defineProperty(c,"__esModule",{value:!0})})}),xL=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X,Sv(),Xx(),E5()):g(c.d3=c.d3||{},c.d3,c.d3,c.d3)})(X,function(c,g,E,A){function t(f){return f.target.depth}function e(f){return f.depth}function r(f,k){return k-1-f.height}function i(f,k){return f.sourceLinks.length?f.depth:k-1}function n(f){return f.targetLinks.length?f.depth:f.sourceLinks.length?g.min(f.sourceLinks,t)-1:0}function o(f){return function(){return f}}function a(f,k){return h(f.source,k.source)||f.index-k.index}function s(f,k){return h(f.target,k.target)||f.index-k.index}function h(f,k){return f.y0-k.y0}function v(f){return f.value}function m(f){return(f.y0+f.y1)/2}function p(f){return m(f.source)*f.value}function y(f){return m(f.target)*f.value}function l(f){return f.index}function x(f){return f.nodes}function b(f){return f.links}function S(f,k){var _=f.get(k);if(!_)throw new Error("missing: "+k);return _}var T=function(){var f=0,k=0,_=1,D=1,I=24,O=8,B=l,R=i,L=x,F=b,N=32,j=2/3;function G(){var st={nodes:L.apply(null,arguments),links:F.apply(null,arguments)};return rt(st),ct(st),lt(st),tt(st),Z(st),st}G.update=function(st){return Z(st),st},G.nodeId=function(st){return arguments.length?(B=typeof st=="function"?st:o(st),G):B},G.nodeAlign=function(st){return arguments.length?(R=typeof st=="function"?st:o(st),G):R},G.nodeWidth=function(st){return arguments.length?(I=+st,G):I},G.nodePadding=function(st){return arguments.length?(O=+st,G):O},G.nodes=function(st){return arguments.length?(L=typeof st=="function"?st:o(st),G):L},G.links=function(st){return arguments.length?(F=typeof st=="function"?st:o(st),G):F},G.size=function(st){return arguments.length?(f=k=0,_=+st[0],D=+st[1],G):[_-f,D-k]},G.extent=function(st){return arguments.length?(f=+st[0][0],_=+st[1][0],k=+st[0][1],D=+st[1][1],G):[[f,k],[_,D]]},G.iterations=function(st){return arguments.length?(N=+st,G):N};function rt(st){st.nodes.forEach(function(Q,nt){Q.index=nt,Q.sourceLinks=[],Q.targetLinks=[]});var $=E.map(st.nodes,B);st.links.forEach(function(Q,nt){Q.index=nt;var Y=Q.source,q=Q.target;typeof Y!="object"&&(Y=Q.source=S($,Y)),typeof q!="object"&&(q=Q.target=S($,q)),Y.sourceLinks.push(Q),q.targetLinks.push(Q)})}function ct(st){st.nodes.forEach(function($){$.value=Math.max(g.sum($.sourceLinks,v),g.sum($.targetLinks,v))})}function lt(st){var $,Q,nt;for($=st.nodes,Q=[],nt=0;$.length;++nt,$=Q,Q=[])$.forEach(function(q){q.depth=nt,q.sourceLinks.forEach(function(ot){Q.indexOf(ot.target)<0&&Q.push(ot.target)})});for($=st.nodes,Q=[],nt=0;$.length;++nt,$=Q,Q=[])$.forEach(function(q){q.height=nt,q.targetLinks.forEach(function(ot){Q.indexOf(ot.source)<0&&Q.push(ot.source)})});var Y=(_-f-I)/(nt-1);st.nodes.forEach(function(q){q.x1=(q.x0=f+Math.max(0,Math.min(nt-1,Math.floor(R.call(null,q,nt))))*Y)+I})}function tt(st){var $=E.nest().key(function(dt){return dt.x0}).sortKeys(g.ascending).entries(st.nodes).map(function(dt){return dt.values});Y(),it();for(var Q=1,nt=N;nt>0;--nt)ot(Q*=.99),it(),q(Q),it();function Y(){var dt=g.max($,function(Ft){return Ft.length}),wt=j*(D-k)/(dt-1);O>wt&&(O=wt);var xt=g.min($,function(Ft){return(D-k-(Ft.length-1)*O)/g.sum(Ft,v)});$.forEach(function(Ft){Ft.forEach(function(Et,Nt){Et.y1=(Et.y0=Nt)+Et.value*xt})}),st.links.forEach(function(Ft){Ft.width=Ft.value*xt})}function q(dt){$.forEach(function(wt){wt.forEach(function(xt){if(xt.targetLinks.length){var Ft=(g.sum(xt.targetLinks,p)/g.sum(xt.targetLinks,v)-m(xt))*dt;xt.y0+=Ft,xt.y1+=Ft}})})}function ot(dt){$.slice().reverse().forEach(function(wt){wt.forEach(function(xt){if(xt.sourceLinks.length){var Ft=(g.sum(xt.sourceLinks,y)/g.sum(xt.sourceLinks,v)-m(xt))*dt;xt.y0+=Ft,xt.y1+=Ft}})})}function it(){$.forEach(function(dt){var wt,xt,Ft=k,Et=dt.length,Nt;for(dt.sort(h),Nt=0;Nt<Et;++Nt)wt=dt[Nt],xt=Ft-wt.y0,xt>0&&(wt.y0+=xt,wt.y1+=xt),Ft=wt.y1+O;if(xt=Ft-O-D,xt>0)for(Ft=wt.y0-=xt,wt.y1-=xt,Nt=Et-2;Nt>=0;--Nt)wt=dt[Nt],xt=wt.y1+O-Ft,xt>0&&(wt.y0-=xt,wt.y1-=xt),Ft=wt.y0})}}function Z(st){st.nodes.forEach(function($){$.sourceLinks.sort(s),$.targetLinks.sort(a)}),st.nodes.forEach(function($){var Q=$.y0,nt=Q;$.sourceLinks.forEach(function(Y){Y.y0=Q+Y.width/2,Q+=Y.width}),$.targetLinks.forEach(function(Y){Y.y1=nt+Y.width/2,nt+=Y.width})})}return G};function M(f){return[f.source.x1,f.y0]}function w(f){return[f.target.x0,f.y1]}var u=function(){return A.linkHorizontal().source(M).target(w)};c.sankey=T,c.sankeyCenter=n,c.sankeyLeft=e,c.sankeyRight=r,c.sankeyJustify=i,c.sankeyLinkHorizontal=u,Object.defineProperty(c,"__esModule",{value:!0})})}),_L=Vt((X,V)=>{var c=S5();V.exports=function(g,E){var A=[],t=[],e=[],r={},i=[],n;function o(b){e[b]=!1,r.hasOwnProperty(b)&&Object.keys(r[b]).forEach(function(S){delete r[b][S],e[S]&&o(S)})}function a(b){var S=!1;t.push(b),e[b]=!0;var T,M;for(T=0;T<i[b].length;T++)M=i[b][T],M===n?(s(n,t),S=!0):e[M]||(S=a(M));if(S)o(b);else for(T=0;T<i[b].length;T++){M=i[b][T];var w=r[M];w||(w={},r[M]=w),w[M]=!0}return t.pop(),S}function s(b,S){var T=[].concat(S).concat(b);E?E(a):A.push(T)}function h(b){for(var S=0;S<g.length;S++)S<b&&(g[S]=[]),g[S]=g[S].filter(function(T){return T>=b})}function v(b){h(b);for(var S=g,T=c(S),M=T.components.filter(function(I){return I.length>1}),w=1/0,u,f=0;f<M.length;f++)for(var k=0;k<M[f].length;k++)M[f][k]<w&&(w=M[f][k],u=f);var _=M[u];if(!_)return!1;var D=g.map(function(I,O){return _.indexOf(O)===-1?[]:I.filter(function(B){return _.indexOf(B)!==-1})});return{leastVertex:w,adjList:D}}n=0;for(var m=g.length;n<m;){var p=v(n);if(n=p.leastVertex,i=p.adjList,i){for(var y=0;y<i.length;y++)for(var l=0;l<i[y].length;l++){var x=i[y][l];e[+x]=!1,r[x]={}}a(n),n=n+1}else n=m}if(!E)return A}}),bL=Vt((X,V)=>{(function(c,g){typeof X=="object"&&typeof V<"u"?g(X,Sv(),Xx(),E5(),_L()):g(c.d3=c.d3||{},c.d3,c.d3,c.d3,null)})(X,function(c,g,E,A,t){t=t&&t.hasOwnProperty("default")?t.default:t;function e(Et){return Et.target.depth}function r(Et){return Et.depth}function i(Et,Nt){return Nt-1-Et.height}function n(Et,Nt){return Et.sourceLinks.length?Et.depth:Nt-1}function o(Et){return Et.targetLinks.length?Et.depth:Et.sourceLinks.length?g.min(Et.sourceLinks,e)-1:0}function a(Et){return function(){return Et}}var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Et){return typeof Et}:function(Et){return Et&&typeof Symbol=="function"&&Et.constructor===Symbol&&Et!==Symbol.prototype?"symbol":typeof Et};function h(Et,Nt){return m(Et.source,Nt.source)||Et.index-Nt.index}function v(Et,Nt){return m(Et.target,Nt.target)||Et.index-Nt.index}function m(Et,Nt){return Et.partOfCycle===Nt.partOfCycle?Et.y0-Nt.y0:Et.circularLinkType==="top"||Nt.circularLinkType==="bottom"?-1:1}function p(Et){return Et.value}function y(Et){return(Et.y0+Et.y1)/2}function l(Et){return y(Et.source)}function x(Et){return y(Et.target)}function b(Et){return Et.index}function S(Et){return Et.nodes}function T(Et){return Et.links}function M(Et,Nt){var te=Et.get(Nt);if(!te)throw new Error("missing: "+Nt);return te}function w(Et,Nt){return Nt(Et)}var u=25,f=10,k=.3;function _(){var Et=0,Nt=0,te=1,Jt=1,Qt=24,Wt,gt=b,bt=n,vt=S,Ut=T,Kt=32,Zt=2,le,Te=null;function Se(){var he={nodes:vt.apply(null,arguments),links:Ut.apply(null,arguments)};Fe(he),D(he,gt,Te),Oe(he),We(he),I(he,gt),Lr(he,Kt,gt),kr(he);for(var Dt=4,qt=0;qt<Dt;qt++)ot(he,Jt,gt),it(he,Jt,gt),nt(he,Nt,Jt,gt),ot(he,Jt,gt),it(he,Jt,gt);return Ft(he,Nt,Jt),N(he,Zt,Jt,gt),he}Se.nodeId=function(he){return arguments.length?(gt=typeof he=="function"?he:a(he),Se):gt},Se.nodeAlign=function(he){return arguments.length?(bt=typeof he=="function"?he:a(he),Se):bt},Se.nodeWidth=function(he){return arguments.length?(Qt=+he,Se):Qt},Se.nodePadding=function(he){return arguments.length?(Wt=+he,Se):Wt},Se.nodes=function(he){return arguments.length?(vt=typeof he=="function"?he:a(he),Se):vt},Se.links=function(he){return arguments.length?(Ut=typeof he=="function"?he:a(he),Se):Ut},Se.size=function(he){return arguments.length?(Et=Nt=0,te=+he[0],Jt=+he[1],Se):[te-Et,Jt-Nt]},Se.extent=function(he){return arguments.length?(Et=+he[0][0],te=+he[1][0],Nt=+he[0][1],Jt=+he[1][1],Se):[[Et,Nt],[te,Jt]]},Se.iterations=function(he){return arguments.length?(Kt=+he,Se):Kt},Se.circularLinkGap=function(he){return arguments.length?(Zt=+he,Se):Zt},Se.nodePaddingRatio=function(he){return arguments.length?(le=+he,Se):le},Se.sortNodes=function(he){return arguments.length?(Te=he,Se):Te},Se.update=function(he){return I(he,gt),kr(he),he.links.forEach(function(Dt){Dt.circular&&(Dt.circularLinkType=Dt.y0+Dt.y1<Jt?"top":"bottom",Dt.source.circularLinkType=Dt.circularLinkType,Dt.target.circularLinkType=Dt.circularLinkType)}),ot(he,Jt,gt,!1),it(he,Jt,gt),N(he,Zt,Jt,gt),he};function Fe(he){he.nodes.forEach(function(qt,zt){qt.index=zt,qt.sourceLinks=[],qt.targetLinks=[]});var Dt=E.map(he.nodes,gt);return he.links.forEach(function(qt,zt){qt.index=zt;var ut=qt.source,yt=qt.target;(typeof ut>"u"?"undefined":s(ut))!=="object"&&(ut=qt.source=M(Dt,ut)),(typeof yt>"u"?"undefined":s(yt))!=="object"&&(yt=qt.target=M(Dt,yt)),ut.sourceLinks.push(qt),yt.targetLinks.push(qt)}),he}function Oe(he){he.nodes.forEach(function(Dt){Dt.partOfCycle=!1,Dt.value=Math.max(g.sum(Dt.sourceLinks,p),g.sum(Dt.targetLinks,p)),Dt.sourceLinks.forEach(function(qt){qt.circular&&(Dt.partOfCycle=!0,Dt.circularLinkType=qt.circularLinkType)}),Dt.targetLinks.forEach(function(qt){qt.circular&&(Dt.partOfCycle=!0,Dt.circularLinkType=qt.circularLinkType)})})}function ur(he){var Dt=0,qt=0,zt=0,ut=0,yt=g.max(he.nodes,function(Mt){return Mt.column});return he.links.forEach(function(Mt){Mt.circular&&(Mt.circularLinkType=="top"?Dt=Dt+Mt.width:qt=qt+Mt.width,Mt.target.column==0&&(ut=ut+Mt.width),Mt.source.column==yt&&(zt=zt+Mt.width))}),Dt=Dt>0?Dt+u+f:Dt,qt=qt>0?qt+u+f:qt,zt=zt>0?zt+u+f:zt,ut=ut>0?ut+u+f:ut,{top:Dt,bottom:qt,left:ut,right:zt}}function fr(he,Dt){var qt=g.max(he.nodes,function(ee){return ee.column}),zt=te-Et,ut=Jt-Nt,yt=zt+Dt.right+Dt.left,Mt=ut+Dt.top+Dt.bottom,Ot=zt/yt,$t=ut/Mt;return Et=Et*Ot+Dt.left,te=Dt.right==0?te:te*Ot,Nt=Nt*$t+Dt.top,Jt=Jt*$t,he.nodes.forEach(function(ee){ee.x0=Et+ee.column*((te-Et-Qt)/qt),ee.x1=ee.x0+Qt}),$t}function We(he){var Dt,qt,zt;for(Dt=he.nodes,qt=[],zt=0;Dt.length;++zt,Dt=qt,qt=[])Dt.forEach(function(ut){ut.depth=zt,ut.sourceLinks.forEach(function(yt){qt.indexOf(yt.target)<0&&!yt.circular&&qt.push(yt.target)})});for(Dt=he.nodes,qt=[],zt=0;Dt.length;++zt,Dt=qt,qt=[])Dt.forEach(function(ut){ut.height=zt,ut.targetLinks.forEach(function(yt){qt.indexOf(yt.source)<0&&!yt.circular&&qt.push(yt.source)})});he.nodes.forEach(function(ut){ut.column=Math.floor(bt.call(null,ut,zt))})}function Lr(he,Dt,qt){var zt=E.nest().key(function(ee){return ee.column}).sortKeys(g.ascending).entries(he.nodes).map(function(ee){return ee.values});Mt(qt),$t();for(var ut=1,yt=Dt;yt>0;--yt)Ot(ut*=.99,qt),$t();function Mt(ee){if(le){var we=1/0;zt.forEach(function(Ze){var Ue=Jt*le/(Ze.length+1);we=Ue<we?Ue:we}),Wt=we}var Me=g.min(zt,function(Ze){return(Jt-Nt-(Ze.length-1)*Wt)/g.sum(Ze,p)});Me=Me*k,he.links.forEach(function(Ze){Ze.width=Ze.value*Me});var Re=ur(he),Be=fr(he,Re);Me=Me*Be,he.links.forEach(function(Ze){Ze.width=Ze.value*Me}),zt.forEach(function(Ze){var Ue=Ze.length;Ze.forEach(function(mr,ln){mr.depth==zt.length-1&&Ue==1||mr.depth==0&&Ue==1?(mr.y0=Jt/2-mr.value*Me,mr.y1=mr.y0+mr.value*Me):mr.partOfCycle?R(mr,ee)==0?(mr.y0=Jt/2+ln,mr.y1=mr.y0+mr.value*Me):mr.circularLinkType=="top"?(mr.y0=Nt+ln,mr.y1=mr.y0+mr.value*Me):(mr.y0=Jt-mr.value*Me-ln,mr.y1=mr.y0+mr.value*Me):Re.top==0||Re.bottom==0?(mr.y0=(Jt-Nt)/Ue*ln,mr.y1=mr.y0+mr.value*Me):(mr.y0=(Jt-Nt)/2-Ue/2+ln,mr.y1=mr.y0+mr.value*Me)})})}function Ot(ee,we){var Me=zt.length;zt.forEach(function(Re){var Be=Re.length,Ze=Re[0].depth;Re.forEach(function(Ue){var mr;if((Ue.sourceLinks.length||Ue.targetLinks.length)&&!(Ue.partOfCycle&&R(Ue,we)>0))if(Ze==0&&Be==1)mr=Ue.y1-Ue.y0,Ue.y0=Jt/2-mr/2,Ue.y1=Jt/2+mr/2;else if(Ze==Me-1&&Be==1)mr=Ue.y1-Ue.y0,Ue.y0=Jt/2-mr/2,Ue.y1=Jt/2+mr/2;else{var ln=0,an=g.mean(Ue.sourceLinks,x),vn=g.mean(Ue.targetLinks,l);an&&vn?ln=(an+vn)/2:ln=an||vn;var Sn=(ln-y(Ue))*ee;Ue.y0+=Sn,Ue.y1+=Sn}})})}function $t(){zt.forEach(function(ee){var we,Me,Re=Nt,Be=ee.length,Ze;for(ee.sort(m),Ze=0;Ze<Be;++Ze)we=ee[Ze],Me=Re-we.y0,Me>0&&(we.y0+=Me,we.y1+=Me),Re=we.y1+Wt;if(Me=Re-Wt-Jt,Me>0)for(Re=we.y0-=Me,we.y1-=Me,Ze=Be-2;Ze>=0;--Ze)we=ee[Ze],Me=we.y1+Wt-Re,Me>0&&(we.y0-=Me,we.y1-=Me),Re=we.y0})}}function kr(he){he.nodes.forEach(function(Dt){Dt.sourceLinks.sort(v),Dt.targetLinks.sort(h)}),he.nodes.forEach(function(Dt){var qt=Dt.y0,zt=qt,ut=Dt.y1,yt=ut;Dt.sourceLinks.forEach(function(Mt){Mt.circular?(Mt.y0=ut-Mt.width/2,ut=ut-Mt.width):(Mt.y0=qt+Mt.width/2,qt+=Mt.width)}),Dt.targetLinks.forEach(function(Mt){Mt.circular?(Mt.y1=yt-Mt.width/2,yt=yt-Mt.width):(Mt.y1=zt+Mt.width/2,zt+=Mt.width)})})}return Se}function D(Et,Nt,te){var Jt=0;if(te===null){for(var Qt=[],Wt=0;Wt<Et.links.length;Wt++){var gt=Et.links[Wt],bt=gt.source.index,vt=gt.target.index;Qt[bt]||(Qt[bt]=[]),Qt[vt]||(Qt[vt]=[]),Qt[bt].indexOf(vt)===-1&&Qt[bt].push(vt)}var Ut=t(Qt);Ut.sort(function(Te,Se){return Te.length-Se.length});var Kt={};for(Wt=0;Wt<Ut.length;Wt++){var Zt=Ut[Wt],le=Zt.slice(-2);Kt[le[0]]||(Kt[le[0]]={}),Kt[le[0]][le[1]]=!0}Et.links.forEach(function(Te){var Se=Te.target.index,Fe=Te.source.index;Se===Fe||Kt[Fe]&&Kt[Fe][Se]?(Te.circular=!0,Te.circularLinkID=Jt,Jt=Jt+1):Te.circular=!1})}else Et.links.forEach(function(Te){Te.source[te]<Te.target[te]?Te.circular=!1:(Te.circular=!0,Te.circularLinkID=Jt,Jt=Jt+1)})}function I(Et,Nt){var te=0,Jt=0;Et.links.forEach(function(Qt){Qt.circular&&(Qt.source.circularLinkType||Qt.target.circularLinkType?Qt.circularLinkType=Qt.source.circularLinkType?Qt.source.circularLinkType:Qt.target.circularLinkType:Qt.circularLinkType=te<Jt?"top":"bottom",Qt.circularLinkType=="top"?te=te+1:Jt=Jt+1,Et.nodes.forEach(function(Wt){(w(Wt,Nt)==w(Qt.source,Nt)||w(Wt,Nt)==w(Qt.target,Nt))&&(Wt.circularLinkType=Qt.circularLinkType)}))}),Et.links.forEach(function(Qt){Qt.circular&&(Qt.source.circularLinkType==Qt.target.circularLinkType&&(Qt.circularLinkType=Qt.source.circularLinkType),xt(Qt,Nt)&&(Qt.circularLinkType=Qt.source.circularLinkType))})}function O(Et){var Nt=Math.abs(Et.y1-Et.y0),te=Math.abs(Et.target.x0-Et.source.x1);return Math.atan(te/Nt)}function B(Et,Nt){return Et.source.column<Nt.target.column?!1:!(Et.target.column>Nt.source.column)}function R(Et,Nt){var te=0;Et.sourceLinks.forEach(function(Qt){te=Qt.circular&&!xt(Qt,Nt)?te+1:te});var Jt=0;return Et.targetLinks.forEach(function(Qt){Jt=Qt.circular&&!xt(Qt,Nt)?Jt+1:Jt}),te+Jt}function L(Et){var Nt=Et.source.sourceLinks,te=0;Nt.forEach(function(Wt){te=Wt.circular?te+1:te});var Jt=Et.target.targetLinks,Qt=0;return Jt.forEach(function(Wt){Qt=Wt.circular?Qt+1:Qt}),!(te>1||Qt>1)}function F(Et,Nt,te){return Et.sort(G),Et.forEach(function(Jt,Qt){var Wt=0;if(xt(Jt,te)&&L(Jt))Jt.circularPathData.verticalBuffer=Wt+Jt.width/2;else{var gt=0;for(gt;gt<Qt;gt++)if(B(Et[Qt],Et[gt])){var bt=Et[gt].circularPathData.verticalBuffer+Et[gt].width/2+Nt;Wt=bt>Wt?bt:Wt}Jt.circularPathData.verticalBuffer=Wt+Jt.width/2}}),Et}function N(Et,Nt,te,Jt){var Qt=5,Wt=g.min(Et.links,function(vt){return vt.source.y0});Et.links.forEach(function(vt){vt.circular&&(vt.circularPathData={})});var gt=Et.links.filter(function(vt){return vt.circularLinkType=="top"});F(gt,Nt,Jt);var bt=Et.links.filter(function(vt){return vt.circularLinkType=="bottom"});F(bt,Nt,Jt),Et.links.forEach(function(vt){if(vt.circular){if(vt.circularPathData.arcRadius=vt.width+f,vt.circularPathData.leftNodeBuffer=Qt,vt.circularPathData.rightNodeBuffer=Qt,vt.circularPathData.sourceWidth=vt.source.x1-vt.source.x0,vt.circularPathData.sourceX=vt.source.x0+vt.circularPathData.sourceWidth,vt.circularPathData.targetX=vt.target.x0,vt.circularPathData.sourceY=vt.y0,vt.circularPathData.targetY=vt.y1,xt(vt,Jt)&&L(vt))vt.circularPathData.leftSmallArcRadius=f+vt.width/2,vt.circularPathData.leftLargeArcRadius=f+vt.width/2,vt.circularPathData.rightSmallArcRadius=f+vt.width/2,vt.circularPathData.rightLargeArcRadius=f+vt.width/2,vt.circularLinkType=="bottom"?(vt.circularPathData.verticalFullExtent=vt.source.y1+u+vt.circularPathData.verticalBuffer,vt.circularPathData.verticalLeftInnerExtent=vt.circularPathData.verticalFullExtent-vt.circularPathData.leftLargeArcRadius,vt.circularPathData.verticalRightInnerExtent=vt.circularPathData.verticalFullExtent-vt.circularPathData.rightLargeArcRadius):(vt.circularPathData.verticalFullExtent=vt.source.y0-u-vt.circularPathData.verticalBuffer,vt.circularPathData.verticalLeftInnerExtent=vt.circularPathData.verticalFullExtent+vt.circularPathData.leftLargeArcRadius,vt.circularPathData.verticalRightInnerExtent=vt.circularPathData.verticalFullExtent+vt.circularPathData.rightLargeArcRadius);else{var Ut=vt.source.column,Kt=vt.circularLinkType,Zt=Et.links.filter(function(Se){return Se.source.column==Ut&&Se.circularLinkType==Kt});vt.circularLinkType=="bottom"?Zt.sort(ct):Zt.sort(rt);var le=0;Zt.forEach(function(Se,Fe){Se.circularLinkID==vt.circularLinkID&&(vt.circularPathData.leftSmallArcRadius=f+vt.width/2+le,vt.circularPathData.leftLargeArcRadius=f+vt.width/2+Fe*Nt+le),le=le+Se.width}),Ut=vt.target.column,Zt=Et.links.filter(function(Se){return Se.target.column==Ut&&Se.circularLinkType==Kt}),vt.circularLinkType=="bottom"?Zt.sort(tt):Zt.sort(lt),le=0,Zt.forEach(function(Se,Fe){Se.circularLinkID==vt.circularLinkID&&(vt.circularPathData.rightSmallArcRadius=f+vt.width/2+le,vt.circularPathData.rightLargeArcRadius=f+vt.width/2+Fe*Nt+le),le=le+Se.width}),vt.circularLinkType=="bottom"?(vt.circularPathData.verticalFullExtent=Math.max(te,vt.source.y1,vt.target.y1)+u+vt.circularPathData.verticalBuffer,vt.circularPathData.verticalLeftInnerExtent=vt.circularPathData.verticalFullExtent-vt.circularPathData.leftLargeArcRadius,vt.circularPathData.verticalRightInnerExtent=vt.circularPathData.verticalFullExtent-vt.circularPathData.rightLargeArcRadius):(vt.circularPathData.verticalFullExtent=Wt-u-vt.circularPathData.verticalBuffer,vt.circularPathData.verticalLeftInnerExtent=vt.circularPathData.verticalFullExtent+vt.circularPathData.leftLargeArcRadius,vt.circularPathData.verticalRightInnerExtent=vt.circularPathData.verticalFullExtent+vt.circularPathData.rightLargeArcRadius)}vt.circularPathData.leftInnerExtent=vt.circularPathData.sourceX+vt.circularPathData.leftNodeBuffer,vt.circularPathData.rightInnerExtent=vt.circularPathData.targetX-vt.circularPathData.rightNodeBuffer,vt.circularPathData.leftFullExtent=vt.circularPathData.sourceX+vt.circularPathData.leftLargeArcRadius+vt.circularPathData.leftNodeBuffer,vt.circularPathData.rightFullExtent=vt.circularPathData.targetX-vt.circularPathData.rightLargeArcRadius-vt.circularPathData.rightNodeBuffer}if(vt.circular)vt.path=j(vt);else{var Te=A.linkHorizontal().source(function(Se){var Fe=Se.source.x0+(Se.source.x1-Se.source.x0),Oe=Se.y0;return[Fe,Oe]}).target(function(Se){var Fe=Se.target.x0,Oe=Se.y1;return[Fe,Oe]});vt.path=Te(vt)}})}function j(Et){var Nt="";return Et.circularLinkType=="top"?Nt="M"+Et.circularPathData.sourceX+" "+Et.circularPathData.sourceY+" L"+Et.circularPathData.leftInnerExtent+" "+Et.circularPathData.sourceY+" A"+Et.circularPathData.leftLargeArcRadius+" "+Et.circularPathData.leftSmallArcRadius+" 0 0 0 "+Et.circularPathData.leftFullExtent+" "+(Et.circularPathData.sourceY-Et.circularPathData.leftSmallArcRadius)+" L"+Et.circularPathData.leftFullExtent+" "+Et.circularPathData.verticalLeftInnerExtent+" A"+Et.circularPathData.leftLargeArcRadius+" "+Et.circularPathData.leftLargeArcRadius+" 0 0 0 "+Et.circularPathData.leftInnerExtent+" "+Et.circularPathData.verticalFullExtent+" L"+Et.circularPathData.rightInnerExtent+" "+Et.circularPathData.verticalFullExtent+" A"+Et.circularPathData.rightLargeArcRadius+" "+Et.circularPathData.rightLargeArcRadius+" 0 0 0 "+Et.circularPathData.rightFullExtent+" "+Et.circularPathData.verticalRightInnerExtent+" L"+Et.circularPathData.rightFullExtent+" "+(Et.circularPathData.targetY-Et.circularPathData.rightSmallArcRadius)+" A"+Et.circularPathData.rightLargeArcRadius+" "+Et.circularPathData.rightSmallArcRadius+" 0 0 0 "+Et.circularPathData.rightInnerExtent+" "+Et.circularPathData.targetY+" L"+Et.circularPathData.targetX+" "+Et.circularPathData.targetY:Nt="M"+Et.circularPathData.sourceX+" "+Et.circularPathData.sourceY+" L"+Et.circularPathData.leftInnerExtent+" "+Et.circularPathData.sourceY+" A"+Et.circularPathData.leftLargeArcRadius+" "+Et.circularPathData.leftSmallArcRadius+" 0 0 1 "+Et.circularPathData.leftFullExtent+" "+(Et.circularPathData.sourceY+Et.circularPathData.leftSmallArcRadius)+" L"+Et.circularPathData.leftFullExtent+" "+Et.circularPathData.verticalLeftInnerExtent+" A"+Et.circularPathData.leftLargeArcRadius+" "+Et.circularPathData.leftLargeArcRadius+" 0 0 1 "+Et.circularPathData.leftInnerExtent+" "+Et.circularPathData.verticalFullExtent+" L"+Et.circularPathData.rightInnerExtent+" "+Et.circularPathData.verticalFullExtent+" A"+Et.circularPathData.rightLargeArcRadius+" "+Et.circularPathData.rightLargeArcRadius+" 0 0 1 "+Et.circularPathData.rightFullExtent+" "+Et.circularPathData.verticalRightInnerExtent+" L"+Et.circularPathData.rightFullExtent+" "+(Et.circularPathData.targetY+Et.circularPathData.rightSmallArcRadius)+" A"+Et.circularPathData.rightLargeArcRadius+" "+Et.circularPathData.rightSmallArcRadius+" 0 0 1 "+Et.circularPathData.rightInnerExtent+" "+Et.circularPathData.targetY+" L"+Et.circularPathData.targetX+" "+Et.circularPathData.targetY,Nt}function G(Et,Nt){return Z(Et)==Z(Nt)?Et.circularLinkType=="bottom"?ct(Et,Nt):rt(Et,Nt):Z(Nt)-Z(Et)}function rt(Et,Nt){return Et.y0-Nt.y0}function ct(Et,Nt){return Nt.y0-Et.y0}function lt(Et,Nt){return Et.y1-Nt.y1}function tt(Et,Nt){return Nt.y1-Et.y1}function Z(Et){return Et.target.column-Et.source.column}function st(Et){return Et.target.x0-Et.source.x1}function $(Et,Nt){var te=O(Et),Jt=st(Nt)/Math.tan(te),Qt=wt(Et)=="up"?Et.y1+Jt:Et.y1-Jt;return Qt}function Q(Et,Nt){var te=O(Et),Jt=st(Nt)/Math.tan(te),Qt=wt(Et)=="up"?Et.y1-Jt:Et.y1+Jt;return Qt}function nt(Et,Nt,te,Jt){Et.links.forEach(function(Qt){if(!Qt.circular&&Qt.target.column-Qt.source.column>1){var Wt=Qt.source.column+1,gt=Qt.target.column-1,bt=1,vt=gt-Wt+1;for(bt=1;Wt<=gt;Wt++,bt++)Et.nodes.forEach(function(Ut){if(Ut.column==Wt){var Kt=bt/(vt+1),Zt=Math.pow(1-Kt,3),le=3*Kt*Math.pow(1-Kt,2),Te=3*Math.pow(Kt,2)*(1-Kt),Se=Math.pow(Kt,3),Fe=Zt*Qt.y0+le*Qt.y0+Te*Qt.y1+Se*Qt.y1,Oe=Fe-Qt.width/2,ur=Fe+Qt.width/2,fr;Oe>Ut.y0&&Oe<Ut.y1?(fr=Ut.y1-Oe+10,fr=Ut.circularLinkType=="bottom"?fr:-fr,Ut=q(Ut,fr,Nt,te),Et.nodes.forEach(function(We){w(We,Jt)==w(Ut,Jt)||We.column!=Ut.column||Y(Ut,We)&&q(We,fr,Nt,te)})):ur>Ut.y0&&ur<Ut.y1?(fr=ur-Ut.y0+10,Ut=q(Ut,fr,Nt,te),Et.nodes.forEach(function(We){w(We,Jt)==w(Ut,Jt)||We.column!=Ut.column||We.y0<Ut.y1&&We.y1>Ut.y1&&q(We,fr,Nt,te)})):Oe<Ut.y0&&ur>Ut.y1&&(fr=ur-Ut.y0+10,Ut=q(Ut,fr,Nt,te),Et.nodes.forEach(function(We){w(We,Jt)==w(Ut,Jt)||We.column!=Ut.column||We.y0<Ut.y1&&We.y1>Ut.y1&&q(We,fr,Nt,te)}))}})}})}function Y(Et,Nt){return Et.y0>Nt.y0&&Et.y0<Nt.y1||Et.y1>Nt.y0&&Et.y1<Nt.y1?!0:Et.y0<Nt.y0&&Et.y1>Nt.y1}function q(Et,Nt,te,Jt){return Et.y0+Nt>=te&&Et.y1+Nt<=Jt&&(Et.y0=Et.y0+Nt,Et.y1=Et.y1+Nt,Et.targetLinks.forEach(function(Qt){Qt.y1=Qt.y1+Nt}),Et.sourceLinks.forEach(function(Qt){Qt.y0=Qt.y0+Nt})),Et}function ot(Et,Nt,te,Jt){Et.nodes.forEach(function(Qt){Jt&&Qt.y+(Qt.y1-Qt.y0)>Nt&&(Qt.y=Qt.y-(Qt.y+(Qt.y1-Qt.y0)-Nt));var Wt=Et.links.filter(function(vt){return w(vt.source,te)==w(Qt,te)}),gt=Wt.length;gt>1&&Wt.sort(function(vt,Ut){if(!vt.circular&&!Ut.circular){if(vt.target.column==Ut.target.column)return vt.y1-Ut.y1;if(dt(vt,Ut)){if(vt.target.column>Ut.target.column){var Kt=Q(Ut,vt);return vt.y1-Kt}if(Ut.target.column>vt.target.column){var Zt=Q(vt,Ut);return Zt-Ut.y1}}else return vt.y1-Ut.y1}if(vt.circular&&!Ut.circular)return vt.circularLinkType=="top"?-1:1;if(Ut.circular&&!vt.circular)return Ut.circularLinkType=="top"?1:-1;if(vt.circular&&Ut.circular)return vt.circularLinkType===Ut.circularLinkType&&vt.circularLinkType=="top"?vt.target.column===Ut.target.column?vt.target.y1-Ut.target.y1:Ut.target.column-vt.target.column:vt.circularLinkType===Ut.circularLinkType&&vt.circularLinkType=="bottom"?vt.target.column===Ut.target.column?Ut.target.y1-vt.target.y1:vt.target.column-Ut.target.column:vt.circularLinkType=="top"?-1:1});var bt=Qt.y0;Wt.forEach(function(vt){vt.y0=bt+vt.width/2,bt=bt+vt.width}),Wt.forEach(function(vt,Ut){if(vt.circularLinkType=="bottom"){var Kt=Ut+1,Zt=0;for(Kt;Kt<gt;Kt++)Zt=Zt+Wt[Kt].width;vt.y0=Qt.y1-Zt-vt.width/2}})})}function it(Et,Nt,te){Et.nodes.forEach(function(Jt){var Qt=Et.links.filter(function(bt){return w(bt.target,te)==w(Jt,te)}),Wt=Qt.length;Wt>1&&Qt.sort(function(bt,vt){if(!bt.circular&&!vt.circular){if(bt.source.column==vt.source.column)return bt.y0-vt.y0;if(dt(bt,vt)){if(vt.source.column<bt.source.column){var Ut=$(vt,bt);return bt.y0-Ut}if(bt.source.column<vt.source.column){var Kt=$(bt,vt);return Kt-vt.y0}}else return bt.y0-vt.y0}if(bt.circular&&!vt.circular)return bt.circularLinkType=="top"?-1:1;if(vt.circular&&!bt.circular)return vt.circularLinkType=="top"?1:-1;if(bt.circular&&vt.circular)return bt.circularLinkType===vt.circularLinkType&&bt.circularLinkType=="top"?bt.source.column===vt.source.column?bt.source.y1-vt.source.y1:bt.source.column-vt.source.column:bt.circularLinkType===vt.circularLinkType&&bt.circularLinkType=="bottom"?bt.source.column===vt.source.column?bt.source.y1-vt.source.y1:vt.source.column-bt.source.column:bt.circularLinkType=="top"?-1:1});var gt=Jt.y0;Qt.forEach(function(bt){bt.y1=gt+bt.width/2,gt=gt+bt.width}),Qt.forEach(function(bt,vt){if(bt.circularLinkType=="bottom"){var Ut=vt+1,Kt=0;for(Ut;Ut<Wt;Ut++)Kt=Kt+Qt[Ut].width;bt.y1=Jt.y1-Kt-bt.width/2}})})}function dt(Et,Nt){return wt(Et)==wt(Nt)}function wt(Et){return Et.y0-Et.y1>0?"up":"down"}function xt(Et,Nt){return w(Et.source,Nt)==w(Et.target,Nt)}function Ft(Et,Nt,te){var Jt=Et.nodes,Qt=Et.links,Wt=!1,gt=!1;if(Qt.forEach(function(le){le.circularLinkType=="top"?Wt=!0:le.circularLinkType=="bottom"&&(gt=!0)}),Wt==!1||gt==!1){var bt=g.min(Jt,function(le){return le.y0}),vt=g.max(Jt,function(le){return le.y1}),Ut=vt-bt,Kt=te-Nt,Zt=Kt/Ut;Jt.forEach(function(le){var Te=(le.y1-le.y0)*Zt;le.y0=(le.y0-bt)*Zt,le.y1=le.y0+Te}),Qt.forEach(function(le){le.y0=(le.y0-bt)*Zt,le.y1=(le.y1-bt)*Zt,le.width=le.width*Zt})}}c.sankeyCircular=_,c.sankeyCenter=o,c.sankeyLeft=r,c.sankeyRight=i,c.sankeyJustify=n,Object.defineProperty(c,"__esModule",{value:!0})})}),P5=Vt((X,V)=>{V.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}),wL=Vt((X,V)=>{var c=vL(),g=(M0(),xd(Rd)).interpolateNumber,E=Ai(),A=xL(),t=bL(),e=P5(),r=yh(),i=vi(),n=go(),o=qr(),a=o.strTranslate,s=o.strRotate,h=Ap(),v=h.keyFun,m=h.repeat,p=h.unwrap,y=sl(),l=Mi(),x=nh(),b=x.CAP_SHIFT,S=x.LINE_SPACING,T=3;function M($,Q,nt){var Y=p(Q),q=Y.trace,ot=q.domain,it=q.orientation==="h",dt=q.node.pad,wt=q.node.thickness,xt={justify:A.sankeyJustify,left:A.sankeyLeft,right:A.sankeyRight,center:A.sankeyCenter}[q.node.align],Ft=$.width*(ot.x[1]-ot.x[0]),Et=$.height*(ot.y[1]-ot.y[0]),Nt=Y._nodes,te=Y._links,Jt=Y.circular,Qt;Jt?Qt=t.sankeyCircular().circularLinkGap(0):Qt=A.sankey(),Qt.iterations(e.sankeyIterations).size(it?[Ft,Et]:[Et,Ft]).nodeWidth(wt).nodePadding(dt).nodeId(function(We){return We.pointNumber}).nodeAlign(xt).nodes(Nt).links(te);var Wt=Qt();Qt.nodePadding()<dt&&o.warn("node.pad was reduced to ",Qt.nodePadding()," to fit within the figure.");var gt,bt,vt;for(var Ut in Y._groupLookup){var Kt=parseInt(Y._groupLookup[Ut]),Zt;for(gt=0;gt<Wt.nodes.length;gt++)if(Wt.nodes[gt].pointNumber===Kt){Zt=Wt.nodes[gt];break}if(Zt){var le={pointNumber:parseInt(Ut),x0:Zt.x0,x1:Zt.x1,y0:Zt.y0,y1:Zt.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};Wt.nodes.unshift(le),Zt.childrenNodes.unshift(le)}}function Te(){for(gt=0;gt<Wt.nodes.length;gt++){var We=Wt.nodes[gt],Lr={},kr,he;for(bt=0;bt<We.targetLinks.length;bt++)he=We.targetLinks[bt],kr=he.source.pointNumber+":"+he.target.pointNumber,Lr.hasOwnProperty(kr)||(Lr[kr]=[]),Lr[kr].push(he);var Dt=Object.keys(Lr);for(bt=0;bt<Dt.length;bt++){kr=Dt[bt];var qt=Lr[kr],zt=0,ut={};for(vt=0;vt<qt.length;vt++)he=qt[vt],ut[he.label]||(ut[he.label]=0),ut[he.label]+=he.value,zt+=he.value;for(vt=0;vt<qt.length;vt++)he=qt[vt],he.flow={value:zt,labelConcentration:ut[he.label]/zt,concentration:he.value/zt,links:qt},he.concentrationscale&&(he.color=r(he.concentrationscale(he.flow.labelConcentration)))}var yt=0;for(bt=0;bt<We.sourceLinks.length;bt++)yt+=We.sourceLinks[bt].value;for(bt=0;bt<We.sourceLinks.length;bt++)he=We.sourceLinks[bt],he.concentrationOut=he.value/yt;var Mt=0;for(bt=0;bt<We.targetLinks.length;bt++)Mt+=We.targetLinks[bt].value;for(bt=0;bt<We.targetLinks.length;bt++)he=We.targetLinks[bt],he.concenrationIn=he.value/Mt}}Te();function Se(We){We.forEach(function(Lr){var kr,he,Dt=0,qt=Lr.length,zt;for(Lr.sort(function(ut,yt){return ut.y0-yt.y0}),zt=0;zt<qt;++zt)kr=Lr[zt],kr.y0>=Dt||(he=Dt-kr.y0,he>1e-6&&(kr.y0+=he,kr.y1+=he)),Dt=kr.y1+dt})}function Fe(We){var Lr=We.map(function(yt,Mt){return{x0:yt.x0,index:Mt}}).sort(function(yt,Mt){return yt.x0-Mt.x0}),kr=[],he=-1,Dt,qt=-1/0,zt;for(gt=0;gt<Lr.length;gt++){var ut=We[Lr[gt].index];ut.x0>qt+wt&&(he+=1,Dt=ut.x0),qt=ut.x0,kr[he]||(kr[he]=[]),kr[he].push(ut),zt=Dt-ut.x0,ut.x0+=zt,ut.x1+=zt}return kr}if(q.node.x.length&&q.node.y.length){for(gt=0;gt<Math.min(q.node.x.length,q.node.y.length,Wt.nodes.length);gt++)if(q.node.x[gt]&&q.node.y[gt]){var Oe=[q.node.x[gt]*Ft,q.node.y[gt]*Et];Wt.nodes[gt].x0=Oe[0]-wt/2,Wt.nodes[gt].x1=Oe[0]+wt/2;var ur=Wt.nodes[gt].y1-Wt.nodes[gt].y0;Wt.nodes[gt].y0=Oe[1]-ur/2,Wt.nodes[gt].y1=Oe[1]+ur/2}if(q.arrangement==="snap"){Nt=Wt.nodes;var fr=Fe(Nt);Se(fr)}Qt.update(Wt)}return{circular:Jt,key:nt,trace:q,guid:o.randstr(),horizontal:it,width:Ft,height:Et,nodePad:q.node.pad,nodeLineColor:q.node.line.color,nodeLineWidth:q.node.line.width,linkLineColor:q.link.line.color,linkLineWidth:q.link.line.width,linkArrowLength:q.link.arrowlen,valueFormat:q.valueformat,valueSuffix:q.valuesuffix,textFont:q.textfont,translateX:ot.x[0]*$.width+$.margin.l,translateY:$.height-ot.y[1]*$.height+$.margin.t,dragParallel:it?Et:Ft,dragPerpendicular:it?Ft:Et,arrangement:q.arrangement,sankey:Qt,graph:Wt,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function w($,Q,nt){var Y=r(Q.color),q=r(Q.hovercolor),ot=Q.source.label+"|"+Q.target.label,it=ot+"__"+nt;return Q.trace=$.trace,Q.curveNumber=$.trace.index,{circular:$.circular,key:it,traceId:$.key,pointNumber:Q.pointNumber,link:Q,tinyColorHue:i.tinyRGB(Y),tinyColorAlpha:Y.getAlpha(),tinyColorHoverHue:i.tinyRGB(q),tinyColorHoverAlpha:q.getAlpha(),linkPath:f,linkLineColor:$.linkLineColor,linkLineWidth:$.linkLineWidth,linkArrowLength:$.linkArrowLength,valueFormat:$.valueFormat,valueSuffix:$.valueSuffix,sankey:$.sankey,parent:$,interactionState:$.interactionState,flow:Q.flow}}function u($,Q){var nt="",Y=$.width/2,q=$.circularPathData,ot=q.sourceX+q.verticalBuffer<q.targetX,it=q.rightFullExtent-q.rightLargeArcRadius-Q<=q.leftFullExtent-Y;return Math.abs(q.rightFullExtent-q.leftFullExtent-Y)<Y,$.circularLinkType==="top"?(nt="M "+(q.targetX-Q)+" "+(q.targetY+Y)+" L "+(q.rightInnerExtent-Q)+" "+(q.targetY+Y)+"A "+(q.rightLargeArcRadius+Y)+" "+(q.rightSmallArcRadius+Y)+" 0 0 1 "+(q.rightFullExtent-Y-Q)+" "+(q.targetY-q.rightSmallArcRadius)+"L "+(q.rightFullExtent-Y-Q)+" "+q.verticalRightInnerExtent,ot&&it?nt+=" A "+(q.rightLargeArcRadius+Y)+" "+(q.rightLargeArcRadius+Y)+" 0 0 1 "+(q.rightFullExtent+Y-Q-(q.rightLargeArcRadius-Y))+" "+(q.verticalRightInnerExtent-(q.rightLargeArcRadius+Y))+" L "+(q.rightFullExtent+Y-(q.rightLargeArcRadius-Y)-Q)+" "+(q.verticalRightInnerExtent-(q.rightLargeArcRadius+Y))+" A "+(q.leftLargeArcRadius+Y)+" "+(q.leftLargeArcRadius+Y)+" 0 0 1 "+(q.leftFullExtent+Y)+" "+q.verticalRightInnerExtent:ot?nt+=" A "+(q.rightLargeArcRadius-Y)+" "+(q.rightLargeArcRadius-Y)+" 0 0 0 "+(q.rightFullExtent-Y-Q-(q.rightLargeArcRadius-Y))+" "+(q.verticalRightInnerExtent-(q.rightLargeArcRadius-Y))+" L "+(q.leftFullExtent+Y+(q.rightLargeArcRadius-Y))+" "+(q.verticalRightInnerExtent-(q.rightLargeArcRadius-Y))+" A "+(q.leftLargeArcRadius-Y)+" "+(q.leftLargeArcRadius-Y)+" 0 0 0 "+(q.leftFullExtent+Y)+" "+q.verticalLeftInnerExtent:nt+=" A "+(q.rightLargeArcRadius+Y)+" "+(q.rightLargeArcRadius+Y)+" 0 0 1 "+(q.rightInnerExtent-Q)+" "+(q.verticalFullExtent-Y)+" L "+q.leftInnerExtent+" "+(q.verticalFullExtent-Y)+" A "+(q.leftLargeArcRadius+Y)+" "+(q.leftLargeArcRadius+Y)+" 0 0 1 "+(q.leftFullExtent+Y)+" "+q.verticalLeftInnerExtent,nt+=" L "+(q.leftFullExtent+Y)+" "+(q.sourceY-q.leftSmallArcRadius)+" A "+(q.leftLargeArcRadius+Y)+" "+(q.leftSmallArcRadius+Y)+" 0 0 1 "+q.leftInnerExtent+" "+(q.sourceY+Y)+" L "+q.sourceX+" "+(q.sourceY+Y)+" L "+q.sourceX+" "+(q.sourceY-Y)+" L "+q.leftInnerExtent+" "+(q.sourceY-Y)+" A "+(q.leftLargeArcRadius-Y)+" "+(q.leftSmallArcRadius-Y)+" 0 0 0 "+(q.leftFullExtent-Y)+" "+(q.sourceY-q.leftSmallArcRadius)+" L "+(q.leftFullExtent-Y)+" "+q.verticalLeftInnerExtent,ot&&it?nt+=" A "+(q.leftLargeArcRadius+Y)+" "+(q.leftSmallArcRadius+Y)+" 0 0 0 "+(q.leftFullExtent-Y)+" "+(q.verticalFullExtent+Y)+"L"+(q.rightFullExtent+Y-Q)+" "+(q.verticalFullExtent+Y)+" A "+(q.leftLargeArcRadius+Y)+" "+(q.leftSmallArcRadius+Y)+" 0 0 0 "+(q.rightFullExtent+Y-Q)+" "+q.verticalRightInnerExtent:ot?nt+=" A "+(q.leftLargeArcRadius+Y)+" "+(q.leftSmallArcRadius+Y)+" 0 0 1 "+(q.leftFullExtent+Y)+" "+(q.verticalFullExtent-Y)+" L "+(q.rightFullExtent-Y-Q)+" "+(q.verticalFullExtent-Y)+" A "+(q.leftLargeArcRadius+Y)+" "+(q.leftSmallArcRadius+Y)+" 0 0 1 "+(q.rightFullExtent+Y-Q)+" "+q.verticalRightInnerExtent:nt+=" A "+(q.leftLargeArcRadius-Y)+" "+(q.leftLargeArcRadius-Y)+" 0 0 0 "+q.leftInnerExtent+" "+(q.verticalFullExtent+Y)+" L "+(q.rightInnerExtent-Q)+" "+(q.verticalFullExtent+Y)+" A "+(q.rightLargeArcRadius-Y)+" "+(q.rightLargeArcRadius-Y)+" 0 0 0 "+(q.rightFullExtent+Y-Q)+" "+q.verticalRightInnerExtent,nt+=" L "+(q.rightFullExtent+Y-Q)+" "+(q.targetY-q.rightSmallArcRadius)+" A "+(q.rightLargeArcRadius-Y)+" "+(q.rightSmallArcRadius-Y)+" 0 0 0 "+(q.rightInnerExtent-Q)+" "+(q.targetY-Y)+" L "+(q.targetX-Q)+" "+(q.targetY-Y)+(Q>0?" L "+q.targetX+" "+q.targetY:"")+"Z"):(nt="M "+(q.targetX-Q)+" "+(q.targetY-Y)+" L "+(q.rightInnerExtent-Q)+" "+(q.targetY-Y)+" A "+(q.rightLargeArcRadius+Y)+" "+(q.rightSmallArcRadius+Y)+" 0 0 0 "+(q.rightFullExtent-Y-Q)+" "+(q.targetY+q.rightSmallArcRadius)+" L "+(q.rightFullExtent-Y-Q)+" "+q.verticalRightInnerExtent,ot&&it?nt+=" A "+(q.rightLargeArcRadius+Y)+" "+(q.rightLargeArcRadius+Y)+" 0 0 0 "+(q.rightInnerExtent-Y-Q)+" "+(q.verticalFullExtent+Y)+" L "+(q.rightFullExtent+Y-Q-(q.rightLargeArcRadius-Y))+" "+(q.verticalFullExtent+Y)+" A "+(q.rightLargeArcRadius+Y)+" "+(q.rightLargeArcRadius+Y)+" 0 0 0 "+(q.leftFullExtent+Y)+" "+q.verticalLeftInnerExtent:ot?nt+=" A "+(q.rightLargeArcRadius-Y)+" "+(q.rightSmallArcRadius-Y)+" 0 0 1 "+(q.rightFullExtent-Q-Y-(q.rightLargeArcRadius-Y))+" "+(q.verticalFullExtent-Y)+" L "+(q.leftFullExtent+Y+(q.rightLargeArcRadius-Y))+" "+(q.verticalFullExtent-Y)+" A "+(q.rightLargeArcRadius-Y)+" "+(q.rightSmallArcRadius-Y)+" 0 0 1 "+(q.leftFullExtent+Y)+" "+q.verticalLeftInnerExtent:nt+=" A "+(q.rightLargeArcRadius+Y)+" "+(q.rightLargeArcRadius+Y)+" 0 0 0 "+(q.rightInnerExtent-Q)+" "+(q.verticalFullExtent+Y)+" L "+q.leftInnerExtent+" "+(q.verticalFullExtent+Y)+" A "+(q.leftLargeArcRadius+Y)+" "+(q.leftLargeArcRadius+Y)+" 0 0 0 "+(q.leftFullExtent+Y)+" "+q.verticalLeftInnerExtent,nt+=" L "+(q.leftFullExtent+Y)+" "+(q.sourceY+q.leftSmallArcRadius)+" A "+(q.leftLargeArcRadius+Y)+" "+(q.leftSmallArcRadius+Y)+" 0 0 0 "+q.leftInnerExtent+" "+(q.sourceY-Y)+" L "+q.sourceX+" "+(q.sourceY-Y)+" L "+q.sourceX+" "+(q.sourceY+Y)+" L "+q.leftInnerExtent+" "+(q.sourceY+Y)+" A "+(q.leftLargeArcRadius-Y)+" "+(q.leftSmallArcRadius-Y)+" 0 0 1 "+(q.leftFullExtent-Y)+" "+(q.sourceY+q.leftSmallArcRadius)+" L "+(q.leftFullExtent-Y)+" "+q.verticalLeftInnerExtent,ot&&it?nt+=" A "+(q.rightLargeArcRadius-Y)+" "+(q.rightSmallArcRadius-Y)+" 0 0 1 "+(q.leftFullExtent-Y-(q.rightLargeArcRadius-Y))+" "+(q.verticalFullExtent-Y)+" L "+(q.rightFullExtent+Y-Q+(q.rightLargeArcRadius-Y))+" "+(q.verticalFullExtent-Y)+" A "+(q.rightLargeArcRadius-Y)+" "+(q.rightSmallArcRadius-Y)+" 0 0 1 "+(q.rightFullExtent+Y-Q)+" "+q.verticalRightInnerExtent:ot?nt+=" A "+(q.rightLargeArcRadius+Y)+" "+(q.rightLargeArcRadius+Y)+" 0 0 0 "+(q.leftFullExtent+Y)+" "+(q.verticalFullExtent+Y)+" L "+(q.rightFullExtent-Q-Y)+" "+(q.verticalFullExtent+Y)+" A "+(q.rightLargeArcRadius+Y)+" "+(q.rightLargeArcRadius+Y)+" 0 0 0 "+(q.rightFullExtent+Y-Q)+" "+q.verticalRightInnerExtent:nt+=" A "+(q.leftLargeArcRadius-Y)+" "+(q.leftLargeArcRadius-Y)+" 0 0 1 "+q.leftInnerExtent+" "+(q.verticalFullExtent-Y)+" L "+(q.rightInnerExtent-Q)+" "+(q.verticalFullExtent-Y)+" A "+(q.rightLargeArcRadius-Y)+" "+(q.rightLargeArcRadius-Y)+" 0 0 1 "+(q.rightFullExtent+Y-Q)+" "+q.verticalRightInnerExtent,nt+=" L "+(q.rightFullExtent+Y-Q)+" "+(q.targetY+q.rightSmallArcRadius)+" A "+(q.rightLargeArcRadius-Y)+" "+(q.rightSmallArcRadius-Y)+" 0 0 1 "+(q.rightInnerExtent-Q)+" "+(q.targetY+Y)+" L "+(q.targetX-Q)+" "+(q.targetY+Y)+(Q>0?" L "+q.targetX+" "+q.targetY:"")+"Z"),nt}function f(){var $=.5;function Q(nt){var Y=nt.linkArrowLength;if(nt.link.circular)return u(nt.link,Y);var q=Math.abs((nt.link.target.x0-nt.link.source.x1)/2);Y>q&&(Y=q);var ot=nt.link.source.x1,it=nt.link.target.x0-Y,dt=g(ot,it),wt=dt($),xt=dt(1-$),Ft=nt.link.y0-nt.link.width/2,Et=nt.link.y0+nt.link.width/2,Nt=nt.link.y1-nt.link.width/2,te=nt.link.y1+nt.link.width/2,Jt="M"+ot+","+Ft,Qt="C"+wt+","+Ft+" "+xt+","+Nt+" "+it+","+Nt,Wt="C"+xt+","+te+" "+wt+","+Et+" "+ot+","+Et,gt=Y>0?"L"+(it+Y)+","+(Nt+nt.link.width/2):"";return gt+="L"+it+","+te,Jt+Qt+gt+Wt+"Z"}return Q}function k($,Q){var nt=r(Q.color),Y=e.nodePadAcross,q=$.nodePad/2;Q.dx=Q.x1-Q.x0,Q.dy=Q.y1-Q.y0;var ot=Q.dx,it=Math.max(.5,Q.dy),dt="node_"+Q.pointNumber;return Q.group&&(dt=o.randstr()),Q.trace=$.trace,Q.curveNumber=$.trace.index,{index:Q.pointNumber,key:dt,partOfGroup:Q.partOfGroup||!1,group:Q.group,traceId:$.key,trace:$.trace,node:Q,nodePad:$.nodePad,nodeLineColor:$.nodeLineColor,nodeLineWidth:$.nodeLineWidth,textFont:$.textFont,size:$.horizontal?$.height:$.width,visibleWidth:Math.ceil(ot),visibleHeight:it,zoneX:-Y,zoneY:-q,zoneWidth:ot+2*Y,zoneHeight:it+2*q,labelY:$.horizontal?Q.dy/2+1:Q.dx/2+1,left:Q.originalLayer===1,sizeAcross:$.width,forceLayouts:$.forceLayouts,horizontal:$.horizontal,darkBackground:nt.getBrightness()<=128,tinyColorHue:i.tinyRGB(nt),tinyColorAlpha:nt.getAlpha(),valueFormat:$.valueFormat,valueSuffix:$.valueSuffix,sankey:$.sankey,graph:$.graph,arrangement:$.arrangement,uniqueNodeLabelPathId:[$.guid,$.key,dt].join("_"),interactionState:$.interactionState,figure:$}}function _($){$.attr("transform",function(Q){return a(Q.node.x0.toFixed(3),Q.node.y0.toFixed(3))})}function D($){$.call(_)}function I($,Q){$.call(D),Q.attr("d",f())}function O($){$.attr("width",function(Q){return Q.node.x1-Q.node.x0}).attr("height",function(Q){return Q.visibleHeight})}function B($){return $.link.width>1||$.linkLineWidth>0}function R($){var Q=a($.translateX,$.translateY);return Q+($.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function L($,Q,nt){$.on(".basic",null).on("mouseover.basic",function(Y){!Y.interactionState.dragInProgress&&!Y.partOfGroup&&(nt.hover(this,Y,Q),Y.interactionState.hovered=[this,Y])}).on("mousemove.basic",function(Y){!Y.interactionState.dragInProgress&&!Y.partOfGroup&&(nt.follow(this,Y),Y.interactionState.hovered=[this,Y])}).on("mouseout.basic",function(Y){!Y.interactionState.dragInProgress&&!Y.partOfGroup&&(nt.unhover(this,Y,Q),Y.interactionState.hovered=!1)}).on("click.basic",function(Y){Y.interactionState.hovered&&(nt.unhover(this,Y,Q),Y.interactionState.hovered=!1),!Y.interactionState.dragInProgress&&!Y.partOfGroup&&nt.select(this,Y,Q)})}function F($,Q,nt,Y){var q=E.behavior.drag().origin(function(ot){return{x:ot.node.x0+ot.visibleWidth/2,y:ot.node.y0+ot.visibleHeight/2}}).on("dragstart",function(ot){if(ot.arrangement!=="fixed"&&(o.ensureSingle(Y._fullLayout._infolayer,"g","dragcover",function(dt){Y._fullLayout._dragCover=dt}),o.raiseToTop(this),ot.interactionState.dragInProgress=ot.node,lt(ot.node),ot.interactionState.hovered&&(nt.nodeEvents.unhover.apply(0,ot.interactionState.hovered),ot.interactionState.hovered=!1),ot.arrangement==="snap")){var it=ot.traceId+"|"+ot.key;ot.forceLayouts[it]?ot.forceLayouts[it].alpha(1):N($,it,ot),j($,Q,ot,it,Y)}}).on("drag",function(ot){if(ot.arrangement!=="fixed"){var it=E.event.x,dt=E.event.y;ot.arrangement==="snap"?(ot.node.x0=it-ot.visibleWidth/2,ot.node.x1=it+ot.visibleWidth/2,ot.node.y0=dt-ot.visibleHeight/2,ot.node.y1=dt+ot.visibleHeight/2):(ot.arrangement==="freeform"&&(ot.node.x0=it-ot.visibleWidth/2,ot.node.x1=it+ot.visibleWidth/2),dt=Math.max(0,Math.min(ot.size-ot.visibleHeight/2,dt)),ot.node.y0=dt-ot.visibleHeight/2,ot.node.y1=dt+ot.visibleHeight/2),lt(ot.node),ot.arrangement!=="snap"&&(ot.sankey.update(ot.graph),I($.filter(tt(ot)),Q))}}).on("dragend",function(ot){if(ot.arrangement!=="fixed"){ot.interactionState.dragInProgress=!1;for(var it=0;it<ot.node.childrenNodes.length;it++)ot.node.childrenNodes[it].x=ot.node.x,ot.node.childrenNodes[it].y=ot.node.y;ot.arrangement!=="snap"&&rt(ot,Y)}});$.on(".drag",null).call(q)}function N($,Q,nt,Y){Z(nt.graph.nodes);var q=nt.graph.nodes.filter(function(ot){return ot.originalX===nt.node.originalX}).filter(function(ot){return!ot.partOfGroup});nt.forceLayouts[Q]=c.forceSimulation(q).alphaDecay(0).force("collide",c.forceCollide().radius(function(ot){return ot.dy/2+nt.nodePad/2}).strength(1).iterations(e.forceIterations)).force("constrain",G($,Q,q,nt)).stop()}function j($,Q,nt,Y,q){window.requestAnimationFrame(function ot(){var it;for(it=0;it<e.forceTicksPerFrame;it++)nt.forceLayouts[Y].tick();var dt=nt.graph.nodes;if(st(dt),nt.sankey.update(nt.graph),I($.filter(tt(nt)),Q),nt.forceLayouts[Y].alpha()>0)window.requestAnimationFrame(ot);else{var wt=nt.node.originalX;nt.node.x0=wt-nt.visibleWidth/2,nt.node.x1=wt+nt.visibleWidth/2,rt(nt,q)}})}function G($,Q,nt,Y){return function(){for(var q=0,ot=0;ot<nt.length;ot++){var it=nt[ot];it===Y.interactionState.dragInProgress?(it.x=it.lastDraggedX,it.y=it.lastDraggedY):(it.vx=(it.originalX-it.x)/e.forceTicksPerFrame,it.y=Math.min(Y.size-it.dy/2,Math.max(it.dy/2,it.y))),q=Math.max(q,Math.abs(it.vx),Math.abs(it.vy))}!Y.interactionState.dragInProgress&&q<.1&&Y.forceLayouts[Q].alpha()>0&&Y.forceLayouts[Q].alpha(0)}}function rt($,Q){for(var nt=[],Y=[],q=0;q<$.graph.nodes.length;q++){var ot=($.graph.nodes[q].x0+$.graph.nodes[q].x1)/2,it=($.graph.nodes[q].y0+$.graph.nodes[q].y1)/2;nt.push(ot/$.figure.width),Y.push(it/$.figure.height)}l.call("_guiRestyle",Q,{"node.x":[nt],"node.y":[Y]},$.trace.index).then(function(){Q._fullLayout._dragCover&&Q._fullLayout._dragCover.remove()})}function ct($){var Q=[],nt;for(nt=0;nt<$.length;nt++)$[nt].originalX=($[nt].x0+$[nt].x1)/2,$[nt].originalY=($[nt].y0+$[nt].y1)/2,Q.indexOf($[nt].originalX)===-1&&Q.push($[nt].originalX);for(Q.sort(function(Y,q){return Y-q}),nt=0;nt<$.length;nt++)$[nt].originalLayerIndex=Q.indexOf($[nt].originalX),$[nt].originalLayer=$[nt].originalLayerIndex/(Q.length-1)}function lt($){$.lastDraggedX=$.x0+$.dx/2,$.lastDraggedY=$.y0+$.dy/2}function tt($){return function(Q){return Q.node.originalX===$.node.originalX}}function Z($){for(var Q=0;Q<$.length;Q++)$[Q].y=($[Q].y0+$[Q].y1)/2,$[Q].x=($[Q].x0+$[Q].x1)/2}function st($){for(var Q=0;Q<$.length;Q++)$[Q].y0=$[Q].y-$[Q].dy/2,$[Q].y1=$[Q].y0+$[Q].dy,$[Q].x0=$[Q].x-$[Q].dx/2,$[Q].x1=$[Q].x0+$[Q].dx}V.exports=function($,Q,nt,Y,q){var ot=$._context.staticPlot,it=!1;o.ensureSingle($._fullLayout._infolayer,"g","first-render",function(){it=!0});var dt=$._fullLayout._dragCover,wt=nt.filter(function(Wt){return p(Wt).trace.visible}).map(M.bind(null,Y)),xt=Q.selectAll("."+e.cn.sankey).data(wt,v);xt.exit().remove(),xt.enter().append("g").classed(e.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events",ot?"none":"auto").attr("transform",R),xt.each(function(Wt,gt){$._fullData[gt]._sankey=Wt;var bt="bgsankey-"+Wt.trace.uid+"-"+gt;o.ensureSingle($._fullLayout._draggers,"rect",bt),$._fullData[gt]._bgRect=E.select("."+bt),$._fullData[gt]._bgRect.style("pointer-events",ot?"none":"all").attr("width",Wt.width).attr("height",Wt.height).attr("x",Wt.translateX).attr("y",Wt.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})}),xt.transition().ease(e.ease).duration(e.duration).attr("transform",R);var Ft=xt.selectAll("."+e.cn.sankeyLinks).data(m,v);Ft.enter().append("g").classed(e.cn.sankeyLinks,!0).style("fill","none");var Et=Ft.selectAll("."+e.cn.sankeyLink).data(function(Wt){var gt=Wt.graph.links;return gt.filter(function(bt){return bt.value}).map(w.bind(null,Wt))},v);Et.enter().append("path").classed(e.cn.sankeyLink,!0).call(L,xt,q.linkEvents),Et.style("stroke",function(Wt){return B(Wt)?i.tinyRGB(r(Wt.linkLineColor)):Wt.tinyColorHue}).style("stroke-opacity",function(Wt){return B(Wt)?i.opacity(Wt.linkLineColor):Wt.tinyColorAlpha}).style("fill",function(Wt){return Wt.tinyColorHue}).style("fill-opacity",function(Wt){return Wt.tinyColorAlpha}).style("stroke-width",function(Wt){return B(Wt)?Wt.linkLineWidth:1}).attr("d",f()),Et.style("opacity",function(){return $._context.staticPlot||it||dt?1:0}).transition().ease(e.ease).duration(e.duration).style("opacity",1),Et.exit().transition().ease(e.ease).duration(e.duration).style("opacity",0).remove();var Nt=xt.selectAll("."+e.cn.sankeyNodeSet).data(m,v);Nt.enter().append("g").classed(e.cn.sankeyNodeSet,!0),Nt.style("cursor",function(Wt){switch(Wt.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var te=Nt.selectAll("."+e.cn.sankeyNode).data(function(Wt){var gt=Wt.graph.nodes;return ct(gt),gt.map(k.bind(null,Wt))},v);te.enter().append("g").classed(e.cn.sankeyNode,!0).call(_).style("opacity",function(Wt){return($._context.staticPlot||it)&&!Wt.partOfGroup?1:0}),te.call(L,xt,q.nodeEvents).call(F,Et,q,$),te.transition().ease(e.ease).duration(e.duration).call(_).style("opacity",function(Wt){return Wt.partOfGroup?0:1}),te.exit().transition().ease(e.ease).duration(e.duration).style("opacity",0).remove();var Jt=te.selectAll("."+e.cn.nodeRect).data(m);Jt.enter().append("rect").classed(e.cn.nodeRect,!0).call(O),Jt.style("stroke-width",function(Wt){return Wt.nodeLineWidth}).style("stroke",function(Wt){return i.tinyRGB(r(Wt.nodeLineColor))}).style("stroke-opacity",function(Wt){return i.opacity(Wt.nodeLineColor)}).style("fill",function(Wt){return Wt.tinyColorHue}).style("fill-opacity",function(Wt){return Wt.tinyColorAlpha}),Jt.transition().ease(e.ease).duration(e.duration).call(O);var Qt=te.selectAll("."+e.cn.nodeLabel).data(m);Qt.enter().append("text").classed(e.cn.nodeLabel,!0).style("cursor","default"),Qt.attr("data-notex",1).text(function(Wt){return Wt.node.label}).each(function(Wt){var gt=E.select(this);n.font(gt,Wt.textFont),y.convertToTspans(gt,$)}).attr("text-anchor",function(Wt){return Wt.horizontal&&Wt.left?"end":"start"}).attr("transform",function(Wt){var gt=E.select(this),bt=y.lineCount(gt),vt=Wt.textFont.size*((bt-1)*S-b),Ut=Wt.nodeLineWidth/2+T,Kt=((Wt.horizontal?Wt.visibleHeight:Wt.visibleWidth)-vt)/2;Wt.horizontal&&(Wt.left?Ut=-Ut:Ut+=Wt.visibleWidth);var Zt=Wt.horizontal?"":"scale(-1,1)"+s(90);return a(Wt.horizontal?Ut:Kt,Wt.horizontal?Kt:Ut)+Zt}),Qt.transition().ease(e.ease).duration(e.duration)}}),I5=Vt((X,V)=>{var c=Ai(),g=qr(),E=g.numberFormat,A=wL(),t=Hu(),e=vi(),r=P5().cn,i=g._;function n(b){return b!==""}function o(b,S){return b.filter(function(T){return T.key===S.traceId})}function a(b,S){c.select(b).select("path").style("fill-opacity",S),c.select(b).select("rect").style("fill-opacity",S)}function s(b){c.select(b).select("text.name").style("fill","black")}function h(b){return function(S){return b.node.sourceLinks.indexOf(S.link)!==-1||b.node.targetLinks.indexOf(S.link)!==-1}}function v(b){return function(S){return S.node.sourceLinks.indexOf(b.link)!==-1||S.node.targetLinks.indexOf(b.link)!==-1}}function m(b,S,T){S&&T&&o(T,S).selectAll("."+r.sankeyLink).filter(h(S)).call(y.bind(0,S,T,!1))}function p(b,S,T){S&&T&&o(T,S).selectAll("."+r.sankeyLink).filter(h(S)).call(l.bind(0,S,T,!1))}function y(b,S,T,M){M.style("fill",function(w){if(!w.link.concentrationscale)return w.tinyColorHoverHue}).style("fill-opacity",function(w){if(!w.link.concentrationscale)return w.tinyColorHoverAlpha}),M.each(function(w){var u=w.link.label;u!==""&&o(S,b).selectAll("."+r.sankeyLink).filter(function(f){return f.link.label===u}).style("fill",function(f){if(!f.link.concentrationscale)return f.tinyColorHoverHue}).style("fill-opacity",function(f){if(!f.link.concentrationscale)return f.tinyColorHoverAlpha})}),T&&o(S,b).selectAll("."+r.sankeyNode).filter(v(b)).call(m)}function l(b,S,T,M){M.style("fill",function(w){return w.tinyColorHue}).style("fill-opacity",function(w){return w.tinyColorAlpha}),M.each(function(w){var u=w.link.label;u!==""&&o(S,b).selectAll("."+r.sankeyLink).filter(function(f){return f.link.label===u}).style("fill",function(f){return f.tinyColorHue}).style("fill-opacity",function(f){return f.tinyColorAlpha})}),T&&o(S,b).selectAll(r.sankeyNode).filter(v(b)).call(p)}function x(b,S){var T=b.hoverlabel||{},M=g.nestedProperty(T,S).get();return Array.isArray(M)?!1:M}V.exports=function(b,S){for(var T=b._fullLayout,M=T._paper,w=T._size,u=0;u<b._fullData.length;u++)if(b._fullData[u].visible&&b._fullData[u].type===r.sankey&&!b._fullData[u]._viewInitial){var f=b._fullData[u].node;b._fullData[u]._viewInitial={node:{groups:f.groups.slice(),x:f.x.slice(),y:f.y.slice()}}}var k=function(ct,lt){var tt=lt.link;tt.originalEvent=c.event,b._hoverdata=[tt],t.click(b,{target:!0})},_=function(ct,lt,tt){b._fullLayout.hovermode!==!1&&(c.select(ct).call(y.bind(0,lt,tt,!0)),lt.link.trace.link.hoverinfo!=="skip"&&(lt.link.fullData=lt.link.trace,b.emit("plotly_hover",{event:c.event,points:[lt.link]})))},D=i(b,"source:")+" ",I=i(b,"target:")+" ",O=i(b,"concentration:")+" ",B=i(b,"incoming flow count:")+" ",R=i(b,"outgoing flow count:")+" ",L=function(ct,lt){if(b._fullLayout.hovermode===!1)return;var tt=lt.link.trace.link;if(tt.hoverinfo==="none"||tt.hoverinfo==="skip")return;var Z=[];function st(it){var dt,wt;it.circular?(dt=(it.circularPathData.leftInnerExtent+it.circularPathData.rightInnerExtent)/2,wt=it.circularPathData.verticalFullExtent):(dt=(it.source.x1+it.target.x0)/2,wt=(it.y0+it.y1)/2);var xt=[dt,wt];return it.trace.orientation==="v"&&xt.reverse(),xt[0]+=lt.parent.translateX,xt[1]+=lt.parent.translateY,xt}for(var $=0,Q=0;Q<lt.flow.links.length;Q++){var nt=lt.flow.links[Q];if(!(b._fullLayout.hovermode==="closest"&<.link.pointNumber!==nt.pointNumber)){lt.link.pointNumber===nt.pointNumber&&($=Q),nt.fullData=nt.trace,tt=lt.link.trace.link;var Y=st(nt),q={valueLabel:E(lt.valueFormat)(nt.value)+lt.valueSuffix};Z.push({x:Y[0],y:Y[1],name:q.valueLabel,text:[nt.label||"",D+nt.source.label,I+nt.target.label,nt.concentrationscale?O+E("%0.2f")(nt.flow.labelConcentration):""].filter(n).join("<br>"),color:x(tt,"bgcolor")||e.addOpacity(nt.color,1),borderColor:x(tt,"bordercolor"),fontFamily:x(tt,"font.family"),fontSize:x(tt,"font.size"),fontColor:x(tt,"font.color"),fontWeight:x(tt,"font.weight"),fontStyle:x(tt,"font.style"),fontVariant:x(tt,"font.variant"),fontTextcase:x(tt,"font.textcase"),fontLineposition:x(tt,"font.lineposition"),fontShadow:x(tt,"font.shadow"),nameLength:x(tt,"namelength"),textAlign:x(tt,"align"),idealAlign:c.event.x<Y[0]?"right":"left",hovertemplate:tt.hovertemplate,hovertemplateLabels:q,eventData:[nt]})}}var ot=t.loneHover(Z,{container:T._hoverlayer.node(),outerContainer:T._paper.node(),gd:b,anchorIndex:$});ot.each(function(){var it=this;lt.link.concentrationscale||a(it,.65),s(it)})},F=function(ct,lt,tt){b._fullLayout.hovermode!==!1&&(c.select(ct).call(l.bind(0,lt,tt,!0)),lt.link.trace.link.hoverinfo!=="skip"&&(lt.link.fullData=lt.link.trace,b.emit("plotly_unhover",{event:c.event,points:[lt.link]})),t.loneUnhover(T._hoverlayer.node()))},N=function(ct,lt,tt){var Z=lt.node;Z.originalEvent=c.event,b._hoverdata=[Z],c.select(ct).call(p,lt,tt),t.click(b,{target:!0})},j=function(ct,lt,tt){b._fullLayout.hovermode!==!1&&(c.select(ct).call(m,lt,tt),lt.node.trace.node.hoverinfo!=="skip"&&(lt.node.fullData=lt.node.trace,b.emit("plotly_hover",{event:c.event,points:[lt.node]})))},G=function(ct,lt){if(b._fullLayout.hovermode!==!1){var tt=lt.node.trace.node;if(!(tt.hoverinfo==="none"||tt.hoverinfo==="skip")){var Z=c.select(ct).select("."+r.nodeRect),st=b._fullLayout._paperdiv.node().getBoundingClientRect(),$=Z.node().getBoundingClientRect(),Q=$.left-2-st.left,nt=$.right+2-st.left,Y=$.top+$.height/4-st.top,q={valueLabel:E(lt.valueFormat)(lt.node.value)+lt.valueSuffix};lt.node.fullData=lt.node.trace,b._fullLayout._calcInverseTransform(b);var ot=b._fullLayout._invScaleX,it=b._fullLayout._invScaleY,dt=t.loneHover({x0:ot*Q,x1:ot*nt,y:it*Y,name:E(lt.valueFormat)(lt.node.value)+lt.valueSuffix,text:[lt.node.label,B+lt.node.targetLinks.length,R+lt.node.sourceLinks.length].filter(n).join("<br>"),color:x(tt,"bgcolor")||lt.tinyColorHue,borderColor:x(tt,"bordercolor"),fontFamily:x(tt,"font.family"),fontSize:x(tt,"font.size"),fontColor:x(tt,"font.color"),fontWeight:x(tt,"font.weight"),fontStyle:x(tt,"font.style"),fontVariant:x(tt,"font.variant"),fontTextcase:x(tt,"font.textcase"),fontLineposition:x(tt,"font.lineposition"),fontShadow:x(tt,"font.shadow"),nameLength:x(tt,"namelength"),textAlign:x(tt,"align"),idealAlign:"left",hovertemplate:tt.hovertemplate,hovertemplateLabels:q,eventData:[lt.node]},{container:T._hoverlayer.node(),outerContainer:T._paper.node(),gd:b});a(dt,.85),s(dt)}}},rt=function(ct,lt,tt){b._fullLayout.hovermode!==!1&&(c.select(ct).call(p,lt,tt),lt.node.trace.node.hoverinfo!=="skip"&&(lt.node.fullData=lt.node.trace,b.emit("plotly_unhover",{event:c.event,points:[lt.node]})),t.loneUnhover(T._hoverlayer.node()))};A(b,M,S,{width:w.w,height:w.h,margin:{t:w.t,r:w.r,b:w.b,l:w.l}},{linkEvents:{hover:_,follow:L,unhover:F,select:k},nodeEvents:{hover:j,follow:G,unhover:rt,select:N}})}}),TL=Vt(X=>{var V=su().overrideAll,c=Ph().getModuleCalcData,g=I5(),E=_d(),A=tp(),t=af(),e=fc().prepSelect,r=qr(),i=Mi(),n="sankey";X.name=n,X.baseLayoutAttrOverrides=V({hoverlabel:E.hoverlabel},"plot","nested"),X.plot=function(a){var s=c(a.calcdata,n)[0];g(a,s),X.updateFx(a)},X.clean=function(a,s,h,v){var m=v._has&&v._has(n),p=s._has&&s._has(n);m&&!p&&(v._paperdiv.selectAll(".sankey").remove(),v._paperdiv.selectAll(".bgsankey").remove())},X.updateFx=function(a){for(var s=0;s<a._fullData.length;s++)o(a,s)};function o(a,s){var h=a._fullData[s],v=a._fullLayout,m=v.dragmode,p=v.dragmode==="pan"?"move":"crosshair",y=h._bgRect;if(y&&!(m==="pan"||m==="zoom")){A(y,p);var l={_id:"x",c2p:r.identity,_offset:h._sankey.translateX,_length:h._sankey.width},x={_id:"y",c2p:r.identity,_offset:h._sankey.translateY,_length:h._sankey.height},b={gd:a,element:y.node(),plotinfo:{id:s,xaxis:l,yaxis:x,fillRangeItems:r.noop},subplot:s,xaxes:[l],yaxes:[x],doneFnCompleted:function(S){var T=a._fullData[s],M,w=T.node.groups.slice(),u=[];function f(I){for(var O=T._sankey.graph.nodes,B=0;B<O.length;B++)if(O[B].pointNumber===I)return O[B]}for(var k=0;k<S.length;k++){var _=f(S[k].pointNumber);if(_)if(_.group){for(var D=0;D<_.childrenNodes.length;D++)u.push(_.childrenNodes[D].pointNumber);w[_.pointNumber-T.node._count]=!1}else u.push(_.pointNumber)}M=w.filter(Boolean).concat([u]),i.call("_guiRestyle",a,{"node.groups":[M]},s)}};b.prepFn=function(S,T,M){e(S,T,M,b,m)},t.init(b)}}}),kL=Vt((X,V)=>{V.exports=function(c,g){for(var E=c.cd,A=[],t=E[0].trace,e=t._sankey.graph.nodes,r=0;r<e.length;r++){var i=e[r];if(!i.partOfGroup){var n=[(i.x0+i.x1)/2,(i.y0+i.y1)/2];t.orientation==="v"&&n.reverse(),g&&g.contains(n,!1,r,c)&&A.push({pointNumber:i.pointNumber})}}return A}}),AL=Vt((X,V)=>{V.exports={attributes:M5(),supplyDefaults:fL(),calc:pL(),plot:I5(),moduleType:"trace",name:"sankey",basePlotModule:TL(),selectPoints:kL(),categories:["noOpacity"],meta:{}}}),ML=Vt((X,V)=>{V.exports=AL()}),SL=Vt(X=>{var V=fu();X.name="indicator",X.plot=function(c,g,E,A){V.plotBasePlot(X.name,c,g,E,A)},X.clean=function(c,g,E,A){V.cleanBasePlot(X.name,c,g,E,A)}}),L5=Vt((X,V)=>{var c=po().extendFlat,g=po().extendDeep,E=su().overrideAll,A=Nl(),t=Hc(),e=pu().attributes,r=Ih(),i=Ns().templatedArray,n=Cg(),o=qu().descriptionOnlyNumbers,a=A({editType:"plot",colorEditType:"plot"}),s={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:t.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},h={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},v=i("step",g({},s,{range:h}));V.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:e({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:c({},a,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:o("value")},font:c({},a,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:o("value")},increasing:{symbol:{valType:"string",dflt:n.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:n.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:n.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:n.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:c({},a,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:g({},s,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:t.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:E({range:h,visible:c({},r.visible,{dflt:!0}),tickmode:r.minor.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:c({},r.ticks,{dflt:"outside"}),ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,ticklabelstep:r.ticklabelstep,showticklabels:r.showticklabels,labelalias:r.labelalias,tickfont:A({}),tickangle:r.tickangle,tickformat:r.tickformat,tickformatstops:r.tickformatstops,tickprefix:r.tickprefix,showtickprefix:r.showtickprefix,ticksuffix:r.ticksuffix,showticksuffix:r.showticksuffix,separatethousands:r.separatethousands,exponentformat:r.exponentformat,minexponent:r.minexponent,showexponent:r.showexponent,editType:"plot"},"plot"),steps:v,threshold:{line:{color:c({},s.line.color,{}),width:c({},s.line.width,{dflt:1}),editType:"plot"},thickness:c({},s.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}),C5=Vt((X,V)=>{V.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}),EL=Vt((X,V)=>{var c=qr(),g=L5(),E=pu().defaults,A=Ns(),t=Gh(),e=C5(),r=l0(),i=xg(),n=Ad(),o=Md();function a(h,v,m,p){function y(F,N){return c.coerce(h,v,g,F,N)}E(v,p,y),y("mode"),v._hasNumber=v.mode.indexOf("number")!==-1,v._hasDelta=v.mode.indexOf("delta")!==-1,v._hasGauge=v.mode.indexOf("gauge")!==-1;var l=y("value");v._range=[0,typeof l=="number"?1.5*l:1];var x=new Array(2),b;if(v._hasNumber){y("number.valueformat");var S=c.extendFlat({},p.font);S.size=void 0,c.coerceFont(y,"number.font",S),v.number.font.size===void 0&&(v.number.font.size=e.defaultNumberFontSize,x[0]=!0),y("number.prefix"),y("number.suffix"),b=v.number.font.size}var T;if(v._hasDelta){var M=c.extendFlat({},p.font);M.size=void 0,c.coerceFont(y,"delta.font",M),v.delta.font.size===void 0&&(v.delta.font.size=(v._hasNumber?.5:1)*(b||e.defaultNumberFontSize),x[1]=!0),y("delta.reference",v.value),y("delta.relative"),y("delta.valueformat",v.delta.relative?"2%":""),y("delta.increasing.symbol"),y("delta.increasing.color"),y("delta.decreasing.symbol"),y("delta.decreasing.color"),y("delta.position"),y("delta.prefix"),y("delta.suffix"),T=v.delta.font.size}v._scaleNumbers=(!v._hasNumber||x[0])&&(!v._hasDelta||x[1])||!1;var w=c.extendFlat({},p.font);w.size=.25*(b||T||e.defaultNumberFontSize),c.coerceFont(y,"title.font",w),y("title.text");var u,f,k,_;function D(F,N){return c.coerce(u,f,g.gauge,F,N)}function I(F,N){return c.coerce(k,_,g.gauge.axis,F,N)}if(v._hasGauge){u=h.gauge,u||(u={}),f=A.newContainer(v,"gauge"),D("shape");var O=v._isBullet=v.gauge.shape==="bullet";O||y("title.align","center");var B=v._isAngular=v.gauge.shape==="angular";B||y("align","center"),D("bgcolor",p.paper_bgcolor),D("borderwidth"),D("bordercolor"),D("bar.color"),D("bar.line.color"),D("bar.line.width");var R=e.valueThickness*(v.gauge.shape==="bullet"?.5:1);D("bar.thickness",R),t(u,f,{name:"steps",handleItemDefaults:s}),D("threshold.value"),D("threshold.thickness"),D("threshold.line.width"),D("threshold.line.color"),k={},u&&(k=u.axis||{}),_=A.newContainer(f,"axis"),I("visible"),v._range=I("range",v._range);var L={font:p.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};r(k,_,I,"linear"),o(k,_,I,"linear",L),n(k,_,I,"linear",L),i(k,_,I,L)}else y("title.align","center"),y("align","center"),v._isAngular=v._isBullet=!1;v._length=null}function s(h,v){function m(p,y){return c.coerce(h,v,g.gauge.steps,p,y)}m("color"),m("line.color"),m("line.width"),m("range"),m("thickness")}V.exports={supplyDefaults:a}}),PL=Vt((X,V)=>{function c(g,E){var A=[],t=E.value;typeof E._lastValue!="number"&&(E._lastValue=E.value);var e=E._lastValue,r=e;return E._hasDelta&&typeof E.delta.reference=="number"&&(r=E.delta.reference),A[0]={y:t,lastY:e,delta:t-r,relativeDelta:(t-r)/r},A}V.exports={calc:c}}),IL=Vt((X,V)=>{var c=Ai(),g=(M0(),xd(Rd)).interpolate,E=(M0(),xd(Rd)).interpolateNumber,A=qr(),t=A.strScale,e=A.strTranslate,r=A.rad2deg,i=nh().MID_SHIFT,n=go(),o=C5(),a=sl(),s=ao(),h=Hm(),v=Ky(),m=Ih(),p=vi(),y={left:"start",center:"middle",right:"end"},l={left:0,center:.5,right:1},x=/[yzafpnµmkMGTPEZY]/;function b(O){return O&&O.duration>0}V.exports=function(O,B,R,L){var F=O._fullLayout,N;b(R)&&L&&(N=L()),A.makeTraceGroups(F._indicatorlayer,B,"trace").each(function(j){var G=j[0],rt=G.trace,ct=c.select(this),lt=rt._hasGauge,tt=rt._isAngular,Z=rt._isBullet,st=rt.domain,$={w:F._size.w*(st.x[1]-st.x[0]),h:F._size.h*(st.y[1]-st.y[0]),l:F._size.l+F._size.w*st.x[0],r:F._size.r+F._size.w*(1-st.x[1]),t:F._size.t+F._size.h*(1-st.y[1]),b:F._size.b+F._size.h*st.y[0]},Q=$.l+$.w/2,nt=$.t+$.h/2,Y=Math.min($.w/2,$.h),q=o.innerRadius*Y,ot,it,dt,wt=rt.align||"center";if(it=nt,!lt)ot=$.l+l[wt]*$.w,dt=function(bt){return k(bt,$.w,$.h)};else if(tt&&(ot=Q,it=nt+Y/2,dt=function(bt){return _(bt,.9*q)}),Z){var xt=o.bulletPadding,Ft=1-o.bulletNumberDomainSize+xt;ot=$.l+(Ft+(1-Ft)*l[wt])*$.w,dt=function(bt){return k(bt,(o.bulletNumberDomainSize-xt)*$.w,$.h)}}M(O,ct,j,{numbersX:ot,numbersY:it,numbersScaler:dt,transitionOpts:R,onComplete:N});var Et,Nt;lt&&(Et={range:rt.gauge.axis.range,color:rt.gauge.bgcolor,line:{color:rt.gauge.bordercolor,width:0},thickness:1},Nt={range:rt.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:rt.gauge.bordercolor,width:rt.gauge.borderwidth},thickness:1});var te=ct.selectAll("g.angular").data(tt?j:[]);te.exit().remove();var Jt=ct.selectAll("g.angularaxis").data(tt?j:[]);Jt.exit().remove(),tt&&T(O,ct,j,{radius:Y,innerRadius:q,gauge:te,layer:Jt,size:$,gaugeBg:Et,gaugeOutline:Nt,transitionOpts:R,onComplete:N});var Qt=ct.selectAll("g.bullet").data(Z?j:[]);Qt.exit().remove();var Wt=ct.selectAll("g.bulletaxis").data(Z?j:[]);Wt.exit().remove(),Z&&S(O,ct,j,{gauge:Qt,layer:Wt,size:$,gaugeBg:Et,gaugeOutline:Nt,transitionOpts:R,onComplete:N});var gt=ct.selectAll("text.title").data(j);gt.exit().remove(),gt.enter().append("text").classed("title",!0),gt.attr("text-anchor",function(){return Z?y.right:y[rt.title.align]}).text(rt.title.text).call(n.font,rt.title.font).call(a.convertToTspans,O),gt.attr("transform",function(){var bt=$.l+$.w*l[rt.title.align],vt,Ut=o.titlePadding,Kt=n.bBox(gt.node());if(lt){if(tt)if(rt.gauge.axis.visible){var Zt=n.bBox(Jt.node());vt=Zt.top-Ut-Kt.bottom}else vt=$.t+$.h/2-Y/2-Kt.bottom-Ut;Z&&(vt=it-(Kt.top+Kt.bottom)/2,bt=$.l-o.bulletPadding*$.w)}else vt=rt._numbersTop-Ut-Kt.bottom;return e(bt,vt)})})};function S(O,B,R,L){var F=R[0].trace,N=L.gauge,j=L.layer,G=L.gaugeBg,rt=L.gaugeOutline,ct=L.size,lt=F.domain,tt=L.transitionOpts,Z=L.onComplete,st,$,Q,nt,Y;N.enter().append("g").classed("bullet",!0),N.attr("transform",e(ct.l,ct.t)),j.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),j.selectAll("g.xbulletaxistick,path,text").remove();var q=ct.h,ot=F.gauge.bar.thickness*q,it=lt.x[0],dt=lt.x[0]+(lt.x[1]-lt.x[0])*(F._hasNumber||F._hasDelta?1-o.bulletNumberDomainSize:1);st=f(O,F.gauge.axis),st._id="xbulletaxis",st.domain=[it,dt],st.setScale(),$=s.calcTicks(st),Q=s.makeTransTickFn(st),nt=s.getTickSigns(st)[2],Y=ct.t+ct.h,st.visible&&(s.drawTicks(O,st,{vals:st.ticks==="inside"?s.clipEnds(st,$):$,layer:j,path:s.makeTickPath(st,Y,nt),transFn:Q}),s.drawLabels(O,st,{vals:$,layer:j,transFn:Q,labelFns:s.makeLabelFns(st,Y)}));function wt(Qt){Qt.attr("width",function(Wt){return Math.max(0,st.c2p(Wt.range[1])-st.c2p(Wt.range[0]))}).attr("x",function(Wt){return st.c2p(Wt.range[0])}).attr("y",function(Wt){return .5*(1-Wt.thickness)*q}).attr("height",function(Wt){return Wt.thickness*q})}var xt=[G].concat(F.gauge.steps),Ft=N.selectAll("g.bg-bullet").data(xt);Ft.enter().append("g").classed("bg-bullet",!0).append("rect"),Ft.select("rect").call(wt).call(w),Ft.exit().remove();var Et=N.selectAll("g.value-bullet").data([F.gauge.bar]);Et.enter().append("g").classed("value-bullet",!0).append("rect"),Et.select("rect").attr("height",ot).attr("y",(q-ot)/2).call(w),b(tt)?Et.select("rect").transition().duration(tt.duration).ease(tt.easing).each("end",function(){Z&&Z()}).each("interrupt",function(){Z&&Z()}).attr("width",Math.max(0,st.c2p(Math.min(F.gauge.axis.range[1],R[0].y)))):Et.select("rect").attr("width",typeof R[0].y=="number"?Math.max(0,st.c2p(Math.min(F.gauge.axis.range[1],R[0].y))):0),Et.exit().remove();var Nt=R.filter(function(){return F.gauge.threshold.value||F.gauge.threshold.value===0}),te=N.selectAll("g.threshold-bullet").data(Nt);te.enter().append("g").classed("threshold-bullet",!0).append("line"),te.select("line").attr("x1",st.c2p(F.gauge.threshold.value)).attr("x2",st.c2p(F.gauge.threshold.value)).attr("y1",(1-F.gauge.threshold.thickness)/2*q).attr("y2",(1-(1-F.gauge.threshold.thickness)/2)*q).call(p.stroke,F.gauge.threshold.line.color).style("stroke-width",F.gauge.threshold.line.width),te.exit().remove();var Jt=N.selectAll("g.gauge-outline").data([rt]);Jt.enter().append("g").classed("gauge-outline",!0).append("rect"),Jt.select("rect").call(wt).call(w),Jt.exit().remove()}function T(O,B,R,L){var F=R[0].trace,N=L.size,j=L.radius,G=L.innerRadius,rt=L.gaugeBg,ct=L.gaugeOutline,lt=[N.l+N.w/2,N.t+N.h/2+j/2],tt=L.gauge,Z=L.layer,st=L.transitionOpts,$=L.onComplete,Q=Math.PI/2;function nt(Te){var Se=F.gauge.axis.range[0],Fe=F.gauge.axis.range[1],Oe=(Te-Se)/(Fe-Se)*Math.PI-Q;return Oe<-Q?-Q:Oe>Q?Q:Oe}function Y(Te){return c.svg.arc().innerRadius((G+j)/2-Te/2*(j-G)).outerRadius((G+j)/2+Te/2*(j-G)).startAngle(-Q)}function q(Te){Te.attr("d",function(Se){return Y(Se.thickness).startAngle(nt(Se.range[0])).endAngle(nt(Se.range[1]))()})}var ot,it,dt,wt;tt.enter().append("g").classed("angular",!0),tt.attr("transform",e(lt[0],lt[1])),Z.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),Z.selectAll("g.xangularaxistick,path,text").remove(),ot=f(O,F.gauge.axis),ot.type="linear",ot.range=F.gauge.axis.range,ot._id="xangularaxis",ot.ticklabeloverflow="allow",ot.setScale();var xt=function(Te){return(ot.range[0]-Te.x)/(ot.range[1]-ot.range[0])*Math.PI+Math.PI},Ft={},Et=s.makeLabelFns(ot,0),Nt=Et.labelStandoff;Ft.xFn=function(Te){var Se=xt(Te);return Math.cos(Se)*Nt},Ft.yFn=function(Te){var Se=xt(Te),Fe=Math.sin(Se)>0?.2:1;return-Math.sin(Se)*(Nt+Te.fontSize*Fe)+Math.abs(Math.cos(Se))*(Te.fontSize*i)},Ft.anchorFn=function(Te){var Se=xt(Te),Fe=Math.cos(Se);return Math.abs(Fe)<.1?"middle":Fe>0?"start":"end"},Ft.heightFn=function(Te,Se,Fe){var Oe=xt(Te);return-.5*(1+Math.sin(Oe))*Fe};var te=function(Te){return e(lt[0]+j*Math.cos(Te),lt[1]-j*Math.sin(Te))};dt=function(Te){return te(xt(Te))};var Jt=function(Te){var Se=xt(Te);return te(Se)+"rotate("+-r(Se)+")"};if(it=s.calcTicks(ot),wt=s.getTickSigns(ot)[2],ot.visible){wt=ot.ticks==="inside"?-1:1;var Qt=(ot.linewidth||1)/2;s.drawTicks(O,ot,{vals:it,layer:Z,path:"M"+wt*Qt+",0h"+wt*ot.ticklen,transFn:Jt}),s.drawLabels(O,ot,{vals:it,layer:Z,transFn:dt,labelFns:Ft})}var Wt=[rt].concat(F.gauge.steps),gt=tt.selectAll("g.bg-arc").data(Wt);gt.enter().append("g").classed("bg-arc",!0).append("path"),gt.select("path").call(q).call(w),gt.exit().remove();var bt=Y(F.gauge.bar.thickness),vt=tt.selectAll("g.value-arc").data([F.gauge.bar]);vt.enter().append("g").classed("value-arc",!0).append("path");var Ut=vt.select("path");b(st)?(Ut.transition().duration(st.duration).ease(st.easing).each("end",function(){$&&$()}).each("interrupt",function(){$&&$()}).attrTween("d",u(bt,nt(R[0].lastY),nt(R[0].y))),F._lastValue=R[0].y):Ut.attr("d",typeof R[0].y=="number"?bt.endAngle(nt(R[0].y)):"M0,0Z"),Ut.call(w),vt.exit().remove(),Wt=[];var Kt=F.gauge.threshold.value;(Kt||Kt===0)&&Wt.push({range:[Kt,Kt],color:F.gauge.threshold.color,line:{color:F.gauge.threshold.line.color,width:F.gauge.threshold.line.width},thickness:F.gauge.threshold.thickness});var Zt=tt.selectAll("g.threshold-arc").data(Wt);Zt.enter().append("g").classed("threshold-arc",!0).append("path"),Zt.select("path").call(q).call(w),Zt.exit().remove();var le=tt.selectAll("g.gauge-outline").data([ct]);le.enter().append("g").classed("gauge-outline",!0).append("path"),le.select("path").call(q).call(w),le.exit().remove()}function M(O,B,R,L){var F=R[0].trace,N=L.numbersX,j=L.numbersY,G=F.align||"center",rt=y[G],ct=L.transitionOpts,lt=L.onComplete,tt=A.ensureSingle(B,"g","numbers"),Z,st,$,Q=[];F._hasNumber&&Q.push("number"),F._hasDelta&&(Q.push("delta"),F.delta.position==="left"&&Q.reverse());var nt=tt.selectAll("text").data(Q);nt.enter().append("text"),nt.attr("text-anchor",function(){return rt}).attr("class",function(te){return te}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),nt.exit().remove();function Y(te,Jt,Qt,Wt){if(te.match("s")&&Qt>=0!=Wt>=0&&!Jt(Qt).slice(-1).match(x)&&!Jt(Wt).slice(-1).match(x)){var gt=te.slice().replace("s","f").replace(/\d+/,function(vt){return parseInt(vt)-1}),bt=f(O,{tickformat:gt});return function(vt){return Math.abs(vt)<1?s.tickText(bt,vt).text:Jt(vt)}}else return Jt}function q(){var te=f(O,{tickformat:F.number.valueformat},F._range);te.setScale(),s.prepTicks(te);var Jt=function(vt){return s.tickText(te,vt).text},Qt=F.number.suffix,Wt=F.number.prefix,gt=tt.select("text.number");function bt(){var vt=typeof R[0].y=="number"?Wt+Jt(R[0].y)+Qt:"-";gt.text(vt).call(n.font,F.number.font).call(a.convertToTspans,O)}return b(ct)?gt.transition().duration(ct.duration).ease(ct.easing).each("end",function(){bt(),lt&<()}).each("interrupt",function(){bt(),lt&<()}).attrTween("text",function(){var vt=c.select(this),Ut=E(R[0].lastY,R[0].y);F._lastValue=R[0].y;var Kt=Y(F.number.valueformat,Jt,R[0].lastY,R[0].y);return function(Zt){vt.text(Wt+Kt(Ut(Zt))+Qt)}}):bt(),Z=D(Wt+Jt(R[0].y)+Qt,F.number.font,rt,O),gt}function ot(){var te=f(O,{tickformat:F.delta.valueformat},F._range);te.setScale(),s.prepTicks(te);var Jt=function(Zt){return s.tickText(te,Zt).text},Qt=F.delta.suffix,Wt=F.delta.prefix,gt=function(Zt){var le=F.delta.relative?Zt.relativeDelta:Zt.delta;return le},bt=function(Zt,le){return Zt===0||typeof Zt!="number"||isNaN(Zt)?"-":(Zt>0?F.delta.increasing.symbol:F.delta.decreasing.symbol)+Wt+le(Zt)+Qt},vt=function(Zt){return Zt.delta>=0?F.delta.increasing.color:F.delta.decreasing.color};F._deltaLastValue===void 0&&(F._deltaLastValue=gt(R[0]));var Ut=tt.select("text.delta");Ut.call(n.font,F.delta.font).call(p.fill,vt({delta:F._deltaLastValue}));function Kt(){Ut.text(bt(gt(R[0]),Jt)).call(p.fill,vt(R[0])).call(a.convertToTspans,O)}return b(ct)?Ut.transition().duration(ct.duration).ease(ct.easing).tween("text",function(){var Zt=c.select(this),le=gt(R[0]),Te=F._deltaLastValue,Se=Y(F.delta.valueformat,Jt,Te,le),Fe=E(Te,le);return F._deltaLastValue=le,function(Oe){Zt.text(bt(Fe(Oe),Se)),Zt.call(p.fill,vt({delta:Fe(Oe)}))}}).each("end",function(){Kt(),lt&<()}).each("interrupt",function(){Kt(),lt&<()}):Kt(),st=D(bt(gt(R[0]),Jt),F.delta.font,rt,O),Ut}var it=F.mode+F.align,dt;if(F._hasDelta&&(dt=ot(),it+=F.delta.position+F.delta.font.size+F.delta.font.family+F.delta.valueformat,it+=F.delta.increasing.symbol+F.delta.decreasing.symbol,$=st),F._hasNumber&&(q(),it+=F.number.font.size+F.number.font.family+F.number.valueformat+F.number.suffix+F.number.prefix,$=Z),F._hasDelta&&F._hasNumber){var wt=[(Z.left+Z.right)/2,(Z.top+Z.bottom)/2],xt=[(st.left+st.right)/2,(st.top+st.bottom)/2],Ft,Et,Nt=.75*F.delta.font.size;F.delta.position==="left"&&(Ft=I(F,"deltaPos",0,-1*(Z.width*l[F.align]+st.width*(1-l[F.align])+Nt),it,Math.min),Et=wt[1]-xt[1],$={width:Z.width+st.width+Nt,height:Math.max(Z.height,st.height),left:st.left+Ft,right:Z.right,top:Math.min(Z.top,st.top+Et),bottom:Math.max(Z.bottom,st.bottom+Et)}),F.delta.position==="right"&&(Ft=I(F,"deltaPos",0,Z.width*(1-l[F.align])+st.width*l[F.align]+Nt,it,Math.max),Et=wt[1]-xt[1],$={width:Z.width+st.width+Nt,height:Math.max(Z.height,st.height),left:Z.left,right:st.right+Ft,top:Math.min(Z.top,st.top+Et),bottom:Math.max(Z.bottom,st.bottom+Et)}),F.delta.position==="bottom"&&(Ft=null,Et=st.height,$={width:Math.max(Z.width,st.width),height:Z.height+st.height,left:Math.min(Z.left,st.left),right:Math.max(Z.right,st.right),top:Z.bottom-Z.height,bottom:Z.bottom+st.height}),F.delta.position==="top"&&(Ft=null,Et=Z.top,$={width:Math.max(Z.width,st.width),height:Z.height+st.height,left:Math.min(Z.left,st.left),right:Math.max(Z.right,st.right),top:Z.bottom-Z.height-st.height,bottom:Z.bottom}),dt.attr({dx:Ft,dy:Et})}(F._hasNumber||F._hasDelta)&&tt.attr("transform",function(){var te=L.numbersScaler($);it+=te[2];var Jt=I(F,"numbersScale",1,te[0],it,Math.min),Qt;F._scaleNumbers||(Jt=1),F._isAngular?Qt=j-Jt*$.bottom:Qt=j-Jt*($.top+$.bottom)/2,F._numbersTop=Jt*$.top+Qt;var Wt=$[G];G==="center"&&(Wt=($.left+$.right)/2);var gt=N-Jt*Wt;return gt=I(F,"numbersTranslate",0,gt,it,Math.max),e(gt,Qt)+t(Jt)})}function w(O){O.each(function(B){p.stroke(c.select(this),B.line.color)}).each(function(B){p.fill(c.select(this),B.color)}).style("stroke-width",function(B){return B.line.width})}function u(O,B,R){return function(){var L=g(B,R);return function(F){return O.endAngle(L(F))()}}}function f(O,B,R){var L=O._fullLayout,F=A.extendFlat({type:"linear",ticks:"outside",range:R,showline:!0},B),N={type:"linear",_id:"x"+B._id},j={letter:"x",font:L.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function G(rt,ct){return A.coerce(F,N,m,rt,ct)}return h(F,N,G,j,L),v(F,N,G,j),N}function k(O,B,R){var L=Math.min(B/O.width,R/O.height);return[L,O,B+"x"+R]}function _(O,B){var R=Math.sqrt(O.width/2*(O.width/2)+O.height*O.height),L=B/R;return[L,O,B]}function D(O,B,R,L){var F=document.createElementNS("http://www.w3.org/2000/svg","text"),N=c.select(F);return N.text(O).attr("x",0).attr("y",0).attr("text-anchor",R).attr("data-unformatted",O).call(a.convertToTspans,L).call(n.font,B),n.bBox(N.node())}function I(O,B,R,L,F,N){var j="_cache"+B;O[j]&&O[j].key===F||(O[j]={key:F,value:R});var G=A.aggNums(N,null,[O[j].value,L],2);return O[j].value=G,G}}),LL=Vt((X,V)=>{V.exports={moduleType:"trace",name:"indicator",basePlotModule:SL(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:L5(),supplyDefaults:EL().supplyDefaults,calc:PL().calc,plot:IL(),meta:{}}}),CL=Vt((X,V)=>{V.exports=LL()}),D5=Vt((X,V)=>{var c=h0(),g=po().extendFlat,E=su().overrideAll,A=Nl(),t=pu().attributes,e=qu().descriptionOnlyNumbers;V.exports=E({domain:t({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:e("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:g({},c.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:g({},A({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:e("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:g({},c.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:g({},A({arrayOk:!0}))}},"calc","from-root")}),DL=Vt((X,V)=>{var c=qr(),g=D5(),E=pu().defaults;function A(t,e){for(var r=t.columnorder||[],i=t.header.values.length,n=r.slice(0,i),o=n.slice().sort(function(h,v){return h-v}),a=n.map(function(h){return o.indexOf(h)}),s=a.length;s<i;s++)a.push(s);e("columnorder",a)}V.exports=function(t,e,r,i){function n(o,a){return c.coerce(t,e,g,o,a)}E(e,i,n),n("columnwidth"),n("header.values"),n("header.format"),n("header.align"),n("header.prefix"),n("header.suffix"),n("header.height"),n("header.line.width"),n("header.line.color"),n("header.fill.color"),c.coerceFont(n,"header.font",i.font),A(e,n),n("cells.values"),n("cells.format"),n("cells.align"),n("cells.prefix"),n("cells.suffix"),n("cells.height"),n("cells.line.width"),n("cells.line.color"),n("cells.fill.color"),c.coerceFont(n,"cells.font",i.font),e._length=null}}),zL=Vt((X,V)=>{var c=Ap().wrap;V.exports=function(){return c({})}}),z5=Vt((X,V)=>{V.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"<br>",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}),OL=Vt((X,V)=>{var c=z5(),g=po().extendFlat,E=vo(),A=nf().isTypedArray,t=nf().isArrayOrTypedArray;V.exports=function(v,m){var p=i(m.cells.values),y=function(G){return G.slice(m.header.values.length,G.length)},l=i(m.header.values);l.length&&!l[0].length&&(l[0]=[""],l=i(l));var x=l.concat(y(p).map(function(){return n((l[0]||[""]).length)})),b=m.domain,S=Math.floor(v._fullLayout._size.w*(b.x[1]-b.x[0])),T=Math.floor(v._fullLayout._size.h*(b.y[1]-b.y[0])),M=m.header.values.length?x[0].map(function(){return m.header.height}):[c.emptyHeaderHeight],w=p.length?p[0].map(function(){return m.cells.height}):[],u=M.reduce(r,0),f=T-u,k=f+c.uplift,_=s(w,k),D=s(M,u),I=a(D,[]),O=a(_,I),B={},R=m._fullInput.columnorder;t(R)&&(R=Array.from(R)),R=R.concat(y(p.map(function(G,rt){return rt})));var L=x.map(function(G,rt){var ct=t(m.columnwidth)?m.columnwidth[Math.min(rt,m.columnwidth.length-1)]:m.columnwidth;return E(ct)?Number(ct):1}),F=L.reduce(r,0);L=L.map(function(G){return G/F*S});var N=Math.max(e(m.header.line.width),e(m.cells.line.width)),j={key:m.uid+v._context.staticPlot,translateX:b.x[0]*v._fullLayout._size.w,translateY:v._fullLayout._size.h*(1-b.y[1]),size:v._fullLayout._size,width:S,maxLineWidth:N,height:T,columnOrder:R,groupHeight:T,rowBlocks:O,headerRowBlocks:I,scrollY:0,cells:g({},m.cells,{values:p}),headerCells:g({},m.header,{values:x}),gdColumns:x.map(function(G){return G[0]}),gdColumnsOriginalOrder:x.map(function(G){return G[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:x.map(function(G,rt){var ct=B[G];B[G]=(ct||0)+1;var lt=G+"__"+B[G];return{key:lt,label:G,specIndex:rt,xIndex:R[rt],xScale:o,x:void 0,calcdata:void 0,columnWidth:L[rt]}})};return j.columns.forEach(function(G){G.calcdata=j,G.x=o(G)}),j};function e(v){if(t(v)){for(var m=0,p=0;p<v.length;p++)m=Math.max(m,e(v[p]));return m}return v}function r(v,m){return v+m}function i(v){var m=v.slice(),p=1/0,y=0,l;for(l=0;l<m.length;l++)A(m[l])?m[l]=Array.from(m[l]):t(m[l])||(m[l]=[m[l]]),p=Math.min(p,m[l].length),y=Math.max(y,m[l].length);if(p!==y)for(l=0;l<m.length;l++){var x=y-m[l].length;x&&(m[l]=m[l].concat(n(x)))}return m}function n(v){for(var m=new Array(v),p=0;p<v;p++)m[p]="";return m}function o(v){return v.calcdata.columns.reduce(function(m,p){return p.xIndex<v.xIndex?m+p.columnWidth:m},0)}function a(v,m){var p=Object.keys(v);return p.map(function(y){return g({},v[y],{auxiliaryBlocks:m})})}function s(v,m){for(var p={},y,l=0,x=0,b=h(),S=0,T=0,M=0;M<v.length;M++)y=v[M],b.rows.push({rowIndex:M,rowHeight:y}),x+=y,(x>=m||M===v.length-1)&&(p[l]=b,b.key=T++,b.firstRowIndex=S,b.lastRowIndex=M,b=h(),l+=x,S=M+1,x=0);return p}function h(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}),FL=Vt(X=>{var V=po().extendFlat;X.splitToPanels=function(g){var E=[0,0],A=V({},g,{key:"header",type:"header",page:0,prevPages:E,currentRepaint:[null,null],dragHandle:!0,values:g.calcdata.headerCells.values[g.specIndex],rowBlocks:g.calcdata.headerRowBlocks,calcdata:V({},g.calcdata,{cells:g.calcdata.headerCells})}),t=V({},g,{key:"cells1",type:"cells",page:0,prevPages:E,currentRepaint:[null,null],dragHandle:!1,values:g.calcdata.cells.values[g.specIndex],rowBlocks:g.calcdata.rowBlocks}),e=V({},g,{key:"cells2",type:"cells",page:1,prevPages:E,currentRepaint:[null,null],dragHandle:!1,values:g.calcdata.cells.values[g.specIndex],rowBlocks:g.calcdata.rowBlocks});return[t,e,A]},X.splitToCells=function(g){var E=c(g);return(g.values||[]).slice(E[0],E[1]).map(function(A,t){var e=typeof A=="string"&&A.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:t+e,key:E[0]+t,column:g,calcdata:g.calcdata,page:g.page,rowBlocks:g.rowBlocks,value:A}})};function c(g){var E=g.rowBlocks[g.page],A=E?E.rows[0].rowIndex:0,t=E?A+E.rows.length:0;return[A,t]}}),O5=Vt((X,V)=>{var c=z5(),g=Ai(),E=qr(),A=E.numberFormat,t=Ap(),e=go(),r=sl(),i=qr().raiseToTop,n=qr().strTranslate,o=qr().cancelTransition,a=OL(),s=FL(),h=vi();V.exports=function(ot,it){var dt=!ot._context.staticPlot,wt=ot._fullLayout._paper.selectAll("."+c.cn.table).data(it.map(function(Zt){var le=t.unwrap(Zt),Te=le.trace;return a(ot,Te)}),t.keyFun);wt.exit().remove(),wt.enter().append("g").classed(c.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),wt.attr("width",function(Zt){return Zt.width+Zt.size.l+Zt.size.r}).attr("height",function(Zt){return Zt.height+Zt.size.t+Zt.size.b}).attr("transform",function(Zt){return n(Zt.translateX,Zt.translateY)});var xt=wt.selectAll("."+c.cn.tableControlView).data(t.repeat,t.keyFun),Ft=xt.enter().append("g").classed(c.cn.tableControlView,!0).style("box-sizing","content-box");if(dt){var Et="onwheel"in document?"wheel":"mousewheel";Ft.on("mousemove",function(Zt){xt.filter(function(le){return Zt===le}).call(l,ot)}).on(Et,function(Zt){if(!Zt.scrollbarState.wheeling){Zt.scrollbarState.wheeling=!0;var le=Zt.scrollY+g.event.deltaY,Te=rt(ot,xt,null,le)(Zt);Te||(g.event.stopPropagation(),g.event.preventDefault()),Zt.scrollbarState.wheeling=!1}}).call(l,ot,!0)}xt.attr("transform",function(Zt){return n(Zt.size.l,Zt.size.t)});var Nt=xt.selectAll("."+c.cn.scrollBackground).data(t.repeat,t.keyFun);Nt.enter().append("rect").classed(c.cn.scrollBackground,!0).attr("fill","none"),Nt.attr("width",function(Zt){return Zt.width}).attr("height",function(Zt){return Zt.height}),xt.each(function(Zt){e.setClipUrl(g.select(this),m(ot,Zt),ot)});var te=xt.selectAll("."+c.cn.yColumn).data(function(Zt){return Zt.columns},t.keyFun);te.enter().append("g").classed(c.cn.yColumn,!0),te.exit().remove(),te.attr("transform",function(Zt){return n(Zt.x,0)}),dt&&te.call(g.behavior.drag().origin(function(Zt){var le=g.select(this);return R(le,Zt,-c.uplift),i(this),Zt.calcdata.columnDragInProgress=!0,l(xt.filter(function(Te){return Zt.calcdata.key===Te.key}),ot),Zt}).on("drag",function(Zt){var le=g.select(this),Te=function(Oe){return(Zt===Oe?g.event.x:Oe.x)+Oe.columnWidth/2};Zt.x=Math.max(-c.overdrag,Math.min(Zt.calcdata.width+c.overdrag-Zt.columnWidth,g.event.x));var Se=y(te).filter(function(Oe){return Oe.calcdata.key===Zt.calcdata.key}),Fe=Se.sort(function(Oe,ur){return Te(Oe)-Te(ur)});Fe.forEach(function(Oe,ur){Oe.xIndex=ur,Oe.x=Zt===Oe?Oe.x:Oe.xScale(Oe)}),te.filter(function(Oe){return Zt!==Oe}).transition().ease(c.transitionEase).duration(c.transitionDuration).attr("transform",function(Oe){return n(Oe.x,0)}),le.call(o).attr("transform",n(Zt.x,-c.uplift))}).on("dragend",function(Zt){var le=g.select(this),Te=Zt.calcdata;Zt.x=Zt.xScale(Zt),Zt.calcdata.columnDragInProgress=!1,R(le,Zt,0),O(ot,Te,Te.columns.map(function(Se){return Se.xIndex}))})),te.each(function(Zt){e.setClipUrl(g.select(this),p(ot,Zt),ot)});var Jt=te.selectAll("."+c.cn.columnBlock).data(s.splitToPanels,t.keyFun);Jt.enter().append("g").classed(c.cn.columnBlock,!0).attr("id",function(Zt){return Zt.key}),Jt.style("cursor",function(Zt){return Zt.dragHandle?"ew-resize":Zt.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var Qt=Jt.filter(F),Wt=Jt.filter(L);dt&&Wt.call(g.behavior.drag().origin(function(Zt){return g.event.stopPropagation(),Zt}).on("drag",rt(ot,xt,-1)).on("dragend",function(){})),x(ot,xt,Qt,Jt),x(ot,xt,Wt,Jt);var gt=xt.selectAll("."+c.cn.scrollAreaClip).data(t.repeat,t.keyFun);gt.enter().append("clipPath").classed(c.cn.scrollAreaClip,!0).attr("id",function(Zt){return m(ot,Zt)});var bt=gt.selectAll("."+c.cn.scrollAreaClipRect).data(t.repeat,t.keyFun);bt.enter().append("rect").classed(c.cn.scrollAreaClipRect,!0).attr("x",-c.overdrag).attr("y",-c.uplift).attr("fill","none"),bt.attr("width",function(Zt){return Zt.width+2*c.overdrag}).attr("height",function(Zt){return Zt.height+c.uplift});var vt=te.selectAll("."+c.cn.columnBoundary).data(t.repeat,t.keyFun);vt.enter().append("g").classed(c.cn.columnBoundary,!0);var Ut=te.selectAll("."+c.cn.columnBoundaryClippath).data(t.repeat,t.keyFun);Ut.enter().append("clipPath").classed(c.cn.columnBoundaryClippath,!0),Ut.attr("id",function(Zt){return p(ot,Zt)});var Kt=Ut.selectAll("."+c.cn.columnBoundaryRect).data(t.repeat,t.keyFun);Kt.enter().append("rect").classed(c.cn.columnBoundaryRect,!0).attr("fill","none"),Kt.attr("width",function(Zt){return Zt.columnWidth+2*v(Zt)}).attr("height",function(Zt){return Zt.calcdata.height+2*v(Zt)+c.uplift}).attr("x",function(Zt){return-v(Zt)}).attr("y",function(Zt){return-v(Zt)}),G(null,Wt,xt)};function v(ot){return Math.ceil(ot.calcdata.maxLineWidth/2)}function m(ot,it){return"clip"+ot._fullLayout._uid+"_scrollAreaBottomClip_"+it.key}function p(ot,it){return"clip"+ot._fullLayout._uid+"_columnBoundaryClippath_"+it.calcdata.key+"_"+it.specIndex}function y(ot){return[].concat.apply([],ot.map(function(it){return it})).map(function(it){return it.__data__})}function l(ot,it,dt){function wt(Jt){var Qt=Jt.rowBlocks;return $(Qt,Qt.length-1)+(Qt.length?Q(Qt[Qt.length-1],1/0):1)}var xt=ot.selectAll("."+c.cn.scrollbarKit).data(t.repeat,t.keyFun);xt.enter().append("g").classed(c.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),xt.each(function(Jt){var Qt=Jt.scrollbarState;Qt.totalHeight=wt(Jt),Qt.scrollableAreaHeight=Jt.groupHeight-N(Jt),Qt.currentlyVisibleHeight=Math.min(Qt.totalHeight,Qt.scrollableAreaHeight),Qt.ratio=Qt.currentlyVisibleHeight/Qt.totalHeight,Qt.barLength=Math.max(Qt.ratio*Qt.currentlyVisibleHeight,c.goldenRatio*c.scrollbarWidth),Qt.barWiggleRoom=Qt.currentlyVisibleHeight-Qt.barLength,Qt.wiggleRoom=Math.max(0,Qt.totalHeight-Qt.scrollableAreaHeight),Qt.topY=Qt.barWiggleRoom===0?0:Jt.scrollY/Qt.wiggleRoom*Qt.barWiggleRoom,Qt.bottomY=Qt.topY+Qt.barLength,Qt.dragMultiplier=Qt.wiggleRoom/Qt.barWiggleRoom}).attr("transform",function(Jt){var Qt=Jt.width+c.scrollbarWidth/2+c.scrollbarOffset;return n(Qt,N(Jt))});var Ft=xt.selectAll("."+c.cn.scrollbar).data(t.repeat,t.keyFun);Ft.enter().append("g").classed(c.cn.scrollbar,!0);var Et=Ft.selectAll("."+c.cn.scrollbarSlider).data(t.repeat,t.keyFun);Et.enter().append("g").classed(c.cn.scrollbarSlider,!0),Et.attr("transform",function(Jt){return n(0,Jt.scrollbarState.topY||0)});var Nt=Et.selectAll("."+c.cn.scrollbarGlyph).data(t.repeat,t.keyFun);Nt.enter().append("line").classed(c.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",c.scrollbarWidth).attr("stroke-linecap","round").attr("y1",c.scrollbarWidth/2),Nt.attr("y2",function(Jt){return Jt.scrollbarState.barLength-c.scrollbarWidth/2}).attr("stroke-opacity",function(Jt){return Jt.columnDragInProgress||!Jt.scrollbarState.barWiggleRoom||dt?0:.4}),Nt.transition().delay(0).duration(0),Nt.transition().delay(c.scrollbarHideDelay).duration(c.scrollbarHideDuration).attr("stroke-opacity",0);var te=Ft.selectAll("."+c.cn.scrollbarCaptureZone).data(t.repeat,t.keyFun);te.enter().append("line").classed(c.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",c.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(Jt){var Qt=g.event.y,Wt=this.getBoundingClientRect(),gt=Jt.scrollbarState,bt=Qt-Wt.top,vt=g.scale.linear().domain([0,gt.scrollableAreaHeight]).range([0,gt.totalHeight]).clamp(!0);gt.topY<=bt&&bt<=gt.bottomY||rt(it,ot,null,vt(bt-gt.barLength/2))(Jt)}).call(g.behavior.drag().origin(function(Jt){return g.event.stopPropagation(),Jt.scrollbarState.scrollbarScrollInProgress=!0,Jt}).on("drag",rt(it,ot)).on("dragend",function(){})),te.attr("y2",function(Jt){return Jt.scrollbarState.scrollableAreaHeight}),it._context.staticPlot&&(Nt.remove(),te.remove())}function x(ot,it,dt,wt){var xt=b(dt),Ft=S(xt);u(Ft);var Et=T(Ft);k(Et);var Nt=w(Ft),te=M(Nt);f(te),_(te,it,wt,ot),st(Ft)}function b(ot){var it=ot.selectAll("."+c.cn.columnCells).data(t.repeat,t.keyFun);return it.enter().append("g").classed(c.cn.columnCells,!0),it.exit().remove(),it}function S(ot){var it=ot.selectAll("."+c.cn.columnCell).data(s.splitToCells,function(dt){return dt.keyWithinBlock});return it.enter().append("g").classed(c.cn.columnCell,!0),it.exit().remove(),it}function T(ot){var it=ot.selectAll("."+c.cn.cellRect).data(t.repeat,function(dt){return dt.keyWithinBlock});return it.enter().append("rect").classed(c.cn.cellRect,!0),it}function M(ot){var it=ot.selectAll("."+c.cn.cellText).data(t.repeat,function(dt){return dt.keyWithinBlock});return it.enter().append("text").classed(c.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){g.event.stopPropagation()}),it}function w(ot){var it=ot.selectAll("."+c.cn.cellTextHolder).data(t.repeat,function(dt){return dt.keyWithinBlock});return it.enter().append("g").classed(c.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),it}function u(ot){ot.each(function(it,dt){var wt=it.calcdata.cells.font,xt=it.column.specIndex,Ft={size:B(wt.size,xt,dt),color:B(wt.color,xt,dt),family:B(wt.family,xt,dt),weight:B(wt.weight,xt,dt),style:B(wt.style,xt,dt),variant:B(wt.variant,xt,dt),textcase:B(wt.textcase,xt,dt),lineposition:B(wt.lineposition,xt,dt),shadow:B(wt.shadow,xt,dt)};it.rowNumber=it.key,it.align=B(it.calcdata.cells.align,xt,dt),it.cellBorderWidth=B(it.calcdata.cells.line.width,xt,dt),it.font=Ft})}function f(ot){ot.each(function(it){e.font(g.select(this),it.font)})}function k(ot){ot.attr("width",function(it){return it.column.columnWidth}).attr("stroke-width",function(it){return it.cellBorderWidth}).each(function(it){var dt=g.select(this);h.stroke(dt,B(it.calcdata.cells.line.color,it.column.specIndex,it.rowNumber)),h.fill(dt,B(it.calcdata.cells.fill.color,it.column.specIndex,it.rowNumber))})}function _(ot,it,dt,wt){ot.text(function(xt){var Ft=xt.column.specIndex,Et=xt.rowNumber,Nt=xt.value,te=typeof Nt=="string",Jt=te&&Nt.match(/<br>/i),Qt=!te||Jt;xt.mayHaveMarkup=te&&Nt.match(/[<&>]/);var Wt=D(Nt);xt.latex=Wt;var gt=Wt?"":B(xt.calcdata.cells.prefix,Ft,Et)||"",bt=Wt?"":B(xt.calcdata.cells.suffix,Ft,Et)||"",vt=Wt?null:B(xt.calcdata.cells.format,Ft,Et)||null,Ut=gt+(vt?A(vt)(xt.value):xt.value)+bt,Kt;xt.wrappingNeeded=!xt.wrapped&&!Qt&&!Wt&&(Kt=I(Ut)),xt.cellHeightMayIncrease=Jt||Wt||xt.mayHaveMarkup||(Kt===void 0?I(Ut):Kt),xt.needsConvertToTspans=xt.mayHaveMarkup||xt.wrappingNeeded||xt.latex;var Zt;if(xt.wrappingNeeded){var le=c.wrapSplitCharacter===" "?Ut.replace(/<a href=/ig,"<a_href="):Ut,Te=le.split(c.wrapSplitCharacter),Se=c.wrapSplitCharacter===" "?Te.map(function(Fe){return Fe.replace(/<a_href=/ig,"<a href=")}):Te;xt.fragments=Se.map(function(Fe){return{text:Fe,width:null}}),xt.fragments.push({fragment:c.wrapSpacer,width:null}),Zt=Se.join(c.lineBreaker)+c.lineBreaker+c.wrapSpacer}else delete xt.fragments,Zt=Ut;return Zt}).attr("dy",function(xt){return xt.needsConvertToTspans?0:"0.75em"}).each(function(xt){var Ft=this,Et=g.select(Ft),Nt=xt.wrappingNeeded?lt:tt;xt.needsConvertToTspans?r.convertToTspans(Et,wt,Nt(dt,Ft,it,wt,xt)):g.select(Ft.parentNode).attr("transform",function(te){return n(Z(te),c.cellPad)}).attr("text-anchor",function(te){return{left:"start",center:"middle",right:"end"}[te.align]})})}function D(ot){return typeof ot=="string"&&ot.match(c.latexCheck)}function I(ot){return ot.indexOf(c.wrapSplitCharacter)!==-1}function O(ot,it,dt){var wt=it.gdColumnsOriginalOrder;it.gdColumns.sort(function(xt,Ft){return dt[wt.indexOf(xt)]-dt[wt.indexOf(Ft)]}),it.columnorder=dt,ot.emit("plotly_restyle")}function B(ot,it,dt){if(E.isArrayOrTypedArray(ot)){var wt=ot[Math.min(it,ot.length-1)];return E.isArrayOrTypedArray(wt)?wt[Math.min(dt,wt.length-1)]:wt}else return ot}function R(ot,it,dt){ot.transition().ease(c.releaseTransitionEase).duration(c.releaseTransitionDuration).attr("transform",n(it.x,dt))}function L(ot){return ot.type==="cells"}function F(ot){return ot.type==="header"}function N(ot){var it=ot.rowBlocks.length?ot.rowBlocks[0].auxiliaryBlocks:[];return it.reduce(function(dt,wt){return dt+Q(wt,1/0)},0)}function j(ot,it,dt){for(var wt=[],xt=0,Ft=0;Ft<ot.length;Ft++){for(var Et=ot[Ft],Nt=Et.rows,te=0,Jt=0;Jt<Nt.length;Jt++)te+=Nt[Jt].rowHeight;Et.allRowsHeight=te;var Qt=xt+te,Wt=it,gt=Wt+dt;Wt<Qt&>>xt&&wt.push(Ft),xt+=te}return wt}function G(ot,it,dt){var wt=y(it)[0];if(wt!==void 0){var xt=wt.rowBlocks,Ft=wt.calcdata,Et=$(xt,xt.length),Nt=wt.calcdata.groupHeight-N(wt),te=Ft.scrollY=Math.max(0,Math.min(Et-Nt,Ft.scrollY)),Jt=j(xt,te,Nt);Jt.length===1&&(Jt[0]===xt.length-1?Jt.unshift(Jt[0]-1):Jt.push(Jt[0]+1)),Jt[0]%2&&Jt.reverse(),it.each(function(Qt,Wt){Qt.page=Jt[Wt],Qt.scrollY=te}),it.attr("transform",function(Qt){var Wt=$(Qt.rowBlocks,Qt.page)-Qt.scrollY;return n(0,Wt)}),ot&&(ct(ot,dt,it,Jt,wt.prevPages,wt,0),ct(ot,dt,it,Jt,wt.prevPages,wt,1),l(dt,ot))}}function rt(ot,it,dt,wt){return function(xt){var Ft=xt.calcdata?xt.calcdata:xt,Et=it.filter(function(Qt){return Ft.key===Qt.key}),Nt=dt||Ft.scrollbarState.dragMultiplier,te=Ft.scrollY;Ft.scrollY=wt===void 0?Ft.scrollY+Nt*g.event.dy:wt;var Jt=Et.selectAll("."+c.cn.yColumn).selectAll("."+c.cn.columnBlock).filter(L);return G(ot,Jt,Et),Ft.scrollY===te}}function ct(ot,it,dt,wt,xt,Ft,Et){var Nt=wt[Et]!==xt[Et];Nt&&(clearTimeout(Ft.currentRepaint[Et]),Ft.currentRepaint[Et]=setTimeout(function(){var te=dt.filter(function(Jt,Qt){return Qt===Et&&wt[Qt]!==xt[Qt]});x(ot,it,te,dt),xt[Et]=wt[Et]}))}function lt(ot,it,dt,wt){return function(){var xt=g.select(it.parentNode);xt.each(function(Ft){var Et=Ft.fragments;xt.selectAll("tspan.line").each(function(vt,Ut){Et[Ut].width=this.getComputedTextLength()});var Nt=Et[Et.length-1].width,te=Et.slice(0,-1),Jt=[],Qt,Wt,gt=0,bt=Ft.column.columnWidth-2*c.cellPad;for(Ft.value="";te.length;)Qt=te.shift(),Wt=Qt.width+Nt,gt+Wt>bt&&(Ft.value+=Jt.join(c.wrapSpacer)+c.lineBreaker,Jt=[],gt=0),Jt.push(Qt.text),gt+=Wt;gt&&(Ft.value+=Jt.join(c.wrapSpacer)),Ft.wrapped=!0}),xt.selectAll("tspan.line").remove(),_(xt.select("."+c.cn.cellText),dt,ot,wt),g.select(it.parentNode.parentNode).call(st)}}function tt(ot,it,dt,wt,xt){return function(){if(!xt.settledY){var Ft=g.select(it.parentNode),Et=Y(xt),Nt=xt.key-Et.firstRowIndex,te=Et.rows[Nt].rowHeight,Jt=xt.cellHeightMayIncrease?it.parentNode.getBoundingClientRect().height+2*c.cellPad:te,Qt=Math.max(Jt,te),Wt=Qt-Et.rows[Nt].rowHeight;Wt&&(Et.rows[Nt].rowHeight=Qt,ot.selectAll("."+c.cn.columnCell).call(st),G(null,ot.filter(L),0),l(dt,wt,!0)),Ft.attr("transform",function(){var gt=this,bt=gt.parentNode,vt=bt.getBoundingClientRect(),Ut=g.select(gt.parentNode).select("."+c.cn.cellRect).node().getBoundingClientRect(),Kt=gt.transform.baseVal.consolidate(),Zt=Ut.top-vt.top+(Kt?Kt.matrix.f:c.cellPad);return n(Z(xt,g.select(gt.parentNode).select("."+c.cn.cellTextHolder).node().getBoundingClientRect().width),Zt)}),xt.settledY=!0}}}function Z(ot,it){switch(ot.align){case"left":return c.cellPad;case"right":return ot.column.columnWidth-(it||0)-c.cellPad;case"center":return(ot.column.columnWidth-(it||0))/2;default:return c.cellPad}}function st(ot){ot.attr("transform",function(it){var dt=it.rowBlocks[0].auxiliaryBlocks.reduce(function(Et,Nt){return Et+Q(Nt,1/0)},0),wt=Y(it),xt=Q(wt,it.key),Ft=xt+dt;return n(0,Ft)}).selectAll("."+c.cn.cellRect).attr("height",function(it){return q(Y(it),it.key).rowHeight})}function $(ot,it){for(var dt=0,wt=it-1;wt>=0;wt--)dt+=nt(ot[wt]);return dt}function Q(ot,it){for(var dt=0,wt=0;wt<ot.rows.length&&ot.rows[wt].rowIndex<it;wt++)dt+=ot.rows[wt].rowHeight;return dt}function nt(ot){var it=ot.allRowsHeight;if(it!==void 0)return it;for(var dt=0,wt=0;wt<ot.rows.length;wt++)dt+=ot.rows[wt].rowHeight;return ot.allRowsHeight=dt,dt}function Y(ot){return ot.rowBlocks[ot.page]}function q(ot,it){return ot.rows[it-ot.firstRowIndex]}}),BL=Vt(X=>{var V=Ph().getModuleCalcData,c=O5(),g="table";X.name=g,X.plot=function(E){var A=V(E.calcdata,g)[0];A.length&&c(E,A)},X.clean=function(E,A,t,e){var r=e._has&&e._has(g),i=A._has&&A._has(g);r&&!i&&e._paperdiv.selectAll(".table").remove()}}),RL=Vt((X,V)=>{V.exports={attributes:D5(),supplyDefaults:DL(),calc:zL(),plot:O5(),moduleType:"trace",name:"table",basePlotModule:BL(),categories:["noOpacity"],meta:{}}}),jL=Vt((X,V)=>{V.exports=RL()}),NL=Vt((X,V)=>{var c=Nl(),g=Hc(),E=Ih(),A=qu().descriptionWithDates,t=su().overrideAll,e=Eh().dash,r=po().extendFlat;V.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:c({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:E.autotypenumbers,autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},labelalias:r({},E.labelalias,{editType:"calc"}),tickfont:c({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"calc"},minexponent:{valType:"number",dflt:3,min:0,editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc",description:A("tick label")},tickformatstops:t(E.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:g.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},griddash:r({},e,{editType:"calc"}),showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgriddash:r({},e,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:g.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}}),$x=Vt((X,V)=>{var c=Nl(),g=NL(),E=Hc(),A=c({editType:"calc"}),t=Gu().zorder;A.family.dflt='"Open Sans", verdana, arial, sans-serif',A.size.dflt=12,A.color.dflt=E.defaultLine,V.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:g,baxis:g,font:A,color:{valType:"color",dflt:E.defaultLine,editType:"plot"},zorder:t}}),UL=Vt((X,V)=>{var c=qr().isArray1D;V.exports=function(g,E,A){var t=A("x"),e=t&&t.length,r=A("y"),i=r&&r.length;if(!e&&!i)return!1;if(E._cheater=!t,(!e||c(t))&&(!i||c(r))){var n=e?t.length:1/0;i&&(n=Math.min(n,r.length)),E.a&&E.a.length&&(n=Math.min(n,E.a.length)),E.b&&E.b.length&&(n=Math.min(n,E.b.length)),E._length=n}else E._length=null;return!0}}),VL=Vt((X,V)=>{var c=$x(),g=vi().addOpacity,E=Mi(),A=qr(),t=l0(),e=Ad(),r=Md(),i=Yy(),n=xp(),o=bg();V.exports=function(s,h,v){var m=v.letter,p=v.font||{},y=c[m+"axis"];function l(N,j){return A.coerce(s,h,y,N,j)}function x(N,j){return A.coerce2(s,h,y,N,j)}v.name&&(h._name=v.name,h._id=v.name),l("autotypenumbers",v.autotypenumbersDflt);var b=l("type");if(b==="-"&&(v.data&&a(h,v.data),h.type==="-"?h.type="linear":b=s.type=h.type),l("smoothing"),l("cheatertype"),l("showticklabels"),l("labelprefix",m+" = "),l("labelsuffix"),l("showtickprefix"),l("showticksuffix"),l("separatethousands"),l("tickformat"),l("exponentformat"),l("minexponent"),l("showexponent"),l("categoryorder"),l("tickmode"),l("tickvals"),l("ticktext"),l("tick0"),l("dtick"),h.tickmode==="array"&&(l("arraytick0"),l("arraydtick")),l("labelpadding"),h._hovertitle=m,b==="date"){var S=E.getComponentMethod("calendars","handleDefaults");S(s,h,"calendar",v.calendar)}n(h,v.fullLayout),h.c2p=A.identity;var T=l("color",v.dfltColor),M=T===s.color?T:p.color,w=l("title.text");w&&(A.coerceFont(l,"title.font",p,{overrideDflt:{size:A.bigFont(p.size),color:M}}),l("title.offset")),l("tickangle");var u=l("autorange",!h.isValidRange(s.range));u&&l("rangemode"),l("range"),h.cleanRange(),l("fixedrange"),t(s,h,l,b),r(s,h,l,b,v),e(s,h,l,b,v),i(s,h,l,{data:v.data,dataAttr:m});var f=x("gridcolor",g(T,.3)),k=x("gridwidth"),_=x("griddash"),D=l("showgrid");D||(delete h.gridcolor,delete h.gridwidth,delete h.griddash);var I=x("startlinecolor",T),O=x("startlinewidth",k),B=l("startline",h.showgrid||!!I||!!O);B||(delete h.startlinecolor,delete h.startlinewidth);var R=x("endlinecolor",T),L=x("endlinewidth",k),F=l("endline",h.showgrid||!!R||!!L);return F||(delete h.endlinecolor,delete h.endlinewidth),D?(l("minorgridcount"),l("minorgridwidth",k),l("minorgriddash",_),l("minorgridcolor",g(f,.06)),h.minorgridcount||(delete h.minorgridwidth,delete h.minorgriddash,delete h.minorgridcolor)):(delete h.gridcolor,delete h.gridwidth,delete h.griddash),h.showticklabels==="none"&&(delete h.tickfont,delete h.tickangle,delete h.showexponent,delete h.exponentformat,delete h.minexponent,delete h.tickformat,delete h.showticksuffix,delete h.showtickprefix),h.showticksuffix||delete h.ticksuffix,h.showtickprefix||delete h.tickprefix,l("tickmode"),h};function a(s,h){if(s.type==="-"){var v=s._id,m=v.charAt(0),p=m+"calendar",y=s[p];s.type=o(h,y,{autotypenumbers:s.autotypenumbers})}}}),qL=Vt((X,V)=>{var c=VL(),g=Ns();V.exports=function(A,t,e,r,i){var n=r("a");n||(r("da"),r("a0"));var o=r("b");o||(r("db"),r("b0")),E(A,t,e,i)};function E(A,t,e,r){var i=["aaxis","baxis"];i.forEach(function(n){var o=n.charAt(0),a=A[n]||{},s=g.newContainer(t,n),h={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:"x",id:o+"axis",letter:o,font:t.font,name:n,data:A[o],calendar:t.calendar,dfltColor:r,bgColor:e.paper_bgcolor,autotypenumbersDflt:e.autotypenumbers,fullLayout:e};c(a,s,h),s._categories=s._categories||[],!A[n]&&a.type!=="-"&&(A[n]={type:a.type})})}}),HL=Vt((X,V)=>{var c=qr(),g=UL(),E=qL(),A=$x(),t=Hc();V.exports=function(e,r,i,n){function o(h,v){return c.coerce(e,r,A,h,v)}r._clipPathId="clip"+r.uid+"carpet";var a=o("color",t.defaultLine);if(c.coerceFont(o,"font",n.font),o("carpet"),E(e,r,n,o,a),!r.a||!r.b){r.visible=!1;return}r.a.length<3&&(r.aaxis.smoothing=0),r.b.length<3&&(r.baxis.smoothing=0);var s=g(e,r,o);s||(r.visible=!1),r._cheater&&o("cheaterslope"),o("zorder")}}),F5=Vt((X,V)=>{var c=qr().isArrayOrTypedArray;V.exports=function(g,E,A){var t;for(c(g)?g.length>E.length&&(g=g.slice(0,E.length)):g=[],t=0;t<E.length;t++)g[t]=A(E[t]);return g}}),B5=Vt((X,V)=>{V.exports=function(c,g,E){if(c.length===0)return"";var A,t=[],e=E?3:1;for(A=0;A<c.length;A+=e)t.push(c[A]+","+g[A]),E&&A<c.length-e&&(t.push("C"),t.push([c[A+1]+","+g[A+1],c[A+2]+","+g[A+2]+" "].join(" ")));return t.join(E?"":"L")}}),GL=Vt((X,V)=>{V.exports=function(c,g,E,A,t,e){var r=t[0]*c.dpdx(g),i=t[1]*c.dpdy(E),n=1,o=1;if(e){var a=Math.sqrt(t[0]*t[0]+t[1]*t[1]),s=Math.sqrt(e[0]*e[0]+e[1]*e[1]),h=(t[0]*e[0]+t[1]*e[1])/a/s;o=Math.max(0,h)}var v=Math.atan2(i,r)*180/Math.PI;return v<-90?(v+=180,n=-n):v>90&&(v-=180,n=-n),{angle:v,flip:n,p:c.c2p(A,g,E),offsetMultplier:o}}}),WL=Vt((X,V)=>{var c=Ai(),g=go(),E=F5(),A=B5(),t=GL(),e=sl(),r=qr(),i=r.strRotate,n=r.strTranslate,o=nh();V.exports=function(l,x,b,S){var T=l._context.staticPlot,M=x.xaxis,w=x.yaxis,u=l._fullLayout,f=u._clips;r.makeTraceGroups(S,b,"trace").each(function(k){var _=c.select(this),D=k[0],I=D.trace,O=I.aaxis,B=I.baxis,R=r.ensureSingle(_,"g","minorlayer"),L=r.ensureSingle(_,"g","majorlayer"),F=r.ensureSingle(_,"g","boundarylayer"),N=r.ensureSingle(_,"g","labellayer");_.style("opacity",I.opacity),s(M,w,L,O,"a",O._gridlines,!0),s(M,w,L,B,"b",B._gridlines,!0),s(M,w,R,O,"a",O._minorgridlines,!0),s(M,w,R,B,"b",B._minorgridlines,!0),s(M,w,F,O,"a-boundary",O._boundarylines,T),s(M,w,F,B,"b-boundary",B._boundarylines,T);var j=h(l,M,w,I,D,N,O._labels,"a-label"),G=h(l,M,w,I,D,N,B._labels,"b-label");v(l,N,I,D,M,w,j,G),a(I,D,f,M,w)})};function a(l,x,b,S,T){var M,w,u,f,k=b.select("#"+l._clipPathId);k.size()||(k=b.append("clipPath").classed("carpetclip",!0));var _=r.ensureSingle(k,"path","carpetboundary"),D=x.clipsegments,I=[];for(f=0;f<D.length;f++)M=D[f],w=E([],M.x,S.c2p),u=E([],M.y,T.c2p),I.push(A(w,u,M.bicubic));var O="M"+I.join("L")+"Z";k.attr("id",l._clipPathId),_.attr("d",O)}function s(l,x,b,S,T,M,w){var u="const-"+T+"-lines",f=b.selectAll("."+u).data(M);f.enter().append("path").classed(u,!0).style("vector-effect",w?"none":"non-scaling-stroke"),f.each(function(k){var _=k,D=_.x,I=_.y,O=E([],D,l.c2p),B=E([],I,x.c2p),R="M"+A(O,B,_.smoothing),L=c.select(this);L.attr("d",R).style("stroke-width",_.width).style("stroke",_.color).style("stroke-dasharray",g.dashStyle(_.dash,_.width)).style("fill","none")}),f.exit().remove()}function h(l,x,b,S,T,M,w,u){var f=M.selectAll("text."+u).data(w);f.enter().append("text").classed(u,!0);var k=0,_={};return f.each(function(D,I){var O;if(D.axis.tickangle==="auto")O=t(S,x,b,D.xy,D.dxy);else{var B=(D.axis.tickangle+180)*Math.PI/180;O=t(S,x,b,D.xy,[Math.cos(B),Math.sin(B)])}I||(_={angle:O.angle,flip:O.flip});var R=(D.endAnchor?-1:1)*O.flip,L=c.select(this).attr({"text-anchor":R>0?"start":"end","data-notex":1}).call(g.font,D.font).text(D.text).call(e.convertToTspans,l),F=g.bBox(this);L.attr("transform",n(O.p[0],O.p[1])+i(O.angle)+n(D.axis.labelpadding*R,F.height*.3)),k=Math.max(k,F.width+D.axis.labelpadding)}),f.exit().remove(),_.maxExtent=k,_}function v(l,x,b,S,T,M,w,u){var f,k,_,D,I=r.aggNums(Math.min,null,b.a),O=r.aggNums(Math.max,null,b.a),B=r.aggNums(Math.min,null,b.b),R=r.aggNums(Math.max,null,b.b);f=.5*(I+O),k=B,_=b.ab2xy(f,k,!0),D=b.dxyda_rough(f,k),w.angle===void 0&&r.extendFlat(w,t(b,T,M,_,b.dxydb_rough(f,k))),y(l,x,b,S,_,D,b.aaxis,T,M,w,"a-title"),f=I,k=.5*(B+R),_=b.ab2xy(f,k,!0),D=b.dxydb_rough(f,k),u.angle===void 0&&r.extendFlat(u,t(b,T,M,_,b.dxyda_rough(f,k))),y(l,x,b,S,_,D,b.baxis,T,M,u,"b-title")}var m=o.LINE_SPACING,p=(1-o.MID_SHIFT)/m+1;function y(l,x,b,S,T,M,w,u,f,k,_){var D=[];w.title.text&&D.push(w.title.text);var I=x.selectAll("text."+_).data(D),O=k.maxExtent;I.enter().append("text").classed(_,!0),I.each(function(){var B=t(b,u,f,T,M);["start","both"].indexOf(w.showticklabels)===-1&&(O=0);var R=w.title.font.size;O+=R+w.title.offset;var L=k.angle+(k.flip<0?180:0),F=(L-B.angle+450)%360,N=F>90&&F<270,j=c.select(this);j.text(w.title.text).call(e.convertToTspans,l),N&&(O=(-e.lineCount(j)+p)*m*R-O),j.attr("transform",n(B.p[0],B.p[1])+i(B.angle)+n(0,O)).attr("text-anchor","middle").call(g.font,w.title.font)}),I.exit().remove()}}),ZL=Vt((X,V)=>{var c=qr().isArrayOrTypedArray;V.exports=function(g,E,A){var t,e,r,i,n,o,a=[],s=c(g)?g.length:g,h=c(E)?E.length:E,v=c(g)?g:null,m=c(E)?E:null;v&&(r=(v.length-1)/(v[v.length-1]-v[0])/(s-1)),m&&(i=(m.length-1)/(m[m.length-1]-m[0])/(h-1));var p,y=1/0,l=-1/0;for(e=0;e<h;e++)for(a[e]=[],o=m?(m[e]-m[0])*i:e/(h-1),t=0;t<s;t++)n=v?(v[t]-v[0])*r:t/(s-1),p=n-o*A,y=Math.min(p,y),l=Math.max(p,l),a[e][t]=p;var x=1/(l-y),b=-y*x;for(e=0;e<h;e++)for(t=0;t<s;t++)a[e][t]=x*a[e][t]+b;return a}}),XL=Vt((X,V)=>{var c=qr().isArrayOrTypedArray;V.exports=function(E){return g(E,0)};function g(E,A){if(!c(E)||A>=10)return null;for(var t=1/0,e=-1/0,r=E.length,i=0;i<r;i++){var n=E[i];if(c(n)){var o=g(n,A+1);o&&(t=Math.min(o[0],t),e=Math.max(o[1],e))}else t=Math.min(n,t),e=Math.max(n,e)}return[t,e]}}),$L=Vt((X,V)=>{var c=ao(),g=po().extendFlat;V.exports=function(E,A,t){var e,r,i,n,o,a,s,h,v,m,p,y,l,x,b=E["_"+A],S=E[A+"axis"],T=S._gridlines=[],M=S._minorgridlines=[],w=S._boundarylines=[],u=E["_"+t],f=E[t+"axis"];S.tickmode==="array"&&(S.tickvals=b.slice());var k=E._xctrl,_=E._yctrl,D=k[0].length,I=k.length,O=E._a.length,B=E._b.length;c.prepTicks(S),S.tickmode==="array"&&delete S.tickvals;var R=S.smoothing?3:1;function L(N){var j,G,rt,ct,lt,tt,Z,st,$,Q,nt,Y,q=[],ot=[],it={};if(A==="b")for(G=E.b2j(N),rt=Math.floor(Math.max(0,Math.min(B-2,G))),ct=G-rt,it.length=B,it.crossLength=O,it.xy=function(dt){return E.evalxy([],dt,G)},it.dxy=function(dt,wt){return E.dxydi([],dt,rt,wt,ct)},j=0;j<O;j++)tt=Math.min(O-2,j),Z=j-tt,st=E.evalxy([],j,G),f.smoothing&&j>0&&($=E.dxydi([],j-1,rt,0,ct),q.push(lt[0]+$[0]/3),ot.push(lt[1]+$[1]/3),Q=E.dxydi([],j-1,rt,1,ct),q.push(st[0]-Q[0]/3),ot.push(st[1]-Q[1]/3)),q.push(st[0]),ot.push(st[1]),lt=st;else for(j=E.a2i(N),tt=Math.floor(Math.max(0,Math.min(O-2,j))),Z=j-tt,it.length=O,it.crossLength=B,it.xy=function(dt){return E.evalxy([],j,dt)},it.dxy=function(dt,wt){return E.dxydj([],tt,dt,Z,wt)},G=0;G<B;G++)rt=Math.min(B-2,G),ct=G-rt,st=E.evalxy([],j,G),f.smoothing&&G>0&&(nt=E.dxydj([],tt,G-1,Z,0),q.push(lt[0]+nt[0]/3),ot.push(lt[1]+nt[1]/3),Y=E.dxydj([],tt,G-1,Z,1),q.push(st[0]-Y[0]/3),ot.push(st[1]-Y[1]/3)),q.push(st[0]),ot.push(st[1]),lt=st;return it.axisLetter=A,it.axis=S,it.crossAxis=f,it.value=N,it.constvar=t,it.index=h,it.x=q,it.y=ot,it.smoothing=f.smoothing,it}function F(N){var j,G,rt,ct,lt,tt=[],Z=[],st={};if(st.length=b.length,st.crossLength=u.length,A==="b")for(rt=Math.max(0,Math.min(B-2,N)),lt=Math.min(1,Math.max(0,N-rt)),st.xy=function($){return E.evalxy([],$,N)},st.dxy=function($,Q){return E.dxydi([],$,rt,Q,lt)},j=0;j<D;j++)tt[j]=k[N*R][j],Z[j]=_[N*R][j];else for(G=Math.max(0,Math.min(O-2,N)),ct=Math.min(1,Math.max(0,N-G)),st.xy=function($){return E.evalxy([],N,$)},st.dxy=function($,Q){return E.dxydj([],G,$,ct,Q)},j=0;j<I;j++)tt[j]=k[j][N*R],Z[j]=_[j][N*R];return st.axisLetter=A,st.axis=S,st.crossAxis=f,st.value=b[N],st.constvar=t,st.index=N,st.x=tt,st.y=Z,st.smoothing=f.smoothing,st}if(S.tickmode==="array"){for(n=5e-15,o=[Math.floor((b.length-1-S.arraytick0)/S.arraydtick*(1+n)),Math.ceil(-S.arraytick0/S.arraydtick/(1+n))].sort(function(N,j){return N-j}),a=o[0]-1,s=o[1]+1,h=a;h<s;h++)r=S.arraytick0+S.arraydtick*h,!(r<0||r>b.length-1)&&T.push(g(F(r),{color:S.gridcolor,width:S.gridwidth,dash:S.griddash}));for(h=a;h<s;h++)if(i=S.arraytick0+S.arraydtick*h,p=Math.min(i+S.arraydtick,b.length-1),!(i<0||i>b.length-1)&&!(p<0||p>b.length-1))for(y=b[i],l=b[p],e=0;e<S.minorgridcount;e++)x=p-i,!(x<=0)&&(m=y+(l-y)*(e+1)/(S.minorgridcount+1)*(S.arraydtick/x),!(m<b[0]||m>b[b.length-1])&&M.push(g(L(m),{color:S.minorgridcolor,width:S.minorgridwidth,dash:S.minorgriddash})));S.startline&&w.push(g(F(0),{color:S.startlinecolor,width:S.startlinewidth})),S.endline&&w.push(g(F(b.length-1),{color:S.endlinecolor,width:S.endlinewidth}))}else{for(n=5e-15,o=[Math.floor((b[b.length-1]-S.tick0)/S.dtick*(1+n)),Math.ceil((b[0]-S.tick0)/S.dtick/(1+n))].sort(function(N,j){return N-j}),a=o[0],s=o[1],h=a;h<=s;h++)v=S.tick0+S.dtick*h,T.push(g(L(v),{color:S.gridcolor,width:S.gridwidth,dash:S.griddash}));for(h=a-1;h<s+1;h++)for(v=S.tick0+S.dtick*h,e=0;e<S.minorgridcount;e++)m=v+S.dtick*(e+1)/(S.minorgridcount+1),!(m<b[0]||m>b[b.length-1])&&M.push(g(L(m),{color:S.minorgridcolor,width:S.minorgridwidth,dash:S.minorgriddash}));S.startline&&w.push(g(L(b[0]),{color:S.startlinecolor,width:S.startlinewidth})),S.endline&&w.push(g(L(b[b.length-1]),{color:S.endlinecolor,width:S.endlinewidth}))}}}),JL=Vt((X,V)=>{var c=ao(),g=po().extendFlat;V.exports=function(E,A){var t,e,r,i,n,o=A._labels=[],a=A._gridlines;for(t=0;t<a.length;t++)n=a[t],["start","both"].indexOf(A.showticklabels)!==-1&&(e=c.tickText(A,n.value),g(e,{prefix:r,suffix:i,endAnchor:!0,xy:n.xy(0),dxy:n.dxy(0,0),axis:n.axis,length:n.crossAxis.length,font:n.axis.tickfont,isFirst:t===0,isLast:t===a.length-1}),o.push(e)),["end","both"].indexOf(A.showticklabels)!==-1&&(e=c.tickText(A,n.value),g(e,{endAnchor:!1,xy:n.xy(n.crossLength-1),dxy:n.dxy(n.crossLength-2,1),axis:n.axis,length:n.crossAxis.length,font:n.axis.tickfont,isFirst:t===0,isLast:t===a.length-1}),o.push(e))}}),QL=Vt((X,V)=>{V.exports=function(c,g,E,A){var t,e,r,i=[],n=!!E.smoothing,o=!!A.smoothing,a=c[0].length-1,s=c.length-1;for(t=0,e=[],r=[];t<=a;t++)e[t]=c[0][t],r[t]=g[0][t];for(i.push({x:e,y:r,bicubic:n}),t=0,e=[],r=[];t<=s;t++)e[t]=c[t][a],r[t]=g[t][a];for(i.push({x:e,y:r,bicubic:o}),t=a,e=[],r=[];t>=0;t--)e[a-t]=c[s][t],r[a-t]=g[s][t];for(i.push({x:e,y:r,bicubic:n}),t=s,e=[],r=[];t>=0;t--)e[s-t]=c[t][0],r[s-t]=g[t][0];return i.push({x:e,y:r,bicubic:o}),i}}),YL=Vt((X,V)=>{var c=qr();V.exports=function(g,E,A){var t,e,r,i=[],n=[],o=g[0].length,a=g.length;function s(G,rt){var ct=0,lt,tt=0;return G>0&&(lt=g[rt][G-1])!==void 0&&(tt++,ct+=lt),G<o-1&&(lt=g[rt][G+1])!==void 0&&(tt++,ct+=lt),rt>0&&(lt=g[rt-1][G])!==void 0&&(tt++,ct+=lt),rt<a-1&&(lt=g[rt+1][G])!==void 0&&(tt++,ct+=lt),ct/Math.max(1,tt)}var h=0;for(t=0;t<o;t++)for(e=0;e<a;e++)g[e][t]===void 0&&(i.push(t),n.push(e),g[e][t]=s(t,e)),h=Math.max(h,Math.abs(g[e][t]));if(!i.length)return g;var v,m,p,y,l,x,b,S,T,M,w,u=1e-5,f=0,k=100,_=0,D=i.length;do{for(f=0,r=0;r<D;r++){t=i[r],e=n[r];var I=0,O=0,B,R,L,F,N,j;t===0?(N=Math.min(o-1,2),L=E[N],F=E[1],B=g[e][N],R=g[e][1],O+=R+(R-B)*(E[0]-F)/(F-L),I++):t===o-1&&(N=Math.max(0,o-3),L=E[N],F=E[o-2],B=g[e][N],R=g[e][o-2],O+=R+(R-B)*(E[o-1]-F)/(F-L),I++),(t===0||t===o-1)&&e>0&&e<a-1&&(v=A[e+1]-A[e],m=A[e]-A[e-1],O+=(m*g[e+1][t]+v*g[e-1][t])/(m+v),I++),e===0?(j=Math.min(a-1,2),L=A[j],F=A[1],B=g[j][t],R=g[1][t],O+=R+(R-B)*(A[0]-F)/(F-L),I++):e===a-1&&(j=Math.max(0,a-3),L=A[j],F=A[a-2],B=g[j][t],R=g[a-2][t],O+=R+(R-B)*(A[a-1]-F)/(F-L),I++),(e===0||e===a-1)&&t>0&&t<o-1&&(v=E[t+1]-E[t],m=E[t]-E[t-1],O+=(m*g[e][t+1]+v*g[e][t-1])/(m+v),I++),I?O/=I:(p=E[t+1]-E[t],y=E[t]-E[t-1],l=A[e+1]-A[e],x=A[e]-A[e-1],b=p*y*(p+y),S=l*x*(l+x),O=(b*(x*g[e+1][t]+l*g[e-1][t])+S*(y*g[e][t+1]+p*g[e][t-1]))/(S*(y+p)+b*(x+l))),T=O-g[e][t],M=T/h,f+=M*M,w=I?0:.85,g[e][t]+=T*(1+w)}f=Math.sqrt(f)}while(_++<k&&f>u);return c.log("Smoother converged to",f,"after",_,"iterations"),g}}),KL=Vt((X,V)=>{V.exports={RELATIVE_CULL_TOLERANCE:1e-6}}),tC=Vt((X,V)=>{var c=.5;V.exports=function(g,E,A,t){var e=g[0]-E[0],r=g[1]-E[1],i=A[0]-E[0],n=A[1]-E[1],o=Math.pow(e*e+r*r,c/2),a=Math.pow(i*i+n*n,c/2),s=(a*a*e-o*o*i)*t,h=(a*a*r-o*o*n)*t,v=a*(o+a)*3,m=o*(o+a)*3;return[[E[0]+(v&&s/v),E[1]+(v&&h/v)],[E[0]-(m&&s/m),E[1]-(m&&h/m)]]}}),eC=Vt((X,V)=>{var c=tC(),g=qr().ensureArray;function E(A,t,e){var r=-.5*e[0]+1.5*t[0],i=-.5*e[1]+1.5*t[1];return[(2*r+A[0])/3,(2*i+A[1])/3]}V.exports=function(A,t,e,r,i,n){var o,a,s,h,v,m,p,y,l,x,b=e[0].length,S=e.length,T=i?3*b-2:b,M=n?3*S-2:S;for(A=g(A,M),t=g(t,M),s=0;s<M;s++)A[s]=g(A[s],T),t[s]=g(t[s],T);for(a=0,h=0;a<S;a++,h+=n?3:1)for(v=A[h],m=t[h],p=e[a],y=r[a],o=0,s=0;o<b;o++,s+=i?3:1)v[s]=p[o],m[s]=y[o];if(i)for(a=0,h=0;a<S;a++,h+=n?3:1){for(o=1,s=3;o<b-1;o++,s+=3)l=c([e[a][o-1],r[a][o-1]],[e[a][o],r[a][o]],[e[a][o+1],r[a][o+1]],i),A[h][s-1]=l[0][0],t[h][s-1]=l[0][1],A[h][s+1]=l[1][0],t[h][s+1]=l[1][1];x=E([A[h][0],t[h][0]],[A[h][2],t[h][2]],[A[h][3],t[h][3]]),A[h][1]=x[0],t[h][1]=x[1],x=E([A[h][T-1],t[h][T-1]],[A[h][T-3],t[h][T-3]],[A[h][T-4],t[h][T-4]]),A[h][T-2]=x[0],t[h][T-2]=x[1]}if(n)for(s=0;s<T;s++){for(h=3;h<M-3;h+=3)l=c([A[h-3][s],t[h-3][s]],[A[h][s],t[h][s]],[A[h+3][s],t[h+3][s]],n),A[h-1][s]=l[0][0],t[h-1][s]=l[0][1],A[h+1][s]=l[1][0],t[h+1][s]=l[1][1];x=E([A[0][s],t[0][s]],[A[2][s],t[2][s]],[A[3][s],t[3][s]]),A[1][s]=x[0],t[1][s]=x[1],x=E([A[M-1][s],t[M-1][s]],[A[M-3][s],t[M-3][s]],[A[M-4][s],t[M-4][s]]),A[M-2][s]=x[0],t[M-2][s]=x[1]}if(i&&n)for(h=1;h<M;h+=(h+1)%3===0?2:1){for(s=3;s<T-3;s+=3)l=c([A[h][s-3],t[h][s-3]],[A[h][s],t[h][s]],[A[h][s+3],t[h][s+3]],i),A[h][s-1]=.5*(A[h][s-1]+l[0][0]),t[h][s-1]=.5*(t[h][s-1]+l[0][1]),A[h][s+1]=.5*(A[h][s+1]+l[1][0]),t[h][s+1]=.5*(t[h][s+1]+l[1][1]);x=E([A[h][0],t[h][0]],[A[h][2],t[h][2]],[A[h][3],t[h][3]]),A[h][1]=.5*(A[h][1]+x[0]),t[h][1]=.5*(t[h][1]+x[1]),x=E([A[h][T-1],t[h][T-1]],[A[h][T-3],t[h][T-3]],[A[h][T-4],t[h][T-4]]),A[h][T-2]=.5*(A[h][T-2]+x[0]),t[h][T-2]=.5*(t[h][T-2]+x[1])}return[A,t]}}),rC=Vt((X,V)=>{V.exports=function(c,g,E,A,t){var e=g-2,r=E-2;return A&&t?function(i,n,o){i||(i=[]);var a,s,h,v,m,p,y=Math.max(0,Math.min(Math.floor(n),e)),l=Math.max(0,Math.min(Math.floor(o),r)),x=Math.max(0,Math.min(1,n-y)),b=Math.max(0,Math.min(1,o-l));y*=3,l*=3;var S=x*x,T=S*x,M=1-x,w=M*M,u=w*M,f=b*b,k=f*b,_=1-b,D=_*_,I=D*_;for(p=0;p<c.length;p++)m=c[p],a=u*m[l][y]+3*(w*x*m[l][y+1]+M*S*m[l][y+2])+T*m[l][y+3],s=u*m[l+1][y]+3*(w*x*m[l+1][y+1]+M*S*m[l+1][y+2])+T*m[l+1][y+3],h=u*m[l+2][y]+3*(w*x*m[l+2][y+1]+M*S*m[l+2][y+2])+T*m[l+2][y+3],v=u*m[l+3][y]+3*(w*x*m[l+3][y+1]+M*S*m[l+3][y+2])+T*m[l+3][y+3],i[p]=I*a+3*(D*b*s+_*f*h)+k*v;return i}:A?function(i,n,o){i||(i=[]);var a=Math.max(0,Math.min(Math.floor(n),e)),s=Math.max(0,Math.min(Math.floor(o),r)),h=Math.max(0,Math.min(1,n-a)),v=Math.max(0,Math.min(1,o-s)),m,p,y,l,x,b;a*=3;var S=h*h,T=S*h,M=1-h,w=M*M,u=w*M,f=1-v;for(x=0;x<c.length;x++)b=c[x],m=f*b[s][a]+v*b[s+1][a],p=f*b[s][a+1]+v*b[s+1][a+1],y=f*b[s][a+2]+v*b[s+1][a+1],l=f*b[s][a+3]+v*b[s+1][a+1],i[x]=u*m+3*(w*h*p+M*S*y)+T*l;return i}:t?function(i,n,o){i||(i=[]);var a=Math.max(0,Math.min(Math.floor(n),e)),s=Math.max(0,Math.min(Math.floor(o),r)),h=Math.max(0,Math.min(1,n-a)),v=Math.max(0,Math.min(1,o-s)),m,p,y,l,x,b;s*=3;var S=v*v,T=S*v,M=1-v,w=M*M,u=w*M,f=1-h;for(x=0;x<c.length;x++)b=c[x],m=f*b[s][a]+h*b[s][a+1],p=f*b[s+1][a]+h*b[s+1][a+1],y=f*b[s+2][a]+h*b[s+2][a+1],l=f*b[s+3][a]+h*b[s+3][a+1],i[x]=u*m+3*(w*v*p+M*S*y)+T*l;return i}:function(i,n,o){i||(i=[]);var a=Math.max(0,Math.min(Math.floor(n),e)),s=Math.max(0,Math.min(Math.floor(o),r)),h=Math.max(0,Math.min(1,n-a)),v=Math.max(0,Math.min(1,o-s)),m,p,y,l,x=1-v,b=1-h;for(y=0;y<c.length;y++)l=c[y],m=b*l[s][a]+h*l[s][a+1],p=b*l[s+1][a]+h*l[s+1][a+1],i[y]=x*m+v*p;return i}}}),nC=Vt((X,V)=>{V.exports=function(c,g,E){return g&&E?function(A,t,e,r,i){A||(A=[]);var n,o,a,s,h,v;t*=3,e*=3;var m=r*r,p=1-r,y=p*p,l=p*r*2,x=-3*y,b=3*(y-l),S=3*(l-m),T=3*m,M=i*i,w=M*i,u=1-i,f=u*u,k=f*u;for(v=0;v<c.length;v++)h=c[v],n=x*h[e][t]+b*h[e][t+1]+S*h[e][t+2]+T*h[e][t+3],o=x*h[e+1][t]+b*h[e+1][t+1]+S*h[e+1][t+2]+T*h[e+1][t+3],a=x*h[e+2][t]+b*h[e+2][t+1]+S*h[e+2][t+2]+T*h[e+2][t+3],s=x*h[e+3][t]+b*h[e+3][t+1]+S*h[e+3][t+2]+T*h[e+3][t+3],A[v]=k*n+3*(f*i*o+u*M*a)+w*s;return A}:g?function(A,t,e,r,i){A||(A=[]);var n,o,a,s;t*=3;var h=r*r,v=1-r,m=v*v,p=v*r*2,y=-3*m,l=3*(m-p),x=3*(p-h),b=3*h,S=1-i;for(a=0;a<c.length;a++)s=c[a],n=y*s[e][t]+l*s[e][t+1]+x*s[e][t+2]+b*s[e][t+3],o=y*s[e+1][t]+l*s[e+1][t+1]+x*s[e+1][t+2]+b*s[e+1][t+3],A[a]=S*n+i*o;return A}:E?function(A,t,e,r,i){A||(A=[]);var n,o,a,s,h,v;e*=3;var m=i*i,p=m*i,y=1-i,l=y*y,x=l*y;for(h=0;h<c.length;h++)v=c[h],n=v[e][t+1]-v[e][t],o=v[e+1][t+1]-v[e+1][t],a=v[e+2][t+1]-v[e+2][t],s=v[e+3][t+1]-v[e+3][t],A[h]=x*n+3*(l*i*o+y*m*a)+p*s;return A}:function(A,t,e,r,i){A||(A=[]);var n,o,a,s,h=1-i;for(a=0;a<c.length;a++)s=c[a],n=s[e][t+1]-s[e][t],o=s[e+1][t+1]-s[e+1][t],A[a]=h*n+i*o;return A}}}),aC=Vt((X,V)=>{V.exports=function(c,g,E){return g&&E?function(A,t,e,r,i){A||(A=[]);var n,o,a,s,h,v;t*=3,e*=3;var m=r*r,p=m*r,y=1-r,l=y*y,x=l*y,b=i*i,S=1-i,T=S*S,M=S*i*2,w=-3*T,u=3*(T-M),f=3*(M-b),k=3*b;for(v=0;v<c.length;v++)h=c[v],n=w*h[e][t]+u*h[e+1][t]+f*h[e+2][t]+k*h[e+3][t],o=w*h[e][t+1]+u*h[e+1][t+1]+f*h[e+2][t+1]+k*h[e+3][t+1],a=w*h[e][t+2]+u*h[e+1][t+2]+f*h[e+2][t+2]+k*h[e+3][t+2],s=w*h[e][t+3]+u*h[e+1][t+3]+f*h[e+2][t+3]+k*h[e+3][t+3],A[v]=x*n+3*(l*r*o+y*m*a)+p*s;return A}:g?function(A,t,e,r,i){A||(A=[]);var n,o,a,s,h,v;t*=3;var m=i*i,p=m*i,y=1-i,l=y*y,x=l*y;for(h=0;h<c.length;h++)v=c[h],n=v[e+1][t]-v[e][t],o=v[e+1][t+1]-v[e][t+1],a=v[e+1][t+2]-v[e][t+2],s=v[e+1][t+3]-v[e][t+3],A[h]=x*n+3*(l*i*o+y*m*a)+p*s;return A}:E?function(A,t,e,r,i){A||(A=[]);var n,o,a,s;e*=3;var h=1-r,v=i*i,m=1-i,p=m*m,y=m*i*2,l=-3*p,x=3*(p-y),b=3*(y-v),S=3*v;for(a=0;a<c.length;a++)s=c[a],n=l*s[e][t]+x*s[e+1][t]+b*s[e+2][t]+S*s[e+3][t],o=l*s[e][t+1]+x*s[e+1][t+1]+b*s[e+2][t+1]+S*s[e+3][t+1],A[a]=h*n+r*o;return A}:function(A,t,e,r,i){A||(A=[]);var n,o,a,s,h=1-r;for(a=0;a<c.length;a++)s=c[a],n=s[e+1][t]-s[e][t],o=s[e+1][t+1]-s[e][t+1],A[a]=h*n+r*o;return A}}}),iC=Vt((X,V)=>{var c=KL(),g=Fy().findBin,E=eC(),A=rC(),t=nC(),e=aC();V.exports=function(r){var i=r._a,n=r._b,o=i.length,a=n.length,s=r.aaxis,h=r.baxis,v=i[0],m=i[o-1],p=n[0],y=n[a-1],l=i[i.length-1]-i[0],x=n[n.length-1]-n[0],b=l*c.RELATIVE_CULL_TOLERANCE,S=x*c.RELATIVE_CULL_TOLERANCE;v-=b,m+=b,p-=S,y+=S,r.isVisible=function(T,M){return T>v&&T<m&&M>p&&M<y},r.isOccluded=function(T,M){return T<v||T>m||M<p||M>y},r.setScale=function(){var T=r._x,M=r._y,w=E(r._xctrl,r._yctrl,T,M,s.smoothing,h.smoothing);r._xctrl=w[0],r._yctrl=w[1],r.evalxy=A([r._xctrl,r._yctrl],o,a,s.smoothing,h.smoothing),r.dxydi=t([r._xctrl,r._yctrl],s.smoothing,h.smoothing),r.dxydj=e([r._xctrl,r._yctrl],s.smoothing,h.smoothing)},r.i2a=function(T){var M=Math.max(0,Math.floor(T[0]),o-2),w=T[0]-M;return(1-w)*i[M]+w*i[M+1]},r.j2b=function(T){var M=Math.max(0,Math.floor(T[1]),o-2),w=T[1]-M;return(1-w)*n[M]+w*n[M+1]},r.ij2ab=function(T){return[r.i2a(T[0]),r.j2b(T[1])]},r.a2i=function(T){var M=Math.max(0,Math.min(g(T,i),o-2)),w=i[M],u=i[M+1];return Math.max(0,Math.min(o-1,M+(T-w)/(u-w)))},r.b2j=function(T){var M=Math.max(0,Math.min(g(T,n),a-2)),w=n[M],u=n[M+1];return Math.max(0,Math.min(a-1,M+(T-w)/(u-w)))},r.ab2ij=function(T){return[r.a2i(T[0]),r.b2j(T[1])]},r.i2c=function(T,M){return r.evalxy([],T,M)},r.ab2xy=function(T,M,w){if(!w&&(T<i[0]||T>i[o-1]|M<n[0]||M>n[a-1]))return[!1,!1];var u=r.a2i(T),f=r.b2j(M),k=r.evalxy([],u,f);if(w){var _=0,D=0,I=[],O,B,R,L;T<i[0]?(O=0,B=0,_=(T-i[0])/(i[1]-i[0])):T>i[o-1]?(O=o-2,B=1,_=(T-i[o-1])/(i[o-1]-i[o-2])):(O=Math.max(0,Math.min(o-2,Math.floor(u))),B=u-O),M<n[0]?(R=0,L=0,D=(M-n[0])/(n[1]-n[0])):M>n[a-1]?(R=a-2,L=1,D=(M-n[a-1])/(n[a-1]-n[a-2])):(R=Math.max(0,Math.min(a-2,Math.floor(f))),L=f-R),_&&(r.dxydi(I,O,R,B,L),k[0]+=I[0]*_,k[1]+=I[1]*_),D&&(r.dxydj(I,O,R,B,L),k[0]+=I[0]*D,k[1]+=I[1]*D)}return k},r.c2p=function(T,M,w){return[M.c2p(T[0]),w.c2p(T[1])]},r.p2x=function(T,M,w){return[M.p2c(T[0]),w.p2c(T[1])]},r.dadi=function(T){var M=Math.max(0,Math.min(i.length-2,T));return i[M+1]-i[M]},r.dbdj=function(T){var M=Math.max(0,Math.min(n.length-2,T));return n[M+1]-n[M]},r.dxyda=function(T,M,w,u){var f=r.dxydi(null,T,M,w,u),k=r.dadi(T,w);return[f[0]/k,f[1]/k]},r.dxydb=function(T,M,w,u){var f=r.dxydj(null,T,M,w,u),k=r.dbdj(M,u);return[f[0]/k,f[1]/k]},r.dxyda_rough=function(T,M,w){var u=l*(w||.1),f=r.ab2xy(T+u,M,!0),k=r.ab2xy(T-u,M,!0);return[(f[0]-k[0])*.5/u,(f[1]-k[1])*.5/u]},r.dxydb_rough=function(T,M,w){var u=x*(w||.1),f=r.ab2xy(T,M+u,!0),k=r.ab2xy(T,M-u,!0);return[(f[0]-k[0])*.5/u,(f[1]-k[1])*.5/u]},r.dpdx=function(T){return T._m},r.dpdy=function(T){return T._m}}}),oC=Vt((X,V)=>{var c=ao(),g=qr().isArray1D,E=ZL(),A=XL(),t=$L(),e=JL(),r=QL(),i=g1(),n=YL(),o=d1(),a=iC();V.exports=function(s,h){var v=c.getFromId(s,h.xaxis),m=c.getFromId(s,h.yaxis),p=h.aaxis,y=h.baxis,l=h.x,x=h.y,b=[];l&&g(l)&&b.push("x"),x&&g(x)&&b.push("y"),b.length&&o(h,p,y,"a","b",b);var S=h._a=h._a||h.a,T=h._b=h._b||h.b;l=h._x||h.x,x=h._y||h.y;var M={};if(h._cheater){var w=p.cheatertype==="index"?S.length:S,u=y.cheatertype==="index"?T.length:T;l=E(w,u,h.cheaterslope)}h._x=l=i(l),h._y=x=i(x),n(l,S,T),n(x,S,T),a(h),h.setScale();var f=A(l),k=A(x),_=.5*(f[1]-f[0]),D=.5*(f[1]+f[0]),I=.5*(k[1]-k[0]),O=.5*(k[1]+k[0]),B=1.3;return f=[D-_*B,D+_*B],k=[O-I*B,O+I*B],h._extremes[v._id]=c.findExtremes(v,f,{padded:!0}),h._extremes[m._id]=c.findExtremes(m,k,{padded:!0}),t(h,"a","b"),t(h,"b","a"),e(h,p),e(h,y),M.clipsegments=r(h._xctrl,h._yctrl,p,y),M.x=l,M.y=x,M.a=S,M.b=T,[M]}}),sC=Vt((X,V)=>{V.exports={attributes:$x(),supplyDefaults:HL(),plot:WL(),calc:oC(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Pc(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}),lC=Vt((X,V)=>{V.exports=sC()}),R5=Vt((X,V)=>{var c=rp(),g=Gu(),E=Ks(),A=Zo().hovertemplateAttrs,t=Zo().texttemplateAttrs,e=wl(),r=po().extendFlat,i=g.marker,n=g.line,o=i.line;V.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:r({},g.mode,{dflt:"markers"}),text:r({},g.text,{}),texttemplate:t({editType:"plot"},{keys:["a","b","text"]}),hovertext:r({},g.hovertext,{}),line:{color:n.color,width:n.width,dash:n.dash,backoff:n.backoff,shape:r({},n.shape,{values:["linear","spline"]}),smoothing:n.smoothing,editType:"calc"},connectgaps:g.connectgaps,fill:r({},g.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:c(),marker:r({symbol:i.symbol,opacity:i.opacity,maxdisplayed:i.maxdisplayed,angle:i.angle,angleref:i.angleref,standoff:i.standoff,size:i.size,sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,line:r({width:o.width,editType:"calc"},e("marker.line")),gradient:i.gradient,editType:"calc"},e("marker")),textfont:g.textfont,textposition:g.textposition,selected:g.selected,unselected:g.unselected,hoverinfo:r({},E.hoverinfo,{flags:["a","b","text","name"]}),hoveron:g.hoveron,hovertemplate:A(),zorder:g.zorder}}),uC=Vt((X,V)=>{var c=qr(),g=_p(),E=Sl(),A=Df(),t=Nf(),e=kg(),r=Uf(),i=ap(),n=R5();V.exports=function(o,a,s,h){function v(S,T){return c.coerce(o,a,n,S,T)}v("carpet"),a.xaxis="x",a.yaxis="y";var m=v("a"),p=v("b"),y=Math.min(m.length,p.length);if(!y){a.visible=!1;return}a._length=y,v("text"),v("texttemplate"),v("hovertext");var l=y<g.PTS_LINESONLY?"lines+markers":"lines";v("mode",l),E.hasMarkers(a)&&A(o,a,s,h,v,{gradient:!0}),E.hasLines(a)&&(t(o,a,s,h,v,{backoff:!0}),e(o,a,v),v("connectgaps")),E.hasText(a)&&r(o,a,h,v);var x=[];(E.hasMarkers(a)||E.hasText(a))&&(v("marker.maxdisplayed"),x.push("points")),v("fill"),a.fill!=="none"&&(i(o,a,s,v),E.hasLines(a)||e(o,a,v)),(a.fill==="tonext"||a.fill==="toself")&&x.push("fills");var b=v("hoveron",x.join("+")||"points");b!=="fills"&&v("hovertemplate"),v("zorder"),c.coerceSelectionMarkerOpacity(a,v)}}),cC=Vt((X,V)=>{V.exports=function(c,g){var E={},A=g._carpet,t=A.ab2ij([c.a,c.b]),e=Math.floor(t[0]),r=t[0]-e,i=Math.floor(t[1]),n=t[1]-i,o=A.evalxy([],e,i,r,n);return E.yLabel=o[1].toFixed(3),E}}),Jx=Vt((X,V)=>{V.exports=function(c,g){for(var E=c._fullData.length,A,t=0;t<E;t++){var e=c._fullData[t];if(e.index!==g.index&&e.type==="carpet"&&(A||(A=e),e.carpet===g.carpet))return e}return A}}),hC=Vt((X,V)=>{var c=vo(),g=Vf(),E=bp(),A=qf(),t=Hf().calcMarkerSize,e=Jx();V.exports=function(r,i){var n=i._carpetTrace=e(r,i);if(!(!n||!n.visible||n.visible==="legendonly")){var o;i.xaxis=n.xaxis,i.yaxis=n.yaxis;var a=i._length,s=new Array(a),h,v,m=!1;for(o=0;o<a;o++)if(h=i.a[o],v=i.b[o],c(h)&&c(v)){var p=n.ab2xy(+h,+v,!0),y=n.isVisible(+h,+v);y||(m=!0),s[o]={x:p[0],y:p[1],a:h,b:v,vis:y}}else s[o]={x:!1,y:!1};return i._needsCull=m,s[0].carpet=n,s[0].trace=i,t(i,a),g(r,i),E(s,i),A(s,i),s}}}),fC=Vt((X,V)=>{var c=Ag(),g=ao(),E=go();V.exports=function(A,t,e,r){var i,n,o,a=e[0][0].carpet,s=g.getFromId(A,a.xaxis||"x"),h=g.getFromId(A,a.yaxis||"y"),v={xaxis:s,yaxis:h,plot:t.plot};for(i=0;i<e.length;i++)n=e[i][0].trace,n._xA=s,n._yA=h;for(c(A,v,e,r),i=0;i<e.length;i++)n=e[i][0].trace,o=r.selectAll("g.trace"+n.uid+" .js-line"),E.setClipUrl(o,e[i][0].carpet._clipPathId,A)}}),pC=Vt((X,V)=>{var c=Sg(),g=qr().fillText;V.exports=function(E,A,t,e){var r=c(E,A,t,e);if(!r||r[0].index===!1)return;var i=r[0];if(i.index===void 0){var n=1-i.y0/E.ya._length,o=E.xa._length,a=o*n/2,s=o-a;return i.x0=Math.max(Math.min(i.x0,s),a),i.x1=Math.max(Math.min(i.x1,s),a),r}var h=i.cd[i.index];i.a=h.a,i.b=h.b,i.xLabelVal=void 0,i.yLabelVal=void 0;var v=i.trace,m=v._carpet,p=v._module.formatLabels(h,v);i.yLabel=p.yLabel,delete i.text;var y=[];function l(S,T){var M;S.labelprefix&&S.labelprefix.length>0?M=S.labelprefix.replace(/ = $/,""):M=S._hovertitle,y.push(M+": "+T.toFixed(3)+S.labelsuffix)}if(!v.hovertemplate){var x=h.hi||v.hoverinfo,b=x.split("+");b.indexOf("all")!==-1&&(b=["a","b","text"]),b.indexOf("a")!==-1&&l(m.aaxis,h.a),b.indexOf("b")!==-1&&l(m.baxis,h.b),y.push("y: "+i.yLabel),b.indexOf("text")!==-1&&g(h,v,y),i.extraText=y.join("<br>")}return r}}),dC=Vt((X,V)=>{V.exports=function(c,g,E,A,t){var e=A[t];return c.a=e.a,c.b=e.b,c.y=e.y,c}}),gC=Vt((X,V)=>{V.exports={attributes:R5(),supplyDefaults:uC(),colorbar:Wh(),formatLabels:cC(),calc:hC(),plot:fC(),style:yf().style,styleOnSelect:yf().styleOnSelect,hoverPoints:pC(),selectPoints:Eg(),eventData:dC(),moduleType:"trace",name:"scattercarpet",basePlotModule:Pc(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}),mC=Vt((X,V)=>{V.exports=gC()}),j5=Vt((X,V)=>{var c=Lg(),g=Qm(),E=wl(),A=po().extendFlat,t=g.contours;V.exports=A({carpet:{valType:"string",editType:"calc"},z:c.z,a:c.x,a0:c.x0,da:c.dx,b:c.y,b0:c.y0,db:c.dy,text:c.text,hovertext:c.hovertext,transpose:c.transpose,atype:c.xtype,btype:c.ytype,fillcolor:g.fillcolor,autocontour:g.autocontour,ncontours:g.ncontours,contours:{type:t.type,start:t.start,end:t.end,size:t.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:t.showlines,showlabels:t.showlabels,labelfont:t.labelfont,labelformat:t.labelformat,operation:t.operation,value:t.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:g.line.color,width:g.line.width,dash:g.line.dash,smoothing:g.line.smoothing,editType:"plot"},zorder:g.zorder},E("",{cLetter:"z",autoColorDflt:!1}))}),N5=Vt((X,V)=>{var c=qr(),g=p1(),E=j5(),A=v2(),t=S1(),e=E1();V.exports=function(r,i,n,o){function a(m,p){return c.coerce(r,i,E,m,p)}function s(m){return c.coerce2(r,i,E,m)}if(a("carpet"),r.a&&r.b){var h=g(r,i,a,o,"a","b");if(!h){i.visible=!1;return}a("text");var v=a("contours.type")==="constraint";v?A(r,i,a,o,n,{hasHover:!1}):(t(r,i,a,s),e(r,i,a,o,{hasHover:!1}))}else i._defaultColor=n,i._length=null;a("zorder")}}),vC=Vt((X,V)=>{var c=df(),g=qr(),E=d1(),A=g1(),t=m1(),e=v1(),r=e2(),i=N5(),n=Jx(),o=l2();V.exports=function(s,h){var v=h._carpetTrace=n(s,h);if(!(!v||!v.visible||v.visible==="legendonly")){if(!h.a||!h.b){var m=s.data[v.index],p=s.data[h.index];p.a||(p.a=m.a),p.b||(p.b=m.b),i(p,h,h._defaultColor,s._fullLayout)}var y=a(s,h);return o(h,h._z),y}};function a(s,h){var v=h._carpetTrace,m=v.aaxis,p=v.baxis,y,l,x,b,S,T,M;m._minDtick=0,p._minDtick=0,g.isArray1D(h.z)&&E(h,m,p,"a","b",["z"]),y=h._a=h._a||h.a,b=h._b=h._b||h.b,y=y?m.makeCalcdata(h,"_a"):[],b=b?p.makeCalcdata(h,"_b"):[],l=h.a0||0,x=h.da||1,S=h.b0||0,T=h.db||1,M=h._z=A(h._z||h.z,h.transpose),h._emptypoints=e(M),t(M,h._emptypoints);var w=g.maxRowLength(M),u=h.xtype==="scaled"?"":y,f=r(h,u,l,x,w,m),k=h.ytype==="scaled"?"":b,_=r(h,k,S,T,M.length,p),D={a:f,b:_,z:M};return h.contours.type==="levels"&&h.contours.coloring!=="none"&&c(s,h,{vals:M,containerStr:"",cLetter:"z"}),[D]}}),yC=Vt((X,V)=>{var c=qr().isArrayOrTypedArray;V.exports=function(g,E,A,t){var e,r,i,n,o,a,s,h,v,m,p,y,l,x=c(A)?"a":"b",b=x==="a"?g.aaxis:g.baxis,S=b.smoothing,T=x==="a"?g.a2i:g.b2j,M=x==="a"?A:t,w=x==="a"?t:A,u=x==="a"?E.a.length:E.b.length,f=x==="a"?E.b.length:E.a.length,k=Math.floor(x==="a"?g.b2j(w):g.a2i(w)),_=x==="a"?function(ct){return g.evalxy([],ct,k)}:function(ct){return g.evalxy([],k,ct)};S&&(i=Math.max(0,Math.min(f-2,k)),n=k-i,r=x==="a"?function(ct,lt){return g.dxydi([],ct,i,lt,n)}:function(ct,lt){return g.dxydj([],i,ct,n,lt)});var D=T(M[0]),I=T(M[1]),O=D<I?1:-1,B=(I-D)*1e-8,R=O>0?Math.floor:Math.ceil,L=O>0?Math.ceil:Math.floor,F=O>0?Math.min:Math.max,N=O>0?Math.max:Math.min,j=R(D+B),G=L(I-B);s=_(D);var rt=[[s]];for(e=j;e*O<G*O;e+=O)o=[],p=N(D,e),y=F(I,e+O),l=y-p,a=Math.max(0,Math.min(u-2,Math.floor(.5*(p+y)))),h=_(y),S&&(v=r(a,p-a),m=r(a,y-a),o.push([s[0]+v[0]/3*l,s[1]+v[1]/3*l]),o.push([h[0]-m[0]/3*l,h[1]-m[1]/3*l])),o.push(h),rt.push(o),s=h;return rt}}),xC=Vt((X,V)=>{var c=Ai(),g=F5(),E=B5(),A=go(),t=qr(),e=c2(),r=h2(),i=P1(),n=Km(),o=p2(),a=f2(),s=d2(),h=Jx(),v=yC();V.exports=function(w,u,f,k){var _=u.xaxis,D=u.yaxis;t.makeTraceGroups(k,f,"contour").each(function(I){var O=c.select(this),B=I[0],R=B.trace,L=R._carpetTrace=h(w,R),F=w.calcdata[L.index][0];if(!L.visible||L.visible==="legendonly")return;var N=B.a,j=B.b,G=R.contours,rt=a(G,u,B),ct=G.type==="constraint",lt=G._operation,tt=ct?lt==="="?"lines":"fill":G.coloring;function Z(xt){var Ft=L.ab2xy(xt[0],xt[1],!0);return[_.c2p(Ft[0]),D.c2p(Ft[1])]}var st=[[N[0],j[j.length-1]],[N[N.length-1],j[j.length-1]],[N[N.length-1],j[0]],[N[0],j[0]]];e(rt);var $=(N[N.length-1]-N[0])*1e-8,Q=(j[j.length-1]-j[0])*1e-8;r(rt,$,Q);var nt=rt;G.type==="constraint"&&(nt=o(rt,lt)),m(rt,Z);var Y,q,ot,it,dt=[];for(it=F.clipsegments.length-1;it>=0;it--)Y=F.clipsegments[it],q=g([],Y.x,_.c2p),ot=g([],Y.y,D.c2p),q.reverse(),ot.reverse(),dt.push(E(q,ot,Y.bicubic));var wt="M"+dt.join("L")+"Z";S(O,F.clipsegments,_,D,ct,tt),T(R,O,_,D,nt,st,Z,L,F,tt,wt),p(O,rt,w,B,G,u,L),A.setClipUrl(O,L._clipPathId,w)})};function m(w,u){var f,k,_,D,I,O,B,R,L;for(f=0;f<w.length;f++){for(D=w[f],I=D.pedgepaths=[],O=D.ppaths=[],k=0;k<D.edgepaths.length;k++){for(L=D.edgepaths[k],B=[],_=0;_<L.length;_++)B[_]=u(L[_]);I.push(B)}for(k=0;k<D.paths.length;k++){for(L=D.paths[k],R=[],_=0;_<L.length;_++)R[_]=u(L[_]);O.push(R)}}}function p(w,u,f,k,_,D,I){var O=f._context.staticPlot,B=t.ensureSingle(w,"g","contourlines"),R=_.showlines!==!1,L=_.showlabels,F=R&&L,N=i.createLines(B,R||L,u,O),j=i.createLineClip(B,F,f,k.trace.uid),G=w.selectAll("g.contourlabels").data(L?[0]:[]);if(G.exit().remove(),G.enter().append("g").classed("contourlabels",!0),L){var rt=D.xaxis,ct=D.yaxis,lt=rt._length,tt=ct._length,Z=[[[0,0],[lt,0],[lt,tt],[0,tt]]],st=[];t.clearLocationCache();var $=i.labelFormatter(f,k),Q=A.tester.append("text").attr("data-notex",1).call(A.font,_.labelfont),nt={left:0,right:lt,center:lt/2,top:0,bottom:tt,middle:tt/2},Y=Math.sqrt(lt*lt+tt*tt),q=n.LABELDISTANCE*Y/Math.max(1,u.length/n.LABELINCREASE);N.each(function(ot){var it=i.calcTextOpts(ot.level,$,Q,f);c.select(this).selectAll("path").each(function(dt){var wt=this,xt=t.getVisibleSegment(wt,nt,it.height/2);if(xt&&(y(wt,dt,ot,xt,I,it.height),!(xt.len<(it.width+it.height)*n.LABELMIN)))for(var Ft=Math.min(Math.ceil(xt.len/q),n.LABELMAX),Et=0;Et<Ft;Et++){var Nt=i.findBestTextLocation(wt,xt,it,st,nt);if(!Nt)break;i.addLabelData(Nt,it,st,Z)}})}),Q.remove(),i.drawLabels(G,st,f,j,F?Z:null)}L&&!R&&N.remove()}function y(w,u,f,k,_,D){for(var I,O=0;O<f.pedgepaths.length;O++)u===f.pedgepaths[O]&&(I=f.edgepaths[O]);if(!I)return;var B=_.a[0],R=_.a[_.a.length-1],L=_.b[0],F=_.b[_.b.length-1];function N(lt,tt){var Z=0,st,$=.1;return(Math.abs(lt[0]-B)<$||Math.abs(lt[0]-R)<$)&&(st=x(_.dxydb_rough(lt[0],lt[1],$)),Z=Math.max(Z,D*b(tt,st)/2)),(Math.abs(lt[1]-L)<$||Math.abs(lt[1]-F)<$)&&(st=x(_.dxyda_rough(lt[0],lt[1],$)),Z=Math.max(Z,D*b(tt,st)/2)),Z}var j=l(w,0,1),G=l(w,k.total,k.total-1),rt=N(I[0],j),ct=k.total-N(I[I.length-1],G);k.min<rt&&(k.min=rt),k.max>ct&&(k.max=ct),k.len=k.max-k.min}function l(w,u,f){var k=w.getPointAtLength(u),_=w.getPointAtLength(f),D=_.x-k.x,I=_.y-k.y,O=Math.sqrt(D*D+I*I);return[D/O,I/O]}function x(w){var u=Math.sqrt(w[0]*w[0]+w[1]*w[1]);return[w[0]/u,w[1]/u]}function b(w,u){var f=Math.abs(w[0]*u[0]+w[1]*u[1]),k=Math.sqrt(1-f*f);return k/f}function S(w,u,f,k,_,D){var I,O,B,R,L=t.ensureSingle(w,"g","contourbg"),F=L.selectAll("path").data(D==="fill"&&!_?[0]:[]);F.enter().append("path"),F.exit().remove();var N=[];for(R=0;R<u.length;R++)I=u[R],O=g([],I.x,f.c2p),B=g([],I.y,k.c2p),N.push(E(O,B,I.bicubic));F.attr("d","M"+N.join("L")+"Z").style("stroke","none")}function T(w,u,f,k,_,D,I,O,B,R,L){var F=R==="fill";F&&s(_,w.contours);var N=t.ensureSingle(u,"g","contourfill"),j=N.selectAll("path").data(F?_:[]);j.enter().append("path"),j.exit().remove(),j.each(function(G){var rt=(G.prefixBoundary?L:"")+M(w,G,D,I,O,B,f,k);rt?c.select(this).attr("d",rt).style("stroke","none"):c.select(this).remove()})}function M(w,u,f,k,_,D,I,O){var B,R="",L=u.edgepaths.map(function(it,dt){return dt}),F=!0,N,j,G,rt,ct,lt,tt=Math.abs(f[0][0]-f[2][0])*1e-4,Z=Math.abs(f[0][1]-f[2][1])*1e-4;function st(it){return Math.abs(it[1]-f[0][1])<Z}function $(it){return Math.abs(it[1]-f[2][1])<Z}function Q(it){return Math.abs(it[0]-f[0][0])<tt}function nt(it){return Math.abs(it[0]-f[2][0])<tt}function Y(it,dt){var wt,xt,Ft,Et,Nt="";for(st(it)&&!nt(it)||$(it)&&!Q(it)?(Et=_.aaxis,Ft=v(_,D,[it[0],dt[0]],.5*(it[1]+dt[1]))):(Et=_.baxis,Ft=v(_,D,.5*(it[0]+dt[0]),[it[1],dt[1]])),wt=1;wt<Ft.length;wt++)for(Nt+=Et.smoothing?"C":"L",xt=0;xt<Ft[wt].length;xt++){var te=Ft[wt][xt];Nt+=[I.c2p(te[0]),O.c2p(te[1])]+" "}return Nt}for(B=0,N=null;L.length;){var q=u.edgepaths[B][0];for(N&&(R+=Y(N,q)),lt=A.smoothopen(u.edgepaths[B].map(k),u.smoothing),R+=F?lt:lt.replace(/^M/,"L"),L.splice(L.indexOf(B),1),N=u.edgepaths[B][u.edgepaths[B].length-1],rt=-1,G=0;G<4;G++){if(!N){t.log("Missing end?",B,u);break}for(st(N)&&!nt(N)?j=f[1]:Q(N)?j=f[0]:$(N)?j=f[3]:nt(N)&&(j=f[2]),ct=0;ct<u.edgepaths.length;ct++){var ot=u.edgepaths[ct][0];Math.abs(N[0]-j[0])<tt?Math.abs(N[0]-ot[0])<tt&&(ot[1]-N[1])*(j[1]-ot[1])>=0&&(j=ot,rt=ct):Math.abs(N[1]-j[1])<Z?Math.abs(N[1]-ot[1])<Z&&(ot[0]-N[0])*(j[0]-ot[0])>=0&&(j=ot,rt=ct):t.log("endpt to newendpt is not vert. or horz.",N,j,ot)}if(rt>=0)break;R+=Y(N,j),N=j}if(rt===u.edgepaths.length){t.log("unclosed perimeter path");break}B=rt,F=L.indexOf(B)===-1,F&&(B=L[0],R+=Y(N,j)+"Z",N=null)}for(B=0;B<u.paths.length;B++)R+=A.smoothclosed(u.paths[B].map(k),u.smoothing);return R}}),_C=Vt((X,V)=>{V.exports={attributes:j5(),supplyDefaults:N5(),colorbar:L1(),calc:vC(),plot:xC(),style:I1(),moduleType:"trace",name:"contourcarpet",basePlotModule:Pc(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}),bC=Vt((X,V)=>{V.exports=_C()}),Qx=Vt((X,V)=>{var c=qr().extendFlat,g=Gu(),E=qu().axisHoverFormat,A=Eh().dash,t=dg(),e=Cg(),r=e.INCREASING.COLOR,i=e.DECREASING.COLOR,n=g.line;function o(a){return{line:{color:c({},n.color,{dflt:a}),width:n.width,dash:A,editType:"style"},editType:"style"}}V.exports={xperiod:g.xperiod,xperiod0:g.xperiod0,xperiodalignment:g.xperiodalignment,xhoverformat:E("x"),yhoverformat:E("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:c({},n.width,{}),dash:c({},A,{}),editType:"style"},increasing:o(r),decreasing:o(i),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:c({},t.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:g.zorder}}),U5=Vt((X,V)=>{var c=Mi(),g=qr();V.exports=function(E,A,t,e){var r=t("x"),i=t("open"),n=t("high"),o=t("low"),a=t("close");t("hoverlabel.split");var s=c.getComponentMethod("calendars","handleTraceDefaults");if(s(E,A,["x"],e),!!(i&&n&&o&&a)){var h=Math.min(i.length,n.length,o.length,a.length);return r&&(h=Math.min(h,g.minRowLength(r))),A._length=h,h}}}),wC=Vt((X,V)=>{var c=qr(),g=U5(),E=np(),A=Qx();V.exports=function(e,r,i,n){function o(s,h){return c.coerce(e,r,A,s,h)}var a=g(e,r,o,n);if(!a){r.visible=!1;return}E(e,r,n,o,{x:!0}),o("xhoverformat"),o("yhoverformat"),o("line.width"),o("line.dash"),t(e,r,o,"increasing"),t(e,r,o,"decreasing"),o("text"),o("hovertext"),o("tickwidth"),n._requestRangeslider[r.xaxis]=!0,o("zorder")};function t(e,r,i,n){i(n+".line.color"),i(n+".line.width",r.line.width),i(n+".line.dash",r.line.dash)}}),V5=Vt((X,V)=>{var c=qr(),g=c._,E=ao(),A=ip(),t=ts().BADNUM;function e(o,a){var s=E.getFromId(o,a.xaxis),h=E.getFromId(o,a.yaxis),v=n(o,s,a),m=a._minDiff;a._minDiff=null;var p=a._origX;a._origX=null;var y=a._xcalc;a._xcalc=null;var l=i(o,a,p,y,h,r);return a._extremes[s._id]=E.findExtremes(s,y,{vpad:m/2}),l.length?(c.extendFlat(l[0].t,{wHover:m/2,tickLen:v}),l):[{t:{empty:!0}}]}function r(o,a,s,h){return{o,h:a,l:s,c:h}}function i(o,a,s,h,v,m){for(var p=v.makeCalcdata(a,"open"),y=v.makeCalcdata(a,"high"),l=v.makeCalcdata(a,"low"),x=v.makeCalcdata(a,"close"),b=c.isArrayOrTypedArray(a.text),S=c.isArrayOrTypedArray(a.hovertext),T=!0,M=null,w=!!a.xperiodalignment,u=[],f=0;f<h.length;f++){var k=h[f],_=p[f],D=y[f],I=l[f],O=x[f];if(k!==t&&_!==t&&D!==t&&I!==t&&O!==t){O===_?M!==null&&O!==M&&(T=O>M):T=O>_,M=O;var B=m(_,D,I,O);B.pos=k,B.yc=(_+O)/2,B.i=f,B.dir=T?"increasing":"decreasing",B.x=B.pos,B.y=[I,D],w&&(B.orig_p=s[f]),b&&(B.tx=a.text[f]),S&&(B.htx=a.hovertext[f]),u.push(B)}else u.push({pos:k,empty:!0})}return a._extremes[v._id]=E.findExtremes(v,c.concat(l,y),{padded:!0}),u.length&&(u[0].t={labels:{open:g(o,"open:")+" ",high:g(o,"high:")+" ",low:g(o,"low:")+" ",close:g(o,"close:")+" "}}),u}function n(o,a,s){var h=s._minDiff;if(!h){var v=o._fullData,m=[];h=1/0;var p;for(p=0;p<v.length;p++){var y=v[p];if(y.type==="ohlc"&&y.visible===!0&&y.xaxis===a._id){m.push(y);var l=a.makeCalcdata(y,"x");y._origX=l;var x=A(s,a,"x",l).vals;y._xcalc=x;var b=c.distinctVals(x).minDiff;b&&isFinite(b)&&(h=Math.min(h,b))}}for(h===1/0&&(h=1),p=0;p<m.length;p++)m[p]._minDiff=h}return h*s.tickwidth}V.exports={calc:e,calcCommon:i}}),TC=Vt((X,V)=>{var c=Ai(),g=qr();V.exports=function(E,A,t,e){var r=A.yaxis,i=A.xaxis,n=!!i.rangebreaks;g.makeTraceGroups(e,t,"trace ohlc").each(function(o){var a=c.select(this),s=o[0],h=s.t,v=s.trace;if(v.visible!==!0||h.empty){a.remove();return}var m=h.tickLen,p=a.selectAll("path").data(g.identity);p.enter().append("path"),p.exit().remove(),p.attr("d",function(y){if(y.empty)return"M0,0Z";var l=i.c2p(y.pos-m,!0),x=i.c2p(y.pos+m,!0),b=n?(l+x)/2:i.c2p(y.pos,!0),S=r.c2p(y.o,!0),T=r.c2p(y.h,!0),M=r.c2p(y.l,!0),w=r.c2p(y.c,!0);return"M"+l+","+S+"H"+b+"M"+b+","+T+"V"+M+"M"+x+","+w+"H"+b})})}}),kC=Vt((X,V)=>{var c=Ai(),g=go(),E=vi();V.exports=function(A,t,e){var r=e||c.select(A).selectAll("g.ohlclayer").selectAll("g.trace");r.style("opacity",function(i){return i[0].trace.opacity}),r.each(function(i){var n=i[0].trace;c.select(this).selectAll("path").each(function(o){if(!o.empty){var a=n[o.dir].line;c.select(this).style("fill","none").call(E.stroke,a.color).call(g.dashLine,a.dash,a.width).style("opacity",n.selectedpoints&&!o.selected?.3:1)}})})}}),q5=Vt((X,V)=>{var c=ao(),g=qr(),E=Hu(),A=vi(),t=qr().fillText,e=Cg(),r={increasing:e.INCREASING.SYMBOL,decreasing:e.DECREASING.SYMBOL};function i(s,h,v,m){var p=s.cd,y=p[0].trace;return y.hoverlabel.split?o(s,h,v,m):a(s,h,v,m)}function n(s,h,v,m){var p=s.cd,y=s.xa,l=p[0].trace,x=p[0].t,b=l.type,S=b==="ohlc"?"l":"min",T=b==="ohlc"?"h":"max",M,w,u=x.bPos||0,f=function(G){return G.pos+u-h},k=x.bdPos||x.tickLen,_=x.wHover,D=Math.min(1,k/Math.abs(y.r2c(y.range[1])-y.r2c(y.range[0])));M=s.maxHoverDistance-D,w=s.maxSpikeDistance-D;function I(G){var rt=f(G);return E.inbox(rt-_,rt+_,M)}function O(G){var rt=G[S],ct=G[T];return rt===ct||E.inbox(rt-v,ct-v,M)}function B(G){return(I(G)+O(G))/2}var R=E.getDistanceFunction(m,I,O,B);if(E.getClosest(p,R,s),s.index===!1)return null;var L=p[s.index];if(L.empty)return null;var F=L.dir,N=l[F],j=N.line.color;return A.opacity(j)&&N.line.width?s.color=j:s.color=N.fillcolor,s.x0=y.c2p(L.pos+u-k,!0),s.x1=y.c2p(L.pos+u+k,!0),s.xLabelVal=L.orig_p!==void 0?L.orig_p:L.pos,s.spikeDistance=B(L)*w/M,s.xSpike=y.c2p(L.pos,!0),s}function o(s,h,v,m){var p=s.cd,y=s.ya,l=p[0].trace,x=p[0].t,b=[],S=n(s,h,v,m);if(!S)return[];var T=S.index,M=p[T],w=M.hi||l.hoverinfo,u=w.split("+"),f=w==="all",k=f||u.indexOf("y")!==-1;if(!k)return[];for(var _=["high","open","close","low"],D={},I=0;I<_.length;I++){var O=_[I],B=l[O][S.index],R=y.c2p(B,!0),L;B in D?(L=D[B],L.yLabel+="<br>"+x.labels[O]+c.hoverLabelText(y,B,l.yhoverformat)):(L=g.extendFlat({},S),L.y0=L.y1=R,L.yLabelVal=B,L.yLabel=x.labels[O]+c.hoverLabelText(y,B,l.yhoverformat),L.name="",b.push(L),D[B]=L)}return b}function a(s,h,v,m){var p=s.cd,y=s.ya,l=p[0].trace,x=p[0].t,b=n(s,h,v,m);if(!b)return[];var S=b.index,T=p[S],M=b.index=T.i,w=T.dir;function u(B){return x.labels[B]+c.hoverLabelText(y,l[B][M],l.yhoverformat)}var f=T.hi||l.hoverinfo,k=f.split("+"),_=f==="all",D=_||k.indexOf("y")!==-1,I=_||k.indexOf("text")!==-1,O=D?[u("open"),u("high"),u("low"),u("close")+" "+r[w]]:[];return I&&t(T,l,O),b.extraText=O.join("<br>"),b.y0=b.y1=y.c2p(T.yc,!0),[b]}V.exports={hoverPoints:i,hoverSplit:o,hoverOnPoints:a}}),H5=Vt((X,V)=>{V.exports=function(c,g){var E=c.cd,A=c.xaxis,t=c.yaxis,e=[],r,i=E[0].t.bPos||0;if(g===!1)for(r=0;r<E.length;r++)E[r].selected=0;else for(r=0;r<E.length;r++){var n=E[r];g.contains([A.c2p(n.pos+i),t.c2p(n.yc)],null,n.i,c)?(e.push({pointNumber:n.i,x:A.c2d(n.pos),y:t.c2d(n.yc)}),n.selected=1):n.selected=0}return e}}),AC=Vt((X,V)=>{V.exports={moduleType:"trace",name:"ohlc",basePlotModule:Pc(),categories:["cartesian","svg","showLegend"],meta:{},attributes:Qx(),supplyDefaults:wC(),calc:V5().calc,plot:TC(),style:kC(),hoverPoints:q5().hoverPoints,selectPoints:H5()}}),MC=Vt((X,V)=>{V.exports=AC()}),G5=Vt((X,V)=>{var c=qr().extendFlat,g=qu().axisHoverFormat,E=Qx(),A=Zm();function t(e){return{line:{color:c({},A.line.color,{dflt:e}),width:A.line.width,editType:"style"},fillcolor:A.fillcolor,editType:"style"}}V.exports={xperiod:E.xperiod,xperiod0:E.xperiod0,xperiodalignment:E.xperiodalignment,xhoverformat:g("x"),yhoverformat:g("y"),x:E.x,open:E.open,high:E.high,low:E.low,close:E.close,line:{width:c({},A.line.width,{}),editType:"style"},increasing:t(E.increasing.line.color.dflt),decreasing:t(E.decreasing.line.color.dflt),text:E.text,hovertext:E.hovertext,whiskerwidth:c({},A.whiskerwidth,{dflt:0}),hoverlabel:E.hoverlabel,zorder:A.zorder}}),SC=Vt((X,V)=>{var c=qr(),g=vi(),E=U5(),A=np(),t=G5();V.exports=function(r,i,n,o){function a(h,v){return c.coerce(r,i,t,h,v)}var s=E(r,i,a,o);if(!s){i.visible=!1;return}A(r,i,o,a,{x:!0}),a("xhoverformat"),a("yhoverformat"),a("line.width"),e(r,i,a,"increasing"),e(r,i,a,"decreasing"),a("text"),a("hovertext"),a("whiskerwidth"),o._requestRangeslider[i.xaxis]=!0,a("zorder")};function e(r,i,n,o){var a=n(o+".line.color");n(o+".line.width",i.line.width),n(o+".fillcolor",g.addOpacity(a,.5))}}),EC=Vt((X,V)=>{var c=qr(),g=ao(),E=ip(),A=V5().calcCommon;V.exports=function(e,r){var i=e._fullLayout,n=g.getFromId(e,r.xaxis),o=g.getFromId(e,r.yaxis),a=n.makeCalcdata(r,"x"),s=E(r,n,"x",a).vals,h=A(e,r,a,s,o,t);return h.length?(c.extendFlat(h[0].t,{num:i._numBoxes,dPos:c.distinctVals(s).minDiff/2,posLetter:"x",valLetter:"y"}),i._numBoxes++,h):[{t:{empty:!0}}]};function t(e,r,i,n){return{min:i,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:r}}}),PC=Vt((X,V)=>{V.exports={moduleType:"trace",name:"candlestick",basePlotModule:Pc(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:G5(),layoutAttributes:Xm(),supplyLayoutDefaults:u1().supplyLayoutDefaults,crossTraceCalc:c1().crossTraceCalc,supplyDefaults:SC(),calc:EC(),plot:h1().plot,layerName:"boxlayer",style:f1().style,hoverPoints:q5().hoverPoints,selectPoints:H5()}}),IC=Vt((X,V)=>{V.exports=PC()}),W5=Vt((X,V)=>{var c=qr(),g=xp(),E=c.deg2rad,A=c.rad2deg;V.exports=function(n,o,a){switch(g(n,a),n._id){case"x":case"radialaxis":t(n,o);break;case"angularaxis":i(n,o);break}};function t(n,o){var a=o._subplot;n.setGeometry=function(){var s=n._rl[0],h=n._rl[1],v=a.innerRadius,m=(a.radius-v)/(h-s),p=v/m,y=s>h?function(l){return l<=0}:function(l){return l>=0};n.c2g=function(l){var x=n.c2l(l)-s;return(y(x)?x:0)+p},n.g2c=function(l){return n.l2c(l+s-p)},n.g2p=function(l){return l*m},n.c2p=function(l){return n.g2p(n.c2g(l))}}}function e(n,o){return o==="degrees"?E(n):n}function r(n,o){return o==="degrees"?A(n):n}function i(n,o){var a=n.type;if(a==="linear"){var s=n.d2c,h=n.c2d;n.d2c=function(v,m){return e(s(v),m)},n.c2d=function(v,m){return h(r(v,m))}}n.makeCalcdata=function(v,m){var p=v[m],y=v._length,l,x,b=function(u){return n.d2c(u,v.thetaunit)};if(p)for(l=new Array(y),x=0;x<y;x++)l[x]=b(p[x]);else{var S=m+"0",T="d"+m,M=S in v?b(v[S]):0,w=v[T]?b(v[T]):(n.period||2*Math.PI)/y;for(l=new Array(y),x=0;x<y;x++)l[x]=M+x*w}return l},n.setGeometry=function(){var v=o.sector,m=v.map(E),p={clockwise:-1,counterclockwise:1}[n.direction],y=E(n.rotation),l=function(f){return p*f+y},x=function(f){return(f-y)/p},b,S,T,M;switch(a){case"linear":S=b=c.identity,M=E,T=A,n.range=c.isFullCircle(m)?[v[0],v[0]+360]:m.map(x).map(A);break;case"category":var w=n._categories.length,u=n.period?Math.max(n.period,w):w;u===0&&(u=1),S=M=function(f){return f*2*Math.PI/u},b=T=function(f){return f*u/Math.PI/2},n.range=[0,u];break}n.c2g=function(f){return l(S(f))},n.g2c=function(f){return b(x(f))},n.t2g=function(f){return l(M(f))},n.g2t=function(f){return T(x(f))}}}}),Yx=Vt((X,V)=>{V.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}}),Kx=Vt((X,V)=>{var c=qr(),g=Nm().tester,E=c.findIndexOfMin,A=c.isAngleInsideSector,t=c.angleDelta,e=c.angleDist;function r(x,b,S,T,M){if(!A(b,T))return!1;var w,u;S[0]<S[1]?(w=S[0],u=S[1]):(w=S[1],u=S[0]);var f=g(s(w,T[0],T[1],M)),k=g(s(u,T[0],T[1],M)),_=[x*Math.cos(b),x*Math.sin(b)];return k.contains(_)&&!f.contains(_)}function i(x,b,S,T){var M,w,u=T[0],f=T[1],k=m(Math.sin(b)-Math.sin(x)),_=m(Math.cos(b)-Math.cos(x)),D=Math.tan(S),I=m(1/D),O=k/_,B=f-O*u;return I?k&&_?(M=B/(D-O),w=D*M):_?(M=f*I,w=f):(M=u,w=u*D):k&&_?(M=0,w=B):_?(M=0,w=f):M=w=NaN,[M,w]}function n(x,b,S,T){var M=-b*S,w=b*b+1,u=2*(b*M-S),f=M*M+S*S-x*x,k=Math.sqrt(u*u-4*w*f),_=(-u+k)/(2*w),D=(-u-k)/(2*w);return[[_,b*_+M+T],[D,b*D+M+T]]}function o(x,b){var S=b.length,T=new Array(S+1),M;for(M=0;M<S;M++){var w=b[M];T[M]=[x*Math.cos(w),x*Math.sin(w)]}return T[M]=T[0].slice(),T}function a(x,b,S,T){var M=T.length,w=[],u,f;function k(N){return[x*Math.cos(N),x*Math.sin(N)]}function _(N,j,G){return i(N,j,G,k(N))}function D(N){return c.mod(N,M)}function I(N){return A(N,[b,S])}var O=E(T,function(N){return I(N)?e(N,b):1/0}),B=_(T[O],T[D(O-1)],b);for(w.push(B),u=O,f=0;f<M;u++,f++){var R=T[D(u)];if(!I(R))break;w.push(k(R))}var L=E(T,function(N){return I(N)?e(N,S):1/0}),F=_(T[L],T[D(L+1)],S);return w.push(F),w.push([0,0]),w.push(w[0].slice()),w}function s(x,b,S,T){return c.isFullCircle([b,S])?o(x,T):a(x,b,S,T)}function h(x,b,S,T){for(var M=1/0,w=1/0,u=s(x,b,S,T),f=0;f<u.length;f++){var k=u[f];M=Math.min(M,k[0]),w=Math.min(w,-k[1])}return[M,w]}function v(x,b){var S=function(w){var u=t(w,x);return u>0?u:1/0},T=E(b,S),M=c.mod(T+1,b.length);return[b[T],b[M]]}function m(x){return Math.abs(x)>1e-10?x:0}function p(x,b,S){b=b||0,S=S||0;for(var T=x.length,M=new Array(T),w=0;w<T;w++){var u=x[w];M[w]=[b+u[0],S-u[1]]}return M}function y(x,b,S,T,M,w){var u=s(x,b,S,T);return"M"+p(u,M,w).join("L")}function l(x,b,S,T,M,w,u){var f,k;x<b?(f=x,k=b):(f=b,k=x);var _=p(s(f,S,T,M),w,u),D=p(s(k,S,T,M),w,u);return"M"+D.reverse().join("L")+"M"+_.join("L")}V.exports={isPtInsidePolygon:r,findPolygonOffset:h,findEnclosingVertexAngles:v,findIntersectionXY:i,findXYatLength:n,clampTiny:m,pathPolygon:y,pathPolygonAnnulus:l}}),Z5=Vt((X,V)=>{function c(r){return r<0?-1:r>0?1:0}function g(r){var i=r[0],n=r[1];if(!isFinite(i)||!isFinite(n))return[1,0];var o=(i+1)*(i+1)+n*n;return[(i*i+n*n-1)/o,2*n/o]}function E(r,i){var n=i[0],o=i[1];return[n*r.radius+r.cx,-o*r.radius+r.cy]}function A(r,i){return i*r.radius}function t(r,i,n,o){var a=E(r,g([n,i])),s=a[0],h=a[1],v=E(r,g([o,i])),m=v[0],p=v[1];if(i===0)return["M"+s+","+h,"L"+m+","+p].join(" ");var y=A(r,1/Math.abs(i));return["M"+s+","+h,"A"+y+","+y+" 0 0,"+(i<0?1:0)+" "+m+","+p].join(" ")}function e(r,i,n,o){var a=A(r,1/(i+1)),s=E(r,g([i,n])),h=s[0],v=s[1],m=E(r,g([i,o])),p=m[0],y=m[1];if(c(n)!==c(o)){var l=E(r,g([i,0])),x=l[0],b=l[1];return["M"+h+","+v,"A"+a+","+a+" 0 0,"+(0<n?0:1)+" "+x+","+b,"A"+a+","+a+" 0 0,"+(o<0?0:1)+p+","+y].join(" ")}return["M"+h+","+v,"A"+a+","+a+" 0 0,"+(o<n?0:1)+" "+p+","+y].join(" ")}V.exports={smith:g,reactanceArc:t,resistanceArc:e,smithTransform:E}}),X5=Vt((X,V)=>{var c=Ai(),g=yh(),E=Mi(),A=qr(),t=A.strRotate,e=A.strTranslate,r=vi(),i=go(),n=fu(),o=ao(),a=xp(),s=W5(),h=Kf().doAutoRange,v=Ab(),m=af(),p=Hu(),y=u0(),l=fc().prepSelect,x=fc().selectOnClick,b=fc().clearOutline,S=tp(),T=Bm(),M=jm().redrawReglTraces,w=nh().MID_SHIFT,u=Yx(),f=Kx(),k=Z5(),_=k.smith,D=k.reactanceArc,I=k.resistanceArc,O=k.smithTransform,B=A._,R=A.mod,L=A.deg2rad,F=A.rad2deg;function N(tt,Z,st){this.isSmith=st||!1,this.id=Z,this.gd=tt,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var $=tt._fullLayout,Q="clip"+$._uid+Z;this.clipIds.forTraces=Q+"-for-traces",this.clipPaths.forTraces=$._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=$["_"+(st?"smith":"polar")+"layer"].append("g").attr("class",Z),this.getHole=function(nt){return this.isSmith?0:nt.hole},this.getSector=function(nt){return this.isSmith?[0,360]:nt.sector},this.getRadial=function(nt){return this.isSmith?nt.realaxis:nt.radialaxis},this.getAngular=function(nt){return this.isSmith?nt.imaginaryaxis:nt.angularaxis},st||(this.radialTickLayout=null,this.angularTickLayout=null)}var j=N.prototype;V.exports=function(tt,Z,st){return new N(tt,Z,st)},j.plot=function(tt,Z){for(var st=this,$=Z[st.id],Q=!1,nt=0;nt<tt.length;nt++){var Y=tt[nt][0].trace;if(Y.cliponaxis===!1){Q=!0;break}}st._hasClipOnAxisFalse=Q,st.updateLayers(Z,$),st.updateLayout(Z,$),n.generalUpdatePerTraceModule(st.gd,st,tt,$),st.updateFx(Z,$),st.isSmith&&(delete $.realaxis.range,delete $.imaginaryaxis.range)},j.updateLayers=function(tt,Z){var st=this,$=st.isSmith,Q=st.layers,nt=st.getRadial(Z),Y=st.getAngular(Z),q=u.layerNames,ot=q.indexOf("frontplot"),it=q.slice(0,ot),dt=Y.layer==="below traces",wt=nt.layer==="below traces";dt&&it.push("angular-line"),wt&&it.push("radial-line"),dt&&it.push("angular-axis"),wt&&it.push("radial-axis"),it.push("frontplot"),dt||it.push("angular-line"),wt||it.push("radial-line"),dt||it.push("angular-axis"),wt||it.push("radial-axis");var xt=($?"smith":"polar")+"sublayer",Ft=st.framework.selectAll("."+xt).data(it,String);Ft.enter().append("g").attr("class",function(Et){return xt+" "+Et}).each(function(Et){var Nt=Q[Et]=c.select(this);switch(Et){case"frontplot":$||Nt.append("g").classed("barlayer",!0),Nt.append("g").classed("scatterlayer",!0);break;case"backplot":Nt.append("g").classed("maplayer",!0);break;case"plotbg":Q.bg=Nt.append("path");break;case"radial-grid":Nt.style("fill","none");break;case"angular-grid":Nt.style("fill","none");break;case"radial-line":Nt.append("line").style("fill","none");break;case"angular-line":Nt.append("path").style("fill","none");break}}),Ft.order()},j.updateLayout=function(tt,Z){var st=this,$=st.layers,Q=tt._size,nt=st.getRadial(Z),Y=st.getAngular(Z),q=Z.domain.x,ot=Z.domain.y;st.xOffset=Q.l+Q.w*q[0],st.yOffset=Q.t+Q.h*(1-ot[1]);var it=st.xLength=Q.w*(q[1]-q[0]),dt=st.yLength=Q.h*(ot[1]-ot[0]),wt=st.getSector(Z);st.sectorInRad=wt.map(L);var xt=st.sectorBBox=rt(wt),Ft=xt[2]-xt[0],Et=xt[3]-xt[1],Nt=dt/it,te=Math.abs(Et/Ft),Jt,Qt,Wt,gt,bt;Nt>te?(Jt=it,Qt=it*te,bt=(dt-Qt)/Q.h/2,Wt=[q[0],q[1]],gt=[ot[0]+bt,ot[1]-bt]):(Jt=dt/te,Qt=dt,bt=(it-Jt)/Q.w/2,Wt=[q[0]+bt,q[1]-bt],gt=[ot[0],ot[1]]),st.xLength2=Jt,st.yLength2=Qt,st.xDomain2=Wt,st.yDomain2=gt;var vt=st.xOffset2=Q.l+Q.w*Wt[0],Ut=st.yOffset2=Q.t+Q.h*(1-gt[1]),Kt=st.radius=Jt/Ft,Zt=st.innerRadius=st.getHole(Z)*Kt,le=st.cx=vt-Kt*xt[0],Te=st.cy=Ut+Kt*xt[3],Se=st.cxx=le-vt,Fe=st.cyy=Te-Ut,Oe=nt.side,ur;Oe==="counterclockwise"?(ur=Oe,Oe="top"):Oe==="clockwise"&&(ur=Oe,Oe="bottom"),st.radialAxis=st.mockAxis(tt,Z,nt,{_id:"x",side:Oe,_trueSide:ur,domain:[Zt/Q.w,Kt/Q.w]}),st.angularAxis=st.mockAxis(tt,Z,Y,{side:"right",domain:[0,Math.PI],autorange:!1}),st.doAutoRange(tt,Z),st.updateAngularAxis(tt,Z),st.updateRadialAxis(tt,Z),st.updateRadialAxisTitle(tt,Z),st.xaxis=st.mockCartesianAxis(tt,Z,{_id:"x",domain:Wt}),st.yaxis=st.mockCartesianAxis(tt,Z,{_id:"y",domain:gt});var fr=st.pathSubplot();st.clipPaths.forTraces.select("path").attr("d",fr).attr("transform",e(Se,Fe)),$.frontplot.attr("transform",e(vt,Ut)).call(i.setClipUrl,st._hasClipOnAxisFalse?null:st.clipIds.forTraces,st.gd),$.bg.attr("d",fr).attr("transform",e(le,Te)).call(r.fill,Z.bgcolor)},j.mockAxis=function(tt,Z,st,$){var Q=A.extendFlat({},st,$);return s(Q,Z,tt),Q},j.mockCartesianAxis=function(tt,Z,st){var $=this,Q=$.isSmith,nt=st._id,Y=A.extendFlat({type:"linear"},st);a(Y,tt);var q={x:[0,2],y:[1,3]};return Y.setRange=function(){var ot=$.sectorBBox,it=q[nt],dt=$.radialAxis._rl,wt=(dt[1]-dt[0])/(1-$.getHole(Z));Y.range=[ot[it[0]]*wt,ot[it[1]]*wt]},Y.isPtWithinRange=nt==="x"&&!Q?function(ot){return $.isPtInside(ot)}:function(){return!0},Y.setRange(),Y.setScale(),Y},j.doAutoRange=function(tt,Z){var st=this,$=st.gd,Q=st.radialAxis,nt=st.getRadial(Z);h($,Q);var Y=Q.range;if(nt.range=Y.slice(),nt._input.range=Y.slice(),Q._rl=[Q.r2l(Y[0],null,"gregorian"),Q.r2l(Y[1],null,"gregorian")],Q.minallowed!==void 0){var q=Q.r2l(Q.minallowed);Q._rl[0]>Q._rl[1]?Q._rl[1]=Math.max(Q._rl[1],q):Q._rl[0]=Math.max(Q._rl[0],q)}if(Q.maxallowed!==void 0){var ot=Q.r2l(Q.maxallowed);Q._rl[0]<Q._rl[1]?Q._rl[1]=Math.min(Q._rl[1],ot):Q._rl[0]=Math.min(Q._rl[0],ot)}},j.updateRadialAxis=function(tt,Z){var st=this,$=st.gd,Q=st.layers,nt=st.radius,Y=st.innerRadius,q=st.cx,ot=st.cy,it=st.getRadial(Z),dt=R(st.getSector(Z)[0],360),wt=st.radialAxis,xt=Y<nt,Ft=st.isSmith;Ft||(st.fillViewInitialKey("radialaxis.angle",it.angle),st.fillViewInitialKey("radialaxis.range",wt.range.slice()),wt.setGeometry()),wt.tickangle==="auto"&&dt>90&&dt<=270&&(wt.tickangle=180);var Et=Ft?function(Kt){var Zt=O(st,_([Kt.x,0]));return e(Zt[0]-q,Zt[1]-ot)}:function(Kt){return e(wt.l2p(Kt.x)+Y,0)},Nt=Ft?function(Kt){return I(st,Kt.x,-1/0,1/0)}:function(Kt){return st.pathArc(wt.r2p(Kt.x)+Y)},te=G(it);if(st.radialTickLayout!==te&&(Q["radial-axis"].selectAll(".xtick").remove(),st.radialTickLayout=te),xt){wt.setScale();var Jt=0,Qt=Ft?(wt.tickvals||[]).filter(function(Kt){return Kt>=0}).map(function(Kt){return o.tickText(wt,Kt,!0,!1)}):o.calcTicks(wt),Wt=Ft?Qt:o.clipEnds(wt,Qt),gt=o.getTickSigns(wt)[2];Ft&&((wt.ticks==="top"&&wt.side==="bottom"||wt.ticks==="bottom"&&wt.side==="top")&&(gt=-gt),wt.ticks==="top"&&wt.side==="top"&&(Jt=-wt.ticklen),wt.ticks==="bottom"&&wt.side==="bottom"&&(Jt=wt.ticklen)),o.drawTicks($,wt,{vals:Qt,layer:Q["radial-axis"],path:o.makeTickPath(wt,0,gt),transFn:Et,crisp:!1}),o.drawGrid($,wt,{vals:Wt,layer:Q["radial-grid"],path:Nt,transFn:A.noop,crisp:!1}),o.drawLabels($,wt,{vals:Qt,layer:Q["radial-axis"],transFn:Et,labelFns:o.makeLabelFns(wt,Jt)})}var bt=st.radialAxisAngle=st.vangles?F(ct(L(it.angle),st.vangles)):it.angle,vt=e(q,ot),Ut=vt+t(-bt);lt(Q["radial-axis"],xt&&(it.showticklabels||it.ticks),{transform:Ut}),lt(Q["radial-grid"],xt&&it.showgrid,{transform:Ft?"":vt}),lt(Q["radial-line"].select("line"),xt&&it.showline,{x1:Ft?-nt:Y,y1:0,x2:nt,y2:0,transform:Ut}).attr("stroke-width",it.linewidth).call(r.stroke,it.linecolor)},j.updateRadialAxisTitle=function(tt,Z,st){if(!this.isSmith){var $=this,Q=$.gd,nt=$.radius,Y=$.cx,q=$.cy,ot=$.getRadial(Z),it=$.id+"title",dt=0;if(ot.title){var wt=i.bBox($.layers["radial-axis"].node()).height,xt=ot.title.font.size,Ft=ot.side;dt=Ft==="top"?xt:Ft==="counterclockwise"?-(wt+xt*.4):wt+xt*.8}var Et=st!==void 0?st:$.radialAxisAngle,Nt=L(Et),te=Math.cos(Nt),Jt=Math.sin(Nt),Qt=Y+nt/2*te+dt*Jt,Wt=q-nt/2*Jt+dt*te;$.layers["radial-axis-title"]=y.draw(Q,it,{propContainer:ot,propName:$.id+".radialaxis.title",placeholder:B(Q,"Click to enter radial axis title"),attributes:{x:Qt,y:Wt,"text-anchor":"middle"},transform:{rotate:-Et}})}},j.updateAngularAxis=function(tt,Z){var st=this,$=st.gd,Q=st.layers,nt=st.radius,Y=st.innerRadius,q=st.cx,ot=st.cy,it=st.getAngular(Z),dt=st.angularAxis,wt=st.isSmith;wt||(st.fillViewInitialKey("angularaxis.rotation",it.rotation),dt.setGeometry(),dt.setScale());var xt=wt?function(Zt){var le=O(st,_([0,Zt.x]));return Math.atan2(le[0]-q,le[1]-ot)-Math.PI/2}:function(Zt){return dt.t2g(Zt.x)};dt.type==="linear"&&dt.thetaunit==="radians"&&(dt.tick0=F(dt.tick0),dt.dtick=F(dt.dtick));var Ft=function(Zt){return e(q+nt*Math.cos(Zt),ot-nt*Math.sin(Zt))},Et=wt?function(Zt){var le=O(st,_([0,Zt.x]));return e(le[0],le[1])}:function(Zt){return Ft(xt(Zt))},Nt=wt?function(Zt){var le=O(st,_([0,Zt.x])),Te=Math.atan2(le[0]-q,le[1]-ot)-Math.PI/2;return e(le[0],le[1])+t(-F(Te))}:function(Zt){var le=xt(Zt);return Ft(le)+t(-F(le))},te=wt?function(Zt){return D(st,Zt.x,0,1/0)}:function(Zt){var le=xt(Zt),Te=Math.cos(le),Se=Math.sin(le);return"M"+[q+Y*Te,ot-Y*Se]+"L"+[q+nt*Te,ot-nt*Se]},Jt=o.makeLabelFns(dt,0),Qt=Jt.labelStandoff,Wt={};Wt.xFn=function(Zt){var le=xt(Zt);return Math.cos(le)*Qt},Wt.yFn=function(Zt){var le=xt(Zt),Te=Math.sin(le)>0?.2:1;return-Math.sin(le)*(Qt+Zt.fontSize*Te)+Math.abs(Math.cos(le))*(Zt.fontSize*w)},Wt.anchorFn=function(Zt){var le=xt(Zt),Te=Math.cos(le);return Math.abs(Te)<.1?"middle":Te>0?"start":"end"},Wt.heightFn=function(Zt,le,Te){var Se=xt(Zt);return-.5*(1+Math.sin(Se))*Te};var gt=G(it);st.angularTickLayout!==gt&&(Q["angular-axis"].selectAll("."+dt._id+"tick").remove(),st.angularTickLayout=gt);var bt=wt?[1/0].concat(dt.tickvals||[]).map(function(Zt){return o.tickText(dt,Zt,!0,!1)}):o.calcTicks(dt);wt&&(bt[0].text="∞",bt[0].fontSize*=1.75);var vt;if(Z.gridshape==="linear"?(vt=bt.map(xt),A.angleDelta(vt[0],vt[1])<0&&(vt=vt.slice().reverse())):vt=null,st.vangles=vt,dt.type==="category"&&(bt=bt.filter(function(Zt){return A.isAngleInsideSector(xt(Zt),st.sectorInRad)})),dt.visible){var Ut=dt.ticks==="inside"?-1:1,Kt=(dt.linewidth||1)/2;o.drawTicks($,dt,{vals:bt,layer:Q["angular-axis"],path:"M"+Ut*Kt+",0h"+Ut*dt.ticklen,transFn:Nt,crisp:!1}),o.drawGrid($,dt,{vals:bt,layer:Q["angular-grid"],path:te,transFn:A.noop,crisp:!1}),o.drawLabels($,dt,{vals:bt,layer:Q["angular-axis"],repositionOnUpdate:!0,transFn:Et,labelFns:Wt})}lt(Q["angular-line"].select("path"),it.showline,{d:st.pathSubplot(),transform:e(q,ot)}).attr("stroke-width",it.linewidth).call(r.stroke,it.linecolor)},j.updateFx=function(tt,Z){if(!this.gd._context.staticPlot){var st=!this.isSmith;st&&(this.updateAngularDrag(tt),this.updateRadialDrag(tt,Z,0),this.updateRadialDrag(tt,Z,1)),this.updateHoverAndMainDrag(tt)}},j.updateHoverAndMainDrag=function(tt){var Z=this,st=Z.isSmith,$=Z.gd,Q=Z.layers,nt=tt._zoomlayer,Y=u.MINZOOM,q=u.OFFEDGE,ot=Z.radius,it=Z.innerRadius,dt=Z.cx,wt=Z.cy,xt=Z.cxx,Ft=Z.cyy,Et=Z.sectorInRad,Nt=Z.vangles,te=Z.radialAxis,Jt=f.clampTiny,Qt=f.findXYatLength,Wt=f.findEnclosingVertexAngles,gt=u.cornerHalfWidth,bt=u.cornerLen/2,vt,Ut,Kt=v.makeDragger(Q,"path","maindrag",tt.dragmode===!1?"none":"crosshair");c.select(Kt).attr("d",Z.pathSubplot()).attr("transform",e(dt,wt)),Kt.onmousemove=function(Ze){p.hover($,Ze,Z.id),$._fullLayout._lasthover=Kt,$._fullLayout._hoversubplot=Z.id},Kt.onmouseout=function(Ze){$._dragging||m.unhover($,Ze)};var Zt={element:Kt,gd:$,subplot:Z.id,plotinfo:{id:Z.id,xaxis:Z.xaxis,yaxis:Z.yaxis},xaxes:[Z.xaxis],yaxes:[Z.yaxis]},le,Te,Se,Fe,Oe,ur,fr,We,Lr;function kr(Ze,Ue){return Math.sqrt(Ze*Ze+Ue*Ue)}function he(Ze,Ue){return kr(Ze-xt,Ue-Ft)}function Dt(Ze,Ue){return Math.atan2(Ft-Ue,Ze-xt)}function qt(Ze,Ue){return[Ze*Math.cos(Ue),Ze*Math.sin(-Ue)]}function zt(Ze,Ue){if(Ze===0)return Z.pathSector(2*gt);var mr=bt/Ze,ln=Ue-mr,an=Ue+mr,vn=Math.max(0,Math.min(Ze,ot)),Sn=vn-gt,An=vn+gt;return"M"+qt(Sn,ln)+"A"+[Sn,Sn]+" 0,0,0 "+qt(Sn,an)+"L"+qt(An,an)+"A"+[An,An]+" 0,0,1 "+qt(An,ln)+"Z"}function ut(Ze,Ue,mr){if(Ze===0)return Z.pathSector(2*gt);var ln=qt(Ze,Ue),an=qt(Ze,mr),vn=Jt((ln[0]+an[0])/2),Sn=Jt((ln[1]+an[1])/2),An,pn;if(vn&&Sn){var On=Sn/vn,Nn=-1/On,ke=Qt(gt,On,vn,Sn);An=Qt(bt,Nn,ke[0][0],ke[0][1]),pn=Qt(bt,Nn,ke[1][0],ke[1][1])}else{var ze,je;Sn?(ze=bt,je=gt):(ze=gt,je=bt),An=[[vn-ze,Sn-je],[vn+ze,Sn-je]],pn=[[vn-ze,Sn+je],[vn+ze,Sn+je]]}return"M"+An.join("L")+"L"+pn.reverse().join("L")+"Z"}function yt(){Se=null,Fe=null,Oe=Z.pathSubplot(),ur=!1;var Ze=$._fullLayout[Z.id];fr=g(Ze.bgcolor).getLuminance(),We=v.makeZoombox(nt,fr,dt,wt,Oe),We.attr("fill-rule","evenodd"),Lr=v.makeCorners(nt,dt,wt),b($)}function Mt(Ze,Ue){return Ue=Math.max(Math.min(Ue,ot),it),Ze<q?Ze=0:ot-Ze<q?Ze=ot:Ue<q?Ue=0:ot-Ue<q&&(Ue=ot),Math.abs(Ue-Ze)>Y?(Ze<Ue?(Se=Ze,Fe=Ue):(Se=Ue,Fe=Ze),!0):(Se=null,Fe=null,!1)}function Ot(Ze,Ue){Ze=Ze||Oe,Ue=Ue||"M0,0Z",We.attr("d",Ze),Lr.attr("d",Ue),v.transitionZoombox(We,Lr,ur,fr),ur=!0;var mr={};Re(mr),$.emit("plotly_relayouting",mr)}function $t(Ze,Ue){Ze=Ze*vt,Ue=Ue*Ut;var mr=le+Ze,ln=Te+Ue,an=he(le,Te),vn=Math.min(he(mr,ln),ot),Sn=Dt(le,Te),An,pn;Mt(an,vn)&&(An=Oe+Z.pathSector(Fe),Se&&(An+=Z.pathSector(Se)),pn=zt(Se,Sn)+zt(Fe,Sn)),Ot(An,pn)}function ee(Ze,Ue,mr,ln){var an=f.findIntersectionXY(mr,ln,mr,[Ze-xt,Ft-Ue]);return kr(an[0],an[1])}function we(Ze,Ue){var mr=le+Ze,ln=Te+Ue,an=Dt(le,Te),vn=Dt(mr,ln),Sn=Wt(an,Nt),An=Wt(vn,Nt),pn=ee(le,Te,Sn[0],Sn[1]),On=Math.min(ee(mr,ln,An[0],An[1]),ot),Nn,ke;Mt(pn,On)&&(Nn=Oe+Z.pathSector(Fe),Se&&(Nn+=Z.pathSector(Se)),ke=[ut(Se,Sn[0],Sn[1]),ut(Fe,Sn[0],Sn[1])].join(" ")),Ot(Nn,ke)}function Me(){if(v.removeZoombox($),!(Se===null||Fe===null)){var Ze={};Re(Ze),v.showDoubleClickNotifier($),E.call("_guiRelayout",$,Ze)}}function Re(Ze){var Ue=te._rl,mr=(Ue[1]-Ue[0])/(1-it/ot)/ot,ln=[Ue[0]+(Se-it)*mr,Ue[0]+(Fe-it)*mr];Ze[Z.id+".radialaxis.range"]=ln}function Be(Ze,Ue){var mr=$._fullLayout.clickmode;if(v.removeZoombox($),Ze===2){var ln={};for(var an in Z.viewInitial)ln[Z.id+"."+an]=Z.viewInitial[an];$.emit("plotly_doubleclick",null),E.call("_guiRelayout",$,ln)}mr.indexOf("select")>-1&&Ze===1&&x(Ue,$,[Z.xaxis],[Z.yaxis],Z.id,Zt),mr.indexOf("event")>-1&&p.click($,Ue,Z.id)}Zt.prepFn=function(Ze,Ue,mr){var ln=$._fullLayout.dragmode,an=Kt.getBoundingClientRect();$._fullLayout._calcInverseTransform($);var vn=$._fullLayout._invTransform;vt=$._fullLayout._invScaleX,Ut=$._fullLayout._invScaleY;var Sn=A.apply3DTransform(vn)(Ue-an.left,mr-an.top);if(le=Sn[0],Te=Sn[1],Nt){var An=f.findPolygonOffset(ot,Et[0],Et[1],Nt);le+=xt+An[0],Te+=Ft+An[1]}switch(ln){case"zoom":Zt.clickFn=Be,st||(Nt?Zt.moveFn=we:Zt.moveFn=$t,Zt.doneFn=Me,yt());break;case"select":case"lasso":l(Ze,Ue,mr,Zt,ln);break}},m.init(Zt)},j.updateRadialDrag=function(tt,Z,st){var $=this,Q=$.gd,nt=$.layers,Y=$.radius,q=$.innerRadius,ot=$.cx,it=$.cy,dt=$.radialAxis,wt=u.radialDragBoxSize,xt=wt/2;if(!dt.visible)return;var Ft=L($.radialAxisAngle),Et=dt._rl,Nt=Et[0],te=Et[1],Jt=Et[st],Qt=.75*(Et[1]-Et[0])/(1-$.getHole(Z))/Y,Wt,gt,bt;st?(Wt=ot+(Y+xt)*Math.cos(Ft),gt=it-(Y+xt)*Math.sin(Ft),bt="radialdrag"):(Wt=ot+(q-xt)*Math.cos(Ft),gt=it-(q-xt)*Math.sin(Ft),bt="radialdrag-inner");var vt=v.makeRectDragger(nt,bt,"crosshair",-xt,-xt,wt,wt),Ut={element:vt,gd:Q};tt.dragmode===!1&&(Ut.dragmode=!1),lt(c.select(vt),dt.visible&&q<Y,{transform:e(Wt,gt)});var Kt,Zt,le;function Te(fr,We){if(Kt)Kt(fr,We);else{var Lr=[fr,-We],kr=[Math.cos(Ft),Math.sin(Ft)],he=Math.abs(A.dot(Lr,kr)/Math.sqrt(A.dot(Lr,Lr)));isNaN(he)||(Kt=he<.5?Oe:ur)}var Dt={};Se(Dt),Q.emit("plotly_relayouting",Dt)}function Se(fr){Zt!==null?fr[$.id+".radialaxis.angle"]=Zt:le!==null&&(fr[$.id+".radialaxis.range["+st+"]"]=le)}function Fe(){Zt!==null?E.call("_guiRelayout",Q,$.id+".radialaxis.angle",Zt):le!==null&&E.call("_guiRelayout",Q,$.id+".radialaxis.range["+st+"]",le)}function Oe(fr,We){if(st!==0){var Lr=Wt+fr,kr=gt+We;Zt=Math.atan2(it-kr,Lr-ot),$.vangles&&(Zt=ct(Zt,$.vangles)),Zt=F(Zt);var he=e(ot,it)+t(-Zt);nt["radial-axis"].attr("transform",he),nt["radial-line"].select("line").attr("transform",he);var Dt=$.gd._fullLayout,qt=Dt[$.id];$.updateRadialAxisTitle(Dt,qt,Zt)}}function ur(fr,We){var Lr=A.dot([fr,-We],[Math.cos(Ft),Math.sin(Ft)]);if(le=Jt-Qt*Lr,Qt>0!=(st?le>Nt:le<te)){le=null;return}var kr=Q._fullLayout,he=kr[$.id];dt.range[st]=le,dt._rl[st]=le,$.updateRadialAxis(kr,he),$.xaxis.setRange(),$.xaxis.setScale(),$.yaxis.setRange(),$.yaxis.setScale();var Dt=!1;for(var qt in $.traceHash){var zt=$.traceHash[qt],ut=A.filterVisible(zt),yt=zt[0][0].trace._module;yt.plot(Q,$,ut,he),E.traceIs(qt,"gl")&&ut.length&&(Dt=!0)}Dt&&(T(Q),M(Q))}Ut.prepFn=function(){Kt=null,Zt=null,le=null,Ut.moveFn=Te,Ut.doneFn=Fe,b(Q)},Ut.clampFn=function(fr,We){return Math.sqrt(fr*fr+We*We)<u.MINDRAG&&(fr=0,We=0),[fr,We]},m.init(Ut)},j.updateAngularDrag=function(tt){var Z=this,st=Z.gd,$=Z.layers,Q=Z.radius,nt=Z.angularAxis,Y=Z.cx,q=Z.cy,ot=Z.cxx,it=Z.cyy,dt=u.angularDragBoxSize,wt=v.makeDragger($,"path","angulardrag",tt.dragmode===!1?"none":"move"),xt={element:wt,gd:st};tt.dragmode===!1?xt.dragmode=!1:c.select(wt).attr("d",Z.pathAnnulus(Q,Q+dt)).attr("transform",e(Y,q)).call(S,"move");function Ft(le,Te){return Math.atan2(it+dt-Te,le-ot-dt)}var Et=$.frontplot.select(".scatterlayer").selectAll(".trace"),Nt=Et.selectAll(".point"),te=Et.selectAll(".textpoint"),Jt,Qt,Wt,gt,bt,vt;function Ut(le,Te){var Se=Z.gd._fullLayout,Fe=Se[Z.id],Oe=Jt+le*tt._invScaleX,ur=Qt+Te*tt._invScaleY,fr=Ft(Oe,ur),We=F(fr-vt);if(gt=Wt+We,$.frontplot.attr("transform",e(Z.xOffset2,Z.yOffset2)+t([-We,ot,it])),Z.vangles){bt=Z.radialAxisAngle+We;var Lr=e(Y,q)+t(-We),kr=e(Y,q)+t(-bt);$.bg.attr("transform",Lr),$["radial-grid"].attr("transform",Lr),$["radial-axis"].attr("transform",kr),$["radial-line"].select("line").attr("transform",kr),Z.updateRadialAxisTitle(Se,Fe,bt)}else Z.clipPaths.forTraces.select("path").attr("transform",e(ot,it)+t(We));Nt.each(function(){var Mt=c.select(this),Ot=i.getTranslate(Mt);Mt.attr("transform",e(Ot.x,Ot.y)+t([We]))}),te.each(function(){var Mt=c.select(this),Ot=Mt.select("text"),$t=i.getTranslate(Mt);Mt.attr("transform",t([We,Ot.attr("x"),Ot.attr("y")])+e($t.x,$t.y))}),nt.rotation=A.modHalf(gt,360),Z.updateAngularAxis(Se,Fe),Z._hasClipOnAxisFalse&&!A.isFullCircle(Z.sectorInRad)&&Et.call(i.hideOutsideRangePoints,Z);var he=!1;for(var Dt in Z.traceHash)if(E.traceIs(Dt,"gl")){var qt=Z.traceHash[Dt],zt=A.filterVisible(qt),ut=qt[0][0].trace._module;ut.plot(st,Z,zt,Fe),zt.length&&(he=!0)}he&&(T(st),M(st));var yt={};Kt(yt),st.emit("plotly_relayouting",yt)}function Kt(le){le[Z.id+".angularaxis.rotation"]=gt,Z.vangles&&(le[Z.id+".radialaxis.angle"]=bt)}function Zt(){te.select("text").attr("transform",null);var le={};Kt(le),E.call("_guiRelayout",st,le)}xt.prepFn=function(le,Te,Se){var Fe=tt[Z.id];Wt=Fe.angularaxis.rotation;var Oe=wt.getBoundingClientRect();Jt=Te-Oe.left,Qt=Se-Oe.top,st._fullLayout._calcInverseTransform(st);var ur=A.apply3DTransform(tt._invTransform)(Jt,Qt);Jt=ur[0],Qt=ur[1],vt=Ft(Jt,Qt),xt.moveFn=Ut,xt.doneFn=Zt,b(st)},Z.vangles&&!A.isFullCircle(Z.sectorInRad)&&(xt.prepFn=A.noop,S(c.select(wt),null)),m.init(xt)},j.isPtInside=function(tt){if(this.isSmith)return!0;var Z=this.sectorInRad,st=this.vangles,$=this.angularAxis.c2g(tt.theta),Q=this.radialAxis,nt=Q.c2l(tt.r),Y=Q._rl,q=st?f.isPtInsidePolygon:A.isPtInsideSector;return q(nt,$,Y,Z,st)},j.pathArc=function(tt){var Z=this.sectorInRad,st=this.vangles,$=st?f.pathPolygon:A.pathArc;return $(tt,Z[0],Z[1],st)},j.pathSector=function(tt){var Z=this.sectorInRad,st=this.vangles,$=st?f.pathPolygon:A.pathSector;return $(tt,Z[0],Z[1],st)},j.pathAnnulus=function(tt,Z){var st=this.sectorInRad,$=this.vangles,Q=$?f.pathPolygonAnnulus:A.pathAnnulus;return Q(tt,Z,st[0],st[1],$)},j.pathSubplot=function(){var tt=this.innerRadius,Z=this.radius;return tt?this.pathAnnulus(tt,Z):this.pathSector(Z)},j.fillViewInitialKey=function(tt,Z){tt in this.viewInitial||(this.viewInitial[tt]=Z)};function G(tt){var Z=tt.ticks+String(tt.ticklen)+String(tt.showticklabels);return"side"in tt&&(Z+=tt.side),Z}function rt(tt){var Z=tt[0],st=tt[1],$=st-Z,Q=R(Z,360),nt=Q+$,Y=Math.cos(L(Q)),q=Math.sin(L(Q)),ot=Math.cos(L(nt)),it=Math.sin(L(nt)),dt,wt,xt,Ft;return Q<=90&&nt>=90||Q>90&&nt>=450?Ft=1:q<=0&&it<=0?Ft=0:Ft=Math.max(q,it),Q<=180&&nt>=180||Q>180&&nt>=540?dt=-1:Y>=0&&ot>=0?dt=0:dt=Math.min(Y,ot),Q<=270&&nt>=270||Q>270&&nt>=630?wt=-1:q>=0&&it>=0?wt=0:wt=Math.min(q,it),nt>=360?xt=1:Y<=0&&ot<=0?xt=0:xt=Math.max(Y,ot),[dt,wt,xt,Ft]}function ct(tt,Z){var st=function(Q){return A.angleDist(tt,Q)},$=A.findIndexOfMin(Z,st);return Z[$]}function lt(tt,Z,st){return Z?(tt.attr("display",null),tt.attr(st)):tt&&tt.attr("display","none"),tt}}),$5=Vt((X,V)=>{var c=Hc(),g=Ih(),E=pu().attributes,A=qr().extendFlat,t=su().overrideAll,e=t({color:g.color,showline:A({},g.showline,{dflt:!0}),linecolor:g.linecolor,linewidth:g.linewidth,showgrid:A({},g.showgrid,{dflt:!0}),gridcolor:g.gridcolor,gridwidth:g.gridwidth,griddash:g.griddash},"plot","from-root"),r=t({tickmode:g.minor.tickmode,nticks:g.nticks,tick0:g.tick0,dtick:g.dtick,tickvals:g.tickvals,ticktext:g.ticktext,ticks:g.ticks,ticklen:g.ticklen,tickwidth:g.tickwidth,tickcolor:g.tickcolor,ticklabelstep:g.ticklabelstep,showticklabels:g.showticklabels,labelalias:g.labelalias,showtickprefix:g.showtickprefix,tickprefix:g.tickprefix,showticksuffix:g.showticksuffix,ticksuffix:g.ticksuffix,showexponent:g.showexponent,exponentformat:g.exponentformat,minexponent:g.minexponent,separatethousands:g.separatethousands,tickfont:g.tickfont,tickangle:g.tickangle,tickformat:g.tickformat,tickformatstops:g.tickformatstops,layer:g.layer},"plot","from-root"),i={visible:A({},g.visible,{dflt:!0}),type:A({},g.type,{values:["-","linear","log","date","category"]}),autotypenumbers:g.autotypenumbers,autorangeoptions:{minallowed:g.autorangeoptions.minallowed,maxallowed:g.autorangeoptions.maxallowed,clipmin:g.autorangeoptions.clipmin,clipmax:g.autorangeoptions.clipmax,include:g.autorangeoptions.include,editType:"plot"},autorange:A({},g.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:A({},g.minallowed,{editType:"plot"}),maxallowed:A({},g.maxallowed,{editType:"plot"}),range:A({},g.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:g.categoryorder,categoryarray:g.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:g.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:A({},g.title.text,{editType:"plot",dflt:""}),font:A({},g.title.font,{editType:"plot"}),editType:"plot"},hoverformat:g.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};A(i,e,r);var n={visible:A({},g.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:g.autotypenumbers,categoryorder:g.categoryorder,categoryarray:g.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:g.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};A(n,e,r),V.exports={domain:E({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:c.background},radialaxis:i,angularaxis:n,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),LC=Vt((X,V)=>{var c=qr(),g=vi(),E=Ns(),A=Ld(),t=Ph().getSubplotData,e=l0(),r=xg(),i=Ad(),n=Md(),o=Yy(),a=qm(),s=ob(),h=bg(),v=$5(),m=W5(),p=Yx(),y=p.axisNames;function l(b,S,T,M){var w=T("bgcolor");M.bgColor=g.combine(w,M.paper_bgcolor);var u=T("sector");T("hole");var f=t(M.fullData,p.name,M.id),k=M.layoutOut,_;function D(wt,xt){return T(_+"."+wt,xt)}for(var I=0;I<y.length;I++){_=y[I],c.isPlainObject(b[_])||(b[_]={});var O=b[_],B=E.newContainer(S,_);B._id=B._name=_,B._attr=M.id+"."+_,B._traceIndices=f.map(function(wt){return wt.index});var R=p.axisName2dataArray[_],L=x(O,B,D,f,R,M);o(O,B,D,{axData:f,dataAttr:R});var F=D("visible");switch(m(B,S,k),D("uirevision",S.uirevision),B._m=1,_){case"radialaxis":D("minallowed"),D("maxallowed");var N=D("range"),j=B.getAutorangeDflt(N),G=D("autorange",j),rt;N&&(N[0]===null&&N[1]===null||(N[0]===null||N[1]===null)&&(G==="reversed"||G===!0)||N[0]!==null&&(G==="min"||G==="max reversed")||N[1]!==null&&(G==="max"||G==="min reversed"))&&(N=void 0,delete B.range,B.autorange=!0,rt=!0),rt||(j=B.getAutorangeDflt(N),G=D("autorange",j)),O.autorange=G,G&&(s(D,G,N),(L==="linear"||L==="-")&&D("rangemode"),B.isReversed()&&(B._m=-1)),B.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if(L==="date"){c.log("Polar plots do not support date angular axes yet.");for(var ct=0;ct<f.length;ct++)f[ct].visible=!1;L=O.type=B.type="linear"}D(L==="linear"?"thetaunit":"period");var lt=D("direction");D("rotation",{counterclockwise:0,clockwise:90}[lt]);break}if(n(O,B,D,B.type,{tickSuffixDflt:B.thetaunit==="degrees"?"°":void 0}),F){var tt,Z,st,$,Q,nt,Y,q,ot,it,dt=M.font||{};tt=D("color"),Z=tt===O.color?tt:dt.color,st=dt.size,$=dt.family,Q=dt.weight,nt=dt.style,Y=dt.variant,q=dt.textcase,ot=dt.lineposition,it=dt.shadow,e(O,B,D,B.type),i(O,B,D,B.type,{font:{weight:Q,style:nt,variant:Y,textcase:q,lineposition:ot,shadow:it,color:Z,size:st,family:$},noAutotickangles:_==="angularaxis",noTicklabelshift:!0,noTicklabelstandoff:!0}),r(O,B,D,{outerTicks:!0}),a(O,B,D,{dfltColor:tt,bgColor:M.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:v[_]}),D("layer"),_==="radialaxis"&&(D("side"),D("angle",u[0]),D("title.text"),c.coerceFont(D,"title.font",{weight:Q,style:nt,variant:Y,textcase:q,lineposition:ot,shadow:it,color:Z,size:c.bigFont(st),family:$}))}L!=="category"&&D("hoverformat"),B._input=O}S.angularaxis.type==="category"&&T("gridshape")}function x(b,S,T,M,w,u){var f=T("autotypenumbers",u.autotypenumbersDflt),k=T("type");if(k==="-"){for(var _,D=0;D<M.length;D++)if(M[D].visible){_=M[D];break}_&&_[w]&&(S.type=h(_[w],"gregorian",{noMultiCategory:!0,autotypenumbers:f})),S.type==="-"?S.type="linear":b.type=S.type}return S.type}V.exports=function(b,S,T){A(b,S,T,{type:p.name,attributes:v,handleDefaults:l,font:S.font,autotypenumbersDflt:S.autotypenumbers,paper_bgcolor:S.paper_bgcolor,fullData:T,layoutOut:S})}}),t_=Vt((X,V)=>{var c=Ph().getSubplotCalcData,g=qr().counterRegex,E=X5(),A=Yx(),t=A.attr,e=A.name,r=g(e),i={};i[t]={valType:"subplotid",dflt:e,editType:"calc"};function n(a){for(var s=a._fullLayout,h=a.calcdata,v=s._subplots[e],m=0;m<v.length;m++){var p=v[m],y=c(h,e,p),l=s[p]._subplot;l||(l=E(a,p),s[p]._subplot=l),l.plot(y,s,a._promises)}}function o(a,s,h,v){for(var m=v._subplots[e]||[],p=v._has&&v._has("gl"),y=s._has&&s._has("gl"),l=p&&!y,x=0;x<m.length;x++){var b=m[x],S=v[b]._subplot;if(!s[b]&&S){S.framework.remove(),S.layers["radial-axis-title"].remove();for(var T in S.clipPaths)S.clipPaths[T].remove()}l&&S._scene&&(S._scene.destroy(),S._scene=null)}}V.exports={attr:t,name:e,idRoot:e,idRegex:r,attrRegex:r,attributes:i,layoutAttributes:$5(),supplyLayoutDefaults:LC(),plot:n,clean:o,toSVG:Pc().toSVG}}),Ov=Vt((X,V)=>{var c=Zo().hovertemplateAttrs,g=Zo().texttemplateAttrs,E=po().extendFlat,A=rp(),t=Gu(),e=Ks(),r=t.line;V.exports={mode:t.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:t.text,texttemplate:g({editType:"plot"},{keys:["r","theta","text"]}),hovertext:t.hovertext,line:{color:r.color,width:r.width,dash:r.dash,backoff:r.backoff,shape:E({},r.shape,{values:["linear","spline"]}),smoothing:r.smoothing,editType:"calc"},connectgaps:t.connectgaps,marker:t.marker,cliponaxis:E({},t.cliponaxis,{dflt:!1}),textposition:t.textposition,textfont:t.textfont,fill:E({},t.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:A(),hoverinfo:E({},e.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:t.hoveron,hovertemplate:c(),selected:t.selected,unselected:t.unselected}}),e_=Vt((X,V)=>{var c=qr(),g=Sl(),E=Df(),A=Nf(),t=kg(),e=Uf(),r=ap(),i=_p().PTS_LINESONLY,n=Ov();function o(s,h,v,m){function p(x,b){return c.coerce(s,h,n,x,b)}var y=a(s,h,m,p);if(!y){h.visible=!1;return}p("thetaunit"),p("mode",y<i?"lines+markers":"lines"),p("text"),p("hovertext"),h.hoveron!=="fills"&&p("hovertemplate"),g.hasMarkers(h)&&E(s,h,v,m,p,{gradient:!0}),g.hasLines(h)&&(A(s,h,v,m,p,{backoff:!0}),t(s,h,p),p("connectgaps")),g.hasText(h)&&(p("texttemplate"),e(s,h,m,p));var l=[];(g.hasMarkers(h)||g.hasText(h))&&(p("cliponaxis"),p("marker.maxdisplayed"),l.push("points")),p("fill"),h.fill!=="none"&&(r(s,h,v,p),g.hasLines(h)||t(s,h,p)),(h.fill==="tonext"||h.fill==="toself")&&l.push("fills"),p("hoveron",l.join("+")||"points"),c.coerceSelectionMarkerOpacity(h,p)}function a(s,h,v,m){var p=m("r"),y=m("theta");c.isTypedArray(p)&&(h.r=p=Array.from(p)),c.isTypedArray(y)&&(h.theta=y=Array.from(y));var l;if(p)y?l=Math.min(p.length,y.length):(l=p.length,m("theta0"),m("dtheta"));else{if(!y)return 0;l=h.theta.length,m("r0"),m("dr")}return h._length=l,l}V.exports={handleRThetaDefaults:a,supplyDefaults:o}}),r_=Vt((X,V)=>{var c=qr(),g=ao();V.exports=function(E,A,t){var e={},r=t[A.subplot]._subplot,i,n;r?(i=r.radialAxis,n=r.angularAxis):(r=t[A.subplot],i=r.radialaxis,n=r.angularaxis);var o=i.c2l(E.r);e.rLabel=g.tickText(i,o,!0).text;var a=n.thetaunit==="degrees"?c.rad2deg(E.theta):E.theta;return e.thetaLabel=g.tickText(n,a,!0).text,e}}),CC=Vt((X,V)=>{var c=vo(),g=ts().BADNUM,E=ao(),A=Vf(),t=bp(),e=qf(),r=Hf().calcMarkerSize;V.exports=function(i,n){for(var o=i._fullLayout,a=n.subplot,s=o[a].radialaxis,h=o[a].angularaxis,v=s.makeCalcdata(n,"r"),m=h.makeCalcdata(n,"theta"),p=n._length,y=new Array(p),l=0;l<p;l++){var x=v[l],b=m[l],S=y[l]={};c(x)&&c(b)?(S.r=x,S.theta=b):S.r=g}var T=r(n,p);return n._extremes.x=E.findExtremes(s,v,{ppad:T}),A(i,n),t(y,n),e(y,n),y}}),DC=Vt((X,V)=>{var c=Ag(),g=ts().BADNUM;V.exports=function(E,A,t){for(var e=A.layers.frontplot.select("g.scatterlayer"),r=A.xaxis,i=A.yaxis,n={xaxis:r,yaxis:i,plot:A.framework,layerClipId:A._hasClipOnAxisFalse?A.clipIds.forTraces:null},o=A.radialAxis,a=A.angularAxis,s=0;s<t.length;s++)for(var h=t[s],v=0;v<h.length;v++){v===0&&(h[0].trace._xA=r,h[0].trace._yA=i);var m=h[v],p=m.r;if(p===g)m.x=m.y=g;else{var y=o.c2g(p),l=a.c2g(m.theta);m.x=y*Math.cos(l),m.y=y*Math.sin(l)}}c(E,n,t,e)}}),n_=Vt((X,V)=>{var c=Sg();function g(A,t,e,r){var i=c(A,t,e,r);if(!(!i||i[0].index===!1)){var n=i[0];if(n.index===void 0)return i;var o=A.subplot,a=n.cd[n.index],s=n.trace;if(o.isPtInside(a))return n.xLabelVal=void 0,n.yLabelVal=void 0,E(a,s,o,n),n.hovertemplate=s.hovertemplate,i}}function E(A,t,e,r){var i=e.radialAxis,n=e.angularAxis;i._hovertitle="r",n._hovertitle="θ";var o={};o[t.subplot]={_subplot:e};var a=t._module.formatLabels(A,t,o);r.rLabel=a.rLabel,r.thetaLabel=a.thetaLabel;var s=A.hi||t.hoverinfo,h=[];function v(p,y){h.push(p._hovertitle+": "+y)}if(!t.hovertemplate){var m=s.split("+");m.indexOf("all")!==-1&&(m=["r","theta","text"]),m.indexOf("r")!==-1&&v(i,r.rLabel),m.indexOf("theta")!==-1&&v(n,r.thetaLabel),m.indexOf("text")!==-1&&r.text&&(h.push(r.text),delete r.text),r.extraText=h.join("<br>")}}V.exports={hoverPoints:g,makeHoverPointText:E}}),zC=Vt((X,V)=>{V.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t_(),categories:["polar","symbols","showLegend","scatter-like"],attributes:Ov(),supplyDefaults:e_().supplyDefaults,colorbar:Wh(),formatLabels:r_(),calc:CC(),plot:DC(),style:yf().style,styleOnSelect:yf().styleOnSelect,hoverPoints:n_().hoverPoints,selectPoints:Eg(),meta:{}}}),OC=Vt((X,V)=>{V.exports=zC()}),J5=Vt((X,V)=>{var c=Ov(),g=Ev(),E=Zo().texttemplateAttrs;V.exports={mode:c.mode,r:c.r,theta:c.theta,r0:c.r0,dr:c.dr,theta0:c.theta0,dtheta:c.dtheta,thetaunit:c.thetaunit,text:c.text,texttemplate:E({editType:"plot"},{keys:["r","theta","text"]}),hovertext:c.hovertext,hovertemplate:c.hovertemplate,line:{color:g.line.color,width:g.line.width,dash:g.line.dash,editType:"calc"},connectgaps:g.connectgaps,marker:g.marker,fill:g.fill,fillcolor:g.fillcolor,textposition:g.textposition,textfont:g.textfont,hoverinfo:c.hoverinfo,selected:c.selected,unselected:c.unselected}}),FC=Vt((X,V)=>{var c=qr(),g=Sl(),E=e_().handleRThetaDefaults,A=Df(),t=Nf(),e=Uf(),r=ap(),i=_p().PTS_LINESONLY,n=J5();V.exports=function(o,a,s,h){function v(p,y){return c.coerce(o,a,n,p,y)}var m=E(o,a,h,v);if(!m){a.visible=!1;return}v("thetaunit"),v("mode",m<i?"lines+markers":"lines"),v("text"),v("hovertext"),a.hoveron!=="fills"&&v("hovertemplate"),g.hasMarkers(a)&&A(o,a,s,h,v,{noAngleRef:!0,noStandOff:!0}),g.hasLines(a)&&(t(o,a,s,h,v),v("connectgaps")),g.hasText(a)&&(v("texttemplate"),e(o,a,h,v,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0})),v("fill"),a.fill!=="none"&&r(o,a,s,v),c.coerceSelectionMarkerOpacity(a,v)}}),BC=Vt((X,V)=>{var c=r_();V.exports=function(g,E,A){var t=g.i;return"r"in g||(g.r=E._r[t]),"theta"in g||(g.theta=E._theta[t]),c(g,E,A)}}),RC=Vt((X,V)=>{var c=Vf(),g=Hf().calcMarkerSize,E=L0(),A=ao(),t=qd().TOO_MANY_POINTS;V.exports=function(e,r){var i=e._fullLayout,n=r.subplot,o=i[n].radialaxis,a=i[n].angularaxis,s=r._r=o.makeCalcdata(r,"r"),h=r._theta=a.makeCalcdata(r,"theta"),v=r._length,m={};v<s.length&&(s=s.slice(0,v)),v<h.length&&(h=h.slice(0,v)),m.r=s,m.theta=h,c(e,r);var p=m.opts=E.style(e,r),y;return v<t?y=g(r,v):p.marker&&(y=2*(p.marker.sizeAvg||Math.max(p.marker.size,3))),r._extremes.x=A.findExtremes(o,s,{ppad:y}),[{x:!1,y:!1,t:m,trace:r}]}}),jC=Vt((X,V)=>{var c=Dx(),g=n_().makeHoverPointText;function E(A,t,e,r){var i=A.cd,n=i[0].t,o=n.r,a=n.theta,s=c.hoverPoints(A,t,e,r);if(!(!s||s[0].index===!1)){var h=s[0];if(h.index===void 0)return s;var v=A.subplot,m=h.cd[h.index],p=h.trace;if(m.r=o[h.index],m.theta=a[h.index],!!v.isPtInside(m))return h.xLabelVal=void 0,h.yLabelVal=void 0,g(m,p,v,h),s}}V.exports={hoverPoints:E}}),NC=Vt((X,V)=>{V.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:t_(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:J5(),supplyDefaults:FC(),colorbar:Wh(),formatLabels:BC(),calc:RC(),hoverPoints:jC().hoverPoints,selectPoints:D3(),meta:{}}}),UC=Vt((X,V)=>{var c=Ox(),g=vo(),E=a5(),A=L3(),t=L0(),e=qr(),r=qd().TOO_MANY_POINTS,i={};V.exports=function(n,o,a){if(a.length){var s=o.radialAxis,h=o.angularAxis,v=A(n,o);return a.forEach(function(m){if(!(!m||!m[0]||!m[0].trace)){var p=m[0],y=p.trace,l=p.t,x=y._length,b=l.r,S=l.theta,T=l.opts,M,w=b.slice(),u=S.slice();for(M=0;M<b.length;M++)o.isPtInside({r:b[M],theta:S[M]})||(w[M]=NaN,u[M]=NaN);var f=new Array(x*2),k=Array(x),_=Array(x);for(M=0;M<x;M++){var D=w[M],I,O;if(g(D)){var B=s.c2g(D),R=h.c2g(u[M],y.thetaunit);I=B*Math.cos(R),O=B*Math.sin(R)}else I=O=NaN;k[M]=f[M*2]=I,_[M]=f[M*2+1]=O}l.tree=c(f),T.marker&&x>=r&&(T.marker.cluster=l.tree),T.marker&&(T.markerSel.positions=T.markerUnsel.positions=T.marker.positions=f),T.line&&f.length>1&&e.extendFlat(T.line,t.linePositions(n,y,f)),T.text&&(e.extendFlat(T.text,{positions:f},t.textPosition(n,y,T.text,T.marker)),e.extendFlat(T.textSel,{positions:f},t.textPosition(n,y,T.text,T.markerSel)),e.extendFlat(T.textUnsel,{positions:f},t.textPosition(n,y,T.text,T.markerUnsel))),T.fill&&!v.fill2d&&(v.fill2d=!0),T.marker&&!v.scatter2d&&(v.scatter2d=!0),T.line&&!v.line2d&&(v.line2d=!0),T.text&&!v.glText&&(v.glText=!0),v.lineOptions.push(T.line),v.fillOptions.push(T.fill),v.markerOptions.push(T.marker),v.markerSelectedOptions.push(T.markerSel),v.markerUnselectedOptions.push(T.markerUnsel),v.textOptions.push(T.text),v.textSelectedOptions.push(T.textSel),v.textUnselectedOptions.push(T.textUnsel),v.selectBatch.push([]),v.unselectBatch.push([]),l.x=k,l.y=_,l.rawx=k,l.rawy=_,l.r=b,l.theta=S,l.positions=f,l._scene=v,l.index=v.count,v.count++}}),E(n,o,a)}},V.exports.reglPrecompiled=i}),VC=Vt((X,V)=>{var c=NC();c.plot=UC(),V.exports=c}),qC=Vt((X,V)=>{V.exports=VC()}),Q5=Vt((X,V)=>{var c=Zo().hovertemplateAttrs,g=po().extendFlat,E=Ov(),A=wp();V.exports={r:E.r,theta:E.theta,r0:E.r0,dr:E.dr,theta0:E.theta0,dtheta:E.dtheta,thetaunit:E.thetaunit,base:g({},A.base,{}),offset:g({},A.offset,{}),width:g({},A.width,{}),text:g({},A.text,{}),hovertext:g({},A.hovertext,{}),marker:t(),hoverinfo:E.hoverinfo,hovertemplate:c(),selected:A.selected,unselected:A.unselected};function t(){var e=g({},A.marker);return delete e.cornerradius,e}}),Y5=Vt((X,V)=>{V.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}),HC=Vt((X,V)=>{var c=qr(),g=e_().handleRThetaDefaults,E=s1(),A=Q5();V.exports=function(t,e,r,i){function n(a,s){return c.coerce(t,e,A,a,s)}var o=g(t,e,i,n);if(!o){e.visible=!1;return}n("thetaunit"),n("base"),n("offset"),n("width"),n("text"),n("hovertext"),n("hovertemplate"),E(t,e,n,r,i),c.coerceSelectionMarkerOpacity(e,n)}}),GC=Vt((X,V)=>{var c=qr(),g=Y5();V.exports=function(E,A,t){var e={},r;function i(a,s){return c.coerce(E[r]||{},A[r],g,a,s)}for(var n=0;n<t.length;n++){var o=t[n];o.type==="barpolar"&&o.visible===!0&&(r=o.subplot,e[r]||(i("barmode"),i("bargap"),e[r]=1))}}}),K5=Vt((X,V)=>{var c=pf().hasColorscale,g=df(),E=qr().isArrayOrTypedArray,A=Wm(),t=p0().setGroupPositions,e=qf(),r=Mi().traceIs,i=qr().extendFlat;function n(a,s){for(var h=a._fullLayout,v=s.subplot,m=h[v].radialaxis,p=h[v].angularaxis,y=m.makeCalcdata(s,"r"),l=p.makeCalcdata(s,"theta"),x=s._length,b=new Array(x),S=y,T=l,M=0;M<x;M++)b[M]={p:T[M],s:S[M]};function w(u){var f=s[u];f!==void 0&&(s["_"+u]=E(f)?p.makeCalcdata(s,u):p.d2c(f,s.thetaunit))}return p.type==="linear"&&(w("width"),w("offset")),c(s,"marker")&&g(a,s,{vals:s.marker.color,containerStr:"marker",cLetter:"c"}),c(s,"marker.line")&&g(a,s,{vals:s.marker.line.color,containerStr:"marker.line",cLetter:"c"}),A(b,s),e(b,s),b}function o(a,s,h){for(var v=a.calcdata,m=[],p=0;p<v.length;p++){var y=v[p],l=y[0].trace;l.visible===!0&&r(l,"bar")&&l.subplot===h&&m.push(y)}var x=i({},s.radialaxis,{_id:"x"}),b=s.angularaxis;t(a,b,x,m,{mode:s.barmode,norm:s.barnorm,gap:s.bargap,groupgap:s.bargroupgap})}V.exports={calc:n,crossTraceCalc:o}}),WC=Vt((X,V)=>{var c=Ai(),g=vo(),E=qr(),A=go(),t=Kx();V.exports=function(r,i,n){var o=r._context.staticPlot,a=i.xaxis,s=i.yaxis,h=i.radialAxis,v=i.angularAxis,m=e(i),p=i.layers.frontplot.select("g.barlayer");E.makeTraceGroups(p,n,"trace bars").each(function(){var y=c.select(this),l=E.ensureSingle(y,"g","points"),x=l.selectAll("g.point").data(E.identity);x.enter().append("g").style("vector-effect",o?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),x.exit().remove(),x.each(function(b){var S=c.select(this),T=b.rp0=h.c2p(b.s0),M=b.rp1=h.c2p(b.s1),w=b.thetag0=v.c2g(b.p0),u=b.thetag1=v.c2g(b.p1),f;if(!g(T)||!g(M)||!g(w)||!g(u)||T===M||w===u)f="M0,0Z";else{var k=h.c2g(b.s1),_=(w+u)/2;b.ct=[a.c2p(k*Math.cos(_)),s.c2p(k*Math.sin(_))],f=m(T,M,w,u)}E.ensureSingle(S,"path").attr("d",f)}),A.setClipUrl(y,i._hasClipOnAxisFalse?i.clipIds.forTraces:null,r)})};function e(r){var i=r.cxx,n=r.cyy;return r.vangles?function(o,a,s,h){var v,m;E.angleDelta(s,h)>0?(v=s,m=h):(v=h,m=s);var p=t.findEnclosingVertexAngles(v,r.vangles)[0],y=t.findEnclosingVertexAngles(m,r.vangles)[1],l=[p,(v+m)/2,y];return t.pathPolygonAnnulus(o,a,v,m,l,i,n)}:function(o,a,s,h){return E.pathAnnulus(o,a,s,h,i,n)}}}),ZC=Vt((X,V)=>{var c=Hu(),g=qr(),E=Pg().getTraceColor,A=g.fillText,t=n_().makeHoverPointText,e=Kx().isPtInsidePolygon;V.exports=function(r,i,n){var o=r.cd,a=o[0].trace,s=r.subplot,h=s.radialAxis,v=s.angularAxis,m=s.vangles,p=m?e:g.isPtInsideSector,y=r.maxHoverDistance,l=v._period||2*Math.PI,x=Math.abs(h.g2p(Math.sqrt(i*i+n*n))),b=Math.atan2(n,i);h.range[0]>h.range[1]&&(b+=Math.PI);var S=function(u){return p(x,b,[u.rp0,u.rp1],[u.thetag0,u.thetag1],m)?y+Math.min(1,Math.abs(u.thetag1-u.thetag0)/l)-1+(u.rp1-x)/(u.rp1-u.rp0)-1:1/0};if(c.getClosest(o,S,r),r.index!==!1){var T=r.index,M=o[T];r.x0=r.x1=M.ct[0],r.y0=r.y1=M.ct[1];var w=g.extendFlat({},M,{r:M.s,theta:M.p});return A(M,a,r),t(w,a,s,r),r.hovertemplate=a.hovertemplate,r.color=E(a,M),r.xLabelVal=r.yLabelVal=void 0,M.s<0&&(r.idealAlign="left"),[r]}}}),XC=Vt((X,V)=>{V.exports={moduleType:"trace",name:"barpolar",basePlotModule:t_(),categories:["polar","bar","showLegend"],attributes:Q5(),layoutAttributes:Y5(),supplyDefaults:HC(),supplyLayoutDefaults:GC(),calc:K5().calc,crossTraceCalc:K5().crossTraceCalc,plot:WC(),colorbar:Wh(),formatLabels:r_(),style:Gf().style,styleOnSelect:Gf().styleOnSelect,hoverPoints:ZC(),selectPoints:Ig(),meta:{}}}),$C=Vt((X,V)=>{V.exports=XC()}),tT=Vt((X,V)=>{V.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}),eT=Vt((X,V)=>{var c=Hc(),g=Ih(),E=pu().attributes,A=qr().extendFlat,t=su().overrideAll,e=t({color:g.color,showline:A({},g.showline,{dflt:!0}),linecolor:g.linecolor,linewidth:g.linewidth,showgrid:A({},g.showgrid,{dflt:!0}),gridcolor:g.gridcolor,gridwidth:g.gridwidth,griddash:g.griddash},"plot","from-root"),r=t({ticklen:g.ticklen,tickwidth:A({},g.tickwidth,{dflt:2}),tickcolor:g.tickcolor,showticklabels:g.showticklabels,labelalias:g.labelalias,showtickprefix:g.showtickprefix,tickprefix:g.tickprefix,showticksuffix:g.showticksuffix,ticksuffix:g.ticksuffix,tickfont:g.tickfont,tickformat:g.tickformat,hoverformat:g.hoverformat,layer:g.layer},"plot","from-root"),i=A({visible:A({},g.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:A({},g.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},e,r),n=A({visible:A({},g.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:g.ticks,editType:"calc"},e,r);V.exports={domain:E({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:c.background},realaxis:i,imaginaryaxis:n,editType:"calc"}}),JC=Vt((X,V)=>{var c=qr(),g=vi(),E=Ns(),A=Ld(),t=Ph().getSubplotData,e=Md(),r=Ad(),i=qm(),n=xp(),o=eT(),a=tT(),s=a.axisNames,h=m(function(p){return c.isTypedArray(p)&&(p=Array.from(p)),p.slice().reverse().map(function(y){return-y}).concat([0]).concat(p)},String);function v(p,y,l,x){var b=l("bgcolor");x.bgColor=g.combine(b,x.paper_bgcolor);var S=t(x.fullData,a.name,x.id),T=x.layoutOut,M;function w(j,G){return l(M+"."+j,G)}for(var u=0;u<s.length;u++){M=s[u],c.isPlainObject(p[M])||(p[M]={});var f=p[M],k=E.newContainer(y,M);k._id=k._name=M,k._attr=x.id+"."+M,k._traceIndices=S.map(function(j){return j.index});var _=w("visible");if(k.type="linear",n(k,T),e(f,k,w,k.type),_){var D=M==="realaxis";if(D&&w("side"),D)w("tickvals");else{var I=h(y.realaxis.tickvals||o.realaxis.tickvals.dflt);w("tickvals",I)}c.isTypedArray(k.tickvals)&&(k.tickvals=Array.from(k.tickvals));var O,B,R,L,F=x.font||{};_&&(O=w("color"),B=O===f.color?O:F.color,R=F.size,L=F.family),r(f,k,w,k.type,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noAng:!D,noExp:!0,font:{color:B,size:R,family:L}}),c.coerce2(p,y,o,M+".ticklen"),c.coerce2(p,y,o,M+".tickwidth"),c.coerce2(p,y,o,M+".tickcolor",y.color);var N=w("ticks");N||(delete y[M].ticklen,delete y[M].tickwidth,delete y[M].tickcolor),i(f,k,w,{dfltColor:O,bgColor:x.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:o[M]}),w("layer")}w("hoverformat"),delete k.type,k._input=f}}V.exports=function(p,y,l){A(p,y,l,{noUirevision:!0,type:a.name,attributes:o,handleDefaults:v,font:y.font,paper_bgcolor:y.paper_bgcolor,fullData:l,layoutOut:y})};function m(p,y){var l={};return function(x){var b=y?y(x):x;if(b in l)return l[b];var S=p(x);return l[b]=S,S}}}),QC=Vt((X,V)=>{var c=Ph().getSubplotCalcData,g=qr().counterRegex,E=X5(),A=tT(),t=A.attr,e=A.name,r=g(e),i={};i[t]={valType:"subplotid",dflt:e,editType:"calc"};function n(a){for(var s=a._fullLayout,h=a.calcdata,v=s._subplots[e],m=0;m<v.length;m++){var p=v[m],y=c(h,e,p),l=s[p]._subplot;l||(l=E(a,p,!0),s[p]._subplot=l),l.plot(y,s,a._promises)}}function o(a,s,h,v){for(var m=v._subplots[e]||[],p=0;p<m.length;p++){var y=m[p],l=v[y]._subplot;if(!s[y]&&l){l.framework.remove();for(var x in l.clipPaths)l.clipPaths[x].remove()}}}V.exports={attr:t,name:e,idRoot:e,idRegex:r,attrRegex:r,attributes:i,layoutAttributes:eT(),supplyLayoutDefaults:JC(),plot:n,clean:o,toSVG:Pc().toSVG}}),rT=Vt((X,V)=>{var c=Zo().hovertemplateAttrs,g=Zo().texttemplateAttrs,E=po().extendFlat,A=rp(),t=Gu(),e=Ks(),r=t.line;V.exports={mode:t.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:t.text,texttemplate:g({editType:"plot"},{keys:["real","imag","text"]}),hovertext:t.hovertext,line:{color:r.color,width:r.width,dash:r.dash,backoff:r.backoff,shape:E({},r.shape,{values:["linear","spline"]}),smoothing:r.smoothing,editType:"calc"},connectgaps:t.connectgaps,marker:t.marker,cliponaxis:E({},t.cliponaxis,{dflt:!1}),textposition:t.textposition,textfont:t.textfont,fill:E({},t.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:A(),hoverinfo:E({},e.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:t.hoveron,hovertemplate:c(),selected:t.selected,unselected:t.unselected}}),YC=Vt((X,V)=>{var c=qr(),g=Sl(),E=Df(),A=Nf(),t=kg(),e=Uf(),r=ap(),i=_p().PTS_LINESONLY,n=rT();V.exports=function(a,s,h,v){function m(l,x){return c.coerce(a,s,n,l,x)}var p=o(a,s,v,m);if(!p){s.visible=!1;return}m("mode",p<i?"lines+markers":"lines"),m("text"),m("hovertext"),s.hoveron!=="fills"&&m("hovertemplate"),g.hasMarkers(s)&&E(a,s,h,v,m,{gradient:!0}),g.hasLines(s)&&(A(a,s,h,v,m,{backoff:!0}),t(a,s,m),m("connectgaps")),g.hasText(s)&&(m("texttemplate"),e(a,s,v,m));var y=[];(g.hasMarkers(s)||g.hasText(s))&&(m("cliponaxis"),m("marker.maxdisplayed"),y.push("points")),m("fill"),s.fill!=="none"&&(r(a,s,h,m),g.hasLines(s)||t(a,s,m)),(s.fill==="tonext"||s.fill==="toself")&&y.push("fills"),m("hoveron",y.join("+")||"points"),c.coerceSelectionMarkerOpacity(s,m)};function o(a,s,h,v){var m=v("real"),p=v("imag"),y;return m&&p&&(y=Math.min(m.length,p.length)),c.isTypedArray(m)&&(s.real=m=Array.from(m)),c.isTypedArray(p)&&(s.imag=p=Array.from(p)),s._length=y,y}}),KC=Vt((X,V)=>{var c=ao();V.exports=function(g,E,A){var t={},e=A[E.subplot]._subplot;return t.realLabel=c.tickText(e.radialAxis,g.real,!0).text,t.imagLabel=c.tickText(e.angularAxis,g.imag,!0).text,t}}),tD=Vt((X,V)=>{var c=vo(),g=ts().BADNUM,E=Vf(),A=bp(),t=qf(),e=Hf().calcMarkerSize;V.exports=function(r,i){for(var n=r._fullLayout,o=i.subplot,a=n[o].realaxis,s=n[o].imaginaryaxis,h=a.makeCalcdata(i,"real"),v=s.makeCalcdata(i,"imag"),m=i._length,p=new Array(m),y=0;y<m;y++){var l=h[y],x=v[y],b=p[y]={};c(l)&&c(x)?(b.real=l,b.imag=x):b.real=g}return e(i,m),E(r,i),A(p,i),t(p,i),p}}),eD=Vt((X,V)=>{var c=Ag(),g=ts().BADNUM,E=Z5(),A=E.smith;V.exports=function(t,e,r){for(var i=e.layers.frontplot.select("g.scatterlayer"),n=e.xaxis,o=e.yaxis,a={xaxis:n,yaxis:o,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},s=0;s<r.length;s++)for(var h=r[s],v=0;v<h.length;v++){v===0&&(h[0].trace._xA=n,h[0].trace._yA=o);var m=h[v],p=m.real;if(p===g)m.x=m.y=g;else{var y=A([p,m.imag]);m.x=y[0],m.y=y[1]}}c(t,a,r,i)}}),rD=Vt((X,V)=>{var c=Sg();function g(A,t,e,r){var i=c(A,t,e,r);if(!(!i||i[0].index===!1)){var n=i[0];if(n.index===void 0)return i;var o=A.subplot,a=n.cd[n.index],s=n.trace;if(o.isPtInside(a))return n.xLabelVal=void 0,n.yLabelVal=void 0,E(a,s,o,n),n.hovertemplate=s.hovertemplate,i}}function E(A,t,e,r){var i=e.radialAxis,n=e.angularAxis;i._hovertitle="real",n._hovertitle="imag";var o={};o[t.subplot]={_subplot:e};var a=t._module.formatLabels(A,t,o);r.realLabel=a.realLabel,r.imagLabel=a.imagLabel;var s=A.hi||t.hoverinfo,h=[];function v(p,y){h.push(p._hovertitle+": "+y)}if(!t.hovertemplate){var m=s.split("+");m.indexOf("all")!==-1&&(m=["real","imag","text"]),m.indexOf("real")!==-1&&v(i,r.realLabel),m.indexOf("imag")!==-1&&v(n,r.imagLabel),m.indexOf("text")!==-1&&r.text&&(h.push(r.text),delete r.text),r.extraText=h.join("<br>")}}V.exports={hoverPoints:g,makeHoverPointText:E}}),nD=Vt((X,V)=>{V.exports={moduleType:"trace",name:"scattersmith",basePlotModule:QC(),categories:["smith","symbols","showLegend","scatter-like"],attributes:rT(),supplyDefaults:YC(),colorbar:Wh(),formatLabels:KC(),calc:tD(),plot:eD(),style:yf().style,styleOnSelect:yf().styleOnSelect,hoverPoints:rD().hoverPoints,selectPoints:Eg(),meta:{}}}),aD=Vt((X,V)=>{V.exports=nD()}),sf=Vt((X,V)=>{var c=Gc();function g(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}c(g.prototype,{instance:function(i,n){i=(i||"gregorian").toLowerCase(),n=n||"";var o=this._localCals[i+"-"+n];if(!o&&this.calendars[i]&&(o=new this.calendars[i](n),this._localCals[i+"-"+n]=o),!o)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,i);return o},newDate:function(i,n,o,a,s){return a=(i!=null&&i.year?i.calendar():typeof a=="string"?this.instance(a,s):a)||this.instance(),a.newDate(i,n,o)},substituteDigits:function(i){return function(n){return(n+"").replace(/[0-9]/g,function(o){return i[o]})}},substituteChineseDigits:function(i,n){return function(o){for(var a="",s=0;o>0;){var h=o%10;a=(h===0?"":i[h]+n[s])+a,s++,o=Math.floor(o/10)}return a.indexOf(i[1]+n[1])===0&&(a=a.substr(1)),a||i[0]}}});function E(i,n,o,a){if(this._calendar=i,this._year=n,this._month=o,this._day=a,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function A(i,n){return i=""+i,"000000".substring(0,n-i.length)+i}c(E.prototype,{newDate:function(i,n,o){return this._calendar.newDate(i??this,n,o)},year:function(i){return arguments.length===0?this._year:this.set(i,"y")},month:function(i){return arguments.length===0?this._month:this.set(i,"m")},day:function(i){return arguments.length===0?this._day:this.set(i,"d")},date:function(i,n,o){if(!this._calendar.isValid(i,n,o))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=i,this._month=n,this._day=o,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(i,n){return this._calendar.add(this,i,n)},set:function(i,n){return this._calendar.set(this,i,n)},compareTo:function(i){if(this._calendar.name!==i._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,i._calendar.local.name);var n=this._year!==i._year?this._year-i._year:this._month!==i._month?this.monthOfYear()-i.monthOfYear():this._day-i._day;return n===0?0:n<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(i){return this._calendar.fromJD(i)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(i){return this._calendar.fromJSDate(i)},toString:function(){return(this.year()<0?"-":"")+A(Math.abs(this.year()),4)+"-"+A(this.month(),2)+"-"+A(this.day(),2)}});function t(){this.shortYearCutoff="+10"}c(t.prototype,{_validateLevel:0,newDate:function(i,n,o){return i==null?this.today():(i.year&&(this._validate(i,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate),o=i.day(),n=i.month(),i=i.year()),new E(this,i,n,o))},today:function(){return this.fromJSDate(new Date)},epoch:function(i){var n=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return n.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(i){var n=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(n.year()<0?"-":"")+A(Math.abs(n.year()),4)},monthsInYear:function(i){return this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(i,n){var o=this._validate(i,n,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(o.month()+this.monthsInYear(o)-this.firstMonth)%this.monthsInYear(o)+this.minMonth},fromMonthOfYear:function(i,n){var o=(n+this.firstMonth-2*this.minMonth)%this.monthsInYear(i)+this.minMonth;return this._validate(i,o,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),o},daysInYear:function(i){var n=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(n)?366:365},dayOfYear:function(i,n,o){var a=this._validate(i,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate);return a.toJD()-this.newDate(a.year(),this.fromMonthOfYear(a.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(i,n,o){var a=this._validate(i,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(a))+2)%this.daysInWeek()},extraInfo:function(i,n,o){return this._validate(i,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(i,n,o){return this._validate(i,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(i,this._add(i,n,o),n,o)},_add:function(i,n,o){if(this._validateLevel++,o==="d"||o==="w"){var a=i.toJD()+n*(o==="w"?this.daysInWeek():1),s=i.calendar().fromJD(a);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var h=i.year()+(o==="y"?n:0),v=i.monthOfYear()+(o==="m"?n:0),s=i.day(),m=function(l){for(;v<l.minMonth;)h--,v+=l.monthsInYear(h);for(var x=l.monthsInYear(h);v>x-1+l.minMonth;)h++,v-=x,x=l.monthsInYear(h)};o==="y"?(i.month()!==this.fromMonthOfYear(h,v)&&(v=this.newDate(h,i.month(),this.minDay).monthOfYear()),v=Math.min(v,this.monthsInYear(h)),s=Math.min(s,this.daysInMonth(h,this.fromMonthOfYear(h,v)))):o==="m"&&(m(this),s=Math.min(s,this.daysInMonth(h,this.fromMonthOfYear(h,v))));var p=[h,this.fromMonthOfYear(h,v),s];return this._validateLevel--,p}catch(y){throw this._validateLevel--,y}},_correctAdd:function(i,n,o,a){if(!this.hasYearZero&&(a==="y"||a==="m")&&(n[0]===0||i.year()>0!=n[0]>0)){var s={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[a],h=o<0?-1:1;n=this._add(i,o*s[0]+h*s[1],s[2])}return i.date(n[0],n[1],n[2])},set:function(i,n,o){this._validate(i,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var a=o==="y"?n:i.year(),s=o==="m"?n:i.month(),h=o==="d"?n:i.day();return(o==="y"||o==="m")&&(h=Math.min(h,this.daysInMonth(a,s))),i.date(a,s,h)},isValid:function(i,n,o){this._validateLevel++;var a=this.hasYearZero||i!==0;if(a){var s=this.newDate(i,n,this.minDay);a=n>=this.minMonth&&n-this.minMonth<this.monthsInYear(s)&&o>=this.minDay&&o-this.minDay<this.daysInMonth(s)}return this._validateLevel--,a},toJSDate:function(i,n,o){var a=this._validate(i,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate);return r.instance().fromJD(this.toJD(a)).toJSDate()},fromJSDate:function(i){return this.fromJD(r.instance().fromJSDate(i).toJD())},_validate:function(i,n,o,a){if(i.year){if(this._validateLevel===0&&this.name!==i.calendar().name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,i.calendar().local.name);return i}try{if(this._validateLevel++,this._validateLevel===1&&!this.isValid(i,n,o))throw a.replace(/\{0\}/,this.local.name);var s=this.newDate(i,n,o);return this._validateLevel--,s}catch(h){throw this._validateLevel--,h}}});function e(i){this.local=this.regionalOptions[i]||this.regionalOptions[""]}e.prototype=new t,c(e.prototype,{name:"Gregorian",jdEpoch:17214255e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Gregorian",epochs:["BCE","CE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(o){var n=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),o=n.year()+(n.year()<0?1:0);return o%4===0&&(o%100!==0||o%400===0)},weekOfYear:function(i,n,o){var a=this.newDate(i,n,o);return a.add(4-(a.dayOfWeek()||7),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInMonth:function(i,n){var o=this._validate(i,n,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return this.daysPerMonth[o.month()-1]+(o.month()===2&&this.leapYear(o.year())?1:0)},weekDay:function(i,n,o){return(this.dayOfWeek(i,n,o)||7)<6},toJD:function(i,n,o){var a=this._validate(i,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate);i=a.year(),n=a.month(),o=a.day(),i<0&&i++,n<3&&(n+=12,i--);var s=Math.floor(i/100),h=2-s+Math.floor(s/4);return Math.floor(365.25*(i+4716))+Math.floor(30.6001*(n+1))+o+h-1524.5},fromJD:function(i){var n=Math.floor(i+.5),o=Math.floor((n-186721625e-2)/36524.25);o=n+1+o-Math.floor(o/4);var a=o+1524,s=Math.floor((a-122.1)/365.25),h=Math.floor(365.25*s),v=Math.floor((a-h)/30.6001),m=a-h-Math.floor(v*30.6001),p=v-(v>13.5?13:1),y=s-(p>2.5?4716:4715);return y<=0&&y--,this.newDate(y,p,m)},toJSDate:function(i,n,o){var a=this._validate(i,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(a.year(),a.month()-1,a.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(i){return this.newDate(i.getFullYear(),i.getMonth()+1,i.getDate())}});var r=V.exports=new g;r.cdate=E,r.baseCalendar=t,r.calendars.gregorian=e}),iD=Vt(()=>{var X=Gc(),V=sf();X(V.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),V.local=V.regionalOptions[""],X(V.cdate.prototype,{formatDate:function(c,g){return typeof c!="string"&&(g=c,c=""),this._calendar.formatDate(c||"",this,g)}}),X(V.baseCalendar.prototype,{UNIX_EPOCH:V.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:24*60*60,TICKS_EPOCH:V.instance().jdEpoch,TICKS_PER_DAY:24*60*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(c,g,E){if(typeof c!="string"&&(E=g,g=c,c=""),!g)return"";if(g.calendar()!==this)throw V.local.invalidFormat||V.regionalOptions[""].invalidFormat;c=c||this.local.dateFormat,E=E||{};for(var A=E.dayNamesShort||this.local.dayNamesShort,t=E.dayNames||this.local.dayNames,e=E.monthNumbers||this.local.monthNumbers,r=E.monthNamesShort||this.local.monthNamesShort,i=E.monthNames||this.local.monthNames,n=E.calculateWeek||this.local.calculateWeek,o=function(S,T){for(var M=1;b+M<c.length&&c.charAt(b+M)===S;)M++;return b+=M-1,Math.floor(M/(T||1))>1},a=function(S,T,M,w){var u=""+T;if(o(S,w))for(;u.length<M;)u="0"+u;return u},s=function(S,T,M,w){return o(S)?w[T]:M[T]},h=this,v=function(S){return typeof e=="function"?e.call(h,S,o("m")):y(a("m",S.month(),2))},m=function(S,T){return T?typeof i=="function"?i.call(h,S):i[S.month()-h.minMonth]:typeof r=="function"?r.call(h,S):r[S.month()-h.minMonth]},p=this.local.digits,y=function(S){return E.localNumbers&&p?p(S):S},l="",x=!1,b=0;b<c.length;b++)if(x)c.charAt(b)==="'"&&!o("'")?x=!1:l+=c.charAt(b);else switch(c.charAt(b)){case"d":l+=y(a("d",g.day(),2));break;case"D":l+=s("D",g.dayOfWeek(),A,t);break;case"o":l+=a("o",g.dayOfYear(),3);break;case"w":l+=a("w",g.weekOfYear(),2);break;case"m":l+=v(g);break;case"M":l+=m(g,o("M"));break;case"y":l+=o("y",2)?g.year():(g.year()%100<10?"0":"")+g.year()%100;break;case"Y":o("Y",2),l+=g.formatYear();break;case"J":l+=g.toJD();break;case"@":l+=(g.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":l+=(g.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":o("'")?l+="'":x=!0;break;default:l+=c.charAt(b)}return l},parseDate:function(c,g,E){if(g==null)throw V.local.invalidArguments||V.regionalOptions[""].invalidArguments;if(g=typeof g=="object"?g.toString():g+"",g==="")return null;c=c||this.local.dateFormat,E=E||{};var A=E.shortYearCutoff||this.shortYearCutoff;A=typeof A!="string"?A:this.today().year()%100+parseInt(A,10);for(var t=E.dayNamesShort||this.local.dayNamesShort,e=E.dayNames||this.local.dayNames,r=E.parseMonth||this.local.parseMonth,i=E.monthNumbers||this.local.monthNumbers,n=E.monthNamesShort||this.local.monthNamesShort,o=E.monthNames||this.local.monthNames,a=-1,s=-1,h=-1,v=-1,m=-1,p=!1,y=!1,l=function(D,I){for(var O=1;f+O<c.length&&c.charAt(f+O)===D;)O++;return f+=O-1,Math.floor(O/(I||1))>1},x=function(D,I){var O=l(D,I),B=[2,3,O?4:2,O?4:2,10,11,20]["oyYJ@!".indexOf(D)+1],R=new RegExp("^-?\\d{1,"+B+"}"),L=g.substring(u).match(R);if(!L)throw(V.local.missingNumberAt||V.regionalOptions[""].missingNumberAt).replace(/\{0\}/,u);return u+=L[0].length,parseInt(L[0],10)},b=this,S=function(){if(typeof i=="function"){l("m");var D=i.call(b,g.substring(u));return u+=D.length,D}return x("m")},T=function(D,I,O,B){for(var R=l(D,B)?O:I,L=0;L<R.length;L++)if(g.substr(u,R[L].length).toLowerCase()===R[L].toLowerCase())return u+=R[L].length,L+b.minMonth;throw(V.local.unknownNameAt||V.regionalOptions[""].unknownNameAt).replace(/\{0\}/,u)},M=function(){if(typeof o=="function"){var D=l("M")?o.call(b,g.substring(u)):n.call(b,g.substring(u));return u+=D.length,D}return T("M",n,o)},w=function(){if(g.charAt(u)!==c.charAt(f))throw(V.local.unexpectedLiteralAt||V.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,u);u++},u=0,f=0;f<c.length;f++)if(y)c.charAt(f)==="'"&&!l("'")?y=!1:w();else switch(c.charAt(f)){case"d":v=x("d");break;case"D":T("D",t,e);break;case"o":m=x("o");break;case"w":x("w");break;case"m":h=S();break;case"M":h=M();break;case"y":var k=f;p=!l("y",2),f=k,s=x("y",2);break;case"Y":s=x("Y",2);break;case"J":a=x("J")+.5,g.charAt(u)==="."&&(u++,x("J"));break;case"@":a=x("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":a=x("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":u=g.length;break;case"'":l("'")?w():y=!0;break;default:w()}if(u<g.length)throw V.local.unexpectedText||V.regionalOptions[""].unexpectedText;if(s===-1?s=this.today().year():s<100&&p&&(s+=A===-1?1900:this.today().year()-this.today().year()%100-(s<=A?0:100)),typeof h=="string"&&(h=r.call(this,s,h)),m>-1){h=1,v=m;for(var _=this.daysInMonth(s,h);v>_;_=this.daysInMonth(s,h))h++,v-=_}return a>-1?this.fromJD(a):this.newDate(s,h,v)},determineDate:function(c,g,E,A,t){E&&typeof E!="object"&&(t=A,A=E,E=null),typeof A!="string"&&(t=A,A="");var e=this,r=function(i){try{return e.parseDate(A,i,t)}catch{}i=i.toLowerCase();for(var n=(i.match(/^c/)&&E?E.newDate():null)||e.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,a=o.exec(i);a;)n.add(parseInt(a[1],10),a[2]||"d"),a=o.exec(i);return n};return g=g?g.newDate():null,c=c==null?g:typeof c=="string"?r(c):typeof c=="number"?isNaN(c)||c===1/0||c===-1/0?g:e.today().add(c,"d"):e.newDate(c),c}})}),oD=Vt(()=>{var X=sf(),V=Gc(),c=X.instance();function g(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}g.prototype=new X.baseCalendar,V(g.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(a,s){if(typeof a=="string"){var h=a.match(A);return h?h[0]:""}var v=this._validateYear(a),m=a.month(),p=""+this.toChineseMonth(v,m);return s&&p.length<2&&(p="0"+p),this.isIntercalaryMonth(v,m)&&(p+="i"),p},monthNames:function(a){if(typeof a=="string"){var s=a.match(t);return s?s[0]:""}var h=this._validateYear(a),v=a.month(),m=this.toChineseMonth(h,v),p=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][m-1];return this.isIntercalaryMonth(h,v)&&(p="闰"+p),p},monthNamesShort:function(a){if(typeof a=="string"){var s=a.match(e);return s?s[0]:""}var h=this._validateYear(a),v=a.month(),m=this.toChineseMonth(h,v),p=["一","二","三","四","五","六","七","八","九","十","十一","十二"][m-1];return this.isIntercalaryMonth(h,v)&&(p="闰"+p),p},parseMonth:function(a,s){a=this._validateYear(a);var h=parseInt(s),v;if(isNaN(h))s[0]==="闰"&&(v=!0,s=s.substring(1)),s[s.length-1]==="月"&&(s=s.substring(0,s.length-1)),h=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(s);else{var m=s[s.length-1];v=m==="i"||m==="I"}var p=this.toMonthIndex(a,h,v);return p},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(a,s){if(a.year&&(a=a.year()),typeof a!="number"||a<1888||a>2111)throw s.replace(/\{0\}/,this.local.name);return a},toMonthIndex:function(a,s,h){var v=this.intercalaryMonth(a),m=h&&s!==v;if(m||s<1||s>12)throw X.local.invalidMonth.replace(/\{0\}/,this.local.name);var p;return v?!h&&s<=v?p=s-1:p=s:p=s-1,p},toChineseMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var h=this.intercalaryMonth(a),v=h?12:11;if(s<0||s>v)throw X.local.invalidMonth.replace(/\{0\}/,this.local.name);var m;return h?s<h?m=s+1:m=s:m=s+1,m},intercalaryMonth:function(a){a=this._validateYear(a);var s=r[a-r[0]],h=s>>13;return h},isIntercalaryMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var h=this.intercalaryMonth(a);return!!h&&h===s},leapYear:function(a){return this.intercalaryMonth(a)!==0},weekOfYear:function(a,s,h){var v=this._validateYear(a,X.local.invalidyear),m=i[v-i[0]],p=m>>9&4095,y=m>>5&15,l=m&31,x;x=c.newDate(p,y,l),x.add(4-(x.dayOfWeek()||7),"d");var b=this.toJD(a,s,h)-x.toJD();return 1+Math.floor(b/7)},monthsInYear:function(a){return this.leapYear(a)?13:12},daysInMonth:function(a,s){a.year&&(s=a.month(),a=a.year()),a=this._validateYear(a);var h=r[a-r[0]],v=h>>13,m=v?12:11;if(s>m)throw X.local.invalidMonth.replace(/\{0\}/,this.local.name);var p=h&1<<12-s?30:29;return p},weekDay:function(a,s,h){return(this.dayOfWeek(a,s,h)||7)<6},toJD:function(a,s,h){var v=this._validate(a,p,h,X.local.invalidDate);a=this._validateYear(v.year()),s=v.month(),h=v.day();var m=this.isIntercalaryMonth(a,s),p=this.toChineseMonth(a,s),y=o(a,p,h,m);return c.toJD(y.year,y.month,y.day)},fromJD:function(a){var s=c.fromJD(a),h=n(s.year(),s.month(),s.day()),v=this.toMonthIndex(h.year,h.month,h.isIntercalary);return this.newDate(h.year,v,h.day)},fromString:function(a){var s=a.match(E),h=this._validateYear(+s[1]),v=+s[2],m=!!s[3],p=this.toMonthIndex(h,v,m),y=+s[4];return this.newDate(h,p,y)},add:function(a,s,h){var v=a.year(),m=a.month(),p=this.isIntercalaryMonth(v,m),y=this.toChineseMonth(v,m),l=Object.getPrototypeOf(g.prototype).add.call(this,a,s,h);if(h==="y"){var x=l.year(),b=l.month(),S=this.isIntercalaryMonth(x,y),T=p&&S?this.toMonthIndex(x,y,!0):this.toMonthIndex(x,y,!1);T!==b&&l.month(T)}return l}});var E=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,A=/^\d?\d[iI]?/m,t=/^闰?十?[一二三四五六七八九]?月/m,e=/^闰?十?[一二三四五六七八九]?/m;X.calendars.chinese=g;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],i=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function n(a,s,h,v){var m,p;if(typeof a=="object")m=a,p=s||{};else{var y=typeof a=="number"&&a>=1888&&a<=2111;if(!y)throw new Error("Solar year outside range 1888-2111");var l=typeof s=="number"&&s>=1&&s<=12;if(!l)throw new Error("Solar month outside range 1 - 12");var x=typeof h=="number"&&h>=1&&h<=31;if(!x)throw new Error("Solar day outside range 1 - 31");m={year:a,month:s,day:h},p={}}var b=i[m.year-i[0]],S=m.year<<9|m.month<<5|m.day;p.year=S>=b?m.year:m.year-1,b=i[p.year-i[0]];var T=b>>9&4095,M=b>>5&15,w=b&31,u,f=new Date(T,M-1,w),k=new Date(m.year,m.month-1,m.day);u=Math.round((k-f)/(24*3600*1e3));var _=r[p.year-r[0]],D;for(D=0;D<13;D++){var I=_&1<<12-D?30:29;if(u<I)break;u-=I}var O=_>>13;return!O||D<O?(p.isIntercalary=!1,p.month=1+D):D===O?(p.isIntercalary=!0,p.month=D):(p.isIntercalary=!1,p.month=D),p.day=1+u,p}function o(a,s,h,v,m){var p,y;if(typeof a=="object")y=a,p=s||{};else{var l=typeof a=="number"&&a>=1888&&a<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var x=typeof s=="number"&&s>=1&&s<=12;if(!x)throw new Error("Lunar month outside range 1 - 12");var b=typeof h=="number"&&h>=1&&h<=30;if(!b)throw new Error("Lunar day outside range 1 - 30");var S;typeof v=="object"?(S=!1,p=v):(S=!!v,p={}),y={year:a,month:s,day:h,isIntercalary:S}}var T;T=y.day-1;var M=r[y.year-r[0]],w=M>>13,u;w&&(y.month>w||y.isIntercalary)?u=y.month:u=y.month-1;for(var f=0;f<u;f++){var k=M&1<<12-f?30:29;T+=k}var _=i[y.year-i[0]],D=_>>9&4095,I=_>>5&15,O=_&31,B=new Date(D,I-1,O+T);return p.year=B.getFullYear(),p.month=1+B.getMonth(),p.day=B.getDate(),p}}),sD=Vt(()=>{var X=sf(),V=Gc();function c(g){this.local=this.regionalOptions[g||""]||this.regionalOptions[""]}c.prototype=new X.baseCalendar,V(c.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,X.local.invalidYear),A=E.year()+(E.year()<0?1:0);return A%4===3||A%4===-1},monthsInYear:function(g){return this._validate(g,this.minMonth,this.minDay,X.local.invalidYear||X.regionalOptions[""].invalidYear),13},weekOfYear:function(g,E,A){var t=this.newDate(g,E,A);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(g,E){var A=this._validate(g,E,this.minDay,X.local.invalidMonth);return this.daysPerMonth[A.month()-1]+(A.month()===13&&this.leapYear(A.year())?1:0)},weekDay:function(g,E,A){return(this.dayOfWeek(g,E,A)||7)<6},toJD:function(g,E,A){var t=this._validate(g,E,A,X.local.invalidDate);return g=t.year(),g<0&&g++,t.day()+(t.month()-1)*30+(g-1)*365+Math.floor(g/4)+this.jdEpoch-1},fromJD:function(g){var E=Math.floor(g)+.5-this.jdEpoch,A=Math.floor((E-Math.floor((E+366)/1461))/365)+1;A<=0&&A--,E=Math.floor(g)+.5-this.newDate(A,1,1).toJD();var t=Math.floor(E/30)+1,e=E-(t-1)*30+1;return this.newDate(A,t,e)}}),X.calendars.coptic=c}),lD=Vt(()=>{var X=sf(),V=Gc();function c(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}c.prototype=new X.baseCalendar,V(c.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(E){return this._validate(E,this.minMonth,this.minDay,X.local.invalidYear),!1},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,X.local.invalidYear),13},daysInYear:function(E){return this._validate(E,this.minMonth,this.minDay,X.local.invalidYear),400},weekOfYear:function(E,A,t){var e=this.newDate(E,A,t);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/8)+1},daysInMonth:function(E,A){var t=this._validate(E,A,this.minDay,X.local.invalidMonth);return this.daysPerMonth[t.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(E,A,t){var e=this._validate(E,A,t,X.local.invalidDate);return(e.day()+1)%8},weekDay:function(E,A,t){var e=this.dayOfWeek(E,A,t);return e>=2&&e<=6},extraInfo:function(E,A,t){var e=this._validate(E,A,t,X.local.invalidDate);return{century:g[Math.floor((e.year()-1)/100)+1]||""}},toJD:function(E,A,t){var e=this._validate(E,A,t,X.local.invalidDate);return E=e.year()+(e.year()<0?1:0),A=e.month(),t=e.day(),t+(A>1?16:0)+(A>2?(A-2)*32:0)+(E-1)*400+this.jdEpoch-1},fromJD:function(E){E=Math.floor(E+.5)-Math.floor(this.jdEpoch)-1;var A=Math.floor(E/400)+1;E-=(A-1)*400,E+=E>15?16:0;var t=Math.floor(E/32)+1,e=E-(t-1)*32+1;return this.newDate(A<=0?A-1:A,t,e)}});var g={20:"Fruitbat",21:"Anchovy"};X.calendars.discworld=c}),uD=Vt(()=>{var X=sf(),V=Gc();function c(g){this.local=this.regionalOptions[g||""]||this.regionalOptions[""]}c.prototype=new X.baseCalendar,V(c.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,X.local.invalidYear),A=E.year()+(E.year()<0?1:0);return A%4===3||A%4===-1},monthsInYear:function(g){return this._validate(g,this.minMonth,this.minDay,X.local.invalidYear||X.regionalOptions[""].invalidYear),13},weekOfYear:function(g,E,A){var t=this.newDate(g,E,A);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(g,E){var A=this._validate(g,E,this.minDay,X.local.invalidMonth);return this.daysPerMonth[A.month()-1]+(A.month()===13&&this.leapYear(A.year())?1:0)},weekDay:function(g,E,A){return(this.dayOfWeek(g,E,A)||7)<6},toJD:function(g,E,A){var t=this._validate(g,E,A,X.local.invalidDate);return g=t.year(),g<0&&g++,t.day()+(t.month()-1)*30+(g-1)*365+Math.floor(g/4)+this.jdEpoch-1},fromJD:function(g){var E=Math.floor(g)+.5-this.jdEpoch,A=Math.floor((E-Math.floor((E+366)/1461))/365)+1;A<=0&&A--,E=Math.floor(g)+.5-this.newDate(A,1,1).toJD();var t=Math.floor(E/30)+1,e=E-(t-1)*30+1;return this.newDate(A,t,e)}}),X.calendars.ethiopian=c}),cD=Vt(()=>{var X=sf(),V=Gc();function c(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}c.prototype=new X.baseCalendar,V(c.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,X.local.invalidYear);return this._leapYear(A.year())},_leapYear:function(E){return E=E<0?E+1:E,g(E*7+1,19)<7},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,X.local.invalidYear),this._leapYear(E.year?E.year():E)?13:12},weekOfYear:function(E,A,t){var e=this.newDate(E,A,t);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,X.local.invalidYear);return E=A.year(),this.toJD(E===-1?1:E+1,7,1)-this.toJD(E,7,1)},daysInMonth:function(E,A){return E.year&&(A=E.month(),E=E.year()),this._validate(E,A,this.minDay,X.local.invalidMonth),A===12&&this.leapYear(E)||A===8&&g(this.daysInYear(E),10)===5?30:A===9&&g(this.daysInYear(E),10)===3?29:this.daysPerMonth[A-1]},weekDay:function(E,A,t){return this.dayOfWeek(E,A,t)!==6},extraInfo:function(E,A,t){var e=this._validate(E,A,t,X.local.invalidDate);return{yearType:(this.leapYear(e)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(e)%10-3]}},toJD:function(E,A,t){var e=this._validate(E,A,t,X.local.invalidDate);E=e.year(),A=e.month(),t=e.day();var r=E<=0?E+1:E,i=this.jdEpoch+this._delay1(r)+this._delay2(r)+t+1;if(A<7){for(var n=7;n<=this.monthsInYear(E);n++)i+=this.daysInMonth(E,n);for(var n=1;n<A;n++)i+=this.daysInMonth(E,n)}else for(var n=7;n<A;n++)i+=this.daysInMonth(E,n);return i},_delay1:function(E){var A=Math.floor((235*E-234)/19),t=12084+13753*A,e=A*29+Math.floor(t/25920);return g(3*(e+1),7)<3&&e++,e},_delay2:function(E){var A=this._delay1(E-1),t=this._delay1(E),e=this._delay1(E+1);return e-t===356?2:t-A===382?1:0},fromJD:function(E){E=Math.floor(E)+.5;for(var A=Math.floor((E-this.jdEpoch)*98496/35975351)-1;E>=this.toJD(A===-1?1:A+1,7,1);)A++;for(var t=E<this.toJD(A,1,1)?7:1;E>this.toJD(A,t,this.daysInMonth(A,t));)t++;var e=E-this.toJD(A,t,1)+1;return this.newDate(A,t,e)}});function g(E,A){return E-A*Math.floor(E/A)}X.calendars.hebrew=c}),hD=Vt(()=>{var X=sf(),V=Gc();function c(g){this.local=this.regionalOptions[g||""]||this.regionalOptions[""]}c.prototype=new X.baseCalendar,V(c.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(g){var E=this._validate(g,this.minMonth,this.minDay,X.local.invalidYear);return(E.year()*11+14)%30<11},weekOfYear:function(g,E,A){var t=this.newDate(g,E,A);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(g){return this.leapYear(g)?355:354},daysInMonth:function(g,E){var A=this._validate(g,E,this.minDay,X.local.invalidMonth);return this.daysPerMonth[A.month()-1]+(A.month()===12&&this.leapYear(A.year())?1:0)},weekDay:function(g,E,A){return this.dayOfWeek(g,E,A)!==5},toJD:function(g,E,A){var t=this._validate(g,E,A,X.local.invalidDate);return g=t.year(),E=t.month(),A=t.day(),g=g<=0?g+1:g,A+Math.ceil(29.5*(E-1))+(g-1)*354+Math.floor((3+11*g)/30)+this.jdEpoch-1},fromJD:function(g){g=Math.floor(g)+.5;var E=Math.floor((30*(g-this.jdEpoch)+10646)/10631);E=E<=0?E-1:E;var A=Math.min(12,Math.ceil((g-29-this.toJD(E,1,1))/29.5)+1),t=g-this.toJD(E,A,1)+1;return this.newDate(E,A,t)}}),X.calendars.islamic=c}),fD=Vt(()=>{var X=sf(),V=Gc();function c(g){this.local=this.regionalOptions[g||""]||this.regionalOptions[""]}c.prototype=new X.baseCalendar,V(c.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,X.local.invalidYear),A=E.year()<0?E.year()+1:E.year();return A%4===0},weekOfYear:function(g,E,A){var t=this.newDate(g,E,A);return t.add(4-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(g,E){var A=this._validate(g,E,this.minDay,X.local.invalidMonth);return this.daysPerMonth[A.month()-1]+(A.month()===2&&this.leapYear(A.year())?1:0)},weekDay:function(g,E,A){return(this.dayOfWeek(g,E,A)||7)<6},toJD:function(g,E,A){var t=this._validate(g,E,A,X.local.invalidDate);return g=t.year(),E=t.month(),A=t.day(),g<0&&g++,E<=2&&(g--,E+=12),Math.floor(365.25*(g+4716))+Math.floor(30.6001*(E+1))+A-1524.5},fromJD:function(g){var E=Math.floor(g+.5),A=E+1524,t=Math.floor((A-122.1)/365.25),e=Math.floor(365.25*t),r=Math.floor((A-e)/30.6001),i=r-Math.floor(r<14?1:13),n=t-Math.floor(i>2?4716:4715),o=A-e-Math.floor(30.6001*r);return n<=0&&n--,this.newDate(n,i,o)}}),X.calendars.julian=c}),pD=Vt(()=>{var X=sf(),V=Gc();function c(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}c.prototype=new X.baseCalendar,V(c.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(A){return this._validate(A,this.minMonth,this.minDay,X.local.invalidYear),!1},formatYear:function(A){var t=this._validate(A,this.minMonth,this.minDay,X.local.invalidYear);A=t.year();var e=Math.floor(A/400);A=A%400,A+=A<0?400:0;var r=Math.floor(A/20);return e+"."+r+"."+A%20},forYear:function(A){if(A=A.split("."),A.length<3)throw"Invalid Mayan year";for(var t=0,e=0;e<A.length;e++){var r=parseInt(A[e],10);if(Math.abs(r)>19||e>0&&r<0)throw"Invalid Mayan year";t=t*20+r}return t},monthsInYear:function(A){return this._validate(A,this.minMonth,this.minDay,X.local.invalidYear),18},weekOfYear:function(A,t,e){return this._validate(A,t,e,X.local.invalidDate),0},daysInYear:function(A){return this._validate(A,this.minMonth,this.minDay,X.local.invalidYear),360},daysInMonth:function(A,t){return this._validate(A,t,this.minDay,X.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(A,t,e){var r=this._validate(A,t,e,X.local.invalidDate);return r.day()},weekDay:function(A,t,e){return this._validate(A,t,e,X.local.invalidDate),!0},extraInfo:function(A,t,e){var r=this._validate(A,t,e,X.local.invalidDate),i=r.toJD(),n=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[n[0]-1],haabMonth:n[0],haabDay:n[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(A){A-=this.jdEpoch;var t=g(A+8+17*20,365);return[Math.floor(t/20)+1,g(t,20)]},_toTzolkin:function(A){return A-=this.jdEpoch,[E(A+20,20),E(A+4,13)]},toJD:function(A,t,e){var r=this._validate(A,t,e,X.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(A){A=Math.floor(A)+.5-this.jdEpoch;var t=Math.floor(A/360);A=A%360,A+=A<0?360:0;var e=Math.floor(A/20),r=A%20;return this.newDate(t,e,r)}});function g(A,t){return A-t*Math.floor(A/t)}function E(A,t){return g(A-1,t)+1}X.calendars.mayan=c}),dD=Vt(()=>{var X=sf(),V=Gc();function c(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}c.prototype=new X.baseCalendar;var g=X.instance("gregorian");V(c.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,X.local.invalidYear||X.regionalOptions[""].invalidYear);return g.leapYear(A.year()+(A.year()<1?1:0)+1469)},weekOfYear:function(E,A,t){var e=this.newDate(E,A,t);return e.add(1-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(E,A){var t=this._validate(E,A,this.minDay,X.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===12&&this.leapYear(t.year())?1:0)},weekDay:function(E,A,t){return(this.dayOfWeek(E,A,t)||7)<6},toJD:function(r,A,t){var e=this._validate(r,A,t,X.local.invalidMonth),r=e.year();r<0&&r++;for(var i=e.day(),n=1;n<e.month();n++)i+=this.daysPerMonth[n-1];return i+g.toJD(r+1468,3,13)},fromJD:function(E){E=Math.floor(E+.5);for(var A=Math.floor((E-(this.jdEpoch-1))/366);E>=this.toJD(A+1,1,1);)A++;for(var t=E-Math.floor(this.toJD(A,1,1)+.5)+1,e=1;t>this.daysInMonth(A,e);)t-=this.daysInMonth(A,e),e++;return this.newDate(A,e,t)}}),X.calendars.nanakshahi=c}),gD=Vt(()=>{var X=sf(),V=Gc();function c(g){this.local=this.regionalOptions[g||""]||this.regionalOptions[""]}c.prototype=new X.baseCalendar,V(c.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(g){return this.daysInYear(g)!==this.daysPerYear},weekOfYear:function(g,E,A){var t=this.newDate(g,E,A);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(g){var E=this._validate(g,this.minMonth,this.minDay,X.local.invalidYear);if(g=E.year(),typeof this.NEPALI_CALENDAR_DATA[g]>"u")return this.daysPerYear;for(var A=0,t=this.minMonth;t<=12;t++)A+=this.NEPALI_CALENDAR_DATA[g][t];return A},daysInMonth:function(g,E){return g.year&&(E=g.month(),g=g.year()),this._validate(g,E,this.minDay,X.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[g]>"u"?this.daysPerMonth[E-1]:this.NEPALI_CALENDAR_DATA[g][E]},weekDay:function(g,E,A){return this.dayOfWeek(g,E,A)!==6},toJD:function(g,E,A){var t=this._validate(g,E,A,X.local.invalidDate);g=t.year(),E=t.month(),A=t.day();var e=X.instance(),r=0,i=E,n=g;this._createMissingCalendarData(g);var o=g-(i>9||i===9&&A>=this.NEPALI_CALENDAR_DATA[n][0]?56:57);for(E!==9&&(r=A,i--);i!==9;)i<=0&&(i=12,n--),r+=this.NEPALI_CALENDAR_DATA[n][i],i--;return E===9?(r+=A-this.NEPALI_CALENDAR_DATA[n][0],r<0&&(r+=e.daysInYear(o))):r+=this.NEPALI_CALENDAR_DATA[n][9]-this.NEPALI_CALENDAR_DATA[n][0],e.newDate(o,1,1).add(r,"d").toJD()},fromJD:function(g){var E=X.instance(),A=E.fromJD(g),t=A.year(),e=A.dayOfYear(),r=t+56;this._createMissingCalendarData(r);for(var i=9,n=this.NEPALI_CALENDAR_DATA[r][0],o=this.NEPALI_CALENDAR_DATA[r][i]-n+1;e>o;)i++,i>12&&(i=1,r++),o+=this.NEPALI_CALENDAR_DATA[r][i];var a=this.NEPALI_CALENDAR_DATA[r][i]-(o-e);return this.newDate(r,i,a)},_createMissingCalendarData:function(g){var E=this.daysPerMonth.slice(0);E.unshift(17);for(var A=g-1;A<g+2;A++)typeof this.NEPALI_CALENDAR_DATA[A]>"u"&&(this.NEPALI_CALENDAR_DATA[A]=E)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),X.calendars.nepali=c}),mD=Vt(()=>{var X=sf(),V=Gc();function c(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}c.prototype=new X.baseCalendar,V(c.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Chæharshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Chæ","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,X.local.invalidYear);return((A.year()-(A.year()>0?474:473))%2820+474+38)*682%2816<682},weekOfYear:function(E,A,t){var e=this.newDate(E,A,t);return e.add(-((e.dayOfWeek()+1)%7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(E,A){var t=this._validate(E,A,this.minDay,X.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===12&&this.leapYear(t.year())?1:0)},weekDay:function(E,A,t){return this.dayOfWeek(E,A,t)!==5},toJD:function(E,A,t){var e=this._validate(E,A,t,X.local.invalidDate);E=e.year(),A=e.month(),t=e.day();var r=E-(E>=0?474:473),i=474+g(r,2820);return t+(A<=7?(A-1)*31:(A-1)*30+6)+Math.floor((i*682-110)/2816)+(i-1)*365+Math.floor(r/2820)*1029983+this.jdEpoch-1},fromJD:function(E){E=Math.floor(E)+.5;var A=E-this.toJD(475,1,1),t=Math.floor(A/1029983),e=g(A,1029983),r=2820;if(e!==1029982){var i=Math.floor(e/366),n=g(e,366);r=Math.floor((2134*i+2816*n+2815)/1028522)+i+1}var o=r+2820*t+474;o=o<=0?o-1:o;var a=E-this.toJD(o,1,1)+1,s=a<=186?Math.ceil(a/31):Math.ceil((a-6)/30),h=E-this.toJD(o,s,1)+1;return this.newDate(o,s,h)}});function g(E,A){return E-A*Math.floor(E/A)}X.calendars.persian=c,X.calendars.jalali=c}),vD=Vt(()=>{var X=sf(),V=Gc(),c=X.instance();function g(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}g.prototype=new X.baseCalendar,V(g.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var A=this._validate(t,this.minMonth,this.minDay,X.local.invalidYear),t=this._t2gYear(A.year());return c.leapYear(t)},weekOfYear:function(r,A,t){var e=this._validate(r,this.minMonth,this.minDay,X.local.invalidYear),r=this._t2gYear(e.year());return c.weekOfYear(r,e.month(),e.day())},daysInMonth:function(E,A){var t=this._validate(E,A,this.minDay,X.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===2&&this.leapYear(t.year())?1:0)},weekDay:function(E,A,t){return(this.dayOfWeek(E,A,t)||7)<6},toJD:function(r,A,t){var e=this._validate(r,A,t,X.local.invalidDate),r=this._t2gYear(e.year());return c.toJD(r,e.month(),e.day())},fromJD:function(E){var A=c.fromJD(E),t=this._g2tYear(A.year());return this.newDate(t,A.month(),A.day())},_t2gYear:function(E){return E+this.yearsOffset+(E>=-this.yearsOffset&&E<=-1?1:0)},_g2tYear:function(E){return E-this.yearsOffset-(E>=1&&E<=this.yearsOffset?1:0)}}),X.calendars.taiwan=g}),yD=Vt(()=>{var X=sf(),V=Gc(),c=X.instance();function g(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}g.prototype=new X.baseCalendar,V(g.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var A=this._validate(t,this.minMonth,this.minDay,X.local.invalidYear),t=this._t2gYear(A.year());return c.leapYear(t)},weekOfYear:function(r,A,t){var e=this._validate(r,this.minMonth,this.minDay,X.local.invalidYear),r=this._t2gYear(e.year());return c.weekOfYear(r,e.month(),e.day())},daysInMonth:function(E,A){var t=this._validate(E,A,this.minDay,X.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===2&&this.leapYear(t.year())?1:0)},weekDay:function(E,A,t){return(this.dayOfWeek(E,A,t)||7)<6},toJD:function(r,A,t){var e=this._validate(r,A,t,X.local.invalidDate),r=this._t2gYear(e.year());return c.toJD(r,e.month(),e.day())},fromJD:function(E){var A=c.fromJD(E),t=this._g2tYear(A.year());return this.newDate(t,A.month(),A.day())},_t2gYear:function(E){return E-this.yearsOffset-(E>=1&&E<=this.yearsOffset?1:0)},_g2tYear:function(E){return E+this.yearsOffset+(E>=-this.yearsOffset&&E<=-1?1:0)}}),X.calendars.thai=g}),xD=Vt(()=>{var X=sf(),V=Gc();function c(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}c.prototype=new X.baseCalendar,V(c.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,X.local.invalidYear);return this.daysInYear(A.year())===355},weekOfYear:function(E,A,t){var e=this.newDate(E,A,t);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(E){for(var A=0,t=1;t<=12;t++)A+=this.daysInMonth(E,t);return A},daysInMonth:function(E,A){for(var t=this._validate(E,A,this.minDay,X.local.invalidMonth),e=t.toJD()-24e5+.5,r=0,i=0;i<g.length;i++){if(g[i]>e)return g[r]-g[r-1];r++}return 30},weekDay:function(E,A,t){return this.dayOfWeek(E,A,t)!==5},toJD:function(E,A,t){var e=this._validate(E,A,t,X.local.invalidDate),r=12*(e.year()-1)+e.month()-15292,i=e.day()+g[r-1]-1;return i+24e5-.5},fromJD:function(E){for(var A=E-24e5+.5,t=0,e=0;e<g.length&&!(g[e]>A);e++)t++;var r=t+15292,i=Math.floor((r-1)/12),n=i+1,o=r-12*i,a=A-g[t-1]+1;return this.newDate(n,o,a)},isValid:function(E,A,t){var e=X.baseCalendar.prototype.isValid.apply(this,arguments);return e&&(E=E.year!=null?E.year:E,e=E>=1276&&E<=1500),e},_validate:function(E,A,t,e){var r=X.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw e.replace(/\{0\}/,this.local.name);return r}}),X.calendars.ummalqura=c;var g=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}),_D=Vt((X,V)=>{V.exports=sf(),iD(),oD(),sD(),lD(),uD(),cD(),hD(),fD(),pD(),dD(),gD(),mD(),vD(),yD(),xD()}),bD=Vt((X,V)=>{var c=_D(),g=qr(),E=ts(),A=E.EPOCHJD,t=E.ONEDAY,e={valType:"enumerated",values:g.sortObjectKeys(c.calendars),editType:"calc",dflt:"gregorian"},r=function(M,w,u,f){var k={};return k[u]=e,g.coerce(M,w,k,u,f)},i=function(M,w,u,f){for(var k=0;k<u.length;k++)r(M,w,u[k]+"calendar",f.calendar)},n={chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},o={chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},a={chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},s="##",h={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:s,w:s,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}};function v(M,w,u){for(var f=Math.floor((w+.05)/t)+A,k=p(u).fromJD(f),_=0,D,I,O,B,R;(_=M.indexOf("%",_))!==-1;)D=M.charAt(_+1),D==="0"||D==="-"||D==="_"?(O=3,I=M.charAt(_+2),D==="_"&&(D="-")):(I=D,D="0",O=2),B=h[I],B?(B===s?R=s:R=k.formatDate(B[D]),M=M.substr(0,_)+R+M.substr(_+O),_+=R.length):_+=O;return M}var m={};function p(M){var w=m[M];return w||(w=m[M]=c.instance(M),w)}function y(M){return g.extendFlat({},e,{description:M})}function l(M){return"Sets the calendar system to use with `"+M+"` date data."}var x={xcalendar:y(l("x"))},b=g.extendFlat({},x,{ycalendar:y(l("y"))}),S=g.extendFlat({},b,{zcalendar:y(l("z"))}),T=y(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));V.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:b,bar:b,box:b,heatmap:b,contour:b,histogram:b,histogram2d:b,histogram2dcontour:b,scatter3d:S,surface:S,mesh3d:S,scattergl:b,ohlc:x,candlestick:x},layout:{calendar:y(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:T},yaxis:{calendar:T},scene:{xaxis:{calendar:T},yaxis:{calendar:T},zaxis:{calendar:T}},polar:{radialaxis:{calendar:T}}}},layoutAttributes:e,handleDefaults:r,handleTraceDefaults:i,CANONICAL_SUNDAY:o,CANONICAL_TICK:n,DFLTRANGE:a,getCal:p,worldCalFmt:v}}),wD=Vt((X,V)=>{V.exports=bD()}),TD=Vt((X,V)=>{var c=yA();c.register([wA(),AA(),PA(),zA(),RA(),VA(),GA(),rM(),hM(),wM(),CM(),j6(),G6(),LS(),NS(),XS(),eE(),_E(),kE(),ME(),IE(),OE(),NE(),HE(),i8(),l8(),qP(),aI(),fI(),yI(),EI(),CI(),NI(),KI(),nL(),hL(),ML(),CL(),jL(),lC(),mC(),bC(),MC(),IC(),OC(),qC(),$C(),aD(),wD()]),V.exports=c});return TD()})();/*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <https://feross.org>
|
||
* @license MIT
|
||
*//*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *//*!
|
||
* Determine if an object is a Buffer
|
||
*
|
||
* @author Feross Aboukhadijeh <https://feross.org>
|
||
* @license MIT
|
||
*//*!
|
||
* pad-left <https://github.com/jonschlinkert/pad-left>
|
||
*
|
||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||
* Licensed under the MIT license.
|
||
*//*!
|
||
* repeat-string <https://github.com/jonschlinkert/repeat-string>
|
||
*
|
||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||
* Licensed under the MIT License.
|
||
*//*! Bundled license information:
|
||
|
||
native-promise-only/lib/npo.src.js:
|
||
(*! Native Promise Only
|
||
v0.8.1 (c) Kyle Simpson
|
||
MIT License: http://getify.mit-license.org
|
||
*)
|
||
|
||
polybooljs/index.js:
|
||
(*
|
||
* @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc
|
||
* @license MIT
|
||
* @preserve Project Home: https://github.com/voidqk/polybooljs
|
||
*)
|
||
|
||
ieee754/index.js:
|
||
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||
|
||
buffer/index.js:
|
||
(*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <https://feross.org>
|
||
* @license MIT
|
||
*)
|
||
|
||
safe-buffer/index.js:
|
||
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||
|
||
assert/build/internal/util/comparisons.js:
|
||
(*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||
* @license MIT
|
||
*)
|
||
|
||
object-assign/index.js:
|
||
(*
|
||
object-assign
|
||
(c) Sindre Sorhus
|
||
@license MIT
|
||
*)
|
||
|
||
maplibre-gl/dist/maplibre-gl.js:
|
||
(**
|
||
* MapLibre GL JS
|
||
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt
|
||
*)
|
||
*/return window.Plotly=mf,mf})})(MT);var lz=MT.exports;const AT=sz(lz),{SvelteComponent:uz,attr:cz,binding_callbacks:hz,detach:fz,element:pz,flush:N_,init:dz,insert:gz,noop:U_,safe_not_equal:mz}=window.__gradio__svelte__internal,{afterUpdate:vz,createEventDispatcher:yz}=window.__gradio__svelte__internal;function xz(Yf){let vh;return{c(){vh=pz("div"),cz(vh,"data-testid","plotly")},m(mf,Lf){gz(mf,vh,Lf),Yf[4](vh)},p:U_,i:U_,o:U_,d(mf){mf&&fz(vh),Yf[4](null)}}}function _z(Yf,vh,mf){let Lf,{value:cg}=vh,{show_label:hg}=vh,{loaded_plotly_css:n0=!1}=vh,yp,a0;const Em=yz();function Ey(){if(!n0){a0=document.getElementById("plotly.js-style-global");const hu=a0.cloneNode();yp.appendChild(hu);for(const Py of a0.sheet.cssRules)hu.sheet.insertRule(Py.cssText);mf(1,n0=!0)}}vz(async()=>{Ey();let hu=JSON.parse(Lf);hu.config=hu.config||{},hu.config.responsive=!0,hu.responsive=!0,hu.layout.autosize=!0,hu.layout.margin==null&&(hu.layout.margin={}),hu.layout.title&&hg&&(hu.layout.margin.t=Math.max(100,hu.layout.margin.t||0)),hu.layout.margin.autoexpand=!0,AT.react(yp,hu.data,hu.layout,hu.config),AT.Plots.resize(yp),yp.on("plotly_afterplot",()=>{Em("load")})});function Pm(hu){hz[hu?"unshift":"push"](()=>{yp=hu,mf(0,yp)})}return Yf.$$set=hu=>{"value"in hu&&mf(2,cg=hu.value),"show_label"in hu&&mf(3,hg=hu.show_label),"loaded_plotly_css"in hu&&mf(1,n0=hu.loaded_plotly_css)},Yf.$$.update=()=>{Yf.$$.dirty&4&&(Lf=cg?.plot)},[yp,n0,cg,hg,Pm]}class Tz extends uz{constructor(vh){super(),dz(this,vh,_z,xz,mz,{value:2,show_label:3,loaded_plotly_css:1})}get value(){return this.$$.ctx[2]}set value(vh){this.$$set({value:vh}),N_()}get show_label(){return this.$$.ctx[3]}set show_label(vh){this.$$set({show_label:vh}),N_()}get loaded_plotly_css(){return this.$$.ctx[1]}set loaded_plotly_css(vh){this.$$set({loaded_plotly_css:vh}),N_()}}export{Tz as default};
|
||
//# sourceMappingURL=PlotlyPlot-DSYhxG2K.js.map
|